@webiny/app-website-builder 6.6.0-alpha.0 → 6.6.0-alpha.2

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 (234) hide show
  1. package/BaseEditor/commandHandlers/CloneElement.d.ts +1 -0
  2. package/BaseEditor/commandHandlers/CloneElement.js +17 -0
  3. package/BaseEditor/commandHandlers/CloneElement.js.map +1 -0
  4. package/BaseEditor/commandHandlers/index.js +2 -1
  5. package/BaseEditor/commandHandlers/index.js.map +1 -1
  6. package/BaseEditor/commands.d.ts +3 -0
  7. package/BaseEditor/commands.js +2 -0
  8. package/BaseEditor/commands.js.map +1 -1
  9. package/BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.js +4 -1
  10. package/BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.js.map +1 -1
  11. package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js.map +1 -1
  12. package/BaseEditor/defaultConfig/Content/Preview/Iframe.d.ts +2 -2
  13. package/BaseEditor/defaultConfig/Content/Preview/Overlays/ElementOverlays.d.ts +2 -2
  14. package/BaseEditor/defaultConfig/DefaultEditorConfig.js +9 -0
  15. package/BaseEditor/defaultConfig/DefaultEditorConfig.js.map +1 -1
  16. package/BaseEditor/defaultConfig/DocumentStateEditor/DocumentStateEditor.d.ts +2 -2
  17. package/BaseEditor/defaultConfig/ElementInputRenderers.js +4 -0
  18. package/BaseEditor/defaultConfig/ElementInputRenderers.js.map +1 -1
  19. package/BaseEditor/defaultConfig/Sidebar/ElementActions/CloneElementAction.d.ts +2 -0
  20. package/BaseEditor/defaultConfig/Sidebar/ElementActions/CloneElementAction.js +25 -0
  21. package/BaseEditor/defaultConfig/Sidebar/ElementActions/CloneElementAction.js.map +1 -0
  22. package/BaseEditor/defaultConfig/Sidebar/ElementActions/DeleteElementAction.d.ts +2 -0
  23. package/BaseEditor/defaultConfig/Sidebar/ElementActions/DeleteElementAction.js +26 -0
  24. package/BaseEditor/defaultConfig/Sidebar/ElementActions/DeleteElementAction.js.map +1 -0
  25. package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js +12 -2
  26. package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js.map +1 -1
  27. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js +1 -6
  28. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js.map +1 -1
  29. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.js +11 -2
  30. package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.js.map +1 -1
  31. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundColor.d.ts +6 -2
  32. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.d.ts +6 -2
  33. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundPosition.d.ts +6 -2
  34. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundScaling.d.ts +6 -2
  35. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.d.ts +2 -2
  36. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.d.ts +2 -2
  37. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.d.ts +2 -2
  38. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.d.ts +2 -2
  39. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.d.ts +6 -2
  40. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.d.ts +2 -2
  41. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Margin.d.ts +2 -2
  42. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Padding.d.ts +2 -2
  43. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Visibility/Visibility.d.ts +2 -2
  44. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js +7 -7
  45. package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js.map +1 -1
  46. package/BaseEditor/defaultConfig/Toolbar/Navigator/Navigator.d.ts +2 -2
  47. package/DocumentEditor/DocumentEditor.d.ts +14 -5
  48. package/DocumentEditor/DocumentEditor.js +10 -6
  49. package/DocumentEditor/DocumentEditor.js.map +1 -1
  50. package/DocumentEditor/StateInspector.d.ts +4 -2
  51. package/Extension.js +7 -1
  52. package/Extension.js.map +1 -1
  53. package/ecommerce/components/ResourcePage.d.ts +6 -2
  54. package/ecommerce/components/ResourcesList.d.ts +4 -4
  55. package/ecommerce/components/ResourcesPicker.d.ts +9 -4
  56. package/editorSdk/CommandBus.js.map +1 -1
  57. package/editorSdk/utils/$cloneElement.d.ts +2 -0
  58. package/editorSdk/utils/$cloneElement.js +112 -0
  59. package/editorSdk/utils/$cloneElement.js.map +1 -0
  60. package/editorSdk/utils/index.d.ts +1 -0
  61. package/editorSdk/utils/index.js +1 -0
  62. package/features/experiments/ExperimentsGateway.d.ts +30 -0
  63. package/features/experiments/ExperimentsGateway.js +326 -0
  64. package/features/experiments/ExperimentsGateway.js.map +1 -0
  65. package/features/experiments/abstractions.d.ts +25 -0
  66. package/features/experiments/abstractions.js +5 -0
  67. package/features/experiments/abstractions.js.map +1 -0
  68. package/features/experiments/feature.d.ts +3 -0
  69. package/features/experiments/feature.js +17 -0
  70. package/features/experiments/feature.js.map +1 -0
  71. package/features/experiments/index.d.ts +3 -0
  72. package/features/experiments/index.js +2 -0
  73. package/features/experiments/types.d.ts +61 -0
  74. package/features/experiments/types.js +0 -0
  75. package/inputRenderers/ColorPickerInput.d.ts +3 -0
  76. package/inputRenderers/ColorPickerInput.js +29 -0
  77. package/inputRenderers/ColorPickerInput.js.map +1 -0
  78. package/inputRenderers/FileInput.js +93 -8
  79. package/inputRenderers/FileInput.js.map +1 -1
  80. package/inputRenderers/LexicalInput/LexicalEditor.js +15 -8
  81. package/inputRenderers/LexicalInput/LexicalEditor.js.map +1 -1
  82. package/inputRenderers/LexicalInput/TypographyDropDown.js +3 -2
  83. package/inputRenderers/LexicalInput/TypographyDropDown.js.map +1 -1
  84. package/inputRenderers/LexicalInput/wbStaticToolbar.css +72 -103
  85. package/modules/AbTesting.d.ts +2 -0
  86. package/modules/AbTesting.js +19 -0
  87. package/modules/AbTesting.js.map +1 -0
  88. package/package.json +28 -28
  89. package/presentation/components/LanguageCodeTag.js +5 -4
  90. package/presentation/components/LanguageCodeTag.js.map +1 -1
  91. package/presentation/experiments/ExperimentForm/ExperimentFormPresenter.d.ts +30 -0
  92. package/presentation/experiments/ExperimentForm/ExperimentFormPresenter.js +202 -0
  93. package/presentation/experiments/ExperimentForm/ExperimentFormPresenter.js.map +1 -0
  94. package/presentation/experiments/ExperimentForm/abstractions/ExperimentFormPresenter.d.ts +65 -0
  95. package/presentation/experiments/ExperimentForm/abstractions/ExperimentFormPresenter.js +5 -0
  96. package/presentation/experiments/ExperimentForm/abstractions/ExperimentFormPresenter.js.map +1 -0
  97. package/presentation/experiments/ExperimentForm/components/ExperimentFormView.d.ts +12 -0
  98. package/presentation/experiments/ExperimentForm/components/ExperimentFormView.js +149 -0
  99. package/presentation/experiments/ExperimentForm/components/ExperimentFormView.js.map +1 -0
  100. package/presentation/experiments/ExperimentForm/components/VariantSplitRow.d.ts +17 -0
  101. package/presentation/experiments/ExperimentForm/components/VariantSplitRow.js +122 -0
  102. package/presentation/experiments/ExperimentForm/components/VariantSplitRow.js.map +1 -0
  103. package/presentation/experiments/ExperimentForm/feature.d.ts +3 -0
  104. package/presentation/experiments/ExperimentForm/feature.js +17 -0
  105. package/presentation/experiments/ExperimentForm/feature.js.map +1 -0
  106. package/presentation/experiments/ExperimentForm/index.d.ts +3 -0
  107. package/presentation/experiments/ExperimentForm/index.js +3 -0
  108. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorDataSource.d.ts +18 -0
  109. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorDataSource.js +25 -0
  110. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorDataSource.js.map +1 -0
  111. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorPresenter.d.ts +67 -0
  112. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorPresenter.js +224 -0
  113. package/presentation/experiments/ExperimentsEditor/ExperimentsEditorPresenter.js.map +1 -0
  114. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorDataSource.d.ts +10 -0
  115. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorDataSource.js +5 -0
  116. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorDataSource.js.map +1 -0
  117. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorPresenter.d.ts +58 -0
  118. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorPresenter.js +5 -0
  119. package/presentation/experiments/ExperimentsEditor/abstractions/ExperimentsEditorPresenter.js.map +1 -0
  120. package/presentation/experiments/ExperimentsEditor/components/ExperimentIndicator.d.ts +15 -0
  121. package/presentation/experiments/ExperimentsEditor/components/ExperimentIndicator.js +110 -0
  122. package/presentation/experiments/ExperimentsEditor/components/ExperimentIndicator.js.map +1 -0
  123. package/presentation/experiments/ExperimentsEditor/components/ExperimentPreviewToolbar.d.ts +9 -0
  124. package/presentation/experiments/ExperimentsEditor/components/ExperimentPreviewToolbar.js +178 -0
  125. package/presentation/experiments/ExperimentsEditor/components/ExperimentPreviewToolbar.js.map +1 -0
  126. package/presentation/experiments/ExperimentsEditor/components/ExperimentsButton.d.ts +11 -0
  127. package/presentation/experiments/ExperimentsEditor/components/ExperimentsButton.js +51 -0
  128. package/presentation/experiments/ExperimentsEditor/components/ExperimentsButton.js.map +1 -0
  129. package/presentation/experiments/ExperimentsEditor/components/ExperimentsSwitcher.d.ts +14 -0
  130. package/presentation/experiments/ExperimentsEditor/components/ExperimentsSwitcher.js +147 -0
  131. package/presentation/experiments/ExperimentsEditor/components/ExperimentsSwitcher.js.map +1 -0
  132. package/presentation/experiments/ExperimentsEditor/feature.d.ts +3 -0
  133. package/presentation/experiments/ExperimentsEditor/feature.js +21 -0
  134. package/presentation/experiments/ExperimentsEditor/feature.js.map +1 -0
  135. package/presentation/experiments/ExperimentsEditor/index.d.ts +4 -0
  136. package/presentation/experiments/ExperimentsEditor/index.js +3 -0
  137. package/presentation/experiments/ExperimentsManager/ExperimentsManagerPresenter.d.ts +39 -0
  138. package/presentation/experiments/ExperimentsManager/ExperimentsManagerPresenter.js +219 -0
  139. package/presentation/experiments/ExperimentsManager/ExperimentsManagerPresenter.js.map +1 -0
  140. package/presentation/experiments/ExperimentsManager/abstractions/ExperimentsManagerPresenter.d.ts +52 -0
  141. package/presentation/experiments/ExperimentsManager/abstractions/ExperimentsManagerPresenter.js +5 -0
  142. package/presentation/experiments/ExperimentsManager/abstractions/ExperimentsManagerPresenter.js.map +1 -0
  143. package/presentation/experiments/ExperimentsManager/components/ExperimentCard.d.ts +10 -0
  144. package/presentation/experiments/ExperimentsManager/components/ExperimentCard.js +296 -0
  145. package/presentation/experiments/ExperimentsManager/components/ExperimentCard.js.map +1 -0
  146. package/presentation/experiments/ExperimentsManager/components/ExperimentsDrawerView.d.ts +2 -0
  147. package/presentation/experiments/ExperimentsManager/components/ExperimentsDrawerView.js +92 -0
  148. package/presentation/experiments/ExperimentsManager/components/ExperimentsDrawerView.js.map +1 -0
  149. package/presentation/experiments/ExperimentsManager/components/ExperimentsEmptyState.d.ts +6 -0
  150. package/presentation/experiments/ExperimentsManager/components/ExperimentsEmptyState.js +103 -0
  151. package/presentation/experiments/ExperimentsManager/components/ExperimentsEmptyState.js.map +1 -0
  152. package/presentation/experiments/ExperimentsManager/components/ExperimentsListView.d.ts +9 -0
  153. package/presentation/experiments/ExperimentsManager/components/ExperimentsListView.js +58 -0
  154. package/presentation/experiments/ExperimentsManager/components/ExperimentsListView.js.map +1 -0
  155. package/presentation/experiments/ExperimentsManager/feature.d.ts +3 -0
  156. package/presentation/experiments/ExperimentsManager/feature.js +17 -0
  157. package/presentation/experiments/ExperimentsManager/feature.js.map +1 -0
  158. package/presentation/experiments/ExperimentsManager/index.d.ts +4 -0
  159. package/presentation/experiments/ExperimentsManager/index.js +3 -0
  160. package/presentation/experiments/VariantPageEditorConfig.d.ts +7 -0
  161. package/presentation/experiments/VariantPageEditorConfig.js +26 -0
  162. package/presentation/experiments/VariantPageEditorConfig.js.map +1 -0
  163. package/presentation/experiments/config/ExperimentsEditorConfig.d.ts +8 -0
  164. package/presentation/experiments/config/ExperimentsEditorConfig.js +21 -0
  165. package/presentation/experiments/config/ExperimentsEditorConfig.js.map +1 -0
  166. package/presentation/experiments/config/VariantAutoSave.d.ts +5 -0
  167. package/presentation/experiments/config/VariantAutoSave.js +41 -0
  168. package/presentation/experiments/config/VariantAutoSave.js.map +1 -0
  169. package/presentation/experiments/shared/variantColors.d.ts +11 -0
  170. package/presentation/experiments/shared/variantColors.js +13 -0
  171. package/presentation/experiments/shared/variantColors.js.map +1 -0
  172. package/presentation/experiments/shared/variantDocument.d.ts +16 -0
  173. package/presentation/experiments/shared/variantDocument.js +31 -0
  174. package/presentation/experiments/shared/variantDocument.js.map +1 -0
  175. package/presentation/navigation/Extension.js +9 -5
  176. package/presentation/navigation/Extension.js.map +1 -1
  177. package/presentation/navigation/NextjsConfig/NextjsConfigDialog.d.ts +2 -2
  178. package/presentation/navigation/StarterKitConfigDialog.js +1 -1
  179. package/presentation/navigation/StarterKitConfigDialog.js.map +1 -1
  180. package/presentation/pages/CreatePage/CreatePageDialog.d.ts +2 -2
  181. package/presentation/pages/CreatePage/CreatePagePresenter.js +1 -1
  182. package/presentation/pages/CreatePage/CreatePagePresenter.js.map +1 -1
  183. package/presentation/pages/CreatePage/WithLanguageSelector.js +3 -3
  184. package/presentation/pages/CreatePage/WithLanguageSelector.js.map +1 -1
  185. package/presentation/pages/CreatePage/feature.js +3 -3
  186. package/presentation/pages/CreatePage/feature.js.map +1 -1
  187. package/presentation/pages/PageEditor/PageEditor.experiments.d.ts +2 -0
  188. package/presentation/pages/PageEditor/PageEditor.experiments.js +54 -0
  189. package/presentation/pages/PageEditor/PageEditor.experiments.js.map +1 -0
  190. package/presentation/pages/PageEditor/PageEditorSurface.d.ts +15 -0
  191. package/presentation/pages/PageEditor/PageEditorSurface.js +63 -0
  192. package/presentation/pages/PageEditor/PageEditorSurface.js.map +1 -0
  193. package/presentation/pages/PageEditor/TopBar/PageSettingsDrawer.d.ts +2 -2
  194. package/presentation/pages/PageEditor/pageDocument.d.ts +4 -0
  195. package/presentation/pages/PageEditor/pageDocument.js +15 -0
  196. package/presentation/pages/PageEditor/pageDocument.js.map +1 -0
  197. package/presentation/pages/PageList/components/BulkActions/BulkActionDelete.d.ts +2 -2
  198. package/presentation/pages/PageList/components/BulkActions/BulkActionDuplicate.d.ts +2 -2
  199. package/presentation/pages/PageList/components/BulkActions/BulkActionMovePage.d.ts +2 -2
  200. package/presentation/pages/PageList/components/BulkActions/BulkActionPublish.d.ts +2 -2
  201. package/presentation/pages/PageList/components/BulkActions/BulkActionUnpublish.d.ts +2 -2
  202. package/presentation/pages/PageList/components/DocumentList.d.ts +2 -2
  203. package/presentation/pages/PageList/components/PagesList.js +2 -1
  204. package/presentation/pages/PageList/components/PagesList.js.map +1 -1
  205. package/presentation/pages/PageList/components/Table/Table.d.ts +2 -2
  206. package/presentation/pages/PageList/components/WbPagesBreadcrumbs.d.ts +9 -0
  207. package/presentation/pages/PageList/components/WbPagesBreadcrumbs.js +40 -0
  208. package/presentation/pages/PageList/components/WbPagesBreadcrumbs.js.map +1 -0
  209. package/presentation/pages/TranslatePage/TranslatePageConfig.d.ts +1 -1
  210. package/presentation/pages/TranslatePage/TranslatePageConfig.js +6 -2
  211. package/presentation/pages/TranslatePage/TranslatePageConfig.js.map +1 -1
  212. package/presentation/pages/TranslatePage/TranslatePageDialog.js +22 -10
  213. package/presentation/pages/TranslatePage/TranslatePageDialog.js.map +1 -1
  214. package/presentation/pages/TranslatePage/translatePageSchema.d.ts +1 -1
  215. package/presentation/pages/TranslatePage/translatePageSchema.js +1 -1
  216. package/presentation/pages/TranslatePage/translatePageSchema.js.map +1 -1
  217. package/presentation/pages/TrashBin/WbTrashBin.d.ts +2 -2
  218. package/presentation/redirects/RedirectList/components/BulkActionDelete.d.ts +2 -2
  219. package/presentation/redirects/RedirectList/components/BulkActionMove.d.ts +2 -2
  220. package/presentation/redirects/RedirectList/components/CreateRedirectDialog.d.ts +2 -2
  221. package/presentation/redirects/RedirectList/components/DocumentList.d.ts +2 -2
  222. package/presentation/redirects/RedirectList/components/EditRedirectDialog.d.ts +2 -2
  223. package/presentation/redirects/RedirectList/components/Table/Table.d.ts +2 -2
  224. package/shared/fileManagerItemToValue.d.ts +8 -9
  225. package/shared/fileManagerItemToValue.js +22 -7
  226. package/shared/fileManagerItemToValue.js.map +1 -1
  227. package/inputRenderers/LexicalInput/icons/list-ol.js +0 -20
  228. package/inputRenderers/LexicalInput/icons/list-ol.js.map +0 -1
  229. package/inputRenderers/LexicalInput/icons/list-ol.svg +0 -1
  230. package/inputRenderers/LexicalInput/icons/list-ul.js +0 -18
  231. package/inputRenderers/LexicalInput/icons/list-ul.js.map +0 -1
  232. package/inputRenderers/LexicalInput/icons/list-ul.svg +0 -1
  233. package/static/svg/list-ol.d64946f3.svg +0 -1
  234. package/static/svg/list-ul.1d54da3f.svg +0 -1
@@ -0,0 +1 @@
1
+ export declare const CloneElement: () => null;
@@ -0,0 +1,17 @@
1
+ import { useEffect } from "react";
2
+ import { useDocumentEditor } from "../../DocumentEditor/index.js";
3
+ import { Commands } from "../index.js";
4
+ import { $cloneElement } from "../../editorSdk/utils/index.js";
5
+ const CloneElement = ()=>{
6
+ const editor = useDocumentEditor();
7
+ useEffect(()=>editor.registerCommandHandler(Commands.CloneElement, (payload)=>{
8
+ const newId = $cloneElement(editor, payload.id);
9
+ if (newId) editor.executeCommand(Commands.SelectElement, {
10
+ id: newId
11
+ });
12
+ }), []);
13
+ return null;
14
+ };
15
+ export { CloneElement };
16
+
17
+ //# sourceMappingURL=CloneElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEditor/commandHandlers/CloneElement.js","sources":["../../../src/BaseEditor/commandHandlers/CloneElement.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\nimport { Commands } from \"~/BaseEditor/index.js\";\nimport { $cloneElement } from \"~/editorSdk/utils/index.js\";\n\nexport const CloneElement = () => {\n const editor = useDocumentEditor();\n\n useEffect(() => {\n return editor.registerCommandHandler(Commands.CloneElement, payload => {\n const newId = $cloneElement(editor, payload.id);\n if (newId) {\n editor.executeCommand(Commands.SelectElement, { id: newId });\n }\n });\n }, []);\n\n return null;\n};\n"],"names":["CloneElement","editor","useDocumentEditor","useEffect","Commands","payload","newId","$cloneElement"],"mappings":";;;;AAKO,MAAMA,eAAe;IACxB,MAAMC,SAASC;IAEfC,UAAU,IACCF,OAAO,sBAAsB,CAACG,SAAS,YAAY,EAAEC,CAAAA;YACxD,MAAMC,QAAQC,cAAcN,QAAQI,QAAQ,EAAE;YAC9C,IAAIC,OACAL,OAAO,cAAc,CAACG,SAAS,aAAa,EAAE;gBAAE,IAAIE;YAAM;QAElE,IACD,EAAE;IAEL,OAAO;AACX"}
@@ -1,11 +1,12 @@
1
1
  import react from "react";
2
+ import { CloneElement } from "./CloneElement.js";
2
3
  import { CreateElement } from "./CreateElement.js";
3
4
  import { DeleteElement } from "./DeleteElement.js";
4
5
  import { MoveElement } from "./MoveElement.js";
5
6
  import { DeselectElement } from "./DeselectElement.js";
6
7
  import { SelectElement } from "./SelectElement.js";
7
8
  import { HighlightElement } from "./HighlightElement.js";
8
- const CommandHandlers = /*#__PURE__*/ react.memo(()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(CreateElement, null), /*#__PURE__*/ react.createElement(DeleteElement, null), /*#__PURE__*/ react.createElement(MoveElement, null), /*#__PURE__*/ react.createElement(DeselectElement, null), /*#__PURE__*/ react.createElement(SelectElement, null), /*#__PURE__*/ react.createElement(HighlightElement, null)));
9
+ const CommandHandlers = /*#__PURE__*/ react.memo(()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(CloneElement, null), /*#__PURE__*/ react.createElement(CreateElement, null), /*#__PURE__*/ react.createElement(DeleteElement, null), /*#__PURE__*/ react.createElement(MoveElement, null), /*#__PURE__*/ react.createElement(DeselectElement, null), /*#__PURE__*/ react.createElement(SelectElement, null), /*#__PURE__*/ react.createElement(HighlightElement, null)));
9
10
  CommandHandlers.displayName = "CommandHandlers";
10
11
  export { CommandHandlers };
11
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/commandHandlers/index.js","sources":["../../../src/BaseEditor/commandHandlers/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { CreateElement } from \"./CreateElement.js\";\nimport { DeleteElement } from \"./DeleteElement.js\";\nimport { MoveElement } from \"./MoveElement.js\";\nimport { DeselectElement } from \"./DeselectElement.js\";\nimport { SelectElement } from \"./SelectElement.js\";\nimport { HighlightElement } from \"./HighlightElement.js\";\n\nexport const CommandHandlers = React.memo(() => {\n return (\n <>\n <CreateElement />\n <DeleteElement />\n <MoveElement />\n <DeselectElement />\n <SelectElement />\n <HighlightElement />\n </>\n );\n});\n\nCommandHandlers.displayName = \"CommandHandlers\";\n"],"names":["CommandHandlers","React","CreateElement","DeleteElement","MoveElement","DeselectElement","SelectElement","HighlightElement"],"mappings":";;;;;;;AAQO,MAAMA,kBAAkB,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IAC/B,WAAP,GACI,wDACI,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,aAAWA,OAAAA,WAAAA,GACZ,oBAACC,iBAAeA,OAAAA,WAAAA,GAChB,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,kBAAgBA;AAK7BP,gBAAgB,WAAW,GAAG"}
1
+ {"version":3,"file":"BaseEditor/commandHandlers/index.js","sources":["../../../src/BaseEditor/commandHandlers/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { CloneElement } from \"./CloneElement.js\";\nimport { CreateElement } from \"./CreateElement.js\";\nimport { DeleteElement } from \"./DeleteElement.js\";\nimport { MoveElement } from \"./MoveElement.js\";\nimport { DeselectElement } from \"./DeselectElement.js\";\nimport { SelectElement } from \"./SelectElement.js\";\nimport { HighlightElement } from \"./HighlightElement.js\";\n\nexport const CommandHandlers = React.memo(() => {\n return (\n <>\n <CloneElement />\n <CreateElement />\n <DeleteElement />\n <MoveElement />\n <DeselectElement />\n <SelectElement />\n <HighlightElement />\n </>\n );\n});\n\nCommandHandlers.displayName = \"CommandHandlers\";\n"],"names":["CommandHandlers","React","CloneElement","CreateElement","DeleteElement","MoveElement","DeselectElement","SelectElement","HighlightElement"],"mappings":";;;;;;;;AASO,MAAMA,kBAAkB,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IAC/B,WAAP,GACI,wDACI,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,aAAWA,OAAAA,WAAAA,GACZ,oBAACC,iBAAeA,OAAAA,WAAAA,GAChB,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,kBAAgBA;AAK7BR,gBAAgB,WAAW,GAAG"}
@@ -1,6 +1,9 @@
1
1
  import type { ElementFactoryCreateElementParams } from "@webiny/website-builder-sdk";
2
2
  import type { WebsiteBuilderTheme } from "@webiny/website-builder-sdk/types/WebsiteBuilderTheme.js";
3
3
  export declare const Commands: {
4
+ CloneElement: import("~/editorSdk/createCommand.js").Command<{
5
+ id: string;
6
+ }>;
4
7
  CreateElement: import("~/editorSdk/createCommand.js").Command<{
5
8
  componentName: string;
6
9
  parentId: string;
@@ -1,6 +1,7 @@
1
1
  import { createCommand } from "../editorSdk/createCommand.js";
2
2
  const CreateElement = createCommand("CREATE_ELEMENT");
3
3
  const MoveElement = createCommand("MOVE_ELEMENT");
4
+ const CloneElement = createCommand("CLONE_ELEMENT");
4
5
  const DeleteElement = createCommand("DELETE_ELEMENT");
5
6
  const SelectElement = createCommand("SELECT_ELEMENT");
6
7
  const HighlightElement = createCommand("HIGHLIGHT_ELEMENT");
@@ -10,6 +11,7 @@ const RefreshPreview = createCommand("REFRESH_PREVIEW");
10
11
  const PreviewPatchElement = createCommand("PREVIEW_PATCH_ELEMENT");
11
12
  const SendPreviewMessage = createCommand("SEND_PREVIEW_MESSAGE");
12
13
  const Commands = {
14
+ CloneElement: CloneElement,
13
15
  CreateElement: CreateElement,
14
16
  DeleteElement: DeleteElement,
15
17
  MoveElement: MoveElement,
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/commands.js","sources":["../../src/BaseEditor/commands.ts"],"sourcesContent":["import { createCommand } from \"~/editorSdk/createCommand.js\";\nimport type { ElementFactoryCreateElementParams } from \"@webiny/website-builder-sdk\";\nimport type { WebsiteBuilderTheme } from \"@webiny/website-builder-sdk/types/WebsiteBuilderTheme.js\";\n\nconst CreateElement = createCommand<{\n // Name of the component to use.\n componentName: string;\n // Parent element for the new element.\n parentId: string;\n // Parent element slot (e.g., `children`, `heroBanner`, `tabsList.0.content`).\n slot: string;\n // Index within the slot. Omit to append at the end.\n index?: number;\n // Bindings\n bindings?: ElementFactoryCreateElementParams[\"bindings\"];\n}>(\"CREATE_ELEMENT\");\n\nconst MoveElement = createCommand<{\n // ID of the element to move.\n elementId: string;\n // Parent element for the new element.\n parentId: string;\n // Parent element slot (e.g., `children`, `heroBanner`, `tabsList.0.content`).\n slot: string;\n // Index within the slot.\n index: number;\n}>(\"MOVE_ELEMENT\");\n\nconst DeleteElement = createCommand<{\n id: string;\n}>(\"DELETE_ELEMENT\");\n\nconst SelectElement = createCommand<{ id: string }>(\"SELECT_ELEMENT\");\n\nconst HighlightElement = createCommand<{ id: string }>(\"HIGHLIGHT_ELEMENT\");\n\nconst SetTheme = createCommand<{ theme: WebsiteBuilderTheme }>(\"SET_THEME\");\n\nconst DeselectElement = createCommand<never>(\"DESELECT_ELEMENT\");\n\nconst RefreshPreview = createCommand<never>(\"REFRESH_PREVIEW\");\n\nconst PreviewPatchElement = createCommand<{ elementId: string; patch: any[] }>(\n \"PREVIEW_PATCH_ELEMENT\"\n);\n\nconst SendPreviewMessage = createCommand<{ type: string; payload?: any }>(\"SEND_PREVIEW_MESSAGE\");\n\nexport const Commands = {\n CreateElement,\n DeleteElement,\n MoveElement,\n SelectElement,\n DeselectElement,\n HighlightElement,\n RefreshPreview,\n PreviewPatchElement,\n SendPreviewMessage,\n SetTheme\n};\n"],"names":["CreateElement","createCommand","MoveElement","DeleteElement","SelectElement","HighlightElement","SetTheme","DeselectElement","RefreshPreview","PreviewPatchElement","SendPreviewMessage","Commands"],"mappings":";AAIA,MAAMA,gBAAgBC,cAWnB;AAEH,MAAMC,cAAcD,cASjB;AAEH,MAAME,gBAAgBF,cAEnB;AAEH,MAAMG,gBAAgBH,cAA8B;AAEpD,MAAMI,mBAAmBJ,cAA8B;AAEvD,MAAMK,WAAWL,cAA8C;AAE/D,MAAMM,kBAAkBN,cAAqB;AAE7C,MAAMO,iBAAiBP,cAAqB;AAE5C,MAAMQ,sBAAsBR,cACxB;AAGJ,MAAMS,qBAAqBT,cAA+C;AAEnE,MAAMU,WAAW;IACpBX,eAAAA;IACAG,eAAAA;IACAD,aAAAA;IACAE,eAAAA;IACAG,iBAAAA;IACAF,kBAAAA;IACAG,gBAAAA;IACAC,qBAAAA;IACAC,oBAAAA;IACAJ,UAAAA;AACJ"}
1
+ {"version":3,"file":"BaseEditor/commands.js","sources":["../../src/BaseEditor/commands.ts"],"sourcesContent":["import { createCommand } from \"~/editorSdk/createCommand.js\";\nimport type { ElementFactoryCreateElementParams } from \"@webiny/website-builder-sdk\";\nimport type { WebsiteBuilderTheme } from \"@webiny/website-builder-sdk/types/WebsiteBuilderTheme.js\";\n\nconst CreateElement = createCommand<{\n // Name of the component to use.\n componentName: string;\n // Parent element for the new element.\n parentId: string;\n // Parent element slot (e.g., `children`, `heroBanner`, `tabsList.0.content`).\n slot: string;\n // Index within the slot. Omit to append at the end.\n index?: number;\n // Bindings\n bindings?: ElementFactoryCreateElementParams[\"bindings\"];\n}>(\"CREATE_ELEMENT\");\n\nconst MoveElement = createCommand<{\n // ID of the element to move.\n elementId: string;\n // Parent element for the new element.\n parentId: string;\n // Parent element slot (e.g., `children`, `heroBanner`, `tabsList.0.content`).\n slot: string;\n // Index within the slot.\n index: number;\n}>(\"MOVE_ELEMENT\");\n\nconst CloneElement = createCommand<{ id: string }>(\"CLONE_ELEMENT\");\n\nconst DeleteElement = createCommand<{\n id: string;\n}>(\"DELETE_ELEMENT\");\n\nconst SelectElement = createCommand<{ id: string }>(\"SELECT_ELEMENT\");\n\nconst HighlightElement = createCommand<{ id: string }>(\"HIGHLIGHT_ELEMENT\");\n\nconst SetTheme = createCommand<{ theme: WebsiteBuilderTheme }>(\"SET_THEME\");\n\nconst DeselectElement = createCommand<never>(\"DESELECT_ELEMENT\");\n\nconst RefreshPreview = createCommand<never>(\"REFRESH_PREVIEW\");\n\nconst PreviewPatchElement = createCommand<{ elementId: string; patch: any[] }>(\n \"PREVIEW_PATCH_ELEMENT\"\n);\n\nconst SendPreviewMessage = createCommand<{ type: string; payload?: any }>(\"SEND_PREVIEW_MESSAGE\");\n\nexport const Commands = {\n CloneElement,\n CreateElement,\n DeleteElement,\n MoveElement,\n SelectElement,\n DeselectElement,\n HighlightElement,\n RefreshPreview,\n PreviewPatchElement,\n SendPreviewMessage,\n SetTheme\n};\n"],"names":["CreateElement","createCommand","MoveElement","CloneElement","DeleteElement","SelectElement","HighlightElement","SetTheme","DeselectElement","RefreshPreview","PreviewPatchElement","SendPreviewMessage","Commands"],"mappings":";AAIA,MAAMA,gBAAgBC,cAWnB;AAEH,MAAMC,cAAcD,cASjB;AAEH,MAAME,eAAeF,cAA8B;AAEnD,MAAMG,gBAAgBH,cAEnB;AAEH,MAAMI,gBAAgBJ,cAA8B;AAEpD,MAAMK,mBAAmBL,cAA8B;AAEvD,MAAMM,WAAWN,cAA8C;AAE/D,MAAMO,kBAAkBP,cAAqB;AAE7C,MAAMQ,iBAAiBR,cAAqB;AAE5C,MAAMS,sBAAsBT,cACxB;AAGJ,MAAMU,qBAAqBV,cAA+C;AAEnE,MAAMW,WAAW;IACpBT,cAAAA;IACAH,eAAAA;IACAI,eAAAA;IACAF,aAAAA;IACAG,eAAAA;IACAG,iBAAAA;IACAF,kBAAAA;IACAG,gBAAAA;IACAC,qBAAAA;IACAC,oBAAAA;IACAJ,UAAAA;AACJ"}
@@ -18,7 +18,10 @@ const usePreviewLink = ()=>{
18
18
  url.searchParams.set("wb.path", path);
19
19
  return url.toString();
20
20
  }, [
21
- iframeUrl
21
+ iframeUrl,
22
+ id,
23
+ path,
24
+ documentType
22
25
  ]);
23
26
  };
24
27
  export { usePreviewLink };
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useIframeUrl } from \"~/BaseEditor/defaultConfig/Content/Preview/useIframeUrl.js\";\nimport { useSelectFromDocument } from \"~/BaseEditor/hooks/useSelectFromDocument.js\";\n\nexport const usePreviewLink = () => {\n const iframeUrl = useIframeUrl();\n const id = useSelectFromDocument(document => document.id);\n const path = useSelectFromDocument(document => document.properties.path);\n const documentType = useSelectFromDocument(document => document.metadata.documentType);\n\n return useMemo(() => {\n if (!iframeUrl) {\n return \"\";\n }\n const url = new URL(iframeUrl);\n\n // Remove all `wb.` params\n url.searchParams.forEach((_, key) => {\n if (key.startsWith(\"wb.\")) {\n url.searchParams.delete(key);\n }\n });\n\n // Add preview params\n url.searchParams.set(\"wb.preview\", \"true\");\n url.searchParams.set(\"wb.type\", documentType);\n url.searchParams.set(\"wb.id\", String(id));\n url.searchParams.set(\"wb.path\", path);\n return url.toString();\n }, [iframeUrl]);\n};\n"],"names":["usePreviewLink","iframeUrl","useIframeUrl","id","useSelectFromDocument","document","path","documentType","useMemo","url","URL","_","key","String"],"mappings":";;;AAIO,MAAMA,iBAAiB;IAC1B,MAAMC,YAAYC;IAClB,MAAMC,KAAKC,sBAAsBC,CAAAA,WAAYA,SAAS,EAAE;IACxD,MAAMC,OAAOF,sBAAsBC,CAAAA,WAAYA,SAAS,UAAU,CAAC,IAAI;IACvE,MAAME,eAAeH,sBAAsBC,CAAAA,WAAYA,SAAS,QAAQ,CAAC,YAAY;IAErF,OAAOG,QAAQ;QACX,IAAI,CAACP,WACD,OAAO;QAEX,MAAMQ,MAAM,IAAIC,IAAIT;QAGpBQ,IAAI,YAAY,CAAC,OAAO,CAAC,CAACE,GAAGC;YACzB,IAAIA,IAAI,UAAU,CAAC,QACfH,IAAI,YAAY,CAAC,MAAM,CAACG;QAEhC;QAGAH,IAAI,YAAY,CAAC,GAAG,CAAC,cAAc;QACnCA,IAAI,YAAY,CAAC,GAAG,CAAC,WAAWF;QAChCE,IAAI,YAAY,CAAC,GAAG,CAAC,SAASI,OAAOV;QACrCM,IAAI,YAAY,CAAC,GAAG,CAAC,WAAWH;QAChC,OAAOG,IAAI,QAAQ;IACvB,GAAG;QAACR;KAAU;AAClB"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/usePreviewLink.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useIframeUrl } from \"~/BaseEditor/defaultConfig/Content/Preview/useIframeUrl.js\";\nimport { useSelectFromDocument } from \"~/BaseEditor/hooks/useSelectFromDocument.js\";\n\nexport const usePreviewLink = () => {\n const iframeUrl = useIframeUrl();\n const id = useSelectFromDocument(document => document.id);\n const path = useSelectFromDocument(document => document.properties.path);\n const documentType = useSelectFromDocument(document => document.metadata.documentType);\n // // Set when the edited document is an A/B variant (see variantDocument.ts). When present, the\n // // preview must open the variant's draft — not the page the document borrows its identity from.\n // const previewVariantId = useSelectFromDocument(\n // document =>\n // (document.metadata as Record<string, any>).wbVariantPreviewId as string | undefined\n // );\n\n return useMemo(() => {\n if (!iframeUrl) {\n return \"\";\n }\n const url = new URL(iframeUrl);\n\n // Remove all `wb.` params\n url.searchParams.forEach((_, key) => {\n if (key.startsWith(\"wb.\")) {\n url.searchParams.delete(key);\n }\n });\n\n // if (previewVariantId) {\n // // Variant draft preview — the site renders this variant's draft content on its page.\n // url.searchParams.set(\"wb-variant-draft\", previewVariantId);\n // return url.toString();\n // }\n\n // Add preview params\n url.searchParams.set(\"wb.preview\", \"true\");\n url.searchParams.set(\"wb.type\", documentType);\n url.searchParams.set(\"wb.id\", String(id));\n url.searchParams.set(\"wb.path\", path);\n return url.toString();\n }, [iframeUrl, id, path, documentType /*previewVariantId*/]);\n};\n"],"names":["usePreviewLink","iframeUrl","useIframeUrl","id","useSelectFromDocument","document","path","documentType","useMemo","url","URL","_","key","String"],"mappings":";;;AAIO,MAAMA,iBAAiB;IAC1B,MAAMC,YAAYC;IAClB,MAAMC,KAAKC,sBAAsBC,CAAAA,WAAYA,SAAS,EAAE;IACxD,MAAMC,OAAOF,sBAAsBC,CAAAA,WAAYA,SAAS,UAAU,CAAC,IAAI;IACvE,MAAME,eAAeH,sBAAsBC,CAAAA,WAAYA,SAAS,QAAQ,CAAC,YAAY;IAQrF,OAAOG,QAAQ;QACX,IAAI,CAACP,WACD,OAAO;QAEX,MAAMQ,MAAM,IAAIC,IAAIT;QAGpBQ,IAAI,YAAY,CAAC,OAAO,CAAC,CAACE,GAAGC;YACzB,IAAIA,IAAI,UAAU,CAAC,QACfH,IAAI,YAAY,CAAC,MAAM,CAACG;QAEhC;QASAH,IAAI,YAAY,CAAC,GAAG,CAAC,cAAc;QACnCA,IAAI,YAAY,CAAC,GAAG,CAAC,WAAWF;QAChCE,IAAI,YAAY,CAAC,GAAG,CAAC,SAASI,OAAOV;QACrCM,IAAI,YAAY,CAAC,GAAG,CAAC,WAAWH;QAChC,OAAOG,IAAI,QAAQ;IACvB,GAAG;QAACR;QAAWE;QAAIG;QAAMC;KAAkC;AAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.ts"],"sourcesContent":["import type { Box } from \"./Box.js\";\n\ntype DropPosition = number | null;\ntype MatchChangeCallback = (hasMatch: boolean) => void;\n\nexport interface DropZoneProximity {\n box: Box;\n position: DropPosition;\n}\n\ninterface DropzoneEntry {\n id: string;\n box: Box;\n canAccept?: () => boolean;\n onProximityChange: (proximity: DropZoneProximity | null) => void;\n}\n\nexport class DropZoneManager {\n private zones = new Map<string, DropzoneEntry>();\n private currentTargetId: string | null = null;\n private currentPosition: DropPosition = null;\n private animationFrame: number | null = null;\n private currentBox: Box | null = null;\n private matchCallbacks = new Set<MatchChangeCallback>();\n\n constructor(private mouse: { x: number; y: number }) {}\n\n register(entry: DropzoneEntry) {\n if (entry.id === \"root\") {\n return;\n }\n\n this.zones.set(entry.id, entry);\n }\n\n unregister(id: string) {\n this.zones.delete(id);\n }\n\n subscribeToMatchChange(cb: MatchChangeCallback): () => void {\n this.matchCallbacks.add(cb);\n return () => this.matchCallbacks.delete(cb);\n }\n\n start() {\n const runDropzoneLoop = () => {\n this.tick();\n this.animationFrame = requestAnimationFrame(runDropzoneLoop);\n };\n this.animationFrame = requestAnimationFrame(runDropzoneLoop);\n }\n\n stop() {\n if (this.animationFrame) {\n cancelAnimationFrame(this.animationFrame);\n }\n }\n\n getLastMatchedPosition() {\n if (!this.currentBox) {\n return null;\n }\n\n return {\n parentId: this.currentBox.parentId,\n slot: this.currentBox.parentSlot,\n index: this.currentBox.parentIndex + (this.currentPosition ?? 0)\n };\n }\n\n tick() {\n const scrollYOffset = this.getScrollOffset();\n const threshold = 10;\n const mouseX = this.mouse.x;\n const mouseY = this.mouse.y + scrollYOffset;\n\n let matchedId: string | null = null;\n let matchedPosition: DropPosition = null;\n let matchedBox: Box | null = null;\n\n // Collect all candidate matches with their canAccept callback.\n const candidates: { id: string; box: Box; position: number; canAccept?: () => boolean }[] =\n [];\n\n for (const [id, { box, canAccept }] of this.zones) {\n const isWithinX = mouseX >= box.left && mouseX <= box.right;\n\n if (!isWithinX) {\n continue;\n }\n\n if (Math.abs(mouseY - box.top) <= threshold) {\n candidates.push({ id, box, position: 0, canAccept });\n }\n\n if (Math.abs(mouseY - box.bottom) <= threshold) {\n candidates.push({ id, box, position: 1, canAccept });\n }\n }\n\n if (candidates.length > 0) {\n // Filter to only eligible candidates.\n const eligible = candidates.filter(c => !c.canAccept || c.canAccept());\n\n if (eligible.length > 0) {\n const uniqueDepths = [...new Set(eligible.map(c => c.box.depth))].sort(\n (a, b) => b - a\n );\n\n if (uniqueDepths.length === 1) {\n const winner = eligible[0];\n matchedId = winner.id;\n matchedPosition = winner.position;\n matchedBox = winner.box;\n } else {\n // Use X position to select depth band among eligible candidates only.\n let rangeLeft = Infinity;\n let rangeRight = -Infinity;\n for (const c of eligible) {\n rangeLeft = Math.min(rangeLeft, c.box.left);\n rangeRight = Math.max(rangeRight, c.box.right);\n }\n\n const centerX = (rangeLeft + rangeRight) / 2;\n const halfWidth = (rangeRight - rangeLeft) / 2;\n\n // 0 at center, 1 at edges.\n const distFromCenter =\n halfWidth > 0 ? Math.abs(mouseX - centerX) / halfWidth : 0;\n\n // Map distance to depth index: center → 0 (deepest), edges → last (shallowest).\n const depthIndex = Math.min(\n Math.floor(distFromCenter * uniqueDepths.length),\n uniqueDepths.length - 1\n );\n\n const winner = eligible.find(c => c.box.depth === uniqueDepths[depthIndex]);\n if (winner) {\n matchedId = winner.id;\n matchedPosition = winner.position;\n matchedBox = winner.box;\n }\n }\n }\n }\n\n if (matchedId !== this.currentTargetId || matchedPosition !== this.currentPosition) {\n this.currentTargetId = matchedId;\n this.currentPosition = matchedPosition;\n this.currentBox = matchedBox;\n\n this.matchCallbacks.forEach(cb => cb(matchedId !== null));\n\n for (const [id, entry] of this.zones) {\n const isTarget = id === matchedId;\n entry.onProximityChange(\n isTarget ? { box: matchedBox!, position: matchedPosition } : null\n );\n }\n }\n }\n\n private getScrollOffset() {\n const container = document.getElementById(\"preview-container\");\n if (!container) {\n return 0;\n }\n\n return container.scrollTop;\n }\n}\n"],"names":["DropZoneManager","mouse","Map","Set","entry","id","cb","runDropzoneLoop","requestAnimationFrame","cancelAnimationFrame","scrollYOffset","threshold","mouseX","mouseY","matchedId","matchedPosition","matchedBox","candidates","box","canAccept","isWithinX","Math","eligible","c","uniqueDepths","a","b","winner","rangeLeft","Infinity","rangeRight","centerX","halfWidth","distFromCenter","depthIndex","isTarget","container","document"],"mappings":"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"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.ts"],"sourcesContent":["import type { Box } from \"./Box.js\";\n\ntype DropPosition = number | null;\ntype MatchChangeCallback = (hasMatch: boolean) => void;\n\nexport interface DropZoneProximity {\n box: Box;\n position: DropPosition;\n}\n\ninterface DropzoneEntry {\n id: string;\n box: Box;\n canAccept?: () => boolean;\n onProximityChange: (proximity: DropZoneProximity | null) => void;\n}\n\nexport class DropZoneManager {\n private zones = new Map<string, DropzoneEntry>();\n private currentTargetId: string | null = null;\n private currentPosition: DropPosition = null;\n private animationFrame: number | null = null;\n private currentBox: Box | null = null;\n private matchCallbacks = new Set<MatchChangeCallback>();\n\n constructor(private mouse: { x: number; y: number }) {}\n\n register(entry: DropzoneEntry) {\n if (entry.id === \"root\") {\n return;\n }\n\n this.zones.set(entry.id, entry);\n }\n\n unregister(id: string) {\n this.zones.delete(id);\n }\n\n subscribeToMatchChange(cb: MatchChangeCallback): () => void {\n this.matchCallbacks.add(cb);\n return () => this.matchCallbacks.delete(cb);\n }\n\n start() {\n const runDropzoneLoop = () => {\n this.tick();\n this.animationFrame = requestAnimationFrame(runDropzoneLoop);\n };\n this.animationFrame = requestAnimationFrame(runDropzoneLoop);\n }\n\n stop() {\n if (this.animationFrame) {\n cancelAnimationFrame(this.animationFrame);\n }\n }\n\n getLastMatchedPosition() {\n if (!this.currentBox) {\n return null;\n }\n\n return {\n parentId: this.currentBox.parentId,\n slot: this.currentBox.parentSlot,\n index: this.currentBox.parentIndex + (this.currentPosition ?? 0)\n };\n }\n\n tick() {\n const scrollYOffset = this.getScrollOffset();\n const threshold = 10;\n const mouseX = this.mouse.x;\n const mouseY = this.mouse.y + scrollYOffset;\n\n let matchedId: string | null = null;\n let matchedPosition: DropPosition = null;\n let matchedBox: Box | null = null;\n\n // Collect all candidate matches with their canAccept callback.\n const candidates: { id: string; box: Box; position: number; canAccept?: () => boolean }[] =\n [];\n\n for (const [id, { box, canAccept }] of this.zones) {\n const isWithinX = mouseX >= box.left && mouseX <= box.right;\n\n if (!isWithinX) {\n continue;\n }\n\n if (Math.abs(mouseY - box.top) <= threshold) {\n candidates.push({ id, box, position: 0, canAccept });\n }\n\n if (Math.abs(mouseY - box.bottom) <= threshold) {\n candidates.push({ id, box, position: 1, canAccept });\n }\n }\n\n if (candidates.length > 0) {\n // Filter to only eligible candidates.\n const eligible = candidates.filter(c => !c.canAccept || c.canAccept());\n\n if (eligible.length > 0) {\n const uniqueDepths = [...new Set(eligible.map(c => c.box.depth))].sort(\n (a, b) => b - a\n );\n\n if (uniqueDepths.length === 1) {\n const winner = eligible[0];\n matchedId = winner.id;\n matchedPosition = winner.position;\n matchedBox = winner.box;\n } else {\n // Use X position to select depth band among eligible candidates only.\n let rangeLeft = Infinity;\n let rangeRight = -Infinity;\n for (const c of eligible) {\n rangeLeft = Math.min(rangeLeft, c.box.left);\n rangeRight = Math.max(rangeRight, c.box.right);\n }\n\n const centerX = (rangeLeft + rangeRight) / 2;\n const halfWidth = (rangeRight - rangeLeft) / 2;\n\n // 0 at center, 1 at edges.\n const distFromCenter =\n halfWidth > 0 ? Math.abs(mouseX - centerX) / halfWidth : 0;\n\n // Map distance to depth index: center → 0 (deepest), edges → last (shallowest).\n const depthIndex = Math.min(\n Math.floor(distFromCenter * uniqueDepths.length),\n uniqueDepths.length - 1\n );\n\n const winner = eligible.find(c => c.box.depth === uniqueDepths[depthIndex]);\n if (winner) {\n matchedId = winner.id;\n matchedPosition = winner.position;\n matchedBox = winner.box;\n }\n }\n }\n }\n\n if (matchedId !== this.currentTargetId || matchedPosition !== this.currentPosition) {\n this.currentTargetId = matchedId;\n this.currentPosition = matchedPosition;\n this.currentBox = matchedBox;\n\n this.matchCallbacks.forEach(cb => cb(matchedId !== null));\n\n for (const [id, entry] of this.zones) {\n const isTarget = id === matchedId;\n entry.onProximityChange(\n isTarget ? { box: matchedBox!, position: matchedPosition } : null\n );\n }\n }\n }\n\n private getScrollOffset() {\n const container = document.getElementById(\"preview-container\");\n if (!container) {\n return 0;\n }\n\n return container.scrollTop;\n }\n}\n"],"names":["DropZoneManager","mouse","Map","Set","entry","id","cb","runDropzoneLoop","requestAnimationFrame","cancelAnimationFrame","scrollYOffset","threshold","mouseX","mouseY","matchedId","matchedPosition","matchedBox","candidates","box","canAccept","isWithinX","Math","eligible","c","uniqueDepths","a","b","winner","rangeLeft","Infinity","rangeRight","centerX","halfWidth","distFromCenter","depthIndex","isTarget","container","document"],"mappings":"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"}
@@ -8,7 +8,7 @@ interface IframeProps {
8
8
  viewportManager: ViewportManager;
9
9
  onConnected: (messenger: Messenger) => void;
10
10
  }
11
- export declare const Iframe: (({ url, timestamp, ...props }: IframeProps) => React.JSX.Element) & {
12
- displayName: string;
11
+ export declare const Iframe: (({ url, timestamp, ...props }: IframeProps) => React.JSX.Element) & React.NamedExoticComponent<IframeProps> & {
12
+ readonly type: ({ url, timestamp, ...props }: IframeProps) => React.JSX.Element;
13
13
  };
14
14
  export {};
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- export declare const ElementOverlays: (() => React.JSX.Element) & {
3
- displayName: string;
2
+ export declare const ElementOverlays: (() => React.JSX.Element) & React.NamedExoticComponent<unknown> & {
3
+ readonly type: () => React.JSX.Element;
4
4
  };
@@ -10,6 +10,8 @@ import { CommandHandlers } from "../commandHandlers/index.js";
10
10
  import { ElementSettings } from "./Sidebar/ElementSettings/ElementSettings.js";
11
11
  import { ElementInputRenderers } from "./ElementInputRenderers.js";
12
12
  import { ContentPreviewConfig } from "./Content/ContentPreviewConfig.js";
13
+ import { CloneElementAction } from "./Sidebar/ElementActions/CloneElementAction.js";
14
+ import { DeleteElementAction } from "./Sidebar/ElementActions/DeleteElementAction.js";
13
15
  const { Ui: Ui } = EditorConfig;
14
16
  const ClickToActivate = ()=>/*#__PURE__*/ react.createElement(Ui.NoActiveElement, null, /*#__PURE__*/ react.createElement(SidebarEmptyState, {
15
17
  message: "Select an element in the canvas to edit properties."
@@ -44,6 +46,13 @@ const DefaultEditorConfig = /*#__PURE__*/ react.memo(()=>/*#__PURE__*/ react.cre
44
46
  name: "elementSettings",
45
47
  group: "element",
46
48
  element: /*#__PURE__*/ react.createElement(Ui.OnActiveElement, null, /*#__PURE__*/ react.createElement(ElementSettings, null))
49
+ }), /*#__PURE__*/ react.createElement(EditorConfig.ElementAction, {
50
+ name: "cloneElement",
51
+ element: /*#__PURE__*/ react.createElement(CloneElementAction, null)
52
+ }), /*#__PURE__*/ react.createElement(EditorConfig.ElementAction, {
53
+ name: "deleteElement",
54
+ element: /*#__PURE__*/ react.createElement(DeleteElementAction, null),
55
+ after: "cloneElement"
47
56
  }))));
48
57
  DefaultEditorConfig.displayName = "DefaultEditorConfig";
49
58
  export { DefaultEditorConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/DefaultEditorConfig.js","sources":["../../../src/BaseEditor/defaultConfig/DefaultEditorConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorConfig } from \"~/BaseEditor/config/index.js\";\nimport { SidebarEmptyState } from \"./Sidebar/SidebarEmptyState.js\";\nimport { StyleSettingsGroup } from \"./Sidebar/StyleSettings/StyleSettingsGroup.js\";\nimport { StyleProperties } from \"./Sidebar/StyleSettings/StyleProperties.js\";\nimport { ElementSettingsGroup } from \"./Sidebar/ElementSettings/ElementSettingsGroup.js\";\nimport { InsertElementsTab } from \"./Toolbar/InsertElements/InsertElementsTab.js\";\nimport { NavigatorTab } from \"./Toolbar/Navigator/NavigatorTab.js\";\nimport { CommandHandlers } from \"~/BaseEditor/commandHandlers/index.js\";\nimport { ElementSettings } from \"./Sidebar/ElementSettings/ElementSettings.js\";\nimport { ElementInputRenderers } from \"./ElementInputRenderers.js\";\nimport { ContentPreviewConfig } from \"./Content/ContentPreviewConfig.js\";\n\nconst { Ui } = EditorConfig;\n\nconst ClickToActivate = () => {\n return (\n <Ui.NoActiveElement>\n <SidebarEmptyState message={\"Select an element in the canvas to edit properties.\"} />\n </Ui.NoActiveElement>\n );\n};\n\nexport const DefaultEditorConfig = React.memo(() => {\n return (\n <>\n <CommandHandlers />\n <EditorConfig>\n <ElementInputRenderers />\n <ContentPreviewConfig />\n <Ui.Toolbar.Element\n name={\"insertElements\"}\n group={\"tabs\"}\n element={<InsertElementsTab />}\n />\n <Ui.Toolbar.Element name={\"navigator\"} group={\"tabs\"} element={<NavigatorTab />} />\n {/* Sidebar Groups */}\n <Ui.Sidebar.Group name={\"element\"} element={<ElementSettingsGroup />} />\n <Ui.Sidebar.Group name={\"style\"} element={<StyleSettingsGroup />} />\n {/* Style Settings Tab */}\n <Ui.Sidebar.Element\n name={\"styleSettings\"}\n group={\"style\"}\n element={\n <Ui.OnActiveElement>\n <StyleProperties />\n </Ui.OnActiveElement>\n }\n />\n <Ui.Sidebar.Element\n name={\"styleInactive\"}\n group={\"style\"}\n element={<ClickToActivate />}\n />\n {/* Element Settings Tab */}\n <Ui.Sidebar.Element\n name={\"elementInactive\"}\n group={\"element\"}\n element={<ClickToActivate />}\n />\n {/* This element renders element properties. */}\n <Ui.Sidebar.Element\n name={\"elementSettings\"}\n group={\"element\"}\n element={\n <Ui.OnActiveElement>\n <ElementSettings />\n </Ui.OnActiveElement>\n }\n />\n {/*<Ui.Sidebar.Element\n name={\"stateEditor\"}\n group={\"element\"}\n element={<DocumentStateEditor />}\n />*/}\n </EditorConfig>\n </>\n );\n});\n\nDefaultEditorConfig.displayName = \"DefaultEditorConfig\";\n"],"names":["Ui","EditorConfig","ClickToActivate","SidebarEmptyState","DefaultEditorConfig","React","CommandHandlers","ElementInputRenderers","ContentPreviewConfig","InsertElementsTab","NavigatorTab","ElementSettingsGroup","StyleSettingsGroup","StyleProperties","ElementSettings"],"mappings":";;;;;;;;;;;;AAaA,MAAM,EAAEA,IAAAA,EAAE,EAAE,GAAGC;AAEf,MAAMC,kBAAkB,IACb,WAAP,GACI,oBAACF,GAAG,eAAe,sBACf,oBAACG,mBAAiBA;QAAC,SAAS;;AAKjC,MAAMC,sBAAsB,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IACnC,WAAP,GACI,wDACI,oBAACC,iBAAeA,OAAAA,WAAAA,GAChB,oBAACL,cAAYA,MAAAA,WAAAA,GACT,oBAACM,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,sBAAoBA,OAAAA,WAAAA,GACrB,oBAACR,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACS,mBAAiBA;sBAE/B,oBAACT,GAAG,OAAO,CAAC,OAAO;QAAC,MAAM;QAAa,OAAO;QAAQ,uBAAS,oBAACU,cAAYA;sBAE5E,oBAACV,GAAG,OAAO,CAAC,KAAK;QAAC,MAAM;QAAW,uBAAS,oBAACW,sBAAoBA;sBACjE,oBAACX,GAAG,OAAO,CAAC,KAAK;QAAC,MAAM;QAAS,uBAAS,oBAACY,oBAAkBA;sBAE7D,oBAACZ,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBACI,oBAACA,GAAG,eAAe,sBACf,oBAACa,iBAAeA;sBAI5B,oBAACb,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACE,iBAAeA;sBAG7B,oBAACF,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACE,iBAAeA;sBAG7B,oBAACF,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBACI,oBAACA,GAAG,eAAe,sBACf,oBAACc,iBAAeA;;AAc5CV,oBAAoB,WAAW,GAAG"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/DefaultEditorConfig.js","sources":["../../../src/BaseEditor/defaultConfig/DefaultEditorConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorConfig } from \"~/BaseEditor/config/index.js\";\nimport { SidebarEmptyState } from \"./Sidebar/SidebarEmptyState.js\";\nimport { StyleSettingsGroup } from \"./Sidebar/StyleSettings/StyleSettingsGroup.js\";\nimport { StyleProperties } from \"./Sidebar/StyleSettings/StyleProperties.js\";\nimport { ElementSettingsGroup } from \"./Sidebar/ElementSettings/ElementSettingsGroup.js\";\nimport { InsertElementsTab } from \"./Toolbar/InsertElements/InsertElementsTab.js\";\nimport { NavigatorTab } from \"./Toolbar/Navigator/NavigatorTab.js\";\nimport { CommandHandlers } from \"~/BaseEditor/commandHandlers/index.js\";\nimport { ElementSettings } from \"./Sidebar/ElementSettings/ElementSettings.js\";\nimport { ElementInputRenderers } from \"./ElementInputRenderers.js\";\nimport { ContentPreviewConfig } from \"./Content/ContentPreviewConfig.js\";\nimport { CloneElementAction } from \"./Sidebar/ElementActions/CloneElementAction.js\";\nimport { DeleteElementAction } from \"./Sidebar/ElementActions/DeleteElementAction.js\";\n\nconst { Ui } = EditorConfig;\n\nconst ClickToActivate = () => {\n return (\n <Ui.NoActiveElement>\n <SidebarEmptyState message={\"Select an element in the canvas to edit properties.\"} />\n </Ui.NoActiveElement>\n );\n};\n\nexport const DefaultEditorConfig = React.memo(() => {\n return (\n <>\n <CommandHandlers />\n <EditorConfig>\n <ElementInputRenderers />\n <ContentPreviewConfig />\n <Ui.Toolbar.Element\n name={\"insertElements\"}\n group={\"tabs\"}\n element={<InsertElementsTab />}\n />\n <Ui.Toolbar.Element name={\"navigator\"} group={\"tabs\"} element={<NavigatorTab />} />\n {/* Sidebar Groups */}\n <Ui.Sidebar.Group name={\"element\"} element={<ElementSettingsGroup />} />\n <Ui.Sidebar.Group name={\"style\"} element={<StyleSettingsGroup />} />\n {/* Style Settings Tab */}\n <Ui.Sidebar.Element\n name={\"styleSettings\"}\n group={\"style\"}\n element={\n <Ui.OnActiveElement>\n <StyleProperties />\n </Ui.OnActiveElement>\n }\n />\n <Ui.Sidebar.Element\n name={\"styleInactive\"}\n group={\"style\"}\n element={<ClickToActivate />}\n />\n {/* Element Settings Tab */}\n <Ui.Sidebar.Element\n name={\"elementInactive\"}\n group={\"element\"}\n element={<ClickToActivate />}\n />\n {/* This element renders element properties. */}\n <Ui.Sidebar.Element\n name={\"elementSettings\"}\n group={\"element\"}\n element={\n <Ui.OnActiveElement>\n <ElementSettings />\n </Ui.OnActiveElement>\n }\n />\n {/*<Ui.Sidebar.Element\n name={\"stateEditor\"}\n group={\"element\"}\n element={<DocumentStateEditor />}\n />*/}\n {/* Element Actions (dropdown menu items) */}\n <EditorConfig.ElementAction\n name={\"cloneElement\"}\n element={<CloneElementAction />}\n />\n <EditorConfig.ElementAction\n name={\"deleteElement\"}\n element={<DeleteElementAction />}\n after={\"cloneElement\"}\n />\n </EditorConfig>\n </>\n );\n});\n\nDefaultEditorConfig.displayName = \"DefaultEditorConfig\";\n"],"names":["Ui","EditorConfig","ClickToActivate","SidebarEmptyState","DefaultEditorConfig","React","CommandHandlers","ElementInputRenderers","ContentPreviewConfig","InsertElementsTab","NavigatorTab","ElementSettingsGroup","StyleSettingsGroup","StyleProperties","ElementSettings","CloneElementAction","DeleteElementAction"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,EAAEA,IAAAA,EAAE,EAAE,GAAGC;AAEf,MAAMC,kBAAkB,IACb,WAAP,GACI,oBAACF,GAAG,eAAe,sBACf,oBAACG,mBAAiBA;QAAC,SAAS;;AAKjC,MAAMC,sBAAsB,WAAHA,GAAGC,MAAAA,IAAU,CAAC,IACnC,WAAP,GACI,wDACI,oBAACC,iBAAeA,OAAAA,WAAAA,GAChB,oBAACL,cAAYA,MAAAA,WAAAA,GACT,oBAACM,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,sBAAoBA,OAAAA,WAAAA,GACrB,oBAACR,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACS,mBAAiBA;sBAE/B,oBAACT,GAAG,OAAO,CAAC,OAAO;QAAC,MAAM;QAAa,OAAO;QAAQ,uBAAS,oBAACU,cAAYA;sBAE5E,oBAACV,GAAG,OAAO,CAAC,KAAK;QAAC,MAAM;QAAW,uBAAS,oBAACW,sBAAoBA;sBACjE,oBAACX,GAAG,OAAO,CAAC,KAAK;QAAC,MAAM;QAAS,uBAAS,oBAACY,oBAAkBA;sBAE7D,oBAACZ,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBACI,oBAACA,GAAG,eAAe,sBACf,oBAACa,iBAAeA;sBAI5B,oBAACb,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACE,iBAAeA;sBAG7B,oBAACF,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBAAS,oBAACE,iBAAeA;sBAG7B,oBAACF,GAAG,OAAO,CAAC,OAAO;QACf,MAAM;QACN,OAAO;QACP,uBACI,oBAACA,GAAG,eAAe,sBACf,oBAACc,iBAAeA;sBAU5B,oBAACb,aAAa,aAAa;QACvB,MAAM;QACN,uBAAS,oBAACc,oBAAkBA;sBAEhC,oBAACd,aAAa,aAAa;QACvB,MAAM;QACN,uBAAS,oBAACe,qBAAmBA;QAC7B,OAAO;;AAO3BZ,oBAAoB,WAAW,GAAG"}
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- export declare const DocumentStateEditor: (() => React.JSX.Element) & {
3
- displayName: string;
2
+ export declare const DocumentStateEditor: (() => React.JSX.Element) & React.NamedExoticComponent<unknown> & {
3
+ readonly type: () => React.JSX.Element;
4
4
  };
@@ -12,6 +12,7 @@ import { SelectInputRenderer } from "../../inputRenderers/SelectInput.js";
12
12
  import { FileInputRenderer } from "../../inputRenderers/FileInput.js";
13
13
  import { FragmentSelectorInputRenderer } from "../../inputRenderers/FragmentSelectorInput.js";
14
14
  import { ObjectInputRenderer } from "../../inputRenderers/ObjectInput/ObjectInputRenderer.js";
15
+ import { ColorPickerInputRenderer } from "../../inputRenderers/ColorPickerInput.js";
15
16
  const ElementInputRenderers = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(EditorConfig.ElementInput.Renderer, {
16
17
  name: "Webiny/Slot",
17
18
  component: SlotInputRenderer
@@ -45,6 +46,9 @@ const ElementInputRenderers = ()=>/*#__PURE__*/ react.createElement(react.Fragme
45
46
  }), /*#__PURE__*/ react.createElement(EditorConfig.ElementInput.Renderer, {
46
47
  name: "Webiny/Object",
47
48
  component: ObjectInputRenderer
49
+ }), /*#__PURE__*/ react.createElement(EditorConfig.ElementInput.Renderer, {
50
+ name: "Webiny/ColorPicker",
51
+ component: ColorPickerInputRenderer
48
52
  }));
49
53
  export { ElementInputRenderers };
50
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/ElementInputRenderers.js","sources":["../../../src/BaseEditor/defaultConfig/ElementInputRenderers.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorConfig } from \"~/BaseEditor/index.js\";\nimport { TextInputRenderer } from \"~/inputRenderers/TextInput.js\";\nimport { NumberInputRenderer } from \"~/inputRenderers/NumberInput.js\";\nimport { BooleanInputRenderer } from \"~/inputRenderers/BooleanInput.js\";\nimport { TextareaInputRenderer } from \"~/inputRenderers/TextareaInput.js\";\nimport { LexicalInputRenderer } from \"~/inputRenderers/LexicalInput/LexicalInput.js\";\nimport { DefaultLexicalConfig } from \"~/inputRenderers/LexicalInput/DefaultLexicalConfig.js\";\nimport { SlotInputRenderer } from \"~/inputRenderers/SlotInput.js\";\nimport { GridLayoutInputRenderer } from \"~/inputRenderers/GridLayoutInput.js\";\nimport { SelectInputRenderer } from \"~/inputRenderers/SelectInput.js\";\nimport { FileInputRenderer } from \"~/inputRenderers/FileInput.js\";\nimport { FragmentSelectorInputRenderer } from \"~/inputRenderers/FragmentSelectorInput.js\";\nimport { ObjectInputRenderer } from \"~/inputRenderers/ObjectInput/ObjectInputRenderer.js\";\n\nexport const ElementInputRenderers = () => {\n return (\n <>\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Slot\"}\n component={SlotInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Input\"}\n component={TextInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Select\"}\n component={SelectInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Textarea\"}\n component={TextareaInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Number\"}\n component={NumberInputRenderer}\n />\n {/* Configure Lexical Editor*/}\n <DefaultLexicalConfig />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Lexical\"}\n component={LexicalInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Switch\"}\n component={BooleanInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/GridLayout\"}\n component={GridLayoutInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/FileManager\"}\n component={FileInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/FragmentSelector\"}\n component={FragmentSelectorInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Object\"}\n component={ObjectInputRenderer}\n />\n </>\n );\n};\n"],"names":["ElementInputRenderers","EditorConfig","SlotInputRenderer","TextInputRenderer","SelectInputRenderer","TextareaInputRenderer","NumberInputRenderer","DefaultLexicalConfig","LexicalInputRenderer","BooleanInputRenderer","GridLayoutInputRenderer","FileInputRenderer","FragmentSelectorInputRenderer","ObjectInputRenderer"],"mappings":";;;;;;;;;;;;;;AAeO,MAAMA,wBAAwB,IAC1B,WAAP,GACI,wDACI,oBAACC,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWC;sBAEf,oBAACD,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWE;sBAEf,oBAACF,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWG;sBAEf,oBAACH,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWI;sBAEf,oBAACJ,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWK;sBAGf,oBAACC,sBAAoBA,OAAAA,WAAAA,GACrB,oBAACN,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWO;sBAEf,oBAACP,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWQ;sBAEf,oBAACR,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWS;sBAEf,oBAACT,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWU;sBAEf,oBAACV,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWW;sBAEf,oBAACX,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWY"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/ElementInputRenderers.js","sources":["../../../src/BaseEditor/defaultConfig/ElementInputRenderers.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorConfig } from \"~/BaseEditor/index.js\";\nimport { TextInputRenderer } from \"~/inputRenderers/TextInput.js\";\nimport { NumberInputRenderer } from \"~/inputRenderers/NumberInput.js\";\nimport { BooleanInputRenderer } from \"~/inputRenderers/BooleanInput.js\";\nimport { TextareaInputRenderer } from \"~/inputRenderers/TextareaInput.js\";\nimport { LexicalInputRenderer } from \"~/inputRenderers/LexicalInput/LexicalInput.js\";\nimport { DefaultLexicalConfig } from \"~/inputRenderers/LexicalInput/DefaultLexicalConfig.js\";\nimport { SlotInputRenderer } from \"~/inputRenderers/SlotInput.js\";\nimport { GridLayoutInputRenderer } from \"~/inputRenderers/GridLayoutInput.js\";\nimport { SelectInputRenderer } from \"~/inputRenderers/SelectInput.js\";\nimport { FileInputRenderer } from \"~/inputRenderers/FileInput.js\";\nimport { FragmentSelectorInputRenderer } from \"~/inputRenderers/FragmentSelectorInput.js\";\nimport { ObjectInputRenderer } from \"~/inputRenderers/ObjectInput/ObjectInputRenderer.js\";\nimport { ColorPickerInputRenderer } from \"~/inputRenderers/ColorPickerInput.js\";\n\nexport const ElementInputRenderers = () => {\n return (\n <>\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Slot\"}\n component={SlotInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Input\"}\n component={TextInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Select\"}\n component={SelectInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Textarea\"}\n component={TextareaInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Number\"}\n component={NumberInputRenderer}\n />\n {/* Configure Lexical Editor*/}\n <DefaultLexicalConfig />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Lexical\"}\n component={LexicalInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Switch\"}\n component={BooleanInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/GridLayout\"}\n component={GridLayoutInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/FileManager\"}\n component={FileInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/FragmentSelector\"}\n component={FragmentSelectorInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/Object\"}\n component={ObjectInputRenderer}\n />\n <EditorConfig.ElementInput.Renderer\n name={\"Webiny/ColorPicker\"}\n component={ColorPickerInputRenderer}\n />\n </>\n );\n};\n"],"names":["ElementInputRenderers","EditorConfig","SlotInputRenderer","TextInputRenderer","SelectInputRenderer","TextareaInputRenderer","NumberInputRenderer","DefaultLexicalConfig","LexicalInputRenderer","BooleanInputRenderer","GridLayoutInputRenderer","FileInputRenderer","FragmentSelectorInputRenderer","ObjectInputRenderer","ColorPickerInputRenderer"],"mappings":";;;;;;;;;;;;;;;AAgBO,MAAMA,wBAAwB,IAC1B,WAAP,GACI,wDACI,oBAACC,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWC;sBAEf,oBAACD,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWE;sBAEf,oBAACF,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWG;sBAEf,oBAACH,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWI;sBAEf,oBAACJ,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWK;sBAGf,oBAACC,sBAAoBA,OAAAA,WAAAA,GACrB,oBAACN,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWO;sBAEf,oBAACP,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWQ;sBAEf,oBAACR,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWS;sBAEf,oBAACT,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWU;sBAEf,oBAACV,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWW;sBAEf,oBAACX,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWY;sBAEf,oBAACZ,aAAa,YAAY,CAAC,QAAQ;QAC/B,MAAM;QACN,WAAWa"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const CloneElementAction: () => React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import react, { useCallback } from "react";
2
+ import { DropdownMenu } from "@webiny/admin-ui";
3
+ import { ReactComponent } from "@webiny/icons/content_copy.svg";
4
+ import { useActiveElement } from "../../../hooks/useActiveElement.js";
5
+ import { useDocumentEditor } from "../../../../DocumentEditor/index.js";
6
+ import { Commands } from "../../../index.js";
7
+ const CloneElementAction = ()=>{
8
+ const [element] = useActiveElement();
9
+ const editor = useDocumentEditor();
10
+ const onClick = useCallback(()=>{
11
+ if (element) editor.executeCommand(Commands.CloneElement, {
12
+ id: element.id
13
+ });
14
+ }, [
15
+ element?.id
16
+ ]);
17
+ return /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
18
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
19
+ text: "Clone",
20
+ onClick: onClick
21
+ });
22
+ };
23
+ export { CloneElementAction };
24
+
25
+ //# sourceMappingURL=CloneElementAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementActions/CloneElementAction.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementActions/CloneElementAction.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { DropdownMenu } from \"@webiny/admin-ui\";\nimport { ReactComponent as ContentCopyIcon } from \"@webiny/icons/content_copy.svg\";\nimport { useActiveElement } from \"~/BaseEditor/hooks/useActiveElement.js\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\nimport { Commands } from \"~/BaseEditor/index.js\";\n\nexport const CloneElementAction = () => {\n const [element] = useActiveElement();\n const editor = useDocumentEditor();\n\n const onClick = useCallback(() => {\n if (element) {\n editor.executeCommand(Commands.CloneElement, { id: element.id });\n }\n }, [element?.id]);\n\n return <DropdownMenu.Item icon={<ContentCopyIcon />} text={\"Clone\"} onClick={onClick} />;\n};\n"],"names":["CloneElementAction","element","useActiveElement","editor","useDocumentEditor","onClick","useCallback","Commands","DropdownMenu","ContentCopyIcon"],"mappings":";;;;;;AAOO,MAAMA,qBAAqB;IAC9B,MAAM,CAACC,QAAQ,GAAGC;IAClB,MAAMC,SAASC;IAEf,MAAMC,UAAUC,YAAY;QACxB,IAAIL,SACAE,OAAO,cAAc,CAACI,SAAS,YAAY,EAAE;YAAE,IAAIN,QAAQ,EAAE;QAAC;IAEtE,GAAG;QAACA,SAAS;KAAG;IAEhB,OAAO,WAAP,GAAO,oBAACO,aAAa,IAAI;QAAC,oBAAM,oBAACC,gBAAeA;QAAK,MAAM;QAAS,SAASJ;;AACjF"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const DeleteElementAction: () => React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import react, { useCallback } from "react";
2
+ import { DropdownMenu } from "@webiny/admin-ui";
3
+ import { ReactComponent } from "@webiny/icons/delete.svg";
4
+ import { useActiveElement } from "../../../hooks/useActiveElement.js";
5
+ import { useDocumentEditor } from "../../../../DocumentEditor/index.js";
6
+ import { Commands } from "../../../index.js";
7
+ const DeleteElementAction = ()=>{
8
+ const [element] = useActiveElement();
9
+ const editor = useDocumentEditor();
10
+ const onClick = useCallback(()=>{
11
+ if (element) editor.executeCommand(Commands.DeleteElement, {
12
+ id: element.id
13
+ });
14
+ }, [
15
+ element?.id
16
+ ]);
17
+ return /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
18
+ className: "text-destructive-primary [&_svg]:fill-destructive",
19
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
20
+ text: "Delete",
21
+ onClick: onClick
22
+ });
23
+ };
24
+ export { DeleteElementAction };
25
+
26
+ //# sourceMappingURL=DeleteElementAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementActions/DeleteElementAction.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementActions/DeleteElementAction.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { DropdownMenu } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useActiveElement } from \"~/BaseEditor/hooks/useActiveElement.js\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\nimport { Commands } from \"~/BaseEditor/index.js\";\n\nexport const DeleteElementAction = () => {\n const [element] = useActiveElement();\n const editor = useDocumentEditor();\n\n const onClick = useCallback(() => {\n if (element) {\n editor.executeCommand(Commands.DeleteElement, { id: element.id });\n }\n }, [element?.id]);\n\n return (\n <DropdownMenu.Item\n className={\"text-destructive-primary [&_svg]:fill-destructive\"}\n icon={<DeleteIcon />}\n text={\"Delete\"}\n onClick={onClick}\n />\n );\n};\n"],"names":["DeleteElementAction","element","useActiveElement","editor","useDocumentEditor","onClick","useCallback","Commands","DropdownMenu","DeleteIcon"],"mappings":";;;;;;AAOO,MAAMA,sBAAsB;IAC/B,MAAM,CAACC,QAAQ,GAAGC;IAClB,MAAMC,SAASC;IAEf,MAAMC,UAAUC,YAAY;QACxB,IAAIL,SACAE,OAAO,cAAc,CAACI,SAAS,aAAa,EAAE;YAAE,IAAIN,QAAQ,EAAE;QAAC;IAEvE,GAAG;QAACA,SAAS;KAAG;IAEhB,OAAO,WAAP,GACI,oBAACO,aAAa,IAAI;QACd,WAAW;QACX,oBAAM,oBAACC,gBAAUA;QACjB,MAAM;QACN,SAASJ;;AAGrB"}
@@ -1,10 +1,14 @@
1
1
  import react from "react";
2
2
  import { useComponent } from "../../hooks/useComponent.js";
3
- import { Icon } from "@webiny/admin-ui";
3
+ import { DropdownMenu, Icon, IconButton } from "@webiny/admin-ui";
4
4
  import { InlineSvg } from "../Toolbar/InsertElements/InlineSvg.js";
5
+ import { ReactComponent } from "@webiny/icons/more_vert.svg";
6
+ import { ElementActions } from "../../config/ElementAction.js";
5
7
  const ElementPreview = ({ element })=>{
6
8
  const component = useComponent(element.component.name);
7
9
  return /*#__PURE__*/ react.createElement("div", {
10
+ className: "flex items-center justify-between"
11
+ }, /*#__PURE__*/ react.createElement("div", {
8
12
  className: "flex items-center gap-sm"
9
13
  }, /*#__PURE__*/ react.createElement("div", {
10
14
  className: "fill-accent-default"
@@ -16,7 +20,13 @@ const ElementPreview = ({ element })=>{
16
20
  label: component.label ?? element.component.name
17
21
  })), /*#__PURE__*/ react.createElement("span", {
18
22
  className: "text-md font-semibold text-neutral-primary"
19
- }, component.label ?? element.component.name));
23
+ }, component.label ?? element.component.name)), /*#__PURE__*/ react.createElement(DropdownMenu, {
24
+ trigger: /*#__PURE__*/ react.createElement(IconButton, {
25
+ variant: "ghost",
26
+ size: "sm",
27
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null)
28
+ })
29
+ }, /*#__PURE__*/ react.createElement(ElementActions, null)));
20
30
  };
21
31
  export { ElementPreview };
22
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementPreview.js","sources":["../../../../src/BaseEditor/defaultConfig/Sidebar/ElementPreview.tsx"],"sourcesContent":["import React from \"react\";\nimport type { DocumentElement } from \"@webiny/website-builder-sdk\";\nimport { useComponent } from \"~/BaseEditor/hooks/useComponent.js\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport { InlineSvg } from \"~/BaseEditor/defaultConfig/Toolbar/InsertElements/InlineSvg.js\";\n\ninterface ElementPreviewProps {\n element: DocumentElement;\n}\n\nexport const ElementPreview = ({ element }: ElementPreviewProps) => {\n const component = useComponent(element.component.name);\n\n return (\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"fill-accent-default\"}>\n {component.image && (\n <Icon\n icon={<InlineSvg src={component.image} />}\n size={\"md\"}\n label={component.label ?? element.component.name}\n />\n )}\n </div>\n <span className={\"text-md font-semibold text-neutral-primary\"}>\n {component.label ?? element.component.name}\n </span>\n </div>\n );\n};\n"],"names":["ElementPreview","element","component","useComponent","Icon","InlineSvg"],"mappings":";;;;AAUO,MAAMA,iBAAiB,CAAC,EAAEC,OAAO,EAAuB;IAC3D,MAAMC,YAAYC,aAAaF,QAAQ,SAAS,CAAC,IAAI;IAErD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;OACXC,UAAU,KAAK,IAAI,WAAJ,GACZ,oBAACE,MAAIA;QACD,oBAAM,oBAACC,WAASA;YAAC,KAAKH,UAAU,KAAK;;QACrC,MAAM;QACN,OAAOA,UAAU,KAAK,IAAID,QAAQ,SAAS,CAAC,IAAI;uBAI5D,oBAAC;QAAK,WAAW;OACZC,UAAU,KAAK,IAAID,QAAQ,SAAS,CAAC,IAAI;AAI1D"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementPreview.js","sources":["../../../../src/BaseEditor/defaultConfig/Sidebar/ElementPreview.tsx"],"sourcesContent":["import React from \"react\";\nimport type { DocumentElement } from \"@webiny/website-builder-sdk\";\nimport { useComponent } from \"~/BaseEditor/hooks/useComponent.js\";\nimport { DropdownMenu, Icon, IconButton } from \"@webiny/admin-ui\";\nimport { InlineSvg } from \"~/BaseEditor/defaultConfig/Toolbar/InsertElements/InlineSvg.js\";\nimport { ReactComponent as MoreVerticalIcon } from \"@webiny/icons/more_vert.svg\";\nimport { ElementActions } from \"~/BaseEditor/config/ElementAction.js\";\n\ninterface ElementPreviewProps {\n element: DocumentElement;\n}\n\nexport const ElementPreview = ({ element }: ElementPreviewProps) => {\n const component = useComponent(element.component.name);\n\n return (\n <div className={\"flex items-center justify-between\"}>\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"fill-accent-default\"}>\n {component.image && (\n <Icon\n icon={<InlineSvg src={component.image} />}\n size={\"md\"}\n label={component.label ?? element.component.name}\n />\n )}\n </div>\n <span className={\"text-md font-semibold text-neutral-primary\"}>\n {component.label ?? element.component.name}\n </span>\n </div>\n <DropdownMenu\n trigger={<IconButton variant={\"ghost\"} size={\"sm\"} icon={<MoreVerticalIcon />} />}\n >\n <ElementActions />\n </DropdownMenu>\n </div>\n );\n};\n"],"names":["ElementPreview","element","component","useComponent","Icon","InlineSvg","DropdownMenu","IconButton","MoreVerticalIcon","ElementActions"],"mappings":";;;;;;AAYO,MAAMA,iBAAiB,CAAC,EAAEC,OAAO,EAAuB;IAC3D,MAAMC,YAAYC,aAAaF,QAAQ,SAAS,CAAC,IAAI;IAErD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;OACXC,UAAU,KAAK,IAAI,WAAJ,GACZ,oBAACE,MAAIA;QACD,oBAAM,oBAACC,WAASA;YAAC,KAAKH,UAAU,KAAK;;QACrC,MAAM;QACN,OAAOA,UAAU,KAAK,IAAID,QAAQ,SAAS,CAAC,IAAI;uBAI5D,oBAAC;QAAK,WAAW;OACZC,UAAU,KAAK,IAAID,QAAQ,SAAS,CAAC,IAAI,kBAGlD,oBAACK,cAAYA;QACT,uBAAS,oBAACC,YAAUA;YAAC,SAAS;YAAS,MAAM;YAAM,oBAAM,oBAACC,gBAAgBA;;qBAE1E,oBAACC,gBAAcA;AAI/B"}
@@ -6,7 +6,6 @@ import { InputRenderer } from "./InputRenderer.js";
6
6
  import { ComponentManifestToAstConverter } from "@webiny/website-builder-sdk";
7
7
  import { useSelectFromDocument } from "../../../hooks/useSelectFromDocument.js";
8
8
  import { InfoMessage } from "../InfoMessage.js";
9
- import { ElementPreview } from "../ElementPreview.js";
10
9
  const ElementInputs = makeDecoratable("ElementInputs", ({ element })=>{
11
10
  const component = useComponent(element.component.name);
12
11
  const bindings = useSelectFromDocument((document)=>document.bindings[element.id] ?? {
@@ -25,11 +24,7 @@ const ElementInputs = makeDecoratable("ElementInputs", ({ element })=>{
25
24
  return /*#__PURE__*/ react.createElement(Grid, {
26
25
  gap: "compact",
27
26
  className: "pt-md px-sm"
28
- }, /*#__PURE__*/ react.createElement(Grid.Column, {
29
- span: 12
30
- }, /*#__PURE__*/ react.createElement(ElementPreview, {
31
- element: element
32
- })), hasEditableInputs ? /*#__PURE__*/ react.createElement(react.Fragment, null) : /*#__PURE__*/ react.createElement(Grid.Column, {
27
+ }, hasEditableInputs ? /*#__PURE__*/ react.createElement(react.Fragment, null) : /*#__PURE__*/ react.createElement(Grid.Column, {
33
28
  span: 12
34
29
  }, /*#__PURE__*/ react.createElement(InfoMessage, {
35
30
  message: "This element has no inputs."
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Grid } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { DocumentElement } from \"@webiny/website-builder-sdk\";\nimport { useComponent } from \"~/BaseEditor/hooks/useComponent.js\";\nimport { InputRenderer } from \"./InputRenderer.js\";\nimport { ComponentManifestToAstConverter } from \"@webiny/website-builder-sdk\";\nimport { useSelectFromDocument } from \"~/BaseEditor/hooks/useSelectFromDocument.js\";\nimport { InfoMessage } from \"~/BaseEditor/defaultConfig/Sidebar/InfoMessage.js\";\nimport { ElementPreview } from \"../ElementPreview.js\";\n\ninterface ElementInputsProps {\n element: DocumentElement;\n}\n\nexport const ElementInputs = makeDecoratable(\"ElementInputs\", ({ element }: ElementInputsProps) => {\n const component = useComponent(element.component.name);\n\n const bindings = useSelectFromDocument(\n document => {\n return document.bindings[element.id] ?? { inputs: {} };\n },\n [element.id]\n );\n\n const inputsAst = useMemo(() => {\n return ComponentManifestToAstConverter.convert(component.inputs ?? []);\n }, [component.name, element.id]);\n\n const hasEditableInputs = useMemo(() => {\n return inputsAst.filter(input => input.type !== \"slot\").length > 0;\n }, [inputsAst]);\n\n if (!element) {\n return null;\n }\n\n return (\n <Grid gap={\"compact\"} className={\"pt-md px-sm\"}>\n <Grid.Column span={12}>\n <ElementPreview element={element} />\n </Grid.Column>\n {!hasEditableInputs ? (\n <Grid.Column span={12}>\n <InfoMessage message={\"This element has no inputs.\"} />\n </Grid.Column>\n ) : (\n <></>\n )}\n\n <InputRenderer key={element.id} ast={inputsAst} bindings={bindings.inputs} />\n </Grid>\n );\n});\n\n// interface ElementInputProps {\n// element: DocumentElement;\n// input: ComponentInput;\n// }\n//\n// const ElementInput = ({ element, input }: ElementInputProps) => {\n// const Renderer = useInputRenderer(input.renderer || \"__unknown__\");\n//\n// const { value, onChange, onPreviewChange, setBindingType } = useInputValue(element, input);\n//\n// /* return (\n// <Renderer\n// value={value.static}\n// input={input}\n// onChange={onChange}\n// onPreviewChange={onPreviewChange}\n// />\n// );*/\n// if (value.expression) {\n// return (\n// <WithBindingToggle type={\"expression\"} setBindingType={setBindingType}>\n// <ExpressionRenderer\n// element={element}\n// value={value.expression}\n// onChange={onChange}\n// input={input}\n// />\n// </WithBindingToggle>\n// );\n// }\n//\n// return (\n// <WithBindingToggle type={\"static\"} setBindingType={setBindingType}>\n// <Renderer\n// value={value.static}\n// input={input}\n// onChange={onChange}\n// onPreviewChange={onPreviewChange}\n// />\n// </WithBindingToggle>\n// );\n// };\n"],"names":["ElementInputs","makeDecoratable","element","component","useComponent","bindings","useSelectFromDocument","document","inputsAst","useMemo","ComponentManifestToAstConverter","hasEditableInputs","input","Grid","ElementPreview","InfoMessage","InputRenderer"],"mappings":";;;;;;;;;AAeO,MAAMA,gBAAgBC,gBAAgB,iBAAiB,CAAC,EAAEC,OAAO,EAAsB;IAC1F,MAAMC,YAAYC,aAAaF,QAAQ,SAAS,CAAC,IAAI;IAErD,MAAMG,WAAWC,sBACbC,CAAAA,WACWA,SAAS,QAAQ,CAACL,QAAQ,EAAE,CAAC,IAAI;YAAE,QAAQ,CAAC;QAAE,GAEzD;QAACA,QAAQ,EAAE;KAAC;IAGhB,MAAMM,YAAYC,QAAQ,IACfC,gCAAgC,OAAO,CAACP,UAAU,MAAM,IAAI,EAAE,GACtE;QAACA,UAAU,IAAI;QAAED,QAAQ,EAAE;KAAC;IAE/B,MAAMS,oBAAoBF,QAAQ,IACvBD,UAAU,MAAM,CAACI,CAAAA,QAASA,AAAe,WAAfA,MAAM,IAAI,EAAa,MAAM,GAAG,GAClE;QAACJ;KAAU;IAEd,IAAI,CAACN,SACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACW,MAAIA;QAAC,KAAK;QAAW,WAAW;qBAC7B,oBAACA,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACC,gBAAcA;QAAC,SAASZ;SAE5B,AAACS,oB,cAKE,4CALkB,WAApBA,GACE,oBAACE,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,aAAWA;QAAC,SAAS;SAG1B,cAGJ,oBAACC,eAAaA;QAAC,KAAKd,QAAQ,EAAE;QAAE,KAAKM;QAAW,UAAUH,SAAS,MAAM;;AAGrF"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Grid } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { DocumentElement } from \"@webiny/website-builder-sdk\";\nimport { useComponent } from \"~/BaseEditor/hooks/useComponent.js\";\nimport { InputRenderer } from \"./InputRenderer.js\";\nimport { ComponentManifestToAstConverter } from \"@webiny/website-builder-sdk\";\nimport { useSelectFromDocument } from \"~/BaseEditor/hooks/useSelectFromDocument.js\";\nimport { InfoMessage } from \"~/BaseEditor/defaultConfig/Sidebar/InfoMessage.js\";\n\ninterface ElementInputsProps {\n element: DocumentElement;\n}\n\nexport const ElementInputs = makeDecoratable(\"ElementInputs\", ({ element }: ElementInputsProps) => {\n const component = useComponent(element.component.name);\n\n const bindings = useSelectFromDocument(\n document => {\n return document.bindings[element.id] ?? { inputs: {} };\n },\n [element.id]\n );\n\n const inputsAst = useMemo(() => {\n return ComponentManifestToAstConverter.convert(component.inputs ?? []);\n }, [component.name, element.id]);\n\n const hasEditableInputs = useMemo(() => {\n return inputsAst.filter(input => input.type !== \"slot\").length > 0;\n }, [inputsAst]);\n\n if (!element) {\n return null;\n }\n\n return (\n <Grid gap={\"compact\"} className={\"pt-md px-sm\"}>\n {!hasEditableInputs ? (\n <Grid.Column span={12}>\n <InfoMessage message={\"This element has no inputs.\"} />\n </Grid.Column>\n ) : (\n <></>\n )}\n\n <InputRenderer key={element.id} ast={inputsAst} bindings={bindings.inputs} />\n </Grid>\n );\n});\n\n// interface ElementInputProps {\n// element: DocumentElement;\n// input: ComponentInput;\n// }\n//\n// const ElementInput = ({ element, input }: ElementInputProps) => {\n// const Renderer = useInputRenderer(input.renderer || \"__unknown__\");\n//\n// const { value, onChange, onPreviewChange, setBindingType } = useInputValue(element, input);\n//\n// /* return (\n// <Renderer\n// value={value.static}\n// input={input}\n// onChange={onChange}\n// onPreviewChange={onPreviewChange}\n// />\n// );*/\n// if (value.expression) {\n// return (\n// <WithBindingToggle type={\"expression\"} setBindingType={setBindingType}>\n// <ExpressionRenderer\n// element={element}\n// value={value.expression}\n// onChange={onChange}\n// input={input}\n// />\n// </WithBindingToggle>\n// );\n// }\n//\n// return (\n// <WithBindingToggle type={\"static\"} setBindingType={setBindingType}>\n// <Renderer\n// value={value.static}\n// input={input}\n// onChange={onChange}\n// onPreviewChange={onPreviewChange}\n// />\n// </WithBindingToggle>\n// );\n// };\n"],"names":["ElementInputs","makeDecoratable","element","component","useComponent","bindings","useSelectFromDocument","document","inputsAst","useMemo","ComponentManifestToAstConverter","hasEditableInputs","input","Grid","InfoMessage","InputRenderer"],"mappings":";;;;;;;;AAcO,MAAMA,gBAAgBC,gBAAgB,iBAAiB,CAAC,EAAEC,OAAO,EAAsB;IAC1F,MAAMC,YAAYC,aAAaF,QAAQ,SAAS,CAAC,IAAI;IAErD,MAAMG,WAAWC,sBACbC,CAAAA,WACWA,SAAS,QAAQ,CAACL,QAAQ,EAAE,CAAC,IAAI;YAAE,QAAQ,CAAC;QAAE,GAEzD;QAACA,QAAQ,EAAE;KAAC;IAGhB,MAAMM,YAAYC,QAAQ,IACfC,gCAAgC,OAAO,CAACP,UAAU,MAAM,IAAI,EAAE,GACtE;QAACA,UAAU,IAAI;QAAED,QAAQ,EAAE;KAAC;IAE/B,MAAMS,oBAAoBF,QAAQ,IACvBD,UAAU,MAAM,CAACI,CAAAA,QAASA,AAAe,WAAfA,MAAM,IAAI,EAAa,MAAM,GAAG,GAClE;QAACJ;KAAU;IAEd,IAAI,CAACN,SACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAACW,MAAIA;QAAC,KAAK;QAAW,WAAW;OAC5B,AAACF,oB,cAKE,4CALkB,WAApBA,GACE,oBAACE,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACC,aAAWA;QAAC,SAAS;SAG1B,cAGJ,oBAACC,eAAaA;QAAC,KAAKb,QAAQ,EAAE;QAAE,KAAKM;QAAW,UAAUH,SAAS,MAAM;;AAGrF"}
@@ -1,12 +1,21 @@
1
1
  import react from "react";
2
+ import { Grid } from "@webiny/admin-ui";
2
3
  import { useActiveElement } from "../../../hooks/useActiveElement.js";
3
4
  import { ElementInputs } from "./ElementInputs.js";
5
+ import { ElementPreview } from "../ElementPreview.js";
4
6
  const ElementSettings = ()=>{
5
7
  const [element] = useActiveElement();
6
8
  if (!element) return null;
7
- return /*#__PURE__*/ react.createElement(ElementInputs, {
9
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Grid, {
10
+ gap: "compact",
11
+ className: "pt-md px-sm"
12
+ }, /*#__PURE__*/ react.createElement(Grid.Column, {
13
+ span: 12
14
+ }, /*#__PURE__*/ react.createElement(ElementPreview, {
8
15
  element: element
9
- });
16
+ }))), /*#__PURE__*/ react.createElement(ElementInputs, {
17
+ element: element
18
+ }));
10
19
  };
11
20
  export { ElementSettings };
12
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.tsx"],"sourcesContent":["import React from \"react\";\nimport { useActiveElement } from \"~/BaseEditor/hooks/useActiveElement.js\";\nimport { ElementInputs } from \"./ElementInputs.js\";\n\nexport const ElementSettings = () => {\n const [element] = useActiveElement();\n\n if (!element) {\n return null;\n }\n\n return <ElementInputs element={element} />;\n};\n"],"names":["ElementSettings","element","useActiveElement","ElementInputs"],"mappings":";;;AAIO,MAAMA,kBAAkB;IAC3B,MAAM,CAACC,QAAQ,GAAGC;IAElB,IAAI,CAACD,SACD,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACE,eAAaA;QAAC,SAASF;;AACnC"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettings.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid } from \"@webiny/admin-ui\";\nimport { useActiveElement } from \"~/BaseEditor/hooks/useActiveElement.js\";\nimport { ElementInputs } from \"./ElementInputs.js\";\nimport { ElementPreview } from \"../ElementPreview.js\";\n\nexport const ElementSettings = () => {\n const [element] = useActiveElement();\n\n if (!element) {\n return null;\n }\n\n return (\n <>\n <Grid gap={\"compact\"} className={\"pt-md px-sm\"}>\n <Grid.Column span={12}>\n <ElementPreview element={element} />\n </Grid.Column>\n </Grid>\n <ElementInputs element={element} />\n </>\n );\n};\n"],"names":["ElementSettings","element","useActiveElement","Grid","ElementPreview","ElementInputs"],"mappings":";;;;;AAMO,MAAMA,kBAAkB;IAC3B,MAAM,CAACC,QAAQ,GAAGC;IAElB,IAAI,CAACD,SACD,OAAO;IAGX,OAAO,WAAP,GACI,wDACI,oBAACE,MAAIA;QAAC,KAAK;QAAW,WAAW;qBAC7B,oBAACA,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACC,gBAAcA;QAAC,SAASH;wBAGjC,oBAACI,eAAaA;QAAC,SAASJ;;AAGpC"}
@@ -1,6 +1,10 @@
1
1
  import React from "react";
2
2
  export declare const BackgroundColor: (({ elementId }: {
3
3
  elementId: string;
4
- }) => React.JSX.Element) & {
5
- displayName: string;
4
+ }) => React.JSX.Element) & React.NamedExoticComponent<{
5
+ elementId: string;
6
+ }> & {
7
+ readonly type: ({ elementId }: {
8
+ elementId: string;
9
+ }) => React.JSX.Element;
6
10
  };
@@ -2,6 +2,10 @@ import React from "react";
2
2
  export declare const parseValue: (value: string) => undefined;
3
3
  export declare const BackgroundImage: (({ elementId }: {
4
4
  elementId: string;
5
- }) => React.JSX.Element) & {
6
- displayName: string;
5
+ }) => React.JSX.Element) & React.NamedExoticComponent<{
6
+ elementId: string;
7
+ }> & {
8
+ readonly type: ({ elementId }: {
9
+ elementId: string;
10
+ }) => React.JSX.Element;
7
11
  };
@@ -1,6 +1,10 @@
1
1
  import React from "react";
2
2
  export declare const BackgroundPosition: (({ elementId }: {
3
3
  elementId: string;
4
- }) => React.JSX.Element) & {
5
- displayName: string;
4
+ }) => React.JSX.Element) & React.NamedExoticComponent<{
5
+ elementId: string;
6
+ }> & {
7
+ readonly type: ({ elementId }: {
8
+ elementId: string;
9
+ }) => React.JSX.Element;
6
10
  };
@@ -1,6 +1,10 @@
1
1
  import React from "react";
2
2
  export declare const BackgroundScaling: (({ elementId }: {
3
3
  elementId: string;
4
- }) => React.JSX.Element) & {
5
- displayName: string;
4
+ }) => React.JSX.Element) & React.NamedExoticComponent<{
5
+ elementId: string;
6
+ }> & {
7
+ readonly type: ({ elementId }: {
8
+ elementId: string;
9
+ }) => React.JSX.Element;
6
10
  };
@@ -2,7 +2,7 @@ import React from "react";
2
2
  interface BorderColorProps {
3
3
  elementId: string;
4
4
  }
5
- export declare const BorderColor: (({ elementId }: BorderColorProps) => React.JSX.Element) & {
6
- displayName: string;
5
+ export declare const BorderColor: (({ elementId }: BorderColorProps) => React.JSX.Element) & React.NamedExoticComponent<BorderColorProps> & {
6
+ readonly type: ({ elementId }: BorderColorProps) => React.JSX.Element;
7
7
  };
8
8
  export {};
@@ -2,7 +2,7 @@ import React from "react";
2
2
  interface BorderRadiusProps {
3
3
  elementId: string;
4
4
  }
5
- export declare const BorderRadius: (({ elementId }: BorderRadiusProps) => React.JSX.Element) & {
6
- displayName: string;
5
+ export declare const BorderRadius: (({ elementId }: BorderRadiusProps) => React.JSX.Element) & React.NamedExoticComponent<BorderRadiusProps> & {
6
+ readonly type: ({ elementId }: BorderRadiusProps) => React.JSX.Element;
7
7
  };
8
8
  export {};