Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enabled popup controls and snippets. #2156

Merged
merged 3 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 109 additions & 85 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
"@braintree/sanitize-url": "6.0.2",
"@microsoft/applicationinsights-web": "^2.8.11",
"@monaco-editor/loader": "^1.3.2",
"@paperbits/azure": "0.1.576",
"@paperbits/common": "0.1.576",
"@paperbits/core": "0.1.576",
"@paperbits/forms": "0.1.576",
"@paperbits/prosemirror": "0.1.576",
"@paperbits/styles": "0.1.576",
"@paperbits/azure": "0.1.580",
"@paperbits/common": "0.1.580",
"@paperbits/core": "0.1.580",
"@paperbits/forms": "0.1.580",
"@paperbits/prosemirror": "0.1.580",
"@paperbits/styles": "0.1.580",
"@webcomponents/custom-elements": "1.5.1",
"@webcomponents/shadydom": "^1.10.0",
"client-oauth2": "4.3.3",
Expand Down
10 changes: 6 additions & 4 deletions src/components/staticSettingsProvider.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as Objects from "@paperbits/common/objects";
import { ISettingsProvider } from "@paperbits/common/configuration";

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

public getSetting<T>(name: string): Promise<T> {
return this.configuration[name];
public getSetting<T>(path: string): Promise<T> {
return Objects.getObjectAt(path, this.configuration);
}

public async setSetting<T>(name: string, value: T): Promise<void> {
this.configuration[name] = value;
public async setSetting<T>(path: string, value: T): Promise<void> {
Objects.setValue(path, this.configuration, value);
this.configuration[path] = value;
}

public async getSettings<T>(): Promise<T> {
Expand Down
7 changes: 6 additions & 1 deletion src/config.design.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"managementApiUrl": "https://<service-name>.management.azure-api.net",
"managementApiAccessToken": "SharedAccessSignature ...",
"backendUrl": "https://<service-name>.developer.azure-api.net",
"useHipCaptcha": false
"useHipCaptcha": false,
"integration": {
"googleFonts": {
"apiKey": "<Google API Key>"
}
}
}
153 changes: 153 additions & 0 deletions src/libraries/block-snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@
"key": "blocks/new-popup-template",
"title": "New popup template",
"type": "popup"
},
"heading-block-1": {
"type": "layout-section",
"key": "blocks/heading-block-1",
"title": "Feature block 5",
"description": "",
"contentKey": "files/heading-block-1",
"imports": [
"styles/colors/semi-trsp-lt-bg",
"styles/components/button/no-border",
"popups/main-menu-popup",
"files/main-menu-popup"
]
}
},
"popups": {
Expand Down Expand Up @@ -1581,6 +1594,146 @@
}
]
},
"heading-block-1": {
"type": "layout-section",
"styles": {
"instance": {
"key": "awgovjdnwn"
}
},
"nodes": [
{
"type": "grid",
"nodes": [
{
"type": "grid-cell",
"nodes": [
{
"type": "picture",
"width": 80,
"height": 80,
"caption": "Logo",
"styles": {
"appearance": "components/picture/default"
},
"hyperlink": {
"target": "_self",
"targetKey": "pages/e0987ca1-f458-b546-7697-7be594b35583"
}
},
{
"type": "menu",
"navigationItemKey": "main",
"layout": "horizontal",
"styles": {
"appearance": "components/menu/default",
"instance": {
"display": {
"md": "inline-block",
"xs": "none"
}
}
},
"roles": null
},
{
"type": "button",
"label": "☰",
"styles": {
"appearance": "components/button/no-border",
"instance": {
"display": {
"xs": "inline-block",
"md": "none"
}
}
},
"roles": null,
"hyperlink": {
"target": "_popup",
"targetKey": "popups/main-menu-popup"
}
}
],
"role": "article",
"styles": {
"instance": {
"grid-cell": {
"xs": {
"position": {
"col": 1,
"row": 1
},
"span": {
"cols": 1,
"rows": 1
},
"alignment": {
"vertical": "center",
"horizontal": "between"
}
},
"xl": {
"alignment": {
"vertical": "center",
"horizontal": "between"
}
},
"md": {
"alignment": {
"vertical": "center",
"horizontal": "between"
}
},
"lg": {
"alignment": {
"vertical": "center",
"horizontal": "between"
}
}
},
"padding": {
"xs": {
"top": 10,
"bottom": 10,
"left": 10,
"right": 10
JMach1 marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
}
],
"styles": {
"instance": {
"margin": {
"xs": {
"top": 20,
"left": "auto",
"right": "auto",
"bottom": 20
}
},
"size": {
"lg": {
"maxWidth": 1140
}
},
"grid": {
"xs": {
"rows": [
"auto"
],
"cols": [
"1fr"
]
}
}
}
}
}
]
},
"main-menu-popup": {
"type": "popup",
"backdrop": false,
Expand Down
2 changes: 1 addition & 1 deletion src/persistence/mapiObjectStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export class MapiObjectStorage implements IObjectStorage {
const isLocalized = localizedContentTypes.includes(contentType);
const localeSearchPrefix = isLocalized ? `${selectedLocale}/` : "";

if (key === "popups" || key === "locales") {
if (key === "locales") {
return {
value: []
};
Expand Down
2 changes: 0 additions & 2 deletions src/startup.design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as ko from "knockout";
import { InversifyInjector } from "@paperbits/common/injection";
import { OfflineModule } from "@paperbits/common/persistence/offline.module";
import { CoreDesignModule } from "@paperbits/core/core.design.module";
import { PopupDesignModule } from "@paperbits/core/popup";
import { FormsDesignModule } from "@paperbits/forms/forms.design.module";
import { ProseMirrorModule } from "@paperbits/prosemirror/prosemirror.module";
import { StylesDesignModule } from "@paperbits/styles/styles.design.module";
Expand All @@ -18,7 +17,6 @@ injector.bindToCollection("autostart", SessionExpirationErrorHandler);
injector.bindModule(new CoreDesignModule());
injector.bindModule(new StylesDesignModule());
injector.bindModule(new ProseMirrorModule());
injector.bindModule(new PopupDesignModule());
injector.bindModule(new FormsDesignModule());
injector.bindModule(new ApimDesignModule());
injector.bindModule(new OfflineModule({ autosave: false }));
Expand Down