@gravity-ui/page-constructor 6.3.2-alpha.0 → 6.3.2-alpha.3
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.
- package/build/cjs/blocks/CardLayout/index.d.ts +1 -1
- package/build/cjs/blocks/CardLayout/index.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/index.d.ts +1 -1
- package/build/cjs/blocks/ExtendedFeatures/index.d.ts +1 -1
- package/build/cjs/blocks/FilterBlock/index.d.ts +1 -1
- package/build/cjs/blocks/Form/index.d.ts +1 -1
- package/build/cjs/blocks/Header/dynamic-form.d.ts +1 -1
- package/build/cjs/blocks/Header/dynamic-form.js.map +1 -1
- package/build/cjs/blocks/Header/index.d.ts +1 -1
- package/build/cjs/blocks/HeaderSlider/index.d.ts +1 -1
- package/build/cjs/blocks/Icons/index.d.ts +1 -1
- package/build/cjs/blocks/Info/index.d.ts +1 -1
- package/build/cjs/blocks/Map/index.d.ts +1 -1
- package/build/cjs/blocks/Media/index.d.ts +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/index.d.ts +1 -1
- package/build/cjs/blocks/Questions/index.d.ts +1 -1
- package/build/cjs/blocks/Share/index.d.ts +1 -1
- package/build/cjs/blocks/Slider/dynamic-form.d.ts +1 -1
- package/build/cjs/blocks/Slider/dynamic-form.js.map +1 -1
- package/build/cjs/blocks/Slider/index.d.ts +1 -1
- package/build/cjs/blocks/Table/index.d.ts +1 -1
- package/build/cjs/blocks/Tabs/index.d.ts +1 -1
- package/build/cjs/blocks/TestEditorBlock/form.d.ts +1 -1
- package/build/cjs/blocks/TestEditorBlock/form.js.map +1 -1
- package/build/cjs/blocks/TestEditorBlock/index.d.ts +1 -1
- package/build/cjs/common/postMessage.d.ts +4 -0
- package/build/cjs/common/postMessage.js +31 -0
- package/build/cjs/common/postMessage.js.map +1 -0
- package/build/cjs/common/store.d.ts +40 -0
- package/build/cjs/common/store.js +20 -0
- package/build/cjs/common/store.js.map +1 -0
- package/build/cjs/common/types/actions.d.ts +36 -0
- package/build/cjs/common/types/actions.js +3 -0
- package/build/cjs/common/types/actions.js.map +1 -0
- package/build/cjs/common/types/common.d.ts +5 -0
- package/build/cjs/common/types/common.js +3 -0
- package/build/cjs/common/types/common.js.map +1 -0
- package/build/cjs/common/types/forms.d.ts +97 -0
- package/build/cjs/common/types/forms.js +3 -0
- package/build/cjs/common/types/forms.js.map +1 -0
- package/build/cjs/common/types/index.d.ts +4 -0
- package/build/cjs/common/types/index.js +8 -0
- package/build/cjs/common/types/index.js.map +1 -0
- package/build/cjs/common/types/messages.d.ts +9 -0
- package/build/cjs/common/types/messages.js +3 -0
- package/build/cjs/common/types/messages.js.map +1 -0
- package/build/cjs/common/utils.d.ts +25 -0
- package/build/cjs/common/utils.js +22 -0
- package/build/cjs/common/utils.js.map +1 -0
- package/build/cjs/components/Image/dynamic-form.d.ts +1 -1
- package/build/cjs/components/Image/dynamic-form.js.map +1 -1
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/constructor-items.js.map +1 -1
- package/build/cjs/context/editorStoreContext/PCEditorStoreContext.d.ts +1 -1
- package/build/cjs/context/editorStoreContext/PCEditorStoreContext.js +1 -1
- package/build/cjs/context/editorStoreContext/PCEditorStoreContext.js.map +1 -1
- package/build/cjs/context/editorStoreContext/PCEditorStoreProvider.js +1 -1
- package/build/cjs/context/editorStoreContext/PCEditorStoreProvider.js.map +1 -1
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.css +0 -0
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.d.ts +9 -0
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js +115 -0
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +76 -0
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.d.ts +12 -0
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +27 -0
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.css +37 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.d.ts +11 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.js +68 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/Array.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.d.ts +10 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js +22 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.css +3 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.d.ts +8 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js +13 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.d.ts +8 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.js +16 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Number/Number.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.d.ts +10 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.js +12 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Object/Object.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.css +6 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.d.ts +9 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js +35 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.css +3 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.d.ts +11 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.js +14 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Select/Select.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.d.ts +8 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.js +13 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/Text/Text.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.d.ts +8 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js +13 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js.map +1 -0
- package/build/cjs/editor-v2/components/DynamicForm/utils.d.ts +3 -0
- package/build/cjs/editor-v2/components/DynamicForm/utils.js +23 -0
- package/build/cjs/editor-v2/components/DynamicForm/utils.js.map +1 -0
- package/build/cjs/editor-v2/components/Panels/Panels.css +24 -0
- package/build/cjs/editor-v2/components/Panels/Panels.d.ts +8 -0
- package/build/cjs/editor-v2/components/Panels/Panels.js +28 -0
- package/build/cjs/editor-v2/components/Panels/Panels.js.map +1 -0
- package/build/cjs/editor-v2/components/Sidebar/Sidebar.css +14 -0
- package/build/cjs/editor-v2/components/Sidebar/Sidebar.d.ts +10 -0
- package/build/cjs/editor-v2/components/Sidebar/Sidebar.js +13 -0
- package/build/cjs/editor-v2/components/Sidebar/Sidebar.js.map +1 -0
- package/build/cjs/editor-v2/components/Tabs/Tabs.css +31 -0
- package/build/cjs/editor-v2/components/Tabs/Tabs.d.ts +13 -0
- package/build/cjs/editor-v2/components/Tabs/Tabs.js +32 -0
- package/build/cjs/editor-v2/components/Tabs/Tabs.js.map +1 -0
- package/build/cjs/editor-v2/constants.d.ts +1 -0
- package/build/cjs/editor-v2/constants.js +5 -0
- package/build/cjs/editor-v2/constants.js.map +1 -0
- package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.css +22 -0
- package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.d.ts +4 -0
- package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.js +58 -0
- package/build/cjs/editor-v2/containers/BigOverlay/BigOverlay.js.map +1 -0
- package/build/cjs/editor-v2/containers/BlockConfigForm/BlockConfigForm.css +20 -0
- package/build/cjs/editor-v2/containers/BlockConfigForm/BlockConfigForm.d.ts +5 -0
- package/build/cjs/editor-v2/containers/BlockConfigForm/BlockConfigForm.js +28 -0
- package/build/cjs/editor-v2/containers/BlockConfigForm/BlockConfigForm.js.map +1 -0
- package/build/cjs/editor-v2/containers/BlocksList/BlocksList.css +52 -0
- package/build/cjs/editor-v2/containers/BlocksList/BlocksList.d.ts +2 -0
- package/build/cjs/editor-v2/containers/BlocksList/BlocksList.js +43 -0
- package/build/cjs/editor-v2/containers/BlocksList/BlocksList.js.map +1 -0
- package/build/cjs/editor-v2/containers/Editor/Editor.css +38 -0
- package/build/cjs/editor-v2/containers/Editor/Editor.d.ts +21 -0
- package/build/cjs/editor-v2/containers/Editor/Editor.js +41 -0
- package/build/cjs/editor-v2/containers/Editor/Editor.js.map +1 -0
- package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.css +9 -0
- package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.d.ts +5 -0
- package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.js +17 -0
- package/build/cjs/editor-v2/containers/GlobalConfig/GlobalConfig.js.map +1 -0
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.css +49 -0
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.d.ts +7 -0
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js +34 -0
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -0
- package/build/cjs/editor-v2/containers/Overlay/Overlay.css +64 -0
- package/build/cjs/editor-v2/containers/Overlay/Overlay.d.ts +6 -0
- package/build/cjs/editor-v2/containers/Overlay/Overlay.js +90 -0
- package/build/cjs/editor-v2/containers/Overlay/Overlay.js.map +1 -0
- package/build/cjs/editor-v2/containers/Source/Source.css +14 -0
- package/build/cjs/editor-v2/containers/Source/Source.d.ts +2 -0
- package/build/cjs/editor-v2/containers/Source/Source.js +28 -0
- package/build/cjs/editor-v2/containers/Source/Source.js.map +1 -0
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.css +37 -0
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.d.ts +6 -0
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js +41 -0
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js.map +1 -0
- package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.css +3 -0
- package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.d.ts +7 -0
- package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js +18 -0
- package/build/cjs/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js.map +1 -0
- package/build/cjs/editor-v2/containers/Tree/DragContext.css +25 -0
- package/build/cjs/editor-v2/containers/Tree/DragContext.d.ts +14 -0
- package/build/cjs/editor-v2/containers/Tree/DragContext.js +49 -0
- package/build/cjs/editor-v2/containers/Tree/DragContext.js.map +1 -0
- package/build/cjs/editor-v2/containers/Tree/Tree.css +10 -0
- package/build/cjs/editor-v2/containers/Tree/Tree.d.ts +2 -0
- package/build/cjs/editor-v2/containers/Tree/Tree.js +36 -0
- package/build/cjs/editor-v2/containers/Tree/Tree.js.map +1 -0
- package/build/cjs/editor-v2/containers/Tree/TreeContent.css +12 -0
- package/build/cjs/editor-v2/containers/Tree/TreeContent.d.ts +16 -0
- package/build/cjs/editor-v2/containers/Tree/TreeContent.js +61 -0
- package/build/cjs/editor-v2/containers/Tree/TreeContent.js.map +1 -0
- package/build/cjs/editor-v2/containers/Tree/TreeItem.css +50 -0
- package/build/cjs/editor-v2/containers/Tree/TreeItem.d.ts +13 -0
- package/build/cjs/editor-v2/containers/Tree/TreeItem.js +144 -0
- package/build/cjs/editor-v2/containers/Tree/TreeItem.js.map +1 -0
- package/build/cjs/editor-v2/containers/Tree/index.d.ts +4 -0
- package/build/cjs/editor-v2/containers/Tree/index.js +10 -0
- package/build/cjs/editor-v2/containers/Tree/index.js.map +1 -0
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.css +13 -0
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.d.ts +3 -0
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js +54 -0
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -0
- package/build/cjs/editor-v2/containers/index.d.ts +7 -0
- package/build/cjs/editor-v2/containers/index.js +19 -0
- package/build/cjs/editor-v2/containers/index.js.map +1 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.d.ts +7 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.js +10 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreContext.js.map +1 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.d.ts +5 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.js +35 -0
- package/build/cjs/editor-v2/context/editorStore/MainEditorStoreProvider.js.map +1 -0
- package/build/cjs/editor-v2/context/editorStore/index.d.ts +2 -0
- package/build/cjs/editor-v2/context/editorStore/index.js +6 -0
- package/build/cjs/editor-v2/context/editorStore/index.js.map +1 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeContext.d.ts +12 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeContext.js +14 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeContext.js.map +1 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeProvider.d.ts +7 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeProvider.js +21 -0
- package/build/cjs/editor-v2/context/iframeContext/IframeProvider.js.map +1 -0
- package/build/cjs/editor-v2/context/iframeContext/index.d.ts +2 -0
- package/build/cjs/editor-v2/context/iframeContext/index.js +6 -0
- package/build/cjs/editor-v2/context/iframeContext/index.js.map +1 -0
- package/build/cjs/editor-v2/hooks/index.d.ts +2 -0
- package/build/cjs/editor-v2/hooks/index.js +8 -0
- package/build/cjs/editor-v2/hooks/index.js.map +1 -0
- package/build/cjs/editor-v2/hooks/useEditorTabs.d.ts +16 -0
- package/build/cjs/editor-v2/hooks/useEditorTabs.js +77 -0
- package/build/cjs/editor-v2/hooks/useEditorTabs.js.map +1 -0
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -0
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js +31 -0
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js.map +1 -0
- package/build/cjs/editor-v2/hooks/useMainEditorStore.d.ts +1 -0
- package/build/cjs/editor-v2/hooks/useMainEditorStore.js +13 -0
- package/build/cjs/editor-v2/hooks/useMainEditorStore.js.map +1 -0
- package/build/cjs/editor-v2/hooks/usePostMessageEvents.d.ts +6 -0
- package/build/cjs/editor-v2/hooks/usePostMessageEvents.js +19 -0
- package/build/cjs/editor-v2/hooks/usePostMessageEvents.js.map +1 -0
- package/build/cjs/editor-v2/index.d.ts +5 -0
- package/build/cjs/editor-v2/index.js +9 -0
- package/build/cjs/editor-v2/index.js.map +1 -0
- package/build/cjs/editor-v2/store.d.ts +48 -0
- package/build/cjs/editor-v2/store.js +181 -0
- package/build/cjs/editor-v2/store.js.map +1 -0
- package/build/cjs/editor-v2/styles/mixins.css +0 -0
- package/build/cjs/editor-v2/styles/root.css +9 -0
- package/build/cjs/editor-v2/styles/variables.css +0 -0
- package/build/cjs/editor-v2/utils/cn.d.ts +2 -0
- package/build/cjs/editor-v2/utils/cn.js +7 -0
- package/build/cjs/editor-v2/utils/cn.js.map +1 -0
- package/build/cjs/editor-v2/utils/code.d.ts +6 -0
- package/build/cjs/editor-v2/utils/code.js +13 -0
- package/build/cjs/editor-v2/utils/code.js.map +1 -0
- package/build/cjs/editor-v2/utils/index.d.ts +20 -0
- package/build/cjs/editor-v2/utils/index.js +161 -0
- package/build/cjs/editor-v2/utils/index.js.map +1 -0
- package/build/cjs/hooks/usePCEditorInitializeEvents.js.map +1 -1
- package/build/cjs/hooks/usePCEditorStore.d.ts +1 -1
- package/build/cjs/hooks/usePostMessageAPI.d.ts +1 -1
- package/build/cjs/hooks/usePostMessageAPI.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/dynamic-form.d.ts +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/dynamic-form.js.map +1 -1
- package/build/cjs/utils/form-generator.d.ts +1 -1
- package/build/cjs/utils/form-generator.js.map +1 -1
- package/build/esm/blocks/CardLayout/index.d.ts +1 -1
- package/build/esm/blocks/CardLayout/index.js.map +1 -1
- package/build/esm/blocks/ContentLayout/index.d.ts +1 -1
- package/build/esm/blocks/ExtendedFeatures/index.d.ts +1 -1
- package/build/esm/blocks/FilterBlock/index.d.ts +1 -1
- package/build/esm/blocks/Form/index.d.ts +1 -1
- package/build/esm/blocks/Header/dynamic-form.d.ts +1 -1
- package/build/esm/blocks/Header/dynamic-form.js.map +1 -1
- package/build/esm/blocks/Header/index.d.ts +1 -1
- package/build/esm/blocks/HeaderSlider/index.d.ts +1 -1
- package/build/esm/blocks/Icons/index.d.ts +1 -1
- package/build/esm/blocks/Info/index.d.ts +1 -1
- package/build/esm/blocks/Map/index.d.ts +1 -1
- package/build/esm/blocks/Media/index.d.ts +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/index.d.ts +1 -1
- package/build/esm/blocks/Questions/index.d.ts +1 -1
- package/build/esm/blocks/Share/index.d.ts +1 -1
- package/build/esm/blocks/Slider/dynamic-form.d.ts +1 -1
- package/build/esm/blocks/Slider/dynamic-form.js.map +1 -1
- package/build/esm/blocks/Slider/index.d.ts +1 -1
- package/build/esm/blocks/Table/index.d.ts +1 -1
- package/build/esm/blocks/Tabs/index.d.ts +1 -1
- package/build/esm/blocks/TestEditorBlock/form.d.ts +1 -1
- package/build/esm/blocks/TestEditorBlock/form.js.map +1 -1
- package/build/esm/blocks/TestEditorBlock/index.d.ts +1 -1
- package/build/esm/common/postMessage.d.ts +4 -0
- package/build/esm/common/postMessage.js +25 -0
- package/build/esm/common/postMessage.js.map +1 -0
- package/build/esm/common/store.d.ts +40 -0
- package/build/esm/common/store.js +17 -0
- package/build/esm/common/store.js.map +1 -0
- package/build/esm/common/types/actions.d.ts +36 -0
- package/build/esm/common/types/actions.js +2 -0
- package/build/esm/common/types/actions.js.map +1 -0
- package/build/esm/common/types/common.d.ts +5 -0
- package/build/esm/common/types/common.js +2 -0
- package/build/esm/common/types/common.js.map +1 -0
- package/build/esm/common/types/forms.d.ts +97 -0
- package/build/esm/common/types/forms.js +2 -0
- package/build/esm/common/types/forms.js.map +1 -0
- package/build/esm/common/types/index.d.ts +4 -0
- package/build/esm/common/types/index.js +5 -0
- package/build/esm/common/types/index.js.map +1 -0
- package/build/esm/common/types/messages.d.ts +9 -0
- package/build/esm/common/types/messages.js +2 -0
- package/build/esm/common/types/messages.js.map +1 -0
- package/build/esm/common/utils.d.ts +25 -0
- package/build/esm/common/utils.js +17 -0
- package/build/esm/common/utils.js.map +1 -0
- package/build/esm/components/Image/dynamic-form.d.ts +1 -1
- package/build/esm/components/Image/dynamic-form.js.map +1 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/constructor-items.js.map +1 -1
- package/build/esm/context/editorStoreContext/PCEditorStoreContext.d.ts +1 -1
- package/build/esm/context/editorStoreContext/PCEditorStoreContext.js +1 -1
- package/build/esm/context/editorStoreContext/PCEditorStoreContext.js.map +1 -1
- package/build/esm/context/editorStoreContext/PCEditorStoreProvider.js +1 -1
- package/build/esm/context/editorStoreContext/PCEditorStoreProvider.js.map +1 -1
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.css +0 -0
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.d.ts +10 -0
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js +113 -0
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +76 -0
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.d.ts +13 -0
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +25 -0
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.css +37 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.d.ts +12 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.js +66 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/Array.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.d.ts +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js +19 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Array/ItemButton/ItemButton.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.css +3 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.d.ts +9 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js +11 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Boolean/Boolean.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.d.ts +8 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.js +13 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Number/Number.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.d.ts +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.js +9 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Object/Object.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.css +6 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.d.ts +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js +33 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/OneOf/OneOf.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.css +3 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.d.ts +12 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.js +12 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Select/Select.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.d.ts +8 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.js +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/Text/Text.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.d.ts +8 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/TextArea/TextArea.js.map +1 -0
- package/build/esm/editor-v2/components/DynamicForm/utils.d.ts +3 -0
- package/build/esm/editor-v2/components/DynamicForm/utils.js +17 -0
- package/build/esm/editor-v2/components/DynamicForm/utils.js.map +1 -0
- package/build/esm/editor-v2/components/Panels/Panels.css +24 -0
- package/build/esm/editor-v2/components/Panels/Panels.d.ts +9 -0
- package/build/esm/editor-v2/components/Panels/Panels.js +24 -0
- package/build/esm/editor-v2/components/Panels/Panels.js.map +1 -0
- package/build/esm/editor-v2/components/Sidebar/Sidebar.css +14 -0
- package/build/esm/editor-v2/components/Sidebar/Sidebar.d.ts +11 -0
- package/build/esm/editor-v2/components/Sidebar/Sidebar.js +9 -0
- package/build/esm/editor-v2/components/Sidebar/Sidebar.js.map +1 -0
- package/build/esm/editor-v2/components/Tabs/Tabs.css +31 -0
- package/build/esm/editor-v2/components/Tabs/Tabs.d.ts +14 -0
- package/build/esm/editor-v2/components/Tabs/Tabs.js +30 -0
- package/build/esm/editor-v2/components/Tabs/Tabs.js.map +1 -0
- package/build/esm/editor-v2/constants.d.ts +1 -0
- package/build/esm/editor-v2/constants.js +2 -0
- package/build/esm/editor-v2/constants.js.map +1 -0
- package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.css +22 -0
- package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.d.ts +5 -0
- package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.js +56 -0
- package/build/esm/editor-v2/containers/BigOverlay/BigOverlay.js.map +1 -0
- package/build/esm/editor-v2/containers/BlockConfigForm/BlockConfigForm.css +20 -0
- package/build/esm/editor-v2/containers/BlockConfigForm/BlockConfigForm.d.ts +6 -0
- package/build/esm/editor-v2/containers/BlockConfigForm/BlockConfigForm.js +26 -0
- package/build/esm/editor-v2/containers/BlockConfigForm/BlockConfigForm.js.map +1 -0
- package/build/esm/editor-v2/containers/BlocksList/BlocksList.css +52 -0
- package/build/esm/editor-v2/containers/BlocksList/BlocksList.d.ts +3 -0
- package/build/esm/editor-v2/containers/BlocksList/BlocksList.js +41 -0
- package/build/esm/editor-v2/containers/BlocksList/BlocksList.js.map +1 -0
- package/build/esm/editor-v2/containers/Editor/Editor.css +38 -0
- package/build/esm/editor-v2/containers/Editor/Editor.d.ts +22 -0
- package/build/esm/editor-v2/containers/Editor/Editor.js +37 -0
- package/build/esm/editor-v2/containers/Editor/Editor.js.map +1 -0
- package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.css +9 -0
- package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.d.ts +6 -0
- package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.js +15 -0
- package/build/esm/editor-v2/containers/GlobalConfig/GlobalConfig.js.map +1 -0
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.css +49 -0
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.d.ts +8 -0
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js +32 -0
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -0
- package/build/esm/editor-v2/containers/Overlay/Overlay.css +64 -0
- package/build/esm/editor-v2/containers/Overlay/Overlay.d.ts +7 -0
- package/build/esm/editor-v2/containers/Overlay/Overlay.js +88 -0
- package/build/esm/editor-v2/containers/Overlay/Overlay.js.map +1 -0
- package/build/esm/editor-v2/containers/Source/Source.css +14 -0
- package/build/esm/editor-v2/containers/Source/Source.d.ts +3 -0
- package/build/esm/editor-v2/containers/Source/Source.js +26 -0
- package/build/esm/editor-v2/containers/Source/Source.js.map +1 -0
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.css +37 -0
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.d.ts +7 -0
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.js +39 -0
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.js.map +1 -0
- package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.css +3 -0
- package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.d.ts +8 -0
- package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js +14 -0
- package/build/esm/editor-v2/containers/SourceCode/UpdateModal/UpdateModal.js.map +1 -0
- package/build/esm/editor-v2/containers/Tree/DragContext.css +25 -0
- package/build/esm/editor-v2/containers/Tree/DragContext.d.ts +15 -0
- package/build/esm/editor-v2/containers/Tree/DragContext.js +45 -0
- package/build/esm/editor-v2/containers/Tree/DragContext.js.map +1 -0
- package/build/esm/editor-v2/containers/Tree/Tree.css +10 -0
- package/build/esm/editor-v2/containers/Tree/Tree.d.ts +3 -0
- package/build/esm/editor-v2/containers/Tree/Tree.js +34 -0
- package/build/esm/editor-v2/containers/Tree/Tree.js.map +1 -0
- package/build/esm/editor-v2/containers/Tree/TreeContent.css +12 -0
- package/build/esm/editor-v2/containers/Tree/TreeContent.d.ts +17 -0
- package/build/esm/editor-v2/containers/Tree/TreeContent.js +57 -0
- package/build/esm/editor-v2/containers/Tree/TreeContent.js.map +1 -0
- package/build/esm/editor-v2/containers/Tree/TreeItem.css +50 -0
- package/build/esm/editor-v2/containers/Tree/TreeItem.d.ts +14 -0
- package/build/esm/editor-v2/containers/Tree/TreeItem.js +140 -0
- package/build/esm/editor-v2/containers/Tree/TreeItem.js.map +1 -0
- package/build/esm/editor-v2/containers/Tree/index.d.ts +4 -0
- package/build/esm/editor-v2/containers/Tree/index.js +5 -0
- package/build/esm/editor-v2/containers/Tree/index.js.map +1 -0
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.css +13 -0
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.d.ts +4 -0
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js +52 -0
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -0
- package/build/esm/editor-v2/containers/index.d.ts +7 -0
- package/build/esm/editor-v2/containers/index.js +8 -0
- package/build/esm/editor-v2/containers/index.js.map +1 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.d.ts +7 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.js +6 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreContext.js.map +1 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.d.ts +5 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.js +30 -0
- package/build/esm/editor-v2/context/editorStore/MainEditorStoreProvider.js.map +1 -0
- package/build/esm/editor-v2/context/editorStore/index.d.ts +2 -0
- package/build/esm/editor-v2/context/editorStore/index.js +3 -0
- package/build/esm/editor-v2/context/editorStore/index.js.map +1 -0
- package/build/esm/editor-v2/context/iframeContext/IframeContext.d.ts +12 -0
- package/build/esm/editor-v2/context/iframeContext/IframeContext.js +10 -0
- package/build/esm/editor-v2/context/iframeContext/IframeContext.js.map +1 -0
- package/build/esm/editor-v2/context/iframeContext/IframeProvider.d.ts +7 -0
- package/build/esm/editor-v2/context/iframeContext/IframeProvider.js +16 -0
- package/build/esm/editor-v2/context/iframeContext/IframeProvider.js.map +1 -0
- package/build/esm/editor-v2/context/iframeContext/index.d.ts +2 -0
- package/build/esm/editor-v2/context/iframeContext/index.js +3 -0
- package/build/esm/editor-v2/context/iframeContext/index.js.map +1 -0
- package/build/esm/editor-v2/hooks/index.d.ts +2 -0
- package/build/esm/editor-v2/hooks/index.js +3 -0
- package/build/esm/editor-v2/hooks/index.js.map +1 -0
- package/build/esm/editor-v2/hooks/useEditorTabs.d.ts +16 -0
- package/build/esm/editor-v2/hooks/useEditorTabs.js +72 -0
- package/build/esm/editor-v2/hooks/useEditorTabs.js.map +1 -0
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -0
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.js +29 -0
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.js.map +1 -0
- package/build/esm/editor-v2/hooks/useMainEditorStore.d.ts +1 -0
- package/build/esm/editor-v2/hooks/useMainEditorStore.js +8 -0
- package/build/esm/editor-v2/hooks/useMainEditorStore.js.map +1 -0
- package/build/esm/editor-v2/hooks/usePostMessageEvents.d.ts +6 -0
- package/build/esm/editor-v2/hooks/usePostMessageEvents.js +15 -0
- package/build/esm/editor-v2/hooks/usePostMessageEvents.js.map +1 -0
- package/build/esm/editor-v2/index.d.ts +5 -0
- package/build/esm/editor-v2/index.js +6 -0
- package/build/esm/editor-v2/index.js.map +1 -0
- package/build/esm/editor-v2/store.d.ts +48 -0
- package/build/esm/editor-v2/store.js +177 -0
- package/build/esm/editor-v2/store.js.map +1 -0
- package/build/esm/editor-v2/styles/mixins.css +0 -0
- package/build/esm/editor-v2/styles/root.css +9 -0
- package/build/esm/editor-v2/styles/variables.css +0 -0
- package/build/esm/editor-v2/utils/cn.d.ts +2 -0
- package/build/esm/editor-v2/utils/cn.js +4 -0
- package/build/esm/editor-v2/utils/cn.js.map +1 -0
- package/build/esm/editor-v2/utils/code.d.ts +6 -0
- package/build/esm/editor-v2/utils/code.js +9 -0
- package/build/esm/editor-v2/utils/code.js.map +1 -0
- package/build/esm/editor-v2/utils/index.d.ts +20 -0
- package/build/esm/editor-v2/utils/index.js +143 -0
- package/build/esm/editor-v2/utils/index.js.map +1 -0
- package/build/esm/hooks/usePCEditorInitializeEvents.js.map +1 -1
- package/build/esm/hooks/usePCEditorStore.d.ts +1 -1
- package/build/esm/hooks/usePostMessageAPI.d.ts +1 -1
- package/build/esm/hooks/usePostMessageAPI.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/dynamic-form.d.ts +1 -1
- package/build/esm/sub-blocks/BackgroundCard/dynamic-form.js.map +1 -1
- package/build/esm/utils/form-generator.d.ts +1 -1
- package/build/esm/utils/form-generator.js.map +1 -1
- package/package.json +1 -2
- package/widget/index.js +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { editorCn } from "../../utils/cn.js";
|
|
4
|
+
import { DragContextProvider } from "./DragContext.js";
|
|
5
|
+
import { TreeContent } from "./TreeContent.js";
|
|
6
|
+
import { useMainEditorStore } from "../../hooks/useMainEditorStore.js";
|
|
7
|
+
import { Button, Icon } from '@gravity-ui/uikit';
|
|
8
|
+
import { TrashBin } from '@gravity-ui/icons';
|
|
9
|
+
import { generateChildrenPathFromArray, getItemTitle } from "../../utils/index.js";
|
|
10
|
+
import './Tree.css';
|
|
11
|
+
const b = editorCn('tree');
|
|
12
|
+
const generateTree = (items) => {
|
|
13
|
+
return items.map((item) => {
|
|
14
|
+
let children;
|
|
15
|
+
if ('children' in item && item.children?.length) {
|
|
16
|
+
children = generateTree(item.children);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
type: item.type,
|
|
20
|
+
children,
|
|
21
|
+
treeTitle: getItemTitle(item),
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
// Main Tree component with context provider
|
|
26
|
+
const Tree = () => {
|
|
27
|
+
const { content, resetBlocks, selectedBlock, duplicateBlock, deleteBlock, setSelectedBlock, reorderBlock, } = useMainEditorStore();
|
|
28
|
+
const selectedBlockPath = React.useMemo(() => {
|
|
29
|
+
return generateChildrenPathFromArray(selectedBlock || []);
|
|
30
|
+
}, [selectedBlock]);
|
|
31
|
+
return (_jsx(DragContextProvider, { children: _jsxs("div", { className: b(), children: [_jsx("div", { className: b('head'), children: _jsxs(Button, { view: "outlined-danger", onClick: () => resetBlocks(), children: [_jsx(Icon, { data: TrashBin }), "Clear all"] }) }), _jsx(TreeContent, { reorderBlock: reorderBlock, onCopy: duplicateBlock, onDelete: deleteBlock, onSelect: setSelectedBlock, blockTree: generateTree(content.blocks), selectedBlockPath: selectedBlockPath })] }) }));
|
|
32
|
+
};
|
|
33
|
+
export default Tree;
|
|
34
|
+
//# sourceMappingURL=Tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.js","sourceRoot":"../../../../../src","sources":["editor-v2/containers/Tree/Tree.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,0BAAuB;AACxC,OAAO,EAAC,mBAAmB,EAAC,yBAAsB;AAClD,OAAO,EAAC,WAAW,EAAW,yBAAsB;AAEpD,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAClE,OAAO,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,6BAA6B,EAAE,YAAY,EAAC,6BAAoB;AAExE,OAAO,YAAY,CAAC;AAEpB,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE3B,MAAM,YAAY,GAAG,CAAC,KAAiB,EAAc,EAAE;IACnD,OAAO,K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,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {editorCn} from '../../utils/cn';\nimport {DragContextProvider} from './DragContext';\nimport {TreeContent, TreeItem} from './TreeContent';\n\nimport {useMainEditorStore} from '../../hooks/useMainEditorStore';\nimport {Button, Icon} from '@gravity-ui/uikit';\nimport {TrashBin} from '@gravity-ui/icons';\nimport {generateChildrenPathFromArray, getItemTitle} from '../../utils';\n\nimport './Tree.scss';\n\nconst b = editorCn('tree');\n\nconst generateTree = (items: TreeItem[]): TreeItem[] => {\n return items.map((item) => {\n let children;\n\n if ('children' in item && item.children?.length) {\n children = generateTree(item.children);\n }\n\n return {\n type: item.type,\n children,\n treeTitle: getItemTitle(item),\n };\n });\n};\n\n// Main Tree component with context provider\nconst Tree = () => {\n const {\n content,\n resetBlocks,\n selectedBlock,\n duplicateBlock,\n deleteBlock,\n setSelectedBlock,\n reorderBlock,\n } = useMainEditorStore();\n\n const selectedBlockPath = React.useMemo(() => {\n return generateChildrenPathFromArray(selectedBlock || []);\n }, [selectedBlock]);\n\n return (\n <DragContextProvider>\n <div className={b()}>\n <div className={b('head')}>\n <Button view=\"outlined-danger\" onClick={() => resetBlocks()}>\n <Icon data={TrashBin} />\n Clear all\n </Button>\n </div>\n <TreeContent\n reorderBlock={reorderBlock}\n onCopy={duplicateBlock}\n onDelete={deleteBlock}\n onSelect={setSelectedBlock}\n blockTree={generateTree(content.blocks)}\n selectedBlockPath={selectedBlockPath}\n />\n </div>\n </DragContextProvider>\n );\n};\n\nexport default Tree;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './TreeContent.css';
|
|
3
|
+
interface TreeContentProps {
|
|
4
|
+
blockTree: TreeItem[];
|
|
5
|
+
selectedBlockPath: string;
|
|
6
|
+
reorderBlock(selectedBlock: number[], destination: number[], position?: 'prepend' | 'append'): void;
|
|
7
|
+
onCopy(path: number[]): void;
|
|
8
|
+
onDelete(path: number[]): void;
|
|
9
|
+
onSelect(path: number[]): void;
|
|
10
|
+
}
|
|
11
|
+
export type TreeItem = {
|
|
12
|
+
type: string;
|
|
13
|
+
children?: TreeItem[];
|
|
14
|
+
treeTitle?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const TreeContent: ({ blockTree, selectedBlockPath, reorderBlock, onCopy, onDelete, onSelect, }: React.PropsWithChildren<TreeContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { generateChildrenPathFromArray } from "../../utils/index.js";
|
|
4
|
+
import { DragContext } from "./DragContext.js";
|
|
5
|
+
import { Item } from "./TreeItem.js";
|
|
6
|
+
import { editorCn } from "../../utils/cn.js";
|
|
7
|
+
import './TreeContent.css';
|
|
8
|
+
const b = editorCn('tree-content');
|
|
9
|
+
export const TreeContent = ({ blockTree, selectedBlockPath, reorderBlock, onCopy, onDelete, onSelect, }) => {
|
|
10
|
+
const { draggedItem, setDraggedItem, hidePreview, showPreview } = React.useContext(DragContext);
|
|
11
|
+
const handleFirstPositionDrop = React.useCallback((e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
try {
|
|
15
|
+
const data = e.dataTransfer.getData('application/json');
|
|
16
|
+
if (data) {
|
|
17
|
+
const dragItem = JSON.parse(data);
|
|
18
|
+
// Reorder to the first position by using [0] as destination
|
|
19
|
+
// and 'prepend' as position
|
|
20
|
+
reorderBlock(dragItem.path, [0], 'prepend');
|
|
21
|
+
// Reset drag context
|
|
22
|
+
setDraggedItem(null);
|
|
23
|
+
hidePreview();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.error('Error parsing drag data:', error);
|
|
29
|
+
}
|
|
30
|
+
}, [reorderBlock, hidePreview, setDraggedItem]);
|
|
31
|
+
const handleDragOver = React.useCallback((e) => {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign
|
|
35
|
+
e.dataTransfer.dropEffect = 'move';
|
|
36
|
+
// Show preview element at this position
|
|
37
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
38
|
+
if (draggedItem) {
|
|
39
|
+
showPreview(rect, draggedItem);
|
|
40
|
+
}
|
|
41
|
+
}, [draggedItem, showPreview]);
|
|
42
|
+
const renderTree = (items, parentPathArray) => {
|
|
43
|
+
return items.map(({ type, treeTitle, children }, index) => {
|
|
44
|
+
let blockPathArray;
|
|
45
|
+
if (parentPathArray) {
|
|
46
|
+
blockPathArray = [...parentPathArray, index];
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
blockPathArray = [index];
|
|
50
|
+
}
|
|
51
|
+
const blockPath = generateChildrenPathFromArray(blockPathArray);
|
|
52
|
+
return (_jsx(Item, { type: type, treeTitle: treeTitle, onCopy: onCopy, onDelete: onDelete, onSelect: onSelect, onReorder: reorderBlock, path: blockPathArray, selected: selectedBlockPath === blockPath, children: children && (_jsx("div", { className: b('children'), children: renderTree(children, blockPathArray) })) }, index));
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return (_jsxs("div", { className: b(), children: [_jsx("div", { className: b('drop-zone'), onDragOver: handleDragOver, onDragLeave: hidePreview, onDrop: handleFirstPositionDrop }), _jsx("div", { children: renderTree(blockTree) })] }));
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=TreeContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeContent.js","sourceRoot":"../../../../../src","sources":["editor-v2/containers/Tree/TreeContent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EA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AO,CAC9E,IANI,KAAK,CAOP,CACV,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,EAAE,aACf,cACI,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,EACzB,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,uBAAuB,GAC5B,EACP,wBAAM,UAAU,CAAC,SAAS,CAAC,GAAO,IAChC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {generateChildrenPathFromArray} from '../../utils';\nimport {DragContext, DragItem} from './DragContext';\nimport {Item} from './TreeItem';\nimport {editorCn} from '../../utils/cn';\n\nimport './TreeContent.scss';\n\nconst b = editorCn('tree-content');\n\ninterface TreeContentProps {\n blockTree: TreeItem[];\n selectedBlockPath: string;\n reorderBlock(\n selectedBlock: number[],\n destination: number[],\n position?: 'prepend' | 'append',\n ): void;\n onCopy(path: number[]): void;\n onDelete(path: number[]): void;\n onSelect(path: number[]): void;\n}\n\nexport type TreeItem = {\n type: string;\n children?: TreeItem[];\n treeTitle?: string;\n};\n\nexport const TreeContent = ({\n blockTree,\n selectedBlockPath,\n reorderBlock,\n onCopy,\n onDelete,\n onSelect,\n}: React.PropsWithChildren<TreeContentProps>) => {\n const {draggedItem, setDraggedItem, hidePreview, showPreview} = React.useContext(DragContext);\n\n const handleFirstPositionDrop = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n\n try {\n const data = e.dataTransfer.getData('application/json');\n if (data) {\n const dragItem: DragItem = JSON.parse(data);\n // Reorder to the first position by using [0] as destination\n // and 'prepend' as position\n reorderBlock(dragItem.path, [0], 'prepend');\n\n // Reset drag context\n setDraggedItem(null);\n hidePreview();\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error parsing drag data:', error);\n }\n },\n [reorderBlock, hidePreview, setDraggedItem],\n );\n\n const handleDragOver = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n e.dataTransfer.dropEffect = 'move';\n\n // Show preview element at this position\n const rect = e.currentTarget.getBoundingClientRect();\n if (draggedItem) {\n showPreview(rect, draggedItem);\n }\n },\n [draggedItem, showPreview],\n );\n\n const renderTree = (items: TreeItem[], parentPathArray?: number[]) => {\n return items.map(({type, treeTitle, children}, index) => {\n let blockPathArray: number[];\n if (parentPathArray) {\n blockPathArray = [...parentPathArray, index];\n } else {\n blockPathArray = [index];\n }\n const blockPath = generateChildrenPathFromArray(blockPathArray);\n\n return (\n <Item\n type={type}\n treeTitle={treeTitle}\n onCopy={onCopy}\n onDelete={onDelete}\n onSelect={onSelect}\n onReorder={reorderBlock}\n key={index}\n path={blockPathArray}\n selected={selectedBlockPath === blockPath}\n >\n {children && (\n <div className={b('children')}>{renderTree(children, blockPathArray)}</div>\n )}\n </Item>\n );\n });\n };\n\n return (\n <div className={b()}>\n <div\n className={b('drop-zone')}\n onDragOver={handleDragOver}\n onDragLeave={hidePreview}\n onDrop={handleFirstPositionDrop}\n ></div>\n <div>{renderTree(blockTree)}</div>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.pceditor-tree-item {
|
|
2
|
+
padding: 8px;
|
|
3
|
+
margin-bottom: 8px;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
}
|
|
6
|
+
.pceditor-tree-item_selected {
|
|
7
|
+
border: 1.5px var(--g-color-line-brand) solid;
|
|
8
|
+
}
|
|
9
|
+
.pceditor-tree-item_dragging {
|
|
10
|
+
opacity: 0.5;
|
|
11
|
+
}
|
|
12
|
+
.pceditor-tree-item_drag-over {
|
|
13
|
+
border: 1.5px var(--g-color-line-generic) dashed;
|
|
14
|
+
}
|
|
15
|
+
.pceditor-tree-item:last-child {
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
}
|
|
18
|
+
.pceditor-tree-item__main {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
.pceditor-tree-item__main:hover .pceditor-tree-item__buttons {
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
.pceditor-tree-item__text {
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
min-width: 1px;
|
|
29
|
+
}
|
|
30
|
+
.pceditor-tree-item__buttons {
|
|
31
|
+
flex: 0 0 auto;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
gap: 4px;
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
.pceditor-tree-item__type {
|
|
37
|
+
color: var(--g-color-text-secondary);
|
|
38
|
+
}
|
|
39
|
+
.pceditor-tree-item__title {
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
}
|
|
44
|
+
.pceditor-tree-item__children-drop-zone {
|
|
45
|
+
height: 8px;
|
|
46
|
+
margin-top: 8px;
|
|
47
|
+
margin-bottom: 0;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
transition: background-color 0.2s;
|
|
50
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './TreeItem.css';
|
|
3
|
+
export interface ItemProps {
|
|
4
|
+
type: string;
|
|
5
|
+
treeTitle?: string;
|
|
6
|
+
path: number[];
|
|
7
|
+
selected: boolean;
|
|
8
|
+
onCopy(path: number[]): void;
|
|
9
|
+
onDelete(path: number[]): void;
|
|
10
|
+
onSelect(path: number[]): void;
|
|
11
|
+
onReorder(sourcePath: number[], destinationPath: number[], position?: 'prepend' | 'append'): void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Item: ({ type, children, treeTitle, path, selected, onCopy, onDelete, onSelect, onReorder, }: ItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Copy, TrashBin } from '@gravity-ui/icons';
|
|
3
|
+
import { Button, Card, Icon } from '@gravity-ui/uikit';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { editorCn } from "../../utils/cn.js";
|
|
6
|
+
import { DragContext } from "./DragContext.js";
|
|
7
|
+
import './TreeItem.css';
|
|
8
|
+
const b = editorCn('tree-item');
|
|
9
|
+
export const Item = ({ type, children, treeTitle, path, selected, onCopy, onDelete, onSelect, onReorder, }) => {
|
|
10
|
+
const { draggedItem, setDraggedItem, showPreview, hidePreview } = React.useContext(DragContext);
|
|
11
|
+
const [isDragging, setIsDragging] = React.useState(false);
|
|
12
|
+
const [isDragOver, setIsDragOver] = React.useState(false);
|
|
13
|
+
const [mouseDownPos, setMouseDownPos] = React.useState(null);
|
|
14
|
+
const itemRef = React.useRef(null);
|
|
15
|
+
// Scroll into view when selected
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (selected && itemRef.current) {
|
|
18
|
+
itemRef.current.scrollIntoView({
|
|
19
|
+
behavior: 'smooth',
|
|
20
|
+
block: 'nearest',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, [selected]);
|
|
24
|
+
const handleCopy = React.useCallback(() => {
|
|
25
|
+
onCopy(path);
|
|
26
|
+
}, [onCopy, path]);
|
|
27
|
+
const handleDelete = React.useCallback(() => {
|
|
28
|
+
onDelete(path);
|
|
29
|
+
}, [onDelete, path]);
|
|
30
|
+
const handleMouseDown = React.useCallback((e) => {
|
|
31
|
+
setMouseDownPos({ x: e.clientX, y: e.clientY });
|
|
32
|
+
}, []);
|
|
33
|
+
const handleMouseUp = React.useCallback((e) => {
|
|
34
|
+
if (mouseDownPos) {
|
|
35
|
+
// Check if the mouse has moved significantly (dragging) or just a click
|
|
36
|
+
const dx = Math.abs(e.clientX - mouseDownPos.x);
|
|
37
|
+
const dy = Math.abs(e.clientY - mouseDownPos.y);
|
|
38
|
+
// If the mouse hasn't moved much, consider it a click for selection
|
|
39
|
+
if (dx < 5 && dy < 5) {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
onSelect(path);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
setMouseDownPos(null);
|
|
45
|
+
}, [mouseDownPos, onSelect, path]);
|
|
46
|
+
const handleDragStart = React.useCallback((e) => {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
const dragData = {
|
|
49
|
+
path,
|
|
50
|
+
type,
|
|
51
|
+
treeTitle,
|
|
52
|
+
};
|
|
53
|
+
e.dataTransfer.setData('application/json', JSON.stringify(dragData));
|
|
54
|
+
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign
|
|
55
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
56
|
+
setIsDragging(true);
|
|
57
|
+
// Update drag context
|
|
58
|
+
setDraggedItem(dragData);
|
|
59
|
+
}, [path, type, treeTitle, setDraggedItem]);
|
|
60
|
+
const handleDragEnd = React.useCallback(() => {
|
|
61
|
+
setIsDragging(false);
|
|
62
|
+
// Reset drag context
|
|
63
|
+
setDraggedItem(null);
|
|
64
|
+
hidePreview();
|
|
65
|
+
}, [setDraggedItem, hidePreview]);
|
|
66
|
+
const handleDragOver = React.useCallback((e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign
|
|
70
|
+
e.dataTransfer.dropEffect = 'move';
|
|
71
|
+
setIsDragOver(true);
|
|
72
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
73
|
+
if (draggedItem) {
|
|
74
|
+
showPreview(rect, draggedItem);
|
|
75
|
+
}
|
|
76
|
+
}, [showPreview, draggedItem]);
|
|
77
|
+
const handleDragLeave = React.useCallback(() => {
|
|
78
|
+
setIsDragOver(false);
|
|
79
|
+
hidePreview();
|
|
80
|
+
}, [hidePreview]);
|
|
81
|
+
const handleDrop = React.useCallback((e) => {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
setIsDragOver(false);
|
|
85
|
+
try {
|
|
86
|
+
const data = e.dataTransfer.getData('application/json');
|
|
87
|
+
if (data) {
|
|
88
|
+
const dragItem = JSON.parse(data);
|
|
89
|
+
if (dragItem.path.join(',') !== path.join(',')) {
|
|
90
|
+
onReorder(dragItem.path, path);
|
|
91
|
+
// Reset drag context
|
|
92
|
+
setDraggedItem(null);
|
|
93
|
+
hidePreview();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
// eslint-disable-next-line no-console
|
|
99
|
+
console.error('Error parsing drag data:', error);
|
|
100
|
+
}
|
|
101
|
+
}, [onReorder, path, setDraggedItem, hidePreview]);
|
|
102
|
+
const handleChildrenFirstPositionDrop = React.useCallback((e) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
try {
|
|
106
|
+
const data = e.dataTransfer.getData('application/json');
|
|
107
|
+
if (data) {
|
|
108
|
+
const dragItem = JSON.parse(data);
|
|
109
|
+
// Create a path for the first child position
|
|
110
|
+
const firstChildPath = [...path, 0];
|
|
111
|
+
// Reorder to the first position within children
|
|
112
|
+
onReorder(dragItem.path, firstChildPath, 'prepend');
|
|
113
|
+
// Reset drag context
|
|
114
|
+
setDraggedItem(null);
|
|
115
|
+
hidePreview();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
// eslint-disable-next-line no-console
|
|
120
|
+
console.error('Error parsing drag data:', error);
|
|
121
|
+
}
|
|
122
|
+
}, [onReorder, path, setDraggedItem, hidePreview]);
|
|
123
|
+
const handleDropZoneDragOver = (e) => {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
e.stopPropagation();
|
|
126
|
+
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign
|
|
127
|
+
e.dataTransfer.dropEffect = 'move';
|
|
128
|
+
// Show preview element at this position
|
|
129
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
130
|
+
if (draggedItem) {
|
|
131
|
+
showPreview(rect, draggedItem);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return (_jsxs(Card, { ref: itemRef, className: b({
|
|
135
|
+
selected,
|
|
136
|
+
dragging: isDragging,
|
|
137
|
+
'drag-over': isDragOver,
|
|
138
|
+
}), onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, draggable: true, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [_jsxs("div", { className: b('main'), children: [_jsxs("div", { className: b('text'), children: [_jsx("div", { className: b('type'), children: type }), _jsx("div", { className: b('title'), children: treeTitle })] }), _jsxs("div", { className: b('buttons'), children: [_jsx(Button, { view: "flat", size: "xs", onClick: handleCopy, children: _jsx(Icon, { size: 12, data: Copy }) }), _jsx(Button, { view: "flat", size: "xs", onClick: handleDelete, children: _jsx(Icon, { size: 12, data: TrashBin }) })] })] }), children && (_jsxs(React.Fragment, { children: [_jsx("div", { className: b('children-drop-zone'), onDragOver: handleDropZoneDragOver, onDragLeave: hidePreview, onDrop: handleChildrenFirstPositionDrop }), children] }))] }));
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=TreeItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeItem.js","sourceRoot":"../../../../../src","sources":["editor-v2/containers/Tree/TreeItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAA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AAC,CAAC,MAAM,CAAC,aACrB,cAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,IAAI,GAAO,EACvC,cAAK,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,YAAG,SAAS,GAAO,IAC3C,EACN,eAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,aACxB,KAAC,MAAM,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,UAAU,YAC7C,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI,GACzB,EACT,KAAC,MAAM,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,YAAY,YAC/C,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAI,GAC7B,IACP,IACJ,EACL,QAAQ,IAAI,CACT,MAAC,KAAK,CAAC,QAAQ,eACX,cACI,SAAS,EAAE,CAAC,CAAC,oBAAoB,CAAC,EAClC,UAAU,EAAE,sBAAsB,EAClC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,+BAA+B,GACpC,EACN,QAAQ,IACI,CACpB,IACE,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {Copy, TrashBin} from '@gravity-ui/icons';\nimport {Button, Card, Icon} from '@gravity-ui/uikit';\nimport * as React from 'react';\n\nimport {editorCn} from '../../utils/cn';\nimport {DragContext, DragItem} from './DragContext';\n\nimport './TreeItem.scss';\n\nconst b = editorCn('tree-item');\n\nexport interface ItemProps {\n type: string;\n treeTitle?: string;\n path: number[];\n selected: boolean;\n onCopy(path: number[]): void;\n onDelete(path: number[]): void;\n onSelect(path: number[]): void;\n onReorder(\n sourcePath: number[],\n destinationPath: number[],\n position?: 'prepend' | 'append',\n ): void;\n children?: React.ReactNode;\n}\n\nexport const Item = ({\n type,\n children,\n treeTitle,\n path,\n selected,\n onCopy,\n onDelete,\n onSelect,\n onReorder,\n}: ItemProps) => {\n const {draggedItem, setDraggedItem, showPreview, hidePreview} = React.useContext(DragContext);\n const [isDragging, setIsDragging] = React.useState(false);\n const [isDragOver, setIsDragOver] = React.useState(false);\n const [mouseDownPos, setMouseDownPos] = React.useState<{x: number; y: number} | null>(null);\n const itemRef = React.useRef<HTMLDivElement>(null);\n\n // Scroll into view when selected\n React.useEffect(() => {\n if (selected && itemRef.current) {\n itemRef.current.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }, [selected]);\n\n const handleCopy = React.useCallback(() => {\n onCopy(path);\n }, [onCopy, path]);\n\n const handleDelete = React.useCallback(() => {\n onDelete(path);\n }, [onDelete, path]);\n\n const handleMouseDown = React.useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n setMouseDownPos({x: e.clientX, y: e.clientY});\n }, []);\n\n const handleMouseUp = React.useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (mouseDownPos) {\n // Check if the mouse has moved significantly (dragging) or just a click\n const dx = Math.abs(e.clientX - mouseDownPos.x);\n const dy = Math.abs(e.clientY - mouseDownPos.y);\n\n // If the mouse hasn't moved much, consider it a click for selection\n if (dx < 5 && dy < 5) {\n e.stopPropagation();\n onSelect(path);\n }\n }\n setMouseDownPos(null);\n },\n [mouseDownPos, onSelect, path],\n );\n\n const handleDragStart = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.stopPropagation();\n const dragData: DragItem = {\n path,\n type,\n treeTitle,\n };\n e.dataTransfer.setData('application/json', JSON.stringify(dragData));\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n e.dataTransfer.effectAllowed = 'move';\n setIsDragging(true);\n\n // Update drag context\n setDraggedItem(dragData);\n },\n [path, type, treeTitle, setDraggedItem],\n );\n\n const handleDragEnd = React.useCallback(() => {\n setIsDragging(false);\n\n // Reset drag context\n setDraggedItem(null);\n hidePreview();\n }, [setDraggedItem, hidePreview]);\n\n const handleDragOver = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n e.dataTransfer.dropEffect = 'move';\n setIsDragOver(true);\n\n const rect = e.currentTarget.getBoundingClientRect();\n if (draggedItem) {\n showPreview(rect, draggedItem);\n }\n },\n [showPreview, draggedItem],\n );\n\n const handleDragLeave = React.useCallback(() => {\n setIsDragOver(false);\n hidePreview();\n }, [hidePreview]);\n\n const handleDrop = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragOver(false);\n\n try {\n const data = e.dataTransfer.getData('application/json');\n if (data) {\n const dragItem: DragItem = JSON.parse(data);\n if (dragItem.path.join(',') !== path.join(',')) {\n onReorder(dragItem.path, path);\n\n // Reset drag context\n setDraggedItem(null);\n hidePreview();\n }\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error parsing drag data:', error);\n }\n },\n [onReorder, path, setDraggedItem, hidePreview],\n );\n\n const handleChildrenFirstPositionDrop = React.useCallback(\n (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n\n try {\n const data = e.dataTransfer.getData('application/json');\n if (data) {\n const dragItem: DragItem = JSON.parse(data);\n // Create a path for the first child position\n const firstChildPath = [...path, 0];\n // Reorder to the first position within children\n onReorder(dragItem.path, firstChildPath, 'prepend');\n\n // Reset drag context\n setDraggedItem(null);\n hidePreview();\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error parsing drag data:', error);\n }\n },\n [onReorder, path, setDraggedItem, hidePreview],\n );\n\n const handleDropZoneDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign, no-param-reassign\n e.dataTransfer.dropEffect = 'move';\n\n // Show preview element at this position\n const rect = e.currentTarget.getBoundingClientRect();\n if (draggedItem) {\n showPreview(rect, draggedItem);\n }\n };\n\n return (\n <Card\n ref={itemRef}\n className={b({\n selected,\n dragging: isDragging,\n 'drag-over': isDragOver,\n })}\n onMouseDown={handleMouseDown as unknown as React.MouseEventHandler<'div'>}\n onMouseUp={handleMouseUp as unknown as React.MouseEventHandler<'div'>}\n draggable\n onDragStart={handleDragStart as unknown as React.DragEventHandler<'div'>}\n onDragEnd={handleDragEnd}\n onDragOver={handleDragOver as unknown as React.DragEventHandler<'div'>}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop as unknown as React.DragEventHandler<'div'>}\n >\n <div className={b('main')}>\n <div className={b('text')}>\n <div className={b('type')}>{type}</div>\n <div className={b('title')}>{treeTitle}</div>\n </div>\n <div className={b('buttons')}>\n <Button view=\"flat\" size=\"xs\" onClick={handleCopy}>\n <Icon size={12} data={Copy} />\n </Button>\n <Button view=\"flat\" size=\"xs\" onClick={handleDelete}>\n <Icon size={12} data={TrashBin} />\n </Button>\n </div>\n </div>\n {children && (\n <React.Fragment>\n <div\n className={b('children-drop-zone')}\n onDragOver={handleDropZoneDragOver}\n onDragLeave={hidePreview}\n onDrop={handleChildrenFirstPositionDrop}\n ></div>\n {children}\n </React.Fragment>\n )}\n </Card>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../src","sources":["editor-v2/containers/Tree/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,kBAAe;AAC/B,iCAA8B;AAC9B,8BAA2B;AAC3B,iCAA8B","sourcesContent":["export {default} from './Tree';\nexport * from './DragContext';\nexport * from './TreeItem';\nexport * from './TreeContent';\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Display, Minus, Plus, Smartphone } from '@gravity-ui/icons';
|
|
4
|
+
import { Button, Icon, SegmentedRadioGroup, Select } from '@gravity-ui/uikit';
|
|
5
|
+
import { ZOOM_STEPS } from "../../constants.js";
|
|
6
|
+
import { useMainEditorStore } from "../../hooks/useMainEditorStore.js";
|
|
7
|
+
import { editorCn } from "../../utils/cn.js";
|
|
8
|
+
import './ViewSwitches.css';
|
|
9
|
+
const b = editorCn('view-switches');
|
|
10
|
+
/**
|
|
11
|
+
* Available device viewport options
|
|
12
|
+
* - Desktop: 100% width
|
|
13
|
+
* - Tablet: 768px width
|
|
14
|
+
* - Mobile: 576px width
|
|
15
|
+
*/
|
|
16
|
+
const DEVICE_OPTIONS = [
|
|
17
|
+
{
|
|
18
|
+
label: _jsx(Icon, { data: Display }),
|
|
19
|
+
value: '100%',
|
|
20
|
+
ariaLabel: 'Desktop view',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: _jsx(Icon, { data: Smartphone }),
|
|
24
|
+
value: '768px',
|
|
25
|
+
ariaLabel: 'Tablet view',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: _jsx(Icon, { width: 14, data: Smartphone }),
|
|
29
|
+
value: '576px',
|
|
30
|
+
ariaLabel: 'Mobile view',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const ViewSwitches = () => {
|
|
34
|
+
const { zoom, setZoom, decreaseZoom, increaseZoom, deviceWidth, setDeviceWidth } = useMainEditorStore();
|
|
35
|
+
// Memoize zoom options to prevent unnecessary recalculations
|
|
36
|
+
const zoomOptions = React.useMemo(() => ZOOM_STEPS.map((step) => ({
|
|
37
|
+
value: String(step),
|
|
38
|
+
content: `${step}%`,
|
|
39
|
+
})), []);
|
|
40
|
+
// Memoize current zoom value for Select component
|
|
41
|
+
const currentZoomValue = React.useMemo(() => [String(zoom)], [zoom]);
|
|
42
|
+
// Create stable callback for zoom updates
|
|
43
|
+
const handleZoomUpdate = React.useCallback((value) => {
|
|
44
|
+
const newZoom = Number(Array.isArray(value) ? value[0] : value);
|
|
45
|
+
if (!isNaN(newZoom) && ZOOM_STEPS.includes(newZoom)) {
|
|
46
|
+
setZoom(newZoom);
|
|
47
|
+
}
|
|
48
|
+
}, [setZoom]);
|
|
49
|
+
return (_jsxs("div", { className: b(), role: "toolbar", "aria-label": "View controls", children: [_jsx(SegmentedRadioGroup, { value: deviceWidth, onUpdate: setDeviceWidth, "aria-label": "Device viewport selector", children: DEVICE_OPTIONS.map(({ value, label, ariaLabel }) => (_jsx(SegmentedRadioGroup.Option, { value: value, "aria-label": ariaLabel, children: label }, value))) }), _jsxs("div", { className: b('zoom'), role: "group", "aria-label": "Zoom controls", children: [_jsx(Button, { view: "flat", onClick: decreaseZoom, "aria-label": "Decrease zoom", disabled: zoom <= Math.min(...ZOOM_STEPS), children: _jsx(Icon, { data: Minus }) }), _jsx(Select, { className: b('zoom-select'), multiple: false, value: currentZoomValue, options: zoomOptions, onUpdate: handleZoomUpdate, "aria-label": "Select zoom level", width: "max" }), _jsx(Button, { view: "flat", onClick: increaseZoom, "aria-label": "Increase zoom", disabled: zoom >= Math.max(...ZOOM_STEPS), children: _jsx(Icon, { data: Plus }) })] })] }));
|
|
50
|
+
};
|
|
51
|
+
export default React.memo(ViewSwitches);
|
|
52
|
+
//# sourceMappingURL=ViewSwitches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewSwitches.js","sourceRoot":"../../../../../src","sources":["editor-v2/containers/ViewSwitches/ViewSwitches.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAC,UAAU,EAAC,2BAAwB;AAC3C,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAClE,OAAO,E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AC,MAAM,EACX,OAAO,EAAE,YAAY,gBACV,eAAe,EAC1B,QAAQ,EAAE,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,YAEzC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,GACf,IACP,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport {Display, Minus, Plus, Smartphone} from '@gravity-ui/icons';\nimport {Button, Icon, SegmentedRadioGroup, Select} from '@gravity-ui/uikit';\n\nimport {ZOOM_STEPS} from '../../constants';\nimport {useMainEditorStore} from '../../hooks/useMainEditorStore';\nimport {editorCn} from '../../utils/cn';\n\nimport './ViewSwitches.scss';\n\nconst b = editorCn('view-switches');\n\n/**\n * Device option type definition\n */\ninterface DeviceOption {\n /** React node to display as the option label */\n label: React.ReactNode;\n /** Device width value (e.g., '100%', '768px') */\n value: string;\n /** Descriptive name for accessibility */\n ariaLabel: string;\n}\n\n/**\n * Available device viewport options\n * - Desktop: 100% width\n * - Tablet: 768px width\n * - Mobile: 576px width\n */\nconst DEVICE_OPTIONS: DeviceOption[] = [\n {\n label: <Icon data={Display} />,\n value: '100%',\n ariaLabel: 'Desktop view',\n },\n {\n label: <Icon data={Smartphone} />,\n value: '768px',\n ariaLabel: 'Tablet view',\n },\n {\n label: <Icon width={14} data={Smartphone} />,\n value: '576px',\n ariaLabel: 'Mobile view',\n },\n];\n\nconst ViewSwitches: React.FC = () => {\n const {zoom, setZoom, decreaseZoom, increaseZoom, deviceWidth, setDeviceWidth} =\n useMainEditorStore();\n\n // Memoize zoom options to prevent unnecessary recalculations\n const zoomOptions = React.useMemo(\n () =>\n ZOOM_STEPS.map((step) => ({\n value: String(step),\n content: `${step}%`,\n })),\n [],\n );\n\n // Memoize current zoom value for Select component\n const currentZoomValue = React.useMemo(() => [String(zoom)], [zoom]);\n\n // Create stable callback for zoom updates\n const handleZoomUpdate = React.useCallback(\n (value: string | string[]) => {\n const newZoom = Number(Array.isArray(value) ? value[0] : value);\n if (!isNaN(newZoom) && ZOOM_STEPS.includes(newZoom)) {\n setZoom(newZoom);\n }\n },\n [setZoom],\n );\n\n return (\n <div className={b()} role=\"toolbar\" aria-label=\"View controls\">\n <SegmentedRadioGroup\n value={deviceWidth}\n onUpdate={setDeviceWidth}\n aria-label=\"Device viewport selector\"\n >\n {DEVICE_OPTIONS.map(({value, label, ariaLabel}) => (\n <SegmentedRadioGroup.Option key={value} value={value} aria-label={ariaLabel}>\n {label}\n </SegmentedRadioGroup.Option>\n ))}\n </SegmentedRadioGroup>\n\n <div className={b('zoom')} role=\"group\" aria-label=\"Zoom controls\">\n <Button\n view=\"flat\"\n onClick={decreaseZoom}\n aria-label=\"Decrease zoom\"\n disabled={zoom <= Math.min(...ZOOM_STEPS)}\n >\n <Icon data={Minus} />\n </Button>\n\n <Select\n className={b('zoom-select')}\n multiple={false}\n value={currentZoomValue}\n options={zoomOptions}\n onUpdate={handleZoomUpdate}\n aria-label=\"Select zoom level\"\n width=\"max\"\n />\n\n <Button\n view=\"flat\"\n onClick={increaseZoom}\n aria-label=\"Increase zoom\"\n disabled={zoom >= Math.max(...ZOOM_STEPS)}\n >\n <Icon data={Plus} />\n </Button>\n </div>\n </div>\n );\n};\n\nexport default React.memo(ViewSwitches);\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Editor } from "./Editor/Editor.js";
|
|
2
|
+
export { default as BlockConfigForm } from "./BlockConfigForm/BlockConfigForm.js";
|
|
3
|
+
export { default as BlocksList } from "./BlocksList/BlocksList.js";
|
|
4
|
+
export { default as Source } from "./Source/Source.js";
|
|
5
|
+
export { default as SourceCode } from "./SourceCode/SourceCode.js";
|
|
6
|
+
export { default as Tree } from "./Tree/Tree.js";
|
|
7
|
+
export { default as ViewSwitches } from "./ViewSwitches/ViewSwitches.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Editor } from "./Editor/Editor.js";
|
|
2
|
+
export { default as BlockConfigForm } from "./BlockConfigForm/BlockConfigForm.js";
|
|
3
|
+
export { default as BlocksList } from "./BlocksList/BlocksList.js";
|
|
4
|
+
export { default as Source } from "./Source/Source.js";
|
|
5
|
+
export { default as SourceCode } from "./SourceCode/SourceCode.js";
|
|
6
|
+
export { default as Tree } from "./Tree/Tree.js";
|
|
7
|
+
export { default as ViewSwitches } from "./ViewSwitches/ViewSwitches.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../src","sources":["editor-v2/containers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,2BAAwB;AACvC,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,6CAA0C;AAC7E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,mCAAgC;AAC9D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,2BAAwB;AAClD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,mCAAgC;AAC9D,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,uBAAoB;AAC5C,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,uCAAoC","sourcesContent":["export {Editor} from './Editor/Editor';\nexport {default as BlockConfigForm} from './BlockConfigForm/BlockConfigForm';\nexport {default as BlocksList} from './BlocksList/BlocksList';\nexport {default as Source} from './Source/Source';\nexport {default as SourceCode} from './SourceCode/SourceCode';\nexport {default as Tree} from './Tree/Tree';\nexport {default as ViewSwitches} from './ViewSwitches/ViewSwitches';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { EditorStore } from "../../store.js";
|
|
4
|
+
export interface MainEditorStoreContextProps {
|
|
5
|
+
state: StoreApi<EditorStore>;
|
|
6
|
+
}
|
|
7
|
+
export declare const MainEditorStoreContext: React.Context<MainEditorStoreContextProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainEditorStoreContext.js","sourceRoot":"../../../../../src","sources":["editor-v2/context/editorStore/MainEditorStoreContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAc,iBAAiB,EAAC,uBAAoB;AAM3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA8B;IACnF,KAAK,EAAE,iBAAiB,EAAE;CAC7B,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport {StoreApi} from 'zustand';\n\nimport {EditorStore, createEditorStore} from '../../store';\n\nexport interface MainEditorStoreContextProps {\n state: StoreApi<EditorStore>;\n}\n\nexport const MainEditorStoreContext = React.createContext<MainEditorStoreContextProps>({\n state: createEditorStore(),\n});\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { removeFn } from "../../../common/utils.js";
|
|
4
|
+
import { createEditorStore } from "../../store.js";
|
|
5
|
+
import { IframeContext } from "../iframeContext/index.js";
|
|
6
|
+
import { MainEditorStoreContext } from "./MainEditorStoreContext.js";
|
|
7
|
+
export const MainEditorStoreProvider = ({ children }) => {
|
|
8
|
+
const { iframeElement } = React.useContext(IframeContext);
|
|
9
|
+
const storeRef = React.useRef();
|
|
10
|
+
const sendPostMessage = React.useCallback((data) => {
|
|
11
|
+
const message = {
|
|
12
|
+
state: data,
|
|
13
|
+
};
|
|
14
|
+
if (iframeElement && iframeElement.contentWindow) {
|
|
15
|
+
iframeElement.contentWindow.postMessage(message, '*');
|
|
16
|
+
}
|
|
17
|
+
}, [iframeElement]);
|
|
18
|
+
if (!storeRef.current) {
|
|
19
|
+
storeRef.current = createEditorStore();
|
|
20
|
+
}
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
storeRef.current?.subscribe((state) => {
|
|
23
|
+
sendPostMessage(removeFn(state));
|
|
24
|
+
});
|
|
25
|
+
}, [sendPostMessage]);
|
|
26
|
+
return (_jsx(MainEditorStoreContext.Provider, { value: {
|
|
27
|
+
state: storeRef.current,
|
|
28
|
+
}, children: children }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=MainEditorStoreProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainEditorStoreProvider.js","sourceRoot":"../../../../../src","sources":["editor-v2/context/editorStore/MainEditorStoreProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,QAAQ,EAAC,iCAA8B;AAC/C,OAAO,EAAc,iBAAiB,EAAC,uBAAoB;AAC3D,OAAO,EAAC,aAAa,EAAC,kCAAyB;AAE/C,OAAO,EAAC,sBAAsB,EAAC,oCAAiC;AAIhE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAC,QAAQ,EAA0B,EAAE,EAAE;IAC3E,MAAM,EAAC,aAAa,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAyB,CAAC;IAEvD,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CACrC,CAAC,IAAiB,EAAE,EAAE;QAClB,MAAM,OAAO,GAAqB;YAC9B,KAAK,EAAE,IAAI;SACd,CAAC;QAEF,IAAI,aAAa,IAAI,aAAa,CAAC,aAAa,EAAE,CAAC;YAC/C,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC,EACD,CAAC,aAAa,CAAC,CAClB,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,QAAQ,CAAC,OAAO,GAAG,iBAAiB,EAAE,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YAClC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,OAAO,CACH,KAAC,sBAAsB,CAAC,QAAQ,IAC5B,KAAK,EAAE;YACH,KAAK,EAAE,QAAQ,CAAC,OAAO;SAC1B,YAEA,QAAQ,GACqB,CACrC,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport {StoreApi} from 'zustand';\n\nimport {EditorState} from '../../../common/store';\nimport {StoreSyncMessage} from '../../../common/types';\nimport {removeFn} from '../../../common/utils';\nimport {EditorStore, createEditorStore} from '../../store';\nimport {IframeContext} from '../iframeContext';\n\nimport {MainEditorStoreContext} from './MainEditorStoreContext';\n\ninterface MainEditorProviderProps extends React.PropsWithChildren {}\n\nexport const MainEditorStoreProvider = ({children}: MainEditorProviderProps) => {\n const {iframeElement} = React.useContext(IframeContext);\n const storeRef = React.useRef<StoreApi<EditorStore>>();\n\n const sendPostMessage = React.useCallback(\n (data: EditorState) => {\n const message: StoreSyncMessage = {\n state: data,\n };\n\n if (iframeElement && iframeElement.contentWindow) {\n iframeElement.contentWindow.postMessage(message, '*');\n }\n },\n [iframeElement],\n );\n\n if (!storeRef.current) {\n storeRef.current = createEditorStore();\n }\n\n React.useEffect(() => {\n storeRef.current?.subscribe((state) => {\n sendPostMessage(removeFn(state));\n });\n }, [sendPostMessage]);\n\n return (\n <MainEditorStoreContext.Provider\n value={{\n state: storeRef.current,\n }}\n >\n {children}\n </MainEditorStoreContext.Provider>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../src","sources":["editor-v2/context/editorStore/index.ts"],"names":[],"mappings":"AAAA,4CAAyC;AACzC,6CAA0C","sourcesContent":["export * from './MainEditorStoreContext';\nexport * from './MainEditorStoreProvider';\n"]}
|