@webiny/website-builder-sdk 0.0.0-unstable.a4637c5ce6 → 0.0.0-unstable.df7a8bb475

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 (76) hide show
  1. package/BindingsProcessor.test.js +1 -0
  2. package/BindingsProcessor.test.js.map +1 -1
  3. package/BindingsResolver.d.ts +1 -1
  4. package/BindingsResolver.js +2 -2
  5. package/BindingsResolver.js.map +1 -1
  6. package/BindingsResolver.test.js +1 -0
  7. package/BindingsResolver.test.js.map +1 -1
  8. package/DocumentStore.d.ts +1 -1
  9. package/EditingSdk.js +2 -5
  10. package/EditingSdk.js.map +1 -1
  11. package/ElementFactory.js.map +1 -1
  12. package/HotkeyManager.js +1 -1
  13. package/HotkeyManager.js.map +1 -1
  14. package/InheritanceProcessor.d.ts +2 -2
  15. package/InheritanceProcessor.test.js +1 -0
  16. package/InheritanceProcessor.test.js.map +1 -1
  17. package/InputsBindingsProcessor.test.js +1 -0
  18. package/InputsBindingsProcessor.test.js.map +1 -1
  19. package/InputsUpdater.d.ts +1 -1
  20. package/Logger.d.ts +2 -1
  21. package/PreviewViewport.d.ts +0 -1
  22. package/PreviewViewport.js +0 -20
  23. package/PreviewViewport.js.map +1 -1
  24. package/README.md +10 -2
  25. package/StylesUpdater.d.ts +1 -1
  26. package/Theme.js +3 -10
  27. package/Theme.js.map +1 -1
  28. package/ViewportManager.d.ts +2 -0
  29. package/ViewportManager.js +4 -0
  30. package/ViewportManager.js.map +1 -1
  31. package/createInput.d.ts +123 -15
  32. package/createInput.js +32 -0
  33. package/createInput.js.map +1 -1
  34. package/dataProviders/ApiClient.d.ts +1 -0
  35. package/dataProviders/ApiClient.js.map +1 -1
  36. package/dataProviders/DefaultDataProvider.d.ts +1 -1
  37. package/dataProviders/GET_PAGE_BY_ID.d.ts +1 -1
  38. package/dataProviders/GET_PAGE_BY_ID.js +1 -0
  39. package/dataProviders/GET_PAGE_BY_ID.js.map +1 -1
  40. package/dataProviders/GET_PAGE_BY_PATH.d.ts +1 -1
  41. package/dataProviders/GET_PAGE_BY_PATH.js +1 -0
  42. package/dataProviders/GET_PAGE_BY_PATH.js.map +1 -1
  43. package/dataProviders/LIST_PUBLISHED_PAGES.d.ts +1 -1
  44. package/dataProviders/LIST_PUBLISHED_PAGES.js +1 -0
  45. package/dataProviders/LIST_PUBLISHED_PAGES.js.map +1 -1
  46. package/dataProviders/RedirectsProvider.js +5 -1
  47. package/dataProviders/RedirectsProvider.js.map +1 -1
  48. package/documentOperations/SetGlobalStyleBinding.js.map +1 -1
  49. package/documentOperations/SetInputBindingOverride.js.map +1 -1
  50. package/documentOperations/SetStyleBindingOverride.js.map +1 -1
  51. package/generateElementId.d.ts +1 -1
  52. package/generateElementId.js +0 -1
  53. package/generateElementId.js.map +1 -1
  54. package/index.d.ts +1 -1
  55. package/index.js +0 -1
  56. package/index.js.map +1 -1
  57. package/jsonPatch.d.ts +1 -1
  58. package/messenger/Messenger.js +9 -7
  59. package/messenger/Messenger.js.map +1 -1
  60. package/package.json +14 -19
  61. package/types/WebsiteBuilderTheme.d.ts +42 -45
  62. package/types/WebsiteBuilderTheme.js.map +1 -1
  63. package/types.d.ts +28 -4
  64. package/types.js.map +1 -1
  65. package/lexical/createDefaultLexicalTheme.d.ts +0 -2
  66. package/lexical/createDefaultLexicalTheme.js +0 -84
  67. package/lexical/createDefaultLexicalTheme.js.map +0 -1
  68. package/lexical/createLexicalTheme.d.ts +0 -2
  69. package/lexical/createLexicalTheme.js +0 -7
  70. package/lexical/createLexicalTheme.js.map +0 -1
  71. package/lexical/deepMerge.d.ts +0 -1
  72. package/lexical/deepMerge.js +0 -23
  73. package/lexical/deepMerge.js.map +0 -1
  74. package/types/LexicalEditorTheme.d.ts +0 -2
  75. package/types/LexicalEditorTheme.js +0 -3
  76. package/types/LexicalEditorTheme.js.map +0 -1
package/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type * as CSS from "csstype";
2
2
  import type { BindingsApi } from "./BindingsApi.js";
3
3
  import type { ShorthandCssProperties } from "./types/ShorthandCssProperties.js";
4
+ import type { InputFactory } from "./createInput.js";
4
5
  export type { WebsiteBuilderTheme, Breakpoint } from "./types/WebsiteBuilderTheme.js";
5
- interface CSSProperties extends CSS.Properties<string | number> {
6
- }
6
+ type CSSProperties = CSS.Properties<string | number>;
7
7
  export type ElementMap = Record<string, DocumentElement>;
8
8
  export type DocumentState = Record<string, any>;
9
9
  export type InputValueBinding<T = any> = ValueBinding<T> & {
@@ -57,6 +57,10 @@ export type Component = {
57
57
  component: any;
58
58
  manifest: ComponentManifest;
59
59
  };
60
+ export type ComponentBlueprint<TComponent = any, TManifest = any> = {
61
+ component: TComponent;
62
+ manifest: TManifest;
63
+ };
60
64
  export type ComponentGroupItem = {
61
65
  name: string;
62
66
  item?: DocumentElementTemplate;
@@ -81,7 +85,7 @@ export type ComponentManifest = {
81
85
  group?: string;
82
86
  label?: string;
83
87
  image?: string;
84
- inputs?: ComponentInput[];
88
+ inputs: ComponentInput[];
85
89
  canDrag?: boolean;
86
90
  canDelete?: boolean;
87
91
  acceptsChildren?: boolean;
@@ -125,7 +129,7 @@ export type Document = {
125
129
  bindings: DocumentBindings;
126
130
  elements: ElementMap;
127
131
  };
128
- export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "state">;
132
+ export type PublicPage = Pick<Page, "id" | "version" | "properties" | "bindings" | "elements" | "extensions" | "state">;
129
133
  export type PublicRedirect = {
130
134
  id: string;
131
135
  from: string;
@@ -165,6 +169,7 @@ export type Page = Document & {
165
169
  }>;
166
170
  };
167
171
  };
172
+ extensions: Record<string, any>;
168
173
  };
169
174
  export type Box = {
170
175
  depth: number;
@@ -190,6 +195,8 @@ export type EditorViewportInfo = PreviewViewportInfo & {
190
195
  export type PreviewViewportInfo = {
191
196
  width: number;
192
197
  height: number;
198
+ scrollWidth: number;
199
+ scrollHeight: number;
193
200
  scrollX: number;
194
201
  scrollY: number;
195
202
  };
@@ -293,3 +300,20 @@ export type CustomInput = BaseInput<any> & {
293
300
  fields: ComponentInput[];
294
301
  };
295
302
  export type ComponentInput = TextInput | LongTextInput | NumberInput | BooleanInput | ColorInput | FileInput | DateTimeInput | LexicalInput | SelectInput | RadioInput | TagsInput | ObjectInput | SlotInput | CustomInput;
303
+ export type ManifestInputsArray<TInputs, TAllowChildren extends boolean> = TAllowChildren extends true ? {
304
+ [K in Exclude<keyof TInputs, "children">]: InputFactory<K & string>;
305
+ }[Exclude<keyof TInputs, "children">][] : {
306
+ [K in keyof TInputs]: InputFactory<K & string>;
307
+ }[keyof TInputs][];
308
+ export type ManifestInputsObject<TInputs, TAllowChildren extends boolean> = TAllowChildren extends true ? {
309
+ [K in Exclude<keyof TInputs, "children">]: InputFactory<K & string>;
310
+ } : {
311
+ [K in keyof TInputs]: InputFactory<K & string>;
312
+ };
313
+ export type ComponentManifestInput<TInputs> = (Omit<ComponentManifest, "inputs" | "acceptsChildren"> & {
314
+ acceptsChildren: true;
315
+ inputs?: ManifestInputsArray<TInputs, true> | ManifestInputsObject<TInputs, true>;
316
+ }) | (Omit<ComponentManifest, "inputs" | "acceptsChildren"> & {
317
+ acceptsChildren?: false;
318
+ inputs: ManifestInputsArray<TInputs, false> | ManifestInputsObject<TInputs, false>;
319
+ });
package/types.js.map CHANGED
@@ -1 +1 @@
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\";\nexport type { WebsiteBuilderTheme, Breakpoint } from \"./types/WebsiteBuilderTheme.js\";\n\ninterface CSSProperties extends CSS.Properties<string | number> {}\n\nexport type ElementMap = Record<string, DocumentElement>;\n\nexport type DocumentState = 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 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 bindings: DocumentBindings;\n elements: ElementMap;\n};\n\nexport type PublicPage = Pick<\n Page,\n \"id\" | \"version\" | \"properties\" | \"bindings\" | \"elements\" | \"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};\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 width: number;\n height: number;\n scrollX: number;\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;\nexport type ListPagesOptions = ApiOptions;\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<PublicPage[]>;\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<PublicPage[]>;\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"],"mappings":"","ignoreList":[]}
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 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 bindings: DocumentBindings;\n elements: ElementMap;\n};\n\nexport type PublicPage = Pick<\n Page,\n \"id\" | \"version\" | \"properties\" | \"bindings\" | \"elements\" | \"extensions\" | \"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};\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;\nexport type ListPagesOptions = ApiOptions;\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<PublicPage[]>;\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<PublicPage[]>;\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":[]}
@@ -1,2 +0,0 @@
1
- import type { LexicalEditorTheme } from "../types/LexicalEditorTheme.js";
2
- export declare const createDefaultLexicalTheme: () => LexicalEditorTheme;
@@ -1,84 +0,0 @@
1
- export const createDefaultLexicalTheme = () => {
2
- return {
3
- characterLimit: "wb-lx-characterLimit",
4
- code: "wb-lx-code",
5
- codeHighlight: {
6
- atrule: "wb-lx-tokenAttr",
7
- attr: "wb-lx-tokenAttr",
8
- boolean: "wb-lx-tokenProperty",
9
- builtin: "wb-lx-tokenSelector",
10
- cdata: "wb-lx-tokenComment",
11
- char: "wb-lx-tokenSelector",
12
- class: "wb-lx-tokenFunction",
13
- "class-name": "wb-lx-tokenFunction",
14
- comment: "wb-lx-tokenComment",
15
- constant: "wb-lx-tokenProperty",
16
- deleted: "wb-lx-tokenProperty",
17
- doctype: "wb-lx-tokenComment",
18
- entity: "wb-lx-tokenOperator",
19
- function: "wb-lx-tokenFunction",
20
- important: "wb-lx-tokenVariable",
21
- inserted: "wb-lx-tokenSelector",
22
- keyword: "wb-lx-tokenAttr",
23
- namespace: "wb-lx-tokenVariable",
24
- number: "wb-lx-tokenProperty",
25
- operator: "wb-lx-tokenOperator",
26
- prolog: "wb-lx-tokenComment",
27
- property: "wb-lx-tokenProperty",
28
- punctuation: "wb-lx-tokenPunctuation",
29
- regex: "wb-lx-tokenVariable",
30
- selector: "wb-lx-tokenSelector",
31
- string: "wb-lx-tokenSelector",
32
- symbol: "wb-lx-tokenProperty",
33
- tag: "wb-lx-tokenProperty",
34
- url: "wb-lx-tokenOperator",
35
- variable: "wb-lx-tokenVariable"
36
- },
37
- embedBlock: {
38
- base: "wb-lx-embedBlock",
39
- focus: "wb-lx-embedBlockFocus"
40
- },
41
- hashtag: "wb-lx-hashtag",
42
- heading: {
43
- h1: "wb-lx-h1",
44
- h2: "wb-lx-h2",
45
- h3: "wb-lx-h3",
46
- h4: "wb-lx-h4",
47
- h5: "wb-lx-h5",
48
- h6: "wb-lx-h6"
49
- },
50
- link: "wb-lx-link",
51
- list: {
52
- listitem: "wb-lx-listItem",
53
- listitemChecked: "wb-lx-listItemChecked",
54
- listitemUnchecked: "wb-lx-listItemUnchecked",
55
- nested: {
56
- listitem: "wb-lx-nestedListItem"
57
- },
58
- olDepth: ["wb-lx-ol1", "wb-lx-ol2", "wb-lx-ol3", "wb-lx-ol4", "wb-lx-ol5"],
59
- ul: "wb-lx-ul"
60
- },
61
- ltr: "wb-lx-ltr",
62
- mark: "wb-lx-mark",
63
- markOverlap: "wb-lx-markOverlap",
64
- paragraph: "wb-lx-paragraph",
65
- quote: "wb-lx-quote",
66
- rtl: "wb-lx-rtl",
67
- text: {
68
- bold: "wb-lx-textBold",
69
- code: "wb-lx-textCode",
70
- italic: "wb-lx-textItalic",
71
- strikethrough: "wb-lx-textStrikethrough",
72
- subscript: "wb-lx-textSubscript",
73
- superscript: "wb-lx-textSuperscript",
74
- underline: "wb-lx-textUnderline",
75
- underlineStrikethrough: "wb-lx-textUnderlineStrikethrough"
76
- },
77
- fontColorText: "wb-lx-fontColorText",
78
- image: "wb-lx-image",
79
- indent: "wb-lx-indent",
80
- inlineImage: "wb-lx-inline-image"
81
- };
82
- };
83
-
84
- //# sourceMappingURL=createDefaultLexicalTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createDefaultLexicalTheme","characterLimit","code","codeHighlight","atrule","attr","boolean","builtin","cdata","char","class","comment","constant","deleted","doctype","entity","function","important","inserted","keyword","namespace","number","operator","prolog","property","punctuation","regex","selector","string","symbol","tag","url","variable","embedBlock","base","focus","hashtag","heading","h1","h2","h3","h4","h5","h6","link","list","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ul","ltr","mark","markOverlap","paragraph","quote","rtl","text","bold","italic","strikethrough","subscript","superscript","underline","underlineStrikethrough","fontColorText","image","indent","inlineImage"],"sources":["createDefaultLexicalTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"~/types/LexicalEditorTheme.js\";\n\nexport const createDefaultLexicalTheme = (): LexicalEditorTheme => {\n return {\n characterLimit: \"wb-lx-characterLimit\",\n code: \"wb-lx-code\",\n codeHighlight: {\n atrule: \"wb-lx-tokenAttr\",\n attr: \"wb-lx-tokenAttr\",\n boolean: \"wb-lx-tokenProperty\",\n builtin: \"wb-lx-tokenSelector\",\n cdata: \"wb-lx-tokenComment\",\n char: \"wb-lx-tokenSelector\",\n class: \"wb-lx-tokenFunction\",\n \"class-name\": \"wb-lx-tokenFunction\",\n comment: \"wb-lx-tokenComment\",\n constant: \"wb-lx-tokenProperty\",\n deleted: \"wb-lx-tokenProperty\",\n doctype: \"wb-lx-tokenComment\",\n entity: \"wb-lx-tokenOperator\",\n function: \"wb-lx-tokenFunction\",\n important: \"wb-lx-tokenVariable\",\n inserted: \"wb-lx-tokenSelector\",\n keyword: \"wb-lx-tokenAttr\",\n namespace: \"wb-lx-tokenVariable\",\n number: \"wb-lx-tokenProperty\",\n operator: \"wb-lx-tokenOperator\",\n prolog: \"wb-lx-tokenComment\",\n property: \"wb-lx-tokenProperty\",\n punctuation: \"wb-lx-tokenPunctuation\",\n regex: \"wb-lx-tokenVariable\",\n selector: \"wb-lx-tokenSelector\",\n string: \"wb-lx-tokenSelector\",\n symbol: \"wb-lx-tokenProperty\",\n tag: \"wb-lx-tokenProperty\",\n url: \"wb-lx-tokenOperator\",\n variable: \"wb-lx-tokenVariable\"\n },\n embedBlock: {\n base: \"wb-lx-embedBlock\",\n focus: \"wb-lx-embedBlockFocus\"\n },\n hashtag: \"wb-lx-hashtag\",\n heading: {\n h1: \"wb-lx-h1\",\n h2: \"wb-lx-h2\",\n h3: \"wb-lx-h3\",\n h4: \"wb-lx-h4\",\n h5: \"wb-lx-h5\",\n h6: \"wb-lx-h6\"\n },\n link: \"wb-lx-link\",\n list: {\n listitem: \"wb-lx-listItem\",\n listitemChecked: \"wb-lx-listItemChecked\",\n listitemUnchecked: \"wb-lx-listItemUnchecked\",\n nested: {\n listitem: \"wb-lx-nestedListItem\"\n },\n olDepth: [\"wb-lx-ol1\", \"wb-lx-ol2\", \"wb-lx-ol3\", \"wb-lx-ol4\", \"wb-lx-ol5\"],\n ul: \"wb-lx-ul\"\n },\n ltr: \"wb-lx-ltr\",\n mark: \"wb-lx-mark\",\n markOverlap: \"wb-lx-markOverlap\",\n paragraph: \"wb-lx-paragraph\",\n quote: \"wb-lx-quote\",\n rtl: \"wb-lx-rtl\",\n text: {\n bold: \"wb-lx-textBold\",\n code: \"wb-lx-textCode\",\n italic: \"wb-lx-textItalic\",\n strikethrough: \"wb-lx-textStrikethrough\",\n subscript: \"wb-lx-textSubscript\",\n superscript: \"wb-lx-textSuperscript\",\n underline: \"wb-lx-textUnderline\",\n underlineStrikethrough: \"wb-lx-textUnderlineStrikethrough\"\n },\n fontColorText: \"wb-lx-fontColorText\",\n image: \"wb-lx-image\",\n indent: \"wb-lx-indent\",\n inlineImage: \"wb-lx-inline-image\"\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,yBAAyB,GAAGA,CAAA,KAA0B;EAC/D,OAAO;IACHC,cAAc,EAAE,sBAAsB;IACtCC,IAAI,EAAE,YAAY;IAClBC,aAAa,EAAE;MACXC,MAAM,EAAE,iBAAiB;MACzBC,IAAI,EAAE,iBAAiB;MACvBC,OAAO,EAAE,qBAAqB;MAC9BC,OAAO,EAAE,qBAAqB;MAC9BC,KAAK,EAAE,oBAAoB;MAC3BC,IAAI,EAAE,qBAAqB;MAC3BC,KAAK,EAAE,qBAAqB;MAC5B,YAAY,EAAE,qBAAqB;MACnCC,OAAO,EAAE,oBAAoB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,OAAO,EAAE,qBAAqB;MAC9BC,OAAO,EAAE,oBAAoB;MAC7BC,MAAM,EAAE,qBAAqB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,SAAS,EAAE,qBAAqB;MAChCC,QAAQ,EAAE,qBAAqB;MAC/BC,OAAO,EAAE,iBAAiB;MAC1BC,SAAS,EAAE,qBAAqB;MAChCC,MAAM,EAAE,qBAAqB;MAC7BC,QAAQ,EAAE,qBAAqB;MAC/BC,MAAM,EAAE,oBAAoB;MAC5BC,QAAQ,EAAE,qBAAqB;MAC/BC,WAAW,EAAE,wBAAwB;MACrCC,KAAK,EAAE,qBAAqB;MAC5BC,QAAQ,EAAE,qBAAqB;MAC/BC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE,qBAAqB;MAC7BC,GAAG,EAAE,qBAAqB;MAC1BC,GAAG,EAAE,qBAAqB;MAC1BC,QAAQ,EAAE;IACd,CAAC;IACDC,UAAU,EAAE;MACRC,IAAI,EAAE,kBAAkB;MACxBC,KAAK,EAAE;IACX,CAAC;IACDC,OAAO,EAAE,eAAe;IACxBC,OAAO,EAAE;MACLC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE,UAAU;MACdC,EAAE,EAAE;IACR,CAAC;IACDC,IAAI,EAAE,YAAY;IAClBC,IAAI,EAAE;MACFC,QAAQ,EAAE,gBAAgB;MAC1BC,eAAe,EAAE,uBAAuB;MACxCC,iBAAiB,EAAE,yBAAyB;MAC5CC,MAAM,EAAE;QACJH,QAAQ,EAAE;MACd,CAAC;MACDI,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;MAC1EC,EAAE,EAAE;IACR,CAAC;IACDC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE,YAAY;IAClBC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAC5BC,KAAK,EAAE,aAAa;IACpBC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE;MACFC,IAAI,EAAE,gBAAgB;MACtBzD,IAAI,EAAE,gBAAgB;MACtB0D,MAAM,EAAE,kBAAkB;MAC1BC,aAAa,EAAE,yBAAyB;MACxCC,SAAS,EAAE,qBAAqB;MAChCC,WAAW,EAAE,uBAAuB;MACpCC,SAAS,EAAE,qBAAqB;MAChCC,sBAAsB,EAAE;IAC5B,CAAC;IACDC,aAAa,EAAE,qBAAqB;IACpCC,KAAK,EAAE,aAAa;IACpBC,MAAM,EAAE,cAAc;IACtBC,WAAW,EAAE;EACjB,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { LexicalEditorTheme } from "../types/LexicalEditorTheme.js";
2
- export declare const createLexicalTheme: (theme?: LexicalEditorTheme) => LexicalEditorTheme;
@@ -1,7 +0,0 @@
1
- import { createDefaultLexicalTheme } from "./createDefaultLexicalTheme.js";
2
- import { deepMerge } from "./deepMerge.js";
3
- export const createLexicalTheme = (theme = {}) => {
4
- return deepMerge(createDefaultLexicalTheme(), theme);
5
- };
6
-
7
- //# sourceMappingURL=createLexicalTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createDefaultLexicalTheme","deepMerge","createLexicalTheme","theme"],"sources":["createLexicalTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"~/types/LexicalEditorTheme.js\";\nimport { createDefaultLexicalTheme } from \"./createDefaultLexicalTheme.js\";\nimport { deepMerge } from \"./deepMerge.js\";\n\nexport const createLexicalTheme = (theme: LexicalEditorTheme = {}): LexicalEditorTheme => {\n return deepMerge(createDefaultLexicalTheme(), theme);\n};\n"],"mappings":"AACA,SAASA,yBAAyB;AAClC,SAASC,SAAS;AAElB,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAyB,GAAG,CAAC,CAAC,KAAyB;EACtF,OAAOF,SAAS,CAACD,yBAAyB,CAAC,CAAC,EAAEG,KAAK,CAAC;AACxD,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
@@ -1,23 +0,0 @@
1
- function isObject(value) {
2
- return value !== null && typeof value === "object" && !Array.isArray(value);
3
- }
4
- function mergeObjects(target, source) {
5
- const output = {
6
- ...target
7
- };
8
- for (const key in source) {
9
- const sourceValue = source[key];
10
- const targetValue = target[key];
11
- if (isObject(sourceValue) && isObject(targetValue)) {
12
- output[key] = mergeObjects(targetValue, sourceValue);
13
- } else {
14
- output[key] = sourceValue;
15
- }
16
- }
17
- return output;
18
- }
19
- export function deepMerge(target, source) {
20
- return mergeObjects(target, source);
21
- }
22
-
23
- //# sourceMappingURL=deepMerge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["isObject","value","Array","isArray","mergeObjects","target","source","output","key","sourceValue","targetValue","deepMerge"],"sources":["deepMerge.ts"],"sourcesContent":["function isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction mergeObjects(\n target: Record<string, unknown>,\n source: Record<string, unknown>\n): Record<string, unknown> {\n const output: Record<string, unknown> = { ...target };\n\n for (const key in source) {\n const sourceValue = source[key];\n const targetValue = target[key];\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n output[key] = mergeObjects(targetValue, sourceValue);\n } else {\n output[key] = sourceValue;\n }\n }\n\n return output;\n}\n\nexport function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n return mergeObjects(target, source as Record<string, unknown>) as T;\n}\n"],"mappings":"AAAA,SAASA,QAAQA,CAACC,KAAc,EAAoC;EAChE,OAAOA,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAC/E;AAEA,SAASG,YAAYA,CACjBC,MAA+B,EAC/BC,MAA+B,EACR;EACvB,MAAMC,MAA+B,GAAG;IAAE,GAAGF;EAAO,CAAC;EAErD,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACtB,MAAMG,WAAW,GAAGH,MAAM,CAACE,GAAG,CAAC;IAC/B,MAAME,WAAW,GAAGL,MAAM,CAACG,GAAG,CAAC;IAE/B,IAAIR,QAAQ,CAACS,WAAW,CAAC,IAAIT,QAAQ,CAACU,WAAW,CAAC,EAAE;MAChDH,MAAM,CAACC,GAAG,CAAC,GAAGJ,YAAY,CAACM,WAAW,EAAED,WAAW,CAAC;IACxD,CAAC,MAAM;MACHF,MAAM,CAACC,GAAG,CAAC,GAAGC,WAAW;IAC7B;EACJ;EAEA,OAAOF,MAAM;AACjB;AAEA,OAAO,SAASI,SAASA,CAAoCN,MAAS,EAAEC,MAAkB,EAAK;EAC3F,OAAOF,YAAY,CAACC,MAAM,EAAEC,MAAiC,CAAC;AAClE","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { EditorThemeClasses } from "lexical";
2
- export type LexicalEditorTheme = EditorThemeClasses;
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=LexicalEditorTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["LexicalEditorTheme.ts"],"sourcesContent":["import type { EditorThemeClasses } from \"lexical\";\n\nexport type LexicalEditorTheme = EditorThemeClasses;\n"],"mappings":"","ignoreList":[]}