@webiny/website-builder-sdk 6.0.0-alpha.2 → 6.0.0-alpha.4

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 (133) hide show
  1. package/BindingsApi.d.ts +4 -4
  2. package/BindingsApi.js +3 -3
  3. package/BindingsApi.js.map +1 -1
  4. package/BindingsProcessor.d.ts +1 -1
  5. package/BindingsProcessor.js.map +1 -1
  6. package/BindingsProcessor.test.js +1 -1
  7. package/BindingsProcessor.test.js.map +1 -1
  8. package/BindingsResolver.d.ts +2 -2
  9. package/BindingsResolver.js.map +1 -1
  10. package/BindingsResolver.test.js +3 -3
  11. package/BindingsResolver.test.js.map +1 -1
  12. package/ComponentInputTraverser.d.ts +1 -1
  13. package/ComponentInputTraverser.js.map +1 -1
  14. package/ComponentManifestToAstConverter.d.ts +1 -1
  15. package/ComponentManifestToAstConverter.js.map +1 -1
  16. package/ComponentResolver.d.ts +2 -2
  17. package/ComponentResolver.js +3 -3
  18. package/ComponentResolver.js.map +1 -1
  19. package/ContentSdk.d.ts +3 -3
  20. package/ContentSdk.js +5 -5
  21. package/ContentSdk.js.map +1 -1
  22. package/DocumentStore.d.ts +3 -3
  23. package/DocumentStore.js +1 -1
  24. package/DocumentStore.js.map +1 -1
  25. package/DocumentStoreManager.d.ts +2 -2
  26. package/DocumentStoreManager.js +1 -1
  27. package/DocumentStoreManager.js.map +1 -1
  28. package/EditingSdk.d.ts +2 -2
  29. package/EditingSdk.js +8 -8
  30. package/EditingSdk.js.map +1 -1
  31. package/ElementFactory.d.ts +3 -3
  32. package/ElementFactory.js +4 -4
  33. package/ElementFactory.js.map +1 -1
  34. package/IBindingsUpdater.d.ts +2 -2
  35. package/IBindingsUpdater.js.map +1 -1
  36. package/IRedirects.d.ts +1 -1
  37. package/IRedirects.js.map +1 -1
  38. package/InheritanceProcessor.d.ts +2 -2
  39. package/InheritanceProcessor.js.map +1 -1
  40. package/InheritanceProcessor.test.js +1 -1
  41. package/InheritanceProcessor.test.js.map +1 -1
  42. package/InheritedValueResolver.d.ts +1 -1
  43. package/InheritedValueResolver.js.map +1 -1
  44. package/InputBindingsProcessor.d.ts +4 -4
  45. package/InputBindingsProcessor.js +5 -5
  46. package/InputBindingsProcessor.js.map +1 -1
  47. package/InputsBindingsProcessor.test.js +2 -2
  48. package/InputsBindingsProcessor.test.js.map +1 -1
  49. package/InputsUpdater.d.ts +5 -5
  50. package/InputsUpdater.js +2 -2
  51. package/InputsUpdater.js.map +1 -1
  52. package/LiveSdk.js +1 -1
  53. package/LiveSdk.js.map +1 -1
  54. package/Logger.js +7 -4
  55. package/Logger.js.map +1 -1
  56. package/NullSdk.d.ts +1 -1
  57. package/NullSdk.js.map +1 -1
  58. package/PreviewDocument.js +1 -1
  59. package/PreviewDocument.js.map +1 -1
  60. package/PreviewSdk.js +1 -1
  61. package/PreviewSdk.js.map +1 -1
  62. package/PreviewViewport.d.ts +1 -1
  63. package/PreviewViewport.js +1 -1
  64. package/PreviewViewport.js.map +1 -1
  65. package/StylesBindingsProcessor.d.ts +2 -2
  66. package/StylesBindingsProcessor.js +4 -4
  67. package/StylesBindingsProcessor.js.map +1 -1
  68. package/StylesUpdater.d.ts +4 -4
  69. package/StylesUpdater.js +2 -2
  70. package/StylesUpdater.js.map +1 -1
  71. package/Theme.d.ts +1 -1
  72. package/Theme.js +2 -2
  73. package/Theme.js.map +1 -1
  74. package/ViewportManager.d.ts +1 -1
  75. package/ViewportManager.js +1 -1
  76. package/ViewportManager.js.map +1 -1
  77. package/createElement.d.ts +1 -1
  78. package/createElement.js.map +1 -1
  79. package/createInput.d.ts +1 -1
  80. package/createInput.js +1 -1
  81. package/createInput.js.map +1 -1
  82. package/createTheme.d.ts +1 -1
  83. package/createTheme.js.map +1 -1
  84. package/dataProviders/ApiClient.d.ts +6 -1
  85. package/dataProviders/ApiClient.js +19 -8
  86. package/dataProviders/ApiClient.js.map +1 -1
  87. package/dataProviders/DefaultDataProvider.d.ts +1 -1
  88. package/dataProviders/DefaultDataProvider.js +8 -3
  89. package/dataProviders/DefaultDataProvider.js.map +1 -1
  90. package/dataProviders/RedirectsProvider.d.ts +3 -3
  91. package/dataProviders/RedirectsProvider.js +6 -7
  92. package/dataProviders/RedirectsProvider.js.map +1 -1
  93. package/defaultBreakpoints.d.ts +1 -1
  94. package/defaultBreakpoints.js.map +1 -1
  95. package/documentOperations/$addElementReferenceToParent.js.map +1 -1
  96. package/documentOperations/AddElement.d.ts +1 -1
  97. package/documentOperations/AddElement.js.map +1 -1
  98. package/documentOperations/AddToParent.d.ts +1 -1
  99. package/documentOperations/AddToParent.js.map +1 -1
  100. package/documentOperations/RemoveElement.d.ts +1 -1
  101. package/documentOperations/RemoveElement.js.map +1 -1
  102. package/documentOperations/SetGlobalInputBinding.d.ts +1 -1
  103. package/documentOperations/SetGlobalInputBinding.js.map +1 -1
  104. package/documentOperations/SetGlobalStyleBinding.d.ts +1 -1
  105. package/documentOperations/SetGlobalStyleBinding.js.map +1 -1
  106. package/documentOperations/SetInputBindingOverride.d.ts +1 -1
  107. package/documentOperations/SetInputBindingOverride.js.map +1 -1
  108. package/documentOperations/SetStyleBindingOverride.d.ts +1 -1
  109. package/documentOperations/SetStyleBindingOverride.js.map +1 -1
  110. package/documentOperations/index.d.ts +8 -8
  111. package/documentOperations/index.js +7 -7
  112. package/documentOperations/index.js.map +1 -1
  113. package/findMatchingAstNode.d.ts +1 -1
  114. package/findMatchingAstNode.js.map +1 -1
  115. package/index.d.ts +1 -2
  116. package/index.js +1 -2
  117. package/index.js.map +1 -1
  118. package/lexical/createDefaultLexicalTheme.d.ts +1 -1
  119. package/lexical/createDefaultLexicalTheme.js.map +1 -1
  120. package/lexical/createLexicalTheme.d.ts +1 -1
  121. package/lexical/createLexicalTheme.js +2 -2
  122. package/lexical/createLexicalTheme.js.map +1 -1
  123. package/package.json +4 -4
  124. package/registerComponentGroup.d.ts +1 -1
  125. package/registerComponentGroup.js +1 -1
  126. package/registerComponentGroup.js.map +1 -1
  127. package/types/WebsiteBuilderTheme.d.ts +1 -1
  128. package/types/WebsiteBuilderTheme.js.map +1 -1
  129. package/types.d.ts +3 -3
  130. package/types.js.map +1 -1
  131. package/dataProviders/GET_ACTIVE_REDIRECTS.d.ts +0 -1
  132. package/dataProviders/GET_ACTIVE_REDIRECTS.js +0 -21
  133. package/dataProviders/GET_ACTIVE_REDIRECTS.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { contentSdk } from "./ContentSdk";
1
+ import { contentSdk } from "./ContentSdk.js";
2
2
  export const registerComponentGroup = group => {
3
3
  const editingSdk = contentSdk.getEditingSdk();
4
4
  if (!editingSdk) {
@@ -1 +1 @@
1
- {"version":3,"names":["contentSdk","registerComponentGroup","group","editingSdk","getEditingSdk"],"sources":["registerComponentGroup.ts"],"sourcesContent":["import type { ComponentGroup } from \"./types\";\nimport { contentSdk } from \"./ContentSdk\";\n\nexport const registerComponentGroup = (group: ComponentGroup) => {\n const editingSdk = contentSdk.getEditingSdk();\n\n if (!editingSdk) {\n return;\n }\n\n editingSdk.registerComponentGroup(group);\n};\n"],"mappings":"AACA,SAASA,UAAU;AAEnB,OAAO,MAAMC,sBAAsB,GAAIC,KAAqB,IAAK;EAC7D,MAAMC,UAAU,GAAGH,UAAU,CAACI,aAAa,CAAC,CAAC;EAE7C,IAAI,CAACD,UAAU,EAAE;IACb;EACJ;EAEAA,UAAU,CAACF,sBAAsB,CAACC,KAAK,CAAC;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["contentSdk","registerComponentGroup","group","editingSdk","getEditingSdk"],"sources":["registerComponentGroup.ts"],"sourcesContent":["import type { ComponentGroup } from \"./types.js\";\nimport { contentSdk } from \"./ContentSdk.js\";\n\nexport const registerComponentGroup = (group: ComponentGroup) => {\n const editingSdk = contentSdk.getEditingSdk();\n\n if (!editingSdk) {\n return;\n }\n\n editingSdk.registerComponentGroup(group);\n};\n"],"mappings":"AACA,SAASA,UAAU;AAEnB,OAAO,MAAMC,sBAAsB,GAAIC,KAAqB,IAAK;EAC7D,MAAMC,UAAU,GAAGH,UAAU,CAACI,aAAa,CAAC,CAAC;EAE7C,IAAI,CAACD,UAAU,EAAE;IACb;EACJ;EAEAA,UAAU,CAACF,sBAAsB,CAACC,KAAK,CAAC;AAC5C,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { LexicalEditorTheme } from "./LexicalEditorTheme";
1
+ import type { LexicalEditorTheme } from "./LexicalEditorTheme.js";
2
2
  export type Breakpoint = {
3
3
  name: string;
4
4
  title: string;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["WebsiteBuilderTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"./LexicalEditorTheme\";\n\nexport 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 cssVariables?: Record<string, string>;\n fonts?: string[];\n breakpoints: Breakpoint[];\n styles: {\n colors: Record<string, any>;\n typography: Typography;\n };\n lexical: LexicalEditorTheme;\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\n// We want to allow custom strings as well, thus the (string & {}).\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type TypographyType = \"headings\" | \"paragraphs\" | \"quotes\" | \"lists\" | (string & {});\n\nexport type TypographyStyle = {\n id: string;\n name: string;\n tag: string;\n className: string;\n};\n\nexport type Typography = Partial<Record<TypographyType, TypographyStyle[]>>;\n\nexport type WebsiteBuilderThemeInput = {\n /**\n * CSS to include in the editor.\n */\n css?: string;\n /**\n * CSS variables to define in the editor.\n */\n cssVariables?: Record<string, 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 lexical?: LexicalEditorTheme;\n styles?: {\n /**\n * color1: \"#fa5723\",\n * color2: \"#00ccb0\",\n */\n colors?: Record<string, any>;\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};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["WebsiteBuilderTheme.ts"],"sourcesContent":["import type { LexicalEditorTheme } from \"./LexicalEditorTheme.js\";\n\nexport 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 cssVariables?: Record<string, string>;\n fonts?: string[];\n breakpoints: Breakpoint[];\n styles: {\n colors: Record<string, any>;\n typography: Typography;\n };\n lexical: LexicalEditorTheme;\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\n// We want to allow custom strings as well, thus the (string & {}).\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type TypographyType = \"headings\" | \"paragraphs\" | \"quotes\" | \"lists\" | (string & {});\n\nexport type TypographyStyle = {\n id: string;\n name: string;\n tag: string;\n className: string;\n};\n\nexport type Typography = Partial<Record<TypographyType, TypographyStyle[]>>;\n\nexport type WebsiteBuilderThemeInput = {\n /**\n * CSS to include in the editor.\n */\n css?: string;\n /**\n * CSS variables to define in the editor.\n */\n cssVariables?: Record<string, 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 lexical?: LexicalEditorTheme;\n styles?: {\n /**\n * color1: \"#fa5723\",\n * color2: \"#00ccb0\",\n */\n colors?: Record<string, any>;\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};\n"],"mappings":"","ignoreList":[]}
package/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as CSS from "csstype";
2
- import type { BindingsApi } from "./BindingsApi";
3
- import type { ShorthandCssProperties } from "./types/ShorthandCssProperties";
4
- export type { WebsiteBuilderTheme, Breakpoint } from "./types/WebsiteBuilderTheme";
2
+ import type { BindingsApi } from "./BindingsApi.js";
3
+ import type { ShorthandCssProperties } from "./types/ShorthandCssProperties.js";
4
+ export type { WebsiteBuilderTheme, Breakpoint } from "./types/WebsiteBuilderTheme.js";
5
5
  interface CSSProperties extends CSS.Properties<string | number> {
6
6
  }
7
7
  export type ElementMap = Record<string, DocumentElement>;
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\";\nimport type { ShorthandCssProperties } from \"./types/ShorthandCssProperties\";\nexport type { WebsiteBuilderTheme, Breakpoint } from \"./types/WebsiteBuilderTheme\";\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\";\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 +0,0 @@
1
- export declare const GET_ACTIVE_REDIRECTS = "\n query GetActiveRedirects {\n websiteBuilder {\n getActiveRedirects {\n data {\n id\n from\n to\n permanent\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
@@ -1,21 +0,0 @@
1
- export const GET_ACTIVE_REDIRECTS = /* GraphQL*/`
2
- query GetActiveRedirects {
3
- websiteBuilder {
4
- getActiveRedirects {
5
- data {
6
- id
7
- from
8
- to
9
- permanent
10
- }
11
- error {
12
- code
13
- message
14
- data
15
- }
16
- }
17
- }
18
- }
19
- `;
20
-
21
- //# sourceMappingURL=GET_ACTIVE_REDIRECTS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["GET_ACTIVE_REDIRECTS"],"sources":["GET_ACTIVE_REDIRECTS.ts"],"sourcesContent":["export const GET_ACTIVE_REDIRECTS = /* GraphQL*/ `\n query GetActiveRedirects {\n websiteBuilder {\n getActiveRedirects {\n data {\n id\n from\n to\n permanent\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,oBAAoB,GAAG,YAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}