@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
@@ -1 +1 @@
1
- {"version":3,"names":["functionConverter","createTextInput","input","createInput","type","renderer","createLongTextInput","createNumberInput","createBooleanInput","createColorInput","createFileInput","createDateInput","createLexicalInput","createSelectInput","createRadioInput","createObjectInput","createTagsInput","list","createSlotInput","onChange","serialize"],"sources":["createInput.ts"],"sourcesContent":["import type {\n TextInput,\n LongTextInput,\n NumberInput,\n BooleanInput,\n ColorInput,\n FileInput,\n LexicalInput,\n SelectInput,\n RadioInput,\n ObjectInput,\n DateTimeInput,\n ComponentInput,\n TagsInput,\n SlotInput\n} from \"./types.js\";\nimport { functionConverter } from \"~/FunctionConverter.js\";\n\ntype OmitType<T> = Omit<T, \"type\">;\n\n// Text\nexport function createTextInput(input: OmitType<TextInput>) {\n return createInput({\n type: \"text\",\n renderer: \"Webiny/Input\",\n ...input\n }) as TextInput;\n}\n\n// Long Text\nexport function createLongTextInput(input: OmitType<LongTextInput>) {\n return createInput({\n type: \"longText\",\n renderer: \"Webiny/Textarea\",\n ...input\n });\n}\n\n// Number\nexport function createNumberInput(input: OmitType<NumberInput>) {\n return createInput({\n type: \"number\",\n renderer: \"Webiny/Number\",\n ...input\n }) as NumberInput;\n}\n\n// Boolean\nexport function createBooleanInput(input: OmitType<BooleanInput>) {\n return createInput({\n type: \"boolean\",\n renderer: \"Webiny/Switch\",\n ...input\n }) as BooleanInput;\n}\n\n// Color\nexport function createColorInput(input: OmitType<ColorInput>) {\n return createInput({\n type: \"color\",\n renderer: \"Webiny/ColorPicker\",\n ...input\n }) as ColorInput;\n}\n\n// File\nexport function createFileInput(input: OmitType<FileInput>) {\n return createInput({\n type: \"file\",\n renderer: \"Webiny/FileManager\",\n ...input\n }) as FileInput;\n}\n\n// Date\nexport function createDateInput(input: OmitType<DateTimeInput>) {\n return createInput({\n type: \"datetime\",\n renderer: \"Webiny/DateTime\",\n ...input\n }) as DateTimeInput;\n}\n\n// Rich Text\nexport function createLexicalInput(input: OmitType<LexicalInput>) {\n return createInput({\n type: \"lexical\",\n renderer: \"Webiny/Lexical\",\n ...input\n }) as LexicalInput;\n}\n\n// Select\nexport function createSelectInput(input: OmitType<SelectInput>) {\n return createInput({\n type: \"select\",\n renderer: \"Webiny/Select\",\n ...input\n }) as SelectInput;\n}\n\n// Radio\nexport function createRadioInput(input: OmitType<RadioInput>) {\n return createInput({\n type: \"radio\",\n renderer: \"Webiny/RadioGroup\",\n ...input\n }) as RadioInput;\n}\n\n// Object\nexport function createObjectInput(input: OmitType<ObjectInput>) {\n return createInput({\n type: \"object\",\n renderer: \"Webiny/Object\",\n ...input\n }) as ObjectInput;\n}\n\n// Tags\nexport function createTagsInput(input: OmitType<TagsInput>) {\n return createInput({\n type: \"text\",\n list: true,\n renderer: \"Webiny/Tags\",\n ...input\n }) as TagsInput;\n}\n\nexport function createSlotInput(input: OmitType<SlotInput>) {\n return createInput({\n type: \"slot\",\n list: true,\n renderer: \"Webiny/Slot\",\n ...input\n }) as SlotInput;\n}\n\n// Implementation\nexport function createInput(input: ComponentInput): ComponentInput {\n if (input.onChange) {\n // @ts-expect-error We don't use this function on the frontend, so this is ok.\n input.onChange = functionConverter.serialize(input.onChange!);\n }\n return input;\n}\n"],"mappings":"AAgBA,SAASA,iBAAiB;AAI1B;AACA,OAAO,SAASC,eAAeA,CAACC,KAA0B,EAAE;EACxD,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE,cAAc;IACxB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASI,mBAAmBA,CAACJ,KAA8B,EAAE;EAChE,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,UAAU;IAChBC,QAAQ,EAAE,iBAAiB;IAC3B,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASK,iBAAiBA,CAACL,KAA4B,EAAE;EAC5D,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,QAAQ;IACdC,QAAQ,EAAE,eAAe;IACzB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASM,kBAAkBA,CAACN,KAA6B,EAAE;EAC9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e;IACzB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASc,eAAeA,CAACd,KAA0B,EAAE;EACxD,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZa,IAAI,EAAE,IAAI;IACVZ,QAAQ,EAAE,aAAa;IACvB,GAAGH;EACP,CAAC,CAAC;AACN;AAEA,OAAO,SAASgB,eAAeA,CAAChB,KAA0B,EAAE;EACxD,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZa,IAAI,EAAE,IAAI;IACVZ,QAAQ,EAAE,aAAa;IACvB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASC,WAAWA,CAACD,KAAqB,EAAkB;EAC/D,IAAIA,KAAK,CAACiB,QAAQ,EAAE;IAChB;IACAjB,KAAK,CAACiB,QAAQ,GAAGnB,iBAAiB,CAACoB,SAAS,CAAClB,KAAK,CAACiB,QAAS,CAAC;EACjE;EACA,OAAOjB,KAAK;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["functionConverter","createTextInput","input","createInput","type","renderer","createLongTextInput","createNumberInput","createBooleanInput","createColorInput","createFileInput","createDateInput","createLexicalInput","createSelectInput","createRadioInput","createObjectInput","createTagsInput","list","createSlotInput","defaultValue","onChange","serialize"],"sources":["createInput.ts"],"sourcesContent":["import type {\n TextInput,\n LongTextInput,\n NumberInput,\n BooleanInput,\n ColorInput,\n FileInput,\n LexicalInput,\n SelectInput,\n RadioInput,\n ObjectInput,\n DateTimeInput,\n ComponentInput,\n TagsInput,\n SlotInput\n} from \"./types.js\";\nimport { functionConverter } from \"~/FunctionConverter.js\";\n\nexport type InputFactory<Name extends string> =\n | ReturnType<typeof createTextInput<Name>>\n | ReturnType<typeof createLongTextInput<Name>>\n | ReturnType<typeof createNumberInput<Name>>\n | ReturnType<typeof createBooleanInput<Name>>\n | ReturnType<typeof createColorInput<Name>>\n | ReturnType<typeof createFileInput<Name>>\n | ReturnType<typeof createDateInput<Name>>\n | ReturnType<typeof createLexicalInput<Name>>\n | ReturnType<typeof createSelectInput<Name>>\n | ReturnType<typeof createRadioInput<Name>>\n | ReturnType<typeof createObjectInput<Name>>\n | ReturnType<typeof createTagsInput<Name>>\n | ReturnType<typeof createSlotInput<Name>>;\n\n/**\n * TypeScript Overload Resolution and Input Factory Design\n *\n * Each input factory (e.g., createTextInput) is defined with two TypeScript overload signatures:\n * 1. One overload requires a `name` property in the input (used for array-based APIs, where inference is needed).\n * 2. The other overload omits the `name` property (used for object-based APIs, where the key provides the name).\n *\n * TypeScript resolves overloads by scanning from top to bottom and picking the first matching signature.\n * The implementation signature uses `any` for the argument, and the return type is unified to match all overloads.\n *\n * In array mode, the `name` must be explicitly provided in the input object, so inference for `TName` works.\n * In object mode, the input does not require a `name` property; instead, the key in the object (e.g., `{ foo: createTextInput({ ... }) }`)\n * provides the name via contextual typing from the consuming function (such as `createComponent`). TypeScript uses this context\n * to resolve the correct type for `TName` even when `name` is omitted from the input.\n *\n * This pattern ensures that all returned input objects are typed as `{ name: TName }`, whether `name` is provided explicitly or inferred,\n * so consumers of these factories do not need to worry about the presence of the `name` property in the result.\n */\n// Text\nexport function createTextInput<TName extends string>(\n input: { name: TName } & Omit<TextInput, \"type\" | \"name\">\n): TextInput & { name: TName };\nexport function createTextInput<TName extends string>(\n input: Omit<TextInput, \"type\" | \"name\">\n): TextInput & { name: TName };\nexport function createTextInput<TName extends string>(input: any): TextInput & { name: TName } {\n return createInput({\n type: \"text\",\n renderer: \"Webiny/Input\",\n ...input\n }) as TextInput & { name: TName };\n}\n\n// Long Text\nexport function createLongTextInput<TName extends string>(\n input: { name: TName } & Omit<LongTextInput, \"type\" | \"name\">\n): LongTextInput & { name: TName };\nexport function createLongTextInput<TName extends string>(\n input: Omit<LongTextInput, \"type\" | \"name\">\n): LongTextInput & { name: TName };\nexport function createLongTextInput<TName extends string>(\n input: any\n): LongTextInput & { name: TName } {\n return createInput({\n type: \"longText\",\n renderer: \"Webiny/Textarea\",\n ...input\n }) as LongTextInput & { name: TName };\n}\n\n// Number\nexport function createNumberInput<TName extends string>(\n input: { name: TName } & Omit<NumberInput, \"type\" | \"name\">\n): NumberInput & { name: TName };\nexport function createNumberInput<TName extends string>(\n input: Omit<NumberInput, \"type\" | \"name\">\n): NumberInput & { name: TName };\nexport function createNumberInput<TName extends string>(input: any): NumberInput & { name: TName } {\n return createInput({\n type: \"number\",\n renderer: \"Webiny/Number\",\n ...input\n }) as NumberInput & { name: TName };\n}\n\n// Boolean\nexport function createBooleanInput<TName extends string>(\n input: { name: TName } & Omit<BooleanInput, \"type\" | \"name\">\n): BooleanInput & { name: TName };\nexport function createBooleanInput<TName extends string>(\n input: Omit<BooleanInput, \"type\" | \"name\">\n): BooleanInput & { name: TName };\nexport function createBooleanInput<TName extends string>(\n input: any\n): BooleanInput & { name: TName } {\n return createInput({\n type: \"boolean\",\n renderer: \"Webiny/Switch\",\n ...input\n }) as BooleanInput & { name: TName };\n}\n\n// Color\nexport function createColorInput<TName extends string>(\n input: { name: TName } & Omit<ColorInput, \"type\" | \"name\">\n): ColorInput & { name: TName };\nexport function createColorInput<TName extends string>(\n input: Omit<ColorInput, \"type\" | \"name\">\n): ColorInput & { name: TName };\nexport function createColorInput<TName extends string>(input: any): ColorInput & { name: TName } {\n return createInput({\n type: \"color\",\n renderer: \"Webiny/ColorPicker\",\n ...input\n }) as ColorInput & { name: TName };\n}\n\n// File\nexport function createFileInput<TName extends string>(\n input: { name: TName } & Omit<FileInput, \"type\" | \"name\">\n): FileInput & { name: TName };\nexport function createFileInput<TName extends string>(\n input: Omit<FileInput, \"type\" | \"name\">\n): FileInput & { name: TName };\nexport function createFileInput<TName extends string>(input: any): FileInput & { name: TName } {\n return createInput({\n type: \"file\",\n renderer: \"Webiny/FileManager\",\n ...input\n }) as FileInput & { name: TName };\n}\n\n// Date\nexport function createDateInput<TName extends string>(\n input: { name: TName } & Omit<DateTimeInput, \"type\" | \"name\">\n): DateTimeInput & { name: TName };\nexport function createDateInput<TName extends string>(\n input: Omit<DateTimeInput, \"type\" | \"name\">\n): DateTimeInput & { name: TName };\nexport function createDateInput<TName extends string>(input: any): DateTimeInput & { name: TName } {\n return createInput({\n type: \"datetime\",\n renderer: \"Webiny/DateTime\",\n ...input\n }) as DateTimeInput & { name: TName };\n}\n\n// Rich Text\nexport function createLexicalInput<TName extends string>(\n input: { name: TName } & Omit<LexicalInput, \"type\" | \"name\">\n): LexicalInput & { name: TName };\nexport function createLexicalInput<TName extends string>(\n input: Omit<LexicalInput, \"type\" | \"name\">\n): LexicalInput & { name: TName };\nexport function createLexicalInput<TName extends string>(\n input: any\n): LexicalInput & { name: TName } {\n return createInput({\n type: \"lexical\",\n renderer: \"Webiny/Lexical\",\n ...input\n }) as LexicalInput & { name: TName };\n}\n\n// Select\nexport function createSelectInput<TName extends string>(\n input: { name: TName } & Omit<SelectInput, \"type\" | \"name\">\n): SelectInput & { name: TName };\nexport function createSelectInput<TName extends string>(\n input: Omit<SelectInput, \"type\" | \"name\">\n): SelectInput & { name: TName };\nexport function createSelectInput<TName extends string>(input: any): SelectInput & { name: TName } {\n return createInput({\n type: \"select\",\n renderer: \"Webiny/Select\",\n ...input\n }) as SelectInput & { name: TName };\n}\n\n// Radio\nexport function createRadioInput<TName extends string>(\n input: { name: TName } & Omit<RadioInput, \"type\" | \"name\">\n): RadioInput & { name: TName };\nexport function createRadioInput<TName extends string>(\n input: Omit<RadioInput, \"type\" | \"name\">\n): RadioInput & { name: TName };\nexport function createRadioInput<TName extends string>(input: any): RadioInput & { name: TName } {\n return createInput({\n type: \"radio\",\n renderer: \"Webiny/RadioGroup\",\n ...input\n }) as RadioInput & { name: TName };\n}\n\n// Object\nexport function createObjectInput<TName extends string>(\n input: { name: TName } & Omit<ObjectInput, \"type\" | \"name\">\n): ObjectInput & { name: TName };\nexport function createObjectInput<TName extends string>(\n input: Omit<ObjectInput, \"type\" | \"name\">\n): ObjectInput & { name: TName };\nexport function createObjectInput<TName extends string>(input: any): ObjectInput & { name: TName } {\n return createInput({\n type: \"object\",\n renderer: \"Webiny/Object\",\n ...input\n }) as ObjectInput & { name: TName };\n}\n\n// Tags\nexport function createTagsInput<TName extends string>(\n input: { name: TName } & Omit<TagsInput, \"type\" | \"name\">\n): TagsInput & { name: TName };\nexport function createTagsInput<TName extends string>(\n input: Omit<TagsInput, \"type\" | \"name\">\n): TagsInput & { name: TName };\nexport function createTagsInput<TName extends string>(input: any): TagsInput & { name: TName } {\n return createInput({\n type: \"text\",\n list: true,\n renderer: \"Webiny/Tags\",\n ...input\n }) as TagsInput & { name: TName };\n}\n\nexport function createSlotInput<TName extends string>(\n input: { name: TName } & Omit<SlotInput, \"type\" | \"name\">\n): SlotInput & { name: TName };\nexport function createSlotInput<TName extends string>(\n input: Omit<SlotInput, \"type\" | \"name\">\n): SlotInput & { name: TName };\nexport function createSlotInput<TName extends string>(input: any): SlotInput & { name: TName } {\n return createInput({\n type: \"slot\",\n list: true,\n renderer: \"Webiny/Slot\",\n defaultValue: [],\n ...input\n }) as SlotInput & { name: TName };\n}\n\n// Implementation\nexport function createInput(input: ComponentInput): ComponentInput {\n if (input.onChange) {\n // @ts-expect-error We don't use this function on the frontend, so this is ok.\n input.onChange = functionConverter.serialize(input.onChange!);\n }\n return input;\n}\n"],"mappings":"AAgBA,SAASA,iBAAiB;;AAiB1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,OAAO,SAASC,eAAeA,CAAuBC,KAAU,EAA+B;EAC3F,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE,cAAc;IACxB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;;AAOA,OAAO,SAASI,mBAAmBA,CAC/BJ,KAAU,EACqB;EAC/B,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,UAAU;IAChBC,QAAQ,EAAE,iBAAiB;IAC3B,GAAGH;EACP,C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,gBAAgBA,CAAuBZ,KAAU,EAAgC;EAC7F,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,OAAO;IACbC,QAAQ,EAAE,mBAAmB;IAC7B,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;;AAOA,OAAO,SAASa,iBAAiBA,CAAuBb,KAAU,EAAiC;EAC/F,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,QAAQ;IACdC,QAAQ,EAAE,eAAe;IACzB,GAAGH;EACP,CAAC,CAAC;AACN;;AAEA;;AAOA,OAAO,SAASc,eAAeA,CAAuBd,KAAU,EAA+B;EAC3F,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZa,IAAI,EAAE,IAAI;IACVZ,QAAQ,EAAE,aAAa;IACvB,GAAGH;EACP,CAAC,CAAC;AACN;AAQA,OAAO,SAASgB,eAAeA,CAAuBhB,KAAU,EAA+B;EAC3F,OAAOC,WAAW,CAAC;IACfC,IAAI,EAAE,MAAM;IACZa,IAAI,EAAE,IAAI;IACVZ,QAAQ,EAAE,aAAa;IACvBc,YAAY,EAAE,EAAE;IAChB,GAAGjB;EACP,CAAC,CAAC;AACN;;AAEA;AACA,OAAO,SAASC,WAAWA,CAACD,KAAqB,EAAkB;EAC/D,IAAIA,KAAK,CAACkB,QAAQ,EAAE;IAChB;IACAlB,KAAK,CAACkB,QAAQ,GAAGpB,iBAAiB,CAACqB,SAAS,CAACnB,KAAK,CAACkB,QAAS,CAAC;EACjE;EACA,OAAOlB,KAAK;AAChB","ignoreList":[]}
@@ -5,6 +5,7 @@ interface QueryParams {
5
5
  }
6
6
  type WithPath<T> = T & {
7
7
  path?: string;
8
+ next?: Record<string, any>;
8
9
  };
9
10
  export declare class ApiClient {
10
11
  private readonly apiHost;
@@ -1 +1 @@
1
- {"version":3,"names":["ApiClient","constructor","apiHost","apiKey","apiTenant","fetch","headers","path","params","method","Authorization","then","res","json","query","variables","preview","fetchOptions","next","revalidate","request","body","JSON","stringify","message","Error","errors","console","error","data"],"sources":["ApiClient.ts"],"sourcesContent":["interface QueryParams {\n query: string;\n variables: Record<string, any>;\n preview?: boolean;\n}\n\ntype WithPath<T> = T & {\n path?: string;\n};\n\nexport class ApiClient {\n private readonly apiHost: string;\n private readonly apiKey: string;\n private readonly apiTenant: string;\n\n constructor(apiHost: string, apiKey: string, apiTenant: string) {\n this.apiTenant = apiTenant;\n this.apiHost = apiHost;\n this.apiKey = apiKey;\n }\n\n async fetch({ headers, path, ...params }: WithPath<RequestInit>): Promise<any> {\n return fetch(`${this.apiHost}${path}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Tenant\": this.apiTenant,\n Authorization: \"Bearer \" + this.apiKey,\n ...headers\n },\n ...params\n }).then(res => res.json());\n }\n\n async query({ query, variables, preview }: QueryParams) {\n const fetchOptions = {\n next: {\n revalidate: preview ? 0 : 60\n }\n };\n\n const request: WithPath<RequestInit> = {\n ...fetchOptions,\n path: \"/graphql\",\n method: \"POST\",\n body: JSON.stringify({\n query,\n variables\n })\n };\n\n const json = await this.fetch(request);\n\n if (json.message) {\n throw new Error(json.message);\n }\n\n if (json.errors) {\n console.error(json.errors);\n throw new Error(\"Failed to fetch API\");\n }\n\n return json.data;\n }\n}\n"],"mappings":"AAUA,OAAO,MAAMA,SAAS,CAAC;EAKnBC,WAAWA,CAACC,OAAe,EAAEC,MAAc,EAAEC,SAAiB,EAAE;IAC5D,IAAI,CAACA,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACF,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAME,KAAKA,CAAC;IAAEC,OAAO;IAAEC,IAAI;IAAE,GAAGC;EAA8B,CAAC,EAAgB;IAC3E,OAAOH,KAAK,CAAC,GAAG,IAAI,CAACH,OAAO,GAAGK,IAAI,EAAE,EAAE;MACnCE,MAAM,EAAE,KAAK;MACbH,OAAO,EAAE;QACL,cAAc,EAAE,kBAAkB;QAClC,UAAU,EAAE,IAAI,CAACF,SAAS;QAC1BM,aAAa,EAAE,SAAS,GAAG,IAAI,CAACP,MAAM;QACtC,GAAGG;MACP,CAAC;MACD,GAAGE;IACP,CAAC,CAAC,CAACG,IAAI,CAACC,GAAG,IAAIA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;EAC9B;EAEA,MAAMC,KAAKA,CAAC;IAAEA,KAAK;IAAEC,SAAS;IAAEC;EAAqB,CAAC,EAAE;IACpD,MAAMC,YAAY,GAAG;MACjBC,IAAI,EAAE;QACFC,UAAU,EAAEH,OAAO,GAAG,CAAC,GAAG;MAC9B;IACJ,CAAC;IAED,MAAMI,OAA8B,GAAG;MACnC,GAAGH,YAAY;MACfV,IAAI,EAAE,UAAU;MAChBE,MAAM,EAAE,MAAM;MACdY,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;QACjBT,KAAK;QACLC;MACJ,CAAC;IACL,CAAC;IAED,MAAMF,IAAI,GAAG,MAAM,IAAI,CAACR,KAAK,CAACe,OAAO,CAAC;IAEtC,IAAIP,IAAI,CAACW,OAAO,EAAE;MACd,MAAM,IAAIC,KAAK,CAACZ,IAAI,CAACW,OAAO,CAAC;IACjC;IAEA,IAAIX,IAAI,CAACa,MAAM,EAAE;MACbC,OAAO,CAACC,KAAK,CAACf,IAAI,CAACa,MAAM,CAAC;MAC1B,MAAM,IAAID,KAAK,CAAC,qBAAqB,CAAC;IAC1C;IAEA,OAAOZ,IAAI,CAACgB,IAAI;EACpB;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["ApiClient","constructor","apiHost","apiKey","apiTenant","fetch","headers","path","params","method","Authorization","then","res","json","query","variables","preview","fetchOptions","next","revalidate","request","body","JSON","stringify","message","Error","errors","console","error","data"],"sources":["ApiClient.ts"],"sourcesContent":["interface QueryParams {\n query: string;\n variables: Record<string, any>;\n preview?: boolean;\n}\n\ntype WithPath<T> = T & {\n path?: string;\n next?: Record<string, any>;\n};\n\nexport class ApiClient {\n private readonly apiHost: string;\n private readonly apiKey: string;\n private readonly apiTenant: string;\n\n constructor(apiHost: string, apiKey: string, apiTenant: string) {\n this.apiTenant = apiTenant;\n this.apiHost = apiHost;\n this.apiKey = apiKey;\n }\n\n async fetch({ headers, path, ...params }: WithPath<RequestInit>): Promise<any> {\n return fetch(`${this.apiHost}${path}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Tenant\": this.apiTenant,\n Authorization: \"Bearer \" + this.apiKey,\n ...headers\n },\n ...params\n }).then(res => res.json());\n }\n\n async query({ query, variables, preview }: QueryParams) {\n const fetchOptions = {\n next: {\n revalidate: preview ? 0 : 60\n }\n };\n\n const request: WithPath<RequestInit> = {\n ...fetchOptions,\n path: \"/graphql\",\n method: \"POST\",\n body: JSON.stringify({\n query,\n variables\n })\n };\n\n const json = await this.fetch(request);\n\n if (json.message) {\n throw new Error(json.message);\n }\n\n if (json.errors) {\n console.error(json.errors);\n throw new Error(\"Failed to fetch API\");\n }\n\n return json.data;\n }\n}\n"],"mappings":"AAWA,OAAO,MAAMA,SAAS,CAAC;EAKnBC,WAAWA,CAACC,OAAe,EAAEC,MAAc,EAAEC,SAAiB,EAAE;IAC5D,IAAI,CAACA,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACF,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAME,KAAKA,CAAC;IAAEC,OAAO;IAAEC,IAAI;IAAE,GAAGC;EAA8B,CAAC,EAAgB;IAC3E,OAAOH,KAAK,CAAC,GAAG,IAAI,CAACH,OAAO,GAAGK,IAAI,EAAE,EAAE;MACnCE,MAAM,EAAE,KAAK;MACbH,OAAO,EAAE;QACL,cAAc,EAAE,kBAAkB;QAClC,UAAU,EAAE,IAAI,CAACF,SAAS;QAC1BM,aAAa,EAAE,SAAS,GAAG,IAAI,CAACP,MAAM;QACtC,GAAGG;MACP,CAAC;MACD,GAAGE;IACP,CAAC,CAAC,CAACG,IAAI,CAACC,GAAG,IAAIA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;EAC9B;EAEA,MAAMC,KAAKA,CAAC;IAAEA,KAAK;IAAEC,SAAS;IAAEC;EAAqB,CAAC,EAAE;IACpD,MAAMC,YAAY,GAAG;MACjBC,IAAI,EAAE;QACFC,UAAU,EAAEH,OAAO,GAAG,CAAC,GAAG;MAC9B;IACJ,CAAC;IAED,MAAMI,OAA8B,GAAG;MACnC,GAAGH,YAAY;MACfV,IAAI,EAAE,UAAU;MAChBE,MAAM,EAAE,MAAM;MACdY,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;QACjBT,KAAK;QACLC;MACJ,CAAC;IACL,CAAC;IAED,MAAMF,IAAI,GAAG,MAAM,IAAI,CAACR,KAAK,CAACe,OAAO,CAAC;IAEtC,IAAIP,IAAI,CAACW,OAAO,EAAE;MACd,MAAM,IAAIC,KAAK,CAACZ,IAAI,CAACW,OAAO,CAAC;IACjC;IAEA,IAAIX,IAAI,CAACa,MAAM,EAAE;MACbC,OAAO,CAACC,KAAK,CAACf,IAAI,CAACa,MAAM,CAAC;MAC1B,MAAM,IAAID,KAAK,CAAC,qBAAqB,CAAC;IAC1C;IAEA,OAAOZ,IAAI,CAACgB,IAAI;EACpB;AACJ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { IDataProvider, PublicPage } from "../types.js";
2
- import type { ApiClient } from "./ApiClient.js";
2
+ import type { ApiClient } from "../dataProviders/ApiClient.js";
3
3
  interface DefaultDataProviderConfig {
4
4
  apiClient: ApiClient;
5
5
  }
@@ -1 +1 @@
1
- export declare const GET_PAGE_BY_ID = "\n query GetPageById($id: ID!) {\n websiteBuilder {\n getPageById(id: $id) {\n data {\n id\n properties\n elements\n bindings\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
1
+ export declare const GET_PAGE_BY_ID = "\n query GetPageById($id: ID!) {\n websiteBuilder {\n getPageById(id: $id) {\n data {\n id\n properties\n elements\n bindings\n extensions\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
@@ -7,6 +7,7 @@ export const GET_PAGE_BY_ID = /* GraphQL*/`
7
7
  properties
8
8
  elements
9
9
  bindings
10
+ extensions
10
11
  }
11
12
  error {
12
13
  code
@@ -1 +1 @@
1
- {"version":3,"names":["GET_PAGE_BY_ID"],"sources":["GET_PAGE_BY_ID.ts"],"sourcesContent":["export const GET_PAGE_BY_ID = /* GraphQL*/ `\n query GetPageById($id: ID!) {\n websiteBuilder {\n getPageById(id: $id) {\n data {\n id\n properties\n elements\n bindings\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,YAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["GET_PAGE_BY_ID"],"sources":["GET_PAGE_BY_ID.ts"],"sourcesContent":["export const GET_PAGE_BY_ID = /* GraphQL*/ `\n query GetPageById($id: ID!) {\n websiteBuilder {\n getPageById(id: $id) {\n data {\n id\n properties\n elements\n bindings\n extensions\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,YAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- export declare const GET_PAGE_BY_PATH = "\n query GetPageByPath($path: String!) {\n websiteBuilder {\n getPageByPath(path: $path) {\n data {\n id\n properties\n elements\n bindings\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
1
+ export declare const GET_PAGE_BY_PATH = "\n query GetPageByPath($path: String!) {\n websiteBuilder {\n getPageByPath(path: $path) {\n data {\n id\n properties\n elements\n bindings\n extensions\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
@@ -7,6 +7,7 @@ export const GET_PAGE_BY_PATH = /* GraphQL*/`
7
7
  properties
8
8
  elements
9
9
  bindings
10
+ extensions
10
11
  }
11
12
  error {
12
13
  code
@@ -1 +1 @@
1
- {"version":3,"names":["GET_PAGE_BY_PATH"],"sources":["GET_PAGE_BY_PATH.ts"],"sourcesContent":["export const GET_PAGE_BY_PATH = /* GraphQL*/ `\n query GetPageByPath($path: String!) {\n websiteBuilder {\n getPageByPath(path: $path) {\n data {\n id\n properties\n elements\n bindings\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG,YAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["GET_PAGE_BY_PATH"],"sources":["GET_PAGE_BY_PATH.ts"],"sourcesContent":["export const GET_PAGE_BY_PATH = /* GraphQL*/ `\n query GetPageByPath($path: String!) {\n websiteBuilder {\n getPageByPath(path: $path) {\n data {\n id\n properties\n elements\n bindings\n extensions\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG,YAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- export declare const LIST_PUBLISHED_PAGES = "\n query ListPublishedPages($where: WbPagesListWhereInput) {\n websiteBuilder {\n listPages(where: $where) {\n data {\n id\n properties\n elements\n bindings\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
1
+ export declare const LIST_PUBLISHED_PAGES = "\n query ListPublishedPages($where: WbPagesListWhereInput) {\n websiteBuilder {\n listPages(where: $where) {\n data {\n id\n properties\n elements\n bindings\n extensions\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n";
@@ -7,6 +7,7 @@ export const LIST_PUBLISHED_PAGES = /* GraphQL*/`
7
7
  properties
8
8
  elements
9
9
  bindings
10
+ extensions
10
11
  }
11
12
  error {
12
13
  code
@@ -1 +1 @@
1
- {"version":3,"names":["LIST_PUBLISHED_PAGES"],"sources":["LIST_PUBLISHED_PAGES.ts"],"sourcesContent":["export const LIST_PUBLISHED_PAGES = /* GraphQL*/ `\n query ListPublishedPages($where: WbPagesListWhereInput) {\n websiteBuilder {\n listPages(where: $where) {\n data {\n id\n properties\n elements\n bindings\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":[]}
1
+ {"version":3,"names":["LIST_PUBLISHED_PAGES"],"sources":["LIST_PUBLISHED_PAGES.ts"],"sourcesContent":["export const LIST_PUBLISHED_PAGES = /* GraphQL*/ `\n query ListPublishedPages($where: WbPagesListWhereInput) {\n websiteBuilder {\n listPages(where: $where) {\n data {\n id\n properties\n elements\n bindings\n extensions\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;AACA,CAAC","ignoreList":[]}
@@ -16,7 +16,11 @@ export class RedirectsProvider {
16
16
  }
17
17
  async populateCache() {
18
18
  const redirects = await this.apiClient.fetch({
19
- path: "/wb/redirects"
19
+ path: "/wb/redirects",
20
+ cache: "no-cache",
21
+ next: {
22
+ revalidate: 0
23
+ }
20
24
  });
21
25
  this.redirectsCache = new Map();
22
26
  for (const redirect of redirects) {
@@ -1 +1 @@
1
- {"version":3,"names":["RedirectsProvider","redirectsCache","undefined","constructor","apiClient","getRedirectByPath","path","populateCache","get","getAllRedirects","Map","redirects","fetch","redirect","set","from"],"sources":["RedirectsProvider.ts"],"sourcesContent":["import type { ApiClient } from \"./ApiClient.js\";\nimport type { IRedirects } from \"~/IRedirects.js\";\nimport type { PublicRedirect } from \"~/types.js\";\n\nexport class RedirectsProvider implements IRedirects {\n private redirectsCache: Map<string, PublicRedirect> | undefined = undefined;\n private apiClient: ApiClient;\n\n constructor(apiClient: ApiClient) {\n this.apiClient = apiClient;\n }\n\n async getRedirectByPath(path: string): Promise<PublicRedirect | undefined> {\n await this.populateCache();\n\n if (!this.redirectsCache) {\n return undefined;\n }\n\n return this.redirectsCache.get(path);\n }\n\n async getAllRedirects(): Promise<Map<string, PublicRedirect>> {\n await this.populateCache();\n return this.redirectsCache ?? new Map();\n }\n\n private async populateCache() {\n const redirects: PublicRedirect[] = await this.apiClient.fetch({ path: \"/wb/redirects\" });\n\n this.redirectsCache = new Map();\n for (const redirect of redirects) {\n this.redirectsCache.set(redirect.from, redirect);\n }\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,iBAAiB,CAAuB;EACzCC,cAAc,GAA4CC,SAAS;EAG3EC,WAAWA,CAACC,SAAoB,EAAE;IAC9B,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,iBAAiBA,CAACC,IAAY,EAAuC;IACvE,MAAM,IAAI,CAACC,aAAa,CAAC,CAAC;IAE1B,IAAI,CAAC,IAAI,CAACN,cAAc,EAAE;MACtB,OAAOC,SAAS;IACpB;IAEA,OAAO,IAAI,CAACD,cAAc,CAACO,GAAG,CAACF,IAAI,CAAC;EACxC;EAEA,MAAMG,eAAeA,CAAA,EAAyC;IAC1D,MAAM,IAAI,CAACF,aAAa,CAAC,CAAC;IAC1B,OAAO,IAAI,CAACN,cAAc,IAAI,IAAIS,GAAG,CAAC,CAAC;EAC3C;EAEA,MAAcH,aAAaA,CAAA,EAAG;IAC1B,MAAMI,SAA2B,GAAG,MAAM,IAAI,CAACP,SAAS,CAACQ,KAAK,CAAC;MAAEN,IAAI,EAAE;IAAgB,CAAC,CAAC;IAEzF,IAAI,CAACL,cAAc,GAAG,IAAIS,GAAG,CAAC,CAAC;IAC/B,KAAK,MAAMG,QAAQ,IAAIF,SAAS,EAAE;MAC9B,IAAI,CAACV,cAAc,CAACa,GAAG,CAACD,QAAQ,CAACE,IAAI,EAAEF,QAAQ,CAAC;IACpD;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["RedirectsProvider","redirectsCache","undefined","constructor","apiClient","getRedirectByPath","path","populateCache","get","getAllRedirects","Map","redirects","fetch","cache","next","revalidate","redirect","set","from"],"sources":["RedirectsProvider.ts"],"sourcesContent":["import type { ApiClient } from \"./ApiClient.js\";\nimport type { IRedirects } from \"~/IRedirects.js\";\nimport type { PublicRedirect } from \"~/types.js\";\n\nexport class RedirectsProvider implements IRedirects {\n private redirectsCache: Map<string, PublicRedirect> | undefined = undefined;\n private apiClient: ApiClient;\n\n constructor(apiClient: ApiClient) {\n this.apiClient = apiClient;\n }\n\n async getRedirectByPath(path: string): Promise<PublicRedirect | undefined> {\n await this.populateCache();\n\n if (!this.redirectsCache) {\n return undefined;\n }\n\n return this.redirectsCache.get(path);\n }\n\n async getAllRedirects(): Promise<Map<string, PublicRedirect>> {\n await this.populateCache();\n return this.redirectsCache ?? new Map();\n }\n\n private async populateCache() {\n const redirects: PublicRedirect[] = await this.apiClient.fetch({\n path: \"/wb/redirects\",\n cache: \"no-cache\",\n next: {\n revalidate: 0\n }\n });\n\n this.redirectsCache = new Map();\n for (const redirect of redirects) {\n this.redirectsCache.set(redirect.from, redirect);\n }\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,iBAAiB,CAAuB;EACzCC,cAAc,GAA4CC,SAAS;EAG3EC,WAAWA,CAACC,SAAoB,EAAE;IAC9B,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,iBAAiBA,CAACC,IAAY,EAAuC;IACvE,MAAM,IAAI,CAACC,aAAa,CAAC,CAAC;IAE1B,IAAI,CAAC,IAAI,CAACN,cAAc,EAAE;MACtB,OAAOC,SAAS;IACpB;IAEA,OAAO,IAAI,CAACD,cAAc,CAACO,GAAG,CAACF,IAAI,CAAC;EACxC;EAEA,MAAMG,eAAeA,CAAA,EAAyC;IAC1D,MAAM,IAAI,CAACF,aAAa,CAAC,CAAC;IAC1B,OAAO,IAAI,CAACN,cAAc,IAAI,IAAIS,GAAG,CAAC,CAAC;EAC3C;EAEA,MAAcH,aAAaA,CAAA,EAAG;IAC1B,MAAMI,SAA2B,GAAG,MAAM,IAAI,CAACP,SAAS,CAACQ,KAAK,CAAC;MAC3DN,IAAI,EAAE,eAAe;MACrBO,KAAK,EAAE,UAAU;MACjBC,IAAI,EAAE;QACFC,UAAU,EAAE;MAChB;IACJ,CAAC,CAAC;IAEF,IAAI,CAACd,cAAc,GAAG,IAAIS,GAAG,CAAC,CAAC;IAC/B,KAAK,MAAMM,QAAQ,IAAIL,SAAS,EAAE;MAC9B,IAAI,CAACV,cAAc,CAACgB,GAAG,CAACD,QAAQ,CAACE,IAAI,EAAEF,QAAQ,CAAC;IACpD;EACJ;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["SetGlobalStyleBinding","constructor","elementId","bindingPath","binding","apply","document","bindings","styles"],"sources":["SetGlobalStyleBinding.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetGlobalStyleBinding implements IDocumentOperation {\n private readonly elementId: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(elementId: string, bindingPath: string, binding: StyleValueBinding) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? { styles: {} };\n // @ts-expect-error String doesn't play well with CSSProperties.\n const binding = bindings.styles ? bindings.styles[this.bindingPath] ?? {} : {};\n document.bindings[this.elementId] = {\n ...bindings,\n styles: {\n ...bindings.styles,\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,qBAAqB,CAA+B;EAK7DC,WAAWA,CAACC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,EAAE;IAC5E,IAAI,CAACF,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,IAAI;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IACpE;IACA,MAAMJ,OAAO,GAAGG,QAAQ,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM,CAAC,IAAI,CAACL,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9EG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,GAAG;MAChC,GAAGK,QAAQ;MACXC,MAAM,EAAE;QACJ,GAAGD,QAAQ,CAACC,MAAM;QAClB,CAAC,IAAI,CAACL,WAAW,GAAG;UAChB,GAAGC,OAAO;UACV,GAAG,IAAI,CAACA;QACZ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["SetGlobalStyleBinding","constructor","elementId","bindingPath","binding","apply","document","bindings","styles"],"sources":["SetGlobalStyleBinding.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetGlobalStyleBinding implements IDocumentOperation {\n private readonly elementId: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(elementId: string, bindingPath: string, binding: StyleValueBinding) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? { styles: {} };\n // @ts-expect-error String doesn't play well with CSSProperties.\n const binding = bindings.styles ? (bindings.styles[this.bindingPath] ?? {}) : {};\n document.bindings[this.elementId] = {\n ...bindings,\n styles: {\n ...bindings.styles,\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,qBAAqB,CAA+B;EAK7DC,WAAWA,CAACC,SAAiB,EAAEC,WAAmB,EAAEC,OAA0B,EAAE;IAC5E,IAAI,CAACF,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,IAAI;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IACpE;IACA,MAAMJ,OAAO,GAAGG,QAAQ,CAACC,MAAM,GAAID,QAAQ,CAACC,MAAM,CAAC,IAAI,CAACL,WAAW,CAAC,IAAI,CAAC,CAAC,GAAI,CAAC,CAAC;IAChFG,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACL,SAAS,CAAC,GAAG;MAChC,GAAGK,QAAQ;MACXC,MAAM,EAAE;QACJ,GAAGD,QAAQ,CAACC,MAAM;QAClB,CAAC,IAAI,CAACL,WAAW,GAAG;UAChB,GAAGC,OAAO;UACV,GAAG,IAAI,CAACA;QACZ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["SetInputBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","inputs"],"sources":["SetInputBindingOverride.ts"],"sourcesContent":["import type { Document, InputValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetInputBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: InputValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: InputValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? bindings.overrides[this.breakpoint] ?? {}\n : { inputs: {} };\n\n const binding = breakpointOverrides.inputs\n ? breakpointOverrides.inputs[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n inputs: {\n ...(breakpointOverrides.inputs || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACxCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GACzC;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM,GACpCF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["SetInputBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","inputs"],"sources":["SetInputBindingOverride.ts"],"sourcesContent":["import type { Document, InputValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetInputBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: InputValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: InputValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? (bindings.overrides[this.breakpoint] ?? {})\n : { inputs: {} };\n\n const binding = breakpointOverrides.inputs\n ? breakpointOverrides.inputs[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n inputs: {\n ...(breakpointOverrides.inputs || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACvCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GAC1C;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM,GACpCF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["SetStyleBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","styles"],"sources":["SetStyleBindingOverride.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetStyleBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: StyleValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? bindings.overrides[this.breakpoint] ?? {}\n : { styles: {} };\n\n const binding = breakpointOverrides.styles\n ? // @ts-expect-error String doesn't play well with CSSProperties.\n breakpointOverrides.styles[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n styles: {\n ...(breakpointOverrides.styles || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACxCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GACzC;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM;IACpC;IACAF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["SetStyleBindingOverride","constructor","elementId","bindingPath","binding","breakpoint","apply","document","bindings","breakpointOverrides","overrides","styles"],"sources":["SetStyleBindingOverride.ts"],"sourcesContent":["import type { Document, StyleValueBinding } from \"~/types.js\";\nimport type { IDocumentOperation } from \"./IDocumentOperation.js\";\n\nexport class SetStyleBindingOverride implements IDocumentOperation {\n private readonly elementId: string;\n private breakpoint: string;\n private readonly bindingPath: string;\n private readonly binding: StyleValueBinding;\n\n constructor(\n elementId: string,\n bindingPath: string,\n binding: StyleValueBinding,\n breakpoint: string\n ) {\n this.elementId = elementId;\n this.bindingPath = bindingPath;\n this.binding = binding;\n this.breakpoint = breakpoint;\n }\n\n apply(document: Document) {\n const bindings = document.bindings[this.elementId] ?? {};\n const breakpointOverrides = bindings.overrides\n ? (bindings.overrides[this.breakpoint] ?? {})\n : { styles: {} };\n\n const binding = breakpointOverrides.styles\n ? // @ts-expect-error String doesn't play well with CSSProperties.\n breakpointOverrides.styles[this.bindingPath]\n : {};\n\n document.bindings[this.elementId] = {\n ...bindings,\n overrides: {\n ...(bindings.overrides || {}),\n [this.breakpoint]: {\n ...breakpointOverrides,\n styles: {\n ...(breakpointOverrides.styles || {}),\n [this.bindingPath]: {\n ...binding,\n ...this.binding\n }\n }\n }\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,uBAAuB,CAA+B;EAM/DC,WAAWA,CACPC,SAAiB,EACjBC,WAAmB,EACnBC,OAA0B,EAC1BC,UAAkB,EACpB;IACE,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,UAAU,GAAGA,UAAU;EAChC;EAEAC,KAAKA,CAACC,QAAkB,EAAE;IACtB,MAAMC,QAAQ,GAAGD,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,MAAMO,mBAAmB,GAAGD,QAAQ,CAACE,SAAS,GACvCF,QAAQ,CAACE,SAAS,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAAC,CAAC,GAC1C;MAAEM,MAAM,EAAE,CAAC;IAAE,CAAC;IAEpB,MAAMP,OAAO,GAAGK,mBAAmB,CAACE,MAAM;IACpC;IACAF,mBAAmB,CAACE,MAAM,CAAC,IAAI,CAACR,WAAW,CAAC,GAC5C,CAAC,CAAC;IAERI,QAAQ,CAACC,QAAQ,CAAC,IAAI,CAACN,SAAS,CAAC,GAAG;MAChC,GAAGM,QAAQ;MACXE,SAAS,EAAE;QACP,IAAIF,QAAQ,CAACE,SAAS,IAAI,CAAC,CAAC,CAAC;QAC7B,CAAC,IAAI,CAACL,UAAU,GAAG;UACf,GAAGI,mBAAmB;UACtBE,MAAM,EAAE;YACJ,IAAIF,mBAAmB,CAACE,MAAM,IAAI,CAAC,CAAC,CAAC;YACrC,CAAC,IAAI,CAACR,WAAW,GAAG;cAChB,GAAGC,OAAO;cACV,GAAG,IAAI,CAACA;YACZ;UACJ;QACJ;MACJ;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- export declare const generateElementId: (size?: number | undefined) => string;
1
+ export declare const generateElementId: (size?: number) => string;
@@ -1,5 +1,4 @@
1
1
  import { customAlphabet } from "nanoid";
2
- // @ts-expect-error
3
2
  import { lowercase, numbers } from "nanoid-dictionary";
4
3
  const DEFAULT_SIZE = 21;
5
4
  export const generateElementId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE);
@@ -1 +1 @@
1
- {"version":3,"names":["customAlphabet","lowercase","numbers","DEFAULT_SIZE","generateElementId"],"sources":["generateElementId.ts"],"sourcesContent":["import { customAlphabet } from \"nanoid\";\n// @ts-expect-error\nimport { lowercase, numbers } from \"nanoid-dictionary\";\n\nconst DEFAULT_SIZE = 21;\n\nexport const generateElementId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE);\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,QAAQ;AACvC;AACA,SAASC,SAAS,EAAEC,OAAO,QAAQ,mBAAmB;AAEtD,MAAMC,YAAY,GAAG,EAAE;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,cAAc,CAAC,GAAGC,SAAS,GAAGC,OAAO,EAAE,EAAEC,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["customAlphabet","lowercase","numbers","DEFAULT_SIZE","generateElementId"],"sources":["generateElementId.ts"],"sourcesContent":["import { customAlphabet } from \"nanoid\";\nimport { lowercase, numbers } from \"nanoid-dictionary\";\n\nconst DEFAULT_SIZE = 21;\n\nexport const generateElementId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE);\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,QAAQ;AACvC,SAASC,SAAS,EAAEC,OAAO,QAAQ,mBAAmB;AAEtD,MAAMC,YAAY,GAAG,EAAE;AAEvB,OAAO,MAAMC,iBAAiB,GAAGJ,cAAc,CAAC,GAAGC,SAAS,GAAGC,OAAO,EAAE,EAAEC,YAAY,CAAC","ignoreList":[]}
package/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export * from "./MouseTracker.js";
12
12
  export * from "./ViewportManager.js";
13
13
  export * from "./messenger/Messenger.js";
14
14
  export * from "./messenger/MessageOrigin.js";
15
- export * from "./types.js";
15
+ export type * from "./types.js";
16
16
  export * from "./DocumentStoreManager.js";
17
17
  export * from "./BindingsProcessor.js";
18
18
  export * from "./ResizeObserver.js";
package/index.js CHANGED
@@ -12,7 +12,6 @@ export * from "./MouseTracker.js";
12
12
  export * from "./ViewportManager.js";
13
13
  export * from "./messenger/Messenger.js";
14
14
  export * from "./messenger/MessageOrigin.js";
15
- export * from "./types.js";
16
15
  export * from "./DocumentStoreManager.js";
17
16
  export * from "./BindingsProcessor.js";
18
17
  export * from "./ResizeObserver.js";
package/index.js.map CHANGED
@@ -1 +1 @@
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 * 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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa","ignoreList":[]}
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":[]}
package/jsonPatch.d.ts CHANGED
@@ -2,5 +2,5 @@ import type { Operation, Validator, PatchResult } from "fast-json-patch";
2
2
  export type { Operation as JsonPatchOperation, PatchResult as JsonPatchResult };
3
3
  export declare const jsonPatch: {
4
4
  compare: (tree1: object | any[], tree2: object | any[], invertible?: boolean) => Operation[];
5
- applyPatch: <T>(document: T, patch: Operation[], validateOperation?: boolean | Validator<T> | undefined, mutateDocument?: boolean, banPrototypeModifications?: boolean) => PatchResult<T>;
5
+ applyPatch: <T>(document: T, patch: Operation[], validateOperation?: boolean | Validator<T>, mutateDocument?: boolean, banPrototypeModifications?: boolean) => PatchResult<T>;
6
6
  };
@@ -1,6 +1,8 @@
1
- import micromatch from "micromatch";
1
+ import { isMatch } from "matcher";
2
2
  import { logger } from "../Logger.js";
3
- const ignored = ["preview.mouse.move", "preview.component.register", "preview.scroll", "preview.viewport", "preview.viewport.change.start", "preview.viewport.change.end"];
3
+ const ignored = ["preview.mouse.move", "preview.component.register", "preview.scroll",
4
+ // "preview.viewport",
5
+ "preview.viewport.change.start", "preview.viewport.change.end"];
4
6
  export class Messenger {
5
7
  listeners = new Map();
6
8
  constructor(source, target,
@@ -21,15 +23,15 @@ export class Messenger {
21
23
  if (!this.target.matches(event)) {
22
24
  return;
23
25
  }
24
- if (!type || !micromatch.isMatch(type, this.pattern)) {
26
+ if (!type || !isMatch(type, this.pattern)) {
25
27
  return;
26
28
  }
27
29
  const logicalType = this.stripPrefix(type);
28
30
  if (!this.isIgnored(logicalType)) {
29
- logger.debug(`${this.getTime()} --> [${this.source.origin}][${logicalType}]`, {
31
+ logger.debug({
30
32
  type,
31
33
  payload
32
- });
34
+ }, `${this.getTime()} --> [${this.source.origin}][${logicalType}]`);
33
35
  }
34
36
  const handlers = this.listeners.get(logicalType);
35
37
  if (handlers) {
@@ -57,10 +59,10 @@ export class Messenger {
57
59
  send(logicalType, payload) {
58
60
  const fullType = this.prefixGlob + logicalType;
59
61
  if (!this.isIgnored(logicalType)) {
60
- logger.debug(`${this.getTime()} <-- [${this.source.origin}][${logicalType}]`, {
62
+ logger.debug({
61
63
  type: fullType,
62
64
  payload
63
- });
65
+ }, `${this.getTime()} <-- [${this.source.origin}][${logicalType}]`);
64
66
  }
65
67
  this.target.window.postMessage({
66
68
  type: fullType,
@@ -1 +1 @@
1
- {"version":3,"names":["micromatch","logger","ignored","Messenger","listeners","Map","constructor","source","target","pattern","prefixGlob","replace","handleMessage","bind","window","addEventListener","event","type","payload","data","matches","isMatch","logicalType","stripPrefix","isIgnored","debug","getTime","origin","handlers","get","forEach","fn","fullType","startsWith","slice","length","includes","on","handler","has","set","Set","add","delete","send","postMessage","dispose","removeEventListener","clear","date","Date","getHours","getMinutes","getSeconds","getMilliseconds"],"sources":["Messenger.ts"],"sourcesContent":["import micromatch from \"micromatch\";\nimport type { MessageOrigin } from \"./MessageOrigin.js\";\nimport { logger } from \"../Logger.js\";\n\nexport type Message<T = any> = {\n type: string;\n payload: T;\n};\n\ntype Handler<T = any> = (payload: T, logicalType: string, wildcardMatch?: string) => void;\n\nconst ignored = [\n \"preview.mouse.move\",\n \"preview.component.register\",\n \"preview.scroll\",\n \"preview.viewport\",\n \"preview.viewport.change.start\",\n \"preview.viewport.change.end\"\n];\n\nexport class Messenger {\n private listeners = new Map<string, Set<Handler>>();\n private readonly pattern: string;\n private readonly prefixGlob: string;\n\n constructor(\n private source: MessageOrigin,\n private target: MessageOrigin,\n // Pattern to filter events this Messenger handles.\n pattern: string\n ) {\n this.pattern = pattern;\n this.prefixGlob = pattern.replace(/\\*+$/, \"\");\n this.handleMessage = this.handleMessage.bind(this);\n this.source.window.addEventListener(\"message\", this.handleMessage);\n }\n\n private handleMessage(event: MessageEvent) {\n const { type, payload } = event.data || {};\n if (!this.target.matches(event)) {\n return;\n }\n\n if (!type || !micromatch.isMatch(type, this.pattern)) {\n return;\n }\n\n const logicalType = this.stripPrefix(type);\n\n if (!this.isIgnored(logicalType)) {\n logger.debug(`${this.getTime()} --> [${this.source.origin}][${logicalType}]`, {\n type,\n payload\n });\n }\n\n const handlers = this.listeners.get(logicalType);\n if (handlers) {\n handlers.forEach(fn => fn(payload, logicalType));\n }\n }\n\n private stripPrefix(fullType: string): string {\n return fullType.startsWith(this.prefixGlob)\n ? fullType.slice(this.prefixGlob.length)\n : fullType;\n }\n\n private isIgnored(logicalType: string): boolean {\n return ignored.includes(logicalType);\n }\n\n on<T = any>(logicalType: string, handler: Handler<T>) {\n if (!this.listeners.has(logicalType)) {\n this.listeners.set(logicalType, new Set());\n }\n this.listeners.get(logicalType)!.add(handler);\n return () => {\n const listeners = this.listeners.get(logicalType);\n if (listeners) {\n listeners.delete(handler);\n }\n };\n }\n\n send<T = any>(logicalType: string, payload?: T) {\n const fullType = this.prefixGlob + logicalType;\n\n if (!this.isIgnored(logicalType)) {\n logger.debug(`${this.getTime()} <-- [${this.source.origin}][${logicalType}]`, {\n type: fullType,\n payload\n });\n }\n\n this.target.window.postMessage({ type: fullType, payload }, this.target.origin);\n }\n\n dispose() {\n this.source.window.removeEventListener(\"message\", this.handleMessage);\n this.listeners.clear();\n }\n\n getTime() {\n const date = new Date();\n return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}.${date.getMilliseconds()}`;\n }\n}\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,MAAM;AASf,MAAMC,OAAO,GAAG,CACZ,oBAAoB,EACpB,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,EAClB,+BAA+B,EAC/B,6BAA6B,CAChC;AAED,OAAO,MAAMC,SAAS,CAAC;EACXC,SAAS,GAAG,IAAIC,GAAG,CAAuB,CAAC;EAInDC,WAAWA,CACCC,MAAqB,EACrBC,MAAqB;EAC7B;EACAC,OAAe,EACjB;IAAA,KAJUF,MAAqB,GAArBA,MAAqB;IAAA,KACrBC,MAAqB,GAArBA,MAAqB;IAI7B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAAC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AAS,EAAE,IAAI,CAACnC,aAAa,CAAC;IACrE,IAAI,CAACR,SAAS,CAAC4C,KAAK,CAAC,CAAC;EAC1B;EAEAtB,OAAOA,CAAA,EAAG;IACN,MAAMuB,IAAI,GAAG,IAAIC,IAAI,CAAC,CAAC;IACvB,OAAO,GAAGD,IAAI,CAACE,QAAQ,CAAC,CAAC,IAAIF,IAAI,CAACG,UAAU,CAAC,CAAC,IAAIH,IAAI,CAACI,UAAU,CAAC,CAAC,IAAIJ,IAAI,CAACK,eAAe,CAAC,CAAC,EAAE;EACnG;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["isMatch","logger","ignored","Messenger","listeners","Map","constructor","source","target","pattern","prefixGlob","replace","handleMessage","bind","window","addEventListener","event","type","payload","data","matches","logicalType","stripPrefix","isIgnored","debug","getTime","origin","handlers","get","forEach","fn","fullType","startsWith","slice","length","includes","on","handler","has","set","Set","add","delete","send","postMessage","dispose","removeEventListener","clear","date","Date","getHours","getMinutes","getSeconds","getMilliseconds"],"sources":["Messenger.ts"],"sourcesContent":["import { isMatch } from \"matcher\";\nimport type { MessageOrigin } from \"./MessageOrigin.js\";\nimport { logger } from \"../Logger.js\";\n\nexport type Message<T = any> = {\n type: string;\n payload: T;\n};\n\ntype Handler<T = any> = (payload: T, logicalType: string, wildcardMatch?: string) => void;\n\nconst ignored = [\n \"preview.mouse.move\",\n \"preview.component.register\",\n \"preview.scroll\",\n // \"preview.viewport\",\n \"preview.viewport.change.start\",\n \"preview.viewport.change.end\"\n];\n\nexport class Messenger {\n private listeners = new Map<string, Set<Handler>>();\n private readonly pattern: string;\n private readonly prefixGlob: string;\n\n constructor(\n private source: MessageOrigin,\n private target: MessageOrigin,\n // Pattern to filter events this Messenger handles.\n pattern: string\n ) {\n this.pattern = pattern;\n this.prefixGlob = pattern.replace(/\\*+$/, \"\");\n this.handleMessage = this.handleMessage.bind(this);\n this.source.window.addEventListener(\"message\", this.handleMessage);\n }\n\n private handleMessage(event: MessageEvent) {\n const { type, payload } = event.data || {};\n if (!this.target.matches(event)) {\n return;\n }\n\n if (!type || !isMatch(type, this.pattern)) {\n return;\n }\n\n const logicalType = this.stripPrefix(type);\n\n if (!this.isIgnored(logicalType)) {\n logger.debug(\n {\n type,\n payload\n },\n `${this.getTime()} --> [${this.source.origin}][${logicalType}]`\n );\n }\n\n const handlers = this.listeners.get(logicalType);\n if (handlers) {\n handlers.forEach(fn => fn(payload, logicalType));\n }\n }\n\n private stripPrefix(fullType: string): string {\n return fullType.startsWith(this.prefixGlob)\n ? fullType.slice(this.prefixGlob.length)\n : fullType;\n }\n\n private isIgnored(logicalType: string): boolean {\n return ignored.includes(logicalType);\n }\n\n on<T = any>(logicalType: string, handler: Handler<T>) {\n if (!this.listeners.has(logicalType)) {\n this.listeners.set(logicalType, new Set());\n }\n this.listeners.get(logicalType)!.add(handler);\n return () => {\n const listeners = this.listeners.get(logicalType);\n if (listeners) {\n listeners.delete(handler);\n }\n };\n }\n\n send<T = any>(logicalType: string, payload?: T) {\n const fullType = this.prefixGlob + logicalType;\n\n if (!this.isIgnored(logicalType)) {\n logger.debug(\n {\n type: fullType,\n payload\n },\n `${this.getTime()} <-- [${this.source.origin}][${logicalType}]`\n );\n }\n\n this.target.window.postMessage({ type: fullType, payload }, this.target.origin);\n }\n\n dispose() {\n this.source.window.removeEventListener(\"message\", this.handleMessage);\n this.listeners.clear();\n }\n\n getTime() {\n const date = new Date();\n return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}.${date.getMilliseconds()}`;\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,SAAS;AAEjC,SAASC,MAAM;AASf,MAAMC,OAAO,GAAG,CACZ,oBAAoB,EACpB,4BAA4B,EAC5B,gBAAgB;AAChB;AACA,+BAA+B,EAC/B,6BAA6B,CAChC;AAED,OAAO,MAAMC,SAAS,CAAC;EACXC,SAAS,GAAG,IAAIC,GAAG,CAAuB,CAAC;EAInDC,WAAWA,CACCC,MAAqB,EACrBC,MAAqB;EA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CAACV,MAAM,CAACkB,MAAM,CAAC;EACnF;EAEAmB,OAAOA,CAAA,EAAG;IACN,IAAI,CAACtC,MAAM,CAACO,MAAM,CAACgC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAClC,aAAa,CAAC;IACrE,IAAI,CAACR,SAAS,CAAC2C,KAAK,CAAC,CAAC;EAC1B;EAEAtB,OAAOA,CAAA,EAAG;IACN,MAAMuB,IAAI,GAAG,IAAIC,IAAI,CAAC,CAAC;IACvB,OAAO,GAAGD,IAAI,CAACE,QAAQ,CAAC,CAAC,IAAIF,IAAI,CAACG,UAAU,CAAC,CAAC,IAAIH,IAAI,CAACI,UAAU,CAAC,CAAC,IAAIJ,IAAI,CAACK,eAAe,CAAC,CAAC,EAAE;EACnG;AACJ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@webiny/website-builder-sdk",
3
- "version": "0.0.0-unstable.a4637c5ce6",
3
+ "version": "0.0.0-unstable.df7a8bb475",
4
+ "type": "module",
4
5
  "main": "index.js",
5
6
  "repository": {
6
7
  "type": "git",
@@ -12,37 +13,31 @@
12
13
  "author": "Pavel Denisjuk",
13
14
  "license": "MIT",
14
15
  "dependencies": {
15
- "csstype": "3.1.1",
16
+ "csstype": "3.2.3",
16
17
  "deep-equal": "2.2.3",
17
18
  "deepmerge": "4.3.1",
18
19
  "fast-json-patch": "3.1.1",
19
20
  "fast-json-stable-stringify": "2.1.0",
20
21
  "is-hotkey": "0.2.0",
21
- "lexical": "0.23.1",
22
- "lodash": "4.17.21",
23
- "micromatch": "4.0.8",
24
- "mobx": "6.9.0",
25
- "nanoid": "3.3.8",
26
- "nanoid-dictionary": "4.3.0",
27
- "pino": "8.21.0",
28
- "pino-pretty": "9.4.0"
22
+ "lodash": "4.17.23",
23
+ "matcher": "5.0.0",
24
+ "mobx": "6.15.0",
25
+ "nanoid": "5.1.6",
26
+ "nanoid-dictionary": "5.0.0",
27
+ "pino": "9.14.0",
28
+ "pino-pretty": "9.4.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/deep-equal": "1.0.4",
32
32
  "@types/is-hotkey": "0.1.10",
33
- "@types/micromatch": "4.0.9",
34
- "@webiny/cli": "0.0.0-unstable.a4637c5ce6",
35
- "@webiny/project-utils": "0.0.0-unstable.a4637c5ce6",
36
- "typescript": "5.3.3"
33
+ "@webiny/build-tools": "0.0.0-unstable.df7a8bb475",
34
+ "typescript": "5.9.3",
35
+ "vitest": "3.2.4"
37
36
  },
38
37
  "publishConfig": {
39
38
  "access": "public",
40
39
  "directory": "dist"
41
40
  },
42
- "scripts": {
43
- "build": "yarn webiny run build",
44
- "watch": "yarn webiny run watch"
45
- },
46
41
  "adio": {
47
42
  "ignore": {
48
43
  "dependencies": [
@@ -50,5 +45,5 @@
50
45
  ]
51
46
  }
52
47
  },
53
- "gitHead": "a4637c5ce60a72a1cb15dfa96576cb931e4cc911"
48
+ "gitHead": "df7a8bb4755a1da047f0af8c56bdb649cc81bf7d"
54
49
  }
@@ -1,4 +1,3 @@
1
- import type { LexicalEditorTheme } from "./LexicalEditorTheme.js";
2
1
  export type Breakpoint = {
3
2
  name: string;
4
3
  title: string;
@@ -9,14 +8,10 @@ export type Breakpoint = {
9
8
  };
10
9
  export type WebsiteBuilderTheme = {
11
10
  css?: string;
12
- cssVariables?: Record<string, string>;
13
11
  fonts?: string[];
14
12
  breakpoints: Breakpoint[];
15
- styles: {
16
- colors: Record<string, any>;
17
- typography: Typography;
18
- };
19
- lexical: LexicalEditorTheme;
13
+ colors: ColorStyle[];
14
+ typography: Typography;
20
15
  };
21
16
  type KnownKeys = "desktop" | "tablet" | "mobile";
22
17
  type BreakpointBase = Omit<Breakpoint, "name">;
@@ -26,23 +21,23 @@ type Breakpoints = KnownBreakpoints & {
26
21
  [K in string as K extends KnownKeys ? never : K]: BreakpointBase;
27
22
  };
28
23
  };
29
- export type TypographyType = "headings" | "paragraphs" | "quotes" | "lists" | (string & {});
24
+ export type ColorStyle = {
25
+ id: string;
26
+ label: string;
27
+ value: string;
28
+ };
30
29
  export type TypographyStyle = {
31
30
  id: string;
32
- name: string;
31
+ label: string;
33
32
  tag: string;
34
33
  className: string;
35
34
  };
36
- export type Typography = Partial<Record<TypographyType, TypographyStyle[]>>;
35
+ export type Typography = Record<string, TypographyStyle[]>;
37
36
  export type WebsiteBuilderThemeInput = {
38
37
  /**
39
38
  * CSS to include in the editor.
40
39
  */
41
40
  css?: string;
42
- /**
43
- * CSS variables to define in the editor.
44
- */
45
- cssVariables?: Record<string, string>;
46
41
  /**
47
42
  * Fonts to load when the editor loads.
48
43
  */
@@ -57,36 +52,38 @@ export type WebsiteBuilderThemeInput = {
57
52
  * }
58
53
  */
59
54
  breakpoints?: Breakpoints;
60
- lexical?: LexicalEditorTheme;
61
- styles?: {
62
- /**
63
- * color1: "#fa5723",
64
- * color2: "#00ccb0",
65
- */
66
- colors?: Record<string, any>;
67
- /**
68
- * headings: [
69
- * {
70
- * id: "heading1",
71
- * name: "Heading 1",
72
- * tag: "h1"
73
- * },
74
- * ],
75
- * paragraphs: [
76
- * {
77
- * id: "paragraph1",
78
- * name: "Paragraph 1",
79
- * tag: "p",
80
- * ],
81
- * quotes: [
82
- * {
83
- * id: "quote",
84
- * name: "Quote",
85
- * tag: "blockquote"
86
- * }
87
- * ]
88
- */
89
- typography?: Typography;
90
- };
55
+ /**
56
+ * [
57
+ * {
58
+ * id: "primary",
59
+ * label: "Primary",
60
+ * value: "#000000"
61
+ * },
62
+ * ]
63
+ */
64
+ colors?: ColorStyle[];
65
+ /**
66
+ * headings: [
67
+ * {
68
+ * id: "heading1",
69
+ * name: "Heading 1",
70
+ * tag: "h1"
71
+ * },
72
+ * ],
73
+ * paragraphs: [
74
+ * {
75
+ * id: "paragraph1",
76
+ * name: "Paragraph 1",
77
+ * tag: "p",
78
+ * ],
79
+ * quotes: [
80
+ * {
81
+ * id: "quote",
82
+ * name: "Quote",
83
+ * tag: "blockquote"
84
+ * }
85
+ * ]
86
+ */
87
+ typography?: Typography;
91
88
  };
92
89
  export {};
@@ -1 +1 @@
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":[]}
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":[]}