@webiny/website-builder-sdk 0.0.0-unstable.6844005670 → 0.0.0-unstable.7be00a75a9

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 (169) hide show
  1. package/BindingsApi.js +29 -36
  2. package/BindingsApi.js.map +1 -1
  3. package/BindingsProcessor.js +34 -43
  4. package/BindingsProcessor.js.map +1 -1
  5. package/BindingsProcessor.test.js +82 -78
  6. package/BindingsProcessor.test.js.map +1 -1
  7. package/BindingsResolver.js +92 -122
  8. package/BindingsResolver.js.map +1 -1
  9. package/BindingsResolver.test.js +399 -363
  10. package/BindingsResolver.test.js.map +1 -1
  11. package/ComponentInputTraverser.js +28 -49
  12. package/ComponentInputTraverser.js.map +1 -1
  13. package/ComponentManifestToAstConverter.js +20 -21
  14. package/ComponentManifestToAstConverter.js.map +1 -1
  15. package/ComponentRegistry.js +33 -22
  16. package/ComponentRegistry.js.map +1 -1
  17. package/ComponentResolver.js +25 -29
  18. package/ComponentResolver.js.map +1 -1
  19. package/ConstraintEvaluator.d.ts +36 -0
  20. package/ConstraintEvaluator.js +288 -0
  21. package/ConstraintEvaluator.js.map +1 -0
  22. package/ConstraintEvaluator.test.d.ts +1 -0
  23. package/ConstraintEvaluator.test.js +1634 -0
  24. package/ConstraintEvaluator.test.js.map +1 -0
  25. package/ContentSdk.js +83 -90
  26. package/ContentSdk.js.map +1 -1
  27. package/DocumentStore.js +47 -59
  28. package/DocumentStore.js.map +1 -1
  29. package/DocumentStoreManager.js +17 -16
  30. package/DocumentStoreManager.js.map +1 -1
  31. package/EditingSdk.js +87 -121
  32. package/EditingSdk.js.map +1 -1
  33. package/ElementFactory.d.ts +2 -3
  34. package/ElementFactory.js +125 -164
  35. package/ElementFactory.js.map +1 -1
  36. package/ElementFactory.test.d.ts +1 -0
  37. package/ElementFactory.test.js +251 -0
  38. package/ElementFactory.test.js.map +1 -0
  39. package/Environment.js +18 -19
  40. package/Environment.js.map +1 -1
  41. package/FunctionConverter.js +8 -7
  42. package/FunctionConverter.js.map +1 -1
  43. package/HashObject.js +11 -12
  44. package/HashObject.js.map +1 -1
  45. package/HotkeyManager.js +40 -47
  46. package/HotkeyManager.js.map +1 -1
  47. package/IBindingsUpdater.js +0 -3
  48. package/IRedirects.js +0 -3
  49. package/InheritanceProcessor.js +99 -139
  50. package/InheritanceProcessor.js.map +1 -1
  51. package/InheritanceProcessor.test.js +178 -179
  52. package/InheritanceProcessor.test.js.map +1 -1
  53. package/InheritedValueResolver.js +15 -20
  54. package/InheritedValueResolver.js.map +1 -1
  55. package/InputBindingsProcessor.js +187 -289
  56. package/InputBindingsProcessor.js.map +1 -1
  57. package/InputsBindingsProcessor.test.js +334 -314
  58. package/InputsBindingsProcessor.test.js.map +1 -1
  59. package/InputsUpdater.d.ts +1 -1
  60. package/InputsUpdater.js +23 -26
  61. package/InputsUpdater.js.map +1 -1
  62. package/LiveSdk.js +12 -13
  63. package/LiveSdk.js.map +1 -1
  64. package/Logger.js +9 -8
  65. package/Logger.js.map +1 -1
  66. package/MouseTracker.js +77 -83
  67. package/MouseTracker.js.map +1 -1
  68. package/NullSdk.d.ts +3 -2
  69. package/NullSdk.js +22 -21
  70. package/NullSdk.js.map +1 -1
  71. package/PreviewDocument.js +27 -30
  72. package/PreviewDocument.js.map +1 -1
  73. package/PreviewSdk.js +16 -17
  74. package/PreviewSdk.js.map +1 -1
  75. package/PreviewViewport.js +51 -63
  76. package/PreviewViewport.js.map +1 -1
  77. package/ResizeObserver.js +24 -31
  78. package/ResizeObserver.js.map +1 -1
  79. package/StylesBindingsProcessor.js +40 -79
  80. package/StylesBindingsProcessor.js.map +1 -1
  81. package/StylesUpdater.d.ts +1 -1
  82. package/StylesUpdater.js +20 -25
  83. package/StylesUpdater.js.map +1 -1
  84. package/Theme.js +29 -25
  85. package/Theme.js.map +1 -1
  86. package/ViewportManager.js +89 -101
  87. package/ViewportManager.js.map +1 -1
  88. package/constants.d.ts +1 -0
  89. package/constants.js +7 -5
  90. package/constants.js.map +1 -1
  91. package/createElement.js +5 -6
  92. package/createElement.js.map +1 -1
  93. package/createInput.js +85 -143
  94. package/createInput.js.map +1 -1
  95. package/createTheme.js +2 -3
  96. package/createTheme.js.map +1 -1
  97. package/dataProviders/ApiClient.js +40 -49
  98. package/dataProviders/ApiClient.js.map +1 -1
  99. package/dataProviders/DefaultDataProvider.js +56 -58
  100. package/dataProviders/DefaultDataProvider.js.map +1 -1
  101. package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -1
  102. package/dataProviders/GET_PAGE_BY_ID.js +3 -1
  103. package/dataProviders/GET_PAGE_BY_ID.js.map +1 -1
  104. package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -1
  105. package/dataProviders/GET_PAGE_BY_PATH.js +3 -1
  106. package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -1
  107. package/dataProviders/LIST_PUBLISHED_PAGES.js +2 -1
  108. package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -1
  109. package/dataProviders/NullDataProvider.d.ts +4 -3
  110. package/dataProviders/NullDataProvider.js +21 -20
  111. package/dataProviders/NullDataProvider.js.map +1 -1
  112. package/dataProviders/RedirectsProvider.js +24 -27
  113. package/dataProviders/RedirectsProvider.js.map +1 -1
  114. package/defaultBreakpoints.js +23 -22
  115. package/defaultBreakpoints.js.map +1 -1
  116. package/documentOperations/$addElementReferenceToParent.d.ts +1 -1
  117. package/documentOperations/$addElementReferenceToParent.js +30 -26
  118. package/documentOperations/$addElementReferenceToParent.js.map +1 -1
  119. package/documentOperations/AddElement.js +8 -7
  120. package/documentOperations/AddElement.js.map +1 -1
  121. package/documentOperations/AddToParent.d.ts +2 -2
  122. package/documentOperations/AddToParent.js +14 -13
  123. package/documentOperations/AddToParent.js.map +1 -1
  124. package/documentOperations/IDocumentOperation.js +0 -3
  125. package/documentOperations/RemoveElement.js +10 -7
  126. package/documentOperations/RemoveElement.js.map +1 -1
  127. package/documentOperations/SetGlobalInputBinding.js +23 -22
  128. package/documentOperations/SetGlobalInputBinding.js.map +1 -1
  129. package/documentOperations/SetGlobalStyleBinding.js +23 -23
  130. package/documentOperations/SetGlobalStyleBinding.js.map +1 -1
  131. package/documentOperations/SetInputBindingOverride.js +30 -29
  132. package/documentOperations/SetInputBindingOverride.js.map +1 -1
  133. package/documentOperations/SetStyleBindingOverride.js +30 -31
  134. package/documentOperations/SetStyleBindingOverride.js.map +1 -1
  135. package/documentOperations/index.js +9 -8
  136. package/documentOperations/index.js.map +1 -1
  137. package/findMatchingAstNode.js +11 -13
  138. package/findMatchingAstNode.js.map +1 -1
  139. package/generateElementId.js +2 -1
  140. package/generateElementId.js.map +1 -1
  141. package/headersProvider.js +4 -3
  142. package/headersProvider.js.map +1 -1
  143. package/index.d.ts +1 -0
  144. package/index.js +1 -2
  145. package/jsonPatch.js +5 -9
  146. package/jsonPatch.js.map +1 -1
  147. package/messages.js +12 -11
  148. package/messages.js.map +1 -1
  149. package/messenger/MessageOrigin.js +12 -11
  150. package/messenger/MessageOrigin.js.map +1 -1
  151. package/messenger/Messenger.js +58 -71
  152. package/messenger/Messenger.js.map +1 -1
  153. package/messenger/index.js +0 -2
  154. package/package.json +14 -14
  155. package/registerComponentGroup.js +5 -6
  156. package/registerComponentGroup.js.map +1 -1
  157. package/types/ShorthandCssProperties.js +0 -3
  158. package/types/WebsiteBuilderTheme.d.ts +7 -0
  159. package/types/WebsiteBuilderTheme.js +0 -3
  160. package/types.d.ts +153 -9
  161. package/types.js +0 -3
  162. package/IBindingsUpdater.js.map +0 -1
  163. package/IRedirects.js.map +0 -1
  164. package/documentOperations/IDocumentOperation.js.map +0 -1
  165. package/index.js.map +0 -1
  166. package/messenger/index.js.map +0 -1
  167. package/types/ShorthandCssProperties.js.map +0 -1
  168. package/types/WebsiteBuilderTheme.js.map +0 -1
  169. package/types.js.map +0 -1
package/types.d.ts CHANGED
@@ -2,6 +2,7 @@ import type * as CSS from "csstype";
2
2
  import type { BindingsApi } from "./BindingsApi.js";
3
3
  import type { ShorthandCssProperties } from "./types/ShorthandCssProperties.js";
4
4
  import type { InputFactory } from "./createInput.js";
5
+ import type { Breakpoint } from "./types/WebsiteBuilderTheme.js";
5
6
  export type { WebsiteBuilderTheme, Breakpoint } from "./types/WebsiteBuilderTheme.js";
6
7
  type CSSProperties = CSS.Properties<string | number>;
7
8
  export type ElementMap = Record<string, DocumentElement>;
@@ -81,19 +82,126 @@ export type ComponentGroup = {
81
82
  export type ResponsiveStyles = {
82
83
  [key: string]: SerializableCSSStyleDeclaration;
83
84
  };
85
+ export type ConstraintElementContext = {
86
+ /** Component name (e.g., "FunnelBuilder/Step") */
87
+ name: string;
88
+ /** Component tags */
89
+ tags: string[];
90
+ /** Get the parent element context. undefined for root. */
91
+ getParent(): ConstraintElementContext | undefined;
92
+ /** Index of this element among siblings in the same parent slot. -1 if not in a list slot. */
93
+ childIndex(): number;
94
+ /** Total siblings in the same parent slot. -1 if not in a list slot. */
95
+ childCount(): number;
96
+ /** True if this element is the last among siblings in its parent slot. */
97
+ isLastChild(): boolean;
98
+ /** True if this element is the first among siblings in its parent slot. */
99
+ isFirstChild(): boolean;
100
+ };
101
+ export type ConstraintContext = {
102
+ /** The component/element this constraint is about */
103
+ component: ConstraintElementContext;
104
+ /** The direct parent element at the drop target */
105
+ parent: ConstraintElementContext;
106
+ /** The target slot name (e.g., "children", "leftColumn", "rightColumn") */
107
+ slot: string;
108
+ /** True if the direct parent is the given component */
109
+ isChildOf: (componentName: string) => boolean;
110
+ /** True if any ancestor (including parent) is the given component */
111
+ isDescendantOf: (componentName: string) => boolean;
112
+ /** Find the nearest ancestor matching a component name */
113
+ getAncestor: (componentName: string) => ConstraintElementContext | undefined;
114
+ /** True if the component being placed has the given tag */
115
+ hasTag: (tag: string) => boolean;
116
+ /** Number of items currently in the target slot */
117
+ slotChildCount: () => number;
118
+ /** Count instances of a component type in the entire document */
119
+ countInstances: (componentName: string) => number;
120
+ /** True if the component has any descendant element carrying the given tag */
121
+ hasDescendantWithTag: (tag: string) => boolean;
122
+ /** Returns the resolved inputs of the nearest ancestor matching componentName, or undefined */
123
+ getAncestorInputs: (componentName: string) => Record<string, any> | undefined;
124
+ /** Returns the resolved inputs of the element this constraint is evaluating */
125
+ getElementInputs: () => Record<string, any>;
126
+ /** Debug logger — safe to call inside serialized constraints */
127
+ log: (...args: any[]) => void;
128
+ /** Block placement with an error message shown to the user */
129
+ block: (message: string) => never;
130
+ };
131
+ /**
132
+ * A constraint function. Call `ctx.block("message")` to block placement.
133
+ * Returning without blocking means the constraint passes.
134
+ */
135
+ export type ComponentConstraint = (ctx: ConstraintContext) => void;
136
+ export type Stop = symbol;
137
+ export type Continue = symbol;
138
+ export type HandlerResult = void | Stop | Continue;
139
+ export type OnChangeAction = "create" | "update" | "delete";
140
+ export type OnChangeElementContext = {
141
+ id: string;
142
+ component: ComponentManifest;
143
+ inputs: Record<string, any>;
144
+ };
145
+ export type ManifestAncestorContext = {
146
+ id: string;
147
+ component: ComponentManifest;
148
+ inputs: Record<string, any>;
149
+ updateInputs: (cb: (inputs: Record<string, any>) => void) => void;
150
+ getElement: (id: string) => OnChangeElementContext | undefined;
151
+ };
152
+ export type ComponentChangeContext<TInputs = Record<string, any>> = {
153
+ action: OnChangeAction;
154
+ id: string;
155
+ component: ComponentManifest;
156
+ inputs: TInputs;
157
+ styles: Record<string, any>;
158
+ getAncestor: (componentName: string) => ManifestAncestorContext | undefined;
159
+ getElement: (id: string) => OnChangeElementContext | undefined;
160
+ createElement: (params: any) => any;
161
+ executeCommand: <T = unknown>(command: string, payload?: T) => void;
162
+ breakpoint: string;
163
+ log: (...args: any[]) => void;
164
+ stop: () => Stop;
165
+ continue: () => Continue;
166
+ };
167
+ export type DescendantChangeContext<TInputs = Record<string, any>, TDescendantInputs = Record<string, any>> = {
168
+ action: OnChangeAction;
169
+ descendant: {
170
+ component: ComponentManifest;
171
+ id: string;
172
+ inputs: TDescendantInputs;
173
+ updateInputs: (cb: (inputs: TDescendantInputs) => void) => void;
174
+ };
175
+ inputs: TInputs;
176
+ updateInputs: (cb: (inputs: TInputs) => void) => void;
177
+ getElement: (id: string) => OnChangeElementContext | undefined;
178
+ executeCommand: <T = unknown>(command: string, payload?: T) => void;
179
+ breakpoint: string;
180
+ log: (...args: any[]) => void;
181
+ stop: () => Stop;
182
+ continue: () => Continue;
183
+ };
184
+ export type ComponentChangeHandler<TInputs = Record<string, any>> = (ctx: ComponentChangeContext<TInputs>) => HandlerResult;
185
+ export type DescendantChangeHandler<TInputs = Record<string, any>, TDescendantInputs = Record<string, any>> = (ctx: DescendantChangeContext<TInputs, TDescendantInputs>) => HandlerResult;
84
186
  export type ComponentManifest = {
85
187
  name: string;
86
188
  group?: string;
87
189
  label?: string;
190
+ aiContext?: string;
191
+ useInAiContentGeneration?: boolean;
88
192
  image?: string;
89
193
  inputs: ComponentInput[];
90
194
  canDrag?: boolean;
91
- canDelete?: boolean;
195
+ canDelete?: boolean | ComponentConstraint;
92
196
  acceptsChildren?: boolean;
93
197
  hideFromToolbar?: boolean;
94
198
  hideStyleSettings?: string[];
95
199
  autoApplyStyles?: boolean;
96
- tags?: string[];
200
+ tags: string[];
201
+ constraints?: ComponentConstraint[];
202
+ descendantConstraints?: ComponentConstraint[];
203
+ onChange?: ComponentChangeHandler | ComponentChangeHandler[];
204
+ onDescendantChange?: DescendantChangeHandler | DescendantChangeHandler[];
97
205
  defaults?: {
98
206
  inputs?: Record<string, any>;
99
207
  styles?: SerializableCSSStyleDeclaration;
@@ -127,11 +235,14 @@ export type Document = {
127
235
  state: DocumentState;
128
236
  version: number;
129
237
  properties: Record<string, any>;
238
+ extensions: Record<string, any>;
130
239
  metadata: DocumentMetadata;
131
240
  bindings: DocumentBindings;
132
241
  elements: ElementMap;
133
242
  };
134
- export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "extensions" | "metadata" | "state">;
243
+ export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "extensions" | "metadata" | "state"> & {
244
+ languagePaths: Record<string, string>;
245
+ };
135
246
  export type PublicRedirect = {
136
247
  id: string;
137
248
  from: string;
@@ -139,9 +250,10 @@ export type PublicRedirect = {
139
250
  permanent: boolean;
140
251
  };
141
252
  export type EditorPage = EditorDocument & Pick<Page, "properties" | "status" | "location">;
142
- export type EditorDocument = Document & {
143
- metadata: Record<string, any>;
144
- };
253
+ export interface EditorOptions {
254
+ isReadOnly?: boolean;
255
+ }
256
+ export type EditorDocument = Document;
145
257
  export type Page = Document & {
146
258
  id: string;
147
259
  status: string;
@@ -152,7 +264,18 @@ export type Page = Document & {
152
264
  properties: {
153
265
  title: string;
154
266
  snippet: string;
267
+ image: {
268
+ id: string;
269
+ name: string;
270
+ size: number;
271
+ mimeType: string;
272
+ src: string;
273
+ width: number;
274
+ height: number;
275
+ };
155
276
  path: string;
277
+ language?: string;
278
+ sourcePage?: string;
156
279
  tags: string[];
157
280
  seo: {
158
281
  title: string;
@@ -161,10 +284,23 @@ export type Page = Document & {
161
284
  name: string;
162
285
  content: string;
163
286
  }>;
287
+ canonicalUrl: string;
288
+ noIndex: boolean;
289
+ noFollow: boolean;
290
+ structuredSchema: string;
164
291
  };
165
292
  social: {
166
293
  title: string;
167
294
  description: string;
295
+ image: {
296
+ id: string;
297
+ name: string;
298
+ size: number;
299
+ mimeType: string;
300
+ src: string;
301
+ width: number;
302
+ height: number;
303
+ };
168
304
  metaTags: Array<{
169
305
  property: string;
170
306
  content: string;
@@ -194,6 +330,8 @@ export type BoxData = ElementBoxData | ElementSlotBoxData;
194
330
  export type EditorViewportInfo = PreviewViewportInfo & {
195
331
  top: number;
196
332
  left: number;
333
+ breakpoint: string;
334
+ breakpoints: Breakpoint[];
197
335
  };
198
336
  export type PreviewViewportInfo = {
199
337
  width: number;
@@ -227,7 +365,7 @@ export interface ListPagesMeta {
227
365
  cursor: string | null;
228
366
  }
229
367
  export interface ListPagesResult {
230
- data: Array<Omit<PublicPage, "properties" | "bindings">>;
368
+ data: Array<Omit<PublicPage, "elements" | "bindings">>;
231
369
  meta: ListPagesMeta;
232
370
  }
233
371
  export interface IDataProvider {
@@ -328,10 +466,16 @@ export type ManifestInputsObject<TInputs, TAllowChildren extends boolean> = TAll
328
466
  } : {
329
467
  [K in keyof TInputs]: InputFactory<K & string>;
330
468
  };
331
- export type ComponentManifestInput<TInputs> = (Omit<ComponentManifest, "inputs" | "acceptsChildren"> & {
469
+ export type ComponentManifestInput<TInputs> = (Omit<ComponentManifest, "inputs" | "acceptsChildren" | "tags" | "onChange" | "onDescendantChange"> & {
332
470
  acceptsChildren: true;
471
+ tags?: string[];
333
472
  inputs?: ManifestInputsArray<TInputs, true> | ManifestInputsObject<TInputs, true>;
334
- }) | (Omit<ComponentManifest, "inputs" | "acceptsChildren"> & {
473
+ onChange?: ComponentChangeHandler<TInputs> | ComponentChangeHandler<TInputs>[];
474
+ onDescendantChange?: DescendantChangeHandler<TInputs> | DescendantChangeHandler<TInputs>[];
475
+ }) | (Omit<ComponentManifest, "inputs" | "acceptsChildren" | "tags" | "onChange" | "onDescendantChange"> & {
335
476
  acceptsChildren?: false;
477
+ tags?: string[];
336
478
  inputs: ManifestInputsArray<TInputs, false> | ManifestInputsObject<TInputs, false>;
479
+ onChange?: ComponentChangeHandler<TInputs> | ComponentChangeHandler<TInputs>[];
480
+ onDescendantChange?: DescendantChangeHandler<TInputs> | DescendantChangeHandler<TInputs>[];
337
481
  });
package/types.js CHANGED
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IBindingsUpdater.ts"],"sourcesContent":["import type { JsonPatchOperation } from \"~/jsonPatch.js\";\nimport type { Document, DocumentElementBindings } from \"~/types.js\";\n\nexport interface IBindingsUpdater {\n applyToDocument(document: Document): void;\n createJsonPatch(bindings: DocumentElementBindings): JsonPatchOperation[];\n}\n"],"mappings":"","ignoreList":[]}
package/IRedirects.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IRedirects.ts"],"sourcesContent":["import type { PublicRedirect } from \"~/types.js\";\n\nexport interface IRedirects {\n getAllRedirects(): Promise<Map<string, PublicRedirect>>;\n getRedirectByPath(path: string): Promise<PublicRedirect | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
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":[]}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleSettings"],"sources":["index.ts"],"sourcesContent":["export * from \"./createTheme.js\";\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 type * 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\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./MessageOrigin.js\";\nexport * from \"./Messenger.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["ShorthandCssProperties.ts"],"sourcesContent":["export type ShorthandCssProperties =\n | \"margin\"\n | \"padding\"\n | \"border\"\n | \"borderWidth\"\n | \"borderStyle\"\n | \"borderColor\"\n | \"borderRadius\"\n | \"outline\"\n | \"outlineOffset\"\n | \"inset\"\n | \"background\"\n | \"borderBlock\"\n | \"borderBlockColor\"\n | \"borderBlockStyle\"\n | \"borderBlockWidth\"\n | \"borderInline\"\n | \"borderInlineColor\"\n | \"borderInlineStyle\"\n | \"borderInlineWidth\"\n | \"borderStartEndRadius\"\n | \"borderStartStartRadius\"\n | \"borderEndEndRadius\"\n | \"borderEndStartRadius\"\n | \"font\"\n | \"fontVariant\"\n | \"textDecoration\"\n | \"textEmphasis\"\n | \"textEmphasisStyle\"\n | \"textEmphasisColor\"\n | \"flex\"\n | \"flexFlow\"\n | \"gap\"\n | \"placeContent\"\n | \"placeItems\"\n | \"placeSelf\"\n | \"grid\"\n | \"listStyle\"\n | \"marker\"\n | \"columns\"\n | \"columnRule\"\n | \"animation\"\n | \"transition\"\n | \"boxShadow\"\n | \"textShadow\"\n | \"scrollMargin\"\n | \"scrollPadding\"\n | \"size\"\n | \"aspectRatio\";\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["WebsiteBuilderTheme.ts"],"sourcesContent":["export type Breakpoint = {\n name: string;\n title: string;\n description: string;\n icon: string;\n minWidth: number;\n maxWidth: number;\n};\n\nexport type WebsiteBuilderTheme = {\n css?: string;\n fonts?: string[];\n breakpoints: Breakpoint[];\n colors: ColorStyle[];\n typography: Typography;\n};\ntype KnownKeys = \"desktop\" | \"tablet\" | \"mobile\";\n\ntype BreakpointBase = Omit<Breakpoint, \"name\">;\n\ntype KnownBreakpoints = Partial<Record<KnownKeys, Partial<BreakpointBase>>>;\n\n// This merges both, while avoiding overlap issues\ntype Breakpoints = KnownBreakpoints & {\n custom?: {\n [K in string as K extends KnownKeys ? never : K]: BreakpointBase;\n };\n};\n\nexport type ColorStyle = {\n id: string;\n label: string;\n value: string;\n};\n\nexport type TypographyStyle = {\n id: string;\n label: string;\n tag: string;\n className: string;\n};\n\nexport type Typography = Record<string, TypographyStyle[]>;\n\nexport type WebsiteBuilderThemeInput = {\n /**\n * CSS to include in the editor.\n */\n css?: string;\n /**\n * Fonts to load when the editor loads.\n */\n fonts?: string[];\n /**\n * {\n * title: \"Desktop\",\n * description: `Desktop styles apply at all breakpoints, unless they're edited at a lower breakpoint. Start your styling here.`,\n * icon: \"Inline SVG or a link to an SVG.\",\n * minWidth: 0,\n * maxWidth: 4000\n * }\n */\n breakpoints?: Breakpoints;\n /**\n * [\n * {\n * id: \"primary\",\n * label: \"Primary\",\n * value: \"#000000\"\n * },\n * ]\n */\n colors?: ColorStyle[];\n /**\n * headings: [\n * {\n * id: \"heading1\",\n * name: \"Heading 1\",\n * tag: \"h1\"\n * },\n * ],\n * paragraphs: [\n * {\n * id: \"paragraph1\",\n * name: \"Paragraph 1\",\n * tag: \"p\",\n * ],\n * quotes: [\n * {\n * id: \"quote\",\n * name: \"Quote\",\n * tag: \"blockquote\"\n * }\n * ]\n */\n typography?: Typography;\n};\n"],"mappings":"","ignoreList":[]}
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type * as CSS from \"csstype\";\nimport type { BindingsApi } from \"~/BindingsApi.js\";\nimport type { ShorthandCssProperties } from \"./types/ShorthandCssProperties.js\";\nimport type { InputFactory } from \"~/createInput.js\";\nexport type { WebsiteBuilderTheme, Breakpoint } from \"./types/WebsiteBuilderTheme.js\";\n\ntype CSSProperties = CSS.Properties<string | number>;\n\nexport type ElementMap = Record<string, DocumentElement>;\n\nexport type DocumentState = Record<string, any>;\n\nexport type DocumentMetadata = Record<string, any>;\n\nexport type InputValueBinding<T = any> = ValueBinding<T> & {\n id: string;\n type: string;\n translatable?: boolean;\n list?: boolean;\n};\n\nexport type StyleValueBinding<T = any> = ValueBinding<T>;\n\nexport type ValueBinding<T = any> = {\n static?: T;\n expression?: string;\n};\n\nexport type RepeatValueBinding = {\n expression: string;\n};\n\nexport type CssProperties = Omit<CSSProperties, ShorthandCssProperties>;\n\nexport type DocumentElementStyleBindings = Partial<{\n [K in keyof CssProperties]: StyleValueBinding<CssProperties[K]>;\n}>;\n\nexport type DocumentElementInputBindings = {\n [inputName: string]: InputValueBinding;\n};\n\nexport type DocumentElementBindings = {\n $repeat?: RepeatValueBinding;\n inputs?: DocumentElementInputBindings;\n styles?: DocumentElementStyleBindings;\n metadata?: Record<string, any>;\n overrides?: {\n [key: string]: {\n inputs?: DocumentElementInputBindings;\n styles?: DocumentElementStyleBindings;\n };\n };\n};\n\nexport type DocumentBindings = {\n [elementId: string]: DocumentElementBindings;\n};\n\nexport type ResolvedComponent<TComponent = any> = {\n component: TComponent;\n inputs: Record<string, any>;\n manifest: ComponentManifest;\n styles: SerializableCSSStyleDeclaration;\n};\n\nexport type ResolvedElement = {\n id: string;\n inputs: Record<string, any>;\n styles: SerializableCSSStyleDeclaration;\n};\n\nexport type Component = {\n component: any;\n manifest: ComponentManifest;\n};\n\nexport type ComponentBlueprint<TComponent = any, TManifest = any> = {\n component: TComponent;\n manifest: TManifest;\n};\n\nexport type ComponentGroupItem = {\n // Name of the component.\n name: string;\n // Optionally, define an exact element to insert.\n item?: DocumentElementTemplate;\n};\n\nexport type SerializedComponentGroup = ComponentGroup & {\n filter?: string;\n};\n\nexport type ComponentGroupFilterContext = {\n document: EditorDocument;\n};\n\nexport type ComponentGroup = {\n name: string;\n label: string;\n description?: string;\n filter?: (component: ComponentManifest, context: ComponentGroupFilterContext) => boolean;\n};\n\nexport type ResponsiveStyles = {\n [key: string]: SerializableCSSStyleDeclaration;\n};\n\nexport type ComponentManifest = {\n name: string;\n group?: string;\n label?: string;\n image?: string;\n inputs: ComponentInput[];\n canDrag?: boolean;\n canDelete?: boolean;\n acceptsChildren?: boolean;\n hideFromToolbar?: boolean;\n hideStyleSettings?: string[];\n autoApplyStyles?: boolean;\n tags?: string[];\n defaults?: {\n inputs?: Record<string, any>;\n styles?: SerializableCSSStyleDeclaration;\n overrides?: {\n [breakpoint: string]: {\n inputs?: Record<string, any>;\n styles?: SerializableCSSStyleDeclaration;\n };\n };\n };\n};\n\nexport type DocumentElementTemplate = Omit<DocumentElement, \"id\">;\n\nexport type ElementComponent = {\n name: string;\n};\n\nexport type DocumentElement = {\n type: \"Webiny/Element\";\n id: string;\n component: ElementComponent;\n parent?: {\n id: string;\n slot: string;\n };\n styles?: ResponsiveStyles;\n};\n\nexport type SerializableCSSStyleDeclaration = {\n [K in keyof CssProperties]?: CssProperties[K];\n};\n\nexport type Document = {\n id: string;\n state: DocumentState;\n version: number;\n properties: Record<string, any>;\n metadata: DocumentMetadata;\n bindings: DocumentBindings;\n elements: ElementMap;\n};\n\nexport type PublicPage = Pick<\n Page,\n \"id\" | \"version\" | \"properties\" | \"bindings\" | \"elements\" | \"extensions\" | \"metadata\" | \"state\"\n>;\n\nexport type PublicRedirect = {\n id: string;\n from: string;\n to: string;\n permanent: boolean;\n};\n\nexport type EditorPage = EditorDocument & Pick<Page, \"properties\" | \"status\" | \"location\">;\n\nexport type EditorDocument = Document & {\n metadata: Record<string, any>;\n};\n\nexport type Page = Document & {\n id: string;\n status: string;\n version: number;\n location: {\n folderId: string;\n };\n properties: {\n title: string;\n snippet: string;\n /*image: {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n src: string;\n };*/\n path: string;\n tags: string[];\n seo: {\n title: string;\n description: string;\n metaTags: Array<{ name: string; content: string }>;\n };\n social: {\n title: string;\n description: string;\n /*image: {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n src: string;\n };*/\n metaTags: Array<{ property: string; content: string }>;\n };\n };\n extensions: Record<string, any>;\n metadata: DocumentMetadata;\n};\n\nexport type Box = {\n depth: number;\n parentId: string;\n parentSlot: string;\n parentIndex: number;\n width: number;\n height: number;\n top: number;\n left: number;\n};\n\nexport type ElementBoxData = Box & {\n type: \"element\";\n};\n\nexport type ElementSlotBoxData = Box & {\n type: \"element-slot\";\n};\n\nexport type BoxData = ElementBoxData | ElementSlotBoxData;\n\nexport type EditorViewportInfo = PreviewViewportInfo & {\n top: number;\n left: number;\n};\n\nexport type PreviewViewportInfo = {\n // Viewport width (only the visible part)\n width: number;\n // Viewport height (only the visible part)\n height: number;\n // Full iframe width\n scrollWidth: number;\n // Full iframe height\n scrollHeight: number;\n // Iframe horizontal scroll offset\n scrollX: number;\n // Iframe vertical scroll offest\n scrollY: number;\n};\n\nexport type BoxesData = Record<string, BoxData>;\n\nexport type EditorViewportData = {\n boxes: BoxesData;\n viewport: EditorViewportInfo;\n};\n\nexport type PreviewViewportData = {\n boxes: BoxesData;\n viewport: PreviewViewportInfo;\n};\n\nexport type ApiOptions = Record<string, any>;\n\nexport type GetPageOptions = ApiOptions;\n\nexport interface ListPagesOptions {\n where?: Record<string, any>;\n limit?: number;\n after?: string;\n sort?: string[];\n search?: string;\n}\n\nexport interface ListPagesMeta {\n hasMoreItems: boolean;\n totalCount: number;\n cursor: string | null;\n}\n\nexport interface ListPagesResult {\n data: Array<Omit<PublicPage, \"properties\" | \"bindings\">>;\n meta: ListPagesMeta;\n}\n\nexport interface IDataProvider {\n getPageByPath(path: string, options?: GetPageOptions): Promise<PublicPage | null>;\n getPageById(id: string, options?: GetPageOptions): Promise<PublicPage | null>;\n listPages(options?: ListPagesOptions): Promise<ListPagesResult>;\n}\n\nexport interface IEnvironment {\n isClient(): boolean;\n isServer(): boolean;\n isPreview(): boolean;\n}\n\nexport interface IContentSdk {\n getPage(path: string): Promise<PublicPage | null>;\n listPages(options?: ListPagesOptions): Promise<ListPagesResult>;\n}\n\n// Input types\n\n// inputTypes.ts\nexport type BaseInput<T = any> = {\n name: string;\n type: string;\n onChange?: (\n bindings: ReturnType<BindingsApi[\"getPublicApi\"]>,\n context: { breakpoint: string }\n ) => void;\n label?: string;\n description?: string;\n helperText?: string;\n defaultValue?: T;\n responsive?: boolean;\n required?: boolean;\n hideFromUi?: boolean;\n renderer?: string;\n list?: boolean;\n translatable?: boolean;\n};\n\n// Discriminated union per input type\nexport type TextInput = BaseInput<string> & {\n type: \"text\";\n};\n\nexport type SlotInput = BaseInput<any> & {\n type: \"slot\";\n components?: string[];\n};\n\nexport type TagsInput = BaseInput<string[]> & {\n type: \"text\";\n};\n\nexport type LongTextInput = BaseInput<string> & {\n type: \"longText\";\n};\n\nexport type NumberInput = BaseInput<number> & {\n type: \"number\";\n minValue?: number;\n};\n\nexport type BooleanInput = BaseInput<boolean> & {\n type: \"boolean\";\n};\n\nexport type ColorInput = BaseInput<string> & {\n type: \"color\";\n};\n\nexport type FileInput = BaseInput<string> & {\n type: \"file\";\n allowedFileTypes: string[];\n};\n\nexport type DateTimeInput = BaseInput<string> & {\n type: \"datetime\";\n};\n\nexport type LexicalInput = BaseInput<string> & {\n type: \"lexical\";\n};\n\nexport type SelectInput = BaseInput<string> & {\n type: \"select\";\n options: { label: string; value: string }[];\n showResetAction?: boolean;\n};\n\nexport type RadioInput = BaseInput<string> & {\n type: \"radio\";\n options: { label: string; value: string }[];\n};\n\nexport type ObjectInput = BaseInput<Record<string, any>> & {\n type: \"object\";\n fields: ComponentInput[];\n};\n\nexport type CustomInput = BaseInput<any> & {\n type: string;\n fields: ComponentInput[];\n};\n\n// Union of all input types\nexport type ComponentInput =\n | TextInput\n | LongTextInput\n | NumberInput\n | BooleanInput\n | ColorInput\n | FileInput\n | DateTimeInput\n | LexicalInput\n | SelectInput\n | RadioInput\n | TagsInput\n | ObjectInput\n | SlotInput\n | CustomInput;\n\nexport type ManifestInputsArray<\n TInputs,\n TAllowChildren extends boolean\n> = TAllowChildren extends true\n ? {\n [K in Exclude<keyof TInputs, \"children\">]: InputFactory<K & string>;\n }[Exclude<keyof TInputs, \"children\">][]\n : {\n [K in keyof TInputs]: InputFactory<K & string>;\n }[keyof TInputs][];\n\nexport type ManifestInputsObject<\n TInputs,\n TAllowChildren extends boolean\n> = TAllowChildren extends true\n ? { [K in Exclude<keyof TInputs, \"children\">]: InputFactory<K & string> }\n : { [K in keyof TInputs]: InputFactory<K & string> };\n\nexport type ComponentManifestInput<TInputs> =\n | (Omit<ComponentManifest, \"inputs\" | \"acceptsChildren\"> & {\n acceptsChildren: true;\n inputs?: ManifestInputsArray<TInputs, true> | ManifestInputsObject<TInputs, true>;\n })\n | (Omit<ComponentManifest, \"inputs\" | \"acceptsChildren\"> & {\n acceptsChildren?: false;\n inputs: ManifestInputsArray<TInputs, false> | ManifestInputsObject<TInputs, false>;\n });\n"],"mappings":"","ignoreList":[]}