@gravity-ui/page-constructor 5.14.3 → 5.14.4-alpha.0
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/Banner/Banner.js +3 -1
- package/build/cjs/blocks/Banner/index.d.ts +3 -0
- package/build/cjs/blocks/Banner/index.js +22 -0
- package/build/cjs/blocks/CardLayout/CardLayout.css +1 -0
- package/build/cjs/blocks/CardLayout/CardLayout.js +11 -6
- package/build/cjs/blocks/CardLayout/index.d.ts +5 -0
- package/build/cjs/blocks/CardLayout/index.js +166 -0
- package/build/cjs/blocks/Companies/Companies.js +6 -4
- package/build/cjs/blocks/Companies/index.d.ts +3 -0
- package/build/cjs/blocks/Companies/index.js +18 -0
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +6 -5
- package/build/cjs/blocks/ContentLayout/index.d.ts +11 -0
- package/build/cjs/blocks/ContentLayout/index.js +17 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +1 -0
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +22 -20
- package/build/cjs/blocks/ExtendedFeatures/index.d.ts +12 -0
- package/build/cjs/blocks/ExtendedFeatures/index.js +18 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +1 -0
- package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -0
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +11 -10
- package/build/cjs/blocks/FilterBlock/index.d.ts +11 -0
- package/build/cjs/blocks/FilterBlock/index.js +17 -0
- package/build/cjs/blocks/Form/index.d.ts +12 -0
- package/build/cjs/blocks/Form/index.js +18 -0
- package/build/cjs/blocks/Header/dynamic-form.d.ts +2 -0
- package/build/cjs/blocks/Header/dynamic-form.js +730 -0
- package/build/cjs/blocks/Header/index.d.ts +8 -0
- package/build/cjs/blocks/Header/index.js +14 -0
- package/build/cjs/blocks/HeaderSlider/HeaderSlider.js +3 -2
- package/build/cjs/blocks/HeaderSlider/index.d.ts +31 -0
- package/build/cjs/blocks/HeaderSlider/index.js +38 -0
- package/build/cjs/blocks/Icons/Icons.js +9 -6
- package/build/cjs/blocks/Icons/index.d.ts +13 -0
- package/build/cjs/blocks/Icons/index.js +19 -0
- package/build/cjs/blocks/Info/index.d.ts +21 -0
- package/build/cjs/blocks/Info/index.js +41 -0
- package/build/cjs/blocks/Map/index.d.ts +11 -0
- package/build/cjs/blocks/Map/index.js +17 -0
- package/build/cjs/blocks/Media/index.d.ts +14 -0
- package/build/cjs/blocks/Media/index.js +20 -0
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +19 -16
- package/build/cjs/blocks/PromoFeaturesBlock/index.d.ts +12 -0
- package/build/cjs/blocks/PromoFeaturesBlock/index.js +18 -0
- package/build/cjs/blocks/Questions/Questions.js +12 -10
- package/build/cjs/blocks/Questions/index.d.ts +29 -0
- package/build/cjs/blocks/Questions/index.js +47 -0
- package/build/cjs/blocks/Share/Share.js +11 -10
- package/build/cjs/blocks/Share/index.d.ts +12 -0
- package/build/cjs/blocks/Share/index.js +18 -0
- package/build/cjs/blocks/Slider/Slider.js +22 -17
- package/build/cjs/blocks/Slider/dynamic-form.d.ts +3 -0
- package/build/cjs/blocks/Slider/dynamic-form.js +225 -0
- package/build/cjs/blocks/Slider/index.d.ts +8 -0
- package/build/cjs/blocks/Slider/index.js +14 -0
- package/build/cjs/blocks/Table/index.d.ts +8 -0
- package/build/cjs/blocks/Table/index.js +14 -0
- package/build/cjs/blocks/Table/schema.d.ts +1 -0
- package/build/cjs/blocks/Table/schema.js +1 -0
- package/build/cjs/blocks/Tabs/Tabs.js +9 -8
- package/build/cjs/blocks/Tabs/index.d.ts +16 -0
- package/build/cjs/blocks/Tabs/index.js +29 -0
- package/build/cjs/blocks/TestEditorBlock/TestEditorBlock.d.ts +5 -0
- package/build/cjs/blocks/TestEditorBlock/TestEditorBlock.js +12 -0
- package/build/cjs/blocks/TestEditorBlock/form.d.ts +3 -0
- package/build/cjs/blocks/TestEditorBlock/form.js +80 -0
- package/build/cjs/blocks/TestEditorBlock/index.d.ts +11 -0
- package/build/cjs/blocks/TestEditorBlock/index.js +17 -0
- package/build/cjs/components/BlockBase/BlockBase.css +8 -16
- package/build/cjs/components/Image/dynamic-form.d.ts +2 -0
- package/build/cjs/components/Image/dynamic-form.js +84 -0
- package/build/cjs/components/editor/ChildrenWrap/ChildrenWrap.css +5 -0
- package/build/cjs/components/editor/ChildrenWrap/ChildrenWrap.d.ts +6 -0
- package/build/cjs/components/editor/ChildrenWrap/ChildrenWrap.js +15 -0
- package/build/cjs/components/editor/ItemWrap/ItemWrap.css +9 -0
- package/build/cjs/components/editor/ItemWrap/ItemWrap.d.ts +6 -0
- package/build/cjs/components/editor/ItemWrap/ItemWrap.js +15 -0
- package/build/cjs/constructor-items.d.ts +18 -6
- package/build/cjs/constructor-items.js +67 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js +16 -13
- package/build/cjs/containers/PageConstructor/Provider.js +4 -0
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +10 -6
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +5 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/hooks/useEditorBlockMouseEvents.d.ts +8 -0
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/hooks/useEditorBlockMouseEvents.js +109 -0
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -6
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorLoadable/ConstructorLoadable.js +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorRow/ConstructorRow.js +1 -3
- package/build/cjs/context/blockIdContext/blockIdContext.d.ts +2 -2
- package/build/cjs/context/blockIdContext/blockIdContext.js +1 -1
- package/build/cjs/context/editorContext/editorContext.d.ts +13 -0
- package/build/cjs/context/editorContext/editorContext.js +10 -0
- package/build/cjs/context/editorContext/editorProvider.d.ts +2 -0
- package/build/cjs/context/editorContext/editorProvider.js +20 -0
- package/build/cjs/context/editorContext/hooks/useEditorStore.d.ts +2 -0
- package/build/cjs/context/editorContext/hooks/useEditorStore.js +15 -0
- package/build/cjs/context/editorContext/index.d.ts +4 -0
- package/build/cjs/context/editorContext/index.js +7 -0
- package/build/cjs/context/editorContext/store.d.ts +24 -0
- package/build/cjs/context/editorContext/store.js +39 -0
- package/build/cjs/context/messagesContext/hooks/useMessageObserver.d.ts +4 -0
- package/build/cjs/context/messagesContext/hooks/useMessageObserver.js +16 -0
- package/build/cjs/context/messagesContext/hooks/useMessageSender.d.ts +2 -0
- package/build/cjs/context/messagesContext/hooks/useMessageSender.js +11 -0
- package/build/cjs/context/messagesContext/hooks/useMessagesStore.d.ts +2 -0
- package/build/cjs/context/messagesContext/hooks/useMessagesStore.js +15 -0
- package/build/cjs/context/messagesContext/index.d.ts +5 -0
- package/build/cjs/context/messagesContext/index.js +8 -0
- package/build/cjs/context/messagesContext/messagesContext.d.ts +14 -0
- package/build/cjs/context/messagesContext/messagesContext.js +12 -0
- package/build/cjs/context/messagesContext/messagesProvider.d.ts +2 -0
- package/build/cjs/context/messagesContext/messagesProvider.js +73 -0
- package/build/cjs/context/messagesContext/store.d.ts +25 -0
- package/build/cjs/context/messagesContext/store.js +17 -0
- package/build/cjs/context/messagesContext/types.d.ts +14 -0
- package/build/cjs/context/messagesContext/types.js +2 -0
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/grid/Grid/Grid.css +2 -6
- package/build/cjs/hooks/useAnalytics.js +1 -1
- package/build/cjs/hooks/useEditorInitialize.d.ts +7 -0
- package/build/cjs/hooks/useEditorInitialize.js +90 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -1
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -1
- package/build/cjs/navigation/containers/Layout/Layout.css +0 -1
- package/build/cjs/schema/constants.d.ts +1 -1
- package/build/cjs/schema/constants.js +2 -1
- package/build/cjs/schema/index.d.ts +227 -0
- package/build/cjs/schema/index.js +7 -3
- package/build/cjs/sub-blocks/BackgroundCard/dynamic-form.d.ts +2 -0
- package/build/cjs/sub-blocks/BackgroundCard/dynamic-form.js +81 -0
- package/build/cjs/sub-blocks/BackgroundCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/BackgroundCard/index.js +19 -0
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +4 -3
- package/build/cjs/sub-blocks/BannerCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/BannerCard/index.js +22 -0
- package/build/cjs/sub-blocks/BasicCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/BasicCard/index.js +18 -0
- package/build/cjs/sub-blocks/Content/index.d.ts +3 -0
- package/build/cjs/sub-blocks/Content/index.js +18 -0
- package/build/cjs/sub-blocks/Content/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/Content/schema.js +1 -0
- package/build/cjs/sub-blocks/Divider/index.d.ts +3 -0
- package/build/cjs/sub-blocks/Divider/index.js +15 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +2 -2
- package/build/cjs/sub-blocks/ImageCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/ImageCard/index.js +18 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/form.d.ts +8 -0
- package/build/cjs/sub-blocks/LayoutItem/form.js +14 -0
- package/build/cjs/sub-blocks/LayoutItem/index.d.ts +3 -0
- package/build/cjs/sub-blocks/LayoutItem/index.js +20 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +254 -246
- package/build/cjs/sub-blocks/LayoutItem/schema.js +7 -3
- package/build/cjs/sub-blocks/MediaCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/MediaCard/index.js +20 -0
- package/build/cjs/sub-blocks/PriceCard/index.d.ts +3 -0
- package/build/cjs/sub-blocks/PriceCard/index.js +31 -0
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/index.d.ts +4 -0
- package/build/cjs/sub-blocks/PriceDetailed/index.js +33 -0
- package/build/cjs/sub-blocks/Quote/index.d.ts +3 -0
- package/build/cjs/sub-blocks/Quote/index.js +21 -0
- package/build/cjs/types/actions/codes.d.ts +16 -0
- package/build/cjs/types/actions/codes.js +26 -0
- package/build/cjs/types/actions/index.d.ts +20 -0
- package/build/cjs/types/actions/index.js +10 -0
- package/build/cjs/types/actions/initial.d.ts +23 -0
- package/build/cjs/types/actions/initial.js +2 -0
- package/build/cjs/types/actions/insert.d.ts +19 -0
- package/build/cjs/types/actions/insert.js +2 -0
- package/build/cjs/types/actions/other.d.ts +16 -0
- package/build/cjs/types/actions/other.js +2 -0
- package/build/cjs/types/actions/overlay.d.ts +16 -0
- package/build/cjs/types/actions/overlay.js +2 -0
- package/build/cjs/types/actions/reorder.d.ts +17 -0
- package/build/cjs/types/actions/reorder.js +2 -0
- package/build/cjs/types/actions/select.d.ts +16 -0
- package/build/cjs/types/actions/select.js +2 -0
- package/build/cjs/types/dynamic-form.d.ts +92 -0
- package/build/cjs/types/dynamic-form.js +2 -0
- package/build/cjs/types/index.d.ts +14 -0
- package/build/cjs/types/index.js +2 -0
- package/build/cjs/utils/editor.d.ts +2 -0
- package/build/cjs/utils/editor.js +24 -0
- package/build/cjs/utils/form-generator.d.ts +9 -0
- package/build/cjs/utils/form-generator.js +126 -0
- package/build/cjs/utils/store.d.ts +16 -0
- package/build/cjs/utils/store.js +9 -0
- package/build/esm/blocks/Banner/Banner.js +3 -1
- package/build/esm/blocks/Banner/index.d.ts +3 -0
- package/build/esm/blocks/Banner/index.js +19 -0
- package/build/esm/blocks/CardLayout/CardLayout.css +1 -0
- package/build/esm/blocks/CardLayout/CardLayout.js +12 -7
- package/build/esm/blocks/CardLayout/index.d.ts +5 -0
- package/build/esm/blocks/CardLayout/index.js +162 -0
- package/build/esm/blocks/Companies/Companies.js +6 -4
- package/build/esm/blocks/Companies/index.d.ts +3 -0
- package/build/esm/blocks/Companies/index.js +15 -0
- package/build/esm/blocks/ContentLayout/ContentLayout.js +7 -6
- package/build/esm/blocks/ContentLayout/index.d.ts +11 -0
- package/build/esm/blocks/ContentLayout/index.js +14 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +1 -0
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +23 -21
- package/build/esm/blocks/ExtendedFeatures/index.d.ts +12 -0
- package/build/esm/blocks/ExtendedFeatures/index.js +15 -0
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +1 -0
- package/build/esm/blocks/ExtendedFeatures/schema.js +1 -0
- package/build/esm/blocks/FilterBlock/FilterBlock.js +12 -11
- package/build/esm/blocks/FilterBlock/index.d.ts +11 -0
- package/build/esm/blocks/FilterBlock/index.js +14 -0
- package/build/esm/blocks/Form/index.d.ts +12 -0
- package/build/esm/blocks/Form/index.js +15 -0
- package/build/esm/blocks/Header/dynamic-form.d.ts +2 -0
- package/build/esm/blocks/Header/dynamic-form.js +727 -0
- package/build/esm/blocks/Header/index.d.ts +8 -0
- package/build/esm/blocks/Header/index.js +11 -0
- package/build/esm/blocks/HeaderSlider/HeaderSlider.js +3 -2
- package/build/esm/blocks/HeaderSlider/index.d.ts +31 -0
- package/build/esm/blocks/HeaderSlider/index.js +35 -0
- package/build/esm/blocks/Icons/Icons.js +9 -6
- package/build/esm/blocks/Icons/index.d.ts +13 -0
- package/build/esm/blocks/Icons/index.js +16 -0
- package/build/esm/blocks/Info/index.d.ts +21 -0
- package/build/esm/blocks/Info/index.js +38 -0
- package/build/esm/blocks/Map/index.d.ts +11 -0
- package/build/esm/blocks/Map/index.js +14 -0
- package/build/esm/blocks/Media/index.d.ts +14 -0
- package/build/esm/blocks/Media/index.js +17 -0
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +19 -16
- package/build/esm/blocks/PromoFeaturesBlock/index.d.ts +12 -0
- package/build/esm/blocks/PromoFeaturesBlock/index.js +15 -0
- package/build/esm/blocks/Questions/Questions.js +13 -11
- package/build/esm/blocks/Questions/index.d.ts +29 -0
- package/build/esm/blocks/Questions/index.js +44 -0
- package/build/esm/blocks/Share/Share.js +11 -10
- package/build/esm/blocks/Share/index.d.ts +12 -0
- package/build/esm/blocks/Share/index.js +15 -0
- package/build/esm/blocks/Slider/Slider.js +22 -17
- package/build/esm/blocks/Slider/dynamic-form.d.ts +3 -0
- package/build/esm/blocks/Slider/dynamic-form.js +222 -0
- package/build/esm/blocks/Slider/index.d.ts +8 -0
- package/build/esm/blocks/Slider/index.js +11 -0
- package/build/esm/blocks/Table/index.d.ts +8 -0
- package/build/esm/blocks/Table/index.js +11 -0
- package/build/esm/blocks/Table/schema.d.ts +1 -0
- package/build/esm/blocks/Table/schema.js +1 -0
- package/build/esm/blocks/Tabs/Tabs.js +10 -9
- package/build/esm/blocks/Tabs/index.d.ts +16 -0
- package/build/esm/blocks/Tabs/index.js +26 -0
- package/build/esm/blocks/TestEditorBlock/TestEditorBlock.d.ts +5 -0
- package/build/esm/blocks/TestEditorBlock/TestEditorBlock.js +7 -0
- package/build/esm/blocks/TestEditorBlock/form.d.ts +3 -0
- package/build/esm/blocks/TestEditorBlock/form.js +78 -0
- package/build/esm/blocks/TestEditorBlock/index.d.ts +11 -0
- package/build/esm/blocks/TestEditorBlock/index.js +13 -0
- package/build/esm/components/BlockBase/BlockBase.css +8 -16
- package/build/esm/components/Image/dynamic-form.d.ts +2 -0
- package/build/esm/components/Image/dynamic-form.js +80 -0
- package/build/esm/components/editor/ChildrenWrap/ChildrenWrap.css +5 -0
- package/build/esm/components/editor/ChildrenWrap/ChildrenWrap.d.ts +7 -0
- package/build/esm/components/editor/ChildrenWrap/ChildrenWrap.js +13 -0
- package/build/esm/components/editor/ItemWrap/ItemWrap.css +9 -0
- package/build/esm/components/editor/ItemWrap/ItemWrap.d.ts +7 -0
- package/build/esm/components/editor/ItemWrap/ItemWrap.js +13 -0
- package/build/esm/constructor-items.d.ts +18 -6
- package/build/esm/constructor-items.js +66 -0
- package/build/esm/containers/PageConstructor/PageConstructor.js +19 -16
- package/build/esm/containers/PageConstructor/Provider.js +4 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +10 -6
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +5 -2
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/hooks/useEditorBlockMouseEvents.d.ts +8 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/hooks/useEditorBlockMouseEvents.js +107 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -6
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorLoadable/ConstructorLoadable.js +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorRow/ConstructorRow.js +1 -3
- package/build/esm/context/blockIdContext/blockIdContext.d.ts +2 -2
- package/build/esm/context/blockIdContext/blockIdContext.js +1 -1
- package/build/esm/context/editorContext/editorContext.d.ts +13 -0
- package/build/esm/context/editorContext/editorContext.js +6 -0
- package/build/esm/context/editorContext/editorProvider.d.ts +2 -0
- package/build/esm/context/editorContext/editorProvider.js +15 -0
- package/build/esm/context/editorContext/hooks/useEditorStore.d.ts +2 -0
- package/build/esm/context/editorContext/hooks/useEditorStore.js +11 -0
- package/build/esm/context/editorContext/index.d.ts +4 -0
- package/build/esm/context/editorContext/index.js +4 -0
- package/build/esm/context/editorContext/store.d.ts +24 -0
- package/build/esm/context/editorContext/store.js +36 -0
- package/build/esm/context/messagesContext/hooks/useMessageObserver.d.ts +4 -0
- package/build/esm/context/messagesContext/hooks/useMessageObserver.js +12 -0
- package/build/esm/context/messagesContext/hooks/useMessageSender.d.ts +2 -0
- package/build/esm/context/messagesContext/hooks/useMessageSender.js +7 -0
- package/build/esm/context/messagesContext/hooks/useMessagesStore.d.ts +2 -0
- package/build/esm/context/messagesContext/hooks/useMessagesStore.js +11 -0
- package/build/esm/context/messagesContext/index.d.ts +5 -0
- package/build/esm/context/messagesContext/index.js +5 -0
- package/build/esm/context/messagesContext/messagesContext.d.ts +14 -0
- package/build/esm/context/messagesContext/messagesContext.js +8 -0
- package/build/esm/context/messagesContext/messagesProvider.d.ts +2 -0
- package/build/esm/context/messagesContext/messagesProvider.js +68 -0
- package/build/esm/context/messagesContext/store.d.ts +25 -0
- package/build/esm/context/messagesContext/store.js +14 -0
- package/build/esm/context/messagesContext/types.d.ts +14 -0
- package/build/esm/context/messagesContext/types.js +1 -0
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/grid/Grid/Grid.css +2 -6
- package/build/esm/hooks/useAnalytics.js +1 -1
- package/build/esm/hooks/useEditorInitialize.d.ts +7 -0
- package/build/esm/hooks/useEditorInitialize.js +87 -0
- package/build/esm/models/constructor-items/blocks.d.ts +2 -1
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +1 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +4 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +4 -1
- package/build/esm/navigation/containers/Layout/Layout.css +0 -1
- package/build/esm/schema/constants.d.ts +1 -1
- package/build/esm/schema/constants.js +2 -1
- package/build/esm/schema/index.d.ts +227 -0
- package/build/esm/schema/index.js +6 -2
- package/build/esm/sub-blocks/BackgroundCard/dynamic-form.d.ts +2 -0
- package/build/esm/sub-blocks/BackgroundCard/dynamic-form.js +78 -0
- package/build/esm/sub-blocks/BackgroundCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/BackgroundCard/index.js +16 -0
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +4 -3
- package/build/esm/sub-blocks/BannerCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/BannerCard/index.js +19 -0
- package/build/esm/sub-blocks/BasicCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/BasicCard/index.js +15 -0
- package/build/esm/sub-blocks/Content/index.d.ts +3 -0
- package/build/esm/sub-blocks/Content/index.js +15 -0
- package/build/esm/sub-blocks/Content/schema.d.ts +1 -0
- package/build/esm/sub-blocks/Content/schema.js +1 -0
- package/build/esm/sub-blocks/Divider/index.d.ts +3 -0
- package/build/esm/sub-blocks/Divider/index.js +12 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +2 -2
- package/build/esm/sub-blocks/ImageCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/ImageCard/index.js +15 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/form.d.ts +8 -0
- package/build/esm/sub-blocks/LayoutItem/form.js +11 -0
- package/build/esm/sub-blocks/LayoutItem/index.d.ts +3 -0
- package/build/esm/sub-blocks/LayoutItem/index.js +17 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +254 -246
- package/build/esm/sub-blocks/LayoutItem/schema.js +6 -2
- package/build/esm/sub-blocks/MediaCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/MediaCard/index.js +17 -0
- package/build/esm/sub-blocks/PriceCard/index.d.ts +3 -0
- package/build/esm/sub-blocks/PriceCard/index.js +28 -0
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js +1 -1
- package/build/esm/sub-blocks/PriceDetailed/index.d.ts +4 -0
- package/build/esm/sub-blocks/PriceDetailed/index.js +30 -0
- package/build/esm/sub-blocks/Quote/index.d.ts +3 -0
- package/build/esm/sub-blocks/Quote/index.js +18 -0
- package/build/esm/types/actions/codes.d.ts +16 -0
- package/build/esm/types/actions/codes.js +23 -0
- package/build/esm/types/actions/index.d.ts +20 -0
- package/build/esm/types/actions/index.js +7 -0
- package/build/esm/types/actions/initial.d.ts +23 -0
- package/build/esm/types/actions/initial.js +1 -0
- package/build/esm/types/actions/insert.d.ts +19 -0
- package/build/esm/types/actions/insert.js +1 -0
- package/build/esm/types/actions/other.d.ts +16 -0
- package/build/esm/types/actions/other.js +1 -0
- package/build/esm/types/actions/overlay.d.ts +16 -0
- package/build/esm/types/actions/overlay.js +1 -0
- package/build/esm/types/actions/reorder.d.ts +17 -0
- package/build/esm/types/actions/reorder.js +1 -0
- package/build/esm/types/actions/select.d.ts +16 -0
- package/build/esm/types/actions/select.js +1 -0
- package/build/esm/types/dynamic-form.d.ts +92 -0
- package/build/esm/types/dynamic-form.js +1 -0
- package/build/esm/types/index.d.ts +14 -0
- package/build/esm/types/index.js +1 -0
- package/build/esm/utils/editor.d.ts +2 -0
- package/build/esm/utils/editor.js +20 -0
- package/build/esm/utils/form-generator.d.ts +9 -0
- package/build/esm/utils/form-generator.js +121 -0
- package/build/esm/utils/store.d.ts +16 -0
- package/build/esm/utils/store.js +5 -0
- package/package.json +5 -2
- package/server/models/constructor-items/blocks.d.ts +2 -1
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/models/constructor-items/sub-blocks.d.ts +1 -1
- package/styles/mixins.scss +9 -9
- package/widget/index.js +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { generateFromAJV } from '../../utils/form-generator';
|
|
2
|
+
import PriceDetailed from './PriceDetailed';
|
|
3
|
+
import { PriceDetailedBlock as PriceDetailedSchema } from './schema';
|
|
4
|
+
/** @deprecated */
|
|
5
|
+
const PriceDetailedConfig = {
|
|
6
|
+
component: PriceDetailed,
|
|
7
|
+
schema: {
|
|
8
|
+
name: 'Price Detailed',
|
|
9
|
+
inputs: generateFromAJV(PriceDetailedSchema['price-detailed']),
|
|
10
|
+
default: {
|
|
11
|
+
priceType: 'marked-list',
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
title: '100$',
|
|
15
|
+
description: 'Basic edition',
|
|
16
|
+
detailedTitle: 'per year',
|
|
17
|
+
items: [
|
|
18
|
+
{
|
|
19
|
+
text: 'First item',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: 'Second item',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default PriceDetailedConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { generateFromAJV } from '../../utils/form-generator';
|
|
2
|
+
import Quote from './Quote';
|
|
3
|
+
import { Quote as QuoteSchema } from './schema';
|
|
4
|
+
const QuoteConfig = {
|
|
5
|
+
component: Quote,
|
|
6
|
+
schema: {
|
|
7
|
+
name: 'Quote',
|
|
8
|
+
inputs: generateFromAJV(QuoteSchema['quote']),
|
|
9
|
+
default: {
|
|
10
|
+
text: 'A good decision is based on knowledge and not on numbers.',
|
|
11
|
+
author: {
|
|
12
|
+
firstName: ' Plato',
|
|
13
|
+
description: 'Greek philosopher',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default QuoteConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum ActionTypes {
|
|
2
|
+
UpdateConfigs = "UPDATE_CONFIGS",
|
|
3
|
+
SetHeight = "SET_HEIGHT",
|
|
4
|
+
IframeReady = "IFRAME_READY",
|
|
5
|
+
EditorReady = "EDITOR_READY",
|
|
6
|
+
BlocksConfigs = "BLOCKS_CONFIGS",
|
|
7
|
+
InsertBlock = "INSERT_BLOCK",
|
|
8
|
+
InsertModeEnable = "INSERT_MODE_ENABLE",
|
|
9
|
+
InsertModeDisable = "INSERT_MODE_DISABLE",
|
|
10
|
+
ReorderBlocks = "REORDER_BLOCKS",
|
|
11
|
+
ReorderModeEnable = "REORDER_MODE_ENABLE",
|
|
12
|
+
ReorderModeDisable = "REORDER_MODE_DISABLE",
|
|
13
|
+
OverlayModeOnMove = "OVERLAY_MODE_ON_MOVE",
|
|
14
|
+
SelectBlock = "SELECT_BLOCK",
|
|
15
|
+
UpdateSelectedBlockRect = "UPDATE_SELECTED_BLOCK_RECT"
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var ActionTypes;
|
|
2
|
+
(function (ActionTypes) {
|
|
3
|
+
// Other Events
|
|
4
|
+
ActionTypes["UpdateConfigs"] = "UPDATE_CONFIGS";
|
|
5
|
+
ActionTypes["SetHeight"] = "SET_HEIGHT";
|
|
6
|
+
// Initial Events
|
|
7
|
+
ActionTypes["IframeReady"] = "IFRAME_READY";
|
|
8
|
+
ActionTypes["EditorReady"] = "EDITOR_READY";
|
|
9
|
+
ActionTypes["BlocksConfigs"] = "BLOCKS_CONFIGS";
|
|
10
|
+
// Insert Events
|
|
11
|
+
ActionTypes["InsertBlock"] = "INSERT_BLOCK";
|
|
12
|
+
ActionTypes["InsertModeEnable"] = "INSERT_MODE_ENABLE";
|
|
13
|
+
ActionTypes["InsertModeDisable"] = "INSERT_MODE_DISABLE";
|
|
14
|
+
// Reorder Events
|
|
15
|
+
ActionTypes["ReorderBlocks"] = "REORDER_BLOCKS";
|
|
16
|
+
ActionTypes["ReorderModeEnable"] = "REORDER_MODE_ENABLE";
|
|
17
|
+
ActionTypes["ReorderModeDisable"] = "REORDER_MODE_DISABLE";
|
|
18
|
+
// Overlay Mode
|
|
19
|
+
ActionTypes["OverlayModeOnMove"] = "OVERLAY_MODE_ON_MOVE";
|
|
20
|
+
// Select Events
|
|
21
|
+
ActionTypes["SelectBlock"] = "SELECT_BLOCK";
|
|
22
|
+
ActionTypes["UpdateSelectedBlockRect"] = "UPDATE_SELECTED_BLOCK_RECT";
|
|
23
|
+
})(ActionTypes || (ActionTypes = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InitialActions } from './initial';
|
|
2
|
+
import { InsertActions } from './insert';
|
|
3
|
+
import { OtherActions } from './other';
|
|
4
|
+
import { OverlayActions } from './overlay';
|
|
5
|
+
import { ReorderActions } from './reorder';
|
|
6
|
+
import { SelectActions } from './select';
|
|
7
|
+
export type BaseAction<T extends string = string> = {
|
|
8
|
+
type: T;
|
|
9
|
+
};
|
|
10
|
+
export interface UnknownAction extends BaseAction {
|
|
11
|
+
[extraProps: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export type Action = InitialActions | InsertActions | OverlayActions | ReorderActions | SelectActions | OtherActions;
|
|
14
|
+
export * from './initial';
|
|
15
|
+
export * from './insert';
|
|
16
|
+
export * from './other';
|
|
17
|
+
export * from './overlay';
|
|
18
|
+
export * from './reorder';
|
|
19
|
+
export * from './select';
|
|
20
|
+
export * from './codes';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ConfigInput } from '../dynamic-form';
|
|
2
|
+
import { ItemConfig } from '../index';
|
|
3
|
+
import { ActionTypes } from './codes';
|
|
4
|
+
import { UnknownAction } from './index';
|
|
5
|
+
export interface IframeReadyAction extends UnknownAction {
|
|
6
|
+
type: ActionTypes.IframeReady;
|
|
7
|
+
payload: {
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface EditorReadyAction extends UnknownAction {
|
|
12
|
+
type: ActionTypes.EditorReady;
|
|
13
|
+
payload: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface BlocksConfigsAction extends UnknownAction {
|
|
16
|
+
type: ActionTypes.BlocksConfigs;
|
|
17
|
+
payload: {
|
|
18
|
+
blocks: ItemConfig[];
|
|
19
|
+
subBlocks: ItemConfig[];
|
|
20
|
+
global: ConfigInput[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type InitialActions = BlocksConfigsAction | IframeReadyAction | EditorReadyAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionTypes } from './codes';
|
|
2
|
+
import { UnknownAction } from './index';
|
|
3
|
+
export interface InsertBlockAction extends UnknownAction {
|
|
4
|
+
type: ActionTypes.InsertBlock;
|
|
5
|
+
payload: {
|
|
6
|
+
path: number[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface InsertModeEnableAction extends UnknownAction {
|
|
10
|
+
type: ActionTypes.InsertModeEnable;
|
|
11
|
+
payload: {
|
|
12
|
+
blockType: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface InsertModeDisableAction extends UnknownAction {
|
|
16
|
+
type: ActionTypes.InsertModeDisable;
|
|
17
|
+
payload: undefined;
|
|
18
|
+
}
|
|
19
|
+
export type InsertActions = InsertBlockAction | InsertModeEnableAction | InsertModeDisableAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PageContent } from '../../models';
|
|
2
|
+
import { ActionTypes } from './codes';
|
|
3
|
+
import { UnknownAction } from './index';
|
|
4
|
+
export interface UpdateConfigsAction extends UnknownAction {
|
|
5
|
+
type: ActionTypes.UpdateConfigs;
|
|
6
|
+
payload: {
|
|
7
|
+
content: PageContent;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface SetHeightAction extends UnknownAction {
|
|
11
|
+
type: ActionTypes.SetHeight;
|
|
12
|
+
payload: {
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type OtherActions = UpdateConfigsAction | SetHeightAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionTypes } from './codes';
|
|
2
|
+
import { UnknownAction } from './index';
|
|
3
|
+
export interface OverlayModeOnMoveAction extends UnknownAction {
|
|
4
|
+
type: ActionTypes.OverlayModeOnMove;
|
|
5
|
+
payload: {
|
|
6
|
+
block?: {
|
|
7
|
+
rect: DOMRect;
|
|
8
|
+
cursorPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
9
|
+
};
|
|
10
|
+
cursor: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type OverlayActions = OverlayModeOnMoveAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActionTypes } from './codes';
|
|
2
|
+
import { UnknownAction } from './index';
|
|
3
|
+
export interface ReorderModeEnableAction extends UnknownAction {
|
|
4
|
+
type: ActionTypes.ReorderModeEnable;
|
|
5
|
+
payload: undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface ReorderModeDisableAction extends UnknownAction {
|
|
8
|
+
type: ActionTypes.ReorderModeDisable;
|
|
9
|
+
payload: undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface ReorderBlocksAction extends UnknownAction {
|
|
12
|
+
type: ActionTypes.ReorderBlocks;
|
|
13
|
+
payload: {
|
|
14
|
+
path: number[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export type ReorderActions = ReorderBlocksAction | ReorderModeEnableAction | ReorderModeDisableAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionTypes } from './codes';
|
|
2
|
+
import { UnknownAction } from './index';
|
|
3
|
+
export interface SelectBlockAction extends UnknownAction {
|
|
4
|
+
type: ActionTypes.SelectBlock;
|
|
5
|
+
payload: {
|
|
6
|
+
path: number[];
|
|
7
|
+
rect: DOMRect;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface UpdateSelectedBlockRectAction extends UnknownAction {
|
|
11
|
+
type: ActionTypes.UpdateSelectedBlockRect;
|
|
12
|
+
payload: {
|
|
13
|
+
rect: DOMRect;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type SelectActions = SelectBlockAction | UpdateSelectedBlockRectAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface BlockFormSchema {
|
|
2
|
+
name: string;
|
|
3
|
+
inputs: Array<ConfigInput>;
|
|
4
|
+
}
|
|
5
|
+
export interface TextInput {
|
|
6
|
+
type: 'text';
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BooleanInput {
|
|
11
|
+
type: 'boolean';
|
|
12
|
+
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
export interface NumberInput {
|
|
16
|
+
type: 'number';
|
|
17
|
+
name: string;
|
|
18
|
+
title: string;
|
|
19
|
+
}
|
|
20
|
+
export interface TextAreaInput {
|
|
21
|
+
type: 'textarea';
|
|
22
|
+
name: string;
|
|
23
|
+
title: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SelectBaseInput {
|
|
26
|
+
type: 'select';
|
|
27
|
+
name: string;
|
|
28
|
+
title: string;
|
|
29
|
+
view: 'select' | 'radiobutton';
|
|
30
|
+
mode: 'single' | 'multiple';
|
|
31
|
+
enum: Array<{
|
|
32
|
+
content: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export interface SelectSingleInput extends SelectBaseInput {
|
|
37
|
+
type: 'select';
|
|
38
|
+
name: string;
|
|
39
|
+
title: string;
|
|
40
|
+
view: 'select' | 'radiobutton';
|
|
41
|
+
mode: 'single';
|
|
42
|
+
enum: Array<{
|
|
43
|
+
content: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
export interface SelectMultipleInput extends SelectBaseInput {
|
|
48
|
+
type: 'select';
|
|
49
|
+
name: string;
|
|
50
|
+
title: string;
|
|
51
|
+
view: 'select';
|
|
52
|
+
mode: 'multiple';
|
|
53
|
+
enum: Array<{
|
|
54
|
+
content: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export interface ObjectInput {
|
|
59
|
+
type: 'object';
|
|
60
|
+
name: string;
|
|
61
|
+
title: string;
|
|
62
|
+
properties: Array<ConfigInput>;
|
|
63
|
+
}
|
|
64
|
+
export interface ArrayBaseInput {
|
|
65
|
+
type: 'array';
|
|
66
|
+
arrayType: 'object' | 'text';
|
|
67
|
+
name: string;
|
|
68
|
+
title: string;
|
|
69
|
+
buttonText: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ArrayTextInput extends ArrayBaseInput {
|
|
72
|
+
arrayType: 'text';
|
|
73
|
+
}
|
|
74
|
+
export interface ArrayObjectInput extends ArrayBaseInput {
|
|
75
|
+
arrayType: 'object';
|
|
76
|
+
properties: Array<ConfigInput>;
|
|
77
|
+
}
|
|
78
|
+
export interface OneOfInput {
|
|
79
|
+
type: 'oneOf';
|
|
80
|
+
name: string;
|
|
81
|
+
key?: string;
|
|
82
|
+
title: string;
|
|
83
|
+
options: {
|
|
84
|
+
value: string;
|
|
85
|
+
title: string;
|
|
86
|
+
properties: Array<ConfigInput>;
|
|
87
|
+
}[];
|
|
88
|
+
}
|
|
89
|
+
export interface GeneralProps {
|
|
90
|
+
showIf?: string;
|
|
91
|
+
}
|
|
92
|
+
export type ConfigInput = (TextInput | BooleanInput | NumberInput | TextAreaInput | SelectSingleInput | SelectMultipleInput | ObjectInput | ArrayTextInput | ArrayObjectInput | OneOfInput) & GeneralProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta } from '../context/messagesContext/types';
|
|
2
|
+
import { Action } from './actions';
|
|
3
|
+
import { BlockFormSchema } from './dynamic-form';
|
|
4
|
+
export interface ItemConfig {
|
|
5
|
+
type: string;
|
|
6
|
+
schema: BlockFormSchema;
|
|
7
|
+
}
|
|
8
|
+
export interface WithStoreReducer {
|
|
9
|
+
reducer: (action: Action, meta: Meta) => void;
|
|
10
|
+
}
|
|
11
|
+
export type Subscriber<A extends Action = Action> = {
|
|
12
|
+
action: A['type'];
|
|
13
|
+
handler: (payload: A['payload'], meta: Meta) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const getCursorPositionOverElement = (elementRect, mouseEvent) => {
|
|
2
|
+
const cursorPositionY = elementRect.height - (mouseEvent.clientY - elementRect.y);
|
|
3
|
+
const cursorPositionX = elementRect.width - (mouseEvent.clientX - elementRect.x);
|
|
4
|
+
const cursorRatioY = elementRect.height / 2 / cursorPositionY;
|
|
5
|
+
const cursorRatioX = elementRect.width / 2 / cursorPositionX;
|
|
6
|
+
if (cursorRatioY > cursorRatioX) {
|
|
7
|
+
if (cursorRatioY >= 1) {
|
|
8
|
+
return 'bottom';
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return 'left';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else if (cursorRatioX >= 1) {
|
|
15
|
+
return 'right';
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return 'top';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { ArrayBaseInput, BooleanInput, ConfigInput, NumberInput, ObjectInput, SelectBaseInput, TextAreaInput, TextInput } from '../types/dynamic-form';
|
|
3
|
+
export declare const generateFromAJV: (schema: JSONSchemaType<{}>) => ConfigInput[];
|
|
4
|
+
export declare const generateSingleEntity: (key: string, schema: JSONSchemaType<{}>) => TextInput | BooleanInput | NumberInput | TextAreaInput | SelectBaseInput | ObjectInput | ArrayBaseInput | {
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
title: string;
|
|
8
|
+
options: any;
|
|
9
|
+
} | undefined;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export const generateFromAJV = (schema) => {
|
|
2
|
+
if (schema && schema.properties) {
|
|
3
|
+
const obj = Object.entries(schema.properties).map(([key, value]) => {
|
|
4
|
+
const innerSchema = value;
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
6
|
+
return generateSingleEntity(key, innerSchema);
|
|
7
|
+
});
|
|
8
|
+
return obj.filter(Boolean);
|
|
9
|
+
}
|
|
10
|
+
return [];
|
|
11
|
+
};
|
|
12
|
+
export const generateSingleEntity = (key, schema) => {
|
|
13
|
+
const type = schema.type;
|
|
14
|
+
if (!type && schema.enum) {
|
|
15
|
+
return {
|
|
16
|
+
type: 'select',
|
|
17
|
+
view: 'select',
|
|
18
|
+
name: key,
|
|
19
|
+
title: key,
|
|
20
|
+
enum: schema.enum.map((enumValue) => ({
|
|
21
|
+
content: enumValue,
|
|
22
|
+
value: enumValue,
|
|
23
|
+
})),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (schema.oneOf) {
|
|
27
|
+
return {
|
|
28
|
+
type: 'oneOf',
|
|
29
|
+
name: key,
|
|
30
|
+
title: key,
|
|
31
|
+
options: schema.oneOf.map((item) => {
|
|
32
|
+
let properties;
|
|
33
|
+
if (item.properties) {
|
|
34
|
+
properties = generateFromAJV(item);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
properties = [
|
|
38
|
+
generateSingleEntity('', Object.assign(Object.assign({}, item), { name: '', title: item.optionName })),
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
value: item.optionName,
|
|
43
|
+
title: item.optionName,
|
|
44
|
+
properties: properties,
|
|
45
|
+
};
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
switch (type) {
|
|
50
|
+
case 'string': {
|
|
51
|
+
if (schema.inputType === 'textarea') {
|
|
52
|
+
return {
|
|
53
|
+
type: 'textarea',
|
|
54
|
+
name: key,
|
|
55
|
+
title: key,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (schema.enum) {
|
|
59
|
+
return {
|
|
60
|
+
type: 'select',
|
|
61
|
+
view: 'select',
|
|
62
|
+
name: key,
|
|
63
|
+
title: key,
|
|
64
|
+
enum: schema.enum.map((enumValue) => ({
|
|
65
|
+
content: enumValue,
|
|
66
|
+
value: enumValue,
|
|
67
|
+
})),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
type: 'text',
|
|
72
|
+
name: key,
|
|
73
|
+
title: key,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
case 'number': {
|
|
77
|
+
return {
|
|
78
|
+
type: 'number',
|
|
79
|
+
name: key,
|
|
80
|
+
title: key,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case 'object': {
|
|
84
|
+
return {
|
|
85
|
+
type: 'object',
|
|
86
|
+
name: key,
|
|
87
|
+
title: key,
|
|
88
|
+
properties: generateFromAJV(schema),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
case 'boolean': {
|
|
92
|
+
return {
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
name: key,
|
|
95
|
+
title: key,
|
|
96
|
+
properties: generateFromAJV(schema),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
case 'array': {
|
|
100
|
+
if (schema.items.type === 'string') {
|
|
101
|
+
return {
|
|
102
|
+
type: 'array',
|
|
103
|
+
name: key,
|
|
104
|
+
title: key,
|
|
105
|
+
properties: generateFromAJV(schema.items),
|
|
106
|
+
buttonText: 'Add',
|
|
107
|
+
arrayType: 'text',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
type: 'array',
|
|
112
|
+
name: key,
|
|
113
|
+
title: key,
|
|
114
|
+
properties: generateFromAJV(schema.items),
|
|
115
|
+
buttonText: 'Add',
|
|
116
|
+
arrayType: 'object',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
export declare function initializeStore<State, Methods>(initialState: State, methods: (set: StoreApi<State & Methods>['setState'], get: StoreApi<State & Methods>['getState']) => Methods): (overrideInitialState?: Partial<State>) => import("zustand").UseBoundStore<Omit<Omit<StoreApi<State & Methods>, "setState"> & {
|
|
3
|
+
setState<A extends string | {
|
|
4
|
+
type: string;
|
|
5
|
+
}>(partial: (State & Methods) | Partial<State & Methods> | ((state: State & Methods) => (State & Methods) | Partial<State & Methods>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
+
}, "persist"> & {
|
|
7
|
+
persist: {
|
|
8
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<State & Methods, State & Methods>>) => void;
|
|
9
|
+
clearStorage: () => void;
|
|
10
|
+
rehydrate: () => void | Promise<void>;
|
|
11
|
+
hasHydrated: () => boolean;
|
|
12
|
+
onHydrate: (fn: (state: State & Methods) => void) => () => void;
|
|
13
|
+
onFinishHydration: (fn: (state: State & Methods) => void) => () => void;
|
|
14
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<State & Methods, State & Methods>>;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { devtools } from 'zustand/middleware';
|
|
3
|
+
export function initializeStore(initialState, methods) {
|
|
4
|
+
return (overrideInitialState) => create(devtools((set, get) => (Object.assign(Object.assign(Object.assign({}, initialState), overrideInitialState), methods(set, get)))));
|
|
5
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.4-alpha.0",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"lint": "run-p lint:js lint:styles lint:prettier typecheck",
|
|
66
66
|
"typecheck": "tsc --noEmit",
|
|
67
67
|
"dev": "npm run storybook:start",
|
|
68
|
+
"dev:website": "next dev example",
|
|
68
69
|
"storybook:start": "storybook dev -p 7009",
|
|
69
70
|
"storybook:build": "storybook build -c .storybook -o storybook-static",
|
|
70
71
|
"start": "node dist",
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"snakecase-keys": "^5.1.0",
|
|
109
110
|
"typograf": "^6.14.0",
|
|
110
111
|
"utility-types": "^3.10.0",
|
|
111
|
-
"uuid": "^9.0.0"
|
|
112
|
+
"uuid": "^9.0.0",
|
|
113
|
+
"zustand": "^4.5.2"
|
|
112
114
|
},
|
|
113
115
|
"peerDependencies": {
|
|
114
116
|
"@diplodoc/transform": "^4.10.4",
|
|
@@ -179,6 +181,7 @@
|
|
|
179
181
|
"markdown-loader": "^6.0.0",
|
|
180
182
|
"monaco-editor-webpack-plugin": "^7.1.0",
|
|
181
183
|
"move-file-cli": "^3.0.0",
|
|
184
|
+
"next": "^14.2.3",
|
|
182
185
|
"npm-run-all": "^4.1.5",
|
|
183
186
|
"postcss": "^8.4.16",
|
|
184
187
|
"postcss-loader": "^4.3.0",
|
|
@@ -24,7 +24,8 @@ export declare enum BlockType {
|
|
|
24
24
|
ShareBlock = "share-block",
|
|
25
25
|
MapBlock = "map-block",
|
|
26
26
|
FilterBlock = "filter-block",
|
|
27
|
-
FormBlock = "form-block"
|
|
27
|
+
FormBlock = "form-block",
|
|
28
|
+
TestEditorBlock = "test-editor-block"
|
|
28
29
|
}
|
|
29
30
|
export declare const BlockTypes: BlockType[];
|
|
30
31
|
export declare const HeaderBlockTypes: BlockType[];
|
|
@@ -22,6 +22,7 @@ var BlockType;
|
|
|
22
22
|
BlockType["MapBlock"] = "map-block";
|
|
23
23
|
BlockType["FilterBlock"] = "filter-block";
|
|
24
24
|
BlockType["FormBlock"] = "form-block";
|
|
25
|
+
BlockType["TestEditorBlock"] = "test-editor-block";
|
|
25
26
|
})(BlockType = exports.BlockType || (exports.BlockType = {}));
|
|
26
27
|
exports.BlockTypes = Object.values(BlockType);
|
|
27
28
|
exports.HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];
|
|
@@ -117,7 +117,7 @@ export interface BannerCardProps {
|
|
|
117
117
|
disableCompress?: boolean;
|
|
118
118
|
color?: ThemeSupporting<string>;
|
|
119
119
|
theme?: TextTheme;
|
|
120
|
-
button
|
|
120
|
+
button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
|
|
121
121
|
mediaView?: MediaView;
|
|
122
122
|
}
|
|
123
123
|
export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
|