@webiny/app-admin 6.4.0-beta.2 → 6.4.0-beta.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 (83) hide show
  1. package/base/Base/DefaultFieldRenderers.js +4 -0
  2. package/base/Base/DefaultFieldRenderers.js.map +1 -1
  3. package/base/Base/FieldRenderers/LexicalRenderer.d.ts +12 -0
  4. package/base/Base/FieldRenderers/LexicalRenderer.js +48 -0
  5. package/base/Base/FieldRenderers/LexicalRenderer.js.map +1 -0
  6. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +1 -1
  7. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
  8. package/base/Base.js +2 -1
  9. package/base/Base.js.map +1 -1
  10. package/base/providers/UiProviders.js +6 -2
  11. package/base/providers/UiProviders.js.map +1 -1
  12. package/base/ui/FileManager.d.ts +15 -14
  13. package/base/ui/FileManager.js +5 -2
  14. package/base/ui/FileManager.js.map +1 -1
  15. package/components/LexicalEditor/DefaultLexicalEditorConfig.d.ts +2 -0
  16. package/components/LexicalEditor/DefaultLexicalEditorConfig.js +81 -0
  17. package/components/LexicalEditor/DefaultLexicalEditorConfig.js.map +1 -0
  18. package/components/LexicalEditor/TypographyDropDown.d.ts +8 -0
  19. package/components/LexicalEditor/TypographyDropDown.js +60 -0
  20. package/components/LexicalEditor/TypographyDropDown.js.map +1 -0
  21. package/config/AdminConfig/Menu/MenuItem.d.ts +1 -0
  22. package/config/AdminConfig/Menu/MenuItem.js +2 -1
  23. package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
  24. package/config/AdminConfig/Menu/MenuLink.d.ts +1 -0
  25. package/config/AdminConfig/Menu/MenuLink.js +2 -1
  26. package/config/AdminConfig/Menu/MenuLink.js.map +1 -1
  27. package/config/AdminConfig/Menu.d.ts +2 -0
  28. package/config/AdminConfig.d.ts +2 -0
  29. package/config/AdminConfig.js +1 -0
  30. package/config/AdminConfig.js.map +1 -1
  31. package/exports/admin/ui/file-manager.d.ts +3 -0
  32. package/exports/admin/ui/file-manager.js +2 -0
  33. package/exports/admin/ui/lexical.d.ts +1 -0
  34. package/exports/admin/ui/lexical.js +1 -0
  35. package/exports/admin/ui.d.ts +0 -1
  36. package/exports/admin/ui.js +0 -1
  37. package/features/fileUrlFormatter/abstractions.d.ts +6 -0
  38. package/features/fileUrlFormatter/abstractions.js +5 -0
  39. package/features/fileUrlFormatter/abstractions.js.map +1 -0
  40. package/features/formModel/FormModel.js +2 -2
  41. package/features/formModel/FormModel.js.map +1 -1
  42. package/features/formModel/FormModel.test.js +3 -1
  43. package/features/formModel/FormModel.test.js.map +1 -1
  44. package/features/formModel/demo/FieldRenderersDemoPresenter.js +6 -1
  45. package/features/formModel/demo/FieldRenderersDemoPresenter.js.map +1 -1
  46. package/features/formModel/feature.js +2 -1
  47. package/features/formModel/feature.js.map +1 -1
  48. package/features/formModel/fieldTypes/LexicalFieldType.d.ts +19 -0
  49. package/features/formModel/fieldTypes/LexicalFieldType.js +23 -0
  50. package/features/formModel/fieldTypes/LexicalFieldType.js.map +1 -0
  51. package/features/formModel/fieldTypes/index.d.ts +1 -0
  52. package/features/formModel/fieldTypes/index.js +1 -0
  53. package/features/formModel/renderers.d.ts +1 -0
  54. package/features/formModel/renderers.js +1 -0
  55. package/features/newsletter/NewsletterSubscriptionService.d.ts +13 -0
  56. package/features/newsletter/NewsletterSubscriptionService.js +36 -0
  57. package/features/newsletter/NewsletterSubscriptionService.js.map +1 -0
  58. package/features/newsletter/abstractions.d.ts +11 -0
  59. package/features/newsletter/abstractions.js +5 -0
  60. package/features/newsletter/abstractions.js.map +1 -0
  61. package/features/newsletter/index.d.ts +1 -0
  62. package/features/newsletter/index.js +1 -0
  63. package/index.d.ts +2 -1
  64. package/index.js +2 -1
  65. package/package.json +31 -27
  66. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleRestartInstallation.d.ts +1 -0
  67. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleRestartInstallation.js +6 -0
  68. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleRestartInstallation.js.map +1 -0
  69. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.d.ts +2 -0
  70. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js +27 -0
  71. package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js.map +1 -0
  72. package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +4 -4
  73. package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
  74. package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.d.ts +3 -1
  75. package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +9 -3
  76. package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
  77. package/presentation/installation/presenters/SystemInstaller/feature.js +2 -0
  78. package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -1
  79. package/presentation/listPresenter/ListPresenter.d.ts +1 -0
  80. package/presentation/listPresenter/ListPresenter.js +8 -2
  81. package/presentation/listPresenter/ListPresenter.js.map +1 -1
  82. package/presentation/listPresenter/feature.js +1 -1
  83. package/presentation/listPresenter/feature.js.map +1 -1
@@ -187,7 +187,8 @@ class FieldRenderersDemoPresenter {
187
187
  }));
188
188
  }),
189
189
  fileImage: fields.file().label("Image (full metadata)").description("Stores the full file object (id, name, size, src, etc.)"),
190
- fileUrl: fields.fileUrl().label("Image URL").description("Stores only the file URL as a string")
190
+ fileUrl: fields.fileUrl().label("Image URL").description("Stores only the file URL as a string"),
191
+ richText: fields.lexical().label("Rich Text").description("Lexical rich text editor")
191
192
  }),
192
193
  layout: (layout)=>[
193
194
  layout.tabs("mainTabs").tab("text", (tab)=>{
@@ -258,6 +259,10 @@ class FieldRenderersDemoPresenter {
258
259
  tab.label("Files").layout((l)=>[
259
260
  l.row("fileImage", "fileUrl")
260
261
  ]);
262
+ }).tab("lexical", (tab)=>{
263
+ tab.label("Lexical").layout((l)=>[
264
+ l.row("richText")
265
+ ]);
261
266
  })
262
267
  ]
263
268
  });
@@ -1 +1 @@
1
- {"version":3,"file":"features/formModel/demo/FieldRenderersDemoPresenter.js","sources":["../../../../src/features/formModel/demo/FieldRenderersDemoPresenter.ts"],"sourcesContent":["import { makeAutoObservable, toJS } from \"mobx\";\nimport type { IFormModel, IFormModelFactory, IFormVM, IFormError } from \"../abstractions.js\";\n\nexport interface FieldRenderersDemoVM {\n form: IFormVM;\n data: Record<string, unknown>;\n lastSubmitted: Record<string, unknown> | null;\n isSubmitting: boolean;\n formErrors: IFormError[];\n}\n\nexport class FieldRenderersDemoPresenter {\n private form: IFormModel;\n private lastSubmitted: Record<string, unknown> | null = null;\n private isSubmitting = false;\n\n constructor(formFactory: IFormModelFactory) {\n this.form = formFactory.create({\n fields: fields => ({\n // --- Text ---\n textInput: fields\n .text()\n .label(\"Text Input\")\n .placeholder(\"Type here...\")\n .required(\"Text input is required\")\n .description(\"Standard text input\")\n .help(\"Enter any text value\")\n .note(\"Max 255 characters\"),\n textInputs: fields\n .text()\n .list()\n .label(\"Text Inputs\")\n .renderer(\"textInputs\", { addItemLabel: \"Add text\" })\n .description(\"Add multiple text values\")\n .help(\"Each value is stored separately\")\n .note(\"Press Enter to add quickly\"),\n tags: fields\n .text()\n .list()\n .label(\"Tags\")\n .renderer(\"tags\")\n .placeholder(\"Add values\")\n .defaultValue([])\n .description(\"Comma-separated tags\")\n .help(\"Type and press Enter to add a tag\")\n .note(\"Duplicates are ignored\"),\n textarea: fields\n .text()\n .label(\"Textarea\")\n .renderer(\"textarea\", { rows: 4 })\n .description(\"Multi-line text area\")\n .help(\"Supports plain text only\")\n .note(\"Resizable vertically\"),\n textareas: fields\n .text()\n .list()\n .label(\"Descriptions\")\n .renderer(\"textareas\", { addItemLabel: \"Add description\" })\n .description(\"Multiple long text values\")\n .help(\"Each textarea is independent\")\n .note(\"Click add to append a new block\"),\n\n // --- Number ---\n numberInput: fields\n .number()\n .label(\"Number\")\n .placeholder(\"0\")\n .required(\"Number is required\")\n .description(\"Single numeric value\")\n .help(\"Accepts integers and decimals\")\n .note(\"Use dot as decimal separator\"),\n numberInputs: fields\n .number()\n .list()\n .label(\"Number Inputs\")\n .renderer(\"numberInputs\", { addItemLabel: \"Add number\" })\n .description(\"Multiple numeric values\")\n .help(\"Each input accepts a number\")\n .note(\"Empty values are stored as empty strings\"),\n numberOptions: fields\n .number()\n .list()\n .label(\"Number Options\")\n .options([\n { label: \"Tier 1\", value: 100 },\n { label: \"Tier 2\", value: 200 }\n ])\n .description(\"Multiple numeric values\")\n .help(\"Each input accepts a number\")\n .note(\"Empty values are stored as empty strings\"),\n\n // --- Boolean ---\n boolSwitch: fields\n .boolean()\n .label(\"Boolean Switch\")\n .description(\"Toggle on/off\")\n .help(\"Click to toggle state\")\n .note(\"Default is unchecked\"),\n\n // --- Predefined Values ---\n dropdown: fields\n .text()\n .label(\"Dropdown\")\n .placeholder(\"Pick one\")\n .required(\"Dropdown selection is required\")\n .description(\"Single-select dropdown\")\n .help(\"Choose exactly one option\")\n .note(\"Required for form submission\")\n .options([\n { label: \"Option A\", value: \"a\" },\n { label: \"Option B\", value: \"b\" },\n { label: \"Option C\", value: \"c\" }\n ]),\n radioButtons: fields\n .text()\n .label(\"Radio Buttons\")\n .options([\n { label: \"Small\", value: \"sm\" },\n { label: \"Medium\", value: \"md\" },\n { label: \"Large\", value: \"lg\" }\n ])\n .renderer(\"radioButtons\")\n .description(\"Pick a size variant\")\n .help(\"Only one option can be selected\")\n .note(\"Selection is mutually exclusive\"),\n checkboxes: fields\n .text()\n .list()\n .label(\"Checkboxes\")\n .options([\n { label: \"Read\", value: \"read\" },\n { label: \"Write\", value: \"write\" },\n { label: \"Admin\", value: \"admin\" }\n ])\n .renderer(\"checkboxes\")\n .description(\"Multi-select permissions\")\n .help(\"Check all that apply\")\n .note(\"At least one is recommended\"),\n\n // --- Date/Time ---\n dateOnly: fields\n .datetime()\n .required()\n .dateOnly()\n .label(\"Date Only\")\n .description(\"Pick a calendar date\")\n .note(\"Value: YYYY-MM-DD\"),\n timeOnly: fields\n .datetime()\n .required()\n .timeOnly()\n .label(\"Time Only\")\n .description(\"Time without a date\")\n .note(\"24-hour format\"),\n dateTime: fields\n .datetime()\n .required()\n .withoutTimezone()\n .label(\"Date & Time\")\n .description(\"Date with time of day\")\n .note(\"Seconds default to :00\"),\n dateTimeTz: fields\n .datetime()\n .required()\n .withTimezone()\n .label(\"Date Time + Timezone\")\n .description(\"Full date, time, and timezone\")\n .note(\"Timezone defaults to your local zone\"),\n monthOnly: fields\n .datetime()\n .required()\n .monthOnly()\n .label(\"Month\")\n .description(\"Pick a month and year\")\n .note(\"Value: YYYY-MM\"),\n weekOnly: fields\n .datetime()\n .required()\n .weekOnly({ startsOn: 1 })\n .label(\"Week\")\n .description(\"Pick an ISO week\")\n .note(\"Value: YYYY-Www\"),\n yearOnly: fields\n .datetime()\n .required()\n .yearOnly({ range: [2020, 2035] })\n .label(\"Year\")\n .description(\"Pick a year\")\n .note(\"Value: number\"),\n dateRange: fields\n .datetime()\n .required()\n .dateRange()\n .label(\"Date Range\")\n .description(\"Pick a start and end date\")\n .note(\"Value: { from, to }\"),\n multipleDates: fields\n .datetime()\n .required()\n .multipleDates()\n .label(\"Multiple Dates\")\n .description(\"Select multiple dates\")\n .note(\"Value: string[]\"),\n multipleMonths: fields\n .datetime()\n .required()\n .multipleMonths()\n .label(\"Multiple Months\")\n .description(\"Select multiple months\")\n .note(\"Value: string[]\"),\n multipleYears: fields\n .datetime()\n .required()\n .multipleYears({ range: [2020, 2035] })\n .label(\"Multiple Years\")\n .description(\"Select multiple years\")\n .note(\"Value: number[]\"),\n dateTimeList: fields\n .datetime()\n .required()\n .withTimezone()\n .list()\n .label(\"Dates with TZ (multi)\")\n .description(\"Multiple date entries\")\n .note(\"Each date is independent\"),\n\n // --- Hidden ---\n hiddenField: fields\n .text()\n .hidden()\n .defaultValue(\"secret-value\")\n .description(\"Not visible in the UI\")\n .help(\"Carried in form data silently\")\n .note(\"Value is preset\"),\n\n // --- Key-Value Tags ---\n metaTags: fields\n .object()\n .list()\n .label(\"Meta Tags\")\n .description(\"Add SEO tags\")\n .renderer(\"keyValueTags\", { addItemLabel: \"Add tag\" })\n .fields(f => ({\n name: f.text().placeholder(\"Name\"),\n content: f.text().placeholder(\"Content\")\n })),\n\n // --- Conditional Visibility / Disabled ---\n enableFeature: fields\n .boolean()\n .label(\"Enable Feature\")\n .description(\"Toggle this to show or hide the feature fields below\"),\n featureName: fields\n .text()\n .label(\"Feature Name\")\n .placeholder(\"Name your feature...\")\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n }\n ]),\n featureMode: fields\n .text()\n .label(\"Feature Mode\")\n .options([\n { label: \"Simple\", value: \"simple\" },\n { label: \"Advanced\", value: \"advanced\" }\n ])\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n }\n ]),\n advancedConfig: fields\n .text()\n .label(\"Advanced Config\")\n .placeholder(\"JSON config...\")\n .renderer(\"textarea\", { rows: 3 })\n .description(\"Only editable in advanced mode\")\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n },\n {\n type: \"condition\",\n target: \"featureMode\",\n operator: \"neq\",\n value: \"advanced\",\n action: \"disable\"\n }\n ]),\n\n // --- Dynamic Zone (single template) ---\n contentBlock: fields\n .object()\n .label(\"Content Block\")\n .template(\"hero\", t => {\n t.label(\"Hero Banner\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n heading: f.text().label(\"Heading\").required(\"Required\"),\n image: f.text().label(\"Image URL\")\n }));\n })\n .template(\"text\", t => {\n t.label(\"Rich Text\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n body: f.text().label(\"Body\").renderer(\"textarea\")\n }));\n }),\n\n // --- Dynamic Zone (multi-value template list) ---\n sections: fields\n .object()\n .list()\n .label(\"Page Sections\")\n .renderer(\"dynamicZone\", { container: false })\n .template(\"hero\", t => {\n t.label(\"Hero Banner\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n heading: f.text().label(\"Heading\"),\n subheading: f.text().label(\"Subheading\"),\n uuid: f\n .text()\n .label(\"UUID\")\n .defaultValue(() => Date.now())\n .cloneValue(value => `${value}/${Date.now()}`)\n }));\n })\n .template(\"cta\", t => {\n t.label(\"Call To Action\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n label: f.text().label(\"Button Label\"),\n url: f.text().label(\"URL\")\n }));\n }),\n\n // --- Files ---\n fileImage: fields\n .file()\n .label(\"Image (full metadata)\")\n .description(\"Stores the full file object (id, name, size, src, etc.)\"),\n fileUrl: fields\n .fileUrl()\n .label(\"Image URL\")\n .description(\"Stores only the file URL as a string\")\n }),\n layout: layout => [\n layout\n .tabs(\"mainTabs\")\n .tab(\"text\", tab => {\n tab.label(\"Text\").layout(l => [\n l.row(\"textInput\"),\n l.row(\"textInputs\"),\n l.row(\"tags\"),\n l.row(\"textarea\"),\n l.row(\"textareas\"),\n l.row(\"metaTags\")\n ]);\n })\n .tab(\"numbers\", tab => {\n tab.label(\"Numbers & Boolean\").layout(l => [\n l.row(\"numberInput\"),\n l.row(\"numberInputs\"),\n l.row(\"numberOptions\"),\n l.separator(),\n l.row(\"boolSwitch\")\n ]);\n })\n .tab(\"selects\", tab => {\n tab.label(\"Selects\").layout(l => [\n l.row(\"dropdown\", \"radioButtons\"),\n l.row(\"checkboxes\")\n ]);\n })\n .tab(\"datetime\", tab => {\n tab.label(\"Date / Time\").layout(l => [\n l.row(\"dateOnly\", \"timeOnly\"),\n l.row(\"dateTime\"),\n l.row(\"dateTimeTz\"),\n l.separator(),\n l.row(\"monthOnly\", \"weekOnly\"),\n l.row(\"yearOnly\"),\n l.separator(),\n l.row(\"dateRange\"),\n l.row(\"multipleDates\"),\n l.row(\"multipleMonths\", \"multipleYears\"),\n l.separator(),\n l.row(\"dateTimeList\")\n ]);\n })\n .tab(\"rules\", tab => {\n tab.label(\"Rules\").layout(l => [\n l.row(\"enableFeature\"),\n l.row(\"featureName\", \"featureMode\"),\n l.row(\"advancedConfig\")\n ]);\n })\n .tab(\"dynamic\", tab => {\n tab.label(\"Dynamic Zones\").layout(l => [\n l.object(\"contentBlock\", {\n hero: inner => [inner.row(\"heading\"), inner.row(\"image\")],\n text: inner => [inner.row(\"body\")]\n }),\n l.object(\"sections\", {\n hero: inner => [\n inner.row(\"heading\", \"subheading\"),\n inner.row(\"uuid\")\n ],\n cta: inner => [inner.row(\"label\", \"url\")]\n })\n ]);\n })\n .tab(\"files\", tab => {\n tab.label(\"Files\").layout(l => [l.row(\"fileImage\", \"fileUrl\")]);\n })\n ]\n });\n\n makeAutoObservable(this);\n }\n\n get vm(): FieldRenderersDemoVM {\n return {\n form: this.form.vm,\n data: toJS(this.form.getData()),\n lastSubmitted: this.lastSubmitted,\n isSubmitting: this.isSubmitting,\n formErrors: this.form.errors\n };\n }\n\n focusField(path: string): void {\n this.form.focusField(path);\n }\n\n async submit(): Promise<void> {\n this.isSubmitting = true;\n try {\n const result = await this.form.submit<Record<string, unknown>>();\n if (result !== false) {\n this.lastSubmitted = toJS(result);\n }\n } finally {\n this.isSubmitting = false;\n }\n }\n\n reset(): void {\n this.form.reset();\n this.lastSubmitted = null;\n }\n}\n"],"names":["FieldRenderersDemoPresenter","formFactory","fields","f","t","Date","value","layout","tab","l","inner","makeAutoObservable","toJS","path","result"],"mappings":";AAWO,MAAMA;IAKT,YAAYC,WAA8B,CAAE;aAHpC,aAAa,GAAmC;aAChD,YAAY,GAAG;QAGnB,IAAI,CAAC,IAAI,GAAGA,YAAY,MAAM,CAAC;YAC3B,QAAQC,CAAAA,SAAW;oBAEf,WAAWA,OACN,IAA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,"file":"features/formModel/demo/FieldRenderersDemoPresenter.js","sources":["../../../../src/features/formModel/demo/FieldRenderersDemoPresenter.ts"],"sourcesContent":["import { makeAutoObservable, toJS } from \"mobx\";\nimport type { IFormModel, IFormModelFactory, IFormVM, IFormError } from \"../abstractions.js\";\n\nexport interface FieldRenderersDemoVM {\n form: IFormVM;\n data: Record<string, unknown>;\n lastSubmitted: Record<string, unknown> | null;\n isSubmitting: boolean;\n formErrors: IFormError[];\n}\n\nexport class FieldRenderersDemoPresenter {\n private form: IFormModel;\n private lastSubmitted: Record<string, unknown> | null = null;\n private isSubmitting = false;\n\n constructor(formFactory: IFormModelFactory) {\n this.form = formFactory.create({\n fields: fields => ({\n // --- Text ---\n textInput: fields\n .text()\n .label(\"Text Input\")\n .placeholder(\"Type here...\")\n .required(\"Text input is required\")\n .description(\"Standard text input\")\n .help(\"Enter any text value\")\n .note(\"Max 255 characters\"),\n textInputs: fields\n .text()\n .list()\n .label(\"Text Inputs\")\n .renderer(\"textInputs\", { addItemLabel: \"Add text\" })\n .description(\"Add multiple text values\")\n .help(\"Each value is stored separately\")\n .note(\"Press Enter to add quickly\"),\n tags: fields\n .text()\n .list()\n .label(\"Tags\")\n .renderer(\"tags\")\n .placeholder(\"Add values\")\n .defaultValue([])\n .description(\"Comma-separated tags\")\n .help(\"Type and press Enter to add a tag\")\n .note(\"Duplicates are ignored\"),\n textarea: fields\n .text()\n .label(\"Textarea\")\n .renderer(\"textarea\", { rows: 4 })\n .description(\"Multi-line text area\")\n .help(\"Supports plain text only\")\n .note(\"Resizable vertically\"),\n textareas: fields\n .text()\n .list()\n .label(\"Descriptions\")\n .renderer(\"textareas\", { addItemLabel: \"Add description\" })\n .description(\"Multiple long text values\")\n .help(\"Each textarea is independent\")\n .note(\"Click add to append a new block\"),\n\n // --- Number ---\n numberInput: fields\n .number()\n .label(\"Number\")\n .placeholder(\"0\")\n .required(\"Number is required\")\n .description(\"Single numeric value\")\n .help(\"Accepts integers and decimals\")\n .note(\"Use dot as decimal separator\"),\n numberInputs: fields\n .number()\n .list()\n .label(\"Number Inputs\")\n .renderer(\"numberInputs\", { addItemLabel: \"Add number\" })\n .description(\"Multiple numeric values\")\n .help(\"Each input accepts a number\")\n .note(\"Empty values are stored as empty strings\"),\n numberOptions: fields\n .number()\n .list()\n .label(\"Number Options\")\n .options([\n { label: \"Tier 1\", value: 100 },\n { label: \"Tier 2\", value: 200 }\n ])\n .description(\"Multiple numeric values\")\n .help(\"Each input accepts a number\")\n .note(\"Empty values are stored as empty strings\"),\n\n // --- Boolean ---\n boolSwitch: fields\n .boolean()\n .label(\"Boolean Switch\")\n .description(\"Toggle on/off\")\n .help(\"Click to toggle state\")\n .note(\"Default is unchecked\"),\n\n // --- Predefined Values ---\n dropdown: fields\n .text()\n .label(\"Dropdown\")\n .placeholder(\"Pick one\")\n .required(\"Dropdown selection is required\")\n .description(\"Single-select dropdown\")\n .help(\"Choose exactly one option\")\n .note(\"Required for form submission\")\n .options([\n { label: \"Option A\", value: \"a\" },\n { label: \"Option B\", value: \"b\" },\n { label: \"Option C\", value: \"c\" }\n ]),\n radioButtons: fields\n .text()\n .label(\"Radio Buttons\")\n .options([\n { label: \"Small\", value: \"sm\" },\n { label: \"Medium\", value: \"md\" },\n { label: \"Large\", value: \"lg\" }\n ])\n .renderer(\"radioButtons\")\n .description(\"Pick a size variant\")\n .help(\"Only one option can be selected\")\n .note(\"Selection is mutually exclusive\"),\n checkboxes: fields\n .text()\n .list()\n .label(\"Checkboxes\")\n .options([\n { label: \"Read\", value: \"read\" },\n { label: \"Write\", value: \"write\" },\n { label: \"Admin\", value: \"admin\" }\n ])\n .renderer(\"checkboxes\")\n .description(\"Multi-select permissions\")\n .help(\"Check all that apply\")\n .note(\"At least one is recommended\"),\n\n // --- Date/Time ---\n dateOnly: fields\n .datetime()\n .required()\n .dateOnly()\n .label(\"Date Only\")\n .description(\"Pick a calendar date\")\n .note(\"Value: YYYY-MM-DD\"),\n timeOnly: fields\n .datetime()\n .required()\n .timeOnly()\n .label(\"Time Only\")\n .description(\"Time without a date\")\n .note(\"24-hour format\"),\n dateTime: fields\n .datetime()\n .required()\n .withoutTimezone()\n .label(\"Date & Time\")\n .description(\"Date with time of day\")\n .note(\"Seconds default to :00\"),\n dateTimeTz: fields\n .datetime()\n .required()\n .withTimezone()\n .label(\"Date Time + Timezone\")\n .description(\"Full date, time, and timezone\")\n .note(\"Timezone defaults to your local zone\"),\n monthOnly: fields\n .datetime()\n .required()\n .monthOnly()\n .label(\"Month\")\n .description(\"Pick a month and year\")\n .note(\"Value: YYYY-MM\"),\n weekOnly: fields\n .datetime()\n .required()\n .weekOnly({ startsOn: 1 })\n .label(\"Week\")\n .description(\"Pick an ISO week\")\n .note(\"Value: YYYY-Www\"),\n yearOnly: fields\n .datetime()\n .required()\n .yearOnly({ range: [2020, 2035] })\n .label(\"Year\")\n .description(\"Pick a year\")\n .note(\"Value: number\"),\n dateRange: fields\n .datetime()\n .required()\n .dateRange()\n .label(\"Date Range\")\n .description(\"Pick a start and end date\")\n .note(\"Value: { from, to }\"),\n multipleDates: fields\n .datetime()\n .required()\n .multipleDates()\n .label(\"Multiple Dates\")\n .description(\"Select multiple dates\")\n .note(\"Value: string[]\"),\n multipleMonths: fields\n .datetime()\n .required()\n .multipleMonths()\n .label(\"Multiple Months\")\n .description(\"Select multiple months\")\n .note(\"Value: string[]\"),\n multipleYears: fields\n .datetime()\n .required()\n .multipleYears({ range: [2020, 2035] })\n .label(\"Multiple Years\")\n .description(\"Select multiple years\")\n .note(\"Value: number[]\"),\n dateTimeList: fields\n .datetime()\n .required()\n .withTimezone()\n .list()\n .label(\"Dates with TZ (multi)\")\n .description(\"Multiple date entries\")\n .note(\"Each date is independent\"),\n\n // --- Hidden ---\n hiddenField: fields\n .text()\n .hidden()\n .defaultValue(\"secret-value\")\n .description(\"Not visible in the UI\")\n .help(\"Carried in form data silently\")\n .note(\"Value is preset\"),\n\n // --- Key-Value Tags ---\n metaTags: fields\n .object()\n .list()\n .label(\"Meta Tags\")\n .description(\"Add SEO tags\")\n .renderer(\"keyValueTags\", { addItemLabel: \"Add tag\" })\n .fields(f => ({\n name: f.text().placeholder(\"Name\"),\n content: f.text().placeholder(\"Content\")\n })),\n\n // --- Conditional Visibility / Disabled ---\n enableFeature: fields\n .boolean()\n .label(\"Enable Feature\")\n .description(\"Toggle this to show or hide the feature fields below\"),\n featureName: fields\n .text()\n .label(\"Feature Name\")\n .placeholder(\"Name your feature...\")\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n }\n ]),\n featureMode: fields\n .text()\n .label(\"Feature Mode\")\n .options([\n { label: \"Simple\", value: \"simple\" },\n { label: \"Advanced\", value: \"advanced\" }\n ])\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n }\n ]),\n advancedConfig: fields\n .text()\n .label(\"Advanced Config\")\n .placeholder(\"JSON config...\")\n .renderer(\"textarea\", { rows: 3 })\n .description(\"Only editable in advanced mode\")\n .rules([\n {\n type: \"condition\",\n target: \"enableFeature\",\n operator: \"isFalsy\",\n value: null,\n action: \"hide\"\n },\n {\n type: \"condition\",\n target: \"featureMode\",\n operator: \"neq\",\n value: \"advanced\",\n action: \"disable\"\n }\n ]),\n\n // --- Dynamic Zone (single template) ---\n contentBlock: fields\n .object()\n .label(\"Content Block\")\n .template(\"hero\", t => {\n t.label(\"Hero Banner\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n heading: f.text().label(\"Heading\").required(\"Required\"),\n image: f.text().label(\"Image URL\")\n }));\n })\n .template(\"text\", t => {\n t.label(\"Rich Text\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n body: f.text().label(\"Body\").renderer(\"textarea\")\n }));\n }),\n\n // --- Dynamic Zone (multi-value template list) ---\n sections: fields\n .object()\n .list()\n .label(\"Page Sections\")\n .renderer(\"dynamicZone\", { container: false })\n .template(\"hero\", t => {\n t.label(\"Hero Banner\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n heading: f.text().label(\"Heading\"),\n subheading: f.text().label(\"Subheading\"),\n uuid: f\n .text()\n .label(\"UUID\")\n .defaultValue(() => Date.now())\n .cloneValue(value => `${value}/${Date.now()}`)\n }));\n })\n .template(\"cta\", t => {\n t.label(\"Call To Action\")\n .icon({\n type: \"icon\",\n name: \"fab/behance-square\"\n })\n .fields(f => ({\n label: f.text().label(\"Button Label\"),\n url: f.text().label(\"URL\")\n }));\n }),\n\n // --- Files ---\n fileImage: fields\n .file()\n .label(\"Image (full metadata)\")\n .description(\"Stores the full file object (id, name, size, src, etc.)\"),\n fileUrl: fields\n .fileUrl()\n .label(\"Image URL\")\n .description(\"Stores only the file URL as a string\"),\n\n // --- Lexical ---\n richText: fields\n .lexical()\n .label(\"Rich Text\")\n .description(\"Lexical rich text editor\")\n }),\n layout: layout => [\n layout\n .tabs(\"mainTabs\")\n .tab(\"text\", tab => {\n tab.label(\"Text\").layout(l => [\n l.row(\"textInput\"),\n l.row(\"textInputs\"),\n l.row(\"tags\"),\n l.row(\"textarea\"),\n l.row(\"textareas\"),\n l.row(\"metaTags\")\n ]);\n })\n .tab(\"numbers\", tab => {\n tab.label(\"Numbers & Boolean\").layout(l => [\n l.row(\"numberInput\"),\n l.row(\"numberInputs\"),\n l.row(\"numberOptions\"),\n l.separator(),\n l.row(\"boolSwitch\")\n ]);\n })\n .tab(\"selects\", tab => {\n tab.label(\"Selects\").layout(l => [\n l.row(\"dropdown\", \"radioButtons\"),\n l.row(\"checkboxes\")\n ]);\n })\n .tab(\"datetime\", tab => {\n tab.label(\"Date / Time\").layout(l => [\n l.row(\"dateOnly\", \"timeOnly\"),\n l.row(\"dateTime\"),\n l.row(\"dateTimeTz\"),\n l.separator(),\n l.row(\"monthOnly\", \"weekOnly\"),\n l.row(\"yearOnly\"),\n l.separator(),\n l.row(\"dateRange\"),\n l.row(\"multipleDates\"),\n l.row(\"multipleMonths\", \"multipleYears\"),\n l.separator(),\n l.row(\"dateTimeList\")\n ]);\n })\n .tab(\"rules\", tab => {\n tab.label(\"Rules\").layout(l => [\n l.row(\"enableFeature\"),\n l.row(\"featureName\", \"featureMode\"),\n l.row(\"advancedConfig\")\n ]);\n })\n .tab(\"dynamic\", tab => {\n tab.label(\"Dynamic Zones\").layout(l => [\n l.object(\"contentBlock\", {\n hero: inner => [inner.row(\"heading\"), inner.row(\"image\")],\n text: inner => [inner.row(\"body\")]\n }),\n l.object(\"sections\", {\n hero: inner => [\n inner.row(\"heading\", \"subheading\"),\n inner.row(\"uuid\")\n ],\n cta: inner => [inner.row(\"label\", \"url\")]\n })\n ]);\n })\n .tab(\"files\", tab => {\n tab.label(\"Files\").layout(l => [l.row(\"fileImage\", \"fileUrl\")]);\n })\n .tab(\"lexical\", tab => {\n tab.label(\"Lexical\").layout(l => [l.row(\"richText\")]);\n })\n ]\n });\n\n makeAutoObservable(this);\n }\n\n get vm(): FieldRenderersDemoVM {\n return {\n form: this.form.vm,\n data: toJS(this.form.getData()),\n lastSubmitted: this.lastSubmitted,\n isSubmitting: this.isSubmitting,\n formErrors: this.form.errors\n };\n }\n\n focusField(path: string): void {\n this.form.focusField(path);\n }\n\n async submit(): Promise<void> {\n this.isSubmitting = true;\n try {\n const result = await this.form.submit<Record<string, unknown>>();\n if (result !== false) {\n this.lastSubmitted = toJS(result);\n }\n } finally {\n this.isSubmitting = false;\n }\n }\n\n reset(): void {\n this.form.reset();\n this.lastSubmitted = null;\n }\n}\n"],"names":["FieldRenderersDemoPresenter","formFactory","fields","f","t","Date","value","layout","tab","l","inner","makeAutoObservable","toJS","path","result"],"mappings":";AAWO,MAAMA;IAKT,YAAYC,WAA8B,CAAE;aAHpC,aAAa,GAAmC;aAChD,YAAY,GAAG;QAGnB,IAAI,CAAC,IAAI,GAAGA,YAAY,MAAM,CAAC;YAC3B,QAAQC,CAAAA,S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rC,IAAIA,AAAW,UAAXA,QACA,IAAI,CAAC,aAAa,GAAGF,KAAKE;QAElC,SAAU;YACN,IAAI,CAAC,YAAY,GAAG;QACxB;IACJ;IAEA,QAAc;QACV,IAAI,CAAC,IAAI,CAAC,KAAK;QACf,IAAI,CAAC,aAAa,GAAG;IACzB;AACJ"}
@@ -3,7 +3,7 @@ import { FormModelFactory } from "./abstractions.js";
3
3
  import { FormModelFactory as external_FormModelFactory_js_FormModelFactory } from "./FormModelFactory.js";
4
4
  import { ConditionRuleEvaluator } from "./ConditionRuleEvaluator.js";
5
5
  import { FieldBuilderRegistry } from "./FieldBuilderRegistry.js";
6
- import { BooleanFieldType, DateTimeFieldType, FileFieldType, FileUrlFieldType, NumberFieldType, ObjectFieldType, TextFieldType } from "./fieldTypes/index.js";
6
+ import { BooleanFieldType, DateTimeFieldType, FileFieldType, FileUrlFieldType, LexicalFieldType, NumberFieldType, ObjectFieldType, TextFieldType } from "./fieldTypes/index.js";
7
7
  const FormModelFeature = createFeature({
8
8
  name: "FormModel",
9
9
  register (container) {
@@ -14,6 +14,7 @@ const FormModelFeature = createFeature({
14
14
  container.register(FileFieldType);
15
15
  container.register(FileUrlFieldType);
16
16
  container.register(ObjectFieldType);
17
+ container.register(LexicalFieldType);
17
18
  container.register(FieldBuilderRegistry).inSingletonScope();
18
19
  container.register(ConditionRuleEvaluator).inSingletonScope();
19
20
  container.register(external_FormModelFactory_js_FormModelFactory).inSingletonScope();
@@ -1 +1 @@
1
- {"version":3,"file":"features/formModel/feature.js","sources":["../../../src/features/formModel/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { FormModelFactory as Abstraction } from \"./abstractions.js\";\nimport { FormModelFactory } from \"./FormModelFactory.js\";\nimport { ConditionRuleEvaluator } from \"./ConditionRuleEvaluator.js\";\nimport { FieldBuilderRegistry } from \"./FieldBuilderRegistry.js\";\nimport {\n TextFieldType,\n NumberFieldType,\n BooleanFieldType,\n DateTimeFieldType,\n FileFieldType,\n FileUrlFieldType,\n ObjectFieldType\n} from \"./fieldTypes/index.js\";\n\nexport const FormModelFeature = createFeature({\n name: \"FormModel\",\n register(container) {\n container.register(TextFieldType);\n container.register(NumberFieldType);\n container.register(BooleanFieldType);\n container.register(DateTimeFieldType);\n container.register(FileFieldType);\n container.register(FileUrlFieldType);\n container.register(ObjectFieldType);\n\n container.register(FieldBuilderRegistry).inSingletonScope();\n container.register(ConditionRuleEvaluator).inSingletonScope();\n container.register(FormModelFactory).inSingletonScope();\n },\n resolve(container) {\n return {\n formModelFactory: container.resolve(Abstraction)\n };\n }\n});\n"],"names":["FormModelFeature","createFeature","container","TextFieldType","NumberFieldType","BooleanFieldType","DateTimeFieldType","FileFieldType","FileUrlFieldType","ObjectFieldType","FieldBuilderRegistry","ConditionRuleEvaluator","FormModelFactory","Abstraction"],"mappings":";;;;;;AAeO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QAEnBP,UAAU,QAAQ,CAACQ,sBAAsB,gBAAgB;QACzDR,UAAU,QAAQ,CAACS,wBAAwB,gBAAgB;QAC3DT,UAAU,QAAQ,CAACU,+CAAkB,gBAAgB;IACzD;IACA,SAAQV,SAAS;QACb,OAAO;YACH,kBAAkBA,UAAU,OAAO,CAACW;QACxC;IACJ;AACJ"}
1
+ {"version":3,"file":"features/formModel/feature.js","sources":["../../../src/features/formModel/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { FormModelFactory as Abstraction } from \"./abstractions.js\";\nimport { FormModelFactory } from \"./FormModelFactory.js\";\nimport { ConditionRuleEvaluator } from \"./ConditionRuleEvaluator.js\";\nimport { FieldBuilderRegistry } from \"./FieldBuilderRegistry.js\";\nimport {\n TextFieldType,\n NumberFieldType,\n BooleanFieldType,\n DateTimeFieldType,\n FileFieldType,\n FileUrlFieldType,\n ObjectFieldType,\n LexicalFieldType\n} from \"./fieldTypes/index.js\";\n\nexport const FormModelFeature = createFeature({\n name: \"FormModel\",\n register(container) {\n container.register(TextFieldType);\n container.register(NumberFieldType);\n container.register(BooleanFieldType);\n container.register(DateTimeFieldType);\n container.register(FileFieldType);\n container.register(FileUrlFieldType);\n container.register(ObjectFieldType);\n container.register(LexicalFieldType);\n\n container.register(FieldBuilderRegistry).inSingletonScope();\n container.register(ConditionRuleEvaluator).inSingletonScope();\n container.register(FormModelFactory).inSingletonScope();\n },\n resolve(container) {\n return {\n formModelFactory: container.resolve(Abstraction)\n };\n }\n});\n"],"names":["FormModelFeature","createFeature","container","TextFieldType","NumberFieldType","BooleanFieldType","DateTimeFieldType","FileFieldType","FileUrlFieldType","ObjectFieldType","LexicalFieldType","FieldBuilderRegistry","ConditionRuleEvaluator","FormModelFactory","Abstraction"],"mappings":";;;;;;AAgBO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QAEnBR,UAAU,QAAQ,CAACS,sBAAsB,gBAAgB;QACzDT,UAAU,QAAQ,CAACU,wBAAwB,gBAAgB;QAC3DV,UAAU,QAAQ,CAACW,+CAAkB,gBAAgB;IACzD;IACA,SAAQX,SAAS;QACb,OAAO;YACH,kBAAkBA,UAAU,OAAO,CAACY;QACxC;IACJ;AACJ"}
@@ -0,0 +1,19 @@
1
+ import { type IFieldTypeFactory } from "../abstractions.js";
2
+ import { FieldBuilder } from "../FieldBuilder.js";
3
+ import type { RichTextValueWithHtml } from "../../../components/LexicalEditor/lexicalValueWithHtml.js";
4
+ export declare class LexicalFieldBuilder extends FieldBuilder<"lexical"> {
5
+ constructor();
6
+ }
7
+ declare class LexicalFieldTypeFactory implements IFieldTypeFactory {
8
+ readonly type = "lexical";
9
+ create(_registry: any): LexicalFieldBuilder;
10
+ }
11
+ export declare const LexicalFieldType: typeof LexicalFieldTypeFactory & {
12
+ __abstraction: import("@webiny/di").Abstraction<IFieldTypeFactory>;
13
+ };
14
+ declare module "../abstractions.js" {
15
+ interface IFieldBuilderRegistry {
16
+ lexical(): IFieldBuilder<"lexical", false, RichTextValueWithHtml | null>;
17
+ }
18
+ }
19
+ export {};
@@ -0,0 +1,23 @@
1
+ import { FieldType } from "../abstractions.js";
2
+ import { FieldBuilder } from "../FieldBuilder.js";
3
+ class LexicalFieldBuilder extends FieldBuilder {
4
+ constructor(){
5
+ super("lexical");
6
+ this._config.renderer = "lexical";
7
+ }
8
+ }
9
+ class LexicalFieldTypeFactory {
10
+ create(_registry) {
11
+ return new LexicalFieldBuilder();
12
+ }
13
+ constructor(){
14
+ this.type = "lexical";
15
+ }
16
+ }
17
+ const LexicalFieldType = FieldType.createImplementation({
18
+ implementation: LexicalFieldTypeFactory,
19
+ dependencies: []
20
+ });
21
+ export { LexicalFieldBuilder, LexicalFieldType };
22
+
23
+ //# sourceMappingURL=LexicalFieldType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/formModel/fieldTypes/LexicalFieldType.js","sources":["../../../../src/features/formModel/fieldTypes/LexicalFieldType.ts"],"sourcesContent":["import { FieldType, type IFieldTypeFactory, type IFieldBuilder } from \"../abstractions.js\";\nimport { FieldBuilder } from \"../FieldBuilder.js\";\nimport type { RichTextValueWithHtml } from \"~/components/LexicalEditor/lexicalValueWithHtml.js\";\n\nexport class LexicalFieldBuilder extends FieldBuilder<\"lexical\"> {\n constructor() {\n super(\"lexical\");\n this._config.renderer = \"lexical\";\n }\n}\n\nclass LexicalFieldTypeFactory implements IFieldTypeFactory {\n readonly type = \"lexical\";\n create(_registry: any) {\n return new LexicalFieldBuilder();\n }\n}\n\nexport const LexicalFieldType = FieldType.createImplementation({\n implementation: LexicalFieldTypeFactory,\n dependencies: []\n});\n\ndeclare module \"../abstractions.js\" {\n interface IFieldBuilderRegistry {\n lexical(): IFieldBuilder<\"lexical\", false, RichTextValueWithHtml | null>;\n }\n}\n"],"names":["LexicalFieldBuilder","FieldBuilder","LexicalFieldTypeFactory","_registry","LexicalFieldType","FieldType"],"mappings":";;AAIO,MAAMA,4BAA4BC;IACrC,aAAc;QACV,KAAK,CAAC;QACN,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG;IAC5B;AACJ;AAEA,MAAMC;IAEF,OAAOC,SAAc,EAAE;QACnB,OAAO,IAAIH;IACf;;aAHS,IAAI,GAAG;;AAIpB;AAEO,MAAMI,mBAAmBC,UAAU,oBAAoB,CAAC;IAC3D,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -5,3 +5,4 @@ export { DateTimeFieldType, DateTimeFieldBuilder } from "./DateTimeFieldType.js"
5
5
  export { FileFieldType, FileFieldBuilder } from "./FileFieldType.js";
6
6
  export { FileUrlFieldType, FileUrlFieldBuilder } from "./FileUrlFieldType.js";
7
7
  export { ObjectFieldType, ObjectFieldBuilder } from "./ObjectFieldType.js";
8
+ export { LexicalFieldType, LexicalFieldBuilder } from "./LexicalFieldType.js";
@@ -5,3 +5,4 @@ export { DateTimeFieldBuilder, DateTimeFieldType } from "./DateTimeFieldType.js"
5
5
  export { FileFieldBuilder, FileFieldType } from "./FileFieldType.js";
6
6
  export { FileUrlFieldBuilder, FileUrlFieldType } from "./FileUrlFieldType.js";
7
7
  export { ObjectFieldBuilder, ObjectFieldType } from "./ObjectFieldType.js";
8
+ export { LexicalFieldBuilder, LexicalFieldType } from "./LexicalFieldType.js";
@@ -18,3 +18,4 @@ import "../../base/Base/FieldRenderers/DateTimeInputsRenderer.js";
18
18
  import "../../base/Base/FieldRenderers/HiddenRenderer.js";
19
19
  import "../../base/Base/FieldRenderers/FilePickerRenderer.js";
20
20
  import "../../base/Base/FieldRenderers/CodeEditorRenderer.js";
21
+ import "../../base/Base/FieldRenderers/LexicalRenderer.js";
@@ -18,3 +18,4 @@ import "../../base/Base/FieldRenderers/DateTimeInputsRenderer.js";
18
18
  import "../../base/Base/FieldRenderers/HiddenRenderer.js";
19
19
  import "../../base/Base/FieldRenderers/FilePickerRenderer.js";
20
20
  import "../../base/Base/FieldRenderers/CodeEditorRenderer.js";
21
+ import "../../base/Base/FieldRenderers/LexicalRenderer.js";
@@ -0,0 +1,13 @@
1
+ import { EnvConfig } from "@webiny/app/features/envConfig";
2
+ import { NewsletterSubscriptionService as Abstraction } from "./abstractions.js";
3
+ declare class NewsletterSubscriptionServiceImpl implements Abstraction.Interface {
4
+ private envConfig;
5
+ constructor(envConfig: EnvConfig.Interface);
6
+ subscribe(params: {
7
+ email: string;
8
+ firstName: string;
9
+ lastName: string;
10
+ }): Promise<void>;
11
+ }
12
+ export declare const NewsletterSubscriptionService: import("@webiny/di").Implementation<typeof NewsletterSubscriptionServiceImpl>;
13
+ export {};
@@ -0,0 +1,36 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { EnvConfig } from "@webiny/app/features/envConfig";
3
+ import { NewsletterSubscriptionService } from "./abstractions.js";
4
+ class NewsletterSubscriptionServiceImpl {
5
+ constructor(envConfig){
6
+ this.envConfig = envConfig;
7
+ }
8
+ async subscribe(params) {
9
+ if (!this.envConfig.get("telemetryEnabled")) return;
10
+ if (!params.email || !params.firstName || !params.lastName) return;
11
+ try {
12
+ await fetch("https://t.webiny.com/newsletter", {
13
+ method: "POST",
14
+ headers: {
15
+ "Content-Type": "text/plain;charset=UTF-8"
16
+ },
17
+ body: JSON.stringify({
18
+ firstName: params.firstName,
19
+ lastName: params.lastName,
20
+ email: params.email,
21
+ source: "install-wizard"
22
+ })
23
+ });
24
+ } catch {}
25
+ }
26
+ }
27
+ const NewsletterSubscriptionService_NewsletterSubscriptionService = createImplementation({
28
+ abstraction: NewsletterSubscriptionService,
29
+ implementation: NewsletterSubscriptionServiceImpl,
30
+ dependencies: [
31
+ EnvConfig
32
+ ]
33
+ });
34
+ export { NewsletterSubscriptionService_NewsletterSubscriptionService as NewsletterSubscriptionService };
35
+
36
+ //# sourceMappingURL=NewsletterSubscriptionService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/newsletter/NewsletterSubscriptionService.js","sources":["../../../src/features/newsletter/NewsletterSubscriptionService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { EnvConfig } from \"@webiny/app/features/envConfig\";\nimport { NewsletterSubscriptionService as Abstraction } from \"./abstractions.js\";\n\nclass NewsletterSubscriptionServiceImpl implements Abstraction.Interface {\n constructor(private envConfig: EnvConfig.Interface) {}\n\n async subscribe(params: { email: string; firstName: string; lastName: string }): Promise<void> {\n if (!this.envConfig.get(\"telemetryEnabled\")) {\n return;\n }\n if (!params.email || !params.firstName || !params.lastName) {\n return;\n }\n\n try {\n // TODO: use an injectable service here.\n await fetch(\"https://t.webiny.com/newsletter\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"text/plain;charset=UTF-8\" },\n body: JSON.stringify({\n firstName: params.firstName,\n lastName: params.lastName,\n email: params.email,\n source: \"install-wizard\"\n })\n });\n } catch {\n // Best-effort: never surface to the user.\n }\n }\n}\n\nexport const NewsletterSubscriptionService = createImplementation({\n abstraction: Abstraction,\n implementation: NewsletterSubscriptionServiceImpl,\n dependencies: [EnvConfig]\n});\n"],"names":["NewsletterSubscriptionServiceImpl","envConfig","params","fetch","JSON","NewsletterSubscriptionService","createImplementation","Abstraction","EnvConfig"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,SAA8B,CAAE;aAAhCA,SAAS,GAATA;IAAiC;IAErD,MAAM,UAAUC,MAA8D,EAAiB;QAC3F,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,qBACpB;QAEJ,IAAI,CAACA,OAAO,KAAK,IAAI,CAACA,OAAO,SAAS,IAAI,CAACA,OAAO,QAAQ,EACtD;QAGJ,IAAI;YAEA,MAAMC,MAAM,mCAAmC;gBAC3C,QAAQ;gBACR,SAAS;oBAAE,gBAAgB;gBAA2B;gBACtD,MAAMC,KAAK,SAAS,CAAC;oBACjB,WAAWF,OAAO,SAAS;oBAC3B,UAAUA,OAAO,QAAQ;oBACzB,OAAOA,OAAO,KAAK;oBACnB,QAAQ;gBACZ;YACJ;QACJ,EAAE,OAAM,CAER;IACJ;AACJ;AAEO,MAAMG,8DAAgCC,qBAAqB;IAC9D,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAU;AAC7B"}
@@ -0,0 +1,11 @@
1
+ export interface INewsletterSubscriptionService {
2
+ subscribe(params: {
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ }): Promise<void>;
7
+ }
8
+ export declare const NewsletterSubscriptionService: import("@webiny/di").Abstraction<INewsletterSubscriptionService>;
9
+ export declare namespace NewsletterSubscriptionService {
10
+ type Interface = INewsletterSubscriptionService;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const NewsletterSubscriptionService = createAbstraction("NewsletterSubscriptionService");
3
+ export { NewsletterSubscriptionService };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/newsletter/abstractions.js","sources":["../../../src/features/newsletter/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface INewsletterSubscriptionService {\n subscribe(params: { email: string; firstName: string; lastName: string }): Promise<void>;\n}\n\nexport const NewsletterSubscriptionService = createAbstraction<INewsletterSubscriptionService>(\n \"NewsletterSubscriptionService\"\n);\n\nexport namespace NewsletterSubscriptionService {\n export type Interface = INewsletterSubscriptionService;\n}\n"],"names":["NewsletterSubscriptionService","createAbstraction"],"mappings":";AAMO,MAAMA,gCAAgCC,kBACzC"}
@@ -0,0 +1 @@
1
+ export { NewsletterSubscriptionService } from "./abstractions.js";
@@ -0,0 +1 @@
1
+ export { NewsletterSubscriptionService } from "./abstractions.js";
package/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export * from "./components/index.js";
21
21
  export type { RichTextValueWithHtml } from "./components/index.js";
22
22
  export { HasPermission } from "./presentation/security/components/HasPermission.js";
23
23
  export { SecureRoute } from "./presentation/security/components/SecureRoute.js";
24
- export { FileManager, FileManagerRenderer } from "./base/ui/FileManager.js";
24
+ export { FileManager } from "./base/ui/FileManager.js";
25
25
  export type { FileManagerProps, FileManagerRendererProps, FileManagerFileItem, FileManagerOnChange } from "./base/ui/FileManager.js";
26
26
  export { SystemInstallerProvider } from "./presentation/installation/components/SystemInstaller/index.js";
27
27
  export type { AaclPermission } from "./features/wcp/types.js";
@@ -46,6 +46,7 @@ import "./features/formModel/fieldTypes/DateTimeFieldType.js";
46
46
  import "./features/formModel/fieldTypes/FileFieldType.js";
47
47
  import "./features/formModel/fieldTypes/FileUrlFieldType.js";
48
48
  import "./features/formModel/fieldTypes/ObjectFieldType.js";
49
+ import "./features/formModel/fieldTypes/LexicalFieldType.js";
49
50
  export { FormModelFactory } from "./features/formModel/abstractions.js";
50
51
  export type { FormModel } from "./features/formModel/abstractions.js";
51
52
  export type { IFieldRendererRegistry, FieldRendererName, FieldRendererSettings, IFormModelFactory, IFormModelConfig, ILayoutBuilder, ILayoutNodeBuilder, IRowBuilder, ISeparatorBuilder, ITabsBuilder, IElementBuilder, IObjectBuilder, IFieldBuilder, IOptionsFieldBuilder, IFieldBuilderRegistry, IFormModel, IField, FieldTypeMap, IFieldConfig, IFieldVM, IFieldValidation, IFormVM, IFormError, IValueOption, IRowNode, IRowNodeVM, LayoutNode, LayoutNodeVM, LayoutPosition, IPositionedLayoutNode, ILayoutNodeHandle, ILayoutModifier, IFormModifier, BeforeChangeCallback, AfterChangeCallback, AfterSetValueCallback } from "./features/formModel/abstractions.js";
package/index.js CHANGED
@@ -4,6 +4,7 @@ import "./features/formModel/fieldTypes/BooleanFieldType.js";
4
4
  import "./features/formModel/fieldTypes/NumberFieldType.js";
5
5
  import "./features/formModel/fieldTypes/TextFieldType.js";
6
6
  import "./features/formModel/renderers.js";
7
+ import "./features/formModel/fieldTypes/LexicalFieldType.js";
7
8
  import "./features/formModel/fieldTypes/ObjectFieldType.js";
8
9
  import "./features/formModel/fieldTypes/FileUrlFieldType.js";
9
10
  export * from "@webiny/app";
@@ -27,7 +28,7 @@ export * from "@webiny/app/renderApp.js";
27
28
  export { Admin } from "./base/Admin.js";
28
29
  export { HasPermission } from "./presentation/security/components/HasPermission.js";
29
30
  export { SecureRoute } from "./presentation/security/components/SecureRoute.js";
30
- export { FileManager, FileManagerRenderer } from "./base/ui/FileManager.js";
31
+ export { FileManager } from "./base/ui/FileManager.js";
31
32
  export { SystemInstallerProvider } from "./presentation/installation/components/SystemInstaller/index.js";
32
33
  export { BuildParamsFeature } from "./features/buildParams/feature.js";
33
34
  export { ToolsFeature } from "./features/tools/feature.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-admin",
3
- "version": "6.4.0-beta.2",
3
+ "version": "6.4.0-beta.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -21,26 +21,28 @@
21
21
  "@emotion/styled": "11.14.1",
22
22
  "@fortawesome/fontawesome-svg-core": "7.2.0",
23
23
  "@fortawesome/react-fontawesome": "3.3.1",
24
- "@iconify/json": "2.2.474",
24
+ "@iconify/json": "2.2.478",
25
+ "@lexical/utils": "0.44.0",
25
26
  "@svgr/webpack": "8.1.0",
26
- "@types/react": "18.3.28",
27
- "@webiny/admin-ui": "6.4.0-beta.2",
28
- "@webiny/app": "6.4.0-beta.2",
27
+ "@types/react": "18.3.29",
28
+ "@webiny/admin-ui": "6.4.0-beta.4",
29
+ "@webiny/app": "6.4.0-beta.4",
29
30
  "@webiny/di": "1.0.1",
30
- "@webiny/feature": "6.4.0-beta.2",
31
- "@webiny/form": "6.4.0-beta.2",
32
- "@webiny/icons": "6.4.0-beta.2",
33
- "@webiny/lexical-converter": "6.4.0-beta.2",
34
- "@webiny/lexical-editor": "6.4.0-beta.2",
35
- "@webiny/lexical-theme": "6.4.0-beta.2",
36
- "@webiny/plugins": "6.4.0-beta.2",
37
- "@webiny/react-composition": "6.4.0-beta.2",
38
- "@webiny/react-properties": "6.4.0-beta.2",
39
- "@webiny/sdk": "6.4.0-beta.2",
40
- "@webiny/telemetry": "6.4.0-beta.2",
41
- "@webiny/utils": "6.4.0-beta.2",
42
- "@webiny/validation": "6.4.0-beta.2",
43
- "@webiny/wcp": "6.4.0-beta.2",
31
+ "@webiny/feature": "6.4.0-beta.4",
32
+ "@webiny/form": "6.4.0-beta.4",
33
+ "@webiny/icons": "6.4.0-beta.4",
34
+ "@webiny/lexical-converter": "6.4.0-beta.4",
35
+ "@webiny/lexical-editor": "6.4.0-beta.4",
36
+ "@webiny/lexical-nodes": "6.4.0-beta.4",
37
+ "@webiny/lexical-theme": "6.4.0-beta.4",
38
+ "@webiny/plugins": "6.4.0-beta.4",
39
+ "@webiny/react-composition": "6.4.0-beta.4",
40
+ "@webiny/react-properties": "6.4.0-beta.4",
41
+ "@webiny/sdk": "6.4.0-beta.4",
42
+ "@webiny/telemetry": "6.4.0-beta.4",
43
+ "@webiny/utils": "6.4.0-beta.4",
44
+ "@webiny/validation": "6.4.0-beta.4",
45
+ "@webiny/wcp": "6.4.0-beta.4",
44
46
  "apollo-cache": "1.3.5",
45
47
  "apollo-client": "2.6.10",
46
48
  "apollo-link": "1.2.14",
@@ -54,7 +56,7 @@
54
56
  "is-hotkey": "0.2.0",
55
57
  "lexical": "0.44.0",
56
58
  "lodash": "4.18.1",
57
- "markdown-to-jsx": "9.8.0",
59
+ "markdown-to-jsx": "9.8.1",
58
60
  "mime": "4.1.0",
59
61
  "minimatch": "10.2.5",
60
62
  "mobx": "6.15.3",
@@ -62,7 +64,7 @@
62
64
  "monaco-editor": "0.53.0",
63
65
  "react": "18.3.1",
64
66
  "react-dom": "18.3.1",
65
- "react-resizable-panels": "4.11.1",
67
+ "react-resizable-panels": "4.11.2",
66
68
  "react-transition-group": "4.4.5",
67
69
  "react-virtualized": "9.22.6",
68
70
  "reset-css": "5.0.2",
@@ -75,18 +77,17 @@
75
77
  "@types/bytes": "3.1.5",
76
78
  "@types/graphlib": "2.1.12",
77
79
  "@types/is-hotkey": "0.1.10",
78
- "@types/react-resizable": "3.0.8",
80
+ "@types/react-resizable": "4.0.0",
79
81
  "@types/react-transition-group": "4.4.12",
80
82
  "@types/store": "2.0.5",
81
83
  "@types/tinycolor2": "1.4.6",
82
- "@webiny/build-tools": "6.4.0-beta.2",
84
+ "@webiny/build-tools": "6.4.0-beta.4",
83
85
  "rimraf": "6.1.3",
84
86
  "typescript": "6.0.3",
85
- "vitest": "4.1.6"
87
+ "vitest": "4.1.7"
86
88
  },
87
89
  "publishConfig": {
88
- "access": "public",
89
- "directory": "dist"
90
+ "access": "public"
90
91
  },
91
92
  "adio": {
92
93
  "ignore": {
@@ -105,5 +106,8 @@
105
106
  ]
106
107
  }
107
108
  },
108
- "gitHead": "872f9f50baa1ff6915a5f338216f84bf0b6dfd24"
109
+ "gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
110
+ "webiny": {
111
+ "publishFrom": "dist"
112
+ }
109
113
  }
@@ -0,0 +1 @@
1
+ export declare const handleRestartInstallation: () => void;
@@ -0,0 +1,6 @@
1
+ const handleRestartInstallation = ()=>{
2
+ window.location.reload();
3
+ };
4
+ export { handleRestartInstallation };
5
+
6
+ //# sourceMappingURL=handleRestartInstallation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/installation/components/SystemInstaller/steps/FinishSetup/handleRestartInstallation.js","sources":["../../../../../../../src/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleRestartInstallation.ts"],"sourcesContent":["export const handleRestartInstallation = () => {\n window.location.reload();\n};\n"],"names":["handleRestartInstallation","window"],"mappings":"AAAO,MAAMA,4BAA4B;IACrCC,OAAO,QAAQ,CAAC,MAAM;AAC1B"}
@@ -0,0 +1,2 @@
1
+ import type { ISystemInstallerPresenter } from "../../../../../../presentation/installation/presenters/SystemInstaller/abstractions.js";
2
+ export declare const handleStartUsing: (finishInstallation: ISystemInstallerPresenter["finishInstallation"]) => void;
@@ -0,0 +1,27 @@
1
+ import { getMachineId } from "@webiny/telemetry/react.js";
2
+ const INSTALL_FINISH_URL = process.env.REACT_APP_WEBINY_INSTALL_FINISH_URL || "https://www.webiny.com/install/finish";
3
+ const buildInstallFinishHref = ()=>{
4
+ if ("false" === process.env.REACT_APP_WEBINY_TELEMETRY) return null;
5
+ if ("u" < typeof window) return null;
6
+ const isCloudFrontHost = window.location.hostname.endsWith(".cloudfront.net");
7
+ const allowAlternate = Boolean(process.env.REACT_APP_WEBINY_INSTALL_FINISH_URL);
8
+ if (!isCloudFrontHost && !allowAlternate) return null;
9
+ const machineId = getMachineId();
10
+ if (!machineId) return null;
11
+ const currentUrl = window.location.origin + window.location.pathname;
12
+ const params = new URLSearchParams({
13
+ machine_id: machineId,
14
+ return_to: currentUrl
15
+ });
16
+ return `${INSTALL_FINISH_URL}?${params.toString()}`;
17
+ };
18
+ const handleStartUsing = (finishInstallation)=>{
19
+ if ("u" > typeof window) {
20
+ const handoff = buildInstallFinishHref();
21
+ if (handoff) return void window.location.assign(handoff);
22
+ }
23
+ finishInstallation();
24
+ };
25
+ export { handleStartUsing };
26
+
27
+ //# sourceMappingURL=handleStartUsing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js","sources":["../../../../../../../src/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.ts"],"sourcesContent":["import { getMachineId } from \"@webiny/telemetry/react.js\";\nimport type { ISystemInstallerPresenter } from \"~/presentation/installation/presenters/SystemInstaller/abstractions.js\";\n\nconst INSTALL_FINISH_URL =\n process.env.REACT_APP_WEBINY_INSTALL_FINISH_URL || \"https://www.webiny.com/install/finish\";\n\n/**\n * If telemetry is enabled AND the admin is hosted on CloudFront (production\n * deployment), route the \"Start using Webiny\" CTA through the marketing\n * site's /install/finish page so the website's anonymous wts_did cookie can\n * be aliased to the deployer's machine_id. Falls through to the local\n * `finishInstallation` flow otherwise.\n */\nconst buildInstallFinishHref = (): string | null => {\n if (process.env.REACT_APP_WEBINY_TELEMETRY === \"false\") {\n return null;\n }\n\n if (typeof window === \"undefined\") {\n return null;\n }\n const isCloudFrontHost = window.location.hostname.endsWith(\".cloudfront.net\");\n const allowAlternate = Boolean(process.env.REACT_APP_WEBINY_INSTALL_FINISH_URL);\n if (!isCloudFrontHost && !allowAlternate) {\n return null;\n }\n\n const machineId = getMachineId();\n if (!machineId) {\n return null;\n }\n\n const currentUrl = window.location.origin + window.location.pathname;\n const params = new URLSearchParams({\n machine_id: machineId,\n return_to: currentUrl\n });\n return `${INSTALL_FINISH_URL}?${params.toString()}`;\n};\n\nexport const handleStartUsing = (\n finishInstallation: ISystemInstallerPresenter[\"finishInstallation\"]\n) => {\n if (typeof window !== \"undefined\") {\n const handoff = buildInstallFinishHref();\n if (handoff) {\n window.location.assign(handoff);\n return;\n }\n }\n finishInstallation();\n};\n"],"names":["INSTALL_FINISH_URL","process","buildInstallFinishHref","window","isCloudFrontHost","allowAlternate","Boolean","machineId","getMachineId","currentUrl","params","URLSearchParams","handleStartUsing","finishInstallation","handoff"],"mappings":";AAGA,MAAMA,qBACFC,QAAQ,GAAG,CAAC,mCAAmC,IAAI;AASvD,MAAMC,yBAAyB;IAC3B,IAAID,AAA2C,YAA3CA,QAAQ,GAAG,CAAC,0BAA0B,EACtC,OAAO;IAGX,IAAI,AAAkB,MAAlB,OAAOE,QACP,OAAO;IAEX,MAAMC,mBAAmBD,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAC3D,MAAME,iBAAiBC,QAAQL,QAAQ,GAAG,CAAC,mCAAmC;IAC9E,IAAI,CAACG,oBAAoB,CAACC,gBACtB,OAAO;IAGX,MAAME,YAAYC;IAClB,IAAI,CAACD,WACD,OAAO;IAGX,MAAME,aAAaN,OAAO,QAAQ,CAAC,MAAM,GAAGA,OAAO,QAAQ,CAAC,QAAQ;IACpE,MAAMO,SAAS,IAAIC,gBAAgB;QAC/B,YAAYJ;QACZ,WAAWE;IACf;IACA,OAAO,GAAGT,mBAAmB,CAAC,EAAEU,OAAO,QAAQ,IAAI;AACvD;AAEO,MAAME,mBAAmB,CAC5BC;IAEA,IAAI,AAAkB,MAAlB,OAAOV,QAAwB;QAC/B,MAAMW,UAAUZ;QAChB,IAAIY,SAAS,YACTX,OAAO,QAAQ,CAAC,MAAM,CAACW;IAG/B;IACAD;AACJ"}
@@ -2,6 +2,8 @@ import react, { useEffect } from "react";
2
2
  import { Alert, Button, Grid, Loader } from "@webiny/admin-ui";
3
3
  import { Center } from "./Center.js";
4
4
  import { Container } from "./Container.js";
5
+ import { handleStartUsing } from "./FinishSetup/handleStartUsing.js";
6
+ import { handleRestartInstallation } from "./FinishSetup/handleRestartInstallation.js";
5
7
  const FinishSetupStep = ({ error, isInstalled, installing, installSystem, finishInstallation })=>{
6
8
  useEffect(()=>{
7
9
  installSystem();
@@ -25,9 +27,7 @@ const FinishSetupStep = ({ error, isInstalled, installing, installSystem, finish
25
27
  variant: "secondary",
26
28
  size: "lg",
27
29
  text: "Restart installation",
28
- onClick: ()=>{
29
- window.location.reload();
30
- }
30
+ onClick: handleRestartInstallation
31
31
  })) : /*#__PURE__*/ react.createElement(react.Fragment, null), installing ? /*#__PURE__*/ react.createElement(Grid.Column, {
32
32
  span: 12
33
33
  }, /*#__PURE__*/ react.createElement("div", {
@@ -45,7 +45,7 @@ const FinishSetupStep = ({ error, isInstalled, installing, installSystem, finish
45
45
  variant: "primary",
46
46
  size: "lg",
47
47
  text: "Start using Webiny",
48
- onClick: finishInstallation
48
+ onClick: ()=>handleStartUsing(finishInstallation)
49
49
  })) : /*#__PURE__*/ react.createElement(react.Fragment, null)))));
50
50
  };
51
51
  export { FinishSetupStep };