Skip to content

Commit 6c21786

Browse files
authored
Re-enabled popup controls and snippets. (#2156)
1 parent cc76d74 commit 6c21786

File tree

7 files changed

+281
-99
lines changed

7 files changed

+281
-99
lines changed

package-lock.json

Lines changed: 109 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
"@braintree/sanitize-url": "6.0.2",
7979
"@microsoft/applicationinsights-web": "^2.8.11",
8080
"@monaco-editor/loader": "^1.3.2",
81-
"@paperbits/azure": "0.1.576",
82-
"@paperbits/common": "0.1.576",
83-
"@paperbits/core": "0.1.576",
84-
"@paperbits/forms": "0.1.576",
85-
"@paperbits/prosemirror": "0.1.576",
86-
"@paperbits/styles": "0.1.576",
81+
"@paperbits/azure": "0.1.580",
82+
"@paperbits/common": "0.1.580",
83+
"@paperbits/core": "0.1.580",
84+
"@paperbits/forms": "0.1.580",
85+
"@paperbits/prosemirror": "0.1.580",
86+
"@paperbits/styles": "0.1.580",
8787
"@webcomponents/custom-elements": "1.5.1",
8888
"@webcomponents/shadydom": "^1.10.0",
8989
"client-oauth2": "4.3.3",

src/components/staticSettingsProvider.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import * as Objects from "@paperbits/common/objects";
12
import { ISettingsProvider } from "@paperbits/common/configuration";
23

34
export class StaticSettingsProvider implements ISettingsProvider {
45
constructor(private readonly configuration: Object) { }
56

6-
public getSetting<T>(name: string): Promise<T> {
7-
return this.configuration[name];
7+
public getSetting<T>(path: string): Promise<T> {
8+
return Objects.getObjectAt(path, this.configuration);
89
}
910

10-
public async setSetting<T>(name: string, value: T): Promise<void> {
11-
this.configuration[name] = value;
11+
public async setSetting<T>(path: string, value: T): Promise<void> {
12+
Objects.setValue(path, this.configuration, value);
13+
this.configuration[path] = value;
1214
}
1315

1416
public async getSettings<T>(): Promise<T> {

src/config.design.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
"managementApiUrl": "https://<service-name>.management.azure-api.net",
44
"managementApiAccessToken": "SharedAccessSignature ...",
55
"backendUrl": "https://<service-name>.developer.azure-api.net",
6-
"useHipCaptcha": false
6+
"useHipCaptcha": false,
7+
"integration": {
8+
"googleFonts": {
9+
"apiKey": "<Google API Key>"
10+
}
11+
}
712
}

src/libraries/block-snippets.json

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@
4848
"key": "blocks/new-popup-template",
4949
"title": "New popup template",
5050
"type": "popup"
51+
},
52+
"heading-block-1": {
53+
"type": "layout-section",
54+
"key": "blocks/heading-block-1",
55+
"title": "Feature block 5",
56+
"description": "",
57+
"contentKey": "files/heading-block-1",
58+
"imports": [
59+
"styles/colors/semi-trsp-lt-bg",
60+
"styles/components/button/no-border",
61+
"popups/main-menu-popup",
62+
"files/main-menu-popup"
63+
]
5164
}
5265
},
5366
"popups": {
@@ -1581,6 +1594,146 @@
15811594
}
15821595
]
15831596
},
1597+
"heading-block-1": {
1598+
"type": "layout-section",
1599+
"styles": {
1600+
"instance": {
1601+
"key": "awgovjdnwn"
1602+
}
1603+
},
1604+
"nodes": [
1605+
{
1606+
"type": "grid",
1607+
"nodes": [
1608+
{
1609+
"type": "grid-cell",
1610+
"nodes": [
1611+
{
1612+
"type": "picture",
1613+
"width": 80,
1614+
"height": 80,
1615+
"caption": "Logo",
1616+
"styles": {
1617+
"appearance": "components/picture/default"
1618+
},
1619+
"hyperlink": {
1620+
"target": "_self",
1621+
"targetKey": "pages/e0987ca1-f458-b546-7697-7be594b35583"
1622+
}
1623+
},
1624+
{
1625+
"type": "menu",
1626+
"navigationItemKey": "main",
1627+
"layout": "horizontal",
1628+
"styles": {
1629+
"appearance": "components/menu/default",
1630+
"instance": {
1631+
"display": {
1632+
"md": "inline-block",
1633+
"xs": "none"
1634+
}
1635+
}
1636+
},
1637+
"roles": null
1638+
},
1639+
{
1640+
"type": "button",
1641+
"label": "",
1642+
"styles": {
1643+
"appearance": "components/button/no-border",
1644+
"instance": {
1645+
"display": {
1646+
"xs": "inline-block",
1647+
"md": "none"
1648+
}
1649+
}
1650+
},
1651+
"roles": null,
1652+
"hyperlink": {
1653+
"target": "_popup",
1654+
"targetKey": "popups/main-menu-popup"
1655+
}
1656+
}
1657+
],
1658+
"role": "article",
1659+
"styles": {
1660+
"instance": {
1661+
"grid-cell": {
1662+
"xs": {
1663+
"position": {
1664+
"col": 1,
1665+
"row": 1
1666+
},
1667+
"span": {
1668+
"cols": 1,
1669+
"rows": 1
1670+
},
1671+
"alignment": {
1672+
"vertical": "center",
1673+
"horizontal": "between"
1674+
}
1675+
},
1676+
"xl": {
1677+
"alignment": {
1678+
"vertical": "center",
1679+
"horizontal": "between"
1680+
}
1681+
},
1682+
"md": {
1683+
"alignment": {
1684+
"vertical": "center",
1685+
"horizontal": "between"
1686+
}
1687+
},
1688+
"lg": {
1689+
"alignment": {
1690+
"vertical": "center",
1691+
"horizontal": "between"
1692+
}
1693+
}
1694+
},
1695+
"padding": {
1696+
"xs": {
1697+
"top": 10,
1698+
"bottom": 10,
1699+
"left": 10,
1700+
"right": 10
1701+
}
1702+
}
1703+
}
1704+
}
1705+
}
1706+
],
1707+
"styles": {
1708+
"instance": {
1709+
"margin": {
1710+
"xs": {
1711+
"top": 20,
1712+
"left": "auto",
1713+
"right": "auto",
1714+
"bottom": 20
1715+
}
1716+
},
1717+
"size": {
1718+
"lg": {
1719+
"maxWidth": 1140
1720+
}
1721+
},
1722+
"grid": {
1723+
"xs": {
1724+
"rows": [
1725+
"auto"
1726+
],
1727+
"cols": [
1728+
"1fr"
1729+
]
1730+
}
1731+
}
1732+
}
1733+
}
1734+
}
1735+
]
1736+
},
15841737
"main-menu-popup": {
15851738
"type": "popup",
15861739
"backdrop": false,

src/persistence/mapiObjectStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export class MapiObjectStorage implements IObjectStorage {
393393
const isLocalized = localizedContentTypes.includes(contentType);
394394
const localeSearchPrefix = isLocalized ? `${selectedLocale}/` : "";
395395

396-
if (key === "popups" || key === "locales") {
396+
if (key === "locales") {
397397
return {
398398
value: []
399399
};

src/startup.design.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as ko from "knockout";
33
import { InversifyInjector } from "@paperbits/common/injection";
44
import { OfflineModule } from "@paperbits/common/persistence/offline.module";
55
import { CoreDesignModule } from "@paperbits/core/core.design.module";
6-
import { PopupDesignModule } from "@paperbits/core/popup";
76
import { FormsDesignModule } from "@paperbits/forms/forms.design.module";
87
import { ProseMirrorModule } from "@paperbits/prosemirror/prosemirror.module";
98
import { StylesDesignModule } from "@paperbits/styles/styles.design.module";
@@ -18,7 +17,6 @@ injector.bindToCollection("autostart", SessionExpirationErrorHandler);
1817
injector.bindModule(new CoreDesignModule());
1918
injector.bindModule(new StylesDesignModule());
2019
injector.bindModule(new ProseMirrorModule());
21-
injector.bindModule(new PopupDesignModule());
2220
injector.bindModule(new FormsDesignModule());
2321
injector.bindModule(new ApimDesignModule());
2422
injector.bindModule(new OfflineModule({ autosave: false }));

0 commit comments

Comments
 (0)