@webiny/website-builder-sdk 0.0.0-unstable.3bc8100a7f → 0.0.0-unstable.3fddf667ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BindingsApi.d.ts +4 -4
- package/BindingsApi.js +32 -39
- package/BindingsApi.js.map +1 -1
- package/BindingsProcessor.d.ts +1 -1
- package/BindingsProcessor.js +34 -43
- package/BindingsProcessor.js.map +1 -1
- package/BindingsProcessor.test.js +83 -78
- package/BindingsProcessor.test.js.map +1 -1
- package/BindingsResolver.d.ts +6 -3
- package/BindingsResolver.js +92 -122
- package/BindingsResolver.js.map +1 -1
- package/BindingsResolver.test.js +402 -365
- package/BindingsResolver.test.js.map +1 -1
- package/ComponentInputTraverser.d.ts +1 -1
- package/ComponentInputTraverser.js +29 -49
- package/ComponentInputTraverser.js.map +1 -1
- package/ComponentManifestToAstConverter.d.ts +23 -1
- package/ComponentManifestToAstConverter.js +140 -21
- package/ComponentManifestToAstConverter.js.map +1 -1
- package/ComponentRegistry.d.ts +2 -1
- package/ComponentRegistry.js +40 -22
- package/ComponentRegistry.js.map +1 -1
- package/ComponentResolver.d.ts +7 -4
- package/ComponentResolver.js +33 -32
- package/ComponentResolver.js.map +1 -1
- package/ConstraintEvaluator.d.ts +41 -0
- package/ConstraintEvaluator.js +304 -0
- package/ConstraintEvaluator.js.map +1 -0
- package/ConstraintEvaluator.test.d.ts +1 -0
- package/ConstraintEvaluator.test.js +1771 -0
- package/ConstraintEvaluator.test.js.map +1 -0
- package/ContentSdk.d.ts +90 -8
- package/ContentSdk.js +195 -78
- package/ContentSdk.js.map +1 -1
- package/DocumentStore.d.ts +3 -3
- package/DocumentStore.js +48 -60
- package/DocumentStore.js.map +1 -1
- package/DocumentStoreManager.d.ts +11 -4
- package/DocumentStoreManager.js +37 -17
- package/DocumentStoreManager.js.map +1 -1
- package/EditingSdk.d.ts +21 -5
- package/EditingSdk.js +119 -131
- package/EditingSdk.js.map +1 -1
- package/ElementBindings.d.ts +28 -0
- package/ElementBindings.js +88 -0
- package/ElementBindings.js.map +1 -0
- package/ElementBindings.test.d.ts +1 -0
- package/ElementBindings.test.js +127 -0
- package/ElementBindings.test.js.map +1 -0
- package/ElementFactory.d.ts +15 -7
- package/ElementFactory.js +165 -168
- package/ElementFactory.js.map +1 -1
- package/ElementFactory.test.d.ts +1 -0
- package/ElementFactory.test.js +511 -0
- package/ElementFactory.test.js.map +1 -0
- package/ElementSelection.d.ts +20 -0
- package/ElementSelection.js +32 -0
- package/ElementSelection.js.map +1 -0
- package/ElementSelection.test.d.ts +1 -0
- package/ElementSelection.test.js +73 -0
- package/ElementSelection.test.js.map +1 -0
- package/Environment.d.ts +7 -0
- package/Environment.js +19 -19
- package/Environment.js.map +1 -1
- package/Environment.test.d.ts +1 -0
- package/Environment.test.js +39 -0
- package/Environment.test.js.map +1 -0
- package/FunctionConverter.js +8 -7
- package/FunctionConverter.js.map +1 -1
- package/GlobalComponentLanguage.d.ts +31 -0
- package/GlobalComponentLanguage.js +37 -0
- package/GlobalComponentLanguage.js.map +1 -0
- package/HashObject.js +11 -12
- package/HashObject.js.map +1 -1
- package/HotkeyManager.js +41 -48
- package/HotkeyManager.js.map +1 -1
- package/IBindingsUpdater.d.ts +2 -2
- package/IBindingsUpdater.js +0 -3
- package/IRedirects.d.ts +5 -0
- package/IRedirects.js +0 -0
- package/InheritanceProcessor.d.ts +4 -4
- package/InheritanceProcessor.js +99 -139
- package/InheritanceProcessor.js.map +1 -1
- package/InheritanceProcessor.test.js +185 -177
- package/InheritanceProcessor.test.js.map +1 -1
- package/InheritedValueResolver.d.ts +7 -1
- package/InheritedValueResolver.js +22 -20
- package/InheritedValueResolver.js.map +1 -1
- package/InputBindingsProcessor.d.ts +4 -4
- package/InputBindingsProcessor.js +196 -294
- package/InputBindingsProcessor.js.map +1 -1
- package/InputRenderer.test.d.ts +1 -0
- package/InputRenderer.test.js +186 -0
- package/InputRenderer.test.js.map +1 -0
- package/InputsBindingsProcessor.test.js +466 -315
- package/InputsBindingsProcessor.test.js.map +1 -1
- package/InputsUpdater.d.ts +5 -5
- package/InputsUpdater.js +26 -28
- package/InputsUpdater.js.map +1 -1
- package/LayoutContentArea.d.ts +68 -0
- package/LayoutContentArea.js +78 -0
- package/LayoutContentArea.js.map +1 -0
- package/LayoutContentArea.test.d.ts +1 -0
- package/LayoutContentArea.test.js +111 -0
- package/LayoutContentArea.test.js.map +1 -0
- package/LiveSdk.d.ts +6 -3
- package/LiveSdk.js +17 -14
- package/LiveSdk.js.map +1 -1
- package/Logger.d.ts +2 -1
- package/Logger.js +10 -6
- package/Logger.js.map +1 -1
- package/MouseTracker.js +77 -83
- package/MouseTracker.js.map +1 -1
- package/NullSdk.d.ts +6 -3
- package/NullSdk.js +25 -11
- package/NullSdk.js.map +1 -1
- package/PreviewDocument.d.ts +3 -1
- package/PreviewDocument.js +31 -31
- package/PreviewDocument.js.map +1 -1
- package/PreviewSdk.d.ts +7 -3
- package/PreviewSdk.js +24 -18
- package/PreviewSdk.js.map +1 -1
- package/PreviewViewport.d.ts +6 -2
- package/PreviewViewport.js +60 -83
- package/PreviewViewport.js.map +1 -1
- package/PreviewViewport.test.d.ts +1 -0
- package/PreviewViewport.test.js +27 -0
- package/PreviewViewport.test.js.map +1 -0
- package/README.md +10 -2
- package/RadioOptionInputs.test.d.ts +1 -0
- package/RadioOptionInputs.test.js +521 -0
- package/RadioOptionInputs.test.js.map +1 -0
- package/ResizeObserver.js +24 -31
- package/ResizeObserver.js.map +1 -1
- package/StylesBindingsProcessor.d.ts +2 -2
- package/StylesBindingsProcessor.js +45 -83
- package/StylesBindingsProcessor.js.map +1 -1
- package/StylesUpdater.d.ts +4 -4
- package/StylesUpdater.js +25 -27
- package/StylesUpdater.js.map +1 -1
- package/Theme.d.ts +1 -1
- package/Theme.js +31 -33
- package/Theme.js.map +1 -1
- package/ViewportManager.d.ts +3 -1
- package/ViewportManager.js +90 -95
- package/ViewportManager.js.map +1 -1
- package/asset/deliveryUrl.d.ts +41 -0
- package/asset/deliveryUrl.js +34 -0
- package/asset/deliveryUrl.js.map +1 -0
- package/asset/deliveryUrl.test.d.ts +1 -0
- package/asset/deliveryUrl.test.js +127 -0
- package/asset/deliveryUrl.test.js.map +1 -0
- package/asset/geometry.d.ts +7 -0
- package/asset/geometry.js +10 -0
- package/asset/geometry.js.map +1 -0
- package/asset/imageSrcSet.d.ts +63 -0
- package/asset/imageSrcSet.js +98 -0
- package/asset/imageSrcSet.js.map +1 -0
- package/asset/imageSrcSet.test.d.ts +1 -0
- package/asset/imageSrcSet.test.js +103 -0
- package/asset/imageSrcSet.test.js.map +1 -0
- package/asset/index.d.ts +5 -0
- package/asset/index.js +5 -0
- package/asset/normalize.d.ts +24 -0
- package/asset/normalize.js +106 -0
- package/asset/normalize.js.map +1 -0
- package/asset/normalize.test.d.ts +1 -0
- package/asset/normalize.test.js +263 -0
- package/asset/normalize.test.js.map +1 -0
- package/asset/types.d.ts +2 -0
- package/asset/types.js +0 -0
- package/componentLoader/ComponentLoader.d.ts +16 -0
- package/componentLoader/ComponentLoader.js +0 -0
- package/componentLoader/RegistryOnlyComponentLoader.d.ts +9 -0
- package/componentLoader/RegistryOnlyComponentLoader.js +8 -0
- package/componentLoader/RegistryOnlyComponentLoader.js.map +1 -0
- package/componentLoader/createComponentLoader.d.ts +7 -0
- package/componentLoader/createComponentLoader.js +10 -0
- package/componentLoader/createComponentLoader.js.map +1 -0
- package/componentLoader/defaultComponentLoader.d.ts +7 -0
- package/componentLoader/defaultComponentLoader.js +8 -0
- package/componentLoader/defaultComponentLoader.js.map +1 -0
- package/componentLoader/index.d.ts +3 -0
- package/componentLoader/index.js +3 -0
- package/constants.d.ts +1 -0
- package/constants.js +7 -5
- package/constants.js.map +1 -1
- package/contentClientState.test.d.ts +1 -0
- package/contentClientState.test.js +404 -0
- package/contentClientState.test.js.map +1 -0
- package/contentEntry/ContentEntryBindingsResolver.d.ts +33 -0
- package/contentEntry/ContentEntryBindingsResolver.js +52 -0
- package/contentEntry/ContentEntryBindingsResolver.js.map +1 -0
- package/contentEntry/ContentEntryCache.d.ts +49 -0
- package/contentEntry/ContentEntryCache.js +51 -0
- package/contentEntry/ContentEntryCache.js.map +1 -0
- package/contentEntry/resolveContentEntry.d.ts +74 -0
- package/contentEntry/resolveContentEntry.js +53 -0
- package/contentEntry/resolveContentEntry.js.map +1 -0
- package/contentEntry/resolveContentEntry.test.d.ts +1 -0
- package/contentEntry/resolveContentEntry.test.js +213 -0
- package/contentEntry/resolveContentEntry.test.js.map +1 -0
- package/createComponent.d.ts +5 -0
- package/createComponent.js +32 -0
- package/createComponent.js.map +1 -0
- package/createContentClient.d.ts +17 -0
- package/createContentClient.js +16 -0
- package/createContentClient.js.map +1 -0
- package/createContentClient.test.d.ts +1 -0
- package/createContentClient.test.js +165 -0
- package/createContentClient.test.js.map +1 -0
- package/createElement.d.ts +1 -1
- package/createElement.js +5 -6
- package/createElement.js.map +1 -1
- package/createGlobalElementDocument.d.ts +6 -0
- package/createGlobalElementDocument.js +23 -0
- package/createGlobalElementDocument.js.map +1 -0
- package/createInput.d.ts +132 -16
- package/createInput.js +93 -112
- package/createInput.js.map +1 -1
- package/createTheme.d.ts +1 -1
- package/createTheme.js +2 -3
- package/createTheme.js.map +1 -1
- package/dataProviders/ApiClient.d.ts +18 -5
- package/dataProviders/ApiClient.js +58 -38
- package/dataProviders/ApiClient.js.map +1 -1
- package/dataProviders/ApiClient.test.d.ts +1 -0
- package/dataProviders/ApiClient.test.js +116 -0
- package/dataProviders/ApiClient.test.js.map +1 -0
- package/dataProviders/DefaultDataProvider.d.ts +9 -3
- package/dataProviders/DefaultDataProvider.js +106 -35
- package/dataProviders/DefaultDataProvider.js.map +1 -1
- package/dataProviders/DefaultDataProvider.test.d.ts +1 -0
- package/dataProviders/DefaultDataProvider.test.js +81 -0
- package/dataProviders/DefaultDataProvider.test.js.map +1 -0
- package/dataProviders/GET_EXPERIMENT_PAUSED.d.ts +1 -0
- package/dataProviders/GET_EXPERIMENT_PAUSED.js +17 -0
- package/dataProviders/GET_EXPERIMENT_PAUSED.js.map +1 -0
- package/dataProviders/GET_LAYOUT_BY_SLUG.d.ts +1 -0
- package/dataProviders/GET_LAYOUT_BY_SLUG.js +27 -0
- package/dataProviders/GET_LAYOUT_BY_SLUG.js.map +1 -0
- package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -1
- package/dataProviders/GET_PAGE_BY_ID.js +11 -1
- package/dataProviders/GET_PAGE_BY_ID.js.map +1 -1
- package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -1
- package/dataProviders/GET_PAGE_BY_PATH.js +11 -1
- package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -1
- package/dataProviders/GET_PAGE_EXPERIMENT.d.ts +1 -0
- package/dataProviders/GET_PAGE_EXPERIMENT.js +32 -0
- package/dataProviders/GET_PAGE_EXPERIMENT.js.map +1 -0
- package/dataProviders/GET_VARIANT_CONTENT.d.ts +1 -0
- package/dataProviders/GET_VARIANT_CONTENT.js +24 -0
- package/dataProviders/GET_VARIANT_CONTENT.js.map +1 -0
- package/dataProviders/LIST_PUBLISHED_PAGES.d.ts +1 -1
- package/dataProviders/LIST_PUBLISHED_PAGES.js +17 -5
- package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -1
- package/dataProviders/NullDataProvider.d.ts +18 -4
- package/dataProviders/NullDataProvider.js +33 -10
- package/dataProviders/NullDataProvider.js.map +1 -1
- package/dataProviders/RedirectsProvider.d.ts +11 -0
- package/dataProviders/RedirectsProvider.js +29 -0
- package/dataProviders/RedirectsProvider.js.map +1 -0
- package/dataProviders/queries.test.d.ts +1 -0
- package/dataProviders/queries.test.js +53 -0
- package/dataProviders/queries.test.js.map +1 -0
- package/defaultBreakpoints.d.ts +1 -1
- package/defaultBreakpoints.js +43 -22
- package/defaultBreakpoints.js.map +1 -1
- package/documentOperations/$addElementReferenceToParent.d.ts +1 -1
- package/documentOperations/$addElementReferenceToParent.js +30 -26
- package/documentOperations/$addElementReferenceToParent.js.map +1 -1
- package/documentOperations/AddElement.d.ts +1 -1
- package/documentOperations/AddElement.js +8 -7
- package/documentOperations/AddElement.js.map +1 -1
- package/documentOperations/AddToParent.d.ts +3 -3
- package/documentOperations/AddToParent.js +14 -13
- package/documentOperations/AddToParent.js.map +1 -1
- package/documentOperations/IDocumentOperation.js +0 -3
- package/documentOperations/RemoveElement.d.ts +1 -1
- package/documentOperations/RemoveElement.js +10 -7
- package/documentOperations/RemoveElement.js.map +1 -1
- package/documentOperations/SetGlobalInputBinding.d.ts +1 -1
- package/documentOperations/SetGlobalInputBinding.js +23 -22
- package/documentOperations/SetGlobalInputBinding.js.map +1 -1
- package/documentOperations/SetGlobalStyleBinding.d.ts +1 -1
- package/documentOperations/SetGlobalStyleBinding.js +23 -23
- package/documentOperations/SetGlobalStyleBinding.js.map +1 -1
- package/documentOperations/SetInputBindingOverride.d.ts +1 -1
- package/documentOperations/SetInputBindingOverride.js +30 -29
- package/documentOperations/SetInputBindingOverride.js.map +1 -1
- package/documentOperations/SetStyleBindingOverride.d.ts +1 -1
- package/documentOperations/SetStyleBindingOverride.js +30 -31
- package/documentOperations/SetStyleBindingOverride.js.map +1 -1
- package/documentOperations/index.d.ts +8 -8
- package/documentOperations/index.js +16 -15
- package/documentOperations/index.js.map +1 -1
- package/experiments/PostHogAnalyticsProvider.d.ts +31 -0
- package/experiments/PostHogAnalyticsProvider.js +28 -0
- package/experiments/PostHogAnalyticsProvider.js.map +1 -0
- package/experiments/analyticsProvider.d.ts +4 -0
- package/experiments/analyticsProvider.js +11 -0
- package/experiments/analyticsProvider.js.map +1 -0
- package/experiments/bucketing.d.ts +27 -0
- package/experiments/bucketing.js +91 -0
- package/experiments/bucketing.js.map +1 -0
- package/experiments/bucketing.test.d.ts +1 -0
- package/experiments/bucketing.test.js +183 -0
- package/experiments/bucketing.test.js.map +1 -0
- package/experiments/index.d.ts +5 -0
- package/experiments/index.js +5 -0
- package/experiments/render.d.ts +82 -0
- package/experiments/render.js +149 -0
- package/experiments/render.js.map +1 -0
- package/experiments/types.d.ts +108 -0
- package/experiments/types.js +4 -0
- package/experiments/types.js.map +1 -0
- package/findMatchingAstNode.d.ts +1 -1
- package/findMatchingAstNode.js +11 -13
- package/findMatchingAstNode.js.map +1 -1
- package/generateElementId.d.ts +1 -1
- package/generateElementId.js +2 -2
- package/generateElementId.js.map +1 -1
- package/globalElements.d.ts +43 -0
- package/globalElements.js +79 -0
- package/globalElements.js.map +1 -0
- package/globalElements.test.d.ts +1 -0
- package/globalElements.test.js +343 -0
- package/globalElements.test.js.map +1 -0
- package/headersProvider.d.ts +1 -2
- package/headersProvider.js +4 -3
- package/headersProvider.js.map +1 -1
- package/image/geometry.d.ts +54 -0
- package/image/geometry.js +112 -0
- package/image/geometry.js.map +1 -0
- package/image/geometry.test.d.ts +1 -0
- package/image/geometry.test.js +190 -0
- package/image/geometry.test.js.map +1 -0
- package/image/index.d.ts +3 -0
- package/image/index.js +3 -0
- package/image/presets.d.ts +6 -0
- package/image/presets.js +20 -0
- package/image/presets.js.map +1 -0
- package/image/types.d.ts +10 -0
- package/image/types.js +0 -0
- package/index.d.ts +22 -3
- package/index.js +21 -5
- package/jsonPatch.d.ts +1 -1
- package/jsonPatch.js +5 -9
- package/jsonPatch.js.map +1 -1
- package/messages.d.ts +3 -0
- package/messages.js +15 -11
- package/messages.js.map +1 -1
- package/messenger/MessageOrigin.js +12 -11
- package/messenger/MessageOrigin.js.map +1 -1
- package/messenger/Messenger.js +59 -70
- package/messenger/Messenger.js.map +1 -1
- package/messenger/index.js +0 -2
- package/package.json +19 -23
- package/radioOptionInputs.d.ts +24 -0
- package/radioOptionInputs.js +26 -0
- package/radioOptionInputs.js.map +1 -0
- package/registerComponentGroup.d.ts +1 -1
- package/registerComponentGroup.js +6 -7
- package/registerComponentGroup.js.map +1 -1
- package/types/ShorthandCssProperties.js +0 -3
- package/types/WebsiteBuilderTheme.d.ts +54 -45
- package/types/WebsiteBuilderTheme.js +0 -3
- package/types.d.ts +369 -24
- package/types.js +0 -3
- package/withGlobalElementDefaults.d.ts +8 -0
- package/withGlobalElementDefaults.js +60 -0
- package/withGlobalElementDefaults.js.map +1 -0
- package/IBindingsUpdater.js.map +0 -1
- package/documentOperations/IDocumentOperation.js.map +0 -1
- package/index.js.map +0 -1
- package/lexical/createDefaultLexicalTheme.d.ts +0 -2
- package/lexical/createDefaultLexicalTheme.js +0 -84
- package/lexical/createDefaultLexicalTheme.js.map +0 -1
- package/lexical/createLexicalTheme.d.ts +0 -2
- package/lexical/createLexicalTheme.js +0 -7
- package/lexical/createLexicalTheme.js.map +0 -1
- package/lexical/deepMerge.d.ts +0 -1
- package/lexical/deepMerge.js +0 -23
- package/lexical/deepMerge.js.map +0 -1
- package/messenger/index.js.map +0 -1
- package/types/LexicalEditorTheme.d.ts +0 -2
- package/types/LexicalEditorTheme.js +0 -3
- package/types/LexicalEditorTheme.js.map +0 -1
- package/types/ShorthandCssProperties.js.map +0 -1
- package/types/WebsiteBuilderTheme.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ApiClient } from "./ApiClient.js";
|
|
2
|
+
import type { IRedirects } from "../IRedirects.js";
|
|
3
|
+
import type { PublicRedirect } from "../types.js";
|
|
4
|
+
export declare class RedirectsProvider implements IRedirects {
|
|
5
|
+
private redirectsCache;
|
|
6
|
+
private apiClient;
|
|
7
|
+
constructor(apiClient: ApiClient);
|
|
8
|
+
getRedirectByPath(path: string): Promise<PublicRedirect | undefined>;
|
|
9
|
+
getAllRedirects(): Promise<Map<string, PublicRedirect>>;
|
|
10
|
+
private populateCache;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class RedirectsProvider {
|
|
2
|
+
constructor(apiClient){
|
|
3
|
+
this.redirectsCache = void 0;
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async getRedirectByPath(path) {
|
|
7
|
+
await this.populateCache();
|
|
8
|
+
if (!this.redirectsCache) return;
|
|
9
|
+
return this.redirectsCache.get(path);
|
|
10
|
+
}
|
|
11
|
+
async getAllRedirects() {
|
|
12
|
+
await this.populateCache();
|
|
13
|
+
return this.redirectsCache ?? new Map();
|
|
14
|
+
}
|
|
15
|
+
async populateCache() {
|
|
16
|
+
const redirects = await this.apiClient.fetch({
|
|
17
|
+
path: "/wb/redirects",
|
|
18
|
+
cache: "no-cache",
|
|
19
|
+
next: {
|
|
20
|
+
revalidate: 0
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
this.redirectsCache = new Map();
|
|
24
|
+
for (const redirect of redirects)this.redirectsCache.set(redirect.from, redirect);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export { RedirectsProvider };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=RedirectsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataProviders/RedirectsProvider.js","sources":["../../src/dataProviders/RedirectsProvider.ts"],"sourcesContent":["import type { ApiClient } from \"./ApiClient.js\";\nimport type { IRedirects } from \"~/IRedirects.js\";\nimport type { PublicRedirect } from \"~/types.js\";\n\nexport class RedirectsProvider implements IRedirects {\n private redirectsCache: Map<string, PublicRedirect> | undefined = undefined;\n private apiClient: ApiClient;\n\n constructor(apiClient: ApiClient) {\n this.apiClient = apiClient;\n }\n\n async getRedirectByPath(path: string): Promise<PublicRedirect | undefined> {\n await this.populateCache();\n\n if (!this.redirectsCache) {\n return undefined;\n }\n\n return this.redirectsCache.get(path);\n }\n\n async getAllRedirects(): Promise<Map<string, PublicRedirect>> {\n await this.populateCache();\n return this.redirectsCache ?? new Map();\n }\n\n private async populateCache() {\n const redirects: PublicRedirect[] = await this.apiClient.fetch({\n path: \"/wb/redirects\",\n cache: \"no-cache\",\n next: {\n revalidate: 0\n }\n });\n\n this.redirectsCache = new Map();\n for (const redirect of redirects) {\n this.redirectsCache.set(redirect.from, redirect);\n }\n }\n}\n"],"names":["RedirectsProvider","apiClient","undefined","path","Map","redirects","redirect"],"mappings":"AAIO,MAAMA;IAIT,YAAYC,SAAoB,CAAE;aAH1B,cAAc,GAA4CC;QAI9D,IAAI,CAAC,SAAS,GAAGD;IACrB;IAEA,MAAM,kBAAkBE,IAAY,EAAuC;QACvE,MAAM,IAAI,CAAC,aAAa;QAExB,IAAI,CAAC,IAAI,CAAC,cAAc,EACpB;QAGJ,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAACA;IACnC;IAEA,MAAM,kBAAwD;QAC1D,MAAM,IAAI,CAAC,aAAa;QACxB,OAAO,IAAI,CAAC,cAAc,IAAI,IAAIC;IACtC;IAEA,MAAc,gBAAgB;QAC1B,MAAMC,YAA8B,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YAC3D,MAAM;YACN,OAAO;YACP,MAAM;gBACF,YAAY;YAChB;QACJ;QAEA,IAAI,CAAC,cAAc,GAAG,IAAID;QAC1B,KAAK,MAAME,YAAYD,UACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAACC,SAAS,IAAI,EAAEA;IAE/C;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { GET_PAGE_BY_PATH } from "./GET_PAGE_BY_PATH.js";
|
|
3
|
+
import { GET_PAGE_BY_ID } from "./GET_PAGE_BY_ID.js";
|
|
4
|
+
const getDataSelection = (query)=>{
|
|
5
|
+
const start = query.search(/data\s*\{/);
|
|
6
|
+
if (-1 === start) throw new Error("Query has no `data` selection set.");
|
|
7
|
+
const fields = [];
|
|
8
|
+
let depth = 0;
|
|
9
|
+
for (const token of query.slice(start).split(/\s+/).filter(Boolean))if ("{" === token) depth++;
|
|
10
|
+
else if ("}" === token) {
|
|
11
|
+
depth--;
|
|
12
|
+
if (0 === depth) break;
|
|
13
|
+
} else if (1 === depth && "data" !== token) fields.push(token);
|
|
14
|
+
return fields;
|
|
15
|
+
};
|
|
16
|
+
describe("single-page queries", ()=>{
|
|
17
|
+
it.each([
|
|
18
|
+
[
|
|
19
|
+
"GET_PAGE_BY_PATH",
|
|
20
|
+
GET_PAGE_BY_PATH
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"GET_PAGE_BY_ID",
|
|
24
|
+
GET_PAGE_BY_ID
|
|
25
|
+
]
|
|
26
|
+
])("%s selects metadata", (_name, query)=>{
|
|
27
|
+
expect(getDataSelection(query)).toContain("metadata");
|
|
28
|
+
});
|
|
29
|
+
it.each([
|
|
30
|
+
[
|
|
31
|
+
"GET_PAGE_BY_PATH",
|
|
32
|
+
GET_PAGE_BY_PATH
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"GET_PAGE_BY_ID",
|
|
36
|
+
GET_PAGE_BY_ID
|
|
37
|
+
]
|
|
38
|
+
])("%s selects exactly the expected fields", (_name, query)=>{
|
|
39
|
+
expect(getDataSelection(query)).toEqual([
|
|
40
|
+
"id",
|
|
41
|
+
"version",
|
|
42
|
+
"properties",
|
|
43
|
+
"metadata",
|
|
44
|
+
"elements",
|
|
45
|
+
"bindings",
|
|
46
|
+
"extensions",
|
|
47
|
+
"languagePaths",
|
|
48
|
+
"layout"
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=queries.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataProviders/queries.test.js","sources":["../../src/dataProviders/queries.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { GET_PAGE_BY_PATH } from \"./GET_PAGE_BY_PATH.js\";\nimport { GET_PAGE_BY_ID } from \"./GET_PAGE_BY_ID.js\";\n\n/**\n * Extracts the top-level fields selected inside the `data { ... }` block of a single-page query.\n * A field with its own selection set (e.g. `layout { ... }`) is listed by its name.\n */\nconst getDataSelection = (query: string): string[] => {\n const start = query.search(/data\\s*\\{/);\n if (start === -1) {\n throw new Error(\"Query has no `data` selection set.\");\n }\n\n const fields: string[] = [];\n let depth = 0;\n for (const token of query.slice(start).split(/\\s+/).filter(Boolean)) {\n if (token === \"{\") {\n depth++;\n } else if (token === \"}\") {\n depth--;\n if (depth === 0) {\n break;\n }\n } else if (depth === 1 && token !== \"data\") {\n fields.push(token);\n }\n }\n\n return fields;\n};\n\ndescribe(\"single-page queries\", () => {\n // These assertions exist because a missing `metadata` field previously forced consumers\n // to maintain a Yarn patch against the built SDK. Keep both queries selecting it.\n it.each([\n [\"GET_PAGE_BY_PATH\", GET_PAGE_BY_PATH],\n [\"GET_PAGE_BY_ID\", GET_PAGE_BY_ID]\n ])(\"%s selects metadata\", (_name, query) => {\n expect(getDataSelection(query)).toContain(\"metadata\");\n });\n\n // `PublicPage` also declares `state`, which is not sourced from the API and so is\n // deliberately absent from both queries.\n it.each([\n [\"GET_PAGE_BY_PATH\", GET_PAGE_BY_PATH],\n [\"GET_PAGE_BY_ID\", GET_PAGE_BY_ID]\n ])(\"%s selects exactly the expected fields\", (_name, query) => {\n expect(getDataSelection(query)).toEqual([\n \"id\",\n \"version\",\n \"properties\",\n \"metadata\",\n \"elements\",\n \"bindings\",\n \"extensions\",\n \"languagePaths\",\n \"layout\"\n ]);\n });\n});\n"],"names":["getDataSelection","query","start","Error","fields","depth","token","Boolean","describe","it","GET_PAGE_BY_PATH","GET_PAGE_BY_ID","_name","expect"],"mappings":";;;AAQA,MAAMA,mBAAmB,CAACC;IACtB,MAAMC,QAAQD,MAAM,MAAM,CAAC;IAC3B,IAAIC,AAAU,OAAVA,OACA,MAAM,IAAIC,MAAM;IAGpB,MAAMC,SAAmB,EAAE;IAC3B,IAAIC,QAAQ;IACZ,KAAK,MAAMC,SAASL,MAAM,KAAK,CAACC,OAAO,KAAK,CAAC,OAAO,MAAM,CAACK,SACvD,IAAID,AAAU,QAAVA,OACAD;SACG,IAAIC,AAAU,QAAVA,OAAe;QACtBD;QACA,IAAIA,AAAU,MAAVA,OACA;IAER,OAAO,IAAIA,AAAU,MAAVA,SAAeC,AAAU,WAAVA,OACtBF,OAAO,IAAI,CAACE;IAIpB,OAAOF;AACX;AAEAI,SAAS,uBAAuB;IAG5BC,GAAG,IAAI,CAAC;QACJ;YAAC;YAAoBC;SAAiB;QACtC;YAAC;YAAkBC;SAAe;KACrC,EAAE,uBAAuB,CAACC,OAAOX;QAC9BY,OAAOb,iBAAiBC,QAAQ,SAAS,CAAC;IAC9C;IAIAQ,GAAG,IAAI,CAAC;QACJ;YAAC;YAAoBC;SAAiB;QACtC;YAAC;YAAkBC;SAAe;KACrC,EAAE,0CAA0C,CAACC,OAAOX;QACjDY,OAAOb,iBAAiBC,QAAQ,OAAO,CAAC;YACpC;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACH;IACL;AACJ"}
|
package/defaultBreakpoints.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { WebsiteBuilderThemeInput } from "./types/WebsiteBuilderTheme";
|
|
1
|
+
import type { WebsiteBuilderThemeInput } from "./types/WebsiteBuilderTheme.js";
|
|
2
2
|
export declare const defaultBreakpoints: NonNullable<WebsiteBuilderThemeInput["breakpoints"]>;
|
package/defaultBreakpoints.js
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
const defaultBreakpoints = {
|
|
2
|
+
desktop: {
|
|
3
|
+
title: "Desktop",
|
|
4
|
+
description: "Desktop styles apply at all breakpoints, unless they're edited at a lower breakpoint. Start your styling here.",
|
|
5
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
6
|
+
<path d="M13.3333 12C14.0667 12 14.6667 11.4 14.6667 10.6666V3.99996C14.6667 3.26663 14.0667 2.66663 13.3333 2.66663H2.66667C1.93333 2.66663 1.33333 3.26663 1.33333 3.99996V10.6666C1.33333 11.4 1.93333 12 2.66667 12H0V13.3333H16V12H13.3333ZM2.66667 3.99996H13.3333V10.6666H2.66667V3.99996Z" fill="#59626D"/>
|
|
7
|
+
</svg>`,
|
|
8
|
+
minWidth: 0,
|
|
9
|
+
maxWidth: 4000
|
|
10
|
+
},
|
|
11
|
+
tablet: {
|
|
12
|
+
title: "Tablet",
|
|
13
|
+
description: "Styles added here will apply at 991px and below, unless they're edited at a smaller breakpoint.",
|
|
14
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
15
|
+
<g clip-path="url(#clip0_6424_8826)">
|
|
16
|
+
<path d="M12.666 0H3.33268C2.41268 0 1.66602 0.746667 1.66602 1.66667V14.3333C1.66602 15.2533 2.41268 16 3.33268 16H12.666C13.586 16 14.3327 15.2533 14.3327 14.3333V1.66667C14.3327 0.746667 13.586 0 12.666 0ZM7.99935 15.3333C7.44602 15.3333 6.99935 14.8867 6.99935 14.3333C6.99935 13.78 7.44602 13.3333 7.99935 13.3333C8.55268 13.3333 8.99935 13.78 8.99935 14.3333C8.99935 14.8867 8.55268 15.3333 7.99935 15.3333ZM12.9993 12.6667H2.99935V2H12.9993V12.6667Z" fill="#9DA4B0"/>
|
|
17
|
+
</g>
|
|
18
|
+
<defs>
|
|
19
|
+
<clipPath id="clip0_6424_8826">
|
|
20
|
+
<rect width="16" height="16" fill="white"/>
|
|
21
|
+
</clipPath>
|
|
22
|
+
</defs>
|
|
23
|
+
</svg>`,
|
|
24
|
+
minWidth: 0,
|
|
25
|
+
maxWidth: 991
|
|
26
|
+
},
|
|
27
|
+
mobile: {
|
|
28
|
+
title: "Mobile",
|
|
29
|
+
description: "Styles added here will apply at 430px and below.",
|
|
30
|
+
icon: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
31
|
+
<g clip-path="url(#clip0_6405_34405)">
|
|
32
|
+
<path d="M11.333 0.673293L4.66634 0.666626C3.93301 0.666626 3.33301 1.26663 3.33301 1.99996V14C3.33301 14.7333 3.93301 15.3333 4.66634 15.3333H11.333C12.0663 15.3333 12.6663 14.7333 12.6663 14V1.99996C12.6663 1.26663 12.0663 0.673293 11.333 0.673293ZM11.333 12.6666H4.66634V3.33329H11.333V12.6666Z" fill="#9DA4B0"/>
|
|
33
|
+
</g>
|
|
34
|
+
<defs>
|
|
35
|
+
<clipPath id="clip0_6405_34405">
|
|
36
|
+
<rect width="16" height="16" fill="white"/>
|
|
37
|
+
</clipPath>
|
|
38
|
+
</defs>
|
|
39
|
+
</svg>`,
|
|
40
|
+
minWidth: 0,
|
|
41
|
+
maxWidth: 430
|
|
42
|
+
}
|
|
23
43
|
};
|
|
44
|
+
export { defaultBreakpoints };
|
|
24
45
|
|
|
25
46
|
//# sourceMappingURL=defaultBreakpoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"defaultBreakpoints.js","sources":["../src/defaultBreakpoints.ts"],"sourcesContent":["import type { WebsiteBuilderThemeInput } from \"~/types/WebsiteBuilderTheme.js\";\n\nexport const defaultBreakpoints: NonNullable<WebsiteBuilderThemeInput[\"breakpoints\"]> = {\n desktop: {\n title: \"Desktop\",\n description: `Desktop styles apply at all breakpoints, unless they're edited at a lower breakpoint. Start your styling here.`,\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path d=\"M13.3333 12C14.0667 12 14.6667 11.4 14.6667 10.6666V3.99996C14.6667 3.26663 14.0667 2.66663 13.3333 2.66663H2.66667C1.93333 2.66663 1.33333 3.26663 1.33333 3.99996V10.6666C1.33333 11.4 1.93333 12 2.66667 12H0V13.3333H16V12H13.3333ZM2.66667 3.99996H13.3333V10.6666H2.66667V3.99996Z\" fill=\"#59626D\"/>\n</svg>`,\n minWidth: 0,\n maxWidth: 4000\n },\n tablet: {\n title: \"Tablet\",\n description: `Styles added here will apply at 991px and below, unless they're edited at a smaller breakpoint.`,\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <g clip-path=\"url(#clip0_6424_8826)\">\n <path d=\"M12.666 0H3.33268C2.41268 0 1.66602 0.746667 1.66602 1.66667V14.3333C1.66602 15.2533 2.41268 16 3.33268 16H12.666C13.586 16 14.3327 15.2533 14.3327 14.3333V1.66667C14.3327 0.746667 13.586 0 12.666 0ZM7.99935 15.3333C7.44602 15.3333 6.99935 14.8867 6.99935 14.3333C6.99935 13.78 7.44602 13.3333 7.99935 13.3333C8.55268 13.3333 8.99935 13.78 8.99935 14.3333C8.99935 14.8867 8.55268 15.3333 7.99935 15.3333ZM12.9993 12.6667H2.99935V2H12.9993V12.6667Z\" fill=\"#9DA4B0\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_6424_8826\">\n <rect width=\"16\" height=\"16\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>`,\n minWidth: 0,\n maxWidth: 991\n },\n mobile: {\n title: \"Mobile\",\n description: `Styles added here will apply at 430px and below.`,\n icon: `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <g clip-path=\"url(#clip0_6405_34405)\">\n <path d=\"M11.333 0.673293L4.66634 0.666626C3.93301 0.666626 3.33301 1.26663 3.33301 1.99996V14C3.33301 14.7333 3.93301 15.3333 4.66634 15.3333H11.333C12.0663 15.3333 12.6663 14.7333 12.6663 14V1.99996C12.6663 1.26663 12.0663 0.673293 11.333 0.673293ZM11.333 12.6666H4.66634V3.33329H11.333V12.6666Z\" fill=\"#9DA4B0\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_6405_34405\">\n <rect width=\"16\" height=\"16\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>`,\n minWidth: 0,\n maxWidth: 430\n }\n};\n"],"names":["defaultBreakpoints"],"mappings":"AAEO,MAAMA,qBAA2E;IACpF,SAAS;QACL,OAAO;QACP,aAAa;QACb,MAAM,CAAC;;MAET,CAAC;QACC,UAAU;QACV,UAAU;IACd;IACA,QAAQ;QACJ,OAAO;QACP,aAAa;QACb,MAAM,CAAC;;;;;;;;;MAST,CAAC;QACC,UAAU;QACV,UAAU;IACd;IACA,QAAQ;QACJ,OAAO;QACP,aAAa;QACb,MAAM,CAAC;;;;;;;;;MAST,CAAC;QACC,UAAU;QACV,UAAU;IACd;AACJ"}
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const inputs = bindings.inputs ?? {};
|
|
9
|
-
if (index < 0) {
|
|
10
|
-
// Single value slot
|
|
11
|
-
inputs[slot] = {
|
|
12
|
-
...inputs[slot],
|
|
13
|
-
type: "slot",
|
|
14
|
-
static: elementId
|
|
1
|
+
function $addElementReferenceToParent(document, { elementId, parentId, slot, index }) {
|
|
2
|
+
const bindings = document.bindings[parentId] ?? {};
|
|
3
|
+
const inputs = bindings.inputs ?? {};
|
|
4
|
+
if (void 0 !== index && index < 0) inputs[slot] = {
|
|
5
|
+
...inputs[slot],
|
|
6
|
+
type: "slot",
|
|
7
|
+
static: elementId
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
else {
|
|
10
|
+
const slotElements = inputs[slot];
|
|
11
|
+
const existing = slotElements?.static ?? [];
|
|
12
|
+
let staticValue;
|
|
13
|
+
staticValue = void 0 === index ? [
|
|
14
|
+
...existing,
|
|
15
|
+
elementId
|
|
16
|
+
] : [
|
|
17
|
+
...existing.slice(0, index),
|
|
18
|
+
elementId,
|
|
19
|
+
...existing.slice(index)
|
|
20
|
+
];
|
|
21
|
+
inputs[slot] = {
|
|
22
|
+
...inputs[slot],
|
|
23
|
+
type: "slot",
|
|
24
|
+
list: true,
|
|
25
|
+
static: staticValue
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
document.bindings[parentId] = {
|
|
29
|
+
...bindings,
|
|
30
|
+
inputs
|
|
23
31
|
};
|
|
24
|
-
}
|
|
25
|
-
document.bindings[parentId] = {
|
|
26
|
-
...bindings,
|
|
27
|
-
inputs
|
|
28
|
-
};
|
|
29
32
|
}
|
|
33
|
+
export { $addElementReferenceToParent };
|
|
30
34
|
|
|
31
35
|
//# sourceMappingURL=$addElementReferenceToParent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/$addElementReferenceToParent.js","sources":["../../src/documentOperations/$addElementReferenceToParent.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\nimport type { InputValueBinding } from \"~/types.js\";\n\ninterface Params {\n elementId: string;\n parentId: string;\n slot: string;\n index?: number;\n}\n\nexport function $addElementReferenceToParent(\n document: Document,\n { elementId, parentId, slot, index }: Params\n) {\n const bindings = document.bindings[parentId] ?? {};\n const inputs = bindings.inputs ?? {};\n\n if (index !== undefined && index < 0) {\n // Single value slot\n inputs[slot] = {\n ...inputs[slot],\n type: \"slot\",\n static: elementId\n };\n } else {\n const slotElements = inputs[slot] as InputValueBinding;\n const existing = slotElements?.static ?? [];\n\n let staticValue;\n if (index === undefined) {\n staticValue = [...existing, elementId];\n } else {\n staticValue = [...existing.slice(0, index), elementId, ...existing.slice(index)];\n }\n\n inputs[slot] = {\n ...inputs[slot],\n type: \"slot\",\n list: true,\n static: staticValue\n };\n }\n\n document.bindings[parentId] = {\n ...bindings,\n inputs\n };\n}\n"],"names":["$addElementReferenceToParent","document","elementId","parentId","slot","index","bindings","inputs","undefined","slotElements","existing","staticValue"],"mappings":"AAUO,SAASA,6BACZC,QAAkB,EAClB,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,KAAK,EAAU;IAE5C,MAAMC,WAAWL,SAAS,QAAQ,CAACE,SAAS,IAAI,CAAC;IACjD,MAAMI,SAASD,SAAS,MAAM,IAAI,CAAC;IAEnC,IAAID,AAAUG,WAAVH,SAAuBA,QAAQ,GAE/BE,MAAM,CAACH,KAAK,GAAG;QACX,GAAGG,MAAM,CAACH,KAAK;QACf,MAAM;QACN,QAAQF;IACZ;SACG;QACH,MAAMO,eAAeF,MAAM,CAACH,KAAK;QACjC,MAAMM,WAAWD,cAAc,UAAU,EAAE;QAE3C,IAAIE;QAEAA,cADAN,AAAUG,WAAVH,QACc;eAAIK;YAAUR;SAAU,GAExB;eAAIQ,SAAS,KAAK,CAAC,GAAGL;YAAQH;eAAcQ,SAAS,KAAK,CAACL;SAAO;QAGpFE,MAAM,CAACH,KAAK,GAAG;YACX,GAAGG,MAAM,CAACH,KAAK;YACf,MAAM;YACN,MAAM;YACN,QAAQO;QACZ;IACJ;IAEAV,SAAS,QAAQ,CAACE,SAAS,GAAG;QAC1B,GAAGG,QAAQ;QACXC;IACJ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document, DocumentElement } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class AddElement implements IDocumentOperation {
|
|
4
4
|
private readonly element;
|
|
5
5
|
constructor(element: DocumentElement);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class AddElement {
|
|
2
|
+
constructor(element){
|
|
3
|
+
this.element = element;
|
|
4
|
+
}
|
|
5
|
+
apply(document) {
|
|
6
|
+
document.elements[this.element.id] = this.element;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
|
+
export { AddElement };
|
|
9
10
|
|
|
10
11
|
//# sourceMappingURL=AddElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/AddElement.js","sources":["../../src/documentOperations/AddElement.ts"],"sourcesContent":["import type { Document, DocumentElement } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class AddElement implements IDocumentOperation {\n private readonly element: DocumentElement;\n\n constructor(element: DocumentElement) {\n this.element = element;\n }\n\n apply(document: Document) {\n document.elements[this.element.id] = this.element;\n }\n}\n"],"names":["AddElement","element","document"],"mappings":"AAGO,MAAMA;IAGT,YAAYC,OAAwB,CAAE;QAClC,IAAI,CAAC,OAAO,GAAGA;IACnB;IAEA,MAAMC,QAAkB,EAAE;QACtBA,SAAS,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO;IACrD;AACJ"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Document, DocumentElement } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class AddToParent implements IDocumentOperation {
|
|
4
4
|
private element;
|
|
5
|
-
private readonly index
|
|
6
|
-
constructor(element: DocumentElement, index
|
|
5
|
+
private readonly index?;
|
|
6
|
+
constructor(element: DocumentElement, index?: number);
|
|
7
7
|
apply(document: Document): void;
|
|
8
8
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { $addElementReferenceToParent } from "./$addElementReferenceToParent.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
class AddToParent {
|
|
3
|
+
constructor(element, index){
|
|
4
|
+
this.element = element;
|
|
5
|
+
this.index = index;
|
|
6
|
+
}
|
|
7
|
+
apply(document) {
|
|
8
|
+
$addElementReferenceToParent(document, {
|
|
9
|
+
elementId: this.element.id,
|
|
10
|
+
parentId: this.element.parent.id,
|
|
11
|
+
slot: this.element.parent.slot,
|
|
12
|
+
index: this.index
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
|
+
export { AddToParent };
|
|
16
17
|
|
|
17
18
|
//# sourceMappingURL=AddToParent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/AddToParent.js","sources":["../../src/documentOperations/AddToParent.ts"],"sourcesContent":["import type { Document, DocumentElement } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\nimport { $addElementReferenceToParent } from \"./$addElementReferenceToParent.js\";\n\nexport class AddToParent implements IDocumentOperation {\n private element: DocumentElement;\n private readonly index?: number;\n\n constructor(element: DocumentElement, index?: number) {\n this.element = element;\n this.index = index;\n }\n\n apply(document: Document) {\n $addElementReferenceToParent(document, {\n elementId: this.element.id,\n parentId: this.element.parent!.id,\n slot: this.element.parent!.slot,\n index: this.index\n });\n }\n}\n"],"names":["AddToParent","element","index","document","$addElementReferenceToParent"],"mappings":";AAIO,MAAMA;IAIT,YAAYC,OAAwB,EAAEC,KAAc,CAAE;QAClD,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,KAAK,GAAGC;IACjB;IAEA,MAAMC,QAAkB,EAAE;QACtBC,6BAA6BD,UAAU;YACnC,WAAW,IAAI,CAAC,OAAO,CAAC,EAAE;YAC1B,UAAU,IAAI,CAAC,OAAO,CAAC,MAAM,CAAE,EAAE;YACjC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAE,IAAI;YAC/B,OAAO,IAAI,CAAC,KAAK;QACrB;IACJ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class RemoveElement implements IDocumentOperation {
|
|
4
4
|
private readonly elementId;
|
|
5
5
|
constructor(elementId: string);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class RemoveElement {
|
|
2
|
+
constructor(elementId){
|
|
3
|
+
this.elementId = elementId;
|
|
4
|
+
}
|
|
5
|
+
apply(document) {
|
|
6
|
+
for(const id in document.elements)if (document.elements[id].parent?.id === this.elementId) new RemoveElement(id).apply(document);
|
|
7
|
+
delete document.bindings[this.elementId];
|
|
8
|
+
delete document.elements[this.elementId];
|
|
9
|
+
}
|
|
8
10
|
}
|
|
11
|
+
export { RemoveElement };
|
|
9
12
|
|
|
10
13
|
//# sourceMappingURL=RemoveElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/RemoveElement.js","sources":["../../src/documentOperations/RemoveElement.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class RemoveElement implements IDocumentOperation {\n private readonly elementId: string;\n\n constructor(elementId: string) {\n this.elementId = elementId;\n }\n\n apply(document: Document) {\n // Recursively remove all descendants first.\n for (const id in document.elements) {\n if (document.elements[id].parent?.id === this.elementId) {\n new RemoveElement(id).apply(document);\n }\n }\n\n // Remove bindings and the element itself.\n delete document.bindings[this.elementId];\n delete document.elements[this.elementId];\n }\n}\n"],"names":["RemoveElement","elementId","document","id"],"mappings":"AAGO,MAAMA;IAGT,YAAYC,SAAiB,CAAE;QAC3B,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAMC,QAAkB,EAAE;QAEtB,IAAK,MAAMC,MAAMD,SAAS,QAAQ,CAC9B,IAAIA,SAAS,QAAQ,CAACC,GAAG,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,SAAS,EACnD,IAAIH,cAAcG,IAAI,KAAK,CAACD;QAKpC,OAAOA,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QACxC,OAAOA,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IAC5C;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document, InputValueBinding } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class SetGlobalInputBinding implements IDocumentOperation {
|
|
4
4
|
private readonly elementId;
|
|
5
5
|
private readonly bindingPath;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
class SetGlobalInputBinding {
|
|
2
|
+
constructor(elementId, bindingPath, binding){
|
|
3
|
+
this.elementId = elementId;
|
|
4
|
+
this.bindingPath = bindingPath;
|
|
5
|
+
this.binding = binding;
|
|
6
|
+
}
|
|
7
|
+
apply(document) {
|
|
8
|
+
const bindings = document.bindings[this.elementId] ?? {
|
|
9
|
+
inputs: {}
|
|
10
|
+
};
|
|
11
|
+
const binding = bindings.inputs ? bindings.inputs[this.bindingPath] : {};
|
|
12
|
+
document.bindings[this.elementId] = {
|
|
13
|
+
...bindings,
|
|
14
|
+
inputs: {
|
|
15
|
+
...bindings.inputs ?? {},
|
|
16
|
+
[this.bindingPath]: {
|
|
17
|
+
...binding,
|
|
18
|
+
...this.binding
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
|
+
export { SetGlobalInputBinding };
|
|
24
25
|
|
|
25
26
|
//# sourceMappingURL=SetGlobalInputBinding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/SetGlobalInputBinding.js","sources":["../../src/documentOperations/SetGlobalInputBinding.ts"],"sourcesContent":["import type { Document, InputValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetGlobalInputBinding implements IDocumentOperation {\n private readonly elementId: string;\n private readonly bindingPath: string;\n private readonly binding: InputValueBinding;\n\n constructor(elementId: string, bindingPath: string, binding: InputValueBinding) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? { inputs: {} };\n const binding = bindings.inputs ? bindings.inputs[this.bindingPath] : {};\n document.bindings[this.elementId] = {\n ...bindings,\n inputs: {\n ...(bindings.inputs ?? {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n };\n }\n}\n"],"names":["SetGlobalInputBinding","elementId","bindingPath","binding","document","bindings"],"mappings":"AAGO,MAAMA;IAKT,YAAYC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,CAAE;QAC5E,IAAI,CAAC,SAAS,GAAGF;QACjB,IAAI,CAAC,WAAW,GAAGC;QACnB,IAAI,CAAC,OAAO,GAAGC;IACnB;IAEA,MAAMC,QAAkB,EAAE;QACtB,MAAMC,WAAWD,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI;YAAE,QAAQ,CAAC;QAAE;QACnE,MAAMD,UAAUE,SAAS,MAAM,GAAGA,SAAS,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;QACvED,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG;YAChC,GAAGC,QAAQ;YACX,QAAQ;gBACJ,GAAIA,SAAS,MAAM,IAAI,CAAC,CAAC;gBACzB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;oBAChB,GAAGF,OAAO;oBACV,GAAG,IAAI,CAAC,OAAO;gBACnB;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document, StyleValueBinding } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class SetGlobalStyleBinding implements IDocumentOperation {
|
|
4
4
|
private readonly elementId;
|
|
5
5
|
private readonly bindingPath;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
class SetGlobalStyleBinding {
|
|
2
|
+
constructor(elementId, bindingPath, binding){
|
|
3
|
+
this.elementId = elementId;
|
|
4
|
+
this.bindingPath = bindingPath;
|
|
5
|
+
this.binding = binding;
|
|
6
|
+
}
|
|
7
|
+
apply(document) {
|
|
8
|
+
const bindings = document.bindings[this.elementId] ?? {
|
|
9
|
+
styles: {}
|
|
10
|
+
};
|
|
11
|
+
const binding = bindings.styles ? bindings.styles[this.bindingPath] ?? {} : {};
|
|
12
|
+
document.bindings[this.elementId] = {
|
|
13
|
+
...bindings,
|
|
14
|
+
styles: {
|
|
15
|
+
...bindings.styles,
|
|
16
|
+
[this.bindingPath]: {
|
|
17
|
+
...binding,
|
|
18
|
+
...this.binding
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
24
23
|
}
|
|
24
|
+
export { SetGlobalStyleBinding };
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=SetGlobalStyleBinding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"documentOperations/SetGlobalStyleBinding.js","sources":["../../src/documentOperations/SetGlobalStyleBinding.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetGlobalStyleBinding implements IDocumentOperation {\n private readonly elementId: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(elementId: string, bindingPath: string, binding: StyleValueBinding) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? { styles: {} };\n // @ts-expect-error String doesn't play well with CSSProperties.\n const binding = bindings.styles ? (bindings.styles[this.bindingPath] ?? {}) : {};\n document.bindings[this.elementId] = {\n ...bindings,\n styles: {\n ...bindings.styles,\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n };\n }\n}\n"],"names":["SetGlobalStyleBinding","elementId","bindingPath","binding","document","bindings"],"mappings":"AAGO,MAAMA;IAKT,YAAYC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,CAAE;QAC5E,IAAI,CAAC,SAAS,GAAGF;QACjB,IAAI,CAAC,WAAW,GAAGC;QACnB,IAAI,CAAC,OAAO,GAAGC;IACnB;IAEA,MAAMC,QAAkB,EAAE;QACtB,MAAMC,WAAWD,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI;YAAE,QAAQ,CAAC;QAAE;QAEnE,MAAMD,UAAUE,SAAS,MAAM,GAAIA,SAAS,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAK,CAAC;QAC/ED,SAAS,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG;YAChC,GAAGC,QAAQ;YACX,QAAQ;gBACJ,GAAGA,SAAS,MAAM;gBAClB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;oBAChB,GAAGF,OAAO;oBACV,GAAG,IAAI,CAAC,OAAO;gBACnB;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document, InputValueBinding } from "../types.js";
|
|
2
|
-
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation.js";
|
|
3
3
|
export declare class SetInputBindingOverride implements IDocumentOperation {
|
|
4
4
|
private readonly elementId;
|
|
5
5
|
private breakpoint;
|