@webiny/website-builder-sdk 0.0.0-unstable.e53eceafb5
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 +25 -0
- package/BindingsApi.js +42 -0
- package/BindingsApi.js.map +1 -0
- package/BindingsProcessor.d.ts +11 -0
- package/BindingsProcessor.js +49 -0
- package/BindingsProcessor.js.map +1 -0
- package/BindingsProcessor.test.d.ts +1 -0
- package/BindingsProcessor.test.js +86 -0
- package/BindingsProcessor.test.js.map +1 -0
- package/BindingsResolver.d.ts +20 -0
- package/BindingsResolver.js +134 -0
- package/BindingsResolver.js.map +1 -0
- package/BindingsResolver.test.d.ts +1 -0
- package/BindingsResolver.test.js +382 -0
- package/BindingsResolver.test.js.map +1 -0
- package/ComponentInputTraverser.d.ts +18 -0
- package/ComponentInputTraverser.js +56 -0
- package/ComponentInputTraverser.js.map +1 -0
- package/ComponentManifestToAstConverter.d.ts +13 -0
- package/ComponentManifestToAstConverter.js +24 -0
- package/ComponentManifestToAstConverter.js.map +1 -0
- package/ComponentRegistry.d.ts +15 -0
- package/ComponentRegistry.js +25 -0
- package/ComponentRegistry.js.map +1 -0
- package/ComponentResolver.d.ts +14 -0
- package/ComponentResolver.js +36 -0
- package/ComponentResolver.js.map +1 -0
- package/ContentSdk.d.ts +38 -0
- package/ContentSdk.js +90 -0
- package/ContentSdk.js.map +1 -0
- package/DocumentStore.d.ts +15 -0
- package/DocumentStore.js +67 -0
- package/DocumentStore.js.map +1 -0
- package/DocumentStoreManager.d.ts +11 -0
- package/DocumentStoreManager.js +22 -0
- package/DocumentStoreManager.js.map +1 -0
- package/EditingSdk.d.ts +21 -0
- package/EditingSdk.js +143 -0
- package/EditingSdk.js.map +1 -0
- package/ElementFactory.d.ts +54 -0
- package/ElementFactory.js +183 -0
- package/ElementFactory.js.map +1 -0
- package/Environment.d.ts +9 -0
- package/Environment.js +23 -0
- package/Environment.js.map +1 -0
- package/FunctionConverter.d.ts +6 -0
- package/FunctionConverter.js +11 -0
- package/FunctionConverter.js.map +1 -0
- package/HashObject.d.ts +6 -0
- package/HashObject.js +17 -0
- package/HashObject.js.map +1 -0
- package/HotkeyManager.d.ts +6 -0
- package/HotkeyManager.js +58 -0
- package/HotkeyManager.js.map +1 -0
- package/IBindingsUpdater.d.ts +6 -0
- package/IBindingsUpdater.js +3 -0
- package/IBindingsUpdater.js.map +1 -0
- package/InheritanceProcessor.d.ts +29 -0
- package/InheritanceProcessor.js +147 -0
- package/InheritanceProcessor.js.map +1 -0
- package/InheritanceProcessor.test.d.ts +1 -0
- package/InheritanceProcessor.test.js +192 -0
- package/InheritanceProcessor.test.js.map +1 -0
- package/InheritedValueResolver.d.ts +10 -0
- package/InheritedValueResolver.js +24 -0
- package/InheritedValueResolver.js.map +1 -0
- package/InputBindingsProcessor.d.ts +38 -0
- package/InputBindingsProcessor.js +306 -0
- package/InputBindingsProcessor.js.map +1 -0
- package/InputsBindingsProcessor.test.d.ts +1 -0
- package/InputsBindingsProcessor.test.js +327 -0
- package/InputsBindingsProcessor.test.js.map +1 -0
- package/InputsUpdater.d.ts +12 -0
- package/InputsUpdater.js +34 -0
- package/InputsUpdater.js.map +1 -0
- package/LICENSE +21 -0
- package/LiveSdk.d.ts +7 -0
- package/LiveSdk.js +18 -0
- package/LiveSdk.js.map +1 -0
- package/Logger.d.ts +1 -0
- package/Logger.js +10 -0
- package/Logger.js.map +1 -0
- package/MouseTracker.d.ts +39 -0
- package/MouseTracker.js +93 -0
- package/MouseTracker.js.map +1 -0
- package/NullSdk.d.ts +7 -0
- package/NullSdk.js +14 -0
- package/NullSdk.js.map +1 -0
- package/PreviewDocument.d.ts +8 -0
- package/PreviewDocument.js +35 -0
- package/PreviewDocument.js.map +1 -0
- package/PreviewSdk.d.ts +8 -0
- package/PreviewSdk.js +22 -0
- package/PreviewSdk.js.map +1 -0
- package/PreviewViewport.d.ts +9 -0
- package/PreviewViewport.js +88 -0
- package/PreviewViewport.js.map +1 -0
- package/README.md +3 -0
- package/ResizeObserver.d.ts +5 -0
- package/ResizeObserver.js +41 -0
- package/ResizeObserver.js.map +1 -0
- package/StylesBindingsProcessor.d.ts +33 -0
- package/StylesBindingsProcessor.js +91 -0
- package/StylesBindingsProcessor.js.map +1 -0
- package/StylesUpdater.d.ts +10 -0
- package/StylesUpdater.js +34 -0
- package/StylesUpdater.js.map +1 -0
- package/Theme.d.ts +4 -0
- package/Theme.js +34 -0
- package/Theme.js.map +1 -0
- package/ViewportManager.d.ts +34 -0
- package/ViewportManager.js +103 -0
- package/ViewportManager.js.map +1 -0
- package/constants.d.ts +6 -0
- package/constants.js +8 -0
- package/constants.js.map +1 -0
- package/createElement.d.ts +10 -0
- package/createElement.js +8 -0
- package/createElement.js.map +1 -0
- package/createInput.d.ts +17 -0
- package/createInput.js +128 -0
- package/createInput.js.map +1 -0
- package/createTheme.d.ts +2 -0
- package/createTheme.js +5 -0
- package/createTheme.js.map +1 -0
- package/dataProviders/ApiClient.d.ts +13 -0
- package/dataProviders/ApiClient.js +43 -0
- package/dataProviders/ApiClient.js.map +1 -0
- package/dataProviders/DefaultDataProvider.d.ts +13 -0
- package/dataProviders/DefaultDataProvider.js +39 -0
- package/dataProviders/DefaultDataProvider.js.map +1 -0
- package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -0
- package/dataProviders/GET_PAGE_BY_ID.js +21 -0
- package/dataProviders/GET_PAGE_BY_ID.js.map +1 -0
- package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -0
- package/dataProviders/GET_PAGE_BY_PATH.js +21 -0
- package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -0
- package/dataProviders/LIST_PUBLISHED_PAGES.d.ts +1 -0
- package/dataProviders/LIST_PUBLISHED_PAGES.js +21 -0
- package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -0
- package/dataProviders/NullDataProvider.d.ts +6 -0
- package/dataProviders/NullDataProvider.js +13 -0
- package/dataProviders/NullDataProvider.js.map +1 -0
- package/defaultBreakpoints.d.ts +2 -0
- package/defaultBreakpoints.js +25 -0
- package/defaultBreakpoints.js.map +1 -0
- package/documentOperations/$addElementReferenceToParent.d.ts +9 -0
- package/documentOperations/$addElementReferenceToParent.js +31 -0
- package/documentOperations/$addElementReferenceToParent.js.map +1 -0
- package/documentOperations/AddElement.d.ts +7 -0
- package/documentOperations/AddElement.js +10 -0
- package/documentOperations/AddElement.js.map +1 -0
- package/documentOperations/AddToParent.d.ts +8 -0
- package/documentOperations/AddToParent.js +17 -0
- package/documentOperations/AddToParent.js.map +1 -0
- package/documentOperations/IDocumentOperation.d.ts +4 -0
- package/documentOperations/IDocumentOperation.js +3 -0
- package/documentOperations/IDocumentOperation.js.map +1 -0
- package/documentOperations/RemoveElement.d.ts +7 -0
- package/documentOperations/RemoveElement.js +10 -0
- package/documentOperations/RemoveElement.js.map +1 -0
- package/documentOperations/SetGlobalInputBinding.d.ts +9 -0
- package/documentOperations/SetGlobalInputBinding.js +25 -0
- package/documentOperations/SetGlobalInputBinding.js.map +1 -0
- package/documentOperations/SetGlobalStyleBinding.d.ts +9 -0
- package/documentOperations/SetGlobalStyleBinding.js +26 -0
- package/documentOperations/SetGlobalStyleBinding.js.map +1 -0
- package/documentOperations/SetInputBindingOverride.d.ts +10 -0
- package/documentOperations/SetInputBindingOverride.js +33 -0
- package/documentOperations/SetInputBindingOverride.js.map +1 -0
- package/documentOperations/SetStyleBindingOverride.d.ts +10 -0
- package/documentOperations/SetStyleBindingOverride.js +35 -0
- package/documentOperations/SetStyleBindingOverride.js.map +1 -0
- package/documentOperations/index.d.ts +17 -0
- package/documentOperations/index.js +18 -0
- package/documentOperations/index.js.map +1 -0
- package/findMatchingAstNode.d.ts +2 -0
- package/findMatchingAstNode.js +17 -0
- package/findMatchingAstNode.js.map +1 -0
- package/generateElementId.d.ts +1 -0
- package/generateElementId.js +7 -0
- package/generateElementId.js.map +1 -0
- package/headersProvider.d.ts +4 -0
- package/headersProvider.js +7 -0
- package/headersProvider.js.map +1 -0
- package/index.d.ts +31 -0
- package/index.js +33 -0
- package/index.js.map +1 -0
- package/jsonPatch.d.ts +6 -0
- package/jsonPatch.js +12 -0
- package/jsonPatch.js.map +1 -0
- package/lexical/createDefaultLexicalTheme.d.ts +2 -0
- package/lexical/createDefaultLexicalTheme.js +84 -0
- package/lexical/createDefaultLexicalTheme.js.map +1 -0
- package/lexical/createLexicalTheme.d.ts +2 -0
- package/lexical/createLexicalTheme.js +7 -0
- package/lexical/createLexicalTheme.js.map +1 -0
- package/lexical/deepMerge.d.ts +1 -0
- package/lexical/deepMerge.js +23 -0
- package/lexical/deepMerge.js.map +1 -0
- package/messages.d.ts +11 -0
- package/messages.js +13 -0
- package/messages.js.map +1 -0
- package/messenger/MessageOrigin.d.ts +7 -0
- package/messenger/MessageOrigin.js +14 -0
- package/messenger/MessageOrigin.js.map +1 -0
- package/messenger/Messenger.d.ts +22 -0
- package/messenger/Messenger.js +80 -0
- package/messenger/Messenger.js.map +1 -0
- package/messenger/index.d.ts +2 -0
- package/messenger/index.js +4 -0
- package/messenger/index.js.map +1 -0
- package/package.json +54 -0
- package/registerComponentGroup.d.ts +2 -0
- package/registerComponentGroup.js +10 -0
- package/registerComponentGroup.js.map +1 -0
- package/types/LexicalEditorTheme.d.ts +2 -0
- package/types/LexicalEditorTheme.js +3 -0
- package/types/LexicalEditorTheme.js.map +1 -0
- package/types/ShorthandCssProperties.d.ts +1 -0
- package/types/ShorthandCssProperties.js +3 -0
- package/types/ShorthandCssProperties.js.map +1 -0
- package/types/WebsiteBuilderTheme.d.ts +79 -0
- package/types/WebsiteBuilderTheme.js +3 -0
- package/types/WebsiteBuilderTheme.js.map +1 -0
- package/types.d.ts +294 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function $addElementReferenceToParent(document, {
|
|
2
|
+
elementId,
|
|
3
|
+
parentId,
|
|
4
|
+
slot,
|
|
5
|
+
index
|
|
6
|
+
}) {
|
|
7
|
+
const bindings = document.bindings[parentId] ?? {};
|
|
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
|
|
15
|
+
};
|
|
16
|
+
} else {
|
|
17
|
+
const slotElements = inputs[slot];
|
|
18
|
+
inputs[slot] = {
|
|
19
|
+
...inputs[slot],
|
|
20
|
+
type: "slot",
|
|
21
|
+
list: true,
|
|
22
|
+
static: [...(slotElements?.static ?? []).slice(0, index), elementId, ...(slotElements?.static ?? []).slice(index)]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
document.bindings[parentId] = {
|
|
26
|
+
...bindings,
|
|
27
|
+
inputs
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=$addElementReferenceToParent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["$addElementReferenceToParent","document","elementId","parentId","slot","index","bindings","inputs","type","static","slotElements","list","slice"],"sources":["$addElementReferenceToParent.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\nimport type { InputValueBinding } from \"~/types\";\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 < 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 inputs[slot] = {\n ...inputs[slot],\n type: \"slot\",\n list: true,\n static: [\n ...(slotElements?.static ?? []).slice(0, index),\n elementId,\n ...(slotElements?.static ?? []).slice(index)\n ]\n };\n }\n\n document.bindings[parentId] = {\n ...bindings,\n inputs\n };\n}\n"],"mappings":"AAUA,OAAO,SAASA,4BAA4BA,CACxCC,QAAkB,EAClB;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,IAAI;EAAEC;AAAc,CAAC,EAC9C;EACE,MAAMC,QAAQ,GAAGL,QAAQ,CAACK,QAAQ,CAACH,QAAQ,CAAC,IAAI,CAAC,CAAC;EAClD,MAAMI,MAAM,GAAGD,QAAQ,CAACC,MAAM,IAAI,CAAC,CAAC;EAEpC,IAAIF,KAAK,GAAG,CAAC,EAAE;IACX;IACAE,MAAM,CAACH,IAAI,CAAC,GAAG;MACX,GAAGG,MAAM,CAACH,IAAI,CAAC;MACfI,IAAI,EAAE,MAAM;MACZC,MAAM,EAAEP;IACZ,CAAC;EACL,CAAC,MAAM;IACH,MAAMQ,YAAY,GAAGH,MAAM,CAACH,IAAI,CAAsB;IACtDG,MAAM,CAACH,IAAI,CAAC,GAAG;MACX,GAAGG,MAAM,CAACH,IAAI,CAAC;MACfI,IAAI,EAAE,MAAM;MACZG,IAAI,EAAE,IAAI;MACVF,MAAM,EAAE,CACJ,GAAG,CAACC,YAAY,EAAED,MAAM,IAAI,EAAE,EAAEG,KAAK,CAAC,CAAC,EAAEP,KAAK,CAAC,EAC/CH,SAAS,EACT,GAAG,CAACQ,YAAY,EAAED,MAAM,IAAI,EAAE,EAAEG,KAAK,CAACP,KAAK,CAAC;IAEpD,CAAC;EACL;EAEAJ,QAAQ,CAACK,QAAQ,CAACH,QAAQ,CAAC,GAAG;IAC1B,GAAGG,QAAQ;IACXC;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Document, DocumentElement } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class AddElement implements IDocumentOperation {
|
|
4
|
+
private readonly element;
|
|
5
|
+
constructor(element: DocumentElement);
|
|
6
|
+
apply(document: Document): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AddElement","constructor","element","apply","document","elements","id"],"sources":["AddElement.ts"],"sourcesContent":["import type { Document, DocumentElement } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\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"],"mappings":"AAGA,OAAO,MAAMA,UAAU,CAA+B;EAGlDC,WAAWA,CAACC,OAAwB,EAAE;IAClC,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtBA,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACH,OAAO,CAACI,EAAE,CAAC,GAAG,IAAI,CAACJ,OAAO;EACrD;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Document, DocumentElement } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class AddToParent implements IDocumentOperation {
|
|
4
|
+
private element;
|
|
5
|
+
private readonly index;
|
|
6
|
+
constructor(element: DocumentElement, index: number);
|
|
7
|
+
apply(document: Document): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $addElementReferenceToParent } from "./$addElementReferenceToParent.js";
|
|
2
|
+
export 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
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=AddToParent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["$addElementReferenceToParent","AddToParent","constructor","element","index","apply","document","elementId","id","parentId","parent","slot"],"sources":["AddToParent.ts"],"sourcesContent":["import type { Document, DocumentElement } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\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"],"mappings":"AAEA,SAASA,4BAA4B;AAErC,OAAO,MAAMC,WAAW,CAA+B;EAInDC,WAAWA,CAACC,OAAwB,EAAEC,KAAa,EAAE;IACjD,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,KAAK,GAAGA,KAAK;EACtB;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtBN,4BAA4B,CAACM,QAAQ,EAAE;MACnCC,SAAS,EAAE,IAAI,CAACJ,OAAO,CAACK,EAAE;MAC1BC,QAAQ,EAAE,IAAI,CAACN,OAAO,CAACO,MAAM,CAAEF,EAAE;MACjCG,IAAI,EAAE,IAAI,CAACR,OAAO,CAACO,MAAM,CAAEC,IAAI;MAC/BP,KAAK,EAAE,IAAI,CAACA;IAChB,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["IDocumentOperation.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\n\nexport interface IDocumentOperation {\n apply(document: Document): void;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Document } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class RemoveElement implements IDocumentOperation {
|
|
4
|
+
private readonly elementId;
|
|
5
|
+
constructor(elementId: string);
|
|
6
|
+
apply(document: Document): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RemoveElement","constructor","elementId","apply","document","elements"],"sources":["RemoveElement.ts"],"sourcesContent":["import type { Document } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\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 delete document.elements[this.elementId];\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,aAAa,CAA+B;EAGrDC,WAAWA,CAACC,SAAiB,EAAE;IAC3B,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC9B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,OAAOA,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACH,SAAS,CAAC;EAC5C;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Document, InputValueBinding } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class SetGlobalInputBinding implements IDocumentOperation {
|
|
4
|
+
private readonly elementId;
|
|
5
|
+
private readonly bindingPath;
|
|
6
|
+
private readonly binding;
|
|
7
|
+
constructor(elementId: string, bindingPath: string, binding: InputValueBinding);
|
|
8
|
+
apply(document: Document): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export 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
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=SetGlobalInputBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SetGlobalInputBinding","constructor","elementId","bindingPath","binding","apply","document","bindings","inputs"],"sources":["SetGlobalInputBinding.ts"],"sourcesContent":["import type { Document, InputValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\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"],"mappings":"AAGA,OAAO,MAAMA,qBAAqB,CAA+B;EAK7DC,WAAWA,CAACC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,EAAE;IAC5E,IAAI,CAACF,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,IAAI;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IACpE,MAAMJ,OAAO,GAAGG,QAAQ,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM,CAAC,IAAI,CAACL,WAAW,CAAC,GAAG,CAAC,CAAC;IACxEG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,GAAG;MAChC,GAAGK,QAAQ;MACXC,MAAM,EAAE;QACJ,IAAID,QAAQ,CAACC,MAAM,IAAI,CAAC,CAAC,CAAC;QAC1B,CAAC,IAAI,CAACL,WAAW,GAAG;UAChB,GAAGC,OAAO;UACV,GAAG,IAAI,CAACA;QACZ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Document, StyleValueBinding } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class SetGlobalStyleBinding implements IDocumentOperation {
|
|
4
|
+
private readonly elementId;
|
|
5
|
+
private readonly bindingPath;
|
|
6
|
+
private readonly binding;
|
|
7
|
+
constructor(elementId: string, bindingPath: string, binding: StyleValueBinding);
|
|
8
|
+
apply(document: Document): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export 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
|
+
// @ts-expect-error String doesn't play well with CSSProperties.
|
|
12
|
+
const binding = bindings.styles ? bindings.styles[this.bindingPath] ?? {} : {};
|
|
13
|
+
document.bindings[this.elementId] = {
|
|
14
|
+
...bindings,
|
|
15
|
+
styles: {
|
|
16
|
+
...bindings.styles,
|
|
17
|
+
[this.bindingPath]: {
|
|
18
|
+
...binding,
|
|
19
|
+
...this.binding
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=SetGlobalStyleBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SetGlobalStyleBinding","constructor","elementId","bindingPath","binding","apply","document","bindings","styles"],"sources":["SetGlobalStyleBinding.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\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"],"mappings":"AAGA,OAAO,MAAMA,qBAAqB,CAA+B;EAK7DC,WAAWA,CAACC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,EAAE;IAC5E,IAAI,CAACF,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,IAAI;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IACpE;IACA,MAAMJ,OAAO,GAAGG,QAAQ,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM,CAAC,IAAI,CAACL,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9EG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,GAAG;MAChC,GAAGK,QAAQ;MACXC,MAAM,EAAE;QACJ,GAAGD,QAAQ,CAACC,MAAM;QAClB,CAAC,IAAI,CAACL,WAAW,GAAG;UAChB,GAAGC,OAAO;UACV,GAAG,IAAI,CAACA;QACZ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Document, InputValueBinding } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class SetInputBindingOverride implements IDocumentOperation {
|
|
4
|
+
private readonly elementId;
|
|
5
|
+
private breakpoint;
|
|
6
|
+
private readonly bindingPath;
|
|
7
|
+
private readonly binding;
|
|
8
|
+
constructor(elementId: string, bindingPath: string, binding: InputValueBinding, breakpoint: string);
|
|
9
|
+
apply(document: Document): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class SetInputBindingOverride {
|
|
2
|
+
constructor(elementId, bindingPath, binding, breakpoint) {
|
|
3
|
+
this.elementId = elementId;
|
|
4
|
+
this.bindingPath = bindingPath;
|
|
5
|
+
this.binding = binding;
|
|
6
|
+
this.breakpoint = breakpoint;
|
|
7
|
+
}
|
|
8
|
+
apply(document) {
|
|
9
|
+
const bindings = document.bindings[this.elementId] ?? {};
|
|
10
|
+
const breakpointOverrides = bindings.overrides ? bindings.overrides[this.breakpoint] ?? {} : {
|
|
11
|
+
inputs: {}
|
|
12
|
+
};
|
|
13
|
+
const binding = breakpointOverrides.inputs ? breakpointOverrides.inputs[this.bindingPath] : {};
|
|
14
|
+
document.bindings[this.elementId] = {
|
|
15
|
+
...bindings,
|
|
16
|
+
overrides: {
|
|
17
|
+
...(bindings.overrides || {}),
|
|
18
|
+
[this.breakpoint]: {
|
|
19
|
+
...breakpointOverrides,
|
|
20
|
+
inputs: {
|
|
21
|
+
...(breakpointOverrides.inputs || {}),
|
|
22
|
+
[this.bindingPath]: {
|
|
23
|
+
...binding,
|
|
24
|
+
...this.binding
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=SetInputBindingOverride.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SetInputBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","inputs"],"sources":["SetInputBindingOverride.ts"],"sourcesContent":["import type { Document, InputValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\n\nexport class SetInputBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: InputValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: InputValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? bindings.overrides[this.breakpoint] ?? {}\n : { inputs: {} };\n\n const binding = breakpointOverrides.inputs\n ? breakpointOverrides.inputs[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n inputs: {\n ...(breakpointOverrides.inputs || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACxCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GACzC;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM,GACpCF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Document, StyleValueBinding } from "../types.js";
|
|
2
|
+
import type { IDocumentOperation } from "./IDocumentOperation";
|
|
3
|
+
export declare class SetStyleBindingOverride implements IDocumentOperation {
|
|
4
|
+
private readonly elementId;
|
|
5
|
+
private breakpoint;
|
|
6
|
+
private readonly bindingPath;
|
|
7
|
+
private readonly binding;
|
|
8
|
+
constructor(elementId: string, bindingPath: string, binding: StyleValueBinding, breakpoint: string);
|
|
9
|
+
apply(document: Document): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class SetStyleBindingOverride {
|
|
2
|
+
constructor(elementId, bindingPath, binding, breakpoint) {
|
|
3
|
+
this.elementId = elementId;
|
|
4
|
+
this.bindingPath = bindingPath;
|
|
5
|
+
this.binding = binding;
|
|
6
|
+
this.breakpoint = breakpoint;
|
|
7
|
+
}
|
|
8
|
+
apply(document) {
|
|
9
|
+
const bindings = document.bindings[this.elementId] ?? {};
|
|
10
|
+
const breakpointOverrides = bindings.overrides ? bindings.overrides[this.breakpoint] ?? {} : {
|
|
11
|
+
styles: {}
|
|
12
|
+
};
|
|
13
|
+
const binding = breakpointOverrides.styles ?
|
|
14
|
+
// @ts-expect-error String doesn't play well with CSSProperties.
|
|
15
|
+
breakpointOverrides.styles[this.bindingPath] : {};
|
|
16
|
+
document.bindings[this.elementId] = {
|
|
17
|
+
...bindings,
|
|
18
|
+
overrides: {
|
|
19
|
+
...(bindings.overrides || {}),
|
|
20
|
+
[this.breakpoint]: {
|
|
21
|
+
...breakpointOverrides,
|
|
22
|
+
styles: {
|
|
23
|
+
...(breakpointOverrides.styles || {}),
|
|
24
|
+
[this.bindingPath]: {
|
|
25
|
+
...binding,
|
|
26
|
+
...this.binding
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=SetStyleBindingOverride.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SetStyleBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","styles"],"sources":["SetStyleBindingOverride.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation\";\n\nexport class SetStyleBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: StyleValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? bindings.overrides[this.breakpoint] ?? {}\n : { styles: {} };\n\n const binding = breakpointOverrides.styles\n ? // @ts-expect-error String doesn't play well with CSSProperties.\n breakpointOverrides.styles[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n styles: {\n ...(breakpointOverrides.styles || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACxCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GACzC;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM;IACpC;IACAF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { IDocumentOperation } from "./IDocumentOperation";
|
|
2
|
+
import { AddElement } from "./AddElement";
|
|
3
|
+
import { AddToParent } from "./AddToParent";
|
|
4
|
+
import { RemoveElement } from "./RemoveElement";
|
|
5
|
+
import { SetGlobalInputBinding } from "./SetGlobalInputBinding";
|
|
6
|
+
import { SetGlobalStyleBinding } from "./SetGlobalStyleBinding";
|
|
7
|
+
import { SetInputBindingOverride } from "./SetInputBindingOverride";
|
|
8
|
+
import { SetStyleBindingOverride } from "./SetStyleBindingOverride";
|
|
9
|
+
export declare const DocumentOperations: {
|
|
10
|
+
AddElement: typeof AddElement;
|
|
11
|
+
AddToParent: typeof AddToParent;
|
|
12
|
+
RemoveElement: typeof RemoveElement;
|
|
13
|
+
SetGlobalInputBinding: typeof SetGlobalInputBinding;
|
|
14
|
+
SetGlobalStyleBinding: typeof SetGlobalStyleBinding;
|
|
15
|
+
SetInputBindingOverride: typeof SetInputBindingOverride;
|
|
16
|
+
SetStyleBindingOverride: typeof SetStyleBindingOverride;
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AddElement } from "./AddElement";
|
|
2
|
+
import { AddToParent } from "./AddToParent";
|
|
3
|
+
import { RemoveElement } from "./RemoveElement";
|
|
4
|
+
import { SetGlobalInputBinding } from "./SetGlobalInputBinding";
|
|
5
|
+
import { SetGlobalStyleBinding } from "./SetGlobalStyleBinding";
|
|
6
|
+
import { SetInputBindingOverride } from "./SetInputBindingOverride";
|
|
7
|
+
import { SetStyleBindingOverride } from "./SetStyleBindingOverride";
|
|
8
|
+
export const DocumentOperations = {
|
|
9
|
+
AddElement,
|
|
10
|
+
AddToParent,
|
|
11
|
+
RemoveElement,
|
|
12
|
+
SetGlobalInputBinding,
|
|
13
|
+
SetGlobalStyleBinding,
|
|
14
|
+
SetInputBindingOverride,
|
|
15
|
+
SetStyleBindingOverride
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AddElement","AddToParent","RemoveElement","SetGlobalInputBinding","SetGlobalStyleBinding","SetInputBindingOverride","SetStyleBindingOverride","DocumentOperations"],"sources":["index.ts"],"sourcesContent":["export type { IDocumentOperation } from \"./IDocumentOperation\";\nimport { AddElement } from \"./AddElement\";\nimport { AddToParent } from \"./AddToParent\";\nimport { RemoveElement } from \"./RemoveElement\";\nimport { SetGlobalInputBinding } from \"./SetGlobalInputBinding\";\nimport { SetGlobalStyleBinding } from \"./SetGlobalStyleBinding\";\nimport { SetInputBindingOverride } from \"./SetInputBindingOverride\";\nimport { SetStyleBindingOverride } from \"./SetStyleBindingOverride\";\n\nexport const DocumentOperations = {\n AddElement,\n AddToParent,\n RemoveElement,\n SetGlobalInputBinding,\n SetGlobalStyleBinding,\n SetInputBindingOverride,\n SetStyleBindingOverride\n};\n"],"mappings":"AACA,SAASA,UAAU;AACnB,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,qBAAqB;AAC9B,SAASC,qBAAqB;AAC9B,SAASC,uBAAuB;AAChC,SAASC,uBAAuB;AAEhC,OAAO,MAAMC,kBAAkB,GAAG;EAC9BP,UAAU;EACVC,WAAW;EACXC,aAAa;EACbC,qBAAqB;EACrBC,qBAAqB;EACrBC,uBAAuB;EACvBC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function findMatchingAstNode(path, ast) {
|
|
2
|
+
// Remove all array indices, e.g. columns[0].children → columns.children
|
|
3
|
+
const cleanedPath = path.replace(/\[\d+\]/g, "");
|
|
4
|
+
const pathParts = cleanedPath.split(".");
|
|
5
|
+
let nodes = ast;
|
|
6
|
+
let currentNode;
|
|
7
|
+
for (const part of pathParts) {
|
|
8
|
+
currentNode = nodes.find(n => n.name === part);
|
|
9
|
+
if (!currentNode) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
nodes = currentNode.children;
|
|
13
|
+
}
|
|
14
|
+
return currentNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=findMatchingAstNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["findMatchingAstNode","path","ast","cleanedPath","replace","pathParts","split","nodes","currentNode","part","find","n","name","undefined","children"],"sources":["findMatchingAstNode.ts"],"sourcesContent":["import type { InputAstNode } from \"~/ComponentManifestToAstConverter\";\n\nexport function findMatchingAstNode(path: string, ast: InputAstNode[]): InputAstNode | undefined {\n // Remove all array indices, e.g. columns[0].children → columns.children\n const cleanedPath = path.replace(/\\[\\d+\\]/g, \"\");\n const pathParts = cleanedPath.split(\".\");\n\n let nodes = ast;\n let currentNode: InputAstNode | undefined;\n\n for (const part of pathParts) {\n currentNode = nodes.find(n => n.name === part);\n if (!currentNode) {\n return undefined;\n }\n\n nodes = currentNode.children;\n }\n\n return currentNode;\n}\n"],"mappings":"AAEA,OAAO,SAASA,mBAAmBA,CAACC,IAAY,EAAEC,GAAmB,EAA4B;EAC7F;EACA,MAAMC,WAAW,GAAGF,IAAI,CAACG,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;EAChD,MAAMC,SAAS,GAAGF,WAAW,CAACG,KAAK,CAAC,GAAG,CAAC;EAExC,IAAIC,KAAK,GAAGL,GAAG;EACf,IAAIM,WAAqC;EAEzC,KAAK,MAAMC,IAAI,IAAIJ,SAAS,EAAE;IAC1BG,WAAW,GAAGD,KAAK,CAACG,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,KAAKH,IAAI,CAAC;IAC9C,IAAI,CAACD,WAAW,EAAE;MACd,OAAOK,SAAS;IACpB;IAEAN,KAAK,GAAGC,WAAW,CAACM,QAAQ;EAChC;EAEA,OAAON,WAAW;AACtB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateElementId: (size?: number | undefined) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { customAlphabet } from "nanoid";
|
|
2
|
+
// @ts-expect-error
|
|
3
|
+
import { lowercase, numbers } from "nanoid-dictionary";
|
|
4
|
+
const DEFAULT_SIZE = 21;
|
|
5
|
+
export const generateElementId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE);
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=generateElementId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["customAlphabet","lowercase","numbers","DEFAULT_SIZE","generateElementId"],"sources":["generateElementId.ts"],"sourcesContent":["import { customAlphabet } from \"nanoid\";\n// @ts-expect-error\nimport { lowercase, numbers } from \"nanoid-dictionary\";\n\nconst DEFAULT_SIZE = 21;\n\nexport const generateElementId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE);\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,QAAQ;AACvC;AACA,SAASC,SAAS,EAAEC,OAAO,QAAQ,mBAAmB;AAEtD,MAAMC,YAAY,GAAG,EAAE;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,cAAc,CAAC,GAAGC,SAAS,GAAGC,OAAO,EAAE,EAAEC,YAAY,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["headersProvider","setHeadersProvider","provider","getHeadersProvider"],"sources":["headersProvider.ts"],"sourcesContent":["type HeadersProvider = () => Promise<Headers>;\n\nlet headersProvider: HeadersProvider;\n\nexport const setHeadersProvider = (provider: HeadersProvider) => {\n headersProvider = provider;\n};\n\nexport const getHeadersProvider = () => headersProvider;\n"],"mappings":"AAEA,IAAIA,eAAgC;AAEpC,OAAO,MAAMC,kBAAkB,GAAIC,QAAyB,IAAK;EAC7DF,eAAe,GAAGE,QAAQ;AAC9B,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAMH,eAAe","ignoreList":[]}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from "./createTheme";
|
|
2
|
+
export * from "./EditingSdk.js";
|
|
3
|
+
export * from "./LiveSdk.js";
|
|
4
|
+
export * from "./NullSdk.js";
|
|
5
|
+
export * from "./ContentSdk.js";
|
|
6
|
+
export * from "./Environment.js";
|
|
7
|
+
export * from "./DocumentStore.js";
|
|
8
|
+
export * from "./Logger.js";
|
|
9
|
+
export * from "./FunctionConverter.js";
|
|
10
|
+
export * from "./createInput.js";
|
|
11
|
+
export * from "./MouseTracker.js";
|
|
12
|
+
export * from "./ViewportManager.js";
|
|
13
|
+
export * from "./messenger/Messenger.js";
|
|
14
|
+
export * from "./messenger/MessageOrigin.js";
|
|
15
|
+
export * from "./types.js";
|
|
16
|
+
export * from "./DocumentStoreManager.js";
|
|
17
|
+
export * from "./BindingsProcessor.js";
|
|
18
|
+
export * from "./ResizeObserver.js";
|
|
19
|
+
export * from "./BindingsResolver.js";
|
|
20
|
+
export * from "./createElement.js";
|
|
21
|
+
export * from "./registerComponentGroup.js";
|
|
22
|
+
export * from "./jsonPatch.js";
|
|
23
|
+
export * from "./headersProvider.js";
|
|
24
|
+
export * from "./ComponentManifestToAstConverter.js";
|
|
25
|
+
export * from "./findMatchingAstNode.js";
|
|
26
|
+
export * from "./InheritanceProcessor.js";
|
|
27
|
+
export * from "./InputBindingsProcessor.js";
|
|
28
|
+
export * from "./StylesBindingsProcessor.js";
|
|
29
|
+
export * from "./ElementFactory.js";
|
|
30
|
+
export { StyleSettings } from "./constants.js";
|
|
31
|
+
export * from "./constants";
|
package/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export * from "./createTheme";
|
|
2
|
+
export * from "./EditingSdk.js";
|
|
3
|
+
export * from "./LiveSdk.js";
|
|
4
|
+
export * from "./NullSdk.js";
|
|
5
|
+
export * from "./ContentSdk.js";
|
|
6
|
+
export * from "./Environment.js";
|
|
7
|
+
export * from "./DocumentStore.js";
|
|
8
|
+
export * from "./Logger.js";
|
|
9
|
+
export * from "./FunctionConverter.js";
|
|
10
|
+
export * from "./createInput.js";
|
|
11
|
+
export * from "./MouseTracker.js";
|
|
12
|
+
export * from "./ViewportManager.js";
|
|
13
|
+
export * from "./messenger/Messenger.js";
|
|
14
|
+
export * from "./messenger/MessageOrigin.js";
|
|
15
|
+
export * from "./types.js";
|
|
16
|
+
export * from "./DocumentStoreManager.js";
|
|
17
|
+
export * from "./BindingsProcessor.js";
|
|
18
|
+
export * from "./ResizeObserver.js";
|
|
19
|
+
export * from "./BindingsResolver.js";
|
|
20
|
+
export * from "./createElement.js";
|
|
21
|
+
export * from "./registerComponentGroup.js";
|
|
22
|
+
export * from "./jsonPatch.js";
|
|
23
|
+
export * from "./headersProvider.js";
|
|
24
|
+
export * from "./ComponentManifestToAstConverter.js";
|
|
25
|
+
export * from "./findMatchingAstNode.js";
|
|
26
|
+
export * from "./InheritanceProcessor.js";
|
|
27
|
+
export * from "./InputBindingsProcessor.js";
|
|
28
|
+
export * from "./StylesBindingsProcessor.js";
|
|
29
|
+
export * from "./ElementFactory.js";
|
|
30
|
+
export { StyleSettings } from "./constants.js";
|
|
31
|
+
export * from "./constants";
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSettings"],"sources":["index.ts"],"sourcesContent":["export * from \"./createTheme\";\nexport * from \"./EditingSdk.js\";\nexport * from \"./LiveSdk.js\";\nexport * from \"./NullSdk.js\";\nexport * from \"./ContentSdk.js\";\nexport * from \"./Environment.js\";\nexport * from \"./DocumentStore.js\";\nexport * from \"./Logger.js\";\nexport * from \"./FunctionConverter.js\";\nexport * from \"./createInput.js\";\nexport * from \"./MouseTracker.js\";\nexport * from \"./ViewportManager.js\";\nexport * from \"./messenger/Messenger.js\";\nexport * from \"./messenger/MessageOrigin.js\";\nexport * from \"./types.js\";\nexport * from \"./DocumentStoreManager.js\";\nexport * from \"./BindingsProcessor.js\";\nexport * from \"./ResizeObserver.js\";\nexport * from \"./BindingsResolver.js\";\nexport * from \"./createElement.js\";\nexport * from \"./registerComponentGroup.js\";\nexport * from \"./jsonPatch.js\";\nexport * from \"./headersProvider.js\";\nexport * from \"./ComponentManifestToAstConverter.js\";\nexport * from \"./findMatchingAstNode.js\";\nexport * from \"./InheritanceProcessor.js\";\nexport * from \"./InputBindingsProcessor.js\";\nexport * from \"./StylesBindingsProcessor.js\";\nexport * from \"./ElementFactory.js\";\nexport { StyleSettings } from \"./constants.js\";\nexport * from \"./constants\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa;AACtB","ignoreList":[]}
|
package/jsonPatch.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Operation, Validator, PatchResult } from "fast-json-patch";
|
|
2
|
+
export type { Operation as JsonPatchOperation, PatchResult as JsonPatchResult };
|
|
3
|
+
export declare const jsonPatch: {
|
|
4
|
+
compare: (tree1: object | any[], tree2: object | any[], invertible?: boolean) => Operation[];
|
|
5
|
+
applyPatch: <T>(document: T, patch: Operation[], validateOperation?: boolean | Validator<T> | undefined, mutateDocument?: boolean, banPrototypeModifications?: boolean) => PatchResult<T>;
|
|
6
|
+
};
|
package/jsonPatch.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @ts-expect-error We need this hack.
|
|
2
|
+
import * as fjp from "fast-json-patch/index.mjs";
|
|
3
|
+
export const jsonPatch = {
|
|
4
|
+
compare: (tree1, tree2, invertible) => {
|
|
5
|
+
return fjp.compare(tree1, tree2, invertible);
|
|
6
|
+
},
|
|
7
|
+
applyPatch: (document, patch, validateOperation, mutateDocument, banPrototypeModifications) => {
|
|
8
|
+
return fjp.applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=jsonPatch.js.map
|
package/jsonPatch.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fjp","jsonPatch","compare","tree1","tree2","invertible","applyPatch","document","patch","validateOperation","mutateDocument","banPrototypeModifications"],"sources":["jsonPatch.ts"],"sourcesContent":["import type { Operation, Validator, PatchResult } from \"fast-json-patch\";\n// @ts-expect-error We need this hack.\nimport * as fjp from \"fast-json-patch/index.mjs\";\n\nexport type { Operation as JsonPatchOperation, PatchResult as JsonPatchResult };\n\nexport const jsonPatch = {\n compare: (tree1: object | any[], tree2: object | any[], invertible?: boolean): Operation[] => {\n return fjp.compare(tree1, tree2, invertible);\n },\n applyPatch: <T>(\n document: T,\n patch: Operation[],\n validateOperation?: boolean | Validator<T>,\n mutateDocument?: boolean,\n banPrototypeModifications?: boolean\n ): PatchResult<T> => {\n return fjp.applyPatch(\n document,\n patch,\n validateOperation,\n mutateDocument,\n banPrototypeModifications\n );\n }\n};\n"],"mappings":"AACA;AACA,OAAO,KAAKA,GAAG,MAAM,2BAA2B;AAIhD,OAAO,MAAMC,SAAS,GAAG;EACrBC,OAAO,EAAEA,CAACC,KAAqB,EAAEC,KAAqB,EAAEC,UAAoB,KAAkB;IAC1F,OAAOL,GAAG,CAACE,OAAO,CAACC,KAAK,EAAEC,KAAK,EAAEC,UAAU,CAAC;EAChD,CAAC;EACDC,UAAU,EAAEA,CACRC,QAAW,EACXC,KAAkB,EAClBC,iBAA0C,EAC1CC,cAAwB,EACxBC,yBAAmC,KAClB;IACjB,OAAOX,GAAG,CAACM,UAAU,CACjBC,QAAQ,EACRC,KAAK,EACLC,iBAAiB,EACjBC,cAAc,EACdC,yBACJ,CAAC;EACL;AACJ,CAAC","ignoreList":[]}
|