@gravity-ui/page-constructor 6.3.2-alpha.0 → 6.3.2-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 (379) hide show
  1. package/build/cjs/blocks/ContentLayout/index.d.ts +1 -1
  2. package/build/cjs/blocks/ExtendedFeatures/index.d.ts +1 -1
  3. package/build/cjs/blocks/FilterBlock/index.d.ts +1 -1
  4. package/build/cjs/blocks/Form/index.d.ts +1 -1
  5. package/build/cjs/blocks/Header/index.d.ts +1 -1
  6. package/build/cjs/blocks/HeaderSlider/index.d.ts +1 -1
  7. package/build/cjs/blocks/Icons/index.d.ts +1 -1
  8. package/build/cjs/blocks/Info/index.d.ts +1 -1
  9. package/build/cjs/blocks/Map/index.d.ts +1 -1
  10. package/build/cjs/blocks/Media/index.d.ts +1 -1
  11. package/build/cjs/blocks/PromoFeaturesBlock/index.d.ts +1 -1
  12. package/build/cjs/blocks/Questions/index.d.ts +1 -1
  13. package/build/cjs/blocks/Share/index.d.ts +1 -1
  14. package/build/cjs/blocks/Slider/index.d.ts +1 -1
  15. package/build/cjs/blocks/Table/index.d.ts +1 -1
  16. package/build/cjs/blocks/Tabs/index.d.ts +1 -1
  17. package/build/cjs/blocks/TestEditorBlock/index.d.ts +1 -1
  18. package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.css +0 -0
  19. package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.d.ts +9 -0
  20. package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js +115 -0
  21. package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -0
  22. package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +89 -0
  23. package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.d.ts +12 -0
  24. package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +27 -0
  25. package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -0
  26. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.css +37 -0
  27. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.d.ts +11 -0
  28. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.js +68 -0
  29. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.js.map +1 -0
  30. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.d.ts +10 -0
  31. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js +22 -0
  32. package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js.map +1 -0
  33. package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.css +3 -0
  34. package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.d.ts +8 -0
  35. package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js +13 -0
  36. package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js.map +1 -0
  37. package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.d.ts +8 -0
  38. package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.js +16 -0
  39. package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.js.map +1 -0
  40. package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.d.ts +10 -0
  41. package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.js +12 -0
  42. package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.js.map +1 -0
  43. package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.css +6 -0
  44. package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.d.ts +9 -0
  45. package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js +35 -0
  46. package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js.map +1 -0
  47. package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.css +3 -0
  48. package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.d.ts +11 -0
  49. package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.js +14 -0
  50. package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.js.map +1 -0
  51. package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.d.ts +8 -0
  52. package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.js +13 -0
  53. package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.js.map +1 -0
  54. package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.d.ts +8 -0
  55. package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js +13 -0
  56. package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js.map +1 -0
  57. package/build/cjs/editor-v2/components/DynamicForm/utils.d.ts +3 -0
  58. package/build/cjs/editor-v2/components/DynamicForm/utils.js +23 -0
  59. package/build/cjs/editor-v2/components/DynamicForm/utils.js.map +1 -0
  60. package/build/cjs/editor-v2/components/Panels/Panels.css +37 -0
  61. package/build/cjs/editor-v2/components/Panels/Panels.d.ts +8 -0
  62. package/build/cjs/editor-v2/components/Panels/Panels.js +28 -0
  63. package/build/cjs/editor-v2/components/Panels/Panels.js.map +1 -0
  64. package/build/cjs/editor-v2/components/Sidebar/Sidebar.css +24 -0
  65. package/build/cjs/editor-v2/components/Sidebar/Sidebar.d.ts +10 -0
  66. package/build/cjs/editor-v2/components/Sidebar/Sidebar.js +13 -0
  67. package/build/cjs/editor-v2/components/Sidebar/Sidebar.js.map +1 -0
  68. package/build/cjs/editor-v2/components/StoreViewer/StoreViewer.css +29 -0
  69. package/build/cjs/editor-v2/components/StoreViewer/StoreViewer.d.ts +6 -0
  70. package/build/cjs/editor-v2/components/StoreViewer/StoreViewer.js +17 -0
  71. package/build/cjs/editor-v2/components/StoreViewer/StoreViewer.js.map +1 -0
  72. package/build/cjs/editor-v2/components/Tabs/Tabs.css +26 -0
  73. package/build/cjs/editor-v2/components/Tabs/Tabs.d.ts +13 -0
  74. package/build/cjs/editor-v2/components/Tabs/Tabs.js +32 -0
  75. package/build/cjs/editor-v2/components/Tabs/Tabs.js.map +1 -0
  76. package/build/cjs/editor-v2/constants.d.ts +1 -0
  77. package/build/cjs/editor-v2/constants.js +5 -0
  78. package/build/cjs/editor-v2/constants.js.map +1 -0
  79. package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.css +35 -0
  80. package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.d.ts +4 -0
  81. package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.js +58 -0
  82. package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.js.map +1 -0
  83. package/build/cjs/editor-v2/containers/BlockConfig/BlockConfig.css +33 -0
  84. package/build/cjs/editor-v2/containers/BlockConfig/BlockConfig.d.ts +5 -0
  85. package/build/cjs/editor-v2/containers/BlockConfig/BlockConfig.js +28 -0
  86. package/build/cjs/editor-v2/containers/BlockConfig/BlockConfig.js.map +1 -0
  87. package/build/cjs/editor-v2/containers/BlocksList/BlocksList.css +65 -0
  88. package/build/cjs/editor-v2/containers/BlocksList/BlocksList.d.ts +2 -0
  89. package/build/cjs/editor-v2/containers/BlocksList/BlocksList.js +43 -0
  90. package/build/cjs/editor-v2/containers/BlocksList/BlocksList.js.map +1 -0
  91. package/build/cjs/editor-v2/containers/Editor/Editor.css +51 -0
  92. package/build/cjs/editor-v2/containers/Editor/Editor.d.ts +21 -0
  93. package/build/cjs/editor-v2/containers/Editor/Editor.js +40 -0
  94. package/build/cjs/editor-v2/containers/Editor/Editor.js.map +1 -0
  95. package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.css +24 -0
  96. package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.d.ts +5 -0
  97. package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.js +17 -0
  98. package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.js.map +1 -0
  99. package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.css +62 -0
  100. package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.d.ts +7 -0
  101. package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js +34 -0
  102. package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -0
  103. package/build/cjs/editor-v2/containers/Overlay/Overlay.css +60 -0
  104. package/build/cjs/editor-v2/containers/Overlay/Overlay.d.ts +6 -0
  105. package/build/cjs/editor-v2/containers/Overlay/Overlay.js +90 -0
  106. package/build/cjs/editor-v2/containers/Overlay/Overlay.js.map +1 -0
  107. package/build/cjs/editor-v2/containers/Source/Source.css +27 -0
  108. package/build/cjs/editor-v2/containers/Source/Source.d.ts +2 -0
  109. package/build/cjs/editor-v2/containers/Source/Source.js +28 -0
  110. package/build/cjs/editor-v2/containers/Source/Source.js.map +1 -0
  111. package/build/cjs/editor-v2/containers/SourceCode/SourceCode.css +50 -0
  112. package/build/cjs/editor-v2/containers/SourceCode/SourceCode.d.ts +6 -0
  113. package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js +41 -0
  114. package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js.map +1 -0
  115. package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.css +3 -0
  116. package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.d.ts +7 -0
  117. package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js +18 -0
  118. package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js.map +1 -0
  119. package/build/cjs/editor-v2/containers/Tree/DragContext.css +38 -0
  120. package/build/cjs/editor-v2/containers/Tree/DragContext.d.ts +14 -0
  121. package/build/cjs/editor-v2/containers/Tree/DragContext.js +49 -0
  122. package/build/cjs/editor-v2/containers/Tree/DragContext.js.map +1 -0
  123. package/build/cjs/editor-v2/containers/Tree/Tree.css +23 -0
  124. package/build/cjs/editor-v2/containers/Tree/Tree.d.ts +2 -0
  125. package/build/cjs/editor-v2/containers/Tree/Tree.js +36 -0
  126. package/build/cjs/editor-v2/containers/Tree/Tree.js.map +1 -0
  127. package/build/cjs/editor-v2/containers/Tree/TreeContent.css +28 -0
  128. package/build/cjs/editor-v2/containers/Tree/TreeContent.d.ts +16 -0
  129. package/build/cjs/editor-v2/containers/Tree/TreeContent.js +61 -0
  130. package/build/cjs/editor-v2/containers/Tree/TreeContent.js.map +1 -0
  131. package/build/cjs/editor-v2/containers/Tree/TreeItem.css +66 -0
  132. package/build/cjs/editor-v2/containers/Tree/TreeItem.d.ts +13 -0
  133. package/build/cjs/editor-v2/containers/Tree/TreeItem.js +144 -0
  134. package/build/cjs/editor-v2/containers/Tree/TreeItem.js.map +1 -0
  135. package/build/cjs/editor-v2/containers/Tree/index.d.ts +4 -0
  136. package/build/cjs/editor-v2/containers/Tree/index.js +10 -0
  137. package/build/cjs/editor-v2/containers/Tree/index.js.map +1 -0
  138. package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.css +23 -0
  139. package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.d.ts +3 -0
  140. package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js +54 -0
  141. package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -0
  142. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.d.ts +7 -0
  143. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.js +10 -0
  144. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.js.map +1 -0
  145. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.d.ts +5 -0
  146. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.js +35 -0
  147. package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.js.map +1 -0
  148. package/build/cjs/editor-v2/context/editorStore/index.d.ts +2 -0
  149. package/build/cjs/editor-v2/context/editorStore/index.js +6 -0
  150. package/build/cjs/editor-v2/context/editorStore/index.js.map +1 -0
  151. package/build/cjs/editor-v2/context/iframeContext/IframeContext.d.ts +12 -0
  152. package/build/cjs/editor-v2/context/iframeContext/IframeContext.js +14 -0
  153. package/build/cjs/editor-v2/context/iframeContext/IframeContext.js.map +1 -0
  154. package/build/cjs/editor-v2/context/iframeContext/IframeProvider.d.ts +7 -0
  155. package/build/cjs/editor-v2/context/iframeContext/IframeProvider.js +21 -0
  156. package/build/cjs/editor-v2/context/iframeContext/IframeProvider.js.map +1 -0
  157. package/build/cjs/editor-v2/context/iframeContext/index.d.ts +2 -0
  158. package/build/cjs/editor-v2/context/iframeContext/index.js +6 -0
  159. package/build/cjs/editor-v2/context/iframeContext/index.js.map +1 -0
  160. package/build/cjs/editor-v2/hooks/useEditorTabs.d.ts +16 -0
  161. package/build/cjs/editor-v2/hooks/useEditorTabs.js +77 -0
  162. package/build/cjs/editor-v2/hooks/useEditorTabs.js.map +1 -0
  163. package/build/cjs/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -0
  164. package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js +31 -0
  165. package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js.map +1 -0
  166. package/build/cjs/editor-v2/hooks/useMainEditorStore.d.ts +1 -0
  167. package/build/cjs/editor-v2/hooks/useMainEditorStore.js +13 -0
  168. package/build/cjs/editor-v2/hooks/useMainEditorStore.js.map +1 -0
  169. package/build/cjs/editor-v2/hooks/usePostMessageEvents.d.ts +6 -0
  170. package/build/cjs/editor-v2/hooks/usePostMessageEvents.js +19 -0
  171. package/build/cjs/editor-v2/hooks/usePostMessageEvents.js.map +1 -0
  172. package/build/cjs/editor-v2/index.d.ts +2 -0
  173. package/build/cjs/editor-v2/index.js +8 -0
  174. package/build/cjs/editor-v2/index.js.map +1 -0
  175. package/build/cjs/editor-v2/store.d.ts +48 -0
  176. package/build/cjs/editor-v2/store.js +181 -0
  177. package/build/cjs/editor-v2/store.js.map +1 -0
  178. package/build/cjs/editor-v2/styles/mixins.css +0 -0
  179. package/build/cjs/editor-v2/styles/root.css +12 -0
  180. package/build/cjs/editor-v2/styles/variables.css +0 -0
  181. package/build/cjs/editor-v2/utils/cn.d.ts +2 -0
  182. package/build/cjs/editor-v2/utils/cn.js +7 -0
  183. package/build/cjs/editor-v2/utils/cn.js.map +1 -0
  184. package/build/cjs/editor-v2/utils/code.d.ts +6 -0
  185. package/build/cjs/editor-v2/utils/code.js +13 -0
  186. package/build/cjs/editor-v2/utils/code.js.map +1 -0
  187. package/build/cjs/editor-v2/utils/index.d.ts +18 -0
  188. package/build/cjs/editor-v2/utils/index.js +159 -0
  189. package/build/cjs/editor-v2/utils/index.js.map +1 -0
  190. package/build/esm/blocks/ContentLayout/index.d.ts +1 -1
  191. package/build/esm/blocks/ExtendedFeatures/index.d.ts +1 -1
  192. package/build/esm/blocks/FilterBlock/index.d.ts +1 -1
  193. package/build/esm/blocks/Form/index.d.ts +1 -1
  194. package/build/esm/blocks/Header/index.d.ts +1 -1
  195. package/build/esm/blocks/HeaderSlider/index.d.ts +1 -1
  196. package/build/esm/blocks/Icons/index.d.ts +1 -1
  197. package/build/esm/blocks/Info/index.d.ts +1 -1
  198. package/build/esm/blocks/Map/index.d.ts +1 -1
  199. package/build/esm/blocks/Media/index.d.ts +1 -1
  200. package/build/esm/blocks/PromoFeaturesBlock/index.d.ts +1 -1
  201. package/build/esm/blocks/Questions/index.d.ts +1 -1
  202. package/build/esm/blocks/Share/index.d.ts +1 -1
  203. package/build/esm/blocks/Slider/index.d.ts +1 -1
  204. package/build/esm/blocks/Table/index.d.ts +1 -1
  205. package/build/esm/blocks/Tabs/index.d.ts +1 -1
  206. package/build/esm/blocks/TestEditorBlock/index.d.ts +1 -1
  207. package/build/esm/editor-v2/components/DynamicForm/DynamicForm.css +0 -0
  208. package/build/esm/editor-v2/components/DynamicForm/DynamicForm.d.ts +10 -0
  209. package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js +113 -0
  210. package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -0
  211. package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +89 -0
  212. package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.d.ts +13 -0
  213. package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +25 -0
  214. package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -0
  215. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.css +37 -0
  216. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.d.ts +12 -0
  217. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.js +66 -0
  218. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.js.map +1 -0
  219. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.d.ts +10 -0
  220. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js +19 -0
  221. package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js.map +1 -0
  222. package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.css +3 -0
  223. package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.d.ts +9 -0
  224. package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js +11 -0
  225. package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js.map +1 -0
  226. package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.d.ts +8 -0
  227. package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.js +13 -0
  228. package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.js.map +1 -0
  229. package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.d.ts +10 -0
  230. package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.js +9 -0
  231. package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.js.map +1 -0
  232. package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.css +6 -0
  233. package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.d.ts +10 -0
  234. package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js +33 -0
  235. package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js.map +1 -0
  236. package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.css +3 -0
  237. package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.d.ts +12 -0
  238. package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.js +12 -0
  239. package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.js.map +1 -0
  240. package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.d.ts +8 -0
  241. package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.js +10 -0
  242. package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.js.map +1 -0
  243. package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.d.ts +8 -0
  244. package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js +10 -0
  245. package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js.map +1 -0
  246. package/build/esm/editor-v2/components/DynamicForm/utils.d.ts +3 -0
  247. package/build/esm/editor-v2/components/DynamicForm/utils.js +17 -0
  248. package/build/esm/editor-v2/components/DynamicForm/utils.js.map +1 -0
  249. package/build/esm/editor-v2/components/Panels/Panels.css +37 -0
  250. package/build/esm/editor-v2/components/Panels/Panels.d.ts +9 -0
  251. package/build/esm/editor-v2/components/Panels/Panels.js +24 -0
  252. package/build/esm/editor-v2/components/Panels/Panels.js.map +1 -0
  253. package/build/esm/editor-v2/components/Sidebar/Sidebar.css +24 -0
  254. package/build/esm/editor-v2/components/Sidebar/Sidebar.d.ts +11 -0
  255. package/build/esm/editor-v2/components/Sidebar/Sidebar.js +9 -0
  256. package/build/esm/editor-v2/components/Sidebar/Sidebar.js.map +1 -0
  257. package/build/esm/editor-v2/components/StoreViewer/StoreViewer.css +29 -0
  258. package/build/esm/editor-v2/components/StoreViewer/StoreViewer.d.ts +7 -0
  259. package/build/esm/editor-v2/components/StoreViewer/StoreViewer.js +15 -0
  260. package/build/esm/editor-v2/components/StoreViewer/StoreViewer.js.map +1 -0
  261. package/build/esm/editor-v2/components/Tabs/Tabs.css +26 -0
  262. package/build/esm/editor-v2/components/Tabs/Tabs.d.ts +14 -0
  263. package/build/esm/editor-v2/components/Tabs/Tabs.js +30 -0
  264. package/build/esm/editor-v2/components/Tabs/Tabs.js.map +1 -0
  265. package/build/esm/editor-v2/constants.d.ts +1 -0
  266. package/build/esm/editor-v2/constants.js +2 -0
  267. package/build/esm/editor-v2/constants.js.map +1 -0
  268. package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.css +35 -0
  269. package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.d.ts +5 -0
  270. package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.js +56 -0
  271. package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.js.map +1 -0
  272. package/build/esm/editor-v2/containers/BlockConfig/BlockConfig.css +33 -0
  273. package/build/esm/editor-v2/containers/BlockConfig/BlockConfig.d.ts +6 -0
  274. package/build/esm/editor-v2/containers/BlockConfig/BlockConfig.js +26 -0
  275. package/build/esm/editor-v2/containers/BlockConfig/BlockConfig.js.map +1 -0
  276. package/build/esm/editor-v2/containers/BlocksList/BlocksList.css +65 -0
  277. package/build/esm/editor-v2/containers/BlocksList/BlocksList.d.ts +3 -0
  278. package/build/esm/editor-v2/containers/BlocksList/BlocksList.js +41 -0
  279. package/build/esm/editor-v2/containers/BlocksList/BlocksList.js.map +1 -0
  280. package/build/esm/editor-v2/containers/Editor/Editor.css +51 -0
  281. package/build/esm/editor-v2/containers/Editor/Editor.d.ts +22 -0
  282. package/build/esm/editor-v2/containers/Editor/Editor.js +36 -0
  283. package/build/esm/editor-v2/containers/Editor/Editor.js.map +1 -0
  284. package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.css +24 -0
  285. package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.d.ts +6 -0
  286. package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.js +15 -0
  287. package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.js.map +1 -0
  288. package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.css +62 -0
  289. package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.d.ts +8 -0
  290. package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js +32 -0
  291. package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -0
  292. package/build/esm/editor-v2/containers/Overlay/Overlay.css +60 -0
  293. package/build/esm/editor-v2/containers/Overlay/Overlay.d.ts +7 -0
  294. package/build/esm/editor-v2/containers/Overlay/Overlay.js +88 -0
  295. package/build/esm/editor-v2/containers/Overlay/Overlay.js.map +1 -0
  296. package/build/esm/editor-v2/containers/Source/Source.css +27 -0
  297. package/build/esm/editor-v2/containers/Source/Source.d.ts +3 -0
  298. package/build/esm/editor-v2/containers/Source/Source.js +26 -0
  299. package/build/esm/editor-v2/containers/Source/Source.js.map +1 -0
  300. package/build/esm/editor-v2/containers/SourceCode/SourceCode.css +50 -0
  301. package/build/esm/editor-v2/containers/SourceCode/SourceCode.d.ts +7 -0
  302. package/build/esm/editor-v2/containers/SourceCode/SourceCode.js +39 -0
  303. package/build/esm/editor-v2/containers/SourceCode/SourceCode.js.map +1 -0
  304. package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.css +3 -0
  305. package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.d.ts +8 -0
  306. package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js +14 -0
  307. package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js.map +1 -0
  308. package/build/esm/editor-v2/containers/Tree/DragContext.css +38 -0
  309. package/build/esm/editor-v2/containers/Tree/DragContext.d.ts +15 -0
  310. package/build/esm/editor-v2/containers/Tree/DragContext.js +45 -0
  311. package/build/esm/editor-v2/containers/Tree/DragContext.js.map +1 -0
  312. package/build/esm/editor-v2/containers/Tree/Tree.css +23 -0
  313. package/build/esm/editor-v2/containers/Tree/Tree.d.ts +3 -0
  314. package/build/esm/editor-v2/containers/Tree/Tree.js +34 -0
  315. package/build/esm/editor-v2/containers/Tree/Tree.js.map +1 -0
  316. package/build/esm/editor-v2/containers/Tree/TreeContent.css +28 -0
  317. package/build/esm/editor-v2/containers/Tree/TreeContent.d.ts +17 -0
  318. package/build/esm/editor-v2/containers/Tree/TreeContent.js +57 -0
  319. package/build/esm/editor-v2/containers/Tree/TreeContent.js.map +1 -0
  320. package/build/esm/editor-v2/containers/Tree/TreeItem.css +66 -0
  321. package/build/esm/editor-v2/containers/Tree/TreeItem.d.ts +14 -0
  322. package/build/esm/editor-v2/containers/Tree/TreeItem.js +140 -0
  323. package/build/esm/editor-v2/containers/Tree/TreeItem.js.map +1 -0
  324. package/build/esm/editor-v2/containers/Tree/index.d.ts +4 -0
  325. package/build/esm/editor-v2/containers/Tree/index.js +5 -0
  326. package/build/esm/editor-v2/containers/Tree/index.js.map +1 -0
  327. package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.css +23 -0
  328. package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.d.ts +4 -0
  329. package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js +52 -0
  330. package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -0
  331. package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.d.ts +7 -0
  332. package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.js +6 -0
  333. package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.js.map +1 -0
  334. package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.d.ts +5 -0
  335. package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.js +30 -0
  336. package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.js.map +1 -0
  337. package/build/esm/editor-v2/context/editorStore/index.d.ts +2 -0
  338. package/build/esm/editor-v2/context/editorStore/index.js +3 -0
  339. package/build/esm/editor-v2/context/editorStore/index.js.map +1 -0
  340. package/build/esm/editor-v2/context/iframeContext/IframeContext.d.ts +12 -0
  341. package/build/esm/editor-v2/context/iframeContext/IframeContext.js +10 -0
  342. package/build/esm/editor-v2/context/iframeContext/IframeContext.js.map +1 -0
  343. package/build/esm/editor-v2/context/iframeContext/IframeProvider.d.ts +7 -0
  344. package/build/esm/editor-v2/context/iframeContext/IframeProvider.js +16 -0
  345. package/build/esm/editor-v2/context/iframeContext/IframeProvider.js.map +1 -0
  346. package/build/esm/editor-v2/context/iframeContext/index.d.ts +2 -0
  347. package/build/esm/editor-v2/context/iframeContext/index.js +3 -0
  348. package/build/esm/editor-v2/context/iframeContext/index.js.map +1 -0
  349. package/build/esm/editor-v2/hooks/useEditorTabs.d.ts +16 -0
  350. package/build/esm/editor-v2/hooks/useEditorTabs.js +72 -0
  351. package/build/esm/editor-v2/hooks/useEditorTabs.js.map +1 -0
  352. package/build/esm/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -0
  353. package/build/esm/editor-v2/hooks/useMainEditorInitialize.js +29 -0
  354. package/build/esm/editor-v2/hooks/useMainEditorInitialize.js.map +1 -0
  355. package/build/esm/editor-v2/hooks/useMainEditorStore.d.ts +1 -0
  356. package/build/esm/editor-v2/hooks/useMainEditorStore.js +8 -0
  357. package/build/esm/editor-v2/hooks/useMainEditorStore.js.map +1 -0
  358. package/build/esm/editor-v2/hooks/usePostMessageEvents.d.ts +6 -0
  359. package/build/esm/editor-v2/hooks/usePostMessageEvents.js +15 -0
  360. package/build/esm/editor-v2/hooks/usePostMessageEvents.js.map +1 -0
  361. package/build/esm/editor-v2/index.d.ts +2 -0
  362. package/build/esm/editor-v2/index.js +3 -0
  363. package/build/esm/editor-v2/index.js.map +1 -0
  364. package/build/esm/editor-v2/store.d.ts +48 -0
  365. package/build/esm/editor-v2/store.js +177 -0
  366. package/build/esm/editor-v2/store.js.map +1 -0
  367. package/build/esm/editor-v2/styles/mixins.css +0 -0
  368. package/build/esm/editor-v2/styles/root.css +12 -0
  369. package/build/esm/editor-v2/styles/variables.css +0 -0
  370. package/build/esm/editor-v2/utils/cn.d.ts +2 -0
  371. package/build/esm/editor-v2/utils/cn.js +4 -0
  372. package/build/esm/editor-v2/utils/cn.js.map +1 -0
  373. package/build/esm/editor-v2/utils/code.d.ts +6 -0
  374. package/build/esm/editor-v2/utils/code.js +9 -0
  375. package/build/esm/editor-v2/utils/code.js.map +1 -0
  376. package/build/esm/editor-v2/utils/index.d.ts +18 -0
  377. package/build/esm/editor-v2/utils/index.js +141 -0
  378. package/build/esm/editor-v2/utils/index.js.map +1 -0
  379. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"../../../src","sources":["editor-v2/store.ts"],"names":[],"mappings":";;;;AAAA,4DAAuB;AAEvB,iDAA6D;AAE7D,iDAAmD;AAGnD,8CAAuC;AACvC,4CASiB;AA0BJ,QAAA,iBAAiB,GAAG,IAAA,uBAAe,EAC5C,oBAAY,EACZ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IACX,SAAS,CAAC,MAAc;QACpB,gFAAgF;QAChF,sDAAsD;QACtD,MAAM,SAAS,GAAG,MAAM,GAAG,GAAG,CAAC;QAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,KAAK,EAAE,MAAM,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,cAAc,CAAC,WAAmB;QAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,KAAK,EAAE,WAAW,EAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,CAAC,IAAI;QACR,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YACX,GAA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GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACZ,GAAG,KAAK;YACR,OAAO,EAAE,EAAC,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAC;SAC1C,CAAC,CAAC,CAAC;IACR,CAAC;CACJ,CAAC,CACL,CAAC","sourcesContent":["import _ from 'lodash';\n\nimport {EditorState, initialStore} from '../../common/store';\nimport {DynamicFormValue} from '../../common/types';\nimport {initializeStore} from '../../common/utils';\nimport {ConstructorBlock, PageContentWithNavigation} from '../models';\n\nimport {ZOOM_STEPS} from './constants';\nimport {\n duplicateArrayItem,\n generateChildrenPathFromArray,\n getDestinationShiftBeforeReorder,\n insert,\n isItemsNeighbours,\n modifyObjectByPath,\n removeFromArray,\n reorderArrayItems,\n} from './utils';\n\nexport interface EditorMethods {\n initialize(): void;\n setSelectedBlock(path: number[] | null): void;\n setHeight(height: number): void;\n setDeviceWidth(deviceWidth: string): void;\n setZoom(zoom: number): void;\n increaseZoom(): void;\n decreaseZoom(): void;\n setConfig(data: Pick<EditorState, 'blocks' | 'subBlocks' | 'global'>): void;\n setContent(data: PageContentWithNavigation): void;\n insertBlock(path: number[], blockType: string, position?: 'prepend' | 'append'): void;\n enableInsertMode(blockType: string): void;\n enableReorderMode(path: number[]): void;\n disableMode(): void;\n updateField(path: string, value: DynamicFormValue): void;\n deleteBlock(path: number[]): void;\n duplicateBlock(path: number[]): void;\n reorderBlock(path: number[], destination: number[], position?: 'prepend' | 'append'): void;\n resetInitialize(): void;\n resetBlocks(): void;\n}\n\nexport type EditorStore = EditorState & EditorMethods;\n\nexport const createEditorStore = initializeStore<EditorState, EditorMethods>(\n initialStore,\n (set, get) => ({\n setHeight(height: number) {\n // We have to add 200-500px, because of bottom padding or margin of last element\n // which is not taken into calculation of final height\n const newHeight = height + 500;\n set((state) => ({...state, height: newHeight}));\n },\n setDeviceWidth(deviceWidth: string) {\n set((state) => ({...state, deviceWidth}));\n },\n setZoom(zoom) {\n if (zoom > 0) {\n set((state) => ({...state, zoom}));\n }\n },\n increaseZoom() {\n const currentZoom = get().zoom;\n\n for (const step of ZOOM_STEPS) {\n if (currentZoom < step) {\n get().setZoom(step);\n break;\n }\n }\n },\n decreaseZoom() {\n const currentZoom = get().zoom;\n const reverseSteps = ZOOM_STEPS.slice().reverse();\n\n for (const step of reverseSteps) {\n if (currentZoom > step) {\n get().setZoom(step);\n break;\n }\n }\n },\n setConfig(data) {\n set((state) => ({...state, ...data}));\n },\n insertBlock: (arrayPath, blockType, position = 'append') => {\n if (position === 'append') {\n // TODO: fix\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n arrayPath[arrayPath.length - 1] = arrayPath[arrayPath.length - 1] + 1;\n }\n\n const blocksConfig = get().content.blocks;\n const blocksData = get().blocks;\n\n const foundBlock = blocksData.find(({type}) => type === blockType);\n const defaultValue =\n foundBlock && foundBlock.schema.default\n ? {...foundBlock.schema.default, type: blockType}\n : {type: blockType};\n\n const newBlocksConfig = modifyObjectByPath(\n blocksConfig,\n arrayPath,\n (parentBlocks, index) =>\n insert(parentBlocks, index, defaultValue as ConstructorBlock),\n );\n\n set((state) => ({\n ...state,\n content: {...state.content, blocks: newBlocksConfig},\n selectedBlock: arrayPath,\n }));\n },\n enableInsertMode(blockType: string) {\n set((state) => ({\n ...state,\n manipulateOverlayMode: 'insert',\n preInsertBlockType: blockType,\n }));\n },\n disableMode() {\n set((state) => ({\n ...state,\n manipulateOverlayMode: false,\n preInsertBlockType: undefined,\n preReorderBlockPath: undefined,\n }));\n },\n enableReorderMode(path) {\n set((state) => ({\n ...state,\n manipulateOverlayMode: 'reorder',\n preReorderBlockPath: path,\n }));\n },\n setContent(content) {\n set((state) => ({\n ...state,\n content: content,\n }));\n },\n initialize() {\n set((state) => ({\n ...state,\n initialized: true,\n }));\n },\n setSelectedBlock(path) {\n set((state) => ({\n ...state,\n selectedBlock: path,\n }));\n },\n updateField(path, value) {\n set((state) => {\n const newConfig = _.set(state.content, path, value);\n return {\n ...state,\n content: newConfig,\n };\n });\n },\n deleteBlock: (arrayPath) => {\n const blocksConfig = get().content.blocks;\n\n const newBlocksConfig = modifyObjectByPath(blocksConfig, arrayPath, removeFromArray);\n set((state) => ({\n ...state,\n content: {...state.content, blocks: newBlocksConfig},\n selectedBlock: null,\n }));\n },\n duplicateBlock: (arrayPath) => {\n const blocksConfig = get().content.blocks;\n\n const newBlocksConfig = modifyObjectByPath(blocksConfig, arrayPath, duplicateArrayItem);\n\n set((state) => ({\n ...state,\n content: {...state.content, blocks: newBlocksConfig},\n }));\n },\n reorderBlock: (arrayPath, destination, position = 'append') => {\n // Create a copy of the destination array before any modifications\n let finalDestinationPath: number[] = _.cloneDeep(destination);\n\n if (position === 'append') {\n // TODO: fix\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n destination[destination.length - 1] = destination[destination.length - 1] + 1;\n }\n\n let newBlocksConfig: ConstructorBlock[];\n const blocksConfig = get().content.blocks;\n // Copy\n const copiedBlock = _.get(blocksConfig, generateChildrenPathFromArray(arrayPath));\n\n if (isItemsNeighbours(arrayPath, destination)) {\n newBlocksConfig = modifyObjectByPath(blocksConfig, arrayPath, (parentBlocks) => {\n return reorderArrayItems(\n parentBlocks,\n arrayPath[arrayPath.length - 1],\n destination[destination.length - 1],\n );\n });\n\n if (\n position === 'append' &&\n destination[destination.length - 1] < arrayPath[arrayPath.length - 1]\n ) {\n finalDestinationPath[finalDestinationPath.length - 1] =\n finalDestinationPath[finalDestinationPath.length - 1] + 1;\n }\n } else {\n const arrayDest = getDestinationShiftBeforeReorder(arrayPath, destination);\n finalDestinationPath = _.cloneDeep(arrayDest);\n\n // Delete\n const blocksConfigWithoutBlock = modifyObjectByPath(\n blocksConfig,\n arrayPath,\n removeFromArray,\n );\n // Paste\n newBlocksConfig = modifyObjectByPath(\n blocksConfigWithoutBlock,\n arrayDest,\n (parentBlocks, index) => insert(parentBlocks, index, copiedBlock),\n );\n }\n\n set((state) => ({\n ...state,\n content: {...state.content, blocks: newBlocksConfig},\n selectedBlock: finalDestinationPath,\n }));\n },\n resetInitialize: () => {\n set((state) => ({\n ...state,\n initialized: false,\n }));\n },\n resetBlocks: () => {\n set((state) => ({\n ...state,\n content: {...state.content, blocks: []},\n }));\n },\n }),\n);\n"]}
File without changes
@@ -0,0 +1,12 @@
1
+ .g-root {
2
+ --g-color-base-brand: var(--g-color-private-black-550-solid);
3
+ --g-color-base-brand-hover: var(--g-color-private-black-600-solid);
4
+ --g-color-base-selection: var(--g-color-private-black-200);
5
+ --g-color-base-selection-hover: var(--g-color-private-black-300);
6
+ --g-color-base-brand: var(--g-color-text-primary);
7
+ --g-color-base-brand-hover: var(--g-color-text-complementary);
8
+ --g-color-text-brand-contrast: var(--g-color-text-light-primary);
9
+ --g-color-line-brand: var(--g-color-text-primary);
10
+ --g-color-text-brand: var(--g-color-private-brand-700-solid);
11
+ --g-color-text-brand-heavy: var(--g-color-private-black-700-solid);
12
+ }
File without changes
@@ -0,0 +1,2 @@
1
+ export declare const EDITOR_NAMESPACE = "pceditor-";
2
+ export declare const editorCn: import("@bem-react/classname").ClassNameInitilizer;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editorCn = exports.EDITOR_NAMESPACE = void 0;
4
+ const classname_1 = require("@bem-react/classname");
5
+ exports.EDITOR_NAMESPACE = 'pceditor-';
6
+ exports.editorCn = (0, classname_1.withNaming)({ n: exports.EDITOR_NAMESPACE, e: '__', m: '_' });
7
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.js","sourceRoot":"../../../../src","sources":["editor-v2/utils/cn.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEnC,QAAA,gBAAgB,GAAG,WAAW,CAAC;AAE/B,QAAA,QAAQ,GAAG,IAAA,sBAAU,EAAC,EAAC,CAAC,EAAE,wBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAC,CAAC,CAAC","sourcesContent":["import {withNaming} from '@bem-react/classname';\n\nexport const EDITOR_NAMESPACE = 'pceditor-';\n\nexport const editorCn = withNaming({n: EDITOR_NAMESPACE, e: '__', m: '_'});\n"]}
@@ -0,0 +1,6 @@
1
+ export declare function parseCode(code: string): {
2
+ blocks: import("../../models/index.js").ConstructorBlock[];
3
+ menu?: import("../../models/index.js").Menu;
4
+ background?: import("../../models/index.js").ThemedMediaProps;
5
+ animated?: boolean;
6
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCode = parseCode;
4
+ const tslib_1 = require("tslib");
5
+ const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
6
+ function parseCode(code) {
7
+ const pageContent = js_yaml_1.default.load(code);
8
+ return {
9
+ ...pageContent,
10
+ blocks: pageContent.blocks?.filter(Boolean),
11
+ };
12
+ }
13
+ //# sourceMappingURL=code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.js","sourceRoot":"../../../../src","sources":["editor-v2/utils/code.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAXD,8DAA2B;AAI3B,SAAgB,SAAS,CAAC,IAAY;IAClC,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,IAAI,CAAgB,CAAC;IAEnD,OAAO;QACH,GAAG,WAAW;QACd,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC;KAC9C,CAAC;AACN,CAAC","sourcesContent":["import yaml from 'js-yaml';\n\nimport {PageContent} from '../../models';\n\nexport function parseCode(code: string) {\n const pageContent = yaml.load(code) as PageContent;\n\n return {\n ...pageContent,\n blocks: pageContent.blocks?.filter(Boolean),\n };\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { ConstructorBlock } from "../../models/index.js";
2
+ export declare function insert<T>(arr: Array<T>, index: number, newItem: T): T[];
3
+ export declare function removeFromArray<T>(array: Array<T>, index: number): T[];
4
+ export declare function swapArrayItems<T>(array: Array<T>, firstIndex: number, secondIndex: number): T[];
5
+ export declare function reorderArrayItems<T>(array: Array<T>, index: number, destination: number): T[];
6
+ export declare function duplicateArrayItem<T>(array: Array<T>, index: number): T[];
7
+ export declare function insertByPath<T extends object>(object: T, path: string, value: any): T;
8
+ export declare function splitPathAndIndex(path: string): {
9
+ path: string;
10
+ index: number;
11
+ } | undefined;
12
+ export declare function generateChildrenPathFromArray(indexes: number[]): string;
13
+ export declare function modifyObjectByPath(blocks: ConstructorBlock[], arrayPath: number[], modifyCallback: (parentBlocks: ConstructorBlock[], index: number) => ConstructorBlock[]): ConstructorBlock[];
14
+ export declare function isItemsNeighbours(arrayA: number[], arrayB: number[]): boolean;
15
+ export declare function getDestinationShiftBeforeReorder(arrayInit: number[], arrayDest: number[]): number[];
16
+ export declare function prepareShift(arrayInit: number[], arrayDest: number[]): number[];
17
+ export declare const getUrlOrigin: (url: string) => string | undefined;
18
+ export declare const getItemTitle: (item: object) => string | undefined;
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getItemTitle = exports.getUrlOrigin = void 0;
4
+ exports.insert = insert;
5
+ exports.removeFromArray = removeFromArray;
6
+ exports.swapArrayItems = swapArrayItems;
7
+ exports.reorderArrayItems = reorderArrayItems;
8
+ exports.duplicateArrayItem = duplicateArrayItem;
9
+ exports.insertByPath = insertByPath;
10
+ exports.splitPathAndIndex = splitPathAndIndex;
11
+ exports.generateChildrenPathFromArray = generateChildrenPathFromArray;
12
+ exports.modifyObjectByPath = modifyObjectByPath;
13
+ exports.isItemsNeighbours = isItemsNeighbours;
14
+ exports.getDestinationShiftBeforeReorder = getDestinationShiftBeforeReorder;
15
+ exports.prepareShift = prepareShift;
16
+ const tslib_1 = require("tslib");
17
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
18
+ function insert(arr, index, newItem) {
19
+ return [...arr.slice(0, index), newItem, ...arr.slice(index)];
20
+ }
21
+ function removeFromArray(array, index) {
22
+ return [...array.slice(0, index), ...array.slice(index + 1)];
23
+ }
24
+ function swapArrayItems(array, firstIndex, secondIndex) {
25
+ const results = array.slice();
26
+ const firstItem = array[firstIndex];
27
+ results[firstIndex] = array[secondIndex];
28
+ results[secondIndex] = firstItem;
29
+ return results;
30
+ }
31
+ function reorderArrayItems(array, index, destination) {
32
+ const min = Math.min(index, destination);
33
+ const max = Math.max(index, destination);
34
+ const firstOperationRemove = index < destination;
35
+ const result = [];
36
+ result.push(...array.slice(0, min));
37
+ if (!firstOperationRemove) {
38
+ result.push(array[index]);
39
+ }
40
+ result.push(...array.slice(firstOperationRemove ? min + 1 : min, max));
41
+ if (firstOperationRemove) {
42
+ result.push(array[index]);
43
+ }
44
+ result.push(...array.slice(firstOperationRemove ? max : max + 1, array.length));
45
+ return result;
46
+ }
47
+ function duplicateArrayItem(array, index) {
48
+ const duplicatedItem = lodash_1.default.cloneDeep(array[index]);
49
+ return [...array.slice(0, index), duplicatedItem, ...array.slice(index)];
50
+ }
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ function insertByPath(object, path, value) {
53
+ if (!path) {
54
+ return value;
55
+ }
56
+ return lodash_1.default.setWith(lodash_1.default.clone(object), path, value, lodash_1.default.clone);
57
+ }
58
+ /*
59
+ * path: string;
60
+ * Example:
61
+ * 1. blocks[0] => {path: blocks, index: 0}
62
+ * 2. blocks[2].children[10] => {path: blocks[2].children, index: 10}
63
+ **/
64
+ function splitPathAndIndex(path) {
65
+ // Match blocks[3], blocks[0].children[12], blocks[0], blocks[999999]
66
+ const bracketsRegExp = /(.*)\[(\d+)]$/g;
67
+ const regexpMatches = [...path.matchAll(bracketsRegExp)];
68
+ if (regexpMatches.length) {
69
+ return {
70
+ // blocks, blocks[0].children
71
+ path: regexpMatches[0][1],
72
+ // 3, 12, 0, 9999
73
+ index: Number(regexpMatches[0][2]),
74
+ };
75
+ }
76
+ // eslint-disable-next-line no-console
77
+ console.error('Non correct path for splitting');
78
+ return undefined;
79
+ }
80
+ /*
81
+ * [0, 4, 3] => [0].children[4].children[3]
82
+ * */
83
+ function generateChildrenPathFromArray(indexes) {
84
+ if (!indexes.length) {
85
+ return '';
86
+ }
87
+ let resultPath = `[${indexes[0]}]`;
88
+ if (indexes.length > 1) {
89
+ for (let i = 1; i < indexes.length; i++) {
90
+ resultPath += `.children[${indexes[i]}]`;
91
+ }
92
+ }
93
+ return resultPath;
94
+ }
95
+ function modifyObjectByPath(blocks, arrayPath, modifyCallback) {
96
+ // [1]
97
+ // [4].children[3]
98
+ const insertPath = generateChildrenPathFromArray(arrayPath);
99
+ // path: '' index: 1
100
+ // path: '[4].children' index: 3
101
+ const splitPath = splitPathAndIndex(insertPath);
102
+ if (splitPath) {
103
+ const { path: parentPath, index } = splitPath;
104
+ // Get Array that lies on path
105
+ const parentArray = parentPath ? lodash_1.default.get(blocks, parentPath) : blocks;
106
+ const value = Array.isArray(parentArray) ? parentArray : [];
107
+ // Modify Array
108
+ const newModifiedArray = modifyCallback(value, index);
109
+ // Return it back
110
+ return insertByPath(blocks, parentPath, newModifiedArray);
111
+ }
112
+ return blocks;
113
+ }
114
+ function isItemsNeighbours(arrayA, arrayB) {
115
+ if (arrayA.length !== arrayB.length) {
116
+ return false;
117
+ }
118
+ for (let i = 0; i < arrayA.length - 1; i++) {
119
+ if (arrayA[i] !== arrayB[i]) {
120
+ return false;
121
+ }
122
+ }
123
+ return true;
124
+ }
125
+ function getDestinationShiftBeforeReorder(arrayInit, arrayDest) {
126
+ if (arrayInit.length === arrayDest.length || arrayInit.length > arrayDest.length) {
127
+ return arrayDest;
128
+ }
129
+ for (let i = 0; i < arrayInit.length; i++) {
130
+ if (arrayInit[i] < arrayDest[i]) {
131
+ return prepareShift(arrayInit, arrayDest);
132
+ }
133
+ }
134
+ return arrayDest;
135
+ }
136
+ function prepareShift(arrayInit, arrayDest) {
137
+ if (arrayInit.length === arrayDest.length || arrayInit.length > arrayDest.length) {
138
+ return arrayDest;
139
+ }
140
+ return arrayDest.map((pathIndex, index) => index === arrayInit.length - 1 ? pathIndex - 1 : pathIndex);
141
+ }
142
+ const getUrlOrigin = (url) => {
143
+ try {
144
+ const urlObject = new URL(url);
145
+ return urlObject.origin;
146
+ }
147
+ catch {
148
+ return undefined;
149
+ }
150
+ };
151
+ exports.getUrlOrigin = getUrlOrigin;
152
+ const getItemTitle = (item) => {
153
+ return (lodash_1.default.get(item, 'title.text') ||
154
+ lodash_1.default.get(item, 'title') ||
155
+ lodash_1.default.get(item, 'textContent.title') ||
156
+ lodash_1.default.get(item, 'content.title'));
157
+ };
158
+ exports.getItemTitle = getItemTitle;
159
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../../../../src","sources":["editor-v2/utils/index.ts"],"names":[],"mappings":";;;AAIA,wBAEC;AAED,0CAEC;AAED,wCAMC;AAED,8CAeC;AAED,gDAGC;AAGD,oCAMC;AAQD,8CAgBC;AAKD,sEAcC;AAED,gDA0BC;AAED,8CAYC;AAED,4EAYC;AAED,oCAQC;;AA9JD,4DAAuB;AAIvB,SAAgB,MAAM,CAAI,GAAa,EAAE,KAAa,EAAE,OAAU;IAC9D,OAAO,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,eAAe,CAAI,KAAe,EAAE,KAAa;IAC7D,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAgB,cAAc,CAAI,KAAe,EAAE,UAAkB,EAAE,WAAmB;IACtF,MAAM,OAAO,GAAG,KAAK,CAAC,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AAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IACxC,IAAI,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,SAAS,CAAC,MAAM,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAY,EAAsB,EAAE;IAC7D,OAAO,CACH,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC;QACzB,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC;QACpB,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC;QAChC,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAC/B,CAAC;AACN,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB","sourcesContent":["import _ from 'lodash';\n\nimport {ConstructorBlock} from '../../models';\n\nexport function insert<T>(arr: Array<T>, index: number, newItem: T) {\n return [...arr.slice(0, index), newItem, ...arr.slice(index)];\n}\n\nexport function removeFromArray<T>(array: Array<T>, index: number) {\n return [...array.slice(0, index), ...array.slice(index + 1)];\n}\n\nexport function swapArrayItems<T>(array: Array<T>, firstIndex: number, secondIndex: number) {\n const results = array.slice();\n const firstItem = array[firstIndex];\n results[firstIndex] = array[secondIndex];\n results[secondIndex] = firstItem;\n return results;\n}\n\nexport function reorderArrayItems<T>(array: Array<T>, index: number, destination: number) {\n const min = Math.min(index, destination);\n const max = Math.max(index, destination);\n const firstOperationRemove = index < destination;\n const result = [];\n result.push(...array.slice(0, min));\n if (!firstOperationRemove) {\n result.push(array[index]);\n }\n result.push(...array.slice(firstOperationRemove ? min + 1 : min, max));\n if (firstOperationRemove) {\n result.push(array[index]);\n }\n result.push(...array.slice(firstOperationRemove ? max : max + 1, array.length));\n return result;\n}\n\nexport function duplicateArrayItem<T>(array: Array<T>, index: number) {\n const duplicatedItem = _.cloneDeep(array[index]);\n return [...array.slice(0, index), duplicatedItem, ...array.slice(index)];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function insertByPath<T extends object>(object: T, path: string, value: any) {\n if (!path) {\n return value as T;\n }\n\n return _.setWith(_.clone(object), path, value, _.clone);\n}\n\n/*\n * path: string;\n * Example:\n * 1. blocks[0] => {path: blocks, index: 0}\n * 2. blocks[2].children[10] => {path: blocks[2].children, index: 10}\n **/\nexport function splitPathAndIndex(path: string) {\n // Match blocks[3], blocks[0].children[12], blocks[0], blocks[999999]\n const bracketsRegExp = /(.*)\\[(\\d+)]$/g;\n const regexpMatches = [...path.matchAll(bracketsRegExp)];\n if (regexpMatches.length) {\n return {\n // blocks, blocks[0].children\n path: regexpMatches[0][1],\n // 3, 12, 0, 9999\n index: Number(regexpMatches[0][2]),\n };\n }\n\n // eslint-disable-next-line no-console\n console.error('Non correct path for splitting');\n return undefined;\n}\n\n/*\n * [0, 4, 3] => [0].children[4].children[3]\n * */\nexport function generateChildrenPathFromArray(indexes: number[]) {\n if (!indexes.length) {\n return '';\n }\n\n let resultPath = `[${indexes[0]}]`;\n\n if (indexes.length > 1) {\n for (let i = 1; i < indexes.length; i++) {\n resultPath += `.children[${indexes[i]}]`;\n }\n }\n\n return resultPath;\n}\n\nexport function modifyObjectByPath(\n blocks: ConstructorBlock[],\n arrayPath: number[],\n modifyCallback: (parentBlocks: ConstructorBlock[], index: number) => ConstructorBlock[],\n) {\n // [1]\n // [4].children[3]\n const insertPath = generateChildrenPathFromArray(arrayPath);\n // path: '' index: 1\n // path: '[4].children' index: 3\n const splitPath = splitPathAndIndex(insertPath);\n\n if (splitPath) {\n const {path: parentPath, index} = splitPath;\n // Get Array that lies on path\n const parentArray = parentPath ? _.get(blocks, parentPath) : blocks;\n\n const value = Array.isArray(parentArray) ? parentArray : [];\n // Modify Array\n const newModifiedArray = modifyCallback(value, index);\n\n // Return it back\n return insertByPath(blocks, parentPath, newModifiedArray);\n }\n\n return blocks;\n}\n\nexport function isItemsNeighbours(arrayA: number[], arrayB: number[]) {\n if (arrayA.length !== arrayB.length) {\n return false;\n }\n\n for (let i = 0; i < arrayA.length - 1; i++) {\n if (arrayA[i] !== arrayB[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function getDestinationShiftBeforeReorder(arrayInit: number[], arrayDest: number[]) {\n if (arrayInit.length === arrayDest.length || arrayInit.length > arrayDest.length) {\n return arrayDest;\n }\n\n for (let i = 0; i < arrayInit.length; i++) {\n if (arrayInit[i] < arrayDest[i]) {\n return prepareShift(arrayInit, arrayDest);\n }\n }\n\n return arrayDest;\n}\n\nexport function prepareShift(arrayInit: number[], arrayDest: number[]) {\n if (arrayInit.length === arrayDest.length || arrayInit.length > arrayDest.length) {\n return arrayDest;\n }\n\n return arrayDest.map((pathIndex, index) =>\n index === arrayInit.length - 1 ? pathIndex - 1 : pathIndex,\n );\n}\n\nexport const getUrlOrigin = (url: string) => {\n try {\n const urlObject = new URL(url);\n return urlObject.origin;\n } catch {\n return undefined;\n }\n};\n\nexport const getItemTitle = (item: object): string | undefined => {\n return (\n _.get(item, 'title.text') ||\n _.get(item, 'title') ||\n _.get(item, 'textContent.title') ||\n _.get(item, 'content.title')\n );\n};\n"]}
@@ -3,7 +3,7 @@ declare const ContentLayoutBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  textContent: {
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const ExtendedFeaturesBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: {
@@ -3,7 +3,7 @@ declare const FilterBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  allTag: boolean;
9
9
  description: string;
@@ -3,7 +3,7 @@ declare const FormBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  title: string;
9
9
  formData: {};
@@ -3,7 +3,7 @@ declare const HeaderBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const HeaderSliderBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  items: ({
@@ -3,7 +3,7 @@ declare const IconsBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const InfoBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const MapBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  title: string;
9
9
  };
@@ -3,7 +3,7 @@ declare const MediaBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  title: string;
9
9
  description: string;
@@ -3,7 +3,7 @@ declare const PromoFeaturesBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  title: string;
9
9
  theme: string;
@@ -3,7 +3,7 @@ declare const QuestionsBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const ShareBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  items: string[];
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const SliderBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  dots: boolean;
9
9
  type: string;
@@ -3,7 +3,7 @@ declare const TableBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  type: string;
9
9
  title: string;
@@ -3,7 +3,7 @@ declare const TabsBlockConfig: {
3
3
  schema: {
4
4
  name: string;
5
5
  group: string;
6
- inputs: import("../../../common/types/index.js").ConfigInput[];
6
+ inputs: import("../../editor-v2/index.js").ConfigInput[];
7
7
  default: {
8
8
  title: string;
9
9
  items: {
@@ -2,7 +2,7 @@ declare const TestEditorBlockConfig: {
2
2
  component: (props: import("./TestEditorBlock.js").TestEditorBlockProps) => import("react/jsx-runtime").JSX.Element;
3
3
  schema: {
4
4
  name: string;
5
- inputs: (import("../../../common/types/index.js").TextInput | import("../../../common/types/index.js").BooleanInput | import("../../../common/types/index.js").NumberInput | import("../../../common/types/index.js").TextAreaInput | import("../../../common/types/index.js").SelectSingleInput | import("../../../common/types/index.js").SelectMultipleInput | import("../../../common/types/index.js").ObjectInput | import("../../../common/types/index.js").ArrayTextInput | import("../../../common/types/index.js").ArrayObjectInput | import("../../../common/types/index.js").OneOfInput)[];
5
+ inputs: (import("../../editor-v2/index.js").TextInput | import("../../editor-v2/index.js").BooleanInput | import("../../editor-v2/index.js").NumberInput | import("../../editor-v2/index.js").TextAreaInput | import("../../editor-v2/index.js").SelectSingleInput | import("../../editor-v2/index.js").SelectMultipleInput | import("../../editor-v2/index.js").ObjectInput | import("../../editor-v2/index.js").ArrayTextInput | import("../../editor-v2/index.js").ArrayObjectInput | import("../../editor-v2/index.js").OneOfInput)[];
6
6
  };
7
7
  };
8
8
  export declare const TestEditorBlockSchema: {
@@ -0,0 +1,10 @@
1
+ import { ConfigInput, DynamicFormValue } from "../../../../common/types/index.js";
2
+ import './DynamicForm.css';
3
+ interface DynamicFormProps {
4
+ blockConfig: Array<ConfigInput>;
5
+ contentConfig?: DynamicFormValue;
6
+ onUpdate: (key: string, value: DynamicFormValue) => void;
7
+ className?: string;
8
+ }
9
+ declare const DynamicForm: ({ blockConfig, onUpdate, contentConfig }: DynamicFormProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default DynamicForm;
@@ -0,0 +1,113 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import _ from 'lodash';
3
+ import * as React from 'react';
4
+ import { editorCn } from "../../utils/cn.js";
5
+ import './DynamicForm.css';
6
+ import ArrayDynamicField from "./Fields/Array/Array.js";
7
+ import BooleanDynamicField from "./Fields/Boolean/Boolean.js";
8
+ import NumberDynamicField from "./Fields/Number/Number.js";
9
+ import ObjectDynamicField from "./Fields/Object/Object.js";
10
+ import OneOfDynamicField from "./Fields/OneOf/OneOf.js";
11
+ import SelectDynamicField from "./Fields/Select/Select.js";
12
+ import TextDynamicField from "./Fields/Text/Text.js";
13
+ import TextAreaDynamicField from "./Fields/TextArea/TextArea.js";
14
+ import { getContent, getFullPath } from "./utils.js";
15
+ const b = editorCn('dynamic-form');
16
+ const DynamicForm = ({ blockConfig, onUpdate, contentConfig }) => {
17
+ const inputs = blockConfig;
18
+ const getData = React.useCallback((variable) => {
19
+ if (variable.startsWith('block.')) {
20
+ const purePath = variable.replace('block.', '');
21
+ return _.get(contentConfig, purePath);
22
+ }
23
+ if ((variable.startsWith(`'`) && variable.endsWith(`'`)) ||
24
+ (variable.startsWith(`"`) && variable.endsWith(`"`))) {
25
+ // @ts-ignore TODO: replaceAll types
26
+ return variable.replaceAll(`'`, '').replaceAll(`"`, '');
27
+ }
28
+ return undefined;
29
+ }, [contentConfig]);
30
+ const decide = React.useCallback((showIf) => {
31
+ const parts = showIf.split(' ');
32
+ if (!(parts.length === 3)) {
33
+ // eslint-disable-next-line no-console
34
+ console.log('Something bad happened in showIf, ignored');
35
+ return true;
36
+ }
37
+ const [firstVariable, equals, secondVariable] = parts;
38
+ const data1 = getData(firstVariable);
39
+ const data2 = getData(secondVariable);
40
+ if (equals === '===') {
41
+ return data1 === data2;
42
+ }
43
+ else {
44
+ return data1 !== data2;
45
+ }
46
+ }, [getData]);
47
+ const renderInput = React.useCallback((input) => {
48
+ const fieldPath = input.name;
49
+ const fieldValue = getContent(contentConfig, input.name);
50
+ if (input.showIf) {
51
+ const decision = decide(input.showIf);
52
+ if (!decision) {
53
+ return _jsxs("div", { children: ["Hidden Field: ", input.name] });
54
+ }
55
+ }
56
+ // Text, Select, Boolean and etc
57
+ const onSimpleDynamicFieldUpdate = (value) => {
58
+ onUpdate(fieldPath, value);
59
+ };
60
+ // Array and Objects
61
+ const onComplexDynamicFieldUpdate = (key, value) => {
62
+ onUpdate(getFullPath(fieldPath, key), value);
63
+ };
64
+ switch (input.type) {
65
+ case 'text': {
66
+ return (_jsx(TextDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), title: input.title, value: fieldValue, onUpdate: onSimpleDynamicFieldUpdate }));
67
+ }
68
+ case 'boolean': {
69
+ return (_jsx(BooleanDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), title: input.title, value: fieldValue, onUpdate: onSimpleDynamicFieldUpdate }));
70
+ }
71
+ case 'textarea': {
72
+ return (_jsx(TextAreaDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), title: input.title, value: fieldValue, onUpdate: onSimpleDynamicFieldUpdate }));
73
+ }
74
+ case 'select': {
75
+ return (_jsx(SelectDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), input: input, value: fieldValue, onUpdate: onSimpleDynamicFieldUpdate }));
76
+ }
77
+ case 'number': {
78
+ return (_jsx(NumberDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), title: input.title, value: fieldValue, onUpdate: onSimpleDynamicFieldUpdate }));
79
+ }
80
+ case 'object': {
81
+ if (!input || !('properties' in input)) {
82
+ return null;
83
+ }
84
+ return (_jsx(ObjectDynamicField, { onRefresh: (value) => onUpdate(fieldPath, value), blockConfig: input.properties, title: input.title, value: fieldValue, onUpdate: onComplexDynamicFieldUpdate }));
85
+ }
86
+ case 'array': {
87
+ return (_jsx(ArrayDynamicField, { blockConfig: input, title: input.title, values: fieldValue, onUpdate: onComplexDynamicFieldUpdate }));
88
+ }
89
+ case 'oneOf': {
90
+ if (!input || !('options' in input)) {
91
+ return null;
92
+ }
93
+ return (_jsx(OneOfDynamicField, { inputConfig: input, contentConfig: contentConfig, onUpdate: onComplexDynamicFieldUpdate }));
94
+ }
95
+ default: {
96
+ return _jsxs("div", { children: ["Ignore ", JSON.stringify(input)] });
97
+ }
98
+ }
99
+ }, [contentConfig, decide, onUpdate]);
100
+ const sortedInputs = inputs.sort((x, y) => {
101
+ const nestingFieldTypes = ['object', 'array', 'oneOf'];
102
+ if (nestingFieldTypes.includes(x.type)) {
103
+ return 1;
104
+ }
105
+ if (nestingFieldTypes.includes(y.type)) {
106
+ return -1;
107
+ }
108
+ return 0;
109
+ });
110
+ return (_jsx("div", { className: b(), children: sortedInputs.map((input, index) => (_jsx(React.Fragment, { children: renderInput(input) }, index))) }));
111
+ };
112
+ export default DynamicForm;
113
+ //# sourceMappingURL=DynamicForm.js.map