@webiny/app-website-builder 6.4.0-beta.3 → 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 (200) hide show
  1. package/BaseEditor/components/DragPreview/DragCursorWrapper.d.ts +7 -0
  2. package/BaseEditor/components/DragPreview/DragCursorWrapper.js +17 -0
  3. package/BaseEditor/components/DragPreview/DragCursorWrapper.js.map +1 -0
  4. package/BaseEditor/components/DragPreview/DragPreview.js +37 -0
  5. package/BaseEditor/components/DragPreview/DragPreview.js.map +1 -0
  6. package/BaseEditor/components/DragPreview/index.d.ts +1 -0
  7. package/BaseEditor/components/DragPreview/index.js +1 -0
  8. package/BaseEditor/components/DragPreview/useDragPosition.d.ts +4 -0
  9. package/BaseEditor/components/DragPreview/useDragPosition.js +26 -0
  10. package/BaseEditor/components/DragPreview/useDragPosition.js.map +1 -0
  11. package/BaseEditor/components/Editor.js +1 -2
  12. package/BaseEditor/components/Editor.js.map +1 -1
  13. package/BaseEditor/config/EditorConfig.d.ts +4 -2
  14. package/BaseEditor/config/Layout.js +1 -1
  15. package/BaseEditor/config/Layout.js.map +1 -1
  16. package/BaseEditor/config/Sidebar/Layout.js +8 -14
  17. package/BaseEditor/config/Sidebar/Layout.js.map +1 -1
  18. package/BaseEditor/config/Sidebar/Sidebar.d.ts +1 -1
  19. package/BaseEditor/config/Sidebar/Sidebar.js +1 -1
  20. package/BaseEditor/config/Sidebar/Sidebar.js.map +1 -1
  21. package/BaseEditor/config/Sidebar/Tab.d.ts +2 -2
  22. package/BaseEditor/config/Sidebar/Tab.js +3 -3
  23. package/BaseEditor/config/Sidebar/Tab.js.map +1 -1
  24. package/BaseEditor/config/Toolbar/Layout.js +8 -14
  25. package/BaseEditor/config/Toolbar/Layout.js.map +1 -1
  26. package/BaseEditor/config/Toolbar/Tab.d.ts +10 -0
  27. package/BaseEditor/config/Toolbar/Tab.js +13 -0
  28. package/BaseEditor/config/Toolbar/Tab.js.map +1 -0
  29. package/BaseEditor/config/Toolbar/Toolbar.d.ts +1 -0
  30. package/BaseEditor/config/Toolbar/Toolbar.js +4 -2
  31. package/BaseEditor/config/Toolbar/Toolbar.js.map +1 -1
  32. package/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js +1 -4
  33. package/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js.map +1 -1
  34. package/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js +20 -23
  35. package/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js.map +1 -1
  36. package/BaseEditor/defaultConfig/Content/AddressBar/PreviewDomain.js +1 -1
  37. package/BaseEditor/defaultConfig/Content/AddressBar/PreviewDomain.js.map +1 -1
  38. package/BaseEditor/defaultConfig/Content/Breadcrumbs/styles.js +2 -2
  39. package/BaseEditor/defaultConfig/Content/Breadcrumbs/styles.js.map +1 -1
  40. package/BaseEditor/defaultConfig/Content/ContentPreviewConfig.js +6 -1
  41. package/BaseEditor/defaultConfig/Content/ContentPreviewConfig.js.map +1 -1
  42. package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.d.ts +3 -0
  43. package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js +6 -0
  44. package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js.map +1 -1
  45. package/BaseEditor/defaultConfig/Content/Preview/Iframe.js +1 -1
  46. package/BaseEditor/defaultConfig/Content/Preview/Iframe.js.map +1 -1
  47. package/BaseEditor/defaultConfig/Content/Preview/Overlays/ElementOverlay.js +10 -6
  48. package/BaseEditor/defaultConfig/Content/Preview/Overlays/ElementOverlay.js.map +1 -1
  49. package/BaseEditor/defaultConfig/Content/Preview/Preview.js +2 -1
  50. package/BaseEditor/defaultConfig/Content/Preview/Preview.js.map +1 -1
  51. package/BaseEditor/defaultConfig/Content/Preview/PreviewContainer.js +12 -2
  52. package/BaseEditor/defaultConfig/Content/Preview/PreviewContainer.js.map +1 -1
  53. package/BaseEditor/defaultConfig/Content/Preview/PreviewEvents.js +1 -2
  54. package/BaseEditor/defaultConfig/Content/Preview/PreviewEvents.js.map +1 -1
  55. package/BaseEditor/defaultConfig/Content/Preview/useResponsiveContainer.js +1 -1
  56. package/BaseEditor/defaultConfig/Content/Preview/useResponsiveContainer.js.map +1 -1
  57. package/BaseEditor/defaultConfig/DefaultEditorConfig.js +3 -5
  58. package/BaseEditor/defaultConfig/DefaultEditorConfig.js.map +1 -1
  59. package/BaseEditor/defaultConfig/Sidebar/ElementPreview.d.ts +7 -0
  60. package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js +23 -0
  61. package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js.map +1 -0
  62. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js +12 -3
  63. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js.map +1 -1
  64. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettingsGroup.js +6 -0
  65. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettingsGroup.js.map +1 -1
  66. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/useBindingsForElement.d.ts +5 -5
  67. package/BaseEditor/defaultConfig/Sidebar/InfoMessage.js +2 -2
  68. package/BaseEditor/defaultConfig/Sidebar/InfoMessage.js.map +1 -1
  69. package/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js +2 -0
  70. package/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js.map +1 -1
  71. package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.d.ts +4 -0
  72. package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.js +12 -0
  73. package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.js.map +1 -0
  74. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundColor.js +8 -5
  75. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundColor.js.map +1 -1
  76. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js +11 -9
  77. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js.map +1 -1
  78. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundPosition.js +7 -4
  79. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundPosition.js.map +1 -1
  80. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundScaling.js +7 -4
  81. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundScaling.js.map +1 -1
  82. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js +8 -4
  83. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js.map +1 -1
  84. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js +1 -1
  85. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js.map +1 -1
  86. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js +7 -4
  87. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js.map +1 -1
  88. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js +11 -14
  89. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js.map +1 -1
  90. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js +7 -4
  91. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js.map +1 -1
  92. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js +11 -14
  93. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js.map +1 -1
  94. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js +6 -9
  95. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js.map +1 -1
  96. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js +8 -5
  97. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js.map +1 -1
  98. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js +9 -8
  99. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js.map +1 -1
  100. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js +8 -4
  101. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js.map +1 -1
  102. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js +1 -5
  103. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js.map +1 -1
  104. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Margin.js +10 -21
  105. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Margin.js.map +1 -1
  106. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/MarginPadding.js +2 -1
  107. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/MarginPadding.js.map +1 -1
  108. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Padding.js +13 -16
  109. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Padding.js.map +1 -1
  110. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding.js +6 -9
  111. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding.js.map +1 -1
  112. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Visibility/Visibility.js +21 -7
  113. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Visibility/Visibility.js.map +1 -1
  114. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/VisibilityGroup.js +4 -3
  115. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/VisibilityGroup.js.map +1 -1
  116. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.d.ts +8 -0
  117. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js +24 -0
  118. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js.map +1 -0
  119. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.d.ts +8 -0
  120. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.js +11 -0
  121. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.js.map +1 -0
  122. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.d.ts +9 -0
  123. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.js +45 -0
  124. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.js.map +1 -0
  125. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js +8 -3
  126. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js.map +1 -1
  127. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleSettingsGroup.js +8 -7
  128. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleSettingsGroup.js.map +1 -1
  129. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StylesStore.js +2 -2
  130. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StylesStore.js.map +1 -1
  131. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/UnitValuePicker.js +3 -1
  132. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/UnitValuePicker.js.map +1 -1
  133. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/ValueSelector.js +9 -8
  134. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/ValueSelector.js.map +1 -1
  135. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.d.ts +5 -0
  136. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.js +24 -0
  137. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.js.map +1 -0
  138. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.d.ts +7 -0
  139. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.js +18 -0
  140. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.js.map +1 -0
  141. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.d.ts +7 -0
  142. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.js +18 -0
  143. package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.js.map +1 -0
  144. package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElements.js +72 -36
  145. package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElements.js.map +1 -1
  146. package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElementsTab.js +6 -7
  147. package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElementsTab.js.map +1 -1
  148. package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.d.ts +5 -0
  149. package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.js +23 -0
  150. package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.js.map +1 -0
  151. package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.d.ts +4 -0
  152. package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.js +29 -0
  153. package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.js.map +1 -0
  154. package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.d.ts +2 -0
  155. package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.js +94 -0
  156. package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.js.map +1 -0
  157. package/BaseEditor/defaultConfig/Toolbar/Navigator/Navigator.js +12 -111
  158. package/BaseEditor/defaultConfig/Toolbar/Navigator/Navigator.js.map +1 -1
  159. package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.d.ts +2 -0
  160. package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.js +20 -0
  161. package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.js.map +1 -0
  162. package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorTab.js +6 -7
  163. package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorTab.js.map +1 -1
  164. package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.d.ts +7 -0
  165. package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.js +16 -0
  166. package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.js.map +1 -0
  167. package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.d.ts +32 -0
  168. package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.js +70 -0
  169. package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.js.map +1 -0
  170. package/BaseEditor/hooks/useCreateElement.d.ts +1 -1
  171. package/BaseEditor/hooks/useCreateElement.js +1 -3
  172. package/BaseEditor/hooks/useCreateElement.js.map +1 -1
  173. package/ecommerce/EcommerceIntegration.js +1 -1
  174. package/ecommerce/EcommerceIntegration.js.map +1 -1
  175. package/ecommerce/components/ResourcePage.d.ts +1 -1
  176. package/ecommerce/components/ResourcePage.js +1 -1
  177. package/ecommerce/components/ResourcePage.js.map +1 -1
  178. package/features/ecommerce/apis/useEcommerceApi.js +3 -1
  179. package/features/ecommerce/apis/useEcommerceApi.js.map +1 -1
  180. package/inputRenderers/BooleanInput.js +15 -4
  181. package/inputRenderers/BooleanInput.js.map +1 -1
  182. package/inputRenderers/LexicalInput/DefaultLexicalConfig.js +4 -1
  183. package/inputRenderers/LexicalInput/DefaultLexicalConfig.js.map +1 -1
  184. package/inputRenderers/LexicalInput/ExpandEditorAction.js +4 -1
  185. package/inputRenderers/LexicalInput/ExpandEditorAction.js.map +1 -1
  186. package/inputRenderers/LexicalInput/LexicalEditor.js +1 -0
  187. package/inputRenderers/LexicalInput/LexicalEditor.js.map +1 -1
  188. package/inputRenderers/LexicalInput/LexicalInput.js +1 -0
  189. package/inputRenderers/LexicalInput/LexicalInput.js.map +1 -1
  190. package/inputRenderers/LexicalInput/wbStaticToolbar.css +1 -1
  191. package/inputRenderers/TextInput.js +3 -1
  192. package/inputRenderers/TextInput.js.map +1 -1
  193. package/modules/pages/PageEditor/PageEditorConfig.d.ts +4 -2
  194. package/package.json +31 -29
  195. package/BaseEditor/components/DragPreview.js +0 -59
  196. package/BaseEditor/components/DragPreview.js.map +0 -1
  197. package/ecommerce/components/adaptInputToBind.d.ts +0 -6
  198. package/ecommerce/components/adaptInputToBind.js +0 -26
  199. package/ecommerce/components/adaptInputToBind.js.map +0 -1
  200. /package/BaseEditor/components/{DragPreview.d.ts → DragPreview/DragPreview.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ecommerce/components/ResourcePage.js","sources":["../../../src/ecommerce/components/ResourcePage.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Skeleton } from \"@webiny/admin-ui\";\nimport type { IFormModel, IFieldVM } from \"@webiny/app-admin\";\nimport type { IPageType } from \"~/presentation/pages/CreatePage/abstractions.js\";\nimport type { CreatePageParams } from \"~/features/pages/createPage/abstractions.js\";\nimport type { IEcommerceApiProvider } from \"~/features/index.js\";\nimport type { Resource } from \"../types.js\";\nimport { ResourcesPickerButton } from \"./ResourcesPicker.js\";\nimport { toTitleCaseLabel } from \"./toTitleCaseLabel.js\";\nimport { useEcommerceApi } from \"~/features/index.js\";\n\n// ---------------------------------------------------------------------------\n// ResourcePicker field renderer\n// ---------------------------------------------------------------------------\n\ndeclare module \"@webiny/app-admin/features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n \"resource-picker\": { fieldType: \"text\"; settings?: { rows?: number } };\n }\n}\n\ninterface ResourcePickerRendererConfig {\n pluginName: string;\n resourceType: string;\n}\n\nexport function createResourcePickerRenderer(config: ResourcePickerRendererConfig) {\n return observer(function ResourcePickerField({ field }: { field: IFieldVM }) {\n const { api } = useEcommerceApi(config.pluginName);\n\n if (!api) {\n return <Skeleton />;\n }\n\n return (\n <div className={\"border-sm rounded-md border-neutral-muted p-sm\"}>\n <ResourcesPickerButton\n api={api}\n resourceName={config.resourceType}\n pluginName={config.pluginName}\n value={field.value as string}\n onChange={value => field.onChange(value)}\n />\n </div>\n );\n });\n}\n\n// ---------------------------------------------------------------------------\n// EcommerceResourcePageType — IPageType implementation\n// ---------------------------------------------------------------------------\n\nexport interface EcommerceResourcePageTypeConfig {\n name: string;\n label: string;\n resourceType: string;\n previewPath: (resource: Resource) => string;\n apiName: string;\n}\n\nexport class EcommerceResourcePageType implements IPageType {\n readonly name: string;\n readonly label: string;\n\n constructor(\n private config: EcommerceResourcePageTypeConfig,\n private provider: IEcommerceApiProvider\n ) {\n this.name = config.name;\n this.label = config.label;\n }\n\n modifyForm(form: IFormModel): void {\n form.fields(fields => ({\n resourceId: fields\n .text()\n .label(toTitleCaseLabel(this.config.resourceType))\n .required()\n .renderer(\"resource-picker\")\n .afterChange((value, f) => {\n if (!value) {\n return;\n }\n void this.onResourceSelected(String(value), f);\n })\n }));\n\n form.field(\"title\").setDisabled(true);\n form.field(\"path\").setDisabled(true);\n\n form.layout(layout => [layout.row(\"resourceId\").before(\"title\")]);\n }\n\n mapFromForm(data: Record<string, unknown>, input: CreatePageParams): void {\n input.metadata = input.metadata ?? {};\n input.metadata.resourceId = data.resourceId;\n }\n\n private async onResourceSelected(resourceId: string, form: IFormModel): Promise<void> {\n const api = await this.provider.getApi(this.config.apiName);\n if (!api) {\n return;\n }\n\n const resource = await api[this.config.resourceType].findById(resourceId);\n form.field(\"title\").setValue(resource.title);\n form.field(\"title\").setDisabled(false);\n form.field(\"path\").setValue(this.config.previewPath(resource));\n form.field(\"path\").setDisabled(false);\n }\n}\n"],"names":["createResourcePickerRenderer","config","observer","field","api","useEcommerceApi","Skeleton","ResourcesPickerButton","value","EcommerceResourcePageType","provider","form","fields","toTitleCaseLabel","f","String","layout","data","input","resourceId","resource"],"mappings":";;;;;;AA2BO,SAASA,6BAA6BC,MAAoC;IAC7E,OAAOC,SAAS,SAA6B,EAAEC,KAAK,EAAuB;QACvE,MAAM,EAAEC,GAAG,EAAE,GAAGC,gBAAgBJ,OAAO,UAAU;QAEjD,IAAI,CAACG,KACD,OAAO,WAAP,GAAO,oBAACE,UAAQA;QAGpB,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAACC,uBAAqBA;YAClB,KAAKH;YACL,cAAcH,OAAO,YAAY;YACjC,YAAYA,OAAO,UAAU;YAC7B,OAAOE,MAAM,KAAK;YAClB,UAAUK,CAAAA,QAASL,MAAM,QAAQ,CAACK;;IAIlD;AACJ;AAcO,MAAMC;IAIT,YACYR,MAAuC,EACvCS,QAA+B,CACzC;aAFUT,MAAM,GAANA;aACAS,QAAQ,GAARA;QAER,IAAI,CAAC,IAAI,GAAGT,OAAO,IAAI;QACvB,IAAI,CAAC,KAAK,GAAGA,OAAO,KAAK;IAC7B;IAEA,WAAWU,IAAgB,EAAQ;QAC/BA,KAAK,MAAM,CAACC,CAAAA,SAAW;gBACnB,YAAYA,OACP,IAAI,GACJ,KAAK,CAACC,iBAAiB,IAAI,CAAC,MAAM,CAAC,YAAY,GAC/C,QAAQ,GACR,QAAQ,CAAC,mBACT,WAAW,CAAC,CAACL,OAAOM;oBACjB,IAAI,CAACN,OACD;oBAEC,IAAI,CAAC,kBAAkB,CAACO,OAAOP,QAAQM;gBAChD;YACR;QAEAH,KAAK,KAAK,CAAC,SAAS,WAAW,CAAC;QAChCA,KAAK,KAAK,CAAC,QAAQ,WAAW,CAAC;QAE/BA,KAAK,MAAM,CAACK,CAAAA,SAAU;gBAACA,OAAO,GAAG,CAAC,cAAc,MAAM,CAAC;aAAS;IACpE;IAEA,YAAYC,IAA6B,EAAEC,KAAuB,EAAQ;QACtEA,MAAM,QAAQ,GAAGA,MAAM,QAAQ,IAAI,CAAC;QACpCA,MAAM,QAAQ,CAAC,UAAU,GAAGD,KAAK,UAAU;IAC/C;IAEA,MAAc,mBAAmBE,UAAkB,EAAER,IAAgB,EAAiB;QAClF,MAAMP,MAAM,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;QAC1D,IAAI,CAACA,KACD;QAGJ,MAAMgB,WAAW,MAAMhB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,CAACe;QAC9DR,KAAK,KAAK,CAAC,SAAS,QAAQ,CAACS,SAAS,KAAK;QAC3CT,KAAK,KAAK,CAAC,SAAS,WAAW,CAAC;QAChCA,KAAK,KAAK,CAAC,QAAQ,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAACS;QACpDT,KAAK,KAAK,CAAC,QAAQ,WAAW,CAAC;IACnC;AACJ"}
1
+ {"version":3,"file":"ecommerce/components/ResourcePage.js","sources":["../../../src/ecommerce/components/ResourcePage.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Skeleton } from \"@webiny/admin-ui\";\nimport type { IFormModel, IFieldVM } from \"@webiny/app-admin\";\nimport type { IPageType } from \"~/presentation/pages/CreatePage/abstractions.js\";\nimport type { CreatePageParams } from \"~/features/pages/createPage/abstractions.js\";\nimport type { IEcommerceApiProvider } from \"~/features/index.js\";\nimport type { Resource } from \"../types.js\";\nimport { ResourcesPickerButton } from \"./ResourcesPicker.js\";\nimport { toTitleCaseLabel } from \"./toTitleCaseLabel.js\";\nimport { useEcommerceApi } from \"~/features/index.js\";\n\n// ---------------------------------------------------------------------------\n// ResourcePicker field renderer\n// ---------------------------------------------------------------------------\n\ndeclare module \"@webiny/app-admin/features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n [key: `resource-picker:${string}`]: { fieldType: \"text\"; settings?: { rows?: number } };\n }\n}\n\ninterface ResourcePickerRendererConfig {\n pluginName: string;\n resourceType: string;\n}\n\nexport function createResourcePickerRenderer(config: ResourcePickerRendererConfig) {\n return observer(function ResourcePickerField({ field }: { field: IFieldVM }) {\n const { api } = useEcommerceApi(config.pluginName);\n\n if (!api) {\n return <Skeleton />;\n }\n\n return (\n <div className={\"border-sm rounded-md border-neutral-muted p-sm\"}>\n <ResourcesPickerButton\n api={api}\n resourceName={config.resourceType}\n pluginName={config.pluginName}\n value={field.value as string}\n onChange={value => field.onChange(value)}\n />\n </div>\n );\n });\n}\n\n// ---------------------------------------------------------------------------\n// EcommerceResourcePageType — IPageType implementation\n// ---------------------------------------------------------------------------\n\nexport interface EcommerceResourcePageTypeConfig {\n name: string;\n label: string;\n resourceType: string;\n previewPath: (resource: Resource) => string;\n apiName: string;\n}\n\nexport class EcommerceResourcePageType implements IPageType {\n readonly name: string;\n readonly label: string;\n\n constructor(\n private config: EcommerceResourcePageTypeConfig,\n private provider: IEcommerceApiProvider\n ) {\n this.name = config.name;\n this.label = config.label;\n }\n\n modifyForm(form: IFormModel): void {\n form.fields(fields => ({\n resourceId: fields\n .text()\n .label(toTitleCaseLabel(this.config.resourceType))\n .required()\n .renderer(`resource-picker:${this.config.apiName}`)\n .afterChange((value, f) => {\n if (!value) {\n return;\n }\n void this.onResourceSelected(String(value), f);\n })\n }));\n\n form.field(\"title\").setDisabled(true);\n form.field(\"path\").setDisabled(true);\n\n form.layout(layout => [layout.row(\"resourceId\").before(\"title\")]);\n }\n\n mapFromForm(data: Record<string, unknown>, input: CreatePageParams): void {\n input.metadata = input.metadata ?? {};\n input.metadata.resourceId = data.resourceId;\n }\n\n private async onResourceSelected(resourceId: string, form: IFormModel): Promise<void> {\n const api = await this.provider.getApi(this.config.apiName);\n if (!api) {\n return;\n }\n\n const resource = await api[this.config.resourceType].findById(resourceId);\n form.field(\"title\").setValue(resource.title);\n form.field(\"title\").setDisabled(false);\n form.field(\"path\").setValue(this.config.previewPath(resource));\n form.field(\"path\").setDisabled(false);\n }\n}\n"],"names":["createResourcePickerRenderer","config","observer","field","api","useEcommerceApi","Skeleton","ResourcesPickerButton","value","EcommerceResourcePageType","provider","form","fields","toTitleCaseLabel","f","String","layout","data","input","resourceId","resource"],"mappings":";;;;;;AA2BO,SAASA,6BAA6BC,MAAoC;IAC7E,OAAOC,SAAS,SAA6B,EAAEC,KAAK,EAAuB;QACvE,MAAM,EAAEC,GAAG,EAAE,GAAGC,gBAAgBJ,OAAO,UAAU;QAEjD,IAAI,CAACG,KACD,OAAO,WAAP,GAAO,oBAACE,UAAQA;QAGpB,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAACC,uBAAqBA;YAClB,KAAKH;YACL,cAAcH,OAAO,YAAY;YACjC,YAAYA,OAAO,UAAU;YAC7B,OAAOE,MAAM,KAAK;YAClB,UAAUK,CAAAA,QAASL,MAAM,QAAQ,CAACK;;IAIlD;AACJ;AAcO,MAAMC;IAIT,YACYR,MAAuC,EACvCS,QAA+B,CACzC;aAFUT,MAAM,GAANA;aACAS,QAAQ,GAARA;QAER,IAAI,CAAC,IAAI,GAAGT,OAAO,IAAI;QACvB,IAAI,CAAC,KAAK,GAAGA,OAAO,KAAK;IAC7B;IAEA,WAAWU,IAAgB,EAAQ;QAC/BA,KAAK,MAAM,CAACC,CAAAA,SAAW;gBACnB,YAAYA,OACP,IAAI,GACJ,KAAK,CAACC,iBAAiB,IAAI,CAAC,MAAM,CAAC,YAAY,GAC/C,QAAQ,GACR,QAAQ,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EACjD,WAAW,CAAC,CAACL,OAAOM;oBACjB,IAAI,CAACN,OACD;oBAEC,IAAI,CAAC,kBAAkB,CAACO,OAAOP,QAAQM;gBAChD;YACR;QAEAH,KAAK,KAAK,CAAC,SAAS,WAAW,CAAC;QAChCA,KAAK,KAAK,CAAC,QAAQ,WAAW,CAAC;QAE/BA,KAAK,MAAM,CAACK,CAAAA,SAAU;gBAACA,OAAO,GAAG,CAAC,cAAc,MAAM,CAAC;aAAS;IACpE;IAEA,YAAYC,IAA6B,EAAEC,KAAuB,EAAQ;QACtEA,MAAM,QAAQ,GAAGA,MAAM,QAAQ,IAAI,CAAC;QACpCA,MAAM,QAAQ,CAAC,UAAU,GAAGD,KAAK,UAAU;IAC/C;IAEA,MAAc,mBAAmBE,UAAkB,EAAER,IAAgB,EAAiB;QAClF,MAAMP,MAAM,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;QAC1D,IAAI,CAACA,KACD;QAGJ,MAAMgB,WAAW,MAAMhB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,CAACe;QAC9DR,KAAK,KAAK,CAAC,SAAS,QAAQ,CAACS,SAAS,KAAK;QAC3CT,KAAK,KAAK,CAAC,SAAS,WAAW,CAAC;QAChCA,KAAK,KAAK,CAAC,QAAQ,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAACS;QACpDT,KAAK,KAAK,CAAC,QAAQ,WAAW,CAAC;IACnC;AACJ"}
@@ -27,7 +27,9 @@ const useEcommerceApi = (pluginName)=>{
27
27
  })
28
28
  });
29
29
  });
30
- }, []);
30
+ }, [
31
+ pluginName
32
+ ]);
31
33
  return {
32
34
  api
33
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"features/ecommerce/apis/useEcommerceApi.js","sources":["../../../../src/features/ecommerce/apis/useEcommerceApi.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { Button, useToast } from \"@webiny/admin-ui\";\nimport { useEcommerceApiProvider } from \"~/features/index.js\";\nimport type { IEcommerceApi } from \"~/ecommerce/index.js\";\nimport { useIntegrationsDialog } from \"~/modules/integrations/useIntegrationsDialog.js\";\n\nconst warningShown = new Set<string>();\n\nexport const useEcommerceApi = (pluginName: string) => {\n const { showIntegrationsDialog } = useIntegrationsDialog();\n const { showWarningToast, hideToast } = useToast();\n const provider = useEcommerceApiProvider();\n const [api, setApi] = useState<IEcommerceApi | undefined>(undefined);\n\n useEffect(() => {\n provider\n .getApi(pluginName)\n .then(api => {\n setApi(api);\n })\n .catch(error => {\n if (warningShown.has(pluginName)) {\n return;\n }\n\n warningShown.add(pluginName);\n const id = showWarningToast({\n title: \"Integration not configured!\",\n description: error.message,\n actions: (\n <Button\n variant=\"primary\"\n text={\"Configure now!\"}\n onClick={() => {\n showIntegrationsDialog();\n hideToast(id);\n }}\n />\n )\n });\n });\n }, []);\n\n return { api };\n};\n"],"names":["warningShown","Set","useEcommerceApi","pluginName","showIntegrationsDialog","useIntegrationsDialog","showWarningToast","hideToast","useToast","provider","useEcommerceApiProvider","api","setApi","useState","undefined","useEffect","error","id","Button"],"mappings":";;;;AAMA,MAAMA,eAAe,IAAIC;AAElB,MAAMC,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,sBAAsB,EAAE,GAAGC;IACnC,MAAM,EAAEC,gBAAgB,EAAEC,SAAS,EAAE,GAAGC;IACxC,MAAMC,WAAWC;IACjB,MAAM,CAACC,KAAKC,OAAO,GAAGC,SAAoCC;IAE1DC,UAAU;QACNN,SACK,MAAM,CAACN,YACP,IAAI,CAACQ,CAAAA;YACFC,OAAOD;QACX,GACC,KAAK,CAACK,CAAAA;YACH,IAAIhB,aAAa,GAAG,CAACG,aACjB;YAGJH,aAAa,GAAG,CAACG;YACjB,MAAMc,KAAKX,iBAAiB;gBACxB,OAAO;gBACP,aAAaU,MAAM,OAAO;gBAC1B,SAAS,WAAT,GACI,oBAACE,QAAMA;oBACH,SAAQ;oBACR,MAAM;oBACN,SAAS;wBACLd;wBACAG,UAAUU;oBACd;;YAGZ;QACJ;IACR,GAAG,EAAE;IAEL,OAAO;QAAEN;IAAI;AACjB"}
1
+ {"version":3,"file":"features/ecommerce/apis/useEcommerceApi.js","sources":["../../../../src/features/ecommerce/apis/useEcommerceApi.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { Button, useToast } from \"@webiny/admin-ui\";\nimport { useEcommerceApiProvider } from \"~/features/index.js\";\nimport type { IEcommerceApi } from \"~/ecommerce/index.js\";\nimport { useIntegrationsDialog } from \"~/modules/integrations/useIntegrationsDialog.js\";\n\nconst warningShown = new Set<string>();\n\nexport const useEcommerceApi = (pluginName: string) => {\n const { showIntegrationsDialog } = useIntegrationsDialog();\n const { showWarningToast, hideToast } = useToast();\n const provider = useEcommerceApiProvider();\n const [api, setApi] = useState<IEcommerceApi | undefined>(undefined);\n\n useEffect(() => {\n provider\n .getApi(pluginName)\n .then(api => {\n setApi(api);\n })\n .catch(error => {\n if (warningShown.has(pluginName)) {\n return;\n }\n\n warningShown.add(pluginName);\n const id = showWarningToast({\n title: \"Integration not configured!\",\n description: error.message,\n actions: (\n <Button\n variant=\"primary\"\n text={\"Configure now!\"}\n onClick={() => {\n showIntegrationsDialog();\n hideToast(id);\n }}\n />\n )\n });\n });\n }, [pluginName]);\n\n return { api };\n};\n"],"names":["warningShown","Set","useEcommerceApi","pluginName","showIntegrationsDialog","useIntegrationsDialog","showWarningToast","hideToast","useToast","provider","useEcommerceApiProvider","api","setApi","useState","undefined","useEffect","error","id","Button"],"mappings":";;;;AAMA,MAAMA,eAAe,IAAIC;AAElB,MAAMC,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,sBAAsB,EAAE,GAAGC;IACnC,MAAM,EAAEC,gBAAgB,EAAEC,SAAS,EAAE,GAAGC;IACxC,MAAMC,WAAWC;IACjB,MAAM,CAACC,KAAKC,OAAO,GAAGC,SAAoCC;IAE1DC,UAAU;QACNN,SACK,MAAM,CAACN,YACP,IAAI,CAACQ,CAAAA;YACFC,OAAOD;QACX,GACC,KAAK,CAACK,CAAAA;YACH,IAAIhB,aAAa,GAAG,CAACG,aACjB;YAGJH,aAAa,GAAG,CAACG;YACjB,MAAMc,KAAKX,iBAAiB;gBACxB,OAAO;gBACP,aAAaU,MAAM,OAAO;gBAC1B,SAAS,WAAT,GACI,oBAACE,QAAMA;oBACH,SAAQ;oBACR,MAAM;oBACN,SAAS;wBACLd;wBACAG,UAAUU;oBACd;;YAGZ;QACJ;IACR,GAAG;QAACd;KAAW;IAEf,OAAO;QAAEQ;IAAI;AACjB"}
@@ -1,15 +1,26 @@
1
1
  import react from "react";
2
- import { Switch } from "@webiny/admin-ui";
2
+ import { SegmentedControl } from "@webiny/admin-ui";
3
+ const ITEMS = [
4
+ {
5
+ label: "Off",
6
+ value: "false"
7
+ },
8
+ {
9
+ label: "On",
10
+ value: "true"
11
+ }
12
+ ];
3
13
  const BooleanInputRenderer = ({ value, onChange, input, label })=>{
4
14
  const { description, helperText } = input;
5
- return /*#__PURE__*/ react.createElement(Switch, {
15
+ return /*#__PURE__*/ react.createElement(SegmentedControl, {
6
16
  label: label,
7
17
  note: helperText,
8
18
  description: description,
9
- checked: value,
19
+ items: ITEMS,
20
+ value: String(value),
10
21
  onChange: (newValue)=>{
11
22
  onChange(({ value })=>{
12
- value.set(newValue);
23
+ value.set("true" === newValue);
13
24
  });
14
25
  }
15
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/BooleanInput.js","sources":["../../src/inputRenderers/BooleanInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { Switch } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\n\nexport const BooleanInputRenderer = ({\n value,\n onChange,\n input,\n label\n}: ElementInputRendererProps) => {\n const { description, helperText } = input;\n return (\n <Switch\n label={label}\n note={helperText}\n description={description}\n checked={value}\n onChange={newValue => {\n onChange(({ value }) => {\n value.set(newValue);\n });\n }}\n />\n );\n};\n"],"names":["BooleanInputRenderer","value","onChange","input","label","description","helperText","Switch","newValue"],"mappings":";;AAIO,MAAMA,uBAAuB,CAAC,EACjCC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACmB;IACxB,MAAM,EAAEC,WAAW,EAAEC,UAAU,EAAE,GAAGH;IACpC,OAAO,WAAP,GACI,oBAACI,QAAMA;QACH,OAAOH;QACP,MAAME;QACN,aAAaD;QACb,SAASJ;QACT,UAAUO,CAAAA;YACNN,SAAS,CAAC,EAAED,KAAK,EAAE;gBACfA,MAAM,GAAG,CAACO;YACd;QACJ;;AAGZ"}
1
+ {"version":3,"file":"inputRenderers/BooleanInput.js","sources":["../../src/inputRenderers/BooleanInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { SegmentedControl } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\n\nconst ITEMS = [\n { label: \"Off\", value: \"false\" },\n { label: \"On\", value: \"true\" }\n];\n\nexport const BooleanInputRenderer = ({\n value,\n onChange,\n input,\n label\n}: ElementInputRendererProps) => {\n const { description, helperText } = input;\n return (\n <SegmentedControl\n label={label}\n note={helperText}\n description={description}\n items={ITEMS}\n value={String(value)}\n onChange={newValue => {\n onChange(({ value }) => {\n value.set(newValue === \"true\");\n });\n }}\n />\n );\n};\n"],"names":["ITEMS","BooleanInputRenderer","value","onChange","input","label","description","helperText","SegmentedControl","String","newValue"],"mappings":";;AAIA,MAAMA,QAAQ;IACV;QAAE,OAAO;QAAO,OAAO;IAAQ;IAC/B;QAAE,OAAO;QAAM,OAAO;IAAO;CAChC;AAEM,MAAMC,uBAAuB,CAAC,EACjCC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACmB;IACxB,MAAM,EAAEC,WAAW,EAAEC,UAAU,EAAE,GAAGH;IACpC,OAAO,WAAP,GACI,oBAACI,kBAAgBA;QACb,OAAOH;QACP,MAAME;QACN,aAAaD;QACb,OAAON;QACP,OAAOS,OAAOP;QACd,UAAUQ,CAAAA;YACNP,SAAS,CAAC,EAAED,KAAK,EAAE;gBACfA,MAAM,GAAG,CAACQ,AAAa,WAAbA;YACd;QACJ;;AAGZ"}
@@ -1,5 +1,5 @@
1
1
  import react from "react";
2
- import { BoldAction, BulletListAction, CodeHighlightAction, Divider, FloatingLinkEditorPlugin, FontColorAction, FontColorPlugin, ItalicAction, LexicalEditorConfig, LinkAction, LinkPlugin, ListPlugin, NumberedListAction, QuoteAction, QuotePlugin, TextAlignmentAction, TypographyAction, TypographyPlugin, UnderlineAction } from "@webiny/lexical-editor";
2
+ import { BoldAction, BulletListAction, CodeHighlightAction, Divider, FloatingLinkEditorPlugin, FontColorAction, FontColorPlugin, FontSizeAction, ItalicAction, LexicalEditorConfig, LinkAction, LinkPlugin, ListPlugin, NumberedListAction, QuoteAction, QuotePlugin, TextAlignmentAction, TypographyAction, TypographyPlugin, UnderlineAction } from "@webiny/lexical-editor";
3
3
  import { CompositionScope, LexicalLinkForm } from "@webiny/app-admin";
4
4
  import { TypographyDropDown } from "./TypographyDropDown.js";
5
5
  import { ExpandEditorAction } from "./ExpandEditorAction.js";
@@ -50,6 +50,9 @@ const DefaultLexicalConfig = ()=>/*#__PURE__*/ react.createElement(react.Fragmen
50
50
  element: /*#__PURE__*/ react.createElement(FloatingLinkEditorPlugin, {
51
51
  LinkForm: LexicalLinkForm
52
52
  })
53
+ }), /*#__PURE__*/ react.createElement(ToolbarElement, {
54
+ name: "fontSize",
55
+ element: /*#__PURE__*/ react.createElement(FontSizeAction, null)
53
56
  }), /*#__PURE__*/ react.createElement(ToolbarElement, {
54
57
  name: "fontColor",
55
58
  element: /*#__PURE__*/ react.createElement(FontColorAction, null)
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/LexicalInput/DefaultLexicalConfig.js","sources":["../../../src/inputRenderers/LexicalInput/DefaultLexicalConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n TypographyAction,\n FontColorAction,\n Divider,\n BoldAction,\n ItalicAction,\n UnderlineAction,\n CodeHighlightAction,\n NumberedListAction,\n BulletListAction,\n LinkAction,\n QuoteAction,\n QuotePlugin,\n FloatingLinkEditorPlugin,\n LinkPlugin,\n ListPlugin,\n TypographyPlugin,\n FontColorPlugin,\n TextAlignmentAction\n} from \"@webiny/lexical-editor\";\nimport { CompositionScope } from \"@webiny/app-admin\";\nimport { LexicalLinkForm } from \"@webiny/app-admin\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor\";\nimport { TypographyDropDown } from \"./TypographyDropDown.js\";\nimport { ExpandEditorAction } from \"./ExpandEditorAction.js\";\n\nconst { ToolbarElement, Plugin } = LexicalEditorConfig;\n\nconst sharedPlugins = (\n <>\n <Plugin name={\"fontColor\"} element={<FontColorPlugin />} />\n <Plugin name={\"list\"} element={<ListPlugin />} />\n <Plugin name={\"typography\"} element={<TypographyPlugin />} />\n <Plugin name={\"link\"} element={<LinkPlugin />} />\n <Plugin name={\"quote\"} element={<QuotePlugin />} />\n </>\n);\n\nexport const DefaultLexicalConfig = () => {\n return (\n <>\n <CompositionScope name={\"compact\"}>\n <LexicalEditorConfig priority={\"primary\"}>\n {sharedPlugins}\n <ToolbarElement name=\"textAlignment\" element={<TextAlignmentAction />} />\n <ToolbarElement name=\"boldAction\" element={<BoldAction />} />\n <ToolbarElement name=\"italic\" element={<ItalicAction />} />\n <ToolbarElement name=\"underline\" element={<UnderlineAction />} />\n <ToolbarElement name=\"expand\" element={<ExpandEditorAction />} />\n </LexicalEditorConfig>\n </CompositionScope>\n <CompositionScope name={\"expanded\"}>\n <TypographyAction.TypographyDropDown element={<TypographyDropDown />} />\n <LexicalEditorConfig priority={\"primary\"}>\n {sharedPlugins}\n <Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n <ToolbarElement name=\"fontColor\" element={<FontColorAction />} />\n <ToolbarElement name=\"typography\" element={<TypographyAction />} />\n <ToolbarElement name=\"textAlignment\" element={<TextAlignmentAction />} />\n <ToolbarElement name=\"divider1\" element={<Divider />} />\n <ToolbarElement name=\"boldAction\" element={<BoldAction />} />\n <ToolbarElement name=\"italic\" element={<ItalicAction />} />\n <ToolbarElement name=\"underline\" element={<UnderlineAction />} />\n <ToolbarElement name=\"codeHighlight\" element={<CodeHighlightAction />} />\n <ToolbarElement name=\"divider2\" element={<Divider />} />\n <ToolbarElement name=\"numberedList\" element={<NumberedListAction />} />\n <ToolbarElement name=\"bulletList\" element={<BulletListAction />} />\n <ToolbarElement name=\"divider2\" element={<Divider />} />\n <ToolbarElement name=\"link\" element={<LinkAction />} />\n <ToolbarElement name=\"quote\" element={<QuoteAction />} />\n </LexicalEditorConfig>\n </CompositionScope>\n </>\n );\n};\n"],"names":["ToolbarElement","Plugin","LexicalEditorConfig","sharedPlugins","FontColorPlugin","ListPlugin","TypographyPlugin","LinkPlugin","QuotePlugin","DefaultLexicalConfig","CompositionScope","TextAlignmentAction","BoldAction","ItalicAction","UnderlineAction","ExpandEditorAction","TypographyAction","TypographyDropDown","FloatingLinkEditorPlugin","LexicalLinkForm","FontColorAction","Divider","CodeHighlightAction","NumberedListAction","BulletListAction","LinkAction","QuoteAction"],"mappings":";;;;;AA2BA,MAAM,EAAEA,gBAAAA,cAAc,EAAEC,QAAAA,MAAM,EAAE,GAAGC;AAEnC,MAAMC,gBAAgB,WAAHA,GACf,wDACI,oBAACF,QAAMA;IAAC,MAAM;IAAa,uBAAS,oBAACG,iBAAeA;kBACpD,oBAACH,QAAMA;IAAC,MAAM;IAAQ,uBAAS,oBAACI,YAAUA;kBAC1C,oBAACJ,QAAMA;IAAC,MAAM;IAAc,uBAAS,oBAACK,kBAAgBA;kBACtD,oBAACL,QAAMA;IAAC,MAAM;IAAQ,uBAAS,oBAACM,YAAUA;kBAC1C,oBAACN,QAAMA;IAAC,MAAM;IAAS,uBAAS,oBAACO,aAAWA;;AAI7C,MAAMC,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,qBAAmBA;QAAC,UAAU;OAC1BC,eAAaA,WAAAA,GACd,oBAACH,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACW,qBAAmBA;sBAClE,oBAACX,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACY,YAAUA;sBACtD,oBAACZ,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACa,cAAYA;sBACpD,oBAACb,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACc,iBAAeA;sBAC1D,oBAACd,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACe,oBAAkBA;wBAGlE,oBAACL,kBAAgBA;QAAC,MAAM;qBACpB,oBAACM,iBAAiB,kBAAkB;QAAC,uBAAS,oBAACC,oBAAkBA;sBACjE,oBAACf,qBAAmBA;QAAC,UAAU;OAC1BC,eAAaA,WAAAA,GACd,oBAACF,QAAMA;QACH,MAAM;QACN,uBAAS,oBAACiB,0BAAwBA;YAAC,UAAUC;;sBAEjD,oBAACnB,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACoB,iBAAeA;sBAC1D,oBAACpB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACgB,kBAAgBA;sBAC5D,oBAAChB,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACW,qBAAmBA;sBAClE,oBAACX,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACqB,SAAOA;sBACjD,oBAACrB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACY,YAAUA;sBACtD,oBAACZ,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACa,cAAYA;sBACpD,oBAACb,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACc,iBAAeA;sBAC1D,oBAACd,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACsB,qBAAmBA;sBAClE,oBAACtB,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACqB,SAAOA;sBACjD,oBAACrB,gBAAcA;QAAC,MAAK;QAAe,uBAAS,oBAACuB,oBAAkBA;sBAChE,oBAACvB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACwB,kBAAgBA;sBAC5D,oBAACxB,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACqB,SAAOA;sBACjD,oBAACrB,gBAAcA;QAAC,MAAK;QAAO,uBAAS,oBAACyB,YAAUA;sBAChD,oBAACzB,gBAAcA;QAAC,MAAK;QAAQ,uBAAS,oBAAC0B,aAAWA"}
1
+ {"version":3,"file":"inputRenderers/LexicalInput/DefaultLexicalConfig.js","sources":["../../../src/inputRenderers/LexicalInput/DefaultLexicalConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n TypographyAction,\n FontColorAction,\n Divider,\n BoldAction,\n ItalicAction,\n UnderlineAction,\n CodeHighlightAction,\n NumberedListAction,\n BulletListAction,\n LinkAction,\n QuoteAction,\n QuotePlugin,\n FloatingLinkEditorPlugin,\n LinkPlugin,\n ListPlugin,\n TypographyPlugin,\n FontColorPlugin,\n TextAlignmentAction\n} from \"@webiny/lexical-editor\";\nimport { CompositionScope } from \"@webiny/app-admin\";\nimport { LexicalLinkForm } from \"@webiny/app-admin\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor\";\nimport { TypographyDropDown } from \"./TypographyDropDown.js\";\nimport { ExpandEditorAction } from \"./ExpandEditorAction.js\";\nimport { FontSizeAction } from \"@webiny/lexical-editor\";\n\nconst { ToolbarElement, Plugin } = LexicalEditorConfig;\n\nconst sharedPlugins = (\n <>\n <Plugin name={\"fontColor\"} element={<FontColorPlugin />} />\n <Plugin name={\"list\"} element={<ListPlugin />} />\n <Plugin name={\"typography\"} element={<TypographyPlugin />} />\n <Plugin name={\"link\"} element={<LinkPlugin />} />\n <Plugin name={\"quote\"} element={<QuotePlugin />} />\n </>\n);\n\nexport const DefaultLexicalConfig = () => {\n return (\n <>\n <CompositionScope name={\"compact\"}>\n <LexicalEditorConfig priority={\"primary\"}>\n {sharedPlugins}\n <ToolbarElement name=\"textAlignment\" element={<TextAlignmentAction />} />\n <ToolbarElement name=\"boldAction\" element={<BoldAction />} />\n <ToolbarElement name=\"italic\" element={<ItalicAction />} />\n <ToolbarElement name=\"underline\" element={<UnderlineAction />} />\n <ToolbarElement name=\"expand\" element={<ExpandEditorAction />} />\n </LexicalEditorConfig>\n </CompositionScope>\n <CompositionScope name={\"expanded\"}>\n <TypographyAction.TypographyDropDown element={<TypographyDropDown />} />\n <LexicalEditorConfig priority={\"primary\"}>\n {sharedPlugins}\n <Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n <ToolbarElement name=\"fontSize\" element={<FontSizeAction />} />\n <ToolbarElement name=\"fontColor\" element={<FontColorAction />} />\n <ToolbarElement name=\"typography\" element={<TypographyAction />} />\n <ToolbarElement name=\"textAlignment\" element={<TextAlignmentAction />} />\n <ToolbarElement name=\"divider1\" element={<Divider />} />\n <ToolbarElement name=\"boldAction\" element={<BoldAction />} />\n <ToolbarElement name=\"italic\" element={<ItalicAction />} />\n <ToolbarElement name=\"underline\" element={<UnderlineAction />} />\n <ToolbarElement name=\"codeHighlight\" element={<CodeHighlightAction />} />\n <ToolbarElement name=\"divider2\" element={<Divider />} />\n <ToolbarElement name=\"numberedList\" element={<NumberedListAction />} />\n <ToolbarElement name=\"bulletList\" element={<BulletListAction />} />\n <ToolbarElement name=\"divider2\" element={<Divider />} />\n <ToolbarElement name=\"link\" element={<LinkAction />} />\n <ToolbarElement name=\"quote\" element={<QuoteAction />} />\n </LexicalEditorConfig>\n </CompositionScope>\n </>\n );\n};\n"],"names":["ToolbarElement","Plugin","LexicalEditorConfig","sharedPlugins","FontColorPlugin","ListPlugin","TypographyPlugin","LinkPlugin","QuotePlugin","DefaultLexicalConfig","CompositionScope","TextAlignmentAction","BoldAction","ItalicAction","UnderlineAction","ExpandEditorAction","TypographyAction","TypographyDropDown","FloatingLinkEditorPlugin","LexicalLinkForm","FontSizeAction","FontColorAction","Divider","CodeHighlightAction","NumberedListAction","BulletListAction","LinkAction","QuoteAction"],"mappings":";;;;;AA4BA,MAAM,EAAEA,gBAAAA,cAAc,EAAEC,QAAAA,MAAM,EAAE,GAAGC;AAEnC,MAAMC,gBAAgB,WAAHA,GACf,wDACI,oBAACF,QAAMA;IAAC,MAAM;IAAa,uBAAS,oBAACG,iBAAeA;kBACpD,oBAACH,QAAMA;IAAC,MAAM;IAAQ,uBAAS,oBAACI,YAAUA;kBAC1C,oBAACJ,QAAMA;IAAC,MAAM;IAAc,uBAAS,oBAACK,kBAAgBA;kBACtD,oBAACL,QAAMA;IAAC,MAAM;IAAQ,uBAAS,oBAACM,YAAUA;kBAC1C,oBAACN,QAAMA;IAAC,MAAM;IAAS,uBAAS,oBAACO,aAAWA;;AAI7C,MAAMC,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,qBAAmBA;QAAC,UAAU;OAC1BC,eAAaA,WAAAA,GACd,oBAACH,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACW,qBAAmBA;sBAClE,oBAACX,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACY,YAAUA;sBACtD,oBAACZ,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACa,cAAYA;sBACpD,oBAACb,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACc,iBAAeA;sBAC1D,oBAACd,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACe,oBAAkBA;wBAGlE,oBAACL,kBAAgBA;QAAC,MAAM;qBACpB,oBAACM,iBAAiB,kBAAkB;QAAC,uBAAS,oBAACC,oBAAkBA;sBACjE,oBAACf,qBAAmBA;QAAC,UAAU;OAC1BC,eAAaA,WAAAA,GACd,oBAACF,QAAMA;QACH,MAAM;QACN,uBAAS,oBAACiB,0BAAwBA;YAAC,UAAUC;;sBAEjD,oBAACnB,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACoB,gBAAcA;sBACxD,oBAACpB,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACqB,iBAAeA;sBAC1D,oBAACrB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACgB,kBAAgBA;sBAC5D,oBAAChB,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACW,qBAAmBA;sBAClE,oBAACX,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACsB,SAAOA;sBACjD,oBAACtB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACY,YAAUA;sBACtD,oBAACZ,gBAAcA;QAAC,MAAK;QAAS,uBAAS,oBAACa,cAAYA;sBACpD,oBAACb,gBAAcA;QAAC,MAAK;QAAY,uBAAS,oBAACc,iBAAeA;sBAC1D,oBAACd,gBAAcA;QAAC,MAAK;QAAgB,uBAAS,oBAACuB,qBAAmBA;sBAClE,oBAACvB,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACsB,SAAOA;sBACjD,oBAACtB,gBAAcA;QAAC,MAAK;QAAe,uBAAS,oBAACwB,oBAAkBA;sBAChE,oBAACxB,gBAAcA;QAAC,MAAK;QAAa,uBAAS,oBAACyB,kBAAgBA;sBAC5D,oBAACzB,gBAAcA;QAAC,MAAK;QAAW,uBAAS,oBAACsB,SAAOA;sBACjD,oBAACtB,gBAAcA;QAAC,MAAK;QAAO,uBAAS,oBAAC0B,YAAUA;sBAChD,oBAAC1B,gBAAcA;QAAC,MAAK;QAAQ,uBAAS,oBAAC2B,aAAWA"}
@@ -4,7 +4,10 @@ const ExpandEditorAction = ()=>{
4
4
  const { setExpanded } = useExpandedEditor();
5
5
  return /*#__PURE__*/ react.createElement("button", {
6
6
  onClick: ()=>setExpanded((expanded)=>!expanded),
7
- className: "popup-item absolute right-0 z-1",
7
+ className: "popup-item absolute z-1",
8
+ style: {
9
+ right: 5
10
+ },
8
11
  "aria-label": "Expand editor"
9
12
  }, /*#__PURE__*/ react.createElement("i", {
10
13
  className: "format expand"
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/LexicalInput/ExpandEditorAction.js","sources":["../../../src/inputRenderers/LexicalInput/ExpandEditorAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { useExpandedEditor } from \"./ExpandedEditor.js\";\n\nexport const ExpandEditorAction = () => {\n const { setExpanded } = useExpandedEditor();\n\n return (\n <button\n onClick={() => setExpanded(expanded => !expanded)}\n className={\"popup-item absolute right-0 z-1\"}\n aria-label=\"Expand editor\"\n >\n <i className=\"format expand\" />\n </button>\n );\n};\n"],"names":["ExpandEditorAction","setExpanded","useExpandedEditor","expanded"],"mappings":";;AAGO,MAAMA,qBAAqB;IAC9B,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExB,OAAO,WAAP,GACI,oBAAC;QACG,SAAS,IAAMD,YAAYE,CAAAA,WAAY,CAACA;QACxC,WAAW;QACX,cAAW;qBAEX,oBAAC;QAAE,WAAU;;AAGzB"}
1
+ {"version":3,"file":"inputRenderers/LexicalInput/ExpandEditorAction.js","sources":["../../../src/inputRenderers/LexicalInput/ExpandEditorAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { useExpandedEditor } from \"./ExpandedEditor.js\";\n\nexport const ExpandEditorAction = () => {\n const { setExpanded } = useExpandedEditor();\n\n return (\n <button\n onClick={() => setExpanded(expanded => !expanded)}\n className={\"popup-item absolute z-1\"}\n style={{ right: 5 }}\n aria-label=\"Expand editor\"\n >\n <i className=\"format expand\" />\n </button>\n );\n};\n"],"names":["ExpandEditorAction","setExpanded","useExpandedEditor","expanded"],"mappings":";;AAGO,MAAMA,qBAAqB;IAC9B,MAAM,EAAEC,WAAW,EAAE,GAAGC;IAExB,OAAO,WAAP,GACI,oBAAC;QACG,SAAS,IAAMD,YAAYE,CAAAA,WAAY,CAACA;QACxC,WAAW;QACX,OAAO;YAAE,OAAO;QAAE;QAClB,cAAW;qBAEX,oBAAC;QAAE,WAAU;;AAGzB"}
@@ -28,6 +28,7 @@ const LexicalEditorComponent = (props)=>{
28
28
  const editorTheme = {
29
29
  colors: theme?.colors ?? [],
30
30
  typography: theme?.typography ?? {},
31
+ fontSizes: theme?.fontSizes ?? [],
31
32
  tokens: lexicalTokens
32
33
  };
33
34
  return /*#__PURE__*/ react.createElement(LexicalEditor, {
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/LexicalInput/LexicalEditor.js","sources":["../../../src/inputRenderers/LexicalInput/LexicalEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditor as BaseLexicalEditor } from \"@webiny/app-admin\";\nimport { StaticToolbar } from \"@webiny/lexical-editor\";\nimport type { EditorTheme } from \"@webiny/lexical-theme\";\nimport { createLexicalTokens } from \"@webiny/lexical-theme/createLexicalEditorTokens.js\";\nimport { useWebsiteBuilderTheme } from \"~/BaseEditor/components/index.js\";\nimport \"./wbStaticToolbar.css\";\nimport { CompositionScope } from \"@webiny/app-admin\";\n\nconst placeholderStyles: React.CSSProperties = { position: \"absolute\", top: 40, left: 25 };\n\nconst contentEditableStyles: React.CSSProperties = {\n minHeight: 200,\n display: \"block\",\n padding: 10\n};\n\nconst styles: React.CSSProperties = {\n backgroundColor: \"#fff\",\n border: \"1px solid #e1e1e1\",\n padding: \"10px 14px\",\n minHeight: 200,\n maxHeight: 350,\n fontFamily: \"var(--wb-theme-font-family)\"\n};\n\nconst lexicalTokens = createLexicalTokens(\"wb-lx-\");\n\nexport type LexicalEditorProps = Omit<React.ComponentProps<typeof BaseLexicalEditor>, \"theme\">;\n\nconst LexicalEditorComponent = (props: LexicalEditorProps) => {\n const { theme } = useWebsiteBuilderTheme();\n\n const editorTheme: EditorTheme = {\n colors: theme?.colors ?? [],\n typography: theme?.typography ?? {},\n tokens: lexicalTokens\n };\n\n return (\n <BaseLexicalEditor\n {...props}\n staticToolbar={<StaticToolbar className={\"wb-static-toolbar\"} />}\n tag={\"p\"}\n placeholder={props?.placeholder || \"Enter your text here...\"}\n placeholderStyles={placeholderStyles}\n contentEditableStyles={contentEditableStyles}\n styles={styles}\n theme={editorTheme}\n />\n );\n};\n\nconst ExpandedLexicalEditor = (props: LexicalEditorProps) => {\n return (\n <CompositionScope name={\"expanded\"}>\n <LexicalEditorComponent {...props} />\n </CompositionScope>\n );\n};\n\nconst CompactLexicalEditor = (props: LexicalEditorProps) => {\n return (\n <CompositionScope name={\"compact\"}>\n <LexicalEditorComponent {...props} />\n </CompositionScope>\n );\n};\n\nexport const LexicalEditor = {\n Expanded: ExpandedLexicalEditor,\n Compact: CompactLexicalEditor\n};\n"],"names":["placeholderStyles","contentEditableStyles","styles","lexicalTokens","createLexicalTokens","LexicalEditorComponent","props","theme","useWebsiteBuilderTheme","editorTheme","BaseLexicalEditor","StaticToolbar","ExpandedLexicalEditor","CompositionScope","CompactLexicalEditor","LexicalEditor"],"mappings":";;;;;;AASA,MAAMA,oBAAyC;IAAE,UAAU;IAAY,KAAK;IAAI,MAAM;AAAG;AAEzF,MAAMC,wBAA6C;IAC/C,WAAW;IACX,SAAS;IACT,SAAS;AACb;AAEA,MAAMC,SAA8B;IAChC,iBAAiB;IACjB,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,YAAY;AAChB;AAEA,MAAMC,gBAAgBC,oBAAoB;AAI1C,MAAMC,yBAAyB,CAACC;IAC5B,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAElB,MAAMC,cAA2B;QAC7B,QAAQF,OAAO,UAAU,EAAE;QAC3B,YAAYA,OAAO,cAAc,CAAC;QAClC,QAAQJ;IACZ;IAEA,OAAO,WAAP,GACI,oBAACO,eAAiBA;QACb,GAAGJ,KAAK;QACT,6BAAe,oBAACK,eAAaA;YAAC,WAAW;;QACzC,KAAK;QACL,aAAaL,OAAO,eAAe;QACnC,mBAAmBN;QACnB,uBAAuBC;QACvB,QAAQC;QACR,OAAOO;;AAGnB;AAEA,MAAMG,wBAAwB,CAACN,QACpB,WAAP,GACI,oBAACO,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,wBAA2BC;AAKxC,MAAMQ,uBAAuB,CAACR,QACnB,WAAP,GACI,oBAACO,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,wBAA2BC;AAKjC,MAAMS,8BAAgB;IACzB,UAAUH;IACV,SAASE;AACb"}
1
+ {"version":3,"file":"inputRenderers/LexicalInput/LexicalEditor.js","sources":["../../../src/inputRenderers/LexicalInput/LexicalEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditor as BaseLexicalEditor } from \"@webiny/app-admin\";\nimport { StaticToolbar } from \"@webiny/lexical-editor\";\nimport type { EditorTheme } from \"@webiny/lexical-theme\";\nimport { createLexicalTokens } from \"@webiny/lexical-theme/createLexicalEditorTokens.js\";\nimport { useWebsiteBuilderTheme } from \"~/BaseEditor/components/index.js\";\nimport \"./wbStaticToolbar.css\";\nimport { CompositionScope } from \"@webiny/app-admin\";\n\nconst placeholderStyles: React.CSSProperties = { position: \"absolute\", top: 40, left: 25 };\n\nconst contentEditableStyles: React.CSSProperties = {\n minHeight: 200,\n display: \"block\",\n padding: 10\n};\n\nconst styles: React.CSSProperties = {\n backgroundColor: \"#fff\",\n border: \"1px solid #e1e1e1\",\n padding: \"10px 14px\",\n minHeight: 200,\n maxHeight: 350,\n fontFamily: \"var(--wb-theme-font-family)\"\n};\n\nconst lexicalTokens = createLexicalTokens(\"wb-lx-\");\n\nexport type LexicalEditorProps = Omit<React.ComponentProps<typeof BaseLexicalEditor>, \"theme\">;\n\nconst LexicalEditorComponent = (props: LexicalEditorProps) => {\n const { theme } = useWebsiteBuilderTheme();\n\n const editorTheme: EditorTheme = {\n colors: theme?.colors ?? [],\n typography: theme?.typography ?? {},\n fontSizes: theme?.fontSizes ?? [],\n tokens: lexicalTokens\n };\n\n return (\n <BaseLexicalEditor\n {...props}\n staticToolbar={<StaticToolbar className={\"wb-static-toolbar\"} />}\n tag={\"p\"}\n placeholder={props?.placeholder || \"Enter your text here...\"}\n placeholderStyles={placeholderStyles}\n contentEditableStyles={contentEditableStyles}\n styles={styles}\n theme={editorTheme}\n />\n );\n};\n\nconst ExpandedLexicalEditor = (props: LexicalEditorProps) => {\n return (\n <CompositionScope name={\"expanded\"}>\n <LexicalEditorComponent {...props} />\n </CompositionScope>\n );\n};\n\nconst CompactLexicalEditor = (props: LexicalEditorProps) => {\n return (\n <CompositionScope name={\"compact\"}>\n <LexicalEditorComponent {...props} />\n </CompositionScope>\n );\n};\n\nexport const LexicalEditor = {\n Expanded: ExpandedLexicalEditor,\n Compact: CompactLexicalEditor\n};\n"],"names":["placeholderStyles","contentEditableStyles","styles","lexicalTokens","createLexicalTokens","LexicalEditorComponent","props","theme","useWebsiteBuilderTheme","editorTheme","BaseLexicalEditor","StaticToolbar","ExpandedLexicalEditor","CompositionScope","CompactLexicalEditor","LexicalEditor"],"mappings":";;;;;;AASA,MAAMA,oBAAyC;IAAE,UAAU;IAAY,KAAK;IAAI,MAAM;AAAG;AAEzF,MAAMC,wBAA6C;IAC/C,WAAW;IACX,SAAS;IACT,SAAS;AACb;AAEA,MAAMC,SAA8B;IAChC,iBAAiB;IACjB,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,YAAY;AAChB;AAEA,MAAMC,gBAAgBC,oBAAoB;AAI1C,MAAMC,yBAAyB,CAACC;IAC5B,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAElB,MAAMC,cAA2B;QAC7B,QAAQF,OAAO,UAAU,EAAE;QAC3B,YAAYA,OAAO,cAAc,CAAC;QAClC,WAAWA,OAAO,aAAa,EAAE;QACjC,QAAQJ;IACZ;IAEA,OAAO,WAAP,GACI,oBAACO,eAAiBA;QACb,GAAGJ,KAAK;QACT,6BAAe,oBAACK,eAAaA;YAAC,WAAW;;QACzC,KAAK;QACL,aAAaL,OAAO,eAAe;QACnC,mBAAmBN;QACnB,uBAAuBC;QACvB,QAAQC;QACR,OAAOO;;AAGnB;AAEA,MAAMG,wBAAwB,CAACN,QACpB,WAAP,GACI,oBAACO,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,wBAA2BC;AAKxC,MAAMQ,uBAAuB,CAACR,QACnB,WAAP,GACI,oBAACO,kBAAgBA;QAAC,MAAM;qBACpB,oBAACR,wBAA2BC;AAKjC,MAAMS,8BAAgB;IACzB,UAAUH;IACV,SAASE;AACb"}
@@ -29,6 +29,7 @@ const EditorDialog = (props)=>{
29
29
  "data-hover-manager": "ignore",
30
30
  title: `Edit ${props.input.label}`,
31
31
  dismissible: false,
32
+ scrollable: false,
32
33
  showCloseButton: false,
33
34
  actions: /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Dialog.CancelAction, {
34
35
  onClick: props.onClose
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/LexicalInput/LexicalInput.js","sources":["../../../src/inputRenderers/LexicalInput/LexicalInput.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { Dialog, FormComponentLabel } from \"@webiny/admin-ui\";\nimport type { RichTextValueWithHtml } from \"@webiny/app-admin\";\nimport { LexicalEditor } from \"./LexicalEditor.js\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\nimport {\n ExpandedEditorProvider,\n useExpandedEditor\n} from \"~/inputRenderers/LexicalInput/ExpandedEditor.js\";\n\ntype LexicalInputRendererProps = Omit<ElementInputRendererProps, \"onChange\" | \"metadata\"> & {\n onChange: (value: RichTextValueWithHtml) => void;\n};\n\nexport const LexicalInputRenderer = (props: ElementInputRendererProps) => {\n const onChange = (lexicalValue: RichTextValueWithHtml) => {\n props.onChange(({ value }) => {\n value.set(lexicalValue);\n });\n };\n\n const value = props.value ?? {};\n\n return (\n <ExpandedEditorProvider>\n <ExpandableLexicalInputRenderer {...props} value={value} onChange={onChange} />\n </ExpandedEditorProvider>\n );\n};\n\ninterface EditorDialogProps extends Omit<LexicalInputRendererProps, \"onPreviewChange\" | \"label\"> {\n open: boolean;\n onClose: () => void;\n}\n\nconst EditorDialog = (props: EditorDialogProps) => {\n const [localValue, setLocalValue] = useState(props.value);\n\n useEffect(() => {\n setLocalValue(props.value);\n }, [props.value]);\n\n return (\n <Dialog\n id={\"lexical-editor-dialog\"}\n open={props.open}\n className={\"w-[900px] max-w-[900px] overflow-visible\"}\n data-hover-manager={\"ignore\"}\n title={`Edit ${props.input.label}`}\n dismissible={false}\n showCloseButton={false}\n actions={\n <>\n <Dialog.CancelAction onClick={props.onClose} />\n <Dialog.ConfirmAction\n text={\"Save Changes\"}\n onClick={() => {\n props.onChange(localValue);\n }}\n />\n </>\n }\n >\n <LexicalEditor.Expanded value={localValue} onChange={setLocalValue} />\n </Dialog>\n );\n};\n\nconst ExpandableLexicalInputRenderer = ({\n value,\n onChange,\n input,\n label\n}: LexicalInputRendererProps) => {\n const { isExpanded, setExpanded } = useExpandedEditor();\n\n const applyChanges = useCallback(\n (newValue: any) => {\n onChange(newValue);\n setExpanded(false);\n },\n [onChange, setExpanded]\n );\n\n return (\n <>\n <FormComponentLabel text={label} />\n <LexicalEditor.Compact value={value} onChange={onChange} key={input.name} />\n <EditorDialog\n open={isExpanded}\n value={value}\n onChange={applyChanges}\n onClose={() => setExpanded(false)}\n input={input}\n />\n </>\n );\n};\n"],"names":["LexicalInputRenderer","props","onChange","lexicalValue","value","ExpandedEditorProvider","ExpandableLexicalInputRenderer","EditorDialog","localValue","setLocalValue","useState","useEffect","Dialog","LexicalEditor","input","label","isExpanded","setExpanded","useExpandedEditor","applyChanges","useCallback","newValue","FormComponentLabel"],"mappings":";;;;AAcO,MAAMA,uBAAuB,CAACC;IACjC,MAAMC,WAAW,CAACC;QACdF,MAAM,QAAQ,CAAC,CAAC,EAAEG,KAAK,EAAE;YACrBA,MAAM,GAAG,CAACD;QACd;IACJ;IAEA,MAAMC,QAAQH,MAAM,KAAK,IAAI,CAAC;IAE9B,OAAO,WAAP,GACI,oBAACI,wBAAsBA,MAAAA,WAAAA,GACnB,oBAACC,gCAA8BA;QAAE,GAAGL,KAAK;QAAE,OAAOG;QAAO,UAAUF;;AAG/E;AAOA,MAAMK,eAAe,CAACN;IAClB,MAAM,CAACO,YAAYC,cAAc,GAAGC,SAAST,MAAM,KAAK;IAExDU,UAAU;QACNF,cAAcR,MAAM,KAAK;IAC7B,GAAG;QAACA,MAAM,KAAK;KAAC;IAEhB,OAAO,WAAP,GACI,oBAACW,QAAMA;QACH,IAAI;QACJ,MAAMX,MAAM,IAAI;QAChB,WAAW;QACX,sBAAoB;QACpB,OAAO,CAAC,KAAK,EAAEA,MAAM,KAAK,CAAC,KAAK,EAAE;QAClC,aAAa;QACb,iBAAiB;QACjB,uBACI,wDACI,oBAACW,OAAO,YAAY;YAAC,SAASX,MAAM,OAAO;0BAC3C,oBAACW,OAAO,aAAa;YACjB,MAAM;YACN,SAAS;gBACLX,MAAM,QAAQ,CAACO;YACnB;;qBAKZ,oBAACK,cAAc,QAAQ;QAAC,OAAOL;QAAY,UAAUC;;AAGjE;AAEA,MAAMH,iCAAiC,CAAC,EACpCF,KAAK,EACLF,QAAQ,EACRY,KAAK,EACLC,KAAK,EACmB;IACxB,MAAM,EAAEC,UAAU,EAAEC,WAAW,EAAE,GAAGC;IAEpC,MAAMC,eAAeC,YACjB,CAACC;QACGnB,SAASmB;QACTJ,YAAY;IAChB,GACA;QAACf;QAAUe;KAAY;IAG3B,OAAO,WAAP,GACI,wDACI,oBAACK,oBAAkBA;QAAC,MAAMP;sBAC1B,oBAACF,cAAc,OAAO;QAAC,OAAOT;QAAO,UAAUF;QAAU,KAAKY,MAAM,IAAI;sBACxE,oBAACP,cAAYA;QACT,MAAMS;QACN,OAAOZ;QACP,UAAUe;QACV,SAAS,IAAMF,YAAY;QAC3B,OAAOH;;AAIvB"}
1
+ {"version":3,"file":"inputRenderers/LexicalInput/LexicalInput.js","sources":["../../../src/inputRenderers/LexicalInput/LexicalInput.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { Dialog, FormComponentLabel } from \"@webiny/admin-ui\";\nimport type { RichTextValueWithHtml } from \"@webiny/app-admin\";\nimport { LexicalEditor } from \"./LexicalEditor.js\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\nimport {\n ExpandedEditorProvider,\n useExpandedEditor\n} from \"~/inputRenderers/LexicalInput/ExpandedEditor.js\";\n\ntype LexicalInputRendererProps = Omit<ElementInputRendererProps, \"onChange\" | \"metadata\"> & {\n onChange: (value: RichTextValueWithHtml) => void;\n};\n\nexport const LexicalInputRenderer = (props: ElementInputRendererProps) => {\n const onChange = (lexicalValue: RichTextValueWithHtml) => {\n props.onChange(({ value }) => {\n value.set(lexicalValue);\n });\n };\n\n const value = props.value ?? {};\n\n return (\n <ExpandedEditorProvider>\n <ExpandableLexicalInputRenderer {...props} value={value} onChange={onChange} />\n </ExpandedEditorProvider>\n );\n};\n\ninterface EditorDialogProps extends Omit<LexicalInputRendererProps, \"onPreviewChange\" | \"label\"> {\n open: boolean;\n onClose: () => void;\n}\n\nconst EditorDialog = (props: EditorDialogProps) => {\n const [localValue, setLocalValue] = useState(props.value);\n\n useEffect(() => {\n setLocalValue(props.value);\n }, [props.value]);\n\n return (\n <Dialog\n id={\"lexical-editor-dialog\"}\n open={props.open}\n className={\"w-[900px] max-w-[900px] overflow-visible\"}\n data-hover-manager={\"ignore\"}\n title={`Edit ${props.input.label}`}\n dismissible={false}\n scrollable={false}\n showCloseButton={false}\n actions={\n <>\n <Dialog.CancelAction onClick={props.onClose} />\n <Dialog.ConfirmAction\n text={\"Save Changes\"}\n onClick={() => {\n props.onChange(localValue);\n }}\n />\n </>\n }\n >\n <LexicalEditor.Expanded value={localValue} onChange={setLocalValue} />\n </Dialog>\n );\n};\n\nconst ExpandableLexicalInputRenderer = ({\n value,\n onChange,\n input,\n label\n}: LexicalInputRendererProps) => {\n const { isExpanded, setExpanded } = useExpandedEditor();\n\n const applyChanges = useCallback(\n (newValue: any) => {\n onChange(newValue);\n setExpanded(false);\n },\n [onChange, setExpanded]\n );\n\n return (\n <>\n <FormComponentLabel text={label} />\n <LexicalEditor.Compact value={value} onChange={onChange} key={input.name} />\n <EditorDialog\n open={isExpanded}\n value={value}\n onChange={applyChanges}\n onClose={() => setExpanded(false)}\n input={input}\n />\n </>\n );\n};\n"],"names":["LexicalInputRenderer","props","onChange","lexicalValue","value","ExpandedEditorProvider","ExpandableLexicalInputRenderer","EditorDialog","localValue","setLocalValue","useState","useEffect","Dialog","LexicalEditor","input","label","isExpanded","setExpanded","useExpandedEditor","applyChanges","useCallback","newValue","FormComponentLabel"],"mappings":";;;;AAcO,MAAMA,uBAAuB,CAACC;IACjC,MAAMC,WAAW,CAACC;QACdF,MAAM,QAAQ,CAAC,CAAC,EAAEG,KAAK,EAAE;YACrBA,MAAM,GAAG,CAACD;QACd;IACJ;IAEA,MAAMC,QAAQH,MAAM,KAAK,IAAI,CAAC;IAE9B,OAAO,WAAP,GACI,oBAACI,wBAAsBA,MAAAA,WAAAA,GACnB,oBAACC,gCAA8BA;QAAE,GAAGL,KAAK;QAAE,OAAOG;QAAO,UAAUF;;AAG/E;AAOA,MAAMK,eAAe,CAACN;IAClB,MAAM,CAACO,YAAYC,cAAc,GAAGC,SAAST,MAAM,KAAK;IAExDU,UAAU;QACNF,cAAcR,MAAM,KAAK;IAC7B,GAAG;QAACA,MAAM,KAAK;KAAC;IAEhB,OAAO,WAAP,GACI,oBAACW,QAAMA;QACH,IAAI;QACJ,MAAMX,MAAM,IAAI;QAChB,WAAW;QACX,sBAAoB;QACpB,OAAO,CAAC,KAAK,EAAEA,MAAM,KAAK,CAAC,KAAK,EAAE;QAClC,aAAa;QACb,YAAY;QACZ,iBAAiB;QACjB,uBACI,wDACI,oBAACW,OAAO,YAAY;YAAC,SAASX,MAAM,OAAO;0BAC3C,oBAACW,OAAO,aAAa;YACjB,MAAM;YACN,SAAS;gBACLX,MAAM,QAAQ,CAACO;YACnB;;qBAKZ,oBAACK,cAAc,QAAQ;QAAC,OAAOL;QAAY,UAAUC;;AAGjE;AAEA,MAAMH,iCAAiC,CAAC,EACpCF,KAAK,EACLF,QAAQ,EACRY,KAAK,EACLC,KAAK,EACmB;IACxB,MAAM,EAAEC,UAAU,EAAEC,WAAW,EAAE,GAAGC;IAEpC,MAAMC,eAAeC,YACjB,CAACC;QACGnB,SAASmB;QACTJ,YAAY;IAChB,GACA;QAACf;QAAUe;KAAY;IAG3B,OAAO,WAAP,GACI,wDACI,oBAACK,oBAAkBA;QAAC,MAAMP;sBAC1B,oBAACF,cAAc,OAAO;QAAC,OAAOT;QAAO,UAAUF;QAAU,KAAKY,MAAM,IAAI;sBACxE,oBAACP,cAAYA;QACT,MAAMS;QACN,OAAOZ;QACP,UAAUe;QACV,SAAS,IAAMF,YAAY;QAC3B,OAAOH;;AAIvB"}
@@ -260,5 +260,5 @@
260
260
  }
261
261
 
262
262
  .wb-static-toolbar i.expand {
263
- /* background-image: url("./icons/fullscreen.svg"); */
263
+ background-image: url("./icons/fullscreen.svg");
264
264
  }
@@ -12,12 +12,14 @@ const TextInputRenderer = ({ value, onChange, onPreviewChange, input, label })=>
12
12
  });
13
13
  };
14
14
  return /*#__PURE__*/ react.createElement(Input, {
15
+ size: "md",
16
+ variant: "secondary",
15
17
  value: value,
16
18
  onChange: previewValue,
17
19
  onBlur: (e)=>commitValue(e.currentTarget.value),
18
20
  onEnter: (e)=>commitValue(e.currentTarget.value),
19
21
  label: label,
20
- description: input.description,
22
+ hint: input.description,
21
23
  note: input.helperText
22
24
  });
23
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/TextInput.js","sources":["../../src/inputRenderers/TextInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\n\nexport const TextInputRenderer = ({\n value,\n onChange,\n onPreviewChange,\n input,\n label\n}: ElementInputRendererProps) => {\n const commitValue = (newValue: string) => {\n onChange(({ value }) => {\n value.set(newValue);\n });\n };\n\n const previewValue = (newValue: string) => {\n onPreviewChange(({ value }) => {\n value.set(newValue);\n });\n };\n\n return (\n <Input\n value={value}\n onChange={previewValue}\n onBlur={e => commitValue(e.currentTarget.value)}\n onEnter={e => commitValue(e.currentTarget.value)}\n label={label}\n description={input.description}\n note={input.helperText}\n />\n );\n};\n"],"names":["TextInputRenderer","value","onChange","onPreviewChange","input","label","commitValue","newValue","previewValue","Input","e"],"mappings":";;AAIO,MAAMA,oBAAoB,CAAC,EAC9BC,KAAK,EACLC,QAAQ,EACRC,eAAe,EACfC,KAAK,EACLC,KAAK,EACmB;IACxB,MAAMC,cAAc,CAACC;QACjBL,SAAS,CAAC,EAAED,KAAK,EAAE;YACfA,MAAM,GAAG,CAACM;QACd;IACJ;IAEA,MAAMC,eAAe,CAACD;QAClBJ,gBAAgB,CAAC,EAAEF,KAAK,EAAE;YACtBA,MAAM,GAAG,CAACM;QACd;IACJ;IAEA,OAAO,WAAP,GACI,oBAACE,OAAKA;QACF,OAAOR;QACP,UAAUO;QACV,QAAQE,CAAAA,IAAKJ,YAAYI,EAAE,aAAa,CAAC,KAAK;QAC9C,SAASA,CAAAA,IAAKJ,YAAYI,EAAE,aAAa,CAAC,KAAK;QAC/C,OAAOL;QACP,aAAaD,MAAM,WAAW;QAC9B,MAAMA,MAAM,UAAU;;AAGlC"}
1
+ {"version":3,"file":"inputRenderers/TextInput.js","sources":["../../src/inputRenderers/TextInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\n\nexport const TextInputRenderer = ({\n value,\n onChange,\n onPreviewChange,\n input,\n label\n}: ElementInputRendererProps) => {\n const commitValue = (newValue: string) => {\n onChange(({ value }) => {\n value.set(newValue);\n });\n };\n\n const previewValue = (newValue: string) => {\n onPreviewChange(({ value }) => {\n value.set(newValue);\n });\n };\n\n return (\n <Input\n size={\"md\"}\n variant={\"secondary\"}\n value={value}\n onChange={previewValue}\n onBlur={e => commitValue(e.currentTarget.value)}\n onEnter={e => commitValue(e.currentTarget.value)}\n label={label}\n hint={input.description}\n note={input.helperText}\n />\n );\n};\n"],"names":["TextInputRenderer","value","onChange","onPreviewChange","input","label","commitValue","newValue","previewValue","Input","e"],"mappings":";;AAIO,MAAMA,oBAAoB,CAAC,EAC9BC,KAAK,EACLC,QAAQ,EACRC,eAAe,EACfC,KAAK,EACLC,KAAK,EACmB;IACxB,MAAMC,cAAc,CAACC;QACjBL,SAAS,CAAC,EAAED,KAAK,EAAE;YACfA,MAAM,GAAG,CAACM;QACd;IACJ;IAEA,MAAMC,eAAe,CAACD;QAClBJ,gBAAgB,CAAC,EAAEF,KAAK,EAAE;YACtBA,MAAM,GAAG,CAACM;QACd;IACJ;IAEA,OAAO,WAAP,GACI,oBAACE,OAAKA;QACF,MAAM;QACN,SAAS;QACT,OAAOR;QACP,UAAUO;QACV,QAAQE,CAAAA,IAAKJ,YAAYI,EAAE,aAAa,CAAC,KAAK;QAC9C,SAASA,CAAAA,IAAKJ,YAAYI,EAAE,aAAa,CAAC,KAAK;QAC/C,OAAOL;QACP,MAAMD,MAAM,WAAW;QACvB,MAAMA,MAAM,UAAU;;AAGlC"}
@@ -279,6 +279,7 @@ export declare const InternalPageEditorConfig: (({ children }: PageEditorConfigP
279
279
  displayName: string;
280
280
  }>) => (props: unknown) => React.JSX.Element;
281
281
  };
282
+ Tab: ({ name, label, icon, element, disabled, visible }: import("../../../BaseEditor/config/Toolbar/Tab").TabProps) => React.JSX.Element;
282
283
  };
283
284
  Sidebar: (() => React.JSX.Element) & {
284
285
  original: () => React.JSX.Element;
@@ -375,7 +376,7 @@ export declare const InternalPageEditorConfig: (({ children }: PageEditorConfigP
375
376
  displayName: string;
376
377
  }>) => (props: unknown) => React.JSX.Element;
377
378
  } & {
378
- Tab: ({ name, label, disabled, element, visible, noPadding }: import("../../../BaseEditor/config/Sidebar/Tab").TabProps) => React.JSX.Element;
379
+ Tab: ({ name, label, icon, disabled, element, visible }: import("../../../BaseEditor/config/Sidebar/Tab").TabProps) => React.JSX.Element;
379
380
  };
380
381
  ScrollableContainer: ({ children }: any) => React.JSX.Element;
381
382
  };
@@ -735,6 +736,7 @@ export declare const PageEditorConfig: (({ children }: PageEditorConfigProps) =>
735
736
  displayName: string;
736
737
  }>) => (props: unknown) => React.JSX.Element;
737
738
  };
739
+ Tab: ({ name, label, icon, element, disabled, visible }: import("../../../BaseEditor/config/Toolbar/Tab").TabProps) => React.JSX.Element;
738
740
  };
739
741
  Sidebar: (() => React.JSX.Element) & {
740
742
  original: () => React.JSX.Element;
@@ -831,7 +833,7 @@ export declare const PageEditorConfig: (({ children }: PageEditorConfigProps) =>
831
833
  displayName: string;
832
834
  }>) => (props: unknown) => React.JSX.Element;
833
835
  } & {
834
- Tab: ({ name, label, disabled, element, visible, noPadding }: import("../../../BaseEditor/config/Sidebar/Tab").TabProps) => React.JSX.Element;
836
+ Tab: ({ name, label, icon, disabled, element, visible }: import("../../../BaseEditor/config/Sidebar/Tab").TabProps) => React.JSX.Element;
835
837
  };
836
838
  ScrollableContainer: ({ children }: any) => React.JSX.Element;
837
839
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-website-builder",
3
- "version": "6.4.0-beta.3",
3
+ "version": "6.4.0-beta.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -20,29 +20,29 @@
20
20
  "@lexical/utils": "0.44.0",
21
21
  "@monaco-editor/react": "4.7.0",
22
22
  "@svgr/webpack": "8.1.0",
23
- "@types/react": "18.3.28",
24
- "@webiny/admin-ui": "6.4.0-beta.3",
25
- "@webiny/app": "6.4.0-beta.3",
26
- "@webiny/app-aco": "6.4.0-beta.3",
27
- "@webiny/app-admin": "6.4.0-beta.3",
28
- "@webiny/app-headless-cms-common": "6.4.0-beta.3",
29
- "@webiny/app-trash-bin": "6.4.0-beta.3",
30
- "@webiny/app-utils": "6.4.0-beta.3",
23
+ "@types/react": "18.3.29",
24
+ "@webiny/admin-ui": "6.4.0-beta.4",
25
+ "@webiny/app": "6.4.0-beta.4",
26
+ "@webiny/app-aco": "6.4.0-beta.4",
27
+ "@webiny/app-admin": "6.4.0-beta.4",
28
+ "@webiny/app-headless-cms-common": "6.4.0-beta.4",
29
+ "@webiny/app-trash-bin": "6.4.0-beta.4",
30
+ "@webiny/app-utils": "6.4.0-beta.4",
31
31
  "@webiny/di": "1.0.1",
32
- "@webiny/error": "6.4.0-beta.3",
33
- "@webiny/feature": "6.4.0-beta.3",
34
- "@webiny/form": "6.4.0-beta.3",
35
- "@webiny/icons": "6.4.0-beta.3",
36
- "@webiny/languages": "6.4.0-beta.3",
37
- "@webiny/lexical-converter": "6.4.0-beta.3",
38
- "@webiny/lexical-editor": "6.4.0-beta.3",
39
- "@webiny/lexical-nodes": "6.4.0-beta.3",
40
- "@webiny/lexical-theme": "6.4.0-beta.3",
41
- "@webiny/react-composition": "6.4.0-beta.3",
42
- "@webiny/react-properties": "6.4.0-beta.3",
43
- "@webiny/utils": "6.4.0-beta.3",
44
- "@webiny/validation": "6.4.0-beta.3",
45
- "@webiny/website-builder-sdk": "6.4.0-beta.3",
32
+ "@webiny/error": "6.4.0-beta.4",
33
+ "@webiny/feature": "6.4.0-beta.4",
34
+ "@webiny/form": "6.4.0-beta.4",
35
+ "@webiny/icons": "6.4.0-beta.4",
36
+ "@webiny/languages": "6.4.0-beta.4",
37
+ "@webiny/lexical-converter": "6.4.0-beta.4",
38
+ "@webiny/lexical-editor": "6.4.0-beta.4",
39
+ "@webiny/lexical-nodes": "6.4.0-beta.4",
40
+ "@webiny/lexical-theme": "6.4.0-beta.4",
41
+ "@webiny/react-composition": "6.4.0-beta.4",
42
+ "@webiny/react-properties": "6.4.0-beta.4",
43
+ "@webiny/utils": "6.4.0-beta.4",
44
+ "@webiny/validation": "6.4.0-beta.4",
45
+ "@webiny/website-builder-sdk": "6.4.0-beta.4",
46
46
  "apollo-cache": "1.3.5",
47
47
  "apollo-client": "2.6.10",
48
48
  "apollo-link": "1.2.14",
@@ -53,11 +53,12 @@
53
53
  "graphql-tag": "2.12.6",
54
54
  "is-hotkey": "0.2.0",
55
55
  "lodash": "4.18.1",
56
- "markdown-to-jsx": "9.8.0",
56
+ "markdown-to-jsx": "9.8.1",
57
57
  "matcher": "6.0.0",
58
58
  "mobx": "6.15.3",
59
59
  "mobx-react-lite": "4.1.1",
60
60
  "pluralize": "8.0.0",
61
+ "radix-ui": "1.4.3",
61
62
  "react": "18.3.1",
62
63
  "react-dnd": "16.0.1",
63
64
  "react-dnd-html5-backend": "16.0.1",
@@ -68,15 +69,14 @@
68
69
  "devDependencies": {
69
70
  "@types/deep-equal": "1.0.4",
70
71
  "@types/is-hotkey": "0.1.10",
71
- "@webiny/build-tools": "6.4.0-beta.3",
72
+ "@webiny/build-tools": "6.4.0-beta.4",
72
73
  "execa": "5.1.1",
73
74
  "rimraf": "6.1.3",
74
75
  "typescript": "6.0.3",
75
- "vitest": "4.1.6"
76
+ "vitest": "4.1.7"
76
77
  },
77
78
  "publishConfig": {
78
- "access": "public",
79
- "directory": "dist"
79
+ "access": "public"
80
80
  },
81
81
  "scripts": {
82
82
  "build": "yarn webiny run build",
@@ -90,5 +90,7 @@
90
90
  ]
91
91
  }
92
92
  },
93
- "gitHead": "2e58681d4344024bfb60e6180338e2f154ec87f0"
93
+ "webiny": {
94
+ "publishFrom": "dist"
95
+ }
94
96
  }
@@ -1,59 +0,0 @@
1
- import react, { useEffect, useState } from "react";
2
- import { useDragLayer } from "react-dnd";
3
- let subscribedToOffsetChange = false;
4
- let dragPreviewRef = null;
5
- const onOffsetChange = (monitor)=>()=>{
6
- if (!dragPreviewRef) return;
7
- const offset = monitor.getClientOffset();
8
- if (!offset) return;
9
- const transform = `translate(${offset.x - 15}px, ${offset.y - 15}px)`;
10
- dragPreviewRef.style["transform"] = transform;
11
- dragPreviewRef.style["-webkit-transform"] = transform;
12
- };
13
- const DragPreview = ()=>{
14
- const [dragHelperOpacity, setDragHelperOpacity] = useState(0);
15
- const { isDragging, item } = useDragLayer((monitor)=>{
16
- if (!subscribedToOffsetChange) {
17
- monitor.subscribeToOffsetChange(onOffsetChange(monitor));
18
- subscribedToOffsetChange = true;
19
- }
20
- return {
21
- isDragging: monitor.isDragging(),
22
- item: monitor.getItem()
23
- };
24
- });
25
- useEffect(()=>()=>{
26
- subscribedToOffsetChange = false;
27
- dragPreviewRef = null;
28
- }, []);
29
- useEffect(()=>{
30
- if (isDragging) return void setTimeout(()=>{
31
- setDragHelperOpacity(isDragging ? 1 : 0);
32
- }, 100);
33
- setDragHelperOpacity(0);
34
- }, [
35
- isDragging
36
- ]);
37
- if (!isDragging) return null;
38
- if (item && item.dragInNavigator) return null;
39
- return /*#__PURE__*/ react.createElement("div", {
40
- style: {
41
- zIndex: 1001
42
- },
43
- className: "fixed pointer-events-none left-0 top-0 w-full h-full"
44
- }, /*#__PURE__*/ react.createElement("div", {
45
- ref: (el)=>{
46
- dragPreviewRef = el;
47
- },
48
- className: "transition-opacity duration-250 ease-in-out block",
49
- style: {
50
- opacity: dragHelperOpacity
51
- }
52
- }, /*#__PURE__*/ react.createElement("div", {
53
- className: "size-lg rounded-full bg-primary"
54
- })));
55
- };
56
- const components_DragPreview = DragPreview;
57
- export default components_DragPreview;
58
-
59
- //# sourceMappingURL=DragPreview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseEditor/components/DragPreview.js","sources":["../../../src/BaseEditor/components/DragPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport type { DragLayerMonitor } from \"react-dnd\";\nimport { useDragLayer } from \"react-dnd\";\n\nlet subscribedToOffsetChange = false;\nlet dragPreviewRef: HTMLDivElement | null = null;\n\nconst onOffsetChange = (monitor: DragLayerMonitor) => () => {\n if (!dragPreviewRef) {\n return;\n }\n\n const offset = monitor.getClientOffset();\n if (!offset) {\n return;\n }\n\n const transform = `translate(${offset.x - 15}px, ${offset.y - 15}px)`;\n dragPreviewRef.style[\"transform\"] = transform;\n /**\n * TS is complaining about -webkit.\n */\n // @ts-expect-error\n dragPreviewRef.style[\"-webkit-transform\"] = transform;\n};\n\nconst DragPreview = () => {\n const [dragHelperOpacity, setDragHelperOpacity] = useState(0);\n\n const { isDragging, item } = useDragLayer((monitor: DragLayerMonitor) => {\n if (!subscribedToOffsetChange) {\n // @ts-expect-error\n monitor.subscribeToOffsetChange(onOffsetChange(monitor));\n subscribedToOffsetChange = true;\n }\n\n return {\n isDragging: monitor.isDragging(),\n item: monitor.getItem()\n };\n });\n\n useEffect(() => {\n return () => {\n subscribedToOffsetChange = false;\n dragPreviewRef = null;\n };\n }, []);\n\n // We track the value of \"isDragging\" and apply opacity=1 (after 100ms), when it switches to true.\n // Without this, the drag cursor would be shown in the top-left corner for a short amount of time, and then it\n // would be repositioned correctly. Definitely looks like a glitch. This also adds a nice little fade-in effect.\n useEffect((): void => {\n if (isDragging) {\n setTimeout(() => {\n setDragHelperOpacity(isDragging ? 1 : 0);\n }, 100);\n return;\n }\n\n setDragHelperOpacity(0);\n }, [isDragging]);\n\n if (!isDragging) {\n return null;\n }\n // We don't want to show the drag preview for items being drag in the navigator.\n if (item && item.dragInNavigator) {\n return null;\n }\n\n return (\n <div\n style={{ zIndex: 1001 }}\n className=\"fixed pointer-events-none left-0 top-0 w-full h-full\"\n >\n <div\n ref={el => {\n dragPreviewRef = el;\n }}\n className=\"transition-opacity duration-250 ease-in-out block\"\n style={{ opacity: dragHelperOpacity }}\n >\n <div className=\"size-lg rounded-full bg-primary\" />\n </div>\n </div>\n );\n};\n\nexport default DragPreview;\n"],"names":["subscribedToOffsetChange","dragPreviewRef","onOffsetChange","monitor","offset","transform","DragPreview","dragHelperOpacity","setDragHelperOpacity","useState","isDragging","item","useDragLayer","useEffect","setTimeout","el"],"mappings":";;AAIA,IAAIA,2BAA2B;AAC/B,IAAIC,iBAAwC;AAE5C,MAAMC,iBAAiB,CAACC,UAA8B;QAClD,IAAI,CAACF,gBACD;QAGJ,MAAMG,SAASD,QAAQ,eAAe;QACtC,IAAI,CAACC,QACD;QAGJ,MAAMC,YAAY,CAAC,UAAU,EAAED,OAAO,CAAC,GAAG,GAAG,IAAI,EAAEA,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;QACrEH,eAAe,KAAK,CAAC,YAAY,GAAGI;QAKpCJ,eAAe,KAAK,CAAC,oBAAoB,GAAGI;IAChD;AAEA,MAAMC,cAAc;IAChB,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGC,SAAS;IAE3D,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGC,aAAa,CAACT;QACvC,IAAI,CAACH,0BAA0B;YAE3BG,QAAQ,uBAAuB,CAACD,eAAeC;YAC/CH,2BAA2B;QAC/B;QAEA,OAAO;YACH,YAAYG,QAAQ,UAAU;YAC9B,MAAMA,QAAQ,OAAO;QACzB;IACJ;IAEAU,UAAU,IACC;YACHb,2BAA2B;YAC3BC,iBAAiB;QACrB,GACD,EAAE;IAKLY,UAAU;QACN,IAAIH,YAAY,YACZI,WAAW;YACPN,qBAAqBE,aAAa,IAAI;QAC1C,GAAG;QAIPF,qBAAqB;IACzB,GAAG;QAACE;KAAW;IAEf,IAAI,CAACA,YACD,OAAO;IAGX,IAAIC,QAAQA,KAAK,eAAe,EAC5B,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QACG,OAAO;YAAE,QAAQ;QAAK;QACtB,WAAU;qBAEV,oBAAC;QACG,KAAKI,CAAAA;YACDd,iBAAiBc;QACrB;QACA,WAAU;QACV,OAAO;YAAE,SAASR;QAAkB;qBAEpC,oBAAC;QAAI,WAAU;;AAI/B;AAEA,+BAAeD"}
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import type { BindComponentRenderProp } from "@webiny/form";
3
- import type { ElementInputRendererProps } from "../../BaseEditor/index.js";
4
- export declare const adaptInputToBind: (Component: React.ComponentType<ElementInputRendererProps>) => (props: BindComponentRenderProp & {
5
- label: string;
6
- }) => React.JSX.Element;
@@ -1,26 +0,0 @@
1
- import react from "react";
2
- import { NullMetadata } from "../../BaseEditor/metadata/index.js";
3
- import { InputValueObject } from "../../BaseEditor/hooks/useInputValue.js";
4
- const metadata = new NullMetadata();
5
- const noop = ()=>void 0;
6
- const adaptInputToBind = (Component)=>function(props) {
7
- const onChange = (cb)=>{
8
- const value = new InputValueObject(props.value);
9
- cb({
10
- value,
11
- metadata: metadata
12
- });
13
- props.onChange(value.get());
14
- };
15
- return /*#__PURE__*/ react.createElement(Component, {
16
- label: props.label,
17
- value: props.value,
18
- onChange: onChange,
19
- metadata: metadata,
20
- onPreviewChange: noop,
21
- input: {}
22
- });
23
- };
24
- export { adaptInputToBind };
25
-
26
- //# sourceMappingURL=adaptInputToBind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecommerce/components/adaptInputToBind.js","sources":["../../../src/ecommerce/components/adaptInputToBind.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BindComponentRenderProp } from \"@webiny/form\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\nimport { NullMetadata } from \"~/BaseEditor/metadata/index.js\";\nimport { InputValueObject } from \"~/BaseEditor/hooks/useInputValue.js\";\n\nconst metadata = new NullMetadata();\nconst noop = () => void 0;\n\nexport const adaptInputToBind = (Component: React.ComponentType<ElementInputRendererProps>) => {\n return function ElementInputAsFormInput(props: BindComponentRenderProp & { label: string }) {\n const onChange: ElementInputRendererProps[\"onChange\"] = cb => {\n const value = new InputValueObject(props.value);\n cb({ value, metadata });\n props.onChange(value.get());\n };\n\n return (\n <Component\n label={props.label}\n value={props.value}\n onChange={onChange}\n metadata={metadata}\n onPreviewChange={noop}\n input={{} as any}\n />\n );\n };\n};\n"],"names":["metadata","NullMetadata","noop","adaptInputToBind","Component","props","onChange","cb","value","InputValueObject"],"mappings":";;;AAMA,MAAMA,WAAW,IAAIC;AACrB,MAAMC,OAAO,IAAM,KAAK;AAEjB,MAAMC,mBAAmB,CAACC,YACtB,SAAiCC,KAAkD;QACtF,MAAMC,WAAkDC,CAAAA;YACpD,MAAMC,QAAQ,IAAIC,iBAAiBJ,MAAM,KAAK;YAC9CE,GAAG;gBAAEC;gBAAOR,UAAAA;YAAS;YACrBK,MAAM,QAAQ,CAACG,MAAM,GAAG;QAC5B;QAEA,OAAO,WAAP,GACI,oBAACJ,WAAAA;YACG,OAAOC,MAAM,KAAK;YAClB,OAAOA,MAAM,KAAK;YAClB,UAAUC;YACV,UAAUN;YACV,iBAAiBE;YACjB,OAAO,CAAC;;IAGpB"}