@gravity-ui/page-constructor 6.1.0 → 6.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/Banner/Banner.js +2 -2
- package/build/cjs/blocks/Banner/Banner.js.map +1 -1
- package/build/cjs/blocks/Banner/schema.js +20 -8
- package/build/cjs/blocks/Banner/schema.js.map +1 -1
- package/build/cjs/blocks/CardLayout/CardLayout.js +2 -2
- package/build/cjs/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/cjs/blocks/CardLayout/schema.js +19 -4
- package/build/cjs/blocks/CardLayout/schema.js.map +1 -1
- package/build/cjs/blocks/Companies/Companies.js +1 -1
- package/build/cjs/blocks/Companies/Companies.js.map +1 -1
- package/build/cjs/blocks/Companies/schema.js +10 -4
- package/build/cjs/blocks/Companies/schema.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +1 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/schema.js +7 -2
- package/build/cjs/blocks/ContentLayout/schema.js.map +1 -1
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +1 -1
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js.map +1 -1
- package/build/cjs/blocks/ExtendedFeatures/schema.js +7 -1
- package/build/cjs/blocks/ExtendedFeatures/schema.js.map +1 -1
- package/build/cjs/blocks/FilterBlock/schema.js +13 -3
- package/build/cjs/blocks/FilterBlock/schema.js.map +1 -1
- package/build/cjs/blocks/Form/Form.js +3 -4
- package/build/cjs/blocks/Form/Form.js.map +1 -1
- package/build/cjs/blocks/Form/schema.js +14 -6
- package/build/cjs/blocks/Form/schema.js.map +1 -1
- package/build/cjs/blocks/Header/Header.js +8 -5
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/blocks/Header/schema.js +9 -2
- package/build/cjs/blocks/Header/schema.js.map +1 -1
- package/build/cjs/blocks/HeaderSlider/HeaderSlider.js +2 -3
- package/build/cjs/blocks/HeaderSlider/HeaderSlider.js.map +1 -1
- package/build/cjs/blocks/HeaderSlider/schema.js +6 -2
- package/build/cjs/blocks/HeaderSlider/schema.js.map +1 -1
- package/build/cjs/blocks/Icons/Icons.js +2 -2
- package/build/cjs/blocks/Icons/Icons.js.map +1 -1
- package/build/cjs/blocks/Icons/schema.js +17 -6
- package/build/cjs/blocks/Icons/schema.js.map +1 -1
- package/build/cjs/blocks/Info/Info.js +8 -4
- package/build/cjs/blocks/Info/Info.js.map +1 -1
- package/build/cjs/blocks/Info/schema.js +14 -4
- package/build/cjs/blocks/Info/schema.js.map +1 -1
- package/build/cjs/blocks/Map/Map.js +2 -3
- package/build/cjs/blocks/Map/Map.js.map +1 -1
- package/build/cjs/blocks/Map/schema.js +4 -1
- package/build/cjs/blocks/Map/schema.js.map +1 -1
- package/build/cjs/blocks/Media/Media.js +1 -1
- package/build/cjs/blocks/Media/Media.js.map +1 -1
- package/build/cjs/blocks/Media/schema.js +24 -9
- package/build/cjs/blocks/Media/schema.js.map +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js.map +1 -1
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +8 -2
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js.map +1 -1
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -1
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js.map +1 -1
- package/build/cjs/blocks/Questions/schema.js +6 -2
- package/build/cjs/blocks/Questions/schema.js.map +1 -1
- package/build/cjs/blocks/Share/schema.js +7 -3
- package/build/cjs/blocks/Share/schema.js.map +1 -1
- package/build/cjs/blocks/Slider/Slider.js +15 -14
- package/build/cjs/blocks/Slider/Slider.js.map +1 -1
- package/build/cjs/blocks/Slider/schema.js +6 -1
- package/build/cjs/blocks/Slider/schema.js.map +1 -1
- package/build/cjs/blocks/Slider/utils.js +8 -5
- package/build/cjs/blocks/Slider/utils.js.map +1 -1
- package/build/cjs/blocks/SliderNew/Arrow/Arrow.js +1 -1
- package/build/cjs/blocks/SliderNew/Arrow/Arrow.js.map +1 -1
- package/build/cjs/blocks/SliderNew/Slider.js +5 -5
- package/build/cjs/blocks/SliderNew/Slider.js.map +1 -1
- package/build/cjs/blocks/SliderNew/schema.js +6 -1
- package/build/cjs/blocks/SliderNew/schema.js.map +1 -1
- package/build/cjs/blocks/SliderNew/useSlider.js +1 -2
- package/build/cjs/blocks/SliderNew/useSlider.js.map +1 -1
- package/build/cjs/blocks/SliderNew/utils.js +6 -2
- package/build/cjs/blocks/SliderNew/utils.js.map +1 -1
- package/build/cjs/blocks/Table/Table.js +1 -1
- package/build/cjs/blocks/Table/Table.js.map +1 -1
- package/build/cjs/blocks/Table/schema.js +22 -10
- package/build/cjs/blocks/Table/schema.js.map +1 -1
- package/build/cjs/blocks/Tabs/Tabs.js +16 -18
- package/build/cjs/blocks/Tabs/Tabs.js.map +1 -1
- package/build/cjs/blocks/Tabs/schema.js +24 -9
- package/build/cjs/blocks/Tabs/schema.js.map +1 -1
- package/build/cjs/components/Author/Author.js +1 -1
- package/build/cjs/components/Author/Author.js.map +1 -1
- package/build/cjs/components/Author/schema.js +5 -1
- package/build/cjs/components/Author/schema.js.map +1 -1
- package/build/cjs/components/BackLink/BackLink.js +1 -1
- package/build/cjs/components/BackLink/BackLink.js.map +1 -1
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +1 -1
- package/build/cjs/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +4 -4
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js.map +1 -1
- package/build/cjs/components/BalancedMasonry/BalancedMasonry.js +1 -1
- package/build/cjs/components/BalancedMasonry/BalancedMasonry.js.map +1 -1
- package/build/cjs/components/Button/Button.js +9 -5
- package/build/cjs/components/Button/Button.js.map +1 -1
- package/build/cjs/components/Button/utils.js +2 -2
- package/build/cjs/components/Button/utils.js.map +1 -1
- package/build/cjs/components/Buttons/Buttons.js +4 -1
- package/build/cjs/components/Buttons/Buttons.js.map +1 -1
- package/build/cjs/components/CardBase/CardBase.js +6 -2
- package/build/cjs/components/CardBase/CardBase.js.map +1 -1
- package/build/cjs/components/ContentList/ContentList.js +1 -1
- package/build/cjs/components/ContentList/ContentList.js.map +1 -1
- package/build/cjs/components/ContentList/ContentListItemIcon.js +1 -1
- package/build/cjs/components/ContentList/ContentListItemIcon.js.map +1 -1
- package/build/cjs/components/DefaultVideo/DefaultVideo.js +3 -4
- package/build/cjs/components/DefaultVideo/DefaultVideo.js.map +1 -1
- package/build/cjs/components/FileLink/FileLink.js +2 -2
- package/build/cjs/components/FileLink/FileLink.js.map +1 -1
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.js +12 -17
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.js.map +1 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.js.map +1 -1
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js.map +1 -1
- package/build/cjs/components/IconWrapper/IconWrapper.js +2 -2
- package/build/cjs/components/IconWrapper/IconWrapper.js.map +1 -1
- package/build/cjs/components/Image/schema.js +40 -12
- package/build/cjs/components/Image/schema.js.map +1 -1
- package/build/cjs/components/ImageBase/ImageBase.js +3 -4
- package/build/cjs/components/ImageBase/ImageBase.js.map +1 -1
- package/build/cjs/components/InnerForm/InnerForm.js +5 -5
- package/build/cjs/components/InnerForm/InnerForm.js.map +1 -1
- package/build/cjs/components/Link/Link.js +1 -1
- package/build/cjs/components/Link/Link.js.map +1 -1
- package/build/cjs/components/Links/Links.js +4 -1
- package/build/cjs/components/Links/Links.js.map +1 -1
- package/build/cjs/components/Map/Map.js +2 -2
- package/build/cjs/components/Map/Map.js.map +1 -1
- package/build/cjs/components/Map/YMap/YMap.js +6 -5
- package/build/cjs/components/Map/YMap/YMap.js.map +1 -1
- package/build/cjs/components/Map/YMap/YandexMap.js +1 -2
- package/build/cjs/components/Map/YMap/YandexMap.js.map +1 -1
- package/build/cjs/components/Map/YMap/YandexMapApiLoader.js +2 -1
- package/build/cjs/components/Map/YMap/YandexMapApiLoader.js.map +1 -1
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js +1 -1
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js.map +1 -1
- package/build/cjs/components/Media/Image/Image.js +3 -3
- package/build/cjs/components/Media/Image/Image.js.map +1 -1
- package/build/cjs/components/Media/Media.js +13 -5
- package/build/cjs/components/Media/Media.js.map +1 -1
- package/build/cjs/components/MediaBase/MediaBase.js +3 -3
- package/build/cjs/components/MediaBase/MediaBase.js.map +1 -1
- package/build/cjs/components/MediaBase/MediaBaseContent.js +1 -1
- package/build/cjs/components/MediaBase/MediaBaseContent.js.map +1 -1
- package/build/cjs/components/OutsideClick/OutsideClick.js +9 -12
- package/build/cjs/components/OutsideClick/OutsideClick.js.map +1 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +46 -49
- package/build/cjs/components/OverflowScroller/OverflowScroller.js.map +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +10 -12
- package/build/cjs/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/cjs/components/ReactPlayer/utils.js +1 -2
- package/build/cjs/components/ReactPlayer/utils.js.map +1 -1
- package/build/cjs/components/Title/Title.js +2 -2
- package/build/cjs/components/Title/Title.js.map +1 -1
- package/build/cjs/components/Title/TitleItem.js +1 -1
- package/build/cjs/components/Title/TitleItem.js.map +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +5 -2
- package/build/cjs/components/VideoBlock/VideoBlock.js.map +1 -1
- package/build/cjs/components/YandexForm/YandexForm.js +3 -3
- package/build/cjs/components/YandexForm/YandexForm.js.map +1 -1
- package/build/cjs/components/YandexForm/schema.js +7 -3
- package/build/cjs/components/YandexForm/schema.js.map +1 -1
- package/build/cjs/containers/Loadable/Loadable.js +3 -3
- package/build/cjs/containers/Loadable/Loadable.js.map +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js +14 -7
- package/build/cjs/containers/PageConstructor/PageConstructor.js.map +1 -1
- package/build/cjs/containers/PageConstructor/Provider.js +1 -1
- package/build/cjs/containers/PageConstructor/Provider.js.map +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js.map +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +2 -2
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js.map +1 -1
- package/build/cjs/context/theme/withTheme.js +7 -9
- package/build/cjs/context/theme/withTheme.js.map +1 -1
- package/build/cjs/customization/BlockDecoration.js +3 -5
- package/build/cjs/customization/BlockDecoration.js.map +1 -1
- package/build/cjs/editor/components/AddBlock/AddBlock.js +6 -8
- package/build/cjs/editor/components/AddBlock/AddBlock.js.map +1 -1
- package/build/cjs/editor/components/BlockForm/BlockForm.js +9 -4
- package/build/cjs/editor/components/BlockForm/BlockForm.js.map +1 -1
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js +4 -4
- package/build/cjs/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js.map +1 -1
- package/build/cjs/editor/components/EditBlock/EditBlock.js +2 -2
- package/build/cjs/editor/components/EditBlock/EditBlock.js.map +1 -1
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js +2 -5
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/build/cjs/editor/components/Layout/Layout.js +3 -3
- package/build/cjs/editor/components/Layout/Layout.js.map +1 -1
- package/build/cjs/editor/components/PageSettings/PageSettings.js +2 -2
- package/build/cjs/editor/components/PageSettings/PageSettings.js.map +1 -1
- package/build/cjs/editor/containers/Editor/Editor.js +1 -1
- package/build/cjs/editor/containers/Editor/Editor.js.map +1 -1
- package/build/cjs/editor/containers/Editor/hooks/useCode.js +2 -4
- package/build/cjs/editor/containers/Editor/hooks/useCode.js.map +1 -1
- package/build/cjs/editor/containers/Editor/hooks/useEditorState.js +10 -7
- package/build/cjs/editor/containers/Editor/hooks/useEditorState.js.map +1 -1
- package/build/cjs/editor/containers/Form/Form.js +5 -2
- package/build/cjs/editor/containers/Form/Form.js.map +1 -1
- package/build/cjs/editor/data/index.js +4 -1
- package/build/cjs/editor/data/index.js.map +1 -1
- package/build/cjs/editor/data/previews/default-preview.js +1 -1
- package/build/cjs/editor/data/previews/default-preview.js.map +1 -1
- package/build/cjs/editor/data/previews/header-block.js +1 -1
- package/build/cjs/editor/data/previews/header-block.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +15 -13
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js +8 -10
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/parser/index.js +150 -120
- package/build/cjs/editor/dynamic-forms-custom/parser/index.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/parser/views.js +2 -4
- package/build/cjs/editor/dynamic-forms-custom/parser/views.js.map +1 -1
- package/build/cjs/editor/icons/Tablet.js +1 -1
- package/build/cjs/editor/icons/Tablet.js.map +1 -1
- package/build/cjs/editor/store/main/index.js +7 -4
- package/build/cjs/editor/store/main/index.js.map +1 -1
- package/build/cjs/editor/store/main/reducer.js +17 -3
- package/build/cjs/editor/store/main/reducer.js.map +1 -1
- package/build/cjs/editor/store/main/utils.js +1 -1
- package/build/cjs/editor/store/main/utils.js.map +1 -1
- package/build/cjs/editor/store/settings/reducer.js +16 -4
- package/build/cjs/editor/store/settings/reducer.js.map +1 -1
- package/build/cjs/editor/utils/code.js +4 -2
- package/build/cjs/editor/utils/code.js.map +1 -1
- package/build/cjs/editor/utils/index.js +7 -1
- package/build/cjs/editor/utils/index.js.map +1 -1
- package/build/cjs/editor/widget/index.js +8 -8
- package/build/cjs/editor/widget/index.js.map +1 -1
- package/build/cjs/grid/Col/Col.js +1 -1
- package/build/cjs/grid/Col/Col.js.map +1 -1
- package/build/cjs/hooks/useAnalytics.js +4 -1
- package/build/cjs/hooks/useAnalytics.js.map +1 -1
- package/build/cjs/icons/BrandIconDark.js +1 -1
- package/build/cjs/icons/BrandIconDark.js.map +1 -1
- package/build/cjs/icons/BrandIconLight.js +1 -1
- package/build/cjs/icons/BrandIconLight.js.map +1 -1
- package/build/cjs/icons/BrandName.js +1 -1
- package/build/cjs/icons/BrandName.js.map +1 -1
- package/build/cjs/icons/Chevron.js +1 -1
- package/build/cjs/icons/Chevron.js.map +1 -1
- package/build/cjs/icons/Facebook.js +1 -1
- package/build/cjs/icons/Facebook.js.map +1 -1
- package/build/cjs/icons/Github.js +1 -1
- package/build/cjs/icons/Github.js.map +1 -1
- package/build/cjs/icons/Linkedin.js +1 -1
- package/build/cjs/icons/Linkedin.js.map +1 -1
- package/build/cjs/icons/NavigationArrow.js +1 -1
- package/build/cjs/icons/NavigationArrow.js.map +1 -1
- package/build/cjs/icons/NavigationChevron.js +1 -1
- package/build/cjs/icons/NavigationChevron.js.map +1 -1
- package/build/cjs/icons/Telegram.js +1 -1
- package/build/cjs/icons/Telegram.js.map +1 -1
- package/build/cjs/icons/Twitter.js +1 -1
- package/build/cjs/icons/Twitter.js.map +1 -1
- package/build/cjs/icons/Vk.js +1 -1
- package/build/cjs/icons/Vk.js.map +1 -1
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.js +1 -1
- package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.js.map +1 -1
- package/build/cjs/navigation/components/Logo/Logo.js +4 -5
- package/build/cjs/navigation/components/Logo/Logo.js.map +1 -1
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js +2 -3
- package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +7 -5
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/ContentWrapper/ContentWrapper.js +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/ContentWrapper/ContentWrapper.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +2 -3
- package/build/cjs/navigation/components/NavigationItem/components/GithubButton/GithubButton.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +2 -3
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +4 -4
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js.map +1 -1
- package/build/cjs/navigation/components/NavigationList/NavigationList.js +1 -4
- package/build/cjs/navigation/components/NavigationList/NavigationList.js.map +1 -1
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +2 -3
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js.map +1 -1
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +1 -1
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.js.map +1 -1
- package/build/cjs/navigation/components/Standalone/index.js +1 -1
- package/build/cjs/navigation/components/Standalone/index.js.map +1 -1
- package/build/cjs/navigation/hooks/useActiveNavItem.js +1 -1
- package/build/cjs/navigation/hooks/useActiveNavItem.js.map +1 -1
- package/build/cjs/navigation/schema.js +19 -6
- package/build/cjs/navigation/schema.js.map +1 -1
- package/build/cjs/navigation/utils.js +1 -1
- package/build/cjs/navigation/utils.js.map +1 -1
- package/build/cjs/schema/constants.js +33 -2
- package/build/cjs/schema/constants.js.map +1 -1
- package/build/cjs/schema/index.js +23 -6
- package/build/cjs/schema/index.js.map +1 -1
- package/build/cjs/schema/validators/common.js +77 -31
- package/build/cjs/schema/validators/common.js.map +1 -1
- package/build/cjs/schema/validators/utils.js +9 -2
- package/build/cjs/schema/validators/utils.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +23 -8
- package/build/cjs/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +1 -1
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +2 -2
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.js +17 -6
- package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/Content/Content.js +1 -1
- package/build/cjs/sub-blocks/Content/Content.js.map +1 -1
- package/build/cjs/sub-blocks/Content/schema.js +10 -3
- package/build/cjs/sub-blocks/Content/schema.js.map +1 -1
- package/build/cjs/sub-blocks/Divider/schema.js +6 -2
- package/build/cjs/sub-blocks/Divider/schema.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +3 -3
- package/build/cjs/sub-blocks/HubspotForm/index.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/loadHubspotScript.js +1 -2
- package/build/cjs/sub-blocks/HubspotForm/loadHubspotScript.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/schema.js +11 -5
- package/build/cjs/sub-blocks/HubspotForm/schema.js.map +1 -1
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +1 -1
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js.map +1 -1
- package/build/cjs/sub-blocks/ImageCard/schema.js +17 -6
- package/build/cjs/sub-blocks/ImageCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +11 -9
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js +19 -6
- package/build/cjs/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/utils.js +4 -1
- package/build/cjs/sub-blocks/LayoutItem/utils.js.map +1 -1
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js +1 -5
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js.map +1 -1
- package/build/cjs/sub-blocks/MediaCard/schema.js +12 -3
- package/build/cjs/sub-blocks/MediaCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js +1 -1
- package/build/cjs/sub-blocks/PriceCard/PriceCard.js.map +1 -1
- package/build/cjs/sub-blocks/PriceCard/schema.js +25 -11
- package/build/cjs/sub-blocks/PriceCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +1 -2
- package/build/cjs/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js.map +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js.map +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +1 -4
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js.map +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +44 -12
- package/build/cjs/sub-blocks/PriceDetailed/schema.js.map +1 -1
- package/build/cjs/sub-blocks/Quote/Quote.js +6 -3
- package/build/cjs/sub-blocks/Quote/Quote.js.map +1 -1
- package/build/cjs/sub-blocks/Quote/schema.js +21 -8
- package/build/cjs/sub-blocks/Quote/schema.js.map +1 -1
- package/build/cjs/text-transform/common.js +10 -7
- package/build/cjs/text-transform/common.js.map +1 -1
- package/build/cjs/text-transform/config.js +26 -19
- package/build/cjs/text-transform/config.js.map +1 -1
- package/build/cjs/text-transform/filter.js +4 -1
- package/build/cjs/text-transform/filter.js.map +1 -1
- package/build/cjs/text-transform/transformers.js +1 -1
- package/build/cjs/text-transform/transformers.js.map +1 -1
- package/build/cjs/text-transform/utils.js +8 -5
- package/build/cjs/text-transform/utils.js.map +1 -1
- package/build/cjs/utils/analytics.js +2 -3
- package/build/cjs/utils/analytics.js.map +1 -1
- package/build/cjs/utils/common.js +1 -2
- package/build/cjs/utils/common.js.map +1 -1
- package/build/cjs/utils/hubspot.js +6 -7
- package/build/cjs/utils/hubspot.js.map +1 -1
- package/build/cjs/utils/microdata.js +1 -1
- package/build/cjs/utils/microdata.js.map +1 -1
- package/build/cjs/utils/url.js +10 -5
- package/build/cjs/utils/url.js.map +1 -1
- package/build/esm/blocks/Banner/Banner.js +2 -3
- package/build/esm/blocks/Banner/Banner.js.map +1 -1
- package/build/esm/blocks/Banner/schema.js +20 -8
- package/build/esm/blocks/Banner/schema.js.map +1 -1
- package/build/esm/blocks/CardLayout/CardLayout.js +2 -3
- package/build/esm/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/esm/blocks/CardLayout/schema.js +19 -4
- package/build/esm/blocks/CardLayout/schema.js.map +1 -1
- package/build/esm/blocks/Companies/Companies.js +1 -1
- package/build/esm/blocks/Companies/Companies.js.map +1 -1
- package/build/esm/blocks/Companies/schema.js +10 -4
- package/build/esm/blocks/Companies/schema.js.map +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.js +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/esm/blocks/ContentLayout/schema.js +7 -2
- package/build/esm/blocks/ContentLayout/schema.js.map +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +1 -1
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js.map +1 -1
- package/build/esm/blocks/ExtendedFeatures/schema.js +7 -1
- package/build/esm/blocks/ExtendedFeatures/schema.js.map +1 -1
- package/build/esm/blocks/FilterBlock/schema.js +13 -3
- package/build/esm/blocks/FilterBlock/schema.js.map +1 -1
- package/build/esm/blocks/Form/Form.js +3 -4
- package/build/esm/blocks/Form/Form.js.map +1 -1
- package/build/esm/blocks/Form/schema.js +14 -6
- package/build/esm/blocks/Form/schema.js.map +1 -1
- package/build/esm/blocks/Header/Header.js +8 -5
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/blocks/Header/schema.js +9 -2
- package/build/esm/blocks/Header/schema.js.map +1 -1
- package/build/esm/blocks/HeaderSlider/HeaderSlider.js +2 -4
- package/build/esm/blocks/HeaderSlider/HeaderSlider.js.map +1 -1
- package/build/esm/blocks/HeaderSlider/schema.js +6 -2
- package/build/esm/blocks/HeaderSlider/schema.js.map +1 -1
- package/build/esm/blocks/Icons/Icons.js +2 -2
- package/build/esm/blocks/Icons/Icons.js.map +1 -1
- package/build/esm/blocks/Icons/schema.js +17 -6
- package/build/esm/blocks/Icons/schema.js.map +1 -1
- package/build/esm/blocks/Info/Info.js +8 -4
- package/build/esm/blocks/Info/Info.js.map +1 -1
- package/build/esm/blocks/Info/schema.js +14 -4
- package/build/esm/blocks/Info/schema.js.map +1 -1
- package/build/esm/blocks/Map/Map.js +2 -4
- package/build/esm/blocks/Map/Map.js.map +1 -1
- package/build/esm/blocks/Map/schema.js +4 -1
- package/build/esm/blocks/Map/schema.js.map +1 -1
- package/build/esm/blocks/Media/Media.js +1 -1
- package/build/esm/blocks/Media/Media.js.map +1 -1
- package/build/esm/blocks/Media/schema.js +24 -9
- package/build/esm/blocks/Media/schema.js.map +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js.map +1 -1
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +8 -2
- package/build/esm/blocks/PromoFeaturesBlock/schema.js.map +1 -1
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -1
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js.map +1 -1
- package/build/esm/blocks/Questions/schema.js +6 -2
- package/build/esm/blocks/Questions/schema.js.map +1 -1
- package/build/esm/blocks/Share/schema.js +7 -3
- package/build/esm/blocks/Share/schema.js.map +1 -1
- package/build/esm/blocks/Slider/Slider.js +15 -14
- package/build/esm/blocks/Slider/Slider.js.map +1 -1
- package/build/esm/blocks/Slider/schema.js +6 -1
- package/build/esm/blocks/Slider/schema.js.map +1 -1
- package/build/esm/blocks/Slider/utils.js +8 -5
- package/build/esm/blocks/Slider/utils.js.map +1 -1
- package/build/esm/blocks/SliderNew/Arrow/Arrow.js +1 -1
- package/build/esm/blocks/SliderNew/Arrow/Arrow.js.map +1 -1
- package/build/esm/blocks/SliderNew/Slider.d.ts +1 -1
- package/build/esm/blocks/SliderNew/Slider.js +6 -6
- package/build/esm/blocks/SliderNew/Slider.js.map +1 -1
- package/build/esm/blocks/SliderNew/schema.js +6 -1
- package/build/esm/blocks/SliderNew/schema.js.map +1 -1
- package/build/esm/blocks/SliderNew/useSlider.d.ts +1 -1
- package/build/esm/blocks/SliderNew/useSlider.js +1 -3
- package/build/esm/blocks/SliderNew/useSlider.js.map +1 -1
- package/build/esm/blocks/SliderNew/useSliderPagination.d.ts +1 -1
- package/build/esm/blocks/SliderNew/utils.d.ts +1 -1
- package/build/esm/blocks/SliderNew/utils.js +6 -2
- package/build/esm/blocks/SliderNew/utils.js.map +1 -1
- package/build/esm/blocks/Table/Table.js +1 -1
- package/build/esm/blocks/Table/Table.js.map +1 -1
- package/build/esm/blocks/Table/schema.js +22 -10
- package/build/esm/blocks/Table/schema.js.map +1 -1
- package/build/esm/blocks/Tabs/Tabs.js +16 -18
- package/build/esm/blocks/Tabs/Tabs.js.map +1 -1
- package/build/esm/blocks/Tabs/schema.js +24 -9
- package/build/esm/blocks/Tabs/schema.js.map +1 -1
- package/build/esm/components/Author/Author.js +1 -1
- package/build/esm/components/Author/Author.js.map +1 -1
- package/build/esm/components/Author/schema.js +5 -1
- package/build/esm/components/Author/schema.js.map +1 -1
- package/build/esm/components/BackLink/BackLink.js +1 -1
- package/build/esm/components/BackLink/BackLink.js.map +1 -1
- package/build/esm/components/BackgroundImage/BackgroundImage.js +1 -1
- package/build/esm/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +4 -5
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js.map +1 -1
- package/build/esm/components/BalancedMasonry/BalancedMasonry.js +1 -1
- package/build/esm/components/BalancedMasonry/BalancedMasonry.js.map +1 -1
- package/build/esm/components/Button/Button.js +9 -6
- package/build/esm/components/Button/Button.js.map +1 -1
- package/build/esm/components/Button/utils.js +2 -2
- package/build/esm/components/Button/utils.js.map +1 -1
- package/build/esm/components/Buttons/Buttons.js +4 -1
- package/build/esm/components/Buttons/Buttons.js.map +1 -1
- package/build/esm/components/CardBase/CardBase.js +6 -2
- package/build/esm/components/CardBase/CardBase.js.map +1 -1
- package/build/esm/components/ContentList/ContentList.js +1 -1
- package/build/esm/components/ContentList/ContentList.js.map +1 -1
- package/build/esm/components/ContentList/ContentListItemIcon.js +1 -1
- package/build/esm/components/ContentList/ContentListItemIcon.js.map +1 -1
- package/build/esm/components/DefaultVideo/DefaultVideo.js +3 -4
- package/build/esm/components/DefaultVideo/DefaultVideo.js.map +1 -1
- package/build/esm/components/FileLink/FileLink.js +2 -2
- package/build/esm/components/FileLink/FileLink.js.map +1 -1
- package/build/esm/components/FullWidthBackground/FullWidthBackground.js +12 -17
- package/build/esm/components/FullWidthBackground/FullWidthBackground.js.map +1 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.js.map +1 -1
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +1 -1
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js.map +1 -1
- package/build/esm/components/IconWrapper/IconWrapper.js +2 -2
- package/build/esm/components/IconWrapper/IconWrapper.js.map +1 -1
- package/build/esm/components/Image/schema.js +40 -12
- package/build/esm/components/Image/schema.js.map +1 -1
- package/build/esm/components/ImageBase/ImageBase.js +3 -5
- package/build/esm/components/ImageBase/ImageBase.js.map +1 -1
- package/build/esm/components/InnerForm/InnerForm.js +5 -6
- package/build/esm/components/InnerForm/InnerForm.js.map +1 -1
- package/build/esm/components/Link/Link.js +1 -1
- package/build/esm/components/Link/Link.js.map +1 -1
- package/build/esm/components/Links/Links.js +4 -1
- package/build/esm/components/Links/Links.js.map +1 -1
- package/build/esm/components/Map/Map.js +2 -2
- package/build/esm/components/Map/Map.js.map +1 -1
- package/build/esm/components/Map/YMap/YMap.js +6 -5
- package/build/esm/components/Map/YMap/YMap.js.map +1 -1
- package/build/esm/components/Map/YMap/YandexMap.js +1 -2
- package/build/esm/components/Map/YMap/YandexMap.js.map +1 -1
- package/build/esm/components/Map/YMap/YandexMapApiLoader.js +2 -1
- package/build/esm/components/Map/YMap/YandexMapApiLoader.js.map +1 -1
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js +1 -1
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js.map +1 -1
- package/build/esm/components/Media/Image/Image.js +3 -3
- package/build/esm/components/Media/Image/Image.js.map +1 -1
- package/build/esm/components/Media/Media.js +13 -5
- package/build/esm/components/Media/Media.js.map +1 -1
- package/build/esm/components/MediaBase/MediaBase.js +3 -4
- package/build/esm/components/MediaBase/MediaBase.js.map +1 -1
- package/build/esm/components/MediaBase/MediaBaseContent.js +1 -1
- package/build/esm/components/MediaBase/MediaBaseContent.js.map +1 -1
- package/build/esm/components/OutsideClick/OutsideClick.js +9 -12
- package/build/esm/components/OutsideClick/OutsideClick.js.map +1 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.js +46 -49
- package/build/esm/components/OverflowScroller/OverflowScroller.js.map +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +10 -12
- package/build/esm/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/esm/components/ReactPlayer/utils.js +1 -2
- package/build/esm/components/ReactPlayer/utils.js.map +1 -1
- package/build/esm/components/Title/Title.js +2 -3
- package/build/esm/components/Title/Title.js.map +1 -1
- package/build/esm/components/Title/TitleItem.js +1 -1
- package/build/esm/components/Title/TitleItem.js.map +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +5 -2
- package/build/esm/components/VideoBlock/VideoBlock.js.map +1 -1
- package/build/esm/components/YandexForm/YandexForm.js +3 -3
- package/build/esm/components/YandexForm/YandexForm.js.map +1 -1
- package/build/esm/components/YandexForm/schema.js +7 -3
- package/build/esm/components/YandexForm/schema.js.map +1 -1
- package/build/esm/containers/Loadable/Loadable.js +3 -3
- package/build/esm/containers/Loadable/Loadable.js.map +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.js +14 -8
- package/build/esm/containers/PageConstructor/PageConstructor.js.map +1 -1
- package/build/esm/containers/PageConstructor/Provider.js +1 -1
- package/build/esm/containers/PageConstructor/Provider.js.map +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js.map +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +2 -3
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js.map +1 -1
- package/build/esm/context/theme/withTheme.js +7 -9
- package/build/esm/context/theme/withTheme.js.map +1 -1
- package/build/esm/customization/BlockDecoration.js +3 -6
- package/build/esm/customization/BlockDecoration.js.map +1 -1
- package/build/esm/editor/components/AddBlock/AddBlock.js +6 -8
- package/build/esm/editor/components/AddBlock/AddBlock.js.map +1 -1
- package/build/esm/editor/components/BlockForm/BlockForm.js +9 -5
- package/build/esm/editor/components/BlockForm/BlockForm.js.map +1 -1
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js +4 -5
- package/build/esm/editor/components/DeviceEmulation/DeviceEmulationMobile/DeviceEmulationMobile.js.map +1 -1
- package/build/esm/editor/components/EditBlock/EditBlock.js +2 -2
- package/build/esm/editor/components/EditBlock/EditBlock.js.map +1 -1
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js +2 -5
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/build/esm/editor/components/Layout/Layout.js +3 -3
- package/build/esm/editor/components/Layout/Layout.js.map +1 -1
- package/build/esm/editor/components/PageSettings/PageSettings.js +2 -3
- package/build/esm/editor/components/PageSettings/PageSettings.js.map +1 -1
- package/build/esm/editor/containers/Editor/Editor.js +1 -1
- package/build/esm/editor/containers/Editor/Editor.js.map +1 -1
- package/build/esm/editor/containers/Editor/hooks/useCode.js +2 -4
- package/build/esm/editor/containers/Editor/hooks/useCode.js.map +1 -1
- package/build/esm/editor/containers/Editor/hooks/useEditorState.js +10 -8
- package/build/esm/editor/containers/Editor/hooks/useEditorState.js.map +1 -1
- package/build/esm/editor/containers/Form/Form.js +5 -2
- package/build/esm/editor/containers/Form/Form.js.map +1 -1
- package/build/esm/editor/data/index.js +4 -1
- package/build/esm/editor/data/index.js.map +1 -1
- package/build/esm/editor/data/previews/default-preview.js +1 -1
- package/build/esm/editor/data/previews/default-preview.js.map +1 -1
- package/build/esm/editor/data/previews/header-block.js +1 -1
- package/build/esm/editor/data/previews/header-block.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +15 -13
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js +8 -10
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/parser/index.js +150 -120
- package/build/esm/editor/dynamic-forms-custom/parser/index.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/parser/views.js +2 -4
- package/build/esm/editor/dynamic-forms-custom/parser/views.js.map +1 -1
- package/build/esm/editor/icons/Tablet.js +1 -1
- package/build/esm/editor/icons/Tablet.js.map +1 -1
- package/build/esm/editor/store/main/index.js +7 -5
- package/build/esm/editor/store/main/index.js.map +1 -1
- package/build/esm/editor/store/main/reducer.js +17 -3
- package/build/esm/editor/store/main/reducer.js.map +1 -1
- package/build/esm/editor/store/main/utils.js +1 -1
- package/build/esm/editor/store/main/utils.js.map +1 -1
- package/build/esm/editor/store/settings/reducer.js +16 -4
- package/build/esm/editor/store/settings/reducer.js.map +1 -1
- package/build/esm/editor/utils/code.js +4 -2
- package/build/esm/editor/utils/code.js.map +1 -1
- package/build/esm/editor/utils/index.js +7 -1
- package/build/esm/editor/utils/index.js.map +1 -1
- package/build/esm/editor/widget/index.js +8 -8
- package/build/esm/editor/widget/index.js.map +1 -1
- package/build/esm/grid/Col/Col.js +1 -2
- package/build/esm/grid/Col/Col.js.map +1 -1
- package/build/esm/hooks/useAnalytics.js +4 -1
- package/build/esm/hooks/useAnalytics.js.map +1 -1
- package/build/esm/icons/BrandIconDark.js +1 -1
- package/build/esm/icons/BrandIconDark.js.map +1 -1
- package/build/esm/icons/BrandIconLight.js +1 -1
- package/build/esm/icons/BrandIconLight.js.map +1 -1
- package/build/esm/icons/BrandName.js +1 -1
- package/build/esm/icons/BrandName.js.map +1 -1
- package/build/esm/icons/Chevron.js +1 -1
- package/build/esm/icons/Chevron.js.map +1 -1
- package/build/esm/icons/Facebook.js +1 -1
- package/build/esm/icons/Facebook.js.map +1 -1
- package/build/esm/icons/Github.js +1 -1
- package/build/esm/icons/Github.js.map +1 -1
- package/build/esm/icons/Linkedin.js +1 -1
- package/build/esm/icons/Linkedin.js.map +1 -1
- package/build/esm/icons/NavigationArrow.js +1 -1
- package/build/esm/icons/NavigationArrow.js.map +1 -1
- package/build/esm/icons/NavigationChevron.js +1 -1
- package/build/esm/icons/NavigationChevron.js.map +1 -1
- package/build/esm/icons/Telegram.js +1 -1
- package/build/esm/icons/Telegram.js.map +1 -1
- package/build/esm/icons/Twitter.js +1 -1
- package/build/esm/icons/Twitter.js.map +1 -1
- package/build/esm/icons/Vk.js +1 -1
- package/build/esm/icons/Vk.js.map +1 -1
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.js +1 -1
- package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.js.map +1 -1
- package/build/esm/navigation/components/Logo/Logo.js +4 -6
- package/build/esm/navigation/components/Logo/Logo.js.map +1 -1
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js +2 -4
- package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +7 -6
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/components/ContentWrapper/ContentWrapper.js +1 -1
- package/build/esm/navigation/components/NavigationItem/components/ContentWrapper/ContentWrapper.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.js +2 -3
- package/build/esm/navigation/components/NavigationItem/components/GithubButton/GithubButton.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationButton/NavigationButton.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +2 -4
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +4 -5
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js.map +1 -1
- package/build/esm/navigation/components/NavigationList/NavigationList.js +1 -5
- package/build/esm/navigation/components/NavigationList/NavigationList.js.map +1 -1
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +2 -4
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js.map +1 -1
- package/build/esm/navigation/components/SocialIcon/SocialIcon.js +1 -1
- package/build/esm/navigation/components/SocialIcon/SocialIcon.js.map +1 -1
- package/build/esm/navigation/components/Standalone/index.js +1 -1
- package/build/esm/navigation/components/Standalone/index.js.map +1 -1
- package/build/esm/navigation/hooks/useActiveNavItem.js +1 -1
- package/build/esm/navigation/hooks/useActiveNavItem.js.map +1 -1
- package/build/esm/navigation/schema.js +19 -6
- package/build/esm/navigation/schema.js.map +1 -1
- package/build/esm/navigation/utils.js +1 -1
- package/build/esm/navigation/utils.js.map +1 -1
- package/build/esm/schema/constants.js +33 -2
- package/build/esm/schema/constants.js.map +1 -1
- package/build/esm/schema/index.js +23 -6
- package/build/esm/schema/index.js.map +1 -1
- package/build/esm/schema/validators/common.js +77 -31
- package/build/esm/schema/validators/common.js.map +1 -1
- package/build/esm/schema/validators/utils.js +9 -2
- package/build/esm/schema/validators/utils.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +1 -1
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js +23 -8
- package/build/esm/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +1 -1
- package/build/esm/sub-blocks/BannerCard/BannerCard.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +2 -3
- package/build/esm/sub-blocks/BasicCard/BasicCard.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.js +17 -6
- package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/Content/Content.js +1 -1
- package/build/esm/sub-blocks/Content/Content.js.map +1 -1
- package/build/esm/sub-blocks/Content/schema.js +10 -3
- package/build/esm/sub-blocks/Content/schema.js.map +1 -1
- package/build/esm/sub-blocks/Divider/schema.js +6 -2
- package/build/esm/sub-blocks/Divider/schema.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +3 -3
- package/build/esm/sub-blocks/HubspotForm/index.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/loadHubspotScript.js +1 -2
- package/build/esm/sub-blocks/HubspotForm/loadHubspotScript.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/schema.js +11 -5
- package/build/esm/sub-blocks/HubspotForm/schema.js.map +1 -1
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +1 -1
- package/build/esm/sub-blocks/ImageCard/ImageCard.js.map +1 -1
- package/build/esm/sub-blocks/ImageCard/schema.js +17 -6
- package/build/esm/sub-blocks/ImageCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +11 -10
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js +19 -6
- package/build/esm/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/utils.js +4 -1
- package/build/esm/sub-blocks/LayoutItem/utils.js.map +1 -1
- package/build/esm/sub-blocks/MediaCard/MediaCard.js +1 -5
- package/build/esm/sub-blocks/MediaCard/MediaCard.js.map +1 -1
- package/build/esm/sub-blocks/MediaCard/schema.js +12 -3
- package/build/esm/sub-blocks/MediaCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/PriceCard/PriceCard.js +1 -1
- package/build/esm/sub-blocks/PriceCard/PriceCard.js.map +1 -1
- package/build/esm/sub-blocks/PriceCard/schema.js +25 -11
- package/build/esm/sub-blocks/PriceCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js +1 -2
- package/build/esm/sub-blocks/PriceDetailed/PriceDescription/PriceDescription.js.map +1 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js +1 -1
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js.map +1 -1
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +1 -5
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js.map +1 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.js +44 -12
- package/build/esm/sub-blocks/PriceDetailed/schema.js.map +1 -1
- package/build/esm/sub-blocks/Quote/Quote.js +6 -3
- package/build/esm/sub-blocks/Quote/Quote.js.map +1 -1
- package/build/esm/sub-blocks/Quote/schema.js +21 -8
- package/build/esm/sub-blocks/Quote/schema.js.map +1 -1
- package/build/esm/text-transform/common.js +10 -7
- package/build/esm/text-transform/common.js.map +1 -1
- package/build/esm/text-transform/config.js +26 -19
- package/build/esm/text-transform/config.js.map +1 -1
- package/build/esm/text-transform/filter.js +4 -1
- package/build/esm/text-transform/filter.js.map +1 -1
- package/build/esm/text-transform/transformers.js +1 -1
- package/build/esm/text-transform/transformers.js.map +1 -1
- package/build/esm/text-transform/utils.js +8 -6
- package/build/esm/text-transform/utils.js.map +1 -1
- package/build/esm/utils/analytics.js +2 -3
- package/build/esm/utils/analytics.js.map +1 -1
- package/build/esm/utils/common.js +1 -2
- package/build/esm/utils/common.js.map +1 -1
- package/build/esm/utils/hubspot.js +6 -7
- package/build/esm/utils/hubspot.js.map +1 -1
- package/build/esm/utils/microdata.js +1 -1
- package/build/esm/utils/microdata.js.map +1 -1
- package/build/esm/utils/url.js +10 -5
- package/build/esm/utils/url.js.map +1 -1
- package/package.json +1 -1
- package/widget/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/PriceDetailed/schema.ts"],"names":[],"mappings":";;;AAAA,8DAAoF;AACpF,4DAAmE;AACnE,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AAE,OAAO;oBACb,KAAK,EAAE,4BAAoB;oBAC3B,UAAU,EAAE,MAAM;iBACrB;aACJ;SACJ;KACJ;CACJ,CAAC;AAEF,kBAAkB;AACL,QAAA,kBAAkB,GAAG;IAC9B,gBAAgB,EAAE;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,kBAAS;YACZ,GAAG,wBAAe;YAClB,KAAK,EAAE,IAAA,qBAAa,EAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,6BAA6B;YAC1C,OAAO,EAAE,yBAAyB;YAClC,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,wBAAwB;gBAC9B,OAAO,EAAE,UAAU;aACtB;YACD,gBAAgB,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aAClB;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,SAAS;aAClB;YACD,YAAY,EAAE;gBACV,IAAI,EAAE,SAAS;aAClB;YACD,QAAQ,EAAE,iCAAiC;YAC3C,iBAAiB,EAAE,mCAAmC;SACzD;KACJ;CACJ,CAAC","sourcesContent":["import {AnimatableProps, BaseProps, textSize} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {filteredArray} from '../../schema/validators/utils';\n\nconst PriceDetailedDetailsType = ['marked-list', 'settings'];\nconst PriceDetailedDescriptionColor = ['cornflower', 'black'];\nconst PriceLabelColor = ['blue', 'green', 'yellow', 'purple', 'red'];\n\nconst LabelsDefaultTextProp = PriceLabelColor.reduce((result, labelColor) => {\n return {\n ...result,\n [labelColor]: {\n type: 'string',\n },\n };\n}, {});\n\nconst PriceDetailedLabelsDefaultTextProps = {\n additionalProperties: false,\n required: [],\n properties: LabelsDefaultTextProp,\n};\n\nconst PriceDetailedFoldableDetailsProps = {\n additionalProperties: false,\n required: ['title'],\n properties: {\n title: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n titleColor: {\n type: 'string',\n enum: PriceDetailedDescriptionColor,\n },\n },\n};\n\nconst PriceDetailedDetailsProps = {\n additionalProperties: false,\n required: [],\n properties: {\n titleSize: {\n type: 'string',\n enum: textSize,\n },\n descriptionSize: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nconst PriceDetailedDescriptionProps = {\n additionalProperties: false,\n required: [],\n properties: {\n titleSize: {\n type: 'string',\n enum: textSize,\n },\n descriptionSize: {\n type: 'string',\n enum: textSize,\n },\n titleColor: {\n type: 'string',\n enum: PriceDetailedDescriptionColor,\n },\n },\n};\n\nconst PriceDescriptionLabelProps = {\n additionalProperties: false,\n required: ['color'],\n properties: {\n color: {\n type: 'string',\n enum: PriceLabelColor,\n },\n text: {\n type: 'string',\n contentType: 'text',\n },\n size: {\n type: 'string',\n enum: textSize,\n },\n },\n};\n\nconst PriceDescriptionProps = {\n title: {\n type: 'string',\n contentType: 'text',\n },\n description: {\n type: 'string',\n contentType: 'yfm',\n },\n detailedTitle: {\n type: 'string',\n contentType: 'text',\n },\n label: PriceDescriptionLabelProps,\n};\n\nconst PriceDetailsSettingsProps = {\n type: 'object',\n additionalProperties: false,\n required: ['title', 'description'],\n properties: {\n title: {\n type: 'string',\n contentType: 'text',\n },\n description: {\n type: 'string',\n contentType: 'yfm',\n },\n },\n};\n\nconst PriceDetailsListProps = {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: {\n type: 'string',\n contentType: 'yfm',\n },\n },\n};\n\nconst PriceDetailsProps = {\n items: {\n oneOf: [\n {\n ...filteredArray({\n ...PriceDetailsListProps,\n }),\n optionName: 'marked-list',\n },\n {\n ...filteredArray({\n ...PriceDetailsSettingsProps,\n }),\n optionName: 'settings',\n },\n ],\n },\n};\n\nconst PriceItem = {\n type: 'object',\n additionalProperties: false,\n required: ['title', 'description'],\n properties: {\n ...PriceDetailsProps,\n ...PriceDescriptionProps,\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n },\n};\n\n/** @deprecated */\nexport const PriceDetailedBlock = {\n 'price-detailed': {\n additionalProperties: false,\n required: ['items'],\n properties: {\n ...BaseProps,\n ...AnimatableProps,\n items: filteredArray(PriceItem),\n description: PriceDetailedDescriptionProps,\n details: PriceDetailedDetailsProps,\n priceType: {\n type: 'string',\n enum: PriceDetailedDetailsType,\n default: 'settings',\n },\n numberGroupItems: {\n type: 'number',\n enum: [3, 4, 5],\n },\n isCombined: {\n type: 'boolean',\n },\n useMixedView: {\n type: 'boolean',\n },\n foldable: PriceDetailedFoldableDetailsProps,\n labelsDefaultText: PriceDetailedLabelsDefaultTextProps,\n },\n },\n};\n"]}
|
|
@@ -18,12 +18,15 @@ const Quote = (props) => {
|
|
|
18
18
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.QuoteButton, url);
|
|
19
19
|
const handleButtonClick = React.useCallback(() => handleAnalytics(), [handleAnalytics]);
|
|
20
20
|
const themedAuthor = author
|
|
21
|
-
?
|
|
21
|
+
? {
|
|
22
|
+
...author,
|
|
23
|
+
avatar: (0, utils_2.getThemedValue)(author.avatar, theme),
|
|
24
|
+
}
|
|
22
25
|
: author;
|
|
23
|
-
const renderFooter = Boolean(author || url) && ((0, jsx_runtime_1.jsxs)("div", { className: b('author-wrapper'), children: [themedAuthor && ((0, jsx_runtime_1.jsx)(components_1.Author, { className: b('author', { theme: textTheme }), author: themedAuthor, type: models_1.AuthorType.Line, theme: textTheme })), url && buttonText && !button && ((0, jsx_runtime_1.jsx)(components_1.Button, { theme: "outlined", size: "xl", url: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, urlTitle: urlTitle, text: buttonText })), button && (0, jsx_runtime_1.jsx)(components_1.Button,
|
|
26
|
+
const renderFooter = Boolean(author || url) && ((0, jsx_runtime_1.jsxs)("div", { className: b('author-wrapper'), children: [themedAuthor && ((0, jsx_runtime_1.jsx)(components_1.Author, { className: b('author', { theme: textTheme }), author: themedAuthor, type: models_1.AuthorType.Line, theme: textTheme })), url && buttonText && !button && ((0, jsx_runtime_1.jsx)(components_1.Button, { theme: "outlined", size: "xl", url: url, className: b('link-button', { theme: textTheme }), onClick: handleButtonClick, urlTitle: urlTitle, text: buttonText })), button && (0, jsx_runtime_1.jsx)(components_1.Button, { size: "xl", ...button })] }));
|
|
24
27
|
const themedLogoProps = (0, utils_2.getThemedValue)(logo, theme);
|
|
25
28
|
const logoProps = (0, utils_1.getMediaImage)(themedLogoProps);
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {}, children: [(0, jsx_runtime_1.jsxs)("div", { className: b('content-wrapper'), children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(components_1.Image,
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: b({ theme: textTheme, border }), style: color ? { backgroundColor: color } : {}, children: [(0, jsx_runtime_1.jsxs)("div", { className: b('content-wrapper'), children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(components_1.Image, { className: b('logo'), ...logoProps }), (0, jsx_runtime_1.jsxs)("div", { className: b('content', { 'quote-type': quoteType }), children: [text && ((0, jsx_runtime_1.jsx)("span", { className: b('text'), children: (0, jsx_runtime_1.jsx)(components_1.HTML, { children: text }) })), yfmText && ((0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { className: b('text'), content: yfmText, modifiers: { constructor: true } }))] })] }), renderFooter] }, text), (0, jsx_runtime_1.jsx)("div", { className: b('image-wrapper'), children: (0, jsx_runtime_1.jsx)(components_1.Image, { ...imageData, className: b('image') }) })] }));
|
|
27
30
|
};
|
|
28
31
|
exports.default = Quote;
|
|
29
32
|
//# sourceMappingURL=Quote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quote.js","sourceRoot":"../../../../src","sources":["sub-blocks/Quote/Quote.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,0DAAyE;AACzE,iEAAiE;AACjE,wDAA6C;AAC7C,gDAAyC;AACzC,kDAA8F;AAC9F,gDAAkD;AAIlD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,OAAO,CAAC,CAAC;AAEzB,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAE,EAAE;IAChC,MAAM,EACF,KAAK,EAAE,SAAS,GAAG,OAAO,EAC1B,KAAK,EACL,KAAK,EACL,MAAM,GAAG,QAAQ,EACjB,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,UAAU,EACV,SAAS,GAAG,kBAAS,CAAC,OAAO,EAC7B,MAAM,GACT,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,MAAM,WAAW,GAAG,IAAA,sBAAc,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAA,qBAAa,EAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,IAAA,oBAAY,EAAC,0BAAiB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IACxF,MAAM,YAAY,GAAG,MAAM;QACvB,CAAC,CAAE,
|
|
1
|
+
{"version":3,"file":"Quote.js","sourceRoot":"../../../../src","sources":["sub-blocks/Quote/Quote.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,0DAAyE;AACzE,iEAAiE;AACjE,wDAA6C;AAC7C,gDAAyC;AACzC,kDAA8F;AAC9F,gDAAkD;AAIlD,MAA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GAChC,CACL,IACC,IACJ,EACL,YAAY,KAlBP,IAAI,CAmBR,EACN,gCAAK,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,YAC9B,uBAAC,kBAAK,OAAK,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,GAC7C,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Author, Button, HTML, Image, YFMWrapper} from '../../components';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport {useTheme} from '../../context/theme';\nimport {useAnalytics} from '../../hooks';\nimport {AuthorItem, AuthorType, DefaultEventNames, QuoteProps, QuoteType} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport './Quote.scss';\n\nconst b = block('quote');\n\nconst Quote = (props: QuoteProps) => {\n const {\n theme: textTheme = 'light',\n color,\n image,\n border = 'shadow',\n text,\n yfmText,\n logo,\n author,\n url,\n urlTitle,\n buttonText,\n quoteType = QuoteType.Chevron,\n button,\n } = props;\n const theme = useTheme();\n const imageThemed = getThemedValue(image, theme);\n const imageData = getMediaImage(imageThemed);\n const handleAnalytics = useAnalytics(DefaultEventNames.QuoteButton, url);\n\n const handleButtonClick = React.useCallback(() => handleAnalytics(), [handleAnalytics]);\n const themedAuthor = author\n ? ({\n ...author,\n avatar: getThemedValue(author.avatar, theme),\n } as AuthorItem)\n : author;\n\n const renderFooter = Boolean(author || url) && (\n <div className={b('author-wrapper')}>\n {themedAuthor && (\n <Author\n className={b('author', {theme: textTheme})}\n author={themedAuthor}\n type={AuthorType.Line}\n theme={textTheme}\n />\n )}\n {url && buttonText && !button && (\n <Button\n theme=\"outlined\"\n size=\"xl\"\n url={url}\n className={b('link-button', {theme: textTheme})}\n onClick={handleButtonClick}\n urlTitle={urlTitle}\n text={buttonText}\n />\n )}\n {button && <Button size=\"xl\" {...button} />}\n </div>\n );\n\n const themedLogoProps = getThemedValue(logo, theme);\n const logoProps = getMediaImage(themedLogoProps);\n\n return (\n <div\n className={b({theme: textTheme, border})}\n style={color ? {backgroundColor: color} : {}}\n >\n <div key={text} className={b('content-wrapper')}>\n <div>\n <Image className={b('logo')} {...logoProps} />\n <div className={b('content', {'quote-type': quoteType})}>\n {text && (\n <span className={b('text')}>\n <HTML>{text}</HTML>\n </span>\n )}\n {yfmText && (\n <YFMWrapper\n className={b('text')}\n content={yfmText}\n modifiers={{constructor: true}}\n />\n )}\n </div>\n </div>\n {renderFooter}\n </div>\n <div className={b('image-wrapper')}>\n <Image {...imageData} className={b('image')} />\n </div>\n </div>\n );\n};\n\nexport default Quote;\n"]}
|
|
@@ -7,24 +7,37 @@ exports.Quote = {
|
|
|
7
7
|
quote: {
|
|
8
8
|
additionalProperties: false,
|
|
9
9
|
required: ['image', 'logo'],
|
|
10
|
-
properties:
|
|
10
|
+
properties: {
|
|
11
|
+
...common_1.BaseProps,
|
|
12
|
+
text: {
|
|
11
13
|
type: 'string',
|
|
12
14
|
contentType: 'text',
|
|
13
|
-
},
|
|
15
|
+
},
|
|
16
|
+
yfmText: {
|
|
14
17
|
type: 'string',
|
|
15
18
|
contentType: 'text',
|
|
16
|
-
},
|
|
19
|
+
},
|
|
20
|
+
image: (0, common_1.withTheme)(schema_1.ImageProps),
|
|
21
|
+
logo: schema_1.ImageProps,
|
|
22
|
+
color: {
|
|
17
23
|
type: 'string',
|
|
18
|
-
},
|
|
24
|
+
},
|
|
25
|
+
url: {
|
|
19
26
|
type: 'string',
|
|
20
|
-
},
|
|
27
|
+
},
|
|
28
|
+
urlTitle: {
|
|
21
29
|
type: 'string',
|
|
22
|
-
},
|
|
30
|
+
},
|
|
31
|
+
buttonText: {
|
|
23
32
|
type: 'string',
|
|
24
|
-
},
|
|
33
|
+
},
|
|
34
|
+
theme: common_1.ThemeProps,
|
|
35
|
+
author: common_1.authorItem,
|
|
36
|
+
quoteType: {
|
|
25
37
|
type: 'string',
|
|
26
38
|
enum: common_1.quoteTypes,
|
|
27
|
-
}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
28
41
|
},
|
|
29
42
|
};
|
|
30
43
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/Quote/schema.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,8DAMwC;AAE3B,QAAA,KAAK,GAAG;IACjB,KAAK,EAAE;QACH,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QAC3B,UAAU,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/Quote/schema.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,8DAMwC;AAE3B,QAAA,KAAK,GAAG;IACjB,KAAK,EAAE;QACH,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE;YACR,GAAG,kBAAS;YACZ,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,MAAM;aACtB;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,MAAM;aACtB;YACD,KAAK,EAAE,IAAA,kBAAS,EAAC,mBAAU,CAAC;YAC5B,IAAI,EAAE,mBAAU;YAChB,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;YACD,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,QAAQ;aACjB;YACD,KAAK,EAAE,mBAAU;YACjB,MAAM,EAAE,mBAAU;YAClB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,mBAAU;aACnB;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import {ImageProps} from '../../components/Image/schema';\nimport {\n BaseProps,\n ThemeProps,\n authorItem,\n quoteTypes,\n withTheme,\n} from '../../schema/validators/common';\n\nexport const Quote = {\n quote: {\n additionalProperties: false,\n required: ['image', 'logo'],\n properties: {\n ...BaseProps,\n text: {\n type: 'string',\n contentType: 'text',\n },\n yfmText: {\n type: 'string',\n contentType: 'text',\n },\n image: withTheme(ImageProps),\n logo: ImageProps,\n color: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n buttonText: {\n type: 'string',\n },\n theme: ThemeProps,\n author: authorItem,\n quoteType: {\n type: 'string',\n enum: quoteTypes,\n },\n },\n },\n};\n"]}
|
|
@@ -14,13 +14,16 @@ const createItemsParser = (fields) => (transformer, items) => items.map((item) =
|
|
|
14
14
|
return transformer(item);
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
return {
|
|
18
|
+
...item,
|
|
19
|
+
...fields.reduce((acc, fieldName) => {
|
|
20
|
+
if (item[fieldName]) {
|
|
21
|
+
// eslint-disable-next-line no-param-reassign
|
|
22
|
+
acc[fieldName] = transformer(item[fieldName]);
|
|
23
|
+
}
|
|
24
|
+
return acc;
|
|
25
|
+
}, {}),
|
|
26
|
+
};
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
exports.createItemsParser = createItemsParser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"../../../src","sources":["text-transform/common.ts"],"names":[],"mappings":";;;AAsCA,wCAYC;AAED,kDAEC;;AAtDD,sFAA6D;AAI7D,sCAAsD;AAa/C,MAAM,iBAAiB,GAAG,CAAC,MAAgB,EAAE,EAAE,CAAC,CAAC,WAAwB,EAAE,KAAa,EAAE,EAAE,CAC/F,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;IACf,IAAI,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OAAO,EAAE;QAClC,IAAI;QACJ,OAAO,EAAE,CAAC,GAAG,iBAAc,EAAE,GAAG,OAAO,CAAC;KAC3C,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAgB,mBAAmB,CAAC,IAAU,EAAE,OAAe;IAC3D,OAAO,IAAA,sBAAc,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import defaultPlugins from '@diplodoc/transform/lib/plugins';\nimport {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings';\n\nimport {Lang} from './types';\nimport {fullTransform, typografToHTML} from './utils';\n\nexport type ComplexItem = {[key: string]: string};\nexport type Item = string | null | ComplexItem;\nexport type Transformer = (text: string) => string;\nexport type TransformerRaw = (\n lang: Lang,\n content: string,\n options: {plugins: MarkdownItPluginCb[]},\n) => string;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Parser<T = any> = (transformer: Transformer, block: T) => T;\n\nexport const createItemsParser = (fields: string[]) => (transformer: Transformer, items: Item[]) =>\n items.map((item) => {\n if (!item) {\n return item;\n } else if (typeof item === 'string') {\n return transformer(item);\n } else {\n return {\n ...item,\n ...fields.reduce<ComplexItem>((acc, fieldName) => {\n if (item[fieldName]) {\n // eslint-disable-next-line no-param-reassign\n acc[fieldName] = transformer(item[fieldName]);\n }\n\n return acc;\n }, {}),\n };\n }\n });\n\nexport function yfmTransformer(\n lang: Lang,\n content: string,\n options: {plugins?: MarkdownItPluginCb[]} = {},\n) {\n const {plugins = []} = options;\n const {html} = fullTransform(content, {\n lang,\n plugins: [...defaultPlugins, ...plugins],\n });\n\n return html;\n}\n\nexport function typografTransformer(lang: Lang, content: string) {\n return typografToHTML(content, lang);\n}\n"]}
|
|
@@ -3,31 +3,35 @@
|
|
|
3
3
|
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.config = exports.blockHeaderTransformer = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const models_1 = require("../models/index.js");
|
|
8
7
|
const common_1 = require("./common.js");
|
|
9
8
|
function parseTableBlock(transformer, content) {
|
|
10
|
-
const legend = content
|
|
11
|
-
return
|
|
9
|
+
const legend = content?.legend;
|
|
10
|
+
return {
|
|
11
|
+
...(content || {}),
|
|
12
|
+
legend: legend && legend.map((string) => transformer(string)),
|
|
13
|
+
};
|
|
12
14
|
}
|
|
13
15
|
function parseFeatures(transformer, items) {
|
|
14
|
-
return items.map((
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return items.map(({ title, text, ...rest }) => ({
|
|
17
|
+
title: title && transformer(title),
|
|
18
|
+
text: text && transformer(text),
|
|
19
|
+
...rest,
|
|
20
|
+
}));
|
|
18
21
|
}
|
|
19
22
|
function parsePromoFeatures(transformer, items) {
|
|
20
|
-
return items.map((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
23
|
+
return items.map(({ text, ...rest }) => ({
|
|
24
|
+
text: transformer(text),
|
|
25
|
+
...rest,
|
|
26
|
+
}));
|
|
24
27
|
}
|
|
25
28
|
const parseTitle = (transformer, title) => typeof title === 'object' && 'text' in title
|
|
26
|
-
?
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
? { ...title, text: transformer(title.text) }
|
|
30
|
+
: title && transformer(title);
|
|
31
|
+
const parseItemsTitle = (transformer, items) => items.map(({ title, ...rest }) => ({
|
|
32
|
+
title: title && parseTitle(transformer, title),
|
|
33
|
+
...rest,
|
|
34
|
+
}));
|
|
31
35
|
function parsePriceDetailedBlock(transformer, block) {
|
|
32
36
|
const { priceType } = block;
|
|
33
37
|
/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
|
|
@@ -63,8 +67,11 @@ const parseContentLayout = (transformer, content) => {
|
|
|
63
67
|
}
|
|
64
68
|
if (list) {
|
|
65
69
|
content.list = list.map((item) => {
|
|
66
|
-
if (item
|
|
67
|
-
return
|
|
70
|
+
if (item?.text) {
|
|
71
|
+
return {
|
|
72
|
+
...item,
|
|
73
|
+
text: transformer(item.text),
|
|
74
|
+
};
|
|
68
75
|
}
|
|
69
76
|
return item;
|
|
70
77
|
});
|
|
@@ -74,7 +81,7 @@ const parseContentLayout = (transformer, content) => {
|
|
|
74
81
|
return content;
|
|
75
82
|
};
|
|
76
83
|
function parseContentLayoutTitle(transformer, content) {
|
|
77
|
-
if (content
|
|
84
|
+
if (content?.title) {
|
|
78
85
|
const { title } = content;
|
|
79
86
|
// eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
|
|
80
87
|
content.title = title && parseTitle(transformer, title);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"../../../src","sources":["text-transform/config.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,4EAA4E;;;;AAE5E,+CAWmB;AAEnB,wCAOkB;AAElB,SAAS,eAAe,CAAC,WAAwB,EAAE,OAAmB;IAClE,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC;IAE/B,uCACO,CAAC,OAAO,IAAI,EAAE,CAAC,KAClB,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAC/D;AACN,CAAC;AAED,SAAS,aAAa,CAAC,WAAwB,EAAE,KAA6B;IAC1E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAsB,EAAE,EAAE;YAA1B,EAAC,KAAK,EAAE,IAAI,OAAU,EAAL,IAAI,sBAArB,iBAAsB,CAAD;QAAM,OAAA,iBACzC,KAAK,EAAE,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,EAClC,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,IAC5B,IAAI,EACT,CAAA;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AS,CAAC,SAAS,CAAC,EAAE;QACnB;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,uBAAc;YAC3B,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,4BAAmB;YAChC,MAAM,EAAE,uBAAuB;SAClC;KACJ;CACJ,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\nimport {\n BlockType,\n ContentBlockProps,\n ExtendedFeaturesItem,\n PriceDetailedProps,\n PriceDetailsListProps,\n PriceDetailsSettingsProps,\n PromoFeaturesItem,\n SubBlockType,\n TableProps,\n TitleItemProps,\n} from '../models';\n\nimport {\n Parser,\n Transformer,\n TransformerRaw,\n createItemsParser,\n typografTransformer,\n yfmTransformer,\n} from './common';\n\nfunction parseTableBlock(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n\n return {\n ...(content || {}),\n legend: legend && legend.map((string) => transformer(string)),\n };\n}\n\nfunction parseFeatures(transformer: Transformer, items: ExtendedFeaturesItem[]) {\n return items.map(({title, text, ...rest}) => ({\n title: title && transformer(title),\n text: text && transformer(text),\n ...rest,\n }));\n}\n\nfunction parsePromoFeatures(transformer: Transformer, items: PromoFeaturesItem[]) {\n return items.map(({text, ...rest}) => ({\n text: transformer(text),\n ...rest,\n }));\n}\n\nconst parseTitle = (transformer: Transformer, title: TitleItemProps | string) =>\n typeof title === 'object' && 'text' in title\n ? {...title, text: transformer(title.text)}\n : title && transformer(title);\n\nconst parseItemsTitle = (transformer: Transformer, items: ExtendedFeaturesItem[]) =>\n items.map(({title, ...rest}) => ({\n title: title && parseTitle(transformer, title),\n ...rest,\n }));\n\nfunction parsePriceDetailedBlock(transformer: Transformer, block: PriceDetailedProps) {\n const {priceType} = block;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n block.items = block.items.map((item) => {\n const {description, items: details = []} = item;\n\n if (priceType === 'marked-list') {\n item.items = (details as PriceDetailsListProps[]).map((detail) => {\n detail.text = detail.text && transformer(detail.text);\n\n return detail;\n });\n } else {\n item.items = (details as PriceDetailsSettingsProps[]).map((detail) => {\n detail.description = detail.description && transformer(detail.description);\n\n return detail;\n });\n }\n\n item.description = transformer(description);\n\n return item;\n });\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\n return block;\n}\n\nconst parseContentLayout = (transformer: Transformer, content: ContentBlockProps) => {\n if (content) {\n const {text, additionalInfo, list} = content;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n if (text) {\n content.text = transformer(text);\n }\n\n if (additionalInfo) {\n content.additionalInfo = transformer(additionalInfo);\n }\n\n if (list) {\n content.list = list.map((item) => {\n if (item?.text) {\n return {\n ...item,\n text: transformer(item.text),\n };\n }\n\n return item;\n });\n }\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n }\n\n return content;\n};\n\nfunction parseContentLayoutTitle(transformer: Transformer, content: ContentBlockProps) {\n if (content?.title) {\n const {title} = content;\n\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign\n content.title = title && parseTitle(transformer, title);\n }\n\n return content;\n}\n\nexport const blockHeaderTransformer = [\n {\n fields: ['title'],\n transformer: typografTransformer,\n parser: parseTitle,\n },\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n];\n\ninterface BlockConfig {\n transformer: TransformerRaw;\n fields?: string[];\n parser?: Parser;\n}\n\nexport type BlocksConfig = Record<string, BlockConfig | BlockConfig[]>;\n\nexport const config: BlocksConfig = {\n [SubBlockType.BasicCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BackgroundCard]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [SubBlockType.ImageCard]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [SubBlockType.LayoutItem]: [\n {\n fields: ['content'],\n parser: parseContentLayout,\n transformer: yfmTransformer,\n },\n {\n fields: ['content'],\n parser: parseContentLayoutTitle,\n transformer: typografTransformer,\n },\n {\n fields: ['metaInfo'],\n parser: createItemsParser([]),\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.Quote]: [\n {\n fields: ['text'],\n transformer: typografTransformer,\n },\n {\n fields: ['yfmText'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.ExtendedFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: createItemsParser(['title']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo']),\n },\n ],\n [BlockType.PromoFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parsePromoFeatures,\n },\n ],\n [BlockType.SliderBlock]: blockHeaderTransformer,\n [BlockType.CompaniesBlock]: blockHeaderTransformer,\n [BlockType.QuestionsBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n\n [BlockType.BannerBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BannerCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.MediaBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.MapBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.TabsBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo', 'caption']),\n },\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: parseItemsTitle,\n },\n ],\n [BlockType.TableBlock]: [\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlock,\n },\n ],\n [BlockType.HeaderSliderBlock]: [\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: createItemsParser(['title', 'overtitle']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['description']),\n },\n ],\n [SubBlockType.PriceDetailed]: [\n {\n transformer: yfmTransformer,\n parser: parsePriceDetailedBlock,\n },\n ],\n [BlockType.HeaderBlock]: [\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.ContentLayoutBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n [SubBlockType.Content]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n parser: parseTitle,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.InfoBlock]: [\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n [BlockType.ShareBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [BlockType.CardLayoutBlock]: blockHeaderTransformer,\n [BlockType.FilterBlock]: blockHeaderTransformer,\n [BlockType.IconsBlock]: blockHeaderTransformer,\n [SubBlockType.PriceCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.FormBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"../../../src","sources":["text-transform/config.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,4EAA4E;;;AAE5E,+CAWmB;AAEnB,wCAOkB;AAElB,SAAS,eAAe,CAAC,WAAwB,EAAE,OAAmB;IAClE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KAChE,CAAC;AACN,CAAC;AAED,SAAS,aAAa,CAAC,WAAwB,EAAE,KAA6B;IAC1E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC;QAClC,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC;QAC/B,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AAED,SAAS,kBAAkB,CAAC,WAAwB,EAAE,KAA0B;IAC5E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,WAAW,CAAC,IAAI,CA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not-accumulator-reassign/no-not-accumulator-reassign */\n\nimport {\n BlockType,\n ContentBlockProps,\n ExtendedFeaturesItem,\n PriceDetailedProps,\n PriceDetailsListProps,\n PriceDetailsSettingsProps,\n PromoFeaturesItem,\n SubBlockType,\n TableProps,\n TitleItemProps,\n} from '../models';\n\nimport {\n Parser,\n Transformer,\n TransformerRaw,\n createItemsParser,\n typografTransformer,\n yfmTransformer,\n} from './common';\n\nfunction parseTableBlock(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n\n return {\n ...(content || {}),\n legend: legend && legend.map((string) => transformer(string)),\n };\n}\n\nfunction parseFeatures(transformer: Transformer, items: ExtendedFeaturesItem[]) {\n return items.map(({title, text, ...rest}) => ({\n title: title && transformer(title),\n text: text && transformer(text),\n ...rest,\n }));\n}\n\nfunction parsePromoFeatures(transformer: Transformer, items: PromoFeaturesItem[]) {\n return items.map(({text, ...rest}) => ({\n text: transformer(text),\n ...rest,\n }));\n}\n\nconst parseTitle = (transformer: Transformer, title: TitleItemProps | string) =>\n typeof title === 'object' && 'text' in title\n ? {...title, text: transformer(title.text)}\n : title && transformer(title);\n\nconst parseItemsTitle = (transformer: Transformer, items: ExtendedFeaturesItem[]) =>\n items.map(({title, ...rest}) => ({\n title: title && parseTitle(transformer, title),\n ...rest,\n }));\n\nfunction parsePriceDetailedBlock(transformer: Transformer, block: PriceDetailedProps) {\n const {priceType} = block;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n block.items = block.items.map((item) => {\n const {description, items: details = []} = item;\n\n if (priceType === 'marked-list') {\n item.items = (details as PriceDetailsListProps[]).map((detail) => {\n detail.text = detail.text && transformer(detail.text);\n\n return detail;\n });\n } else {\n item.items = (details as PriceDetailsSettingsProps[]).map((detail) => {\n detail.description = detail.description && transformer(detail.description);\n\n return detail;\n });\n }\n\n item.description = transformer(description);\n\n return item;\n });\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\n return block;\n}\n\nconst parseContentLayout = (transformer: Transformer, content: ContentBlockProps) => {\n if (content) {\n const {text, additionalInfo, list} = content;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n if (text) {\n content.text = transformer(text);\n }\n\n if (additionalInfo) {\n content.additionalInfo = transformer(additionalInfo);\n }\n\n if (list) {\n content.list = list.map((item) => {\n if (item?.text) {\n return {\n ...item,\n text: transformer(item.text),\n };\n }\n\n return item;\n });\n }\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n }\n\n return content;\n};\n\nfunction parseContentLayoutTitle(transformer: Transformer, content: ContentBlockProps) {\n if (content?.title) {\n const {title} = content;\n\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign\n content.title = title && parseTitle(transformer, title);\n }\n\n return content;\n}\n\nexport const blockHeaderTransformer = [\n {\n fields: ['title'],\n transformer: typografTransformer,\n parser: parseTitle,\n },\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n];\n\ninterface BlockConfig {\n transformer: TransformerRaw;\n fields?: string[];\n parser?: Parser;\n}\n\nexport type BlocksConfig = Record<string, BlockConfig | BlockConfig[]>;\n\nexport const config: BlocksConfig = {\n [SubBlockType.BasicCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BackgroundCard]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [SubBlockType.ImageCard]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [SubBlockType.LayoutItem]: [\n {\n fields: ['content'],\n parser: parseContentLayout,\n transformer: yfmTransformer,\n },\n {\n fields: ['content'],\n parser: parseContentLayoutTitle,\n transformer: typografTransformer,\n },\n {\n fields: ['metaInfo'],\n parser: createItemsParser([]),\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.Quote]: [\n {\n fields: ['text'],\n transformer: typografTransformer,\n },\n {\n fields: ['yfmText'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.ExtendedFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: createItemsParser(['title']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo']),\n },\n ],\n [BlockType.PromoFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parsePromoFeatures,\n },\n ],\n [BlockType.SliderBlock]: blockHeaderTransformer,\n [BlockType.CompaniesBlock]: blockHeaderTransformer,\n [BlockType.QuestionsBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n\n [BlockType.BannerBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BannerCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.MediaBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.MapBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.TabsBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo', 'caption']),\n },\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: parseItemsTitle,\n },\n ],\n [BlockType.TableBlock]: [\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlock,\n },\n ],\n [BlockType.HeaderSliderBlock]: [\n {\n fields: ['items'],\n transformer: typografTransformer,\n parser: createItemsParser(['title', 'overtitle']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['description']),\n },\n ],\n [SubBlockType.PriceDetailed]: [\n {\n transformer: yfmTransformer,\n parser: parsePriceDetailedBlock,\n },\n ],\n [BlockType.HeaderBlock]: [\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.ContentLayoutBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n [SubBlockType.Content]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: typografTransformer,\n parser: parseTitle,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.InfoBlock]: [\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n [BlockType.ShareBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n ],\n [BlockType.CardLayoutBlock]: blockHeaderTransformer,\n [BlockType.FilterBlock]: blockHeaderTransformer,\n [BlockType.IconsBlock]: blockHeaderTransformer,\n [SubBlockType.PriceCard]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.FormBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: typografTransformer,\n parser: parseContentLayoutTitle,\n },\n ],\n};\n"]}
|
|
@@ -19,7 +19,10 @@ function filterItems(items, vars, propertyName) {
|
|
|
19
19
|
else {
|
|
20
20
|
const filteredProperty = filterItems(property, vars, propertyName);
|
|
21
21
|
if (filteredProperty.length !== 0) {
|
|
22
|
-
result.push(
|
|
22
|
+
result.push({
|
|
23
|
+
...item,
|
|
24
|
+
[propertyName]: filteredProperty,
|
|
25
|
+
});
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"../../../src","sources":["text-transform/filter.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,4EAA4E;;AAkF5E,sCAgBC;;AAhGD,mGAAgE;AAYhE,SAAS,WAAW,CAChB,KAA8B,EAC9B,IAAsB,EACtB,YAAqB;IAErB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACX,iDAAiD,YAAY,YAAY,IAAI,CAAC,SAAS,CACnF,KAAK,CACR,EAAE,CACN,CAAC;IACN,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAwB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QACxD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE7D,IAAI,gBAAgB,EAAE,CAAC;YACnB,MAAM,QAAQ,GAAG,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;YAEpD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;iBAAM,CAAC;gBACJ,MAAM,gBAAgB,GAAG,WAAW,CAChC,QAAmC,EACnC,IAAI,EACJ,YAAY,CACf,CAAC;gBAEF,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAChC,MAAM,CAAC,IAAI,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SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,IAAI,IAAA,oBAAO,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAC9E,CAAC;AACN,CAAC;AAED,SAAS,WAAW,CAChB,OAA4C;IAE5C,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,MAAM,CACX,OAA4C;IAE5C,OAAO,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CACzB,OAA4C,EAC5C,IAAsB;IAEtB,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,WAAW,CAAC,OAAkC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtE,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CACT,CAAC;IACzB,CAAC;SAAM,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAsB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC7E,GAAG,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACtC,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;SAAM,CAAC;QACJ,OAAO,OAAO,CAAC;IACnB,CAAC;AACL,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\nimport evalExp from '@diplodoc/transform/lib/liquid/evaluation';\n\nimport {ContentVariables} from './transformers';\n\ntype WhenValue = string | boolean | undefined;\ntype OrArray<T> = T | T[];\ntype OrArrayRecord<T> = Record<string, OrArray<T>>;\ninterface FilteredContentItem extends OrArrayRecord<FilteredContentItem> {}\ntype FilteredContent = OrArray<FilteredContentItem>;\ntype FilterableContentItem = FilteredContentItem & {when: WhenValue};\nexport type FilterableContent = OrArray<FilterableContentItem>;\n\nfunction filterItems(\n items: FilterableContentItem[],\n vars: ContentVariables,\n propertyName?: string,\n): FilterableContentItem[] | FilteredContentItem[] {\n if (!Array.isArray(items)) {\n throw new Error(\n `Error while filtering: items has invalid key '${propertyName}' equals ${JSON.stringify(\n items,\n )}`,\n );\n }\n\n return items.reduce<FilteredContentItem[]>((result, item) => {\n const passedFiltration = checkWhenCondition(item.when, vars);\n\n if (passedFiltration) {\n const property = propertyName && item[propertyName];\n\n if (property === undefined) {\n result.push(item);\n } else {\n const filteredProperty = filterItems(\n property as FilterableContentItem[],\n vars,\n propertyName,\n );\n\n if (filteredProperty.length !== 0) {\n result.push({\n ...item,\n [propertyName as string]: filteredProperty,\n });\n }\n }\n }\n\n return result;\n }, []);\n}\n\nfunction checkWhenCondition(whenValue: WhenValue, vars: ContentVariables) {\n return (\n whenValue === true ||\n whenValue === undefined ||\n (typeof whenValue === 'string' && (!whenValue || evalExp(whenValue, vars)))\n );\n}\n\nfunction isItemArray(\n content: FilterableContent | FilteredContent,\n): content is FilterableContentItem[] | FilteredContentItem[] {\n return Array.isArray(content);\n}\n\nfunction isItem(\n content: FilterableContent | FilteredContent,\n): content is FilterableContentItem | FilteredContentItem {\n return content && typeof content === 'object' && !Array.isArray(content);\n}\n\n/**\n * Filters content recoursively by result of it's 'when' property evaluation applied to vars argument.\n * e.g. property {..., when: 'someVar == \"someValue\"' } will be included in result only if vars.someVar === 'someValue'\n * @param {FilterableContent} content\n * @param {ContentVariables} vars\n * @return {FilteredContent}\n */\nexport function filterContent(\n content: FilterableContent | FilteredContent,\n vars: ContentVariables,\n): FilteredContent {\n if (isItemArray(content)) {\n return filterItems(content as FilterableContentItem[], vars).map((item) =>\n filterContent(item, vars),\n ) as FilteredContent;\n } else if (isItem(content)) {\n return Object.entries(content).reduce<FilteredContentItem>((acc, [key, value]) => {\n acc[key] = filterContent(value, vars);\n return acc;\n }, {});\n } else {\n return content;\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ const shuffle_1 = tslib_1.__importDefault(require("lodash/shuffle.js"));
|
|
|
7
7
|
const config_1 = require("./config.js");
|
|
8
8
|
const filter_1 = require("./filter.js");
|
|
9
9
|
function transformBlocks(blocks, lang, customConfig = {}, options = {}) {
|
|
10
|
-
const fullConfig =
|
|
10
|
+
const fullConfig = { ...config_1.config, ...customConfig };
|
|
11
11
|
const { plugins = [] } = options;
|
|
12
12
|
const clonedBlocks = (0, cloneDeep_1.default)(blocks);
|
|
13
13
|
return clonedBlocks.map((block) => transformBlock(lang, fullConfig, block, plugins));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.js","sourceRoot":"../../../src","sources":["text-transform/transformers.ts"],"names":[],"mappings":";;;;AAGA,4EAAyC;AACzC,wEAAqC;AAKrC,wCAA8C;AAC9C,wCAA0D;AAgB1D,SAAS,eAAe,CACpB,MAA0B,EAC1B,IAAU,EACV,YAAY,GAAG,EAAE,EACjB,UAA4C,EAAE;IAE9C,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"transformers.js","sourceRoot":"../../../src","sources":["text-transform/transformers.ts"],"names":[],"mappings":";;;;AAGA,4EAAyC;AACzC,wEAAqC;AAKrC,wCAA8C;AAC9C,wCAA0D;AAgB1D,SAAS,eAAe,CACpB,MAA0B,EAC1B,IAAU,EACV,YAAY,GAAG,EAAE,EACjB,UAA4C,EAAE;IAE9C,MAAM,UAAU,GAAG,EAAC,GAAG,eAAM,EAAE,GAAG,YAAY,EAAC,CAAC;IAChD,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,OAAO,CAAC;IAE/B,MAAM,YAAY,GAAG,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,YAAY,CAAC,GAAG,CAAC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BAAM,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE,CAAC;4BAC1C,KAAK,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAW,CAAC,CAAC;wBACvD,CAAC;oBACL,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC;iBAAM,IAAI,MAAM,EAAE,CAAC;gBAChB,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAC/B,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACxC,KAAK,CAAC,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,QAA8B,EAAE,IAAI,EAAE,YAAY,EAAE;YACvF,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAEM,MAAM,kBAAkB,GAAG,CAAC,EAAC,OAAO,EAAE,OAAO,EAA0B,EAAE,EAAE;IAC9E,MAAM,EAAC,IAAI,EAAE,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,OAAO,CAAC;IAC9D,MAAM,EAAC,MAAM,GAAG,EAAE,EAAC,GAAG,CAClB,IAAI,CAAC,CAAC,CAAC,IAAA,sBAAa,EAAC,OAA4B,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CACtD,CAAC;IAEjB,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE;QAClE,OAAO;KACV,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,iBAAiB;KAC5B,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,kBAAkB,sBAa7B","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\nimport {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings';\nimport cloneDeep from 'lodash/cloneDeep';\nimport shuffle from 'lodash/shuffle';\n\nimport {ConstructorBlock, PageContent} from '../models/constructor';\n\nimport {Transformer} from './common';\nimport {BlocksConfig, config} from './config';\nimport {FilterableContent, filterContent} from './filter';\nimport {Lang} from './types';\n\nexport type ContentVariables = Record<string, string>;\nexport type ContentTransformerProps = {\n content: {\n blocks?: ConstructorBlock[];\n };\n options: {\n lang: Lang;\n customConfig?: {};\n vars?: ContentVariables;\n plugins?: MarkdownItPluginCb[];\n };\n};\n\nfunction transformBlocks(\n blocks: ConstructorBlock[],\n lang: Lang,\n customConfig = {},\n options: {plugins?: MarkdownItPluginCb[]} = {},\n) {\n const fullConfig = {...config, ...customConfig};\n const {plugins = []} = options;\n\n const clonedBlocks = cloneDeep(blocks);\n\n return clonedBlocks.map((block) => transformBlock(lang, fullConfig, block, plugins));\n}\n\nfunction transformBlock(\n lang: Lang,\n blocksConfig: BlocksConfig,\n block: ConstructorBlock,\n plugins: MarkdownItPluginCb[],\n) {\n const blockConfig = blocksConfig[block.type];\n\n if (block) {\n if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {\n block.children = shuffle(block.children as ConstructorBlock[]);\n }\n }\n\n if (blockConfig) {\n const configs = Array.isArray(blockConfig) ? blockConfig : [blockConfig];\n\n configs.forEach((transformConfig) => {\n const {fields, transformer: transformerRaw, parser} = transformConfig;\n const transformer: Transformer = (content) =>\n // eslint-disable-next-line no-useless-call\n transformerRaw.call(null, lang, content, {plugins});\n\n if (fields) {\n (fields as (keyof typeof block)[]).forEach((field) => {\n if (block[field]) {\n if (parser) {\n block[field] = parser(transformer, block[field]);\n } else if (typeof block[field] === 'string') {\n block[field] = transformer(block[field] as string);\n }\n }\n });\n } else if (parser) {\n parser(transformer, block);\n }\n });\n }\n\n if ('children' in block && block.children) {\n block.children = transformBlocks(block.children as ConstructorBlock[], lang, blocksConfig, {\n plugins,\n });\n }\n\n return block;\n}\n\nexport const contentTransformer = ({content, options}: ContentTransformerProps) => {\n const {lang, customConfig = {}, vars, plugins = []} = options;\n const {blocks = []} = (\n vars ? filterContent(content as FilterableContent, vars) : content\n ) as PageContent;\n\n const transformedBlocks = transformBlocks(blocks, lang, customConfig, {\n plugins,\n });\n\n return {\n blocks: transformedBlocks,\n };\n};\n"]}
|
|
@@ -75,15 +75,18 @@ function typografToText(text, lang) {
|
|
|
75
75
|
return text && sanitizeHtml(typograf(text, lang));
|
|
76
76
|
}
|
|
77
77
|
const transformMarkdown = (input, options) => {
|
|
78
|
-
const { result } = (0, transform_1.default)(input
|
|
78
|
+
const { result } = (0, transform_1.default)(input ?? '', options);
|
|
79
79
|
return result;
|
|
80
80
|
};
|
|
81
81
|
exports.transformMarkdown = transformMarkdown;
|
|
82
|
-
function fullTransform(input,
|
|
83
|
-
|
|
84
|
-
const result = (0, exports.transformMarkdown)(input, Object.assign({ lang }, options));
|
|
82
|
+
function fullTransform(input, { lang, ...options }) {
|
|
83
|
+
const result = (0, exports.transformMarkdown)(input, { lang, ...options });
|
|
85
84
|
const { html, title } = result;
|
|
86
|
-
return
|
|
85
|
+
return {
|
|
86
|
+
...result,
|
|
87
|
+
html: typograf(html, lang),
|
|
88
|
+
title: title && typograf(title, lang),
|
|
89
|
+
};
|
|
87
90
|
}
|
|
88
91
|
function typografEntity({ entity, fields, lang = 'ru', transformType = TransformType.Text, }) {
|
|
89
92
|
const transformTypeMap = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"../../../src","sources":["text-transform/utils.ts"],"names":[],"mappings":";;;AA4CA,4CAIC;AASD,4BAcC;AAED,oCAEC;AAED,wCAEC;AAED,wCAEC;AAOD,sCAYC;AASD,wCAqBC;;AApID,4EAAkE;AAClE,0EAAqC;AACrC,gEAAgD;AAMhD,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,8BAAa,CAAA;AACjB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAM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AAC,IAAI,GACf;IACnB,MAAM,gBAAgB,GAAG;QACrB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,cAAc;KACvB,CAAC;IAEF,MAAM,WAAW,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAEpD,MAAM,CAAC,OAAO,CAAC,CAAC,SAAiB,EAAE,EAAE;QACjC,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACpB,sGAAsG;YACtG,MAAM,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import transformYFM, {Options, Output} from '@diplodoc/transform';\nimport sanitize from 'sanitize-html';\nimport Typograf, {TypografRule} from 'typograf';\n\nimport {Lang} from './types';\n\ntype AddRuleOptions = TypografRule;\n\nexport enum TransformType {\n Text = 'text',\n Html = 'html',\n}\n\ninterface TransformOptions extends Options {\n lang: Lang;\n}\n\nexport const DEFAULT_ALLOWED_TAGS = [\n 'br',\n 'b',\n 'i',\n 'strong',\n 'em',\n 'sup',\n 'sub',\n 'a',\n 'ul',\n 'ol',\n 'li',\n];\nexport const typografConfig = {\n enabled: ['common/nbsp/afterNumber', 'common/nbsp/afterParagraphMark'],\n disabled: [\n 'common/symbols/cf',\n 'ru/other/phone-number',\n 'common/space/afterColon',\n 'common/space/afterSemicolon',\n ],\n};\nexport const sanitizeStripOptions: sanitize.IOptions = {\n allowedTags: [],\n allowedAttributes: {},\n};\n\nexport function addTypografRules(options: AddRuleOptions[]) {\n options.forEach((option) => {\n Typograf.addRule(option);\n });\n}\n\nfunction enableRules(tp: Typograf) {\n const {disabled, enabled} = typografConfig;\n\n enabled.forEach((rule) => tp.enableRule(rule));\n disabled.forEach((rule) => tp.disableRule(rule));\n}\n\nexport function typograf(text: string, lang: Lang = 'ru') {\n const localeByLang = {\n ru: ['ru', 'en-US'],\n en: ['en-US', 'ru'],\n };\n\n const tp = new Typograf({\n locale: localeByLang[lang] || lang,\n htmlEntity: {type: 'name'},\n });\n\n enableRules(tp);\n\n return tp.execute(text);\n}\n\nexport function sanitizeHtml(html: string, options = sanitizeStripOptions) {\n return html && sanitize(html, options || sanitizeStripOptions);\n}\n\nexport function typografToHTML(text: string, lang: Lang, allowedTags = DEFAULT_ALLOWED_TAGS) {\n return text && typograf(sanitizeHtml(text, {allowedTags}), lang);\n}\n\nexport function typografToText(text: string, lang: Lang) {\n return text && sanitizeHtml(typograf(text, lang));\n}\n\nexport const transformMarkdown = (input: string, options: TransformOptions): Output['result'] => {\n const {result} = transformYFM(input ?? '', options);\n return result;\n};\n\nexport function fullTransform(\n input: string,\n {lang, ...options}: TransformOptions,\n): Output['result'] {\n const result = transformMarkdown(input, {lang, ...options});\n const {html, title} = result;\n\n return {\n ...result,\n html: typograf(html, lang),\n title: title && typograf(title, lang),\n };\n}\n\nexport interface TypografEntityParams {\n entity: Record<string, string>;\n fields: string[];\n lang: Lang;\n transformType: TransformType;\n}\n\nexport function typografEntity({\n entity,\n fields,\n lang = 'ru',\n transformType = TransformType.Text,\n}: TypografEntityParams) {\n const transformTypeMap = {\n text: typografToText,\n html: typografToHTML,\n };\n\n const transformer = transformTypeMap[transformType];\n\n fields.forEach((fieldName: string) => {\n if (entity[fieldName]) {\n // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign\n entity[fieldName] = transformer(entity[fieldName], lang);\n }\n });\n\n return entity;\n}\n"]}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isCounterAllowed = void 0;
|
|
4
4
|
const isCounterAllowed = (counter, counters) => {
|
|
5
|
-
var _a, _b;
|
|
6
5
|
if (!counters) {
|
|
7
6
|
return true;
|
|
8
7
|
}
|
|
9
|
-
if (
|
|
8
|
+
if (counters.exclude?.includes(counter)) {
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
|
-
else if (
|
|
11
|
+
else if (counters.include?.includes(counter)) {
|
|
13
12
|
return true;
|
|
14
13
|
}
|
|
15
14
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"../../../src","sources":["utils/analytics.ts"],"names":[],"mappings":";;;AAEO,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,QAA4B,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"../../../src","sources":["utils/analytics.ts"],"names":[],"mappings":";;;AAEO,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,QAA4B,EAAE,EAAE;IAC9E,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACjB,CAAC;SAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B","sourcesContent":["import {AnalyticsCounters} from '../models';\n\nexport const isCounterAllowed = (counter: string, counters?: AnalyticsCounters) => {\n if (!counters) {\n return true;\n }\n\n if (counters.exclude?.includes(counter)) {\n return false;\n } else if (counters.include?.includes(counter)) {\n return true;\n }\n\n return false;\n};\n"]}
|
|
@@ -13,9 +13,8 @@ async function loadScript(src, { id, defer = false, async = true }) {
|
|
|
13
13
|
resolve(event);
|
|
14
14
|
};
|
|
15
15
|
script.onerror = (event) => {
|
|
16
|
-
var _a;
|
|
17
16
|
const element = document.getElementById(id);
|
|
18
|
-
|
|
17
|
+
element?.parentNode?.removeChild(element);
|
|
19
18
|
reject(event);
|
|
20
19
|
};
|
|
21
20
|
document.head.appendChild(script);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"../../../src","sources":["utils/common.ts"],"names":[],"mappings":";;AAMA,gCAkBC;AAlBM,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,EAAC,EAAE,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,GAAG,IAAI,EAAgB;IAC1F,wDAAwD;IACxD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;QACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"../../../src","sources":["utils/common.ts"],"names":[],"mappings":";;AAMA,gCAkBC;AAlBM,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,EAAC,EAAE,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,GAAG,IAAI,EAAgB;IAC1F,wDAAwD;IACxD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;QACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;YACvB,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;YAC1C,MAAM,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["export interface ScriptOptions {\n id: string;\n defer?: boolean;\n async?: boolean;\n}\n\nexport async function loadScript(src: string, {id, defer = false, async = true}: ScriptOptions) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = src;\n script.id = id;\n script.defer = defer;\n script.async = async;\n script.onload = (event) => {\n resolve(event);\n };\n script.onerror = (event) => {\n const element = document.getElementById(id);\n element?.parentNode?.removeChild(element);\n reject(event);\n };\n document.head.appendChild(script);\n });\n}\n"]}
|