@gravity-ui/page-constructor 4.0.0-beta.0 → 4.0.1
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/README.md +54 -7
- package/build/cjs/blocks/Banner/schema.d.ts +72 -24
- package/build/cjs/blocks/CardLayout/schema.d.ts +16 -6
- package/build/cjs/blocks/Companies/Companies.css +5 -5
- package/build/cjs/blocks/Companies/Companies.js +3 -3
- package/build/cjs/blocks/Companies/schema.d.ts +8 -3
- package/build/cjs/blocks/ContentLayout/ContentLayout.css +4 -7
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +1 -2
- package/build/cjs/blocks/ContentLayout/schema.d.ts +112 -59
- package/build/cjs/blocks/ContentLayout/schema.js +23 -18
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.css +16 -16
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -3
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +37 -6
- package/build/cjs/blocks/ExtendedFeatures/schema.js +2 -3
- package/build/cjs/blocks/FilterBlock/schema.d.ts +19 -7
- package/build/cjs/blocks/FilterBlock/schema.js +13 -2
- package/build/cjs/blocks/Header/Header.css +28 -25
- package/build/cjs/blocks/Header/Header.js +6 -7
- package/build/cjs/blocks/Header/schema.d.ts +329 -37
- package/build/cjs/blocks/Header/schema.js +1 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +129 -54
- package/build/cjs/blocks/HeaderSlider/schema.js +3 -1
- package/build/cjs/blocks/Icons/Icons.css +2 -2
- package/build/cjs/blocks/Icons/schema.d.ts +9 -3
- package/build/cjs/blocks/Icons/schema.js +2 -1
- package/build/cjs/blocks/Info/Info.css +1 -1
- package/build/cjs/blocks/Info/Info.js +3 -3
- package/build/cjs/blocks/Info/schema.d.ts +44 -9
- package/build/cjs/blocks/Map/schema.d.ts +31 -7
- package/build/cjs/blocks/Media/Media.js +2 -2
- package/build/cjs/blocks/Media/schema.d.ts +346 -112
- package/build/cjs/blocks/Media/schema.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.css +13 -13
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +103 -9
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -0
- package/build/cjs/blocks/Questions/Questions.css +12 -12
- package/build/cjs/blocks/Questions/schema.d.ts +21 -4
- package/build/cjs/blocks/Share/Share.css +14 -12
- package/build/cjs/blocks/Share/schema.d.ts +3 -1
- package/build/cjs/blocks/Slider/Arrow/Arrow.css +4 -4
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/cjs/blocks/Slider/Slider.css +12 -12
- package/build/cjs/blocks/Slider/Slider.js +3 -3
- package/build/cjs/blocks/Slider/schema.d.ts +16 -19
- package/build/cjs/blocks/Slider/schema.js +4 -5
- package/build/cjs/blocks/Slider/utils.d.ts +2 -2
- package/build/cjs/blocks/Slider/utils.js +3 -1
- package/build/cjs/blocks/Table/Table.css +5 -5
- package/build/cjs/blocks/Table/schema.d.ts +11 -4
- package/build/cjs/blocks/Table/schema.js +12 -2
- package/build/cjs/blocks/Tabs/Tabs.css +6 -6
- package/build/cjs/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +4 -4
- package/build/cjs/blocks/Tabs/schema.d.ts +142 -18
- package/build/cjs/blocks/Tabs/schema.js +4 -1
- package/build/cjs/components/Anchor/Anchor.d.ts +2 -3
- package/build/cjs/components/AnimateBlock/AnimateBlock.d.ts +2 -3
- package/build/cjs/components/Author/Author.css +8 -8
- package/build/cjs/components/Author/Author.js +2 -2
- package/build/cjs/components/Author/schema.d.ts +3 -1
- package/build/cjs/components/BlockBase/BlockBase.css +4 -1
- package/build/cjs/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/cjs/components/BlockBase/BlockBase.js +3 -5
- package/build/cjs/components/Button/Button.css +4 -0
- package/build/cjs/components/Button/Button.d.ts +2 -3
- package/build/cjs/components/Button/Button.js +3 -2
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +4 -0
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +2 -3
- package/build/cjs/components/CardBase/CardBase.css +6 -6
- package/build/cjs/components/Control/Control.css +9 -9
- package/build/cjs/components/ErrorWrapper/ErrorWrapper.css +3 -3
- package/build/cjs/components/FileLink/FileLink.css +16 -56
- package/build/cjs/components/FileLink/FileLink.js +18 -1
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.css +1 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.css +3 -3
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.css +3 -3
- package/build/cjs/components/HTML/HTML.js +2 -1
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +11 -11
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
- package/build/cjs/components/Image/Image.d.ts +2 -3
- package/build/cjs/components/Image/schema.d.ts +2 -1
- package/build/cjs/components/Image/schema.js +10 -9
- package/build/cjs/components/Link/Link.css +13 -13
- package/build/cjs/components/Media/Image/Image.js +4 -3
- package/build/cjs/components/Media/Media.js +1 -1
- package/build/cjs/components/Media/Video/Video.js +1 -0
- package/build/cjs/components/MediaBase/MediaBaseContent.js +2 -2
- package/build/cjs/components/MetaInfo/MetaInfo.css +2 -2
- package/build/cjs/components/MetaInfo/MetaInfo.js +1 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +1 -1
- package/build/cjs/components/ReactPlayer/CustomBarControls.css +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +2 -2
- package/build/cjs/components/Table/Table.css +8 -8
- package/build/cjs/components/Title/Title.css +4 -4
- package/build/cjs/components/Title/TitleItem.css +19 -19
- package/build/cjs/components/Title/TitleItem.d.ts +2 -3
- package/build/cjs/components/Title/TitleItem.js +2 -2
- package/build/cjs/components/UnpublishedLabel/UnpublishedLabel.css +5 -5
- package/build/cjs/components/VideoBlock/VideoBlock.css +2 -2
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +2 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +6 -2
- package/build/cjs/components/constants.d.ts +3 -1
- package/build/cjs/components/constants.js +4 -2
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/containers/Loadable/Loadable.d.ts +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.css +50 -30
- package/build/cjs/containers/PageConstructor/PageConstructor.js +6 -3
- package/build/cjs/containers/PageConstructor/Provider.d.ts +2 -3
- package/build/cjs/containers/PageConstructor/Provider.js +2 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +8 -4
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.d.ts +3 -4
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +3 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -3
- package/build/cjs/containers/PageConstructor/components/index.d.ts +2 -0
- package/build/cjs/containers/PageConstructor/components/index.js +5 -0
- package/build/cjs/containers/PageConstructor/index.d.ts +1 -0
- package/build/cjs/containers/PageConstructor/index.js +2 -0
- package/build/cjs/context/theme/ThemeContext.d.ts +2 -3
- package/build/cjs/context/theme/ThemeContext.js +0 -1
- package/build/cjs/context/theme/index.d.ts +0 -1
- package/build/cjs/context/theme/index.js +0 -1
- package/build/cjs/context/theme/useTheme.d.ts +1 -1
- package/build/cjs/context/theme/useTheme.js +2 -2
- package/build/cjs/context/theme/withTheme.js +1 -1
- package/build/cjs/customization/BlockDecoration.d.ts +1 -1
- package/build/cjs/customization/BlockDecoration.js +8 -14
- package/build/cjs/editor/{Components → components}/AddBlock/AddBlock.css +7 -6
- package/build/cjs/editor/components/AddBlock/AddBlock.d.ts +7 -0
- package/build/cjs/editor/{Components → components}/AddBlock/AddBlock.js +3 -3
- package/build/cjs/editor/components/BlockForm/BlockForm.d.ts +12 -0
- package/build/cjs/editor/components/BlockForm/BlockForm.js +28 -0
- package/build/cjs/editor/components/ControlPanel/ControlPanel.css +34 -0
- package/build/cjs/editor/components/ControlPanel/ControlPanel.d.ts +10 -0
- package/build/cjs/editor/components/ControlPanel/ControlPanel.js +35 -0
- package/build/cjs/editor/components/ControlPanel/i18n/en.json +3 -0
- package/build/cjs/editor/components/ControlPanel/i18n/index.d.ts +2 -0
- package/build/cjs/editor/components/ControlPanel/i18n/index.js +8 -0
- package/build/cjs/editor/components/ControlPanel/i18n/ru.json +3 -0
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulation.d.ts +7 -0
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulation.js +10 -0
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.css +33 -0
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.d.ts +8 -0
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js +41 -0
- package/build/cjs/editor/components/DeviceEmulation/utils.d.ts +4 -0
- package/build/cjs/editor/components/DeviceEmulation/utils.js +7 -0
- package/build/{esm/editor/Components → cjs/editor/components}/EditBlock/EditBlock.css +22 -14
- package/build/cjs/editor/components/EditBlock/EditBlock.d.ts +13 -0
- package/build/cjs/editor/components/EditBlock/EditBlock.js +48 -0
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.css +27 -0
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.d.ts +13 -0
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js +35 -0
- package/build/cjs/editor/components/ErrorBoundary/i18n/en.json +4 -0
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.d.ts +2 -0
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.js +8 -0
- package/build/cjs/editor/components/ErrorBoundary/i18n/ru.json +4 -0
- package/build/cjs/editor/components/Layout/Layout.css +44 -0
- package/build/cjs/editor/components/Layout/Layout.d.ts +19 -0
- package/build/cjs/editor/components/Layout/Layout.js +38 -0
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.css +21 -0
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.d.ts +2 -0
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.js +12 -0
- package/build/cjs/editor/components/NotFoundBlock/i18n/en.json +3 -0
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.d.ts +2 -0
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.js +8 -0
- package/build/cjs/editor/components/NotFoundBlock/i18n/ru.json +3 -0
- package/build/cjs/editor/components/PagePropsForm/PagePropsForm.d.ts +10 -0
- package/build/cjs/editor/components/PagePropsForm/PagePropsForm.js +17 -0
- package/build/cjs/editor/components/YamlEditor/YamlEditor.css +12 -0
- package/build/cjs/editor/components/YamlEditor/YamlEditor.d.ts +6 -0
- package/build/cjs/editor/components/YamlEditor/YamlEditor.js +34 -0
- package/build/cjs/editor/containers/Editor/Editor.d.ts +2 -0
- package/build/cjs/editor/containers/Editor/Editor.js +67 -0
- package/build/cjs/editor/containers/Form/Form.css +115 -0
- package/build/cjs/editor/containers/Form/Form.d.ts +11 -0
- package/build/cjs/editor/containers/Form/Form.js +54 -0
- package/build/cjs/editor/containers/Form/dynamic-form-custom.css +0 -0
- package/build/cjs/editor/context.d.ts +9 -0
- package/build/cjs/editor/context.js +6 -0
- package/build/cjs/editor/data/previews/default-preview.js +1 -1
- package/build/cjs/editor/data/previews/header-block.js +5 -5
- package/build/cjs/editor/data/templates/banner-block.json +25 -0
- package/build/cjs/editor/data/templates/card-layout-block.json +39 -0
- package/build/cjs/editor/data/templates/companies-block.json +20 -0
- package/build/cjs/editor/data/templates/content-layout-block.json +56 -0
- package/build/cjs/editor/data/templates/extended-features-block.json +56 -0
- package/build/cjs/editor/data/templates/filter-block.json +62 -0
- package/build/cjs/editor/data/templates/header-block.json +19 -0
- package/build/cjs/editor/data/templates/header-slider-block.json +69 -0
- package/build/cjs/editor/data/templates/icons-block.json +32 -0
- package/build/cjs/editor/data/templates/info-block.json +40 -0
- package/build/cjs/editor/data/templates/link-table-block.json +10 -0
- package/build/cjs/editor/data/templates/map-block.json +48 -0
- package/build/cjs/editor/data/templates/media-block.json +15 -0
- package/build/cjs/editor/data/templates/preview-block.json +38 -0
- package/build/cjs/editor/data/templates/promo-features-block.json +52 -0
- package/build/cjs/editor/data/templates/questions-block.json +105 -0
- package/build/cjs/editor/data/templates/security-block.json +36 -0
- package/build/cjs/editor/data/templates/share-block.json +6 -0
- package/build/cjs/editor/data/templates/simple-block.json +7 -0
- package/build/cjs/editor/data/templates/slider-block.json +46 -0
- package/build/cjs/editor/data/templates/table-block.json +18 -0
- package/build/cjs/editor/data/templates/tabs-block.json +90 -0
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +27 -0
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.d.ts +19 -0
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +72 -0
- package/build/cjs/editor/dynamic-forms-custom/config.d.ts +2 -0
- package/build/cjs/editor/dynamic-forms-custom/config.js +13 -0
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +12 -0
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js +75 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/detect.d.ts +9 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/detect.js +36 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/index.d.ts +28 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/index.js +187 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/types.d.ts +28 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/types.js +2 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/views.d.ts +37 -0
- package/build/cjs/editor/dynamic-forms-custom/parser/views.js +46 -0
- package/build/cjs/editor/hooks/useFormSpec.d.ts +2 -0
- package/build/cjs/editor/hooks/useFormSpec.js +13 -0
- package/build/cjs/editor/hooks/usePreviousValue.d.ts +1 -0
- package/build/cjs/editor/hooks/usePreviousValue.js +11 -0
- package/build/cjs/editor/icons/Tablet.d.ts +2 -0
- package/build/cjs/editor/icons/Tablet.js +9 -0
- package/build/cjs/editor/index.d.ts +1 -1
- package/build/cjs/editor/index.js +1 -1
- package/build/cjs/editor/store/index.d.ts +12 -11
- package/build/cjs/editor/store/index.js +70 -15
- package/build/cjs/editor/store/reducer.d.ts +30 -9
- package/build/cjs/editor/store/reducer.js +20 -31
- package/build/cjs/editor/store/utils.d.ts +6 -5
- package/build/cjs/editor/store/utils.js +6 -2
- package/build/cjs/editor/styles/root.css +7 -0
- package/build/cjs/editor/types/index.d.ts +30 -12
- package/build/cjs/editor/types/index.js +8 -0
- package/build/cjs/editor/utils/index.d.ts +6 -3
- package/build/cjs/editor/utils/index.js +9 -4
- package/build/cjs/editor/widget/constants.d.ts +4 -0
- package/build/cjs/editor/widget/constants.js +8 -0
- package/build/cjs/editor/widget/index.d.ts +21 -0
- package/build/cjs/editor/widget/index.js +76 -0
- package/build/cjs/editor/widget/utils.d.ts +1 -0
- package/build/cjs/editor/widget/utils.js +19 -0
- package/build/cjs/grid/Col/Col.d.ts +3 -4
- package/build/cjs/grid/Col/Col.js +2 -2
- package/build/cjs/grid/Grid/Grid.css +1 -1
- package/build/cjs/hooks/useHeightCalculator.js +1 -1
- package/build/cjs/models/common.d.ts +6 -1
- package/build/cjs/models/common.js +6 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +17 -13
- package/build/cjs/models/constructor-items/common.d.ts +3 -5
- package/build/cjs/models/constructor.d.ts +4 -4
- package/build/cjs/models/customization.d.ts +5 -7
- package/build/cjs/models/navigation.d.ts +4 -2
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.css +92 -0
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +4 -0
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.js +21 -0
- package/build/cjs/navigation/components/Logo/Logo.css +3 -3
- package/build/cjs/navigation/components/Logo/Logo.js +3 -3
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.css +7 -0
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.d.ts +3 -0
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +15 -0
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.css +17 -12
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -10
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js +11 -31
- package/build/cjs/navigation/components/Navigation/Navigation.css +8 -13
- package/build/cjs/navigation/components/Navigation/Navigation.d.ts +4 -7
- package/build/cjs/navigation/components/Navigation/Navigation.js +37 -15
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +28 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.d.ts +3 -9
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +15 -6
- package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.d.ts +5 -4
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +12 -8
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +2 -2
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.d.ts +1 -1
- package/build/cjs/navigation/components/NavigationList/NavigationList.d.ts +3 -0
- package/build/cjs/navigation/components/NavigationList/NavigationList.js +11 -0
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.d.ts +4 -13
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +6 -13
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.css +10 -9
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.d.ts +1 -8
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +6 -6
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.css +3 -3
- package/build/cjs/navigation/containers/Layout/Layout.js +2 -2
- package/build/cjs/navigation/models.d.ts +63 -0
- package/build/cjs/navigation/{constants.js → models.js} +7 -1
- package/build/cjs/navigation/schema.d.ts +1 -0
- package/build/cjs/navigation/schema.js +1 -1
- package/build/cjs/navigation/utils.d.ts +11 -1
- package/build/cjs/navigation/utils.js +19 -1
- package/build/cjs/schema/constants.d.ts +941 -0
- package/build/cjs/schema/constants.js +42 -0
- package/build/cjs/schema/index.d.ts +9 -228
- package/build/cjs/schema/index.js +8 -46
- package/build/cjs/schema/validators/common.d.ts +158 -30
- package/build/cjs/schema/validators/common.js +57 -19
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +4 -4
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +3 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +26 -6
- package/build/cjs/sub-blocks/BannerCard/BannerCard.css +16 -16
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +22 -4
- package/build/cjs/sub-blocks/Content/Content.css +22 -22
- package/build/cjs/sub-blocks/Content/Content.js +3 -1
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.css +48 -0
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +7 -0
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +25 -0
- package/build/cjs/sub-blocks/Content/schema.d.ts +74 -6
- package/build/cjs/sub-blocks/Content/schema.js +27 -2
- package/build/cjs/sub-blocks/Divider/Divider.css +1 -1
- package/build/cjs/sub-blocks/Divider/schema.d.ts +3 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +39 -39
- package/build/cjs/sub-blocks/HubspotForm/index.js +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +115 -10
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +100 -6
- package/build/cjs/sub-blocks/MediaCard/schema.js +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +17 -29
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +18 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +7 -7
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +5 -5
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +4 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +5 -1
- package/build/cjs/sub-blocks/Quote/Quote.css +10 -10
- package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +9 -4
- package/build/cjs/sub-blocks/Quote/schema.js +1 -2
- package/build/cjs/text-transform/config.js +19 -1
- package/build/cjs/text-transform/filter.d.ts +20 -0
- package/build/cjs/text-transform/filter.js +61 -0
- package/build/cjs/text-transform/index.d.ts +1 -0
- package/build/cjs/text-transform/index.js +1 -0
- package/build/cjs/text-transform/transformers.d.ts +2 -0
- package/build/cjs/text-transform/transformers.js +3 -2
- package/build/cjs/text-transform/utils.js +6 -1
- package/build/cjs/utils/blocks.d.ts +4 -5
- package/build/cjs/utils/blocks.js +43 -3
- package/build/cjs/utils/imageCompress.js +1 -1
- package/build/cjs/utils/theme.d.ts +1 -1
- package/build/esm/blocks/Banner/schema.d.ts +72 -24
- package/build/esm/blocks/CardLayout/schema.d.ts +16 -6
- package/build/esm/blocks/Companies/Companies.css +5 -5
- package/build/esm/blocks/Companies/Companies.js +3 -3
- package/build/esm/blocks/Companies/schema.d.ts +8 -3
- package/build/esm/blocks/ContentLayout/ContentLayout.css +4 -7
- package/build/esm/blocks/ContentLayout/ContentLayout.js +1 -2
- package/build/esm/blocks/ContentLayout/schema.d.ts +112 -59
- package/build/esm/blocks/ContentLayout/schema.js +23 -18
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.css +16 -16
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +3 -3
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +37 -6
- package/build/esm/blocks/ExtendedFeatures/schema.js +3 -4
- package/build/esm/blocks/FilterBlock/schema.d.ts +19 -7
- package/build/esm/blocks/FilterBlock/schema.js +13 -2
- package/build/esm/blocks/Header/Header.css +28 -25
- package/build/esm/blocks/Header/Header.js +6 -7
- package/build/esm/blocks/Header/schema.d.ts +329 -37
- package/build/esm/blocks/Header/schema.js +1 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +129 -54
- package/build/esm/blocks/HeaderSlider/schema.js +2 -1
- package/build/esm/blocks/Icons/Icons.css +2 -2
- package/build/esm/blocks/Icons/schema.d.ts +9 -3
- package/build/esm/blocks/Icons/schema.js +2 -1
- package/build/esm/blocks/Info/Info.css +1 -1
- package/build/esm/blocks/Info/Info.js +3 -3
- package/build/esm/blocks/Info/schema.d.ts +44 -9
- package/build/esm/blocks/Map/schema.d.ts +31 -7
- package/build/esm/blocks/Media/Media.js +3 -3
- package/build/esm/blocks/Media/schema.d.ts +346 -112
- package/build/esm/blocks/Media/schema.js +2 -2
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.css +13 -13
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +103 -9
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +1 -0
- package/build/esm/blocks/Questions/Questions.css +12 -12
- package/build/esm/blocks/Questions/schema.d.ts +21 -4
- package/build/esm/blocks/Share/Share.css +14 -12
- package/build/esm/blocks/Share/schema.d.ts +3 -1
- package/build/esm/blocks/Slider/Arrow/Arrow.css +4 -4
- package/build/esm/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/esm/blocks/Slider/Slider.css +12 -12
- package/build/esm/blocks/Slider/Slider.js +4 -4
- package/build/esm/blocks/Slider/schema.d.ts +16 -19
- package/build/esm/blocks/Slider/schema.js +4 -5
- package/build/esm/blocks/Slider/utils.d.ts +2 -2
- package/build/esm/blocks/Slider/utils.js +2 -1
- package/build/esm/blocks/Table/Table.css +5 -5
- package/build/esm/blocks/Table/schema.d.ts +11 -4
- package/build/esm/blocks/Table/schema.js +12 -2
- package/build/esm/blocks/Tabs/Tabs.css +6 -6
- package/build/esm/blocks/Tabs/Tabs.d.ts +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +5 -5
- package/build/esm/blocks/Tabs/schema.d.ts +142 -18
- package/build/esm/blocks/Tabs/schema.js +5 -2
- package/build/esm/components/Anchor/Anchor.d.ts +2 -3
- package/build/esm/components/AnimateBlock/AnimateBlock.d.ts +2 -3
- package/build/esm/components/Author/Author.css +8 -8
- package/build/esm/components/Author/Author.js +2 -2
- package/build/esm/components/Author/schema.d.ts +3 -1
- package/build/esm/components/BlockBase/BlockBase.css +4 -1
- package/build/esm/components/BlockBase/BlockBase.d.ts +3 -2
- package/build/esm/components/BlockBase/BlockBase.js +3 -5
- package/build/esm/components/Button/Button.css +4 -0
- package/build/esm/components/Button/Button.d.ts +2 -3
- package/build/esm/components/Button/Button.js +4 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.css +4 -0
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +2 -3
- package/build/esm/components/CardBase/CardBase.css +6 -6
- package/build/esm/components/Control/Control.css +9 -9
- package/build/esm/components/ErrorWrapper/ErrorWrapper.css +3 -3
- package/build/esm/components/FileLink/FileLink.css +16 -56
- package/build/esm/components/FileLink/FileLink.js +18 -1
- package/build/esm/components/FullWidthBackground/FullWidthBackground.css +1 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.css +3 -3
- package/build/esm/components/FullscreenMedia/FullscreenMedia.css +3 -3
- package/build/esm/components/HTML/HTML.js +2 -1
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +11 -11
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
- package/build/esm/components/Image/Image.d.ts +2 -3
- package/build/esm/components/Image/schema.d.ts +2 -1
- package/build/esm/components/Image/schema.js +9 -8
- package/build/esm/components/Link/Link.css +13 -13
- package/build/esm/components/Media/Image/Image.js +4 -3
- package/build/esm/components/Media/Media.js +1 -1
- package/build/esm/components/Media/Video/Video.js +1 -0
- package/build/esm/components/MediaBase/MediaBaseContent.js +2 -2
- package/build/esm/components/MetaInfo/MetaInfo.css +2 -2
- package/build/esm/components/MetaInfo/MetaInfo.js +1 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.css +1 -1
- package/build/esm/components/ReactPlayer/CustomBarControls.css +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.css +2 -2
- package/build/esm/components/Table/Table.css +8 -8
- package/build/esm/components/Title/Title.css +4 -4
- package/build/esm/components/Title/TitleItem.css +19 -19
- package/build/esm/components/Title/TitleItem.d.ts +2 -3
- package/build/esm/components/Title/TitleItem.js +2 -2
- package/build/esm/components/UnpublishedLabel/UnpublishedLabel.css +5 -5
- package/build/esm/components/VideoBlock/VideoBlock.css +2 -2
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +2 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -2
- package/build/esm/components/constants.d.ts +3 -1
- package/build/esm/components/constants.js +3 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/containers/Loadable/Loadable.d.ts +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.css +50 -30
- package/build/esm/containers/PageConstructor/PageConstructor.js +7 -4
- package/build/esm/containers/PageConstructor/Provider.d.ts +2 -3
- package/build/esm/containers/PageConstructor/Provider.js +2 -2
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +3 -3
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +8 -4
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.d.ts +3 -4
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +7 -4
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +3 -3
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -3
- package/build/esm/containers/PageConstructor/components/index.d.ts +2 -0
- package/build/esm/containers/PageConstructor/components/index.js +1 -0
- package/build/esm/containers/PageConstructor/index.d.ts +1 -0
- package/build/esm/containers/PageConstructor/index.js +1 -0
- package/build/esm/context/theme/ThemeContext.d.ts +2 -3
- package/build/esm/context/theme/ThemeContext.js +0 -1
- package/build/esm/context/theme/index.d.ts +0 -1
- package/build/esm/context/theme/index.js +0 -1
- package/build/esm/context/theme/useTheme.d.ts +1 -1
- package/build/esm/context/theme/useTheme.js +2 -2
- package/build/esm/context/theme/withTheme.js +1 -1
- package/build/esm/customization/BlockDecoration.d.ts +1 -1
- package/build/esm/customization/BlockDecoration.js +9 -14
- package/build/esm/editor/{Components → components}/AddBlock/AddBlock.css +7 -6
- package/build/esm/editor/components/AddBlock/AddBlock.d.ts +8 -0
- package/build/esm/editor/{Components → components}/AddBlock/AddBlock.js +3 -3
- package/build/esm/editor/components/BlockForm/BlockForm.d.ts +12 -0
- package/build/esm/editor/components/BlockForm/BlockForm.js +25 -0
- package/build/esm/editor/components/ControlPanel/ControlPanel.css +34 -0
- package/build/esm/editor/components/ControlPanel/ControlPanel.d.ts +11 -0
- package/build/esm/editor/components/ControlPanel/ControlPanel.js +33 -0
- package/build/esm/editor/components/ControlPanel/i18n/en.json +3 -0
- package/build/esm/editor/components/ControlPanel/i18n/index.d.ts +2 -0
- package/build/esm/editor/components/ControlPanel/i18n/index.js +5 -0
- package/build/esm/editor/components/ControlPanel/i18n/ru.json +3 -0
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulation.d.ts +7 -0
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulation.js +7 -0
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.css +33 -0
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.d.ts +9 -0
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js +40 -0
- package/build/esm/editor/components/DeviceEmulation/utils.d.ts +4 -0
- package/build/esm/editor/components/DeviceEmulation/utils.js +3 -0
- package/build/{cjs/editor/Components → esm/editor/components}/EditBlock/EditBlock.css +22 -14
- package/build/esm/editor/components/EditBlock/EditBlock.d.ts +14 -0
- package/build/esm/editor/components/EditBlock/EditBlock.js +45 -0
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.css +27 -0
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.d.ts +14 -0
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js +31 -0
- package/build/esm/editor/components/ErrorBoundary/i18n/en.json +4 -0
- package/build/esm/editor/components/ErrorBoundary/i18n/index.d.ts +2 -0
- package/build/esm/editor/components/ErrorBoundary/i18n/index.js +5 -0
- package/build/esm/editor/components/ErrorBoundary/i18n/ru.json +4 -0
- package/build/esm/editor/components/Layout/Layout.css +44 -0
- package/build/esm/editor/components/Layout/Layout.d.ts +20 -0
- package/build/esm/editor/components/Layout/Layout.js +36 -0
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.css +21 -0
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.d.ts +3 -0
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.js +8 -0
- package/build/esm/editor/components/NotFoundBlock/i18n/en.json +3 -0
- package/build/esm/editor/components/NotFoundBlock/i18n/index.d.ts +2 -0
- package/build/esm/editor/components/NotFoundBlock/i18n/index.js +5 -0
- package/build/esm/editor/components/NotFoundBlock/i18n/ru.json +3 -0
- package/build/esm/editor/components/PagePropsForm/PagePropsForm.d.ts +10 -0
- package/build/esm/editor/components/PagePropsForm/PagePropsForm.js +13 -0
- package/build/esm/editor/components/YamlEditor/YamlEditor.css +12 -0
- package/build/esm/editor/components/YamlEditor/YamlEditor.d.ts +7 -0
- package/build/esm/editor/components/YamlEditor/YamlEditor.js +30 -0
- package/build/esm/editor/containers/Editor/Editor.d.ts +2 -0
- package/build/esm/editor/containers/Editor/Editor.js +63 -0
- package/build/esm/editor/containers/Form/Form.css +115 -0
- package/build/esm/editor/containers/Form/Form.d.ts +12 -0
- package/build/esm/editor/containers/Form/Form.js +52 -0
- package/build/esm/editor/containers/Form/dynamic-form-custom.css +0 -0
- package/build/esm/editor/context.d.ts +9 -0
- package/build/esm/editor/context.js +2 -0
- package/build/esm/editor/data/previews/default-preview.js +1 -1
- package/build/esm/editor/data/previews/header-block.js +5 -5
- package/build/esm/editor/data/templates/banner-block.json +25 -0
- package/build/esm/editor/data/templates/card-layout-block.json +39 -0
- package/build/esm/editor/data/templates/companies-block.json +20 -0
- package/build/esm/editor/data/templates/content-layout-block.json +56 -0
- package/build/esm/editor/data/templates/extended-features-block.json +56 -0
- package/build/esm/editor/data/templates/filter-block.json +62 -0
- package/build/esm/editor/data/templates/header-block.json +19 -0
- package/build/esm/editor/data/templates/header-slider-block.json +69 -0
- package/build/esm/editor/data/templates/icons-block.json +32 -0
- package/build/esm/editor/data/templates/info-block.json +40 -0
- package/build/esm/editor/data/templates/link-table-block.json +10 -0
- package/build/esm/editor/data/templates/map-block.json +48 -0
- package/build/esm/editor/data/templates/media-block.json +15 -0
- package/build/esm/editor/data/templates/preview-block.json +38 -0
- package/build/esm/editor/data/templates/promo-features-block.json +52 -0
- package/build/esm/editor/data/templates/questions-block.json +105 -0
- package/build/esm/editor/data/templates/security-block.json +36 -0
- package/build/esm/editor/data/templates/share-block.json +6 -0
- package/build/esm/editor/data/templates/simple-block.json +7 -0
- package/build/esm/editor/data/templates/slider-block.json +46 -0
- package/build/esm/editor/data/templates/table-block.json +18 -0
- package/build/esm/editor/data/templates/tabs-block.json +90 -0
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.css +27 -0
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.d.ts +20 -0
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +68 -0
- package/build/esm/editor/dynamic-forms-custom/config.d.ts +2 -0
- package/build/esm/editor/dynamic-forms-custom/config.js +9 -0
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +12 -0
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js +69 -0
- package/build/esm/editor/dynamic-forms-custom/parser/detect.d.ts +9 -0
- package/build/esm/editor/dynamic-forms-custom/parser/detect.js +32 -0
- package/build/esm/editor/dynamic-forms-custom/parser/index.d.ts +28 -0
- package/build/esm/editor/dynamic-forms-custom/parser/index.js +185 -0
- package/build/esm/editor/dynamic-forms-custom/parser/types.d.ts +28 -0
- package/build/esm/editor/dynamic-forms-custom/parser/types.js +1 -0
- package/build/esm/editor/dynamic-forms-custom/parser/views.d.ts +37 -0
- package/build/esm/editor/dynamic-forms-custom/parser/views.js +39 -0
- package/build/esm/editor/hooks/useFormSpec.d.ts +2 -0
- package/build/esm/editor/hooks/useFormSpec.js +9 -0
- package/build/esm/editor/hooks/usePreviousValue.d.ts +1 -0
- package/build/esm/editor/hooks/usePreviousValue.js +8 -0
- package/build/esm/editor/icons/Tablet.d.ts +2 -0
- package/build/esm/editor/icons/Tablet.js +4 -0
- package/build/esm/editor/index.d.ts +1 -1
- package/build/esm/editor/index.js +1 -1
- package/build/esm/editor/store/index.d.ts +12 -11
- package/build/esm/editor/store/index.js +72 -17
- package/build/esm/editor/store/reducer.d.ts +30 -9
- package/build/esm/editor/store/reducer.js +18 -29
- package/build/esm/editor/store/utils.d.ts +6 -5
- package/build/esm/editor/store/utils.js +3 -1
- package/build/esm/editor/styles/root.css +7 -0
- package/build/esm/editor/types/index.d.ts +30 -12
- package/build/esm/editor/types/index.js +7 -1
- package/build/esm/editor/utils/index.d.ts +6 -3
- package/build/esm/editor/utils/index.js +6 -3
- package/build/esm/editor/widget/constants.d.ts +4 -0
- package/build/esm/editor/widget/constants.js +5 -0
- package/build/esm/editor/widget/index.d.ts +21 -0
- package/build/esm/editor/widget/index.js +71 -0
- package/build/esm/editor/widget/utils.d.ts +1 -0
- package/build/esm/editor/widget/utils.js +15 -0
- package/build/esm/grid/Col/Col.d.ts +3 -4
- package/build/esm/grid/Col/Col.js +2 -2
- package/build/esm/grid/Grid/Grid.css +1 -1
- package/build/esm/hooks/useHeightCalculator.js +1 -1
- package/build/esm/models/common.d.ts +6 -1
- package/build/esm/models/common.js +5 -0
- package/build/esm/models/constructor-items/blocks.d.ts +17 -13
- package/build/esm/models/constructor-items/common.d.ts +3 -5
- package/build/esm/models/constructor.d.ts +4 -4
- package/build/esm/models/customization.d.ts +5 -7
- package/build/esm/models/navigation.d.ts +4 -2
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.css +92 -0
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +5 -0
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.js +19 -0
- package/build/esm/navigation/components/Logo/Logo.css +3 -3
- package/build/esm/navigation/components/Logo/Logo.js +3 -3
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.css +7 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.d.ts +4 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +11 -0
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.css +17 -12
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -10
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js +13 -32
- package/build/esm/navigation/components/Navigation/Navigation.css +8 -13
- package/build/esm/navigation/components/Navigation/Navigation.d.ts +4 -7
- package/build/esm/navigation/components/Navigation/Navigation.js +35 -15
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +28 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.d.ts +4 -9
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +16 -6
- package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.d.ts +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.d.ts +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.d.ts +5 -4
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +11 -8
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +2 -2
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.d.ts +1 -1
- package/build/esm/navigation/components/NavigationList/NavigationList.d.ts +3 -0
- package/build/esm/navigation/components/NavigationList/NavigationList.js +7 -0
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.d.ts +4 -14
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +5 -10
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.css +10 -9
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.d.ts +1 -8
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +6 -6
- package/build/esm/navigation/components/SocialIcon/SocialIcon.css +3 -3
- package/build/esm/navigation/containers/Layout/Layout.js +2 -2
- package/build/esm/navigation/models.d.ts +63 -0
- package/build/esm/navigation/{constants.js → models.js} +6 -0
- package/build/esm/navigation/schema.d.ts +1 -0
- package/build/esm/navigation/schema.js +2 -2
- package/build/esm/navigation/utils.d.ts +11 -1
- package/build/esm/navigation/utils.js +17 -0
- package/build/esm/schema/constants.d.ts +941 -0
- package/build/esm/schema/constants.js +39 -0
- package/build/esm/schema/index.d.ts +9 -228
- package/build/esm/schema/index.js +4 -42
- package/build/esm/schema/validators/common.d.ts +158 -30
- package/build/esm/schema/validators/common.js +57 -19
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +4 -4
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +3 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +26 -6
- package/build/esm/sub-blocks/BannerCard/BannerCard.css +16 -16
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -3
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +22 -4
- package/build/esm/sub-blocks/Content/Content.css +22 -22
- package/build/esm/sub-blocks/Content/Content.js +3 -1
- package/build/esm/sub-blocks/Content/ContentList/ContentList.css +48 -0
- package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +8 -0
- package/build/esm/sub-blocks/Content/ContentList/ContentList.js +23 -0
- package/build/esm/sub-blocks/Content/schema.d.ts +74 -6
- package/build/esm/sub-blocks/Content/schema.js +27 -2
- package/build/esm/sub-blocks/Divider/Divider.css +1 -1
- package/build/esm/sub-blocks/Divider/schema.d.ts +3 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +39 -39
- package/build/esm/sub-blocks/HubspotForm/index.js +2 -2
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +115 -10
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +100 -6
- package/build/esm/sub-blocks/MediaCard/schema.js +2 -2
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.css +2 -2
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.css +17 -29
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +18 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/Settings.css +7 -7
- package/build/esm/sub-blocks/PriceDetailed/PriceDetails/PriceDetails.css +5 -5
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +4 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.js +5 -1
- package/build/esm/sub-blocks/Quote/Quote.css +10 -10
- package/build/esm/sub-blocks/Quote/Quote.js +3 -3
- package/build/esm/sub-blocks/Quote/schema.d.ts +9 -4
- package/build/esm/sub-blocks/Quote/schema.js +2 -3
- package/build/esm/text-transform/config.js +19 -1
- package/build/esm/text-transform/filter.d.ts +20 -0
- package/build/esm/text-transform/filter.js +56 -0
- package/build/esm/text-transform/index.d.ts +1 -0
- package/build/esm/text-transform/index.js +1 -0
- package/build/esm/text-transform/transformers.d.ts +2 -0
- package/build/esm/text-transform/transformers.js +3 -2
- package/build/esm/text-transform/utils.js +6 -1
- package/build/esm/utils/blocks.d.ts +4 -5
- package/build/esm/utils/blocks.js +41 -1
- package/build/esm/utils/imageCompress.js +1 -1
- package/build/esm/utils/theme.d.ts +1 -1
- package/package.json +87 -24
- package/server/components/constants.d.ts +3 -1
- package/server/components/constants.js +4 -2
- package/server/models/common.d.ts +6 -1
- package/server/models/common.js +6 -1
- package/server/models/constructor-items/blocks.d.ts +17 -13
- package/server/models/constructor-items/common.d.ts +3 -5
- package/server/models/constructor.d.ts +4 -4
- package/server/models/customization.d.ts +5 -7
- package/server/models/navigation.d.ts +4 -2
- package/server/text-transform/config.js +19 -1
- package/server/text-transform/filter.d.ts +20 -0
- package/server/text-transform/filter.js +63 -0
- package/server/text-transform/index.d.ts +1 -0
- package/server/text-transform/index.js +1 -0
- package/server/text-transform/transformers.d.ts +2 -0
- package/server/text-transform/transformers.js +3 -2
- package/server/text-transform/utils.js +6 -1
- package/server/utils/blocks.d.ts +4 -5
- package/server/utils/blocks.js +43 -3
- package/server/utils/theme.d.ts +1 -1
- package/styles/colors/dark.scss +6 -0
- package/styles/colors/light.scss +6 -0
- package/styles/colors/social.scss +10 -0
- package/styles/mixins.scss +27 -29
- package/styles/root.scss +28 -14
- package/styles/storybook/common.scss +6 -6
- package/styles/storybook/palette.scss +6 -6
- package/styles/storybook/typography.scss +46 -46
- package/styles/styles.css +15 -15
- package/styles/variables.scss +0 -8
- package/styles/yfm.scss +12 -12
- package/widget/index.js +1 -0
- package/CHANGELOG.md +0 -1266
- package/build/cjs/context/theme/ThemeProvider.d.ts +0 -22
- package/build/cjs/context/theme/ThemeProvider.js +0 -49
- package/build/cjs/context/theme/ThemeValueContext.d.ts +0 -7
- package/build/cjs/context/theme/ThemeValueContext.js +0 -9
- package/build/cjs/context/theme/useThemeValue.d.ts +0 -2
- package/build/cjs/context/theme/useThemeValue.js +0 -11
- package/build/cjs/editor/Components/AddBlock/AddBlock.d.ts +0 -7
- package/build/cjs/editor/Components/EditBlock/EditBlock.d.ts +0 -4
- package/build/cjs/editor/Components/EditBlock/EditBlock.js +0 -32
- package/build/cjs/editor/Containers/Editor.d.ts +0 -2
- package/build/cjs/editor/Containers/Editor.js +0 -24
- package/build/cjs/navigation/components/Header/Header.css +0 -98
- package/build/cjs/navigation/components/Header/Header.d.ts +0 -8
- package/build/cjs/navigation/components/Header/Header.js +0 -68
- package/build/cjs/navigation/components/NavigationDropdownItem/NavigationDropdownItem.d.ts +0 -11
- package/build/cjs/navigation/components/NavigationDropdownItem/NavigationDropdownItem.js +0 -15
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.css +0 -27
- package/build/cjs/navigation/constants.d.ts +0 -6
- package/build/esm/context/theme/ThemeProvider.d.ts +0 -22
- package/build/esm/context/theme/ThemeProvider.js +0 -44
- package/build/esm/context/theme/ThemeValueContext.d.ts +0 -7
- package/build/esm/context/theme/ThemeValueContext.js +0 -5
- package/build/esm/context/theme/useThemeValue.d.ts +0 -2
- package/build/esm/context/theme/useThemeValue.js +0 -6
- package/build/esm/editor/Components/AddBlock/AddBlock.d.ts +0 -8
- package/build/esm/editor/Components/EditBlock/EditBlock.d.ts +0 -5
- package/build/esm/editor/Components/EditBlock/EditBlock.js +0 -30
- package/build/esm/editor/Containers/Editor.d.ts +0 -2
- package/build/esm/editor/Containers/Editor.js +0 -20
- package/build/esm/navigation/components/Header/Header.css +0 -98
- package/build/esm/navigation/components/Header/Header.d.ts +0 -9
- package/build/esm/navigation/components/Header/Header.js +0 -64
- package/build/esm/navigation/components/NavigationDropdownItem/NavigationDropdownItem.d.ts +0 -11
- package/build/esm/navigation/components/NavigationDropdownItem/NavigationDropdownItem.js +0 -13
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.css +0 -27
- package/build/esm/navigation/constants.d.ts +0 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ObjectIndependentInputProps } from '@gravity-ui/dynamic-forms';
|
|
3
|
+
import './OneOfCustom.css';
|
|
4
|
+
/**
|
|
5
|
+
* Customization of @gravity-ui/dynamic-forms OneOf component
|
|
6
|
+
*
|
|
7
|
+
* Main differences from original component:
|
|
8
|
+
*
|
|
9
|
+
* 1. Custom component can detect initial data type by it's json schema passed it __schema property of spec and
|
|
10
|
+
* shows according input
|
|
11
|
+
*
|
|
12
|
+
* 2. Custom component doesn't create additional nested level of data for each OneOf option and doesn't wraps data value, e.g.
|
|
13
|
+
*
|
|
14
|
+
* custom component: {propertyName: propertyValue}
|
|
15
|
+
* original component: {propertyName: {option1: {value: propertyValue}}}
|
|
16
|
+
*
|
|
17
|
+
* @param {ObjectIndependentInputProps} props - props of original OneOf component
|
|
18
|
+
* @returns {React.FC<ObjectIndependentInputProps>}
|
|
19
|
+
*/
|
|
20
|
+
export declare const OneOfCustom: React.FC<ObjectIndependentInputProps>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Controller, GroupIndent, SpecTypes, transformArrOut, } from '@gravity-ui/dynamic-forms';
|
|
3
|
+
import Ajv from 'ajv';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { block } from '../../../../utils';
|
|
6
|
+
import { getSpecTypeDefaultValue, useOneOf } from '../../hooks/useOneOf';
|
|
7
|
+
import './OneOfCustom.css';
|
|
8
|
+
const b = block('one-of-custom');
|
|
9
|
+
const ajv = new Ajv({
|
|
10
|
+
$data: true,
|
|
11
|
+
strict: false,
|
|
12
|
+
strictSchema: false,
|
|
13
|
+
strictTypes: false,
|
|
14
|
+
strictRequired: false,
|
|
15
|
+
});
|
|
16
|
+
const getOneOfCustomSpecDefaultType = (spec) => { var _a, _b; return ((_b = (_a = spec.viewSpec) === null || _a === void 0 ? void 0 : _a.order) === null || _b === void 0 ? void 0 : _b[0]) || Object.keys(spec.properties || {})[0]; };
|
|
17
|
+
// dynamic-forms pass {} as default value for required properties of all types
|
|
18
|
+
// this function replaces {} with default value accordingly to selected OneOf option spec type
|
|
19
|
+
const getControllerDefautValue = (value, valueSpecType) => {
|
|
20
|
+
const isDefaultValue = typeof value === 'object' && _.isEmpty(value);
|
|
21
|
+
const defaultValue = valueSpecType ? getSpecTypeDefaultValue(valueSpecType) : undefined;
|
|
22
|
+
return isDefaultValue ? defaultValue : value;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Customization of @gravity-ui/dynamic-forms OneOf component
|
|
26
|
+
*
|
|
27
|
+
* Main differences from original component:
|
|
28
|
+
*
|
|
29
|
+
* 1. Custom component can detect initial data type by it's json schema passed it __schema property of spec and
|
|
30
|
+
* shows according input
|
|
31
|
+
*
|
|
32
|
+
* 2. Custom component doesn't create additional nested level of data for each OneOf option and doesn't wraps data value, e.g.
|
|
33
|
+
*
|
|
34
|
+
* custom component: {propertyName: propertyValue}
|
|
35
|
+
* original component: {propertyName: {option1: {value: propertyValue}}}
|
|
36
|
+
*
|
|
37
|
+
* @param {ObjectIndependentInputProps} props - props of original OneOf component
|
|
38
|
+
* @returns {React.FC<ObjectIndependentInputProps>}
|
|
39
|
+
*/
|
|
40
|
+
export const OneOfCustom = (props) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const { spec, input, name } = props;
|
|
43
|
+
const { properties } = spec;
|
|
44
|
+
//getting oneOf option type from initial value
|
|
45
|
+
const valueType = useMemo(() => {
|
|
46
|
+
var _a;
|
|
47
|
+
return (properties &&
|
|
48
|
+
((_a = Object.keys(properties)) === null || _a === void 0 ? void 0 : _a.find((key) => {
|
|
49
|
+
const fieldSchema = (properties === null || properties === void 0 ? void 0 : properties[key]).__schema;
|
|
50
|
+
return fieldSchema && ajv.validate(fieldSchema, transformArrOut(input.value));
|
|
51
|
+
}))) ||
|
|
52
|
+
getOneOfCustomSpecDefaultType(spec);
|
|
53
|
+
},
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
[]);
|
|
56
|
+
const { oneOfValue, specProperties, toggler } = useOneOf({
|
|
57
|
+
props: Object.assign(Object.assign({}, props), { input: Object.assign(Object.assign({}, input), { value: valueType ? { [valueType]: input.value } : input.value }) }),
|
|
58
|
+
});
|
|
59
|
+
const parentOnChange = React.useCallback((_childName, childValue, childErrors) => {
|
|
60
|
+
input.onChange(childValue, childErrors);
|
|
61
|
+
}, [input]);
|
|
62
|
+
const parentOnUnmount = React.useCallback((childName) => input.onChange((currentValue) => currentValue, { [childName]: false }), [input]);
|
|
63
|
+
const valueSpecType = ((_a = specProperties[oneOfValue]) === null || _a === void 0 ? void 0 : _a.type) || SpecTypes.Object;
|
|
64
|
+
return (React.createElement("div", { className: b() },
|
|
65
|
+
React.createElement("div", null, toggler),
|
|
66
|
+
specProperties[oneOfValue] && (React.createElement(GroupIndent, null,
|
|
67
|
+
React.createElement(Controller, { value: getControllerDefautValue(input.value, valueSpecType), name: name, spec: specProperties[oneOfValue], parentOnChange: parentOnChange, parentOnUnmount: parentOnUnmount, key: `${name}.${oneOfValue}` })))));
|
|
68
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dynamicConfig as libConfig } from '@gravity-ui/dynamic-forms';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { OneOfCustom } from './components/OneOfCustom/OneOfCustom';
|
|
4
|
+
const getDynamicConfig = () => {
|
|
5
|
+
const dynamicConfig = _.cloneDeep(libConfig);
|
|
6
|
+
dynamicConfig.object.inputs['oneof_custom'] = { Component: OneOfCustom, independent: true };
|
|
7
|
+
return dynamicConfig;
|
|
8
|
+
};
|
|
9
|
+
export const dynamicConfig = getDynamicConfig();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ObjectIndependentInputProps, Spec, SpecTypes } from '@gravity-ui/dynamic-forms';
|
|
2
|
+
export interface UseOneOfParams {
|
|
3
|
+
props: ObjectIndependentInputProps;
|
|
4
|
+
onTogglerChange?: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const getSpecTypeDefaultValue: (type: SpecTypes) => {} | undefined;
|
|
7
|
+
export declare const useOneOf: ({ props, onTogglerChange }: UseOneOfParams) => {
|
|
8
|
+
oneOfValue: string;
|
|
9
|
+
specProperties: Record<string, Spec>;
|
|
10
|
+
toggler: JSX.Element;
|
|
11
|
+
togglerInput: JSX.Element;
|
|
12
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpecTypes, } from '@gravity-ui/dynamic-forms';
|
|
3
|
+
import { RadioButton, Select } from '@gravity-ui/uikit';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
const MAX_TAB_TITLE_LENGTH = 20;
|
|
6
|
+
export const getSpecTypeDefaultValue = (type) => {
|
|
7
|
+
switch (type) {
|
|
8
|
+
case SpecTypes.Array:
|
|
9
|
+
return [];
|
|
10
|
+
case SpecTypes.Boolean:
|
|
11
|
+
case SpecTypes.Number:
|
|
12
|
+
case SpecTypes.String:
|
|
13
|
+
return undefined;
|
|
14
|
+
default:
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export const useOneOf = ({ props, onTogglerChange }) => {
|
|
19
|
+
const { name, input, spec, Layout } = props;
|
|
20
|
+
const { order, disabled, oneOfParams } = spec.viewSpec;
|
|
21
|
+
const specProperties = React.useMemo(() => (_.isObjectLike(spec.properties) ? spec.properties : {}), [spec.properties]);
|
|
22
|
+
const [oneOfValue, setOneOfValue] = React.useState(() => {
|
|
23
|
+
let valueKeys;
|
|
24
|
+
if (_.isObjectLike(input.value)) {
|
|
25
|
+
const keys = Object.keys(input.value);
|
|
26
|
+
if (keys.length) {
|
|
27
|
+
valueKeys = keys;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (valueKeys || order || Object.keys(specProperties))[0];
|
|
31
|
+
});
|
|
32
|
+
const onOneOfChange = React.useCallback(([newValue]) => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (newValue !== oneOfValue) {
|
|
35
|
+
const specType = ((_a = specProperties[newValue]) === null || _a === void 0 ? void 0 : _a.type) || SpecTypes.Object;
|
|
36
|
+
input.onChange(getSpecTypeDefaultValue(specType));
|
|
37
|
+
setOneOfValue(newValue);
|
|
38
|
+
onTogglerChange === null || onTogglerChange === void 0 ? void 0 : onTogglerChange(newValue);
|
|
39
|
+
}
|
|
40
|
+
}, [setOneOfValue, input, oneOfValue, specProperties, onTogglerChange]);
|
|
41
|
+
const options = React.useMemo(() => (order || Object.keys(specProperties)).map((value) => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
const title = ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[value]) ||
|
|
44
|
+
((_b = specProperties[value]) === null || _b === void 0 ? void 0 : _b.viewSpec.layoutTitle) ||
|
|
45
|
+
value ||
|
|
46
|
+
'';
|
|
47
|
+
return {
|
|
48
|
+
value,
|
|
49
|
+
title,
|
|
50
|
+
content: title,
|
|
51
|
+
};
|
|
52
|
+
}), [spec.description, order, specProperties]);
|
|
53
|
+
const togglerInput = React.useMemo(() => {
|
|
54
|
+
if ((oneOfParams === null || oneOfParams === void 0 ? void 0 : oneOfParams.toggler) !== 'radio' &&
|
|
55
|
+
((oneOfParams === null || oneOfParams === void 0 ? void 0 : oneOfParams.toggler) === 'select' ||
|
|
56
|
+
options.length > 3 ||
|
|
57
|
+
_.some(options, ({ title }) => title.length > MAX_TAB_TITLE_LENGTH))) {
|
|
58
|
+
return (React.createElement(Select, { width: "max", value: [oneOfValue], onUpdate: onOneOfChange, options: options, disabled: disabled, filterable: options.length > 7, qa: name }));
|
|
59
|
+
}
|
|
60
|
+
return (React.createElement(RadioButton, { value: oneOfValue, onChange: (event) => onOneOfChange([event.target.value]), disabled: disabled, qa: name }, options.map(({ value, title }) => (React.createElement(RadioButton.Option, { key: value, value: value }, title)))));
|
|
61
|
+
}, [options, oneOfValue, onOneOfChange, name, oneOfParams === null || oneOfParams === void 0 ? void 0 : oneOfParams.toggler, disabled]);
|
|
62
|
+
const toggler = React.useMemo(() => {
|
|
63
|
+
if (Layout) {
|
|
64
|
+
return React.createElement(Layout, Object.assign({}, props), togglerInput);
|
|
65
|
+
}
|
|
66
|
+
return togglerInput;
|
|
67
|
+
}, [Layout, togglerInput, props]);
|
|
68
|
+
return { oneOfValue, specProperties, toggler, togglerInput };
|
|
69
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SpecTypes } from '@gravity-ui/dynamic-forms';
|
|
2
|
+
export var ParserType;
|
|
3
|
+
(function (ParserType) {
|
|
4
|
+
ParserType["Object"] = "object";
|
|
5
|
+
ParserType["Array"] = "array";
|
|
6
|
+
ParserType["Children"] = "children";
|
|
7
|
+
ParserType["OneOf"] = "oneOf";
|
|
8
|
+
ParserType["Primitive"] = "primitive";
|
|
9
|
+
})(ParserType || (ParserType = {}));
|
|
10
|
+
const isOneOf = (data) => 'oneOf' in data;
|
|
11
|
+
const isObject = (data) => 'properties' in data;
|
|
12
|
+
const isArray = (data) => 'type' in data && data.type === SpecTypes.Array;
|
|
13
|
+
const isChildren = (data) => 'type' in data &&
|
|
14
|
+
data.type === SpecTypes.Array &&
|
|
15
|
+
'items' in data &&
|
|
16
|
+
typeof data.items !== 'undefined' &&
|
|
17
|
+
'$ref' in data.items;
|
|
18
|
+
//detector applying order matters!
|
|
19
|
+
const ParserTypeDetectors = [
|
|
20
|
+
{ type: ParserType.OneOf, detector: isOneOf },
|
|
21
|
+
{ type: ParserType.Children, detector: isChildren },
|
|
22
|
+
{ type: ParserType.Object, detector: isObject },
|
|
23
|
+
{ type: ParserType.Array, detector: isArray },
|
|
24
|
+
];
|
|
25
|
+
export const detectParserType = (data) => {
|
|
26
|
+
for (const { type, detector } of ParserTypeDetectors) {
|
|
27
|
+
if (detector(data)) {
|
|
28
|
+
return type;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return ParserType.Primitive;
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema } from '../../../schema';
|
|
2
|
+
import { FormSpecs } from './types';
|
|
3
|
+
declare class FormSpecParser {
|
|
4
|
+
private schema;
|
|
5
|
+
private definitions;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms page-constructor json schema into dynamic-forms specs for each block
|
|
8
|
+
*
|
|
9
|
+
* @param schema {Schema} - page-constructor json schema
|
|
10
|
+
* @returns {FormSpecs} - object containig dynamic-forms specs for each constructor block
|
|
11
|
+
*/
|
|
12
|
+
parse(schema: Schema): FormSpecs;
|
|
13
|
+
private getChildrenSpec;
|
|
14
|
+
private getRequiredProperties;
|
|
15
|
+
private childrenParser;
|
|
16
|
+
private oneOfParser;
|
|
17
|
+
private arrayParser;
|
|
18
|
+
private objectParser;
|
|
19
|
+
private primitiveParser;
|
|
20
|
+
private schemaParserMap;
|
|
21
|
+
private parseSchemaProperty;
|
|
22
|
+
private getBlocksSpec;
|
|
23
|
+
private getPageSpec;
|
|
24
|
+
private getFormSpec;
|
|
25
|
+
private init;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: FormSpecParser;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
/* eslint-disable no-param-reassign */
|
|
3
|
+
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
4
|
+
import { SpecTypes } from '@gravity-ui/dynamic-forms';
|
|
5
|
+
import { ParserType, detectParserType } from './detect';
|
|
6
|
+
import { getArrayViewSpec, getObjectViewSpec, getOneOfViewSpec, getPrimitiveViewSpec } from './views';
|
|
7
|
+
class FormSpecParser {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.schema = {};
|
|
10
|
+
this.definitions = {};
|
|
11
|
+
this.getChildrenSpec = (data) => {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
const childrenType = (_c = (_b = (_a = data.items) === null || _a === void 0 ? void 0 : _a.$ref) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop();
|
|
14
|
+
return this.definitions[childrenType];
|
|
15
|
+
};
|
|
16
|
+
this.getRequiredProperties = (data) => Array.isArray(data.required) ? data.required : [];
|
|
17
|
+
this.childrenParser = ({ data, name, required }) => {
|
|
18
|
+
const childSpec = this.getChildrenSpec(data);
|
|
19
|
+
const properties = childSpec &&
|
|
20
|
+
Object.entries(childSpec).reduce((parsedChildSpecProperties, [childName, childSchema]) => {
|
|
21
|
+
const childRequiredProperties = this.getRequiredProperties(childSchema);
|
|
22
|
+
const childProperies = childSchema.properties &&
|
|
23
|
+
Object.entries(childSchema.properties).reduce((parsedChildProperties, [childPropertyName, childPropertyData]) => {
|
|
24
|
+
parsedChildProperties[childPropertyName] = this.parseSchemaProperty({
|
|
25
|
+
data: childPropertyData,
|
|
26
|
+
name: childPropertyName,
|
|
27
|
+
required: childRequiredProperties.includes(childPropertyName),
|
|
28
|
+
});
|
|
29
|
+
return parsedChildProperties;
|
|
30
|
+
}, {});
|
|
31
|
+
const childJsonSchema = Object.assign(Object.assign({}, childSchema), { properties: Object.assign(Object.assign({}, childSchema.properties), { type: {
|
|
32
|
+
type: SpecTypes.String,
|
|
33
|
+
enum: [childName],
|
|
34
|
+
} }) });
|
|
35
|
+
parsedChildSpecProperties[childName] = {
|
|
36
|
+
type: SpecTypes.Array,
|
|
37
|
+
items: Object.assign(Object.assign({}, childSchema), { type: SpecTypes.Object, properties: Object.assign(Object.assign({}, childProperies), { type: {
|
|
38
|
+
type: SpecTypes.String,
|
|
39
|
+
defaultValue: childName,
|
|
40
|
+
viewSpec: {
|
|
41
|
+
type: 'hidden',
|
|
42
|
+
},
|
|
43
|
+
} }), viewSpec: childProperies &&
|
|
44
|
+
getObjectViewSpec({
|
|
45
|
+
properties: childProperies,
|
|
46
|
+
layoutTitle: childName,
|
|
47
|
+
}), __schema: childJsonSchema }),
|
|
48
|
+
required: false,
|
|
49
|
+
viewSpec: getArrayViewSpec({ layoutTitle: childName }),
|
|
50
|
+
__schema: {
|
|
51
|
+
type: SpecTypes.Array,
|
|
52
|
+
items: childJsonSchema,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
return parsedChildSpecProperties;
|
|
56
|
+
}, {});
|
|
57
|
+
return {
|
|
58
|
+
type: SpecTypes.Object,
|
|
59
|
+
properties,
|
|
60
|
+
viewSpec: {
|
|
61
|
+
type: 'oneof_custom',
|
|
62
|
+
layout: 'row',
|
|
63
|
+
layoutTitle: name,
|
|
64
|
+
oneOfParams: {
|
|
65
|
+
toggler: 'select',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
required,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
this.oneOfParser = ({ data, name, required }) => {
|
|
72
|
+
const requiredProperties = this.getRequiredProperties(data);
|
|
73
|
+
const properties = data.oneOf &&
|
|
74
|
+
data.oneOf.reduce((result, propertyData, index) => {
|
|
75
|
+
const propertyName = (propertyData === null || propertyData === void 0 ? void 0 : propertyData.optionName)
|
|
76
|
+
? propertyData === null || propertyData === void 0 ? void 0 : propertyData.optionName
|
|
77
|
+
: `${name}_${index}`;
|
|
78
|
+
result[propertyName] = this.parseSchemaProperty({
|
|
79
|
+
data: propertyData,
|
|
80
|
+
name: propertyName,
|
|
81
|
+
required: requiredProperties.includes(propertyName),
|
|
82
|
+
});
|
|
83
|
+
return result;
|
|
84
|
+
}, {});
|
|
85
|
+
return {
|
|
86
|
+
type: SpecTypes.Object,
|
|
87
|
+
properties,
|
|
88
|
+
required,
|
|
89
|
+
viewSpec: getOneOfViewSpec({ layoutTitle: name }),
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
this.arrayParser = ({ data, name }) => {
|
|
93
|
+
const items = data.items && this.parseSchemaProperty({ data: data.items, name });
|
|
94
|
+
return Object.assign(Object.assign({}, data), { type: SpecTypes.Array, items, viewSpec: getArrayViewSpec({ layoutTitle: name }) });
|
|
95
|
+
};
|
|
96
|
+
this.objectParser = ({ data, name, required }) => {
|
|
97
|
+
const requiredProperties = this.getRequiredProperties(data);
|
|
98
|
+
const properties = data.properties &&
|
|
99
|
+
Object.entries(data.properties).reduce((result, [propertyName, propertyData]) => {
|
|
100
|
+
result[propertyName] = this.parseSchemaProperty({
|
|
101
|
+
data: propertyData,
|
|
102
|
+
name: propertyName,
|
|
103
|
+
required: requiredProperties.includes(propertyName),
|
|
104
|
+
});
|
|
105
|
+
return result;
|
|
106
|
+
}, {});
|
|
107
|
+
return Object.assign(Object.assign({}, data), { type: SpecTypes.Object, properties, viewSpec: getObjectViewSpec({ properties, layoutTitle: name }), required });
|
|
108
|
+
};
|
|
109
|
+
this.primitiveParser = ({ data, name, required }) => {
|
|
110
|
+
return Object.assign(Object.assign({}, data), { type: data.type, required, defaultValue: data.default, viewSpec: getPrimitiveViewSpec({ layoutTitle: name, data }), validator: 'base' });
|
|
111
|
+
};
|
|
112
|
+
//eslint-disable-next-line @typescript-eslint/member-ordering
|
|
113
|
+
this.schemaParserMap = {
|
|
114
|
+
[ParserType.Object]: this.objectParser,
|
|
115
|
+
[ParserType.Array]: this.arrayParser,
|
|
116
|
+
[ParserType.Primitive]: this.primitiveParser,
|
|
117
|
+
[ParserType.OneOf]: this.oneOfParser,
|
|
118
|
+
[ParserType.Children]: this.childrenParser,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Transforms page-constructor json schema into dynamic-forms specs for each block
|
|
123
|
+
*
|
|
124
|
+
* @param schema {Schema} - page-constructor json schema
|
|
125
|
+
* @returns {FormSpecs} - object containig dynamic-forms specs for each constructor block
|
|
126
|
+
*/
|
|
127
|
+
parse(schema) {
|
|
128
|
+
this.init(schema);
|
|
129
|
+
return this.getFormSpec();
|
|
130
|
+
}
|
|
131
|
+
parseSchemaProperty({ data, name, required }) {
|
|
132
|
+
const parserType = detectParserType(data);
|
|
133
|
+
const parser = this.schemaParserMap[parserType];
|
|
134
|
+
return Object.assign(Object.assign({}, parser({ data, name, required })), {
|
|
135
|
+
//save json schema from constructor to compare with incoming intial data inside oneOf form fields
|
|
136
|
+
__schema: data });
|
|
137
|
+
}
|
|
138
|
+
getBlocksSpec() {
|
|
139
|
+
const blocks = this.definitions.children;
|
|
140
|
+
return Object.entries(blocks).reduce((result, [blockName, blockData]) => {
|
|
141
|
+
result[blockName] = this.parseSchemaProperty({
|
|
142
|
+
name: blockName,
|
|
143
|
+
data: Object.assign({}, blockData),
|
|
144
|
+
required: true,
|
|
145
|
+
});
|
|
146
|
+
return result;
|
|
147
|
+
}, {});
|
|
148
|
+
}
|
|
149
|
+
getPageSpec() {
|
|
150
|
+
var _a;
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
152
|
+
const _b = ((_a = this.schema) === null || _a === void 0 ? void 0 : _a.properties) || {}, { blocks } = _b, pageSchema = __rest(_b, ["blocks"]);
|
|
153
|
+
const requiredProperties = this.getRequiredProperties(this.schema);
|
|
154
|
+
const properties = Object.entries(pageSchema).reduce((result, [propertyName, propertyData]) => {
|
|
155
|
+
result[propertyName] = this.parseSchemaProperty({
|
|
156
|
+
name: propertyName,
|
|
157
|
+
data: propertyData,
|
|
158
|
+
required: requiredProperties.includes(propertyName),
|
|
159
|
+
});
|
|
160
|
+
return result;
|
|
161
|
+
}, {});
|
|
162
|
+
return {
|
|
163
|
+
type: SpecTypes.Object,
|
|
164
|
+
properties,
|
|
165
|
+
viewSpec: getObjectViewSpec({ properties, layout: 'section' }),
|
|
166
|
+
required: true,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
getFormSpec() {
|
|
170
|
+
return {
|
|
171
|
+
blocks: this.getBlocksSpec(),
|
|
172
|
+
page: this.getPageSpec(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
init(schema) {
|
|
176
|
+
this.schema = schema;
|
|
177
|
+
if (schema.definitions) {
|
|
178
|
+
this.definitions = Object.entries(schema.definitions).reduce((result, [childType, childSpec]) => {
|
|
179
|
+
result[childType] = childSpec === null || childSpec === void 0 ? void 0 : childSpec.selectCases;
|
|
180
|
+
return result;
|
|
181
|
+
}, {});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
export default new FormSpecParser();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Spec as DynamicFormSpec, ObjectSpec } from '@gravity-ui/dynamic-forms';
|
|
2
|
+
import { Schema } from '../../../schema';
|
|
3
|
+
export type OneOfSpec = {
|
|
4
|
+
oneOf: DynamicFormSpec[];
|
|
5
|
+
viewSpec: ObjectSpec['viewSpec'];
|
|
6
|
+
};
|
|
7
|
+
export type CustomObjectSpec = Omit<ObjectSpec, 'properties'> & {
|
|
8
|
+
properties: Record<string, CustomSpec>;
|
|
9
|
+
};
|
|
10
|
+
export interface SpecCustomProps {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
inputType?: string;
|
|
13
|
+
__schema?: Schema;
|
|
14
|
+
}
|
|
15
|
+
export type Spec = Exclude<DynamicFormSpec, 'ObjectSpec'> | CustomObjectSpec | OneOfSpec;
|
|
16
|
+
export type CustomSpec = Spec & SpecCustomProps;
|
|
17
|
+
export type BlocksSpec = Record<string, CustomSpec>;
|
|
18
|
+
export type PageSpec = CustomSpec;
|
|
19
|
+
export interface FormSpecs {
|
|
20
|
+
blocks: BlocksSpec;
|
|
21
|
+
page: PageSpec;
|
|
22
|
+
}
|
|
23
|
+
export interface SchemaParserParams {
|
|
24
|
+
data: Schema;
|
|
25
|
+
name: string;
|
|
26
|
+
required?: Schema['required'];
|
|
27
|
+
}
|
|
28
|
+
export type SchemaParser = (params: SchemaParserParams) => CustomSpec;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Schema } from '../../../schema';
|
|
2
|
+
import { CustomObjectSpec, CustomSpec } from './types';
|
|
3
|
+
interface BaseParams {
|
|
4
|
+
layoutTitle?: string;
|
|
5
|
+
}
|
|
6
|
+
interface GetObjectViewSpecParams extends BaseParams, Partial<Extract<CustomSpec, CustomObjectSpec>> {
|
|
7
|
+
layout?: string;
|
|
8
|
+
}
|
|
9
|
+
type GetPrimitiveViewSpecParams = BaseParams & Schema;
|
|
10
|
+
export declare const getOneOfViewSpec: ({ layoutTitle }: BaseParams) => {
|
|
11
|
+
type: string;
|
|
12
|
+
layout: string;
|
|
13
|
+
layoutTitle: string | undefined;
|
|
14
|
+
oneOfParams: {
|
|
15
|
+
toggler: "select";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const getObjectViewSpec: ({ properties, disabled, layoutTitle, layout, }: GetObjectViewSpecParams) => {
|
|
19
|
+
layoutTitle: string | undefined;
|
|
20
|
+
type: string;
|
|
21
|
+
layout: string;
|
|
22
|
+
order: string[] | undefined;
|
|
23
|
+
disabled: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const getArrayViewSpec: ({ layoutTitle }: BaseParams) => {
|
|
26
|
+
layoutTitle: string | undefined;
|
|
27
|
+
type: string;
|
|
28
|
+
layout: string;
|
|
29
|
+
layoutOpen: boolean;
|
|
30
|
+
itemLabel: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const getPrimitiveViewSpec: ({ layoutTitle, ...data }: GetPrimitiveViewSpecParams) => {
|
|
33
|
+
layout: string;
|
|
34
|
+
type: any;
|
|
35
|
+
layoutTitle: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
export const getOneOfViewSpec = ({ layoutTitle }) => {
|
|
3
|
+
return {
|
|
4
|
+
type: 'oneof_custom',
|
|
5
|
+
layout: 'row',
|
|
6
|
+
layoutTitle,
|
|
7
|
+
oneOfParams: {
|
|
8
|
+
toggler: 'select',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export const getObjectViewSpec = ({ properties, disabled, layoutTitle, layout = 'accordeon', }) => {
|
|
13
|
+
return {
|
|
14
|
+
layoutTitle,
|
|
15
|
+
type: 'base',
|
|
16
|
+
layout,
|
|
17
|
+
order: properties && Object.keys(properties).sort(),
|
|
18
|
+
disabled,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export const getArrayViewSpec = ({ layoutTitle }) => ({
|
|
22
|
+
layoutTitle,
|
|
23
|
+
type: 'base',
|
|
24
|
+
layout: 'accordeon',
|
|
25
|
+
layoutOpen: true,
|
|
26
|
+
itemLabel: 'Add Item',
|
|
27
|
+
});
|
|
28
|
+
export const getPrimitiveViewSpec = (_a) => {
|
|
29
|
+
var { layoutTitle } = _a, data = __rest(_a, ["layoutTitle"]);
|
|
30
|
+
let type = (data === null || data === void 0 ? void 0 : data.inputType) || 'base';
|
|
31
|
+
if (data && 'enum' in data && data.enum) {
|
|
32
|
+
type = 'select';
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
layout: 'row',
|
|
36
|
+
type,
|
|
37
|
+
layoutTitle,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { generateDefaultSchema } from '../../schema';
|
|
3
|
+
import formSpecParser from '../dynamic-forms-custom/parser';
|
|
4
|
+
export default function useFormSpec(customSchema) {
|
|
5
|
+
return useMemo(() => {
|
|
6
|
+
const schema = generateDefaultSchema(customSchema);
|
|
7
|
+
return formSpecParser.parse(schema);
|
|
8
|
+
}, [customSchema]);
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function usePreviousValue<T>(value: T): T | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { a11yHiddenSvgProps } from '../../utils/svg';
|
|
3
|
+
export const Tablet = (props) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "12", height: "14", viewBox: "0 0 12 14", fill: "none" }, a11yHiddenSvgProps, props),
|
|
4
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.5 3L10.5 11C10.5 11.8284 9.82843 12.5 9 12.5L3 12.5C2.17157 12.5 1.5 11.8284 1.5 11L1.5 3C1.5 2.17157 2.17157 1.5 3 1.5L9 1.5C9.82843 1.5 10.5 2.17157 10.5 3ZM9 -1.31134e-07C10.6569 -5.87108e-08 12 1.34315 12 3L12 11C12 12.6569 10.6569 14 9 14L3 14C1.34315 14 4.00426e-07 12.6569 4.72849e-07 11L8.2254e-07 3C8.94964e-07 1.34315 1.34315 -4.65826e-07 3 -3.93403e-07L9 -1.31134e-07ZM3.75 9.5C3.33579 9.5 3 9.83579 3 10.25C3 10.6642 3.33579 11 3.75 11L8.25 11C8.66421 11 9 10.6642 9 10.25C9 9.83579 8.66421 9.5 8.25 9.5L3.75 9.5Z", fill: "currentColor", fillOpacity: "0.85" })));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Editor } from './
|
|
1
|
+
export { Editor } from './containers/Editor/Editor';
|
|
2
2
|
export * from './types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Editor } from './
|
|
1
|
+
export { Editor } from './containers/Editor/Editor';
|
|
2
2
|
export * from './types';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Block } from '../../models';
|
|
2
|
-
import { EditorProps } from '../types';
|
|
1
|
+
import { Block, BlockDecorationProps, PageContent, Theme } from '../../models';
|
|
2
|
+
import { EditBlockProps, EditorProps, ViewModeItem } from '../types';
|
|
3
3
|
export type EditorBlockId = number | string;
|
|
4
4
|
export declare function useEditorState({ content: intialContent, custom }: Omit<EditorProps, 'children'>): {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onCopy: (index: number) => void;
|
|
12
|
-
onOrderChange: (oldIndex: number, newIndex: number) => void;
|
|
13
|
-
};
|
|
5
|
+
activeBlockIndex: number;
|
|
6
|
+
content: PageContent;
|
|
7
|
+
errorBoundaryState: number;
|
|
8
|
+
viewMode: ViewModeItem;
|
|
9
|
+
theme: Theme;
|
|
10
|
+
injectEditBlockProps: ({ type, index: relativeIndex, children, ...rest }: BlockDecorationProps) => EditBlockProps;
|
|
14
11
|
onAdd: (block: Block) => void;
|
|
12
|
+
onSelect: (index: number) => void;
|
|
13
|
+
onContentUpdate: (newContent: PageContent) => void;
|
|
14
|
+
onViewModeUpdate: (newViewMode: ViewModeItem) => void;
|
|
15
|
+
onThemeUpdate: (newTheme: Theme) => void;
|
|
15
16
|
};
|