@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.
Files changed (228) hide show
  1. package/BindingsApi.d.ts +25 -0
  2. package/BindingsApi.js +42 -0
  3. package/BindingsApi.js.map +1 -0
  4. package/BindingsProcessor.d.ts +11 -0
  5. package/BindingsProcessor.js +49 -0
  6. package/BindingsProcessor.js.map +1 -0
  7. package/BindingsProcessor.test.d.ts +1 -0
  8. package/BindingsProcessor.test.js +86 -0
  9. package/BindingsProcessor.test.js.map +1 -0
  10. package/BindingsResolver.d.ts +20 -0
  11. package/BindingsResolver.js +134 -0
  12. package/BindingsResolver.js.map +1 -0
  13. package/BindingsResolver.test.d.ts +1 -0
  14. package/BindingsResolver.test.js +382 -0
  15. package/BindingsResolver.test.js.map +1 -0
  16. package/ComponentInputTraverser.d.ts +18 -0
  17. package/ComponentInputTraverser.js +56 -0
  18. package/ComponentInputTraverser.js.map +1 -0
  19. package/ComponentManifestToAstConverter.d.ts +13 -0
  20. package/ComponentManifestToAstConverter.js +24 -0
  21. package/ComponentManifestToAstConverter.js.map +1 -0
  22. package/ComponentRegistry.d.ts +15 -0
  23. package/ComponentRegistry.js +25 -0
  24. package/ComponentRegistry.js.map +1 -0
  25. package/ComponentResolver.d.ts +14 -0
  26. package/ComponentResolver.js +36 -0
  27. package/ComponentResolver.js.map +1 -0
  28. package/ContentSdk.d.ts +38 -0
  29. package/ContentSdk.js +90 -0
  30. package/ContentSdk.js.map +1 -0
  31. package/DocumentStore.d.ts +15 -0
  32. package/DocumentStore.js +67 -0
  33. package/DocumentStore.js.map +1 -0
  34. package/DocumentStoreManager.d.ts +11 -0
  35. package/DocumentStoreManager.js +22 -0
  36. package/DocumentStoreManager.js.map +1 -0
  37. package/EditingSdk.d.ts +21 -0
  38. package/EditingSdk.js +143 -0
  39. package/EditingSdk.js.map +1 -0
  40. package/ElementFactory.d.ts +54 -0
  41. package/ElementFactory.js +183 -0
  42. package/ElementFactory.js.map +1 -0
  43. package/Environment.d.ts +9 -0
  44. package/Environment.js +23 -0
  45. package/Environment.js.map +1 -0
  46. package/FunctionConverter.d.ts +6 -0
  47. package/FunctionConverter.js +11 -0
  48. package/FunctionConverter.js.map +1 -0
  49. package/HashObject.d.ts +6 -0
  50. package/HashObject.js +17 -0
  51. package/HashObject.js.map +1 -0
  52. package/HotkeyManager.d.ts +6 -0
  53. package/HotkeyManager.js +58 -0
  54. package/HotkeyManager.js.map +1 -0
  55. package/IBindingsUpdater.d.ts +6 -0
  56. package/IBindingsUpdater.js +3 -0
  57. package/IBindingsUpdater.js.map +1 -0
  58. package/InheritanceProcessor.d.ts +29 -0
  59. package/InheritanceProcessor.js +147 -0
  60. package/InheritanceProcessor.js.map +1 -0
  61. package/InheritanceProcessor.test.d.ts +1 -0
  62. package/InheritanceProcessor.test.js +192 -0
  63. package/InheritanceProcessor.test.js.map +1 -0
  64. package/InheritedValueResolver.d.ts +10 -0
  65. package/InheritedValueResolver.js +24 -0
  66. package/InheritedValueResolver.js.map +1 -0
  67. package/InputBindingsProcessor.d.ts +38 -0
  68. package/InputBindingsProcessor.js +306 -0
  69. package/InputBindingsProcessor.js.map +1 -0
  70. package/InputsBindingsProcessor.test.d.ts +1 -0
  71. package/InputsBindingsProcessor.test.js +327 -0
  72. package/InputsBindingsProcessor.test.js.map +1 -0
  73. package/InputsUpdater.d.ts +12 -0
  74. package/InputsUpdater.js +34 -0
  75. package/InputsUpdater.js.map +1 -0
  76. package/LICENSE +21 -0
  77. package/LiveSdk.d.ts +7 -0
  78. package/LiveSdk.js +18 -0
  79. package/LiveSdk.js.map +1 -0
  80. package/Logger.d.ts +1 -0
  81. package/Logger.js +10 -0
  82. package/Logger.js.map +1 -0
  83. package/MouseTracker.d.ts +39 -0
  84. package/MouseTracker.js +93 -0
  85. package/MouseTracker.js.map +1 -0
  86. package/NullSdk.d.ts +7 -0
  87. package/NullSdk.js +14 -0
  88. package/NullSdk.js.map +1 -0
  89. package/PreviewDocument.d.ts +8 -0
  90. package/PreviewDocument.js +35 -0
  91. package/PreviewDocument.js.map +1 -0
  92. package/PreviewSdk.d.ts +8 -0
  93. package/PreviewSdk.js +22 -0
  94. package/PreviewSdk.js.map +1 -0
  95. package/PreviewViewport.d.ts +9 -0
  96. package/PreviewViewport.js +88 -0
  97. package/PreviewViewport.js.map +1 -0
  98. package/README.md +3 -0
  99. package/ResizeObserver.d.ts +5 -0
  100. package/ResizeObserver.js +41 -0
  101. package/ResizeObserver.js.map +1 -0
  102. package/StylesBindingsProcessor.d.ts +33 -0
  103. package/StylesBindingsProcessor.js +91 -0
  104. package/StylesBindingsProcessor.js.map +1 -0
  105. package/StylesUpdater.d.ts +10 -0
  106. package/StylesUpdater.js +34 -0
  107. package/StylesUpdater.js.map +1 -0
  108. package/Theme.d.ts +4 -0
  109. package/Theme.js +34 -0
  110. package/Theme.js.map +1 -0
  111. package/ViewportManager.d.ts +34 -0
  112. package/ViewportManager.js +103 -0
  113. package/ViewportManager.js.map +1 -0
  114. package/constants.d.ts +6 -0
  115. package/constants.js +8 -0
  116. package/constants.js.map +1 -0
  117. package/createElement.d.ts +10 -0
  118. package/createElement.js +8 -0
  119. package/createElement.js.map +1 -0
  120. package/createInput.d.ts +17 -0
  121. package/createInput.js +128 -0
  122. package/createInput.js.map +1 -0
  123. package/createTheme.d.ts +2 -0
  124. package/createTheme.js +5 -0
  125. package/createTheme.js.map +1 -0
  126. package/dataProviders/ApiClient.d.ts +13 -0
  127. package/dataProviders/ApiClient.js +43 -0
  128. package/dataProviders/ApiClient.js.map +1 -0
  129. package/dataProviders/DefaultDataProvider.d.ts +13 -0
  130. package/dataProviders/DefaultDataProvider.js +39 -0
  131. package/dataProviders/DefaultDataProvider.js.map +1 -0
  132. package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -0
  133. package/dataProviders/GET_PAGE_BY_ID.js +21 -0
  134. package/dataProviders/GET_PAGE_BY_ID.js.map +1 -0
  135. package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -0
  136. package/dataProviders/GET_PAGE_BY_PATH.js +21 -0
  137. package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -0
  138. package/dataProviders/LIST_PUBLISHED_PAGES.d.ts +1 -0
  139. package/dataProviders/LIST_PUBLISHED_PAGES.js +21 -0
  140. package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -0
  141. package/dataProviders/NullDataProvider.d.ts +6 -0
  142. package/dataProviders/NullDataProvider.js +13 -0
  143. package/dataProviders/NullDataProvider.js.map +1 -0
  144. package/defaultBreakpoints.d.ts +2 -0
  145. package/defaultBreakpoints.js +25 -0
  146. package/defaultBreakpoints.js.map +1 -0
  147. package/documentOperations/$addElementReferenceToParent.d.ts +9 -0
  148. package/documentOperations/$addElementReferenceToParent.js +31 -0
  149. package/documentOperations/$addElementReferenceToParent.js.map +1 -0
  150. package/documentOperations/AddElement.d.ts +7 -0
  151. package/documentOperations/AddElement.js +10 -0
  152. package/documentOperations/AddElement.js.map +1 -0
  153. package/documentOperations/AddToParent.d.ts +8 -0
  154. package/documentOperations/AddToParent.js +17 -0
  155. package/documentOperations/AddToParent.js.map +1 -0
  156. package/documentOperations/IDocumentOperation.d.ts +4 -0
  157. package/documentOperations/IDocumentOperation.js +3 -0
  158. package/documentOperations/IDocumentOperation.js.map +1 -0
  159. package/documentOperations/RemoveElement.d.ts +7 -0
  160. package/documentOperations/RemoveElement.js +10 -0
  161. package/documentOperations/RemoveElement.js.map +1 -0
  162. package/documentOperations/SetGlobalInputBinding.d.ts +9 -0
  163. package/documentOperations/SetGlobalInputBinding.js +25 -0
  164. package/documentOperations/SetGlobalInputBinding.js.map +1 -0
  165. package/documentOperations/SetGlobalStyleBinding.d.ts +9 -0
  166. package/documentOperations/SetGlobalStyleBinding.js +26 -0
  167. package/documentOperations/SetGlobalStyleBinding.js.map +1 -0
  168. package/documentOperations/SetInputBindingOverride.d.ts +10 -0
  169. package/documentOperations/SetInputBindingOverride.js +33 -0
  170. package/documentOperations/SetInputBindingOverride.js.map +1 -0
  171. package/documentOperations/SetStyleBindingOverride.d.ts +10 -0
  172. package/documentOperations/SetStyleBindingOverride.js +35 -0
  173. package/documentOperations/SetStyleBindingOverride.js.map +1 -0
  174. package/documentOperations/index.d.ts +17 -0
  175. package/documentOperations/index.js +18 -0
  176. package/documentOperations/index.js.map +1 -0
  177. package/findMatchingAstNode.d.ts +2 -0
  178. package/findMatchingAstNode.js +17 -0
  179. package/findMatchingAstNode.js.map +1 -0
  180. package/generateElementId.d.ts +1 -0
  181. package/generateElementId.js +7 -0
  182. package/generateElementId.js.map +1 -0
  183. package/headersProvider.d.ts +4 -0
  184. package/headersProvider.js +7 -0
  185. package/headersProvider.js.map +1 -0
  186. package/index.d.ts +31 -0
  187. package/index.js +33 -0
  188. package/index.js.map +1 -0
  189. package/jsonPatch.d.ts +6 -0
  190. package/jsonPatch.js +12 -0
  191. package/jsonPatch.js.map +1 -0
  192. package/lexical/createDefaultLexicalTheme.d.ts +2 -0
  193. package/lexical/createDefaultLexicalTheme.js +84 -0
  194. package/lexical/createDefaultLexicalTheme.js.map +1 -0
  195. package/lexical/createLexicalTheme.d.ts +2 -0
  196. package/lexical/createLexicalTheme.js +7 -0
  197. package/lexical/createLexicalTheme.js.map +1 -0
  198. package/lexical/deepMerge.d.ts +1 -0
  199. package/lexical/deepMerge.js +23 -0
  200. package/lexical/deepMerge.js.map +1 -0
  201. package/messages.d.ts +11 -0
  202. package/messages.js +13 -0
  203. package/messages.js.map +1 -0
  204. package/messenger/MessageOrigin.d.ts +7 -0
  205. package/messenger/MessageOrigin.js +14 -0
  206. package/messenger/MessageOrigin.js.map +1 -0
  207. package/messenger/Messenger.d.ts +22 -0
  208. package/messenger/Messenger.js +80 -0
  209. package/messenger/Messenger.js.map +1 -0
  210. package/messenger/index.d.ts +2 -0
  211. package/messenger/index.js +4 -0
  212. package/messenger/index.js.map +1 -0
  213. package/package.json +54 -0
  214. package/registerComponentGroup.d.ts +2 -0
  215. package/registerComponentGroup.js +10 -0
  216. package/registerComponentGroup.js.map +1 -0
  217. package/types/LexicalEditorTheme.d.ts +2 -0
  218. package/types/LexicalEditorTheme.js +3 -0
  219. package/types/LexicalEditorTheme.js.map +1 -0
  220. package/types/ShorthandCssProperties.d.ts +1 -0
  221. package/types/ShorthandCssProperties.js +3 -0
  222. package/types/ShorthandCssProperties.js.map +1 -0
  223. package/types/WebsiteBuilderTheme.d.ts +79 -0
  224. package/types/WebsiteBuilderTheme.js +3 -0
  225. package/types/WebsiteBuilderTheme.js.map +1 -0
  226. package/types.d.ts +294 -0
  227. package/types.js +3 -0
  228. 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,10 @@
1
+ export class AddElement {
2
+ constructor(element) {
3
+ this.element = element;
4
+ }
5
+ apply(document) {
6
+ document.elements[this.element.id] = this.element;
7
+ }
8
+ }
9
+
10
+ //# sourceMappingURL=AddElement.js.map
@@ -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,4 @@
1
+ import type { Document } from "../types.js";
2
+ export interface IDocumentOperation {
3
+ apply(document: Document): void;
4
+ }
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=IDocumentOperation.js.map
@@ -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,10 @@
1
+ export class RemoveElement {
2
+ constructor(elementId) {
3
+ this.elementId = elementId;
4
+ }
5
+ apply(document) {
6
+ delete document.elements[this.elementId];
7
+ }
8
+ }
9
+
10
+ //# sourceMappingURL=RemoveElement.js.map
@@ -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,2 @@
1
+ import type { InputAstNode } from "./ComponentManifestToAstConverter";
2
+ export declare function findMatchingAstNode(path: string, ast: InputAstNode[]): InputAstNode | undefined;
@@ -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,4 @@
1
+ type HeadersProvider = () => Promise<Headers>;
2
+ export declare const setHeadersProvider: (provider: HeadersProvider) => void;
3
+ export declare const getHeadersProvider: () => HeadersProvider;
4
+ export {};
@@ -0,0 +1,7 @@
1
+ let headersProvider;
2
+ export const setHeadersProvider = provider => {
3
+ headersProvider = provider;
4
+ };
5
+ export const getHeadersProvider = () => headersProvider;
6
+
7
+ //# sourceMappingURL=headersProvider.js.map
@@ -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
@@ -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":[]}
@@ -0,0 +1,2 @@
1
+ import type { LexicalEditorTheme } from "../types/LexicalEditorTheme";
2
+ export declare const createDefaultLexicalTheme: () => LexicalEditorTheme;