@gravity-ui/page-constructor 4.56.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/build/cjs/blocks/Banner/schema.d.ts +0 -264
- package/build/cjs/blocks/FilterBlock/FilterBlock.js +2 -2
- package/build/cjs/blocks/FilterBlock/i18n/index.d.ts +1 -2
- package/build/cjs/blocks/FilterBlock/i18n/index.js +4 -3
- package/build/cjs/blocks/Map/schema.d.ts +0 -88
- package/build/cjs/blocks/Media/schema.d.ts +0 -176
- package/build/cjs/blocks/Security/i18n/index.d.ts +1 -2
- package/build/cjs/blocks/Security/i18n/index.js +4 -3
- package/build/cjs/blocks/Share/Share.css +2 -1
- package/build/cjs/blocks/Share/Share.js +4 -4
- package/build/cjs/blocks/Share/i18n/index.d.ts +1 -2
- package/build/cjs/blocks/Share/i18n/index.js +4 -3
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/i18n/index.d.ts +1 -2
- package/build/cjs/blocks/Slider/i18n/index.js +4 -3
- package/build/cjs/components/BackLink/BackLink.js +2 -2
- package/build/cjs/components/Button/Button.css +1 -5
- package/build/cjs/components/Button/Button.js +4 -7
- package/build/cjs/components/Button/i18n/index.d.ts +1 -2
- package/build/cjs/components/Button/i18n/index.js +4 -3
- package/build/cjs/components/ButtonTabs/ButtonTabs.css +0 -4
- package/build/cjs/components/CardBase/CardBase.d.ts +1 -3
- package/build/cjs/components/CardBase/CardBase.js +1 -4
- package/build/cjs/components/Control/Control.js +2 -2
- package/build/cjs/components/Control/i18n/index.d.ts +1 -2
- package/build/cjs/components/Control/i18n/index.js +4 -3
- package/build/cjs/components/FileLink/FileLink.css +4 -5
- package/build/cjs/components/FullscreenImage/FullscreenImage.css +1 -0
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +9 -10
- package/build/cjs/components/FullscreenImage/i18n/index.d.ts +1 -2
- package/build/cjs/components/FullscreenImage/i18n/index.js +4 -3
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.css +1 -0
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.js +14 -15
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +3 -6
- package/build/cjs/components/Link/Link.css +1 -2
- package/build/cjs/components/Link/Link.js +3 -6
- package/build/cjs/components/Map/GoogleMap.js +2 -2
- package/build/cjs/components/Map/YMap/YandexMap.js +2 -2
- package/build/cjs/components/Map/YMap/i18n/index.d.ts +1 -2
- package/build/cjs/components/Map/YMap/i18n/index.js +4 -3
- package/build/cjs/components/Media/DataLens/DataLens.js +2 -2
- package/build/cjs/components/Media/DataLens/i18n/index.d.ts +1 -2
- package/build/cjs/components/Media/DataLens/i18n/index.js +4 -3
- package/build/cjs/components/Media/Iframe/Iframe.js +2 -2
- package/build/cjs/components/Media/Iframe/i18n/index.d.ts +1 -2
- package/build/cjs/components/Media/Iframe/i18n/index.js +4 -3
- package/build/cjs/components/Media/Media.js +1 -3
- package/build/cjs/components/Media/Video/Video.js +2 -3
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +2 -2
- package/build/cjs/components/OverflowScroller/i18n/index.d.ts +1 -2
- package/build/cjs/components/OverflowScroller/i18n/index.js +4 -3
- package/build/cjs/components/ReactPlayer/CustomBarControls.js +5 -7
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +7 -31
- package/build/cjs/components/ReactPlayer/i18n/index.d.ts +1 -2
- package/build/cjs/components/ReactPlayer/i18n/index.js +4 -3
- package/build/cjs/components/Table/Table.css +6 -0
- package/build/cjs/components/Table/Table.js +2 -2
- package/build/cjs/components/UnpublishedLabel/UnpublishedLabel.js +2 -2
- package/build/cjs/components/UnpublishedLabel/i18n/index.d.ts +1 -2
- package/build/cjs/components/UnpublishedLabel/i18n/index.js +4 -3
- package/build/cjs/components/VideoBlock/VideoBlock.css +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +4 -4
- package/build/cjs/components/VideoBlock/i18n/index.d.ts +1 -2
- package/build/cjs/components/VideoBlock/i18n/index.js +4 -3
- package/build/cjs/components/YandexForm/YandexForm.js +2 -13
- package/build/cjs/containers/Loadable/Loadable.js +2 -2
- package/build/cjs/containers/Loadable/i18n/index.d.ts +1 -2
- package/build/cjs/containers/Loadable/i18n/index.js +4 -3
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js +1 -1
- package/build/cjs/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/cjs/containers/PageConstructor/Provider.js +1 -3
- package/build/cjs/context/localeContext/localeContext.d.ts +2 -2
- package/build/cjs/context/localeContext/localeContext.js +2 -2
- package/build/cjs/editor/components/ControlPanel/ControlPanel.js +3 -3
- package/build/cjs/editor/components/ControlPanel/i18n/en.json +2 -1
- package/build/cjs/editor/components/ControlPanel/i18n/index.d.ts +1 -2
- package/build/cjs/editor/components/ControlPanel/i18n/index.js +4 -3
- package/build/cjs/editor/components/ControlPanel/i18n/ru.json +2 -1
- package/build/cjs/editor/components/ErrorBoundary/ErrorBoundary.js +3 -3
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.d.ts +1 -2
- package/build/cjs/editor/components/ErrorBoundary/i18n/index.js +4 -3
- package/build/cjs/editor/components/NotFoundBlock/NotFoundBlock.js +2 -2
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.d.ts +1 -2
- package/build/cjs/editor/components/NotFoundBlock/i18n/index.js +4 -3
- package/build/cjs/editor/containers/Form/Form.css +1 -1
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +1 -1
- package/build/cjs/hooks/useAnalytics.d.ts +2 -2
- package/build/cjs/hooks/useMetrika.d.ts +1 -13
- package/build/cjs/hooks/useMetrika.js +0 -41
- package/build/cjs/icons/index.d.ts +0 -9
- package/build/cjs/icons/index.js +0 -9
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -1
- package/build/cjs/models/common.d.ts +2 -53
- package/build/cjs/models/common.js +1 -25
- package/build/cjs/models/constructor-items/common.d.ts +3 -28
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -3
- package/build/cjs/models/guards.d.ts +0 -2
- package/build/cjs/models/guards.js +1 -5
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +3 -3
- package/build/cjs/schema/constants.d.ts +0 -176
- package/build/cjs/schema/constants.js +2 -0
- package/build/cjs/schema/validators/common.d.ts +0 -188
- package/build/cjs/schema/validators/common.js +0 -31
- package/build/cjs/schema/validators/index.d.ts +0 -2
- package/build/cjs/schema/validators/index.js +0 -2
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +4 -10
- package/build/cjs/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +4 -10
- package/build/cjs/sub-blocks/Content/Content.css +6 -2
- package/build/cjs/sub-blocks/Content/Content.js +3 -10
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +0 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +1 -6
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +2 -8
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -15
- package/build/cjs/sub-blocks/PriceCard/schema.d.ts +0 -88
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.d.ts +1 -0
- package/build/cjs/sub-blocks/PriceDetailed/PriceDetailed.js +2 -0
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +1 -0
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +1 -0
- package/build/cjs/text-transform/common.d.ts +5 -5
- package/build/cjs/text-transform/common.js +1 -1
- package/build/cjs/text-transform/filter.js +1 -1
- package/build/cjs/text-transform/transformers.d.ts +3 -3
- package/build/cjs/text-transform/utils.d.ts +7 -7
- package/build/cjs/text-transform/utils.js +6 -6
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +1 -4
- package/build/esm/blocks/Banner/schema.d.ts +0 -264
- package/build/esm/blocks/FilterBlock/FilterBlock.js +1 -1
- package/build/esm/blocks/FilterBlock/i18n/index.d.ts +1 -2
- package/build/esm/blocks/FilterBlock/i18n/index.js +3 -3
- package/build/esm/blocks/Map/schema.d.ts +0 -88
- package/build/esm/blocks/Media/schema.d.ts +0 -176
- package/build/esm/blocks/Security/i18n/index.d.ts +1 -2
- package/build/esm/blocks/Security/i18n/index.js +3 -3
- package/build/esm/blocks/Share/Share.css +2 -1
- package/build/esm/blocks/Share/Share.js +1 -1
- package/build/esm/blocks/Share/i18n/index.d.ts +1 -2
- package/build/esm/blocks/Share/i18n/index.js +3 -3
- package/build/esm/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/esm/blocks/Slider/i18n/index.d.ts +1 -2
- package/build/esm/blocks/Slider/i18n/index.js +3 -3
- package/build/esm/components/BackLink/BackLink.js +2 -2
- package/build/esm/components/Button/Button.css +1 -5
- package/build/esm/components/Button/Button.js +3 -6
- package/build/esm/components/Button/i18n/index.d.ts +1 -2
- package/build/esm/components/Button/i18n/index.js +3 -3
- package/build/esm/components/ButtonTabs/ButtonTabs.css +0 -4
- package/build/esm/components/CardBase/CardBase.d.ts +1 -3
- package/build/esm/components/CardBase/CardBase.js +1 -4
- package/build/esm/components/Control/Control.js +1 -1
- package/build/esm/components/Control/i18n/index.d.ts +1 -2
- package/build/esm/components/Control/i18n/index.js +3 -3
- package/build/esm/components/FileLink/FileLink.css +4 -5
- package/build/esm/components/FullscreenImage/FullscreenImage.css +1 -0
- package/build/esm/components/FullscreenImage/FullscreenImage.js +8 -9
- package/build/esm/components/FullscreenImage/i18n/index.d.ts +1 -2
- package/build/esm/components/FullscreenImage/i18n/index.js +3 -3
- package/build/esm/components/FullscreenMedia/FullscreenMedia.css +1 -0
- package/build/esm/components/FullscreenMedia/FullscreenMedia.js +14 -15
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +3 -6
- package/build/esm/components/Link/Link.css +1 -2
- package/build/esm/components/Link/Link.js +3 -6
- package/build/esm/components/Map/GoogleMap.js +1 -1
- package/build/esm/components/Map/YMap/YandexMap.js +1 -1
- package/build/esm/components/Map/YMap/i18n/index.d.ts +1 -2
- package/build/esm/components/Map/YMap/i18n/index.js +3 -3
- package/build/esm/components/Media/DataLens/DataLens.js +1 -1
- package/build/esm/components/Media/DataLens/i18n/index.d.ts +1 -2
- package/build/esm/components/Media/DataLens/i18n/index.js +3 -3
- package/build/esm/components/Media/Iframe/Iframe.js +1 -1
- package/build/esm/components/Media/Iframe/i18n/index.d.ts +1 -2
- package/build/esm/components/Media/Iframe/i18n/index.js +3 -3
- package/build/esm/components/Media/Media.js +1 -3
- package/build/esm/components/Media/Video/Video.js +2 -3
- package/build/esm/components/OverflowScroller/OverflowScroller.js +1 -1
- package/build/esm/components/OverflowScroller/i18n/index.d.ts +1 -2
- package/build/esm/components/OverflowScroller/i18n/index.js +3 -3
- package/build/esm/components/ReactPlayer/CustomBarControls.js +4 -6
- package/build/esm/components/ReactPlayer/ReactPlayer.css +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +6 -30
- package/build/esm/components/ReactPlayer/i18n/index.d.ts +1 -2
- package/build/esm/components/ReactPlayer/i18n/index.js +3 -3
- package/build/esm/components/Table/Table.css +6 -0
- package/build/esm/components/Table/Table.js +2 -2
- package/build/esm/components/UnpublishedLabel/UnpublishedLabel.js +1 -1
- package/build/esm/components/UnpublishedLabel/i18n/index.d.ts +1 -2
- package/build/esm/components/UnpublishedLabel/i18n/index.js +3 -3
- package/build/esm/components/VideoBlock/VideoBlock.css +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +3 -3
- package/build/esm/components/VideoBlock/i18n/index.d.ts +1 -2
- package/build/esm/components/VideoBlock/i18n/index.js +3 -3
- package/build/esm/components/YandexForm/YandexForm.js +2 -13
- package/build/esm/containers/Loadable/Loadable.js +1 -1
- package/build/esm/containers/Loadable/i18n/index.d.ts +1 -2
- package/build/esm/containers/Loadable/i18n/index.js +3 -3
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.js +1 -1
- package/build/esm/containers/PageConstructor/Provider.d.ts +0 -2
- package/build/esm/containers/PageConstructor/Provider.js +1 -3
- package/build/esm/context/localeContext/localeContext.d.ts +2 -2
- package/build/esm/context/localeContext/localeContext.js +1 -1
- package/build/esm/editor/components/ControlPanel/ControlPanel.js +2 -2
- package/build/esm/editor/components/ControlPanel/i18n/en.json +2 -1
- package/build/esm/editor/components/ControlPanel/i18n/index.d.ts +1 -2
- package/build/esm/editor/components/ControlPanel/i18n/index.js +3 -3
- package/build/esm/editor/components/ControlPanel/i18n/ru.json +2 -1
- package/build/esm/editor/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/build/esm/editor/components/ErrorBoundary/i18n/index.d.ts +1 -2
- package/build/esm/editor/components/ErrorBoundary/i18n/index.js +3 -3
- package/build/esm/editor/components/NotFoundBlock/NotFoundBlock.js +1 -1
- package/build/esm/editor/components/NotFoundBlock/i18n/index.d.ts +1 -2
- package/build/esm/editor/components/NotFoundBlock/i18n/index.js +3 -3
- package/build/esm/editor/containers/Form/Form.css +1 -1
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.d.ts +1 -1
- package/build/esm/hooks/useAnalytics.d.ts +2 -2
- package/build/esm/hooks/useMetrika.d.ts +1 -13
- package/build/esm/hooks/useMetrika.js +1 -38
- package/build/esm/icons/index.d.ts +0 -9
- package/build/esm/icons/index.js +0 -9
- package/build/esm/index.d.ts +0 -1
- package/build/esm/index.js +0 -1
- package/build/esm/models/common.d.ts +2 -53
- package/build/esm/models/common.js +0 -24
- package/build/esm/models/constructor-items/common.d.ts +3 -28
- package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -3
- package/build/esm/models/guards.d.ts +0 -2
- package/build/esm/models/guards.js +0 -3
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +3 -3
- package/build/esm/schema/constants.d.ts +0 -176
- package/build/esm/schema/constants.js +2 -0
- package/build/esm/schema/validators/common.d.ts +0 -188
- package/build/esm/schema/validators/common.js +0 -31
- package/build/esm/schema/validators/index.d.ts +0 -2
- package/build/esm/schema/validators/index.js +0 -2
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +6 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +5 -11
- package/build/esm/sub-blocks/BasicCard/BasicCard.css +7 -0
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +5 -11
- package/build/esm/sub-blocks/Content/Content.css +6 -2
- package/build/esm/sub-blocks/Content/Content.js +4 -11
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +0 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +1 -6
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -9
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -15
- package/build/esm/sub-blocks/PriceCard/schema.d.ts +0 -88
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.d.ts +1 -0
- package/build/esm/sub-blocks/PriceDetailed/PriceDetailed.js +2 -0
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +1 -0
- package/build/esm/sub-blocks/PriceDetailed/schema.js +1 -0
- package/build/esm/text-transform/common.d.ts +5 -5
- package/build/esm/text-transform/common.js +1 -1
- package/build/esm/text-transform/filter.js +1 -1
- package/build/esm/text-transform/transformers.d.ts +3 -3
- package/build/esm/text-transform/utils.d.ts +7 -7
- package/build/esm/text-transform/utils.js +2 -2
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
- package/package.json +16 -15
- package/server/models/common.d.ts +2 -53
- package/server/models/common.js +1 -25
- package/server/models/constructor-items/common.d.ts +3 -28
- package/server/models/constructor-items/sub-blocks.d.ts +3 -3
- package/server/models/guards.d.ts +0 -2
- package/server/models/guards.js +1 -5
- package/server/text-transform/common.d.ts +5 -5
- package/server/text-transform/common.js +1 -1
- package/server/text-transform/filter.js +1 -1
- package/server/text-transform/transformers.d.ts +3 -3
- package/server/text-transform/utils.d.ts +7 -7
- package/server/text-transform/utils.js +6 -6
- package/server/utils/index.d.ts +0 -1
- package/server/utils/index.js +1 -4
- package/styles/mixins.scss +0 -4
- package/styles/storybook/index.scss +1 -1
- package/styles/styles.css +1 -1
- package/styles/yfm.scss +1 -1
- package/widget/index.js +1 -1
- package/build/cjs/context/metrikaContext/index.d.ts +0 -1
- package/build/cjs/context/metrikaContext/index.js +0 -4
- package/build/cjs/context/metrikaContext/metrikaContext.d.ts +0 -13
- package/build/cjs/context/metrikaContext/metrikaContext.js +0 -6
- package/build/cjs/i18n.d.ts +0 -2
- package/build/cjs/i18n.js +0 -12
- package/build/cjs/icons/ArrowConstructor.d.ts +0 -2
- package/build/cjs/icons/ArrowConstructor.js +0 -9
- package/build/cjs/icons/ArrowSidebar.d.ts +0 -2
- package/build/cjs/icons/ArrowSidebar.js +0 -9
- package/build/cjs/icons/Fullscreen.d.ts +0 -2
- package/build/cjs/icons/Fullscreen.js +0 -9
- package/build/cjs/icons/Minus.d.ts +0 -2
- package/build/cjs/icons/Minus.js +0 -9
- package/build/cjs/icons/Mute.d.ts +0 -2
- package/build/cjs/icons/Mute.js +0 -12
- package/build/cjs/icons/NavigationClose.d.ts +0 -2
- package/build/cjs/icons/NavigationClose.js +0 -9
- package/build/cjs/icons/NavigationOpen.d.ts +0 -2
- package/build/cjs/icons/NavigationOpen.js +0 -11
- package/build/cjs/icons/PlayVideo.d.ts +0 -2
- package/build/cjs/icons/PlayVideo.js +0 -9
- package/build/cjs/icons/PreviewClose.d.ts +0 -2
- package/build/cjs/icons/PreviewClose.js +0 -9
- package/build/cjs/icons/Tick.d.ts +0 -2
- package/build/cjs/icons/Tick.js +0 -13
- package/build/cjs/icons/Unmute.d.ts +0 -2
- package/build/cjs/icons/Unmute.js +0 -12
- package/build/cjs/schema/validators/pixel.d.ts +0 -57
- package/build/cjs/schema/validators/pixel.js +0 -63
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/cjs/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -9
- package/build/cjs/utils/configure.d.ts +0 -12
- package/build/cjs/utils/configure.js +0 -26
- package/build/cjs/utils/registerKeyset.d.ts +0 -5
- package/build/cjs/utils/registerKeyset.js +0 -9
- package/build/cjs/utils/renderContentControls/ContentControls.css +0 -6
- package/build/cjs/utils/renderContentControls/renderContentControls.d.ts +0 -11
- package/build/cjs/utils/renderContentControls/renderContentControls.js +0 -16
- package/build/esm/context/metrikaContext/index.d.ts +0 -1
- package/build/esm/context/metrikaContext/index.js +0 -1
- package/build/esm/context/metrikaContext/metrikaContext.d.ts +0 -13
- package/build/esm/context/metrikaContext/metrikaContext.js +0 -2
- package/build/esm/i18n.d.ts +0 -2
- package/build/esm/i18n.js +0 -9
- package/build/esm/icons/ArrowConstructor.d.ts +0 -2
- package/build/esm/icons/ArrowConstructor.js +0 -4
- package/build/esm/icons/ArrowSidebar.d.ts +0 -2
- package/build/esm/icons/ArrowSidebar.js +0 -4
- package/build/esm/icons/Fullscreen.d.ts +0 -2
- package/build/esm/icons/Fullscreen.js +0 -4
- package/build/esm/icons/Minus.d.ts +0 -2
- package/build/esm/icons/Minus.js +0 -4
- package/build/esm/icons/Mute.d.ts +0 -2
- package/build/esm/icons/Mute.js +0 -7
- package/build/esm/icons/NavigationClose.d.ts +0 -2
- package/build/esm/icons/NavigationClose.js +0 -4
- package/build/esm/icons/NavigationOpen.d.ts +0 -2
- package/build/esm/icons/NavigationOpen.js +0 -6
- package/build/esm/icons/PlayVideo.d.ts +0 -2
- package/build/esm/icons/PlayVideo.js +0 -4
- package/build/esm/icons/PreviewClose.d.ts +0 -2
- package/build/esm/icons/PreviewClose.js +0 -4
- package/build/esm/icons/Tick.d.ts +0 -2
- package/build/esm/icons/Tick.js +0 -8
- package/build/esm/icons/Unmute.d.ts +0 -2
- package/build/esm/icons/Unmute.js +0 -7
- package/build/esm/schema/validators/pixel.d.ts +0 -57
- package/build/esm/schema/validators/pixel.js +0 -60
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/CardFooterControlsContainer.css +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.d.ts +0 -3
- package/build/esm/sub-blocks/renderCardFooterControlsContainer/renderCardFooterControlsContainer.js +0 -6
- package/build/esm/utils/configure.d.ts +0 -12
- package/build/esm/utils/configure.js +0 -20
- package/build/esm/utils/registerKeyset.d.ts +0 -5
- package/build/esm/utils/registerKeyset.js +0 -5
- package/build/esm/utils/renderContentControls/ContentControls.css +0 -6
- package/build/esm/utils/renderContentControls/renderContentControls.d.ts +0 -12
- package/build/esm/utils/renderContentControls/renderContentControls.js +0 -14
- package/server/utils/configure.d.ts +0 -12
- package/server/utils/configure.js +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@bem-react/classname": "^1.6.0",
|
|
84
|
-
"@gravity-ui/components": "^
|
|
85
|
-
"@gravity-ui/dynamic-forms": "^
|
|
86
|
-
"@gravity-ui/i18n": "^1.
|
|
84
|
+
"@gravity-ui/components": "^3.0.0",
|
|
85
|
+
"@gravity-ui/dynamic-forms": "^4.0.0",
|
|
86
|
+
"@gravity-ui/i18n": "^1.2.0",
|
|
87
87
|
"@react-spring/web": "^9.7.3",
|
|
88
88
|
"ajv": "^8.12.0",
|
|
89
89
|
"ajv-keywords": "^5.1.0",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"uuid": "^9.0.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"@
|
|
109
|
-
"@gravity-ui/uikit": "^
|
|
108
|
+
"@diplodoc/transform": "^4.10.4",
|
|
109
|
+
"@gravity-ui/uikit": "^6.0.0",
|
|
110
110
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
@@ -116,20 +116,21 @@
|
|
|
116
116
|
"@babel/preset-typescript": "^7.22.5",
|
|
117
117
|
"@commitlint/cli": "^17.1.2",
|
|
118
118
|
"@commitlint/config-conventional": "^17.1.0",
|
|
119
|
-
"@
|
|
119
|
+
"@diplodoc/transform": "^4.10.4",
|
|
120
120
|
"@gravity-ui/eslint-config": "^2.0.0",
|
|
121
|
-
"@gravity-ui/icons": "^2.1
|
|
121
|
+
"@gravity-ui/icons": "^2.8.1",
|
|
122
122
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
123
123
|
"@gravity-ui/stylelint-config": "^1.0.0",
|
|
124
124
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
125
|
-
"@gravity-ui/uikit": "^
|
|
126
|
-
"@storybook/addon-actions": "^7.
|
|
127
|
-
"@storybook/addon-essentials": "^7.
|
|
125
|
+
"@gravity-ui/uikit": "^6.0.0",
|
|
126
|
+
"@storybook/addon-actions": "^7.6.17",
|
|
127
|
+
"@storybook/addon-essentials": "^7.6.17",
|
|
128
128
|
"@storybook/addon-knobs": "^7.0.2",
|
|
129
|
-
"@storybook/addon-
|
|
129
|
+
"@storybook/addon-mdx-gfm": "^7.6.17",
|
|
130
|
+
"@storybook/addon-viewport": "^7.6.17",
|
|
130
131
|
"@storybook/preset-scss": "^1.0.3",
|
|
131
|
-
"@storybook/react": "^7.
|
|
132
|
-
"@storybook/react-webpack5": "^7.
|
|
132
|
+
"@storybook/react": "^7.6.17",
|
|
133
|
+
"@storybook/react-webpack5": "^7.6.17",
|
|
133
134
|
"@testing-library/jest-dom": "^5.16.5",
|
|
134
135
|
"@testing-library/react": "^13.4.0",
|
|
135
136
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -182,7 +183,7 @@
|
|
|
182
183
|
"rimraf": "^3.0.2",
|
|
183
184
|
"sass": "^1.63.6",
|
|
184
185
|
"sass-loader": "^10.4.1",
|
|
185
|
-
"storybook": "^7.
|
|
186
|
+
"storybook": "^7.6.17",
|
|
186
187
|
"string-replace-loader": "^3.1.0",
|
|
187
188
|
"style-loader": "^2.0.0",
|
|
188
189
|
"stylelint": "^14.11.0",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MetrikaGoal } from './';
|
|
3
2
|
export interface Refable<T> {
|
|
4
3
|
ref?: React.Ref<T>;
|
|
5
4
|
}
|
|
@@ -8,59 +7,9 @@ export declare enum Theme {
|
|
|
8
7
|
Dark = "dark"
|
|
9
8
|
}
|
|
10
9
|
export declare const themeNames: Record<Theme, string>;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Pixel will be deleted
|
|
13
|
-
*/
|
|
14
|
-
type PixelCommand = 'track' | 'trackCustom';
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Pixel will be deleted
|
|
17
|
-
*/
|
|
18
|
-
export interface PixelEvent {
|
|
19
|
-
command: PixelCommand;
|
|
20
|
-
event: PixelEventType | string;
|
|
21
|
-
data?: Object;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Pixel will be deleted from package
|
|
25
|
-
*/
|
|
26
|
-
export declare enum PixelEventType {
|
|
27
|
-
AddPaymentInfo = "AddPaymentInfo",
|
|
28
|
-
AddToCart = "AddToCart",
|
|
29
|
-
AddToWishlist = "AddToWishlist",
|
|
30
|
-
CompleteRegistration = "CompleteRegistration",
|
|
31
|
-
Contact = "Contact",
|
|
32
|
-
CustomizeProduct = "CustomizeProduct",
|
|
33
|
-
Donate = "Donate",
|
|
34
|
-
FindLocation = "FindLocation",
|
|
35
|
-
InitiateCheckout = "InitiateCheckout",
|
|
36
|
-
Lead = "Lead",
|
|
37
|
-
PageView = "PageView",
|
|
38
|
-
Purchase = "Purchase",
|
|
39
|
-
Schedule = "Schedule",
|
|
40
|
-
Search = "Search",
|
|
41
|
-
StartTrial = "StartTrial",
|
|
42
|
-
SubmitApplication = "SubmitApplication",
|
|
43
|
-
Subscribe = "Subscribe",
|
|
44
|
-
ViewContent = "ViewContent"
|
|
45
|
-
}
|
|
46
10
|
export type Modifiers = {
|
|
47
11
|
[name: string]: string | boolean | undefined;
|
|
48
12
|
};
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Pixel will be deleted
|
|
51
|
-
*/
|
|
52
|
-
export interface Pixel<TEvent = string> {
|
|
53
|
-
trackStandard: (event: TEvent, data?: Object) => void;
|
|
54
|
-
trackCustom: (event: string, data?: Object) => void;
|
|
55
|
-
track: (trackEvents: string | string[] | PixelEvent[] | PixelEvent) => void;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Metrika will be deleted
|
|
59
|
-
*/
|
|
60
|
-
export interface Metrika {
|
|
61
|
-
reachGoal: (counterName: string, ...args: any) => void;
|
|
62
|
-
reachGoals: (goals: MetrikaGoal, counterName?: string) => void;
|
|
63
|
-
}
|
|
64
13
|
export interface ClassNameProps {
|
|
65
14
|
className?: string;
|
|
66
15
|
}
|
|
@@ -97,7 +46,7 @@ export type AnalyticsEvent<T = {}> = T & {
|
|
|
97
46
|
context?: string;
|
|
98
47
|
target?: string;
|
|
99
48
|
};
|
|
49
|
+
export type AnalyticsEventsProp = AnalyticsEvent | AnalyticsEvent[];
|
|
100
50
|
export interface AnalyticsEventsBase {
|
|
101
|
-
analyticsEvents?:
|
|
51
|
+
analyticsEvents?: AnalyticsEventsProp;
|
|
102
52
|
}
|
|
103
|
-
export {};
|
package/server/models/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultEventNames = exports.PredefinedEventTypes = exports.
|
|
3
|
+
exports.DefaultEventNames = exports.PredefinedEventTypes = exports.themeNames = exports.Theme = void 0;
|
|
4
4
|
var Theme;
|
|
5
5
|
(function (Theme) {
|
|
6
6
|
Theme["Light"] = "light";
|
|
@@ -10,30 +10,6 @@ exports.themeNames = {
|
|
|
10
10
|
[Theme.Light]: 'Light',
|
|
11
11
|
[Theme.Dark]: 'Dark',
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Pixel will be deleted from package
|
|
15
|
-
*/
|
|
16
|
-
var PixelEventType;
|
|
17
|
-
(function (PixelEventType) {
|
|
18
|
-
PixelEventType["AddPaymentInfo"] = "AddPaymentInfo";
|
|
19
|
-
PixelEventType["AddToCart"] = "AddToCart";
|
|
20
|
-
PixelEventType["AddToWishlist"] = "AddToWishlist";
|
|
21
|
-
PixelEventType["CompleteRegistration"] = "CompleteRegistration";
|
|
22
|
-
PixelEventType["Contact"] = "Contact";
|
|
23
|
-
PixelEventType["CustomizeProduct"] = "CustomizeProduct";
|
|
24
|
-
PixelEventType["Donate"] = "Donate";
|
|
25
|
-
PixelEventType["FindLocation"] = "FindLocation";
|
|
26
|
-
PixelEventType["InitiateCheckout"] = "InitiateCheckout";
|
|
27
|
-
PixelEventType["Lead"] = "Lead";
|
|
28
|
-
PixelEventType["PageView"] = "PageView";
|
|
29
|
-
PixelEventType["Purchase"] = "Purchase";
|
|
30
|
-
PixelEventType["Schedule"] = "Schedule";
|
|
31
|
-
PixelEventType["Search"] = "Search";
|
|
32
|
-
PixelEventType["StartTrial"] = "StartTrial";
|
|
33
|
-
PixelEventType["SubmitApplication"] = "SubmitApplication";
|
|
34
|
-
PixelEventType["Subscribe"] = "Subscribe";
|
|
35
|
-
PixelEventType["ViewContent"] = "ViewContent";
|
|
36
|
-
})(PixelEventType = exports.PixelEventType || (exports.PixelEventType = {}));
|
|
37
13
|
var PredefinedEventTypes;
|
|
38
14
|
(function (PredefinedEventTypes) {
|
|
39
15
|
PredefinedEventTypes["Default"] = "default-event";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, HTMLProps, ReactNode } from 'react';
|
|
2
2
|
import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils';
|
|
4
|
-
import { AnalyticsEventsBase,
|
|
4
|
+
import { AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -125,7 +125,6 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
|
125
125
|
playButton?: PlayButtonProps;
|
|
126
126
|
controls?: MediaVideoControlsType;
|
|
127
127
|
customControlsOptions?: CustomControlsOptions;
|
|
128
|
-
metrika?: MetrikaVideo;
|
|
129
128
|
ariaLabel?: string;
|
|
130
129
|
}
|
|
131
130
|
export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
@@ -137,8 +136,6 @@ export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
|
|
|
137
136
|
colorTheme?: TextTheme;
|
|
138
137
|
arrow?: boolean;
|
|
139
138
|
target?: string;
|
|
140
|
-
metrikaGoals?: MetrikaGoal;
|
|
141
|
-
pixelEvents?: ButtonPixel;
|
|
142
139
|
extraProps?: HTMLProps<HTMLAnchorElement>;
|
|
143
140
|
}
|
|
144
141
|
export interface FileLinkProps extends ClassNameProps, Tabbable {
|
|
@@ -159,8 +156,6 @@ export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps,
|
|
|
159
156
|
primary?: boolean;
|
|
160
157
|
theme?: ButtonTheme;
|
|
161
158
|
img?: ButtonImageProps | string;
|
|
162
|
-
metrikaGoals?: MetrikaGoal;
|
|
163
|
-
pixelEvents?: ButtonPixel;
|
|
164
159
|
target?: string;
|
|
165
160
|
}
|
|
166
161
|
export type ButtonImagePosition = 'left' | 'right';
|
|
@@ -184,7 +179,6 @@ export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
|
184
179
|
video: MediaVideoProps;
|
|
185
180
|
height?: number;
|
|
186
181
|
ratio?: number;
|
|
187
|
-
metrika?: MetrikaVideo;
|
|
188
182
|
previewImg?: string;
|
|
189
183
|
}
|
|
190
184
|
export interface MediaComponentYoutubeProps {
|
|
@@ -238,23 +232,6 @@ export interface YMapMarkerLabel {
|
|
|
238
232
|
}
|
|
239
233
|
export type MapProps = GMapProps | YMapProps;
|
|
240
234
|
export type ThemedMediaProps = ThemeSupporting<MediaProps>;
|
|
241
|
-
export interface NewMetrikaGoal {
|
|
242
|
-
name: string;
|
|
243
|
-
isCrossSite?: boolean;
|
|
244
|
-
counterName?: string;
|
|
245
|
-
params?: Record<string, string>;
|
|
246
|
-
}
|
|
247
|
-
export type MetrikaGoal = string | string[] | NewMetrikaGoal[];
|
|
248
|
-
export interface MetrikaVideo {
|
|
249
|
-
counterName?: string;
|
|
250
|
-
play?: MetrikaGoal;
|
|
251
|
-
stop?: MetrikaGoal;
|
|
252
|
-
}
|
|
253
|
-
export interface ButtonPixelEvent {
|
|
254
|
-
name: PixelEventType;
|
|
255
|
-
data?: Object;
|
|
256
|
-
}
|
|
257
|
-
export type ButtonPixel = ButtonPixelEvent[];
|
|
258
235
|
export interface DataLensObjectProps {
|
|
259
236
|
id: string;
|
|
260
237
|
theme: 'dark' | 'light';
|
|
@@ -279,8 +256,7 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
279
256
|
text: ReactNode;
|
|
280
257
|
}[];
|
|
281
258
|
theme?: TextTheme;
|
|
282
|
-
|
|
283
|
-
pixelEvents?: ButtonPixel;
|
|
259
|
+
analyticsEvents?: AnalyticsEventsProp;
|
|
284
260
|
}
|
|
285
261
|
export interface TitleItemProps extends Justifyable, TitleItemBaseProps {
|
|
286
262
|
navTitle?: string;
|
|
@@ -331,6 +307,7 @@ export interface PriceFoldableDetailsProps {
|
|
|
331
307
|
size?: TextSize;
|
|
332
308
|
titleColor?: PriceDescriptionColor;
|
|
333
309
|
}
|
|
310
|
+
/** @deprecated */
|
|
334
311
|
export interface PriceDetailedProps extends CardBaseProps {
|
|
335
312
|
items: PriceItemProps[];
|
|
336
313
|
description?: {
|
|
@@ -373,8 +350,6 @@ export interface YandexFormProps extends AnalyticsEventsBase {
|
|
|
373
350
|
};
|
|
374
351
|
onSubmit?: () => void;
|
|
375
352
|
onLoad?: () => void;
|
|
376
|
-
metrikaGoals?: string | string[];
|
|
377
|
-
pixelEvents?: string | string[] | PixelEvent | PixelEvent[];
|
|
378
353
|
}
|
|
379
354
|
export interface WithBorder {
|
|
380
355
|
border?: MediaBorder;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ClassNameProps, QuoteType } from '../../models';
|
|
2
2
|
import { ThemeSupporting } from '../../utils';
|
|
3
3
|
import { HubspotEventData, HubspotEventHandlers } from '../../utils/hubspot';
|
|
4
|
-
import { AnalyticsEventsBase
|
|
4
|
+
import { AnalyticsEventsBase } from '../common';
|
|
5
5
|
import { ContentBlockProps } from './blocks';
|
|
6
|
-
import { AuthorItem,
|
|
6
|
+
import { AuthorItem, ButtonProps, CardBaseProps, CardLayoutProps, ContentTheme, DividerSize, ImageCardMargins, ImageObjectProps, ImageProps, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from './common';
|
|
7
7
|
export declare enum SubBlockType {
|
|
8
8
|
Divider = "divider",
|
|
9
9
|
Quote = "quote",
|
|
@@ -70,7 +70,6 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
70
70
|
* To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame
|
|
71
71
|
*/
|
|
72
72
|
onLoad?: (arg: HubspotEventData) => void;
|
|
73
|
-
pixelEvents?: string | string[] | PixelEvent | PixelEvent[] | ButtonPixel;
|
|
74
73
|
hubspotEvents?: string[];
|
|
75
74
|
createDOMElement?: boolean;
|
|
76
75
|
}
|
|
@@ -161,6 +160,7 @@ export type LayoutItemModel = {
|
|
|
161
160
|
export type BackgroundCardModel = {
|
|
162
161
|
type: SubBlockType.BackgroundCard;
|
|
163
162
|
} & BackgroundCardProps;
|
|
163
|
+
/** @deprecated */
|
|
164
164
|
export type PriceDetailedModel = {
|
|
165
165
|
type: SubBlockType.PriceDetailed;
|
|
166
166
|
} & PriceDetailedProps;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Block, ConstructorItem, FormBlockData, FormBlockHubspotData, FormBlockYandexData } from './';
|
|
2
|
-
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
2
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
|
-
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
3
|
export declare function isYandexDataForm(data: FormBlockData): data is FormBlockYandexData;
|
|
6
4
|
export declare function isHubspotDataForm(data: FormBlockData): data is FormBlockHubspotData;
|
package/server/models/guards.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isHubspotDataForm = exports.isYandexDataForm = exports.
|
|
3
|
+
exports.isHubspotDataForm = exports.isYandexDataForm = exports.isBlock = void 0;
|
|
4
4
|
const _1 = require("./");
|
|
5
5
|
function isBlock(block) {
|
|
6
6
|
return block.type in _1.BlockTypes;
|
|
7
7
|
}
|
|
8
8
|
exports.isBlock = isBlock;
|
|
9
|
-
function isNewMetrikaFormat(metrika) {
|
|
10
|
-
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
11
|
-
}
|
|
12
|
-
exports.isNewMetrikaFormat = isNewMetrikaFormat;
|
|
13
9
|
function isYandexDataForm(data) {
|
|
14
10
|
return Boolean(data.yandex);
|
|
15
11
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { MarkdownItPluginCb } from '@
|
|
2
|
-
import { Lang } from '
|
|
1
|
+
import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
|
|
2
|
+
import { Lang } from '@gravity-ui/uikit';
|
|
3
3
|
export type ComplexItem = {
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
};
|
|
6
6
|
export type Item = string | null | ComplexItem;
|
|
7
7
|
export type Transformer = (text: string) => string;
|
|
8
|
-
export type TransformerRaw = (lang: Lang
|
|
8
|
+
export type TransformerRaw = (lang: `${Lang}`, content: string, options: {
|
|
9
9
|
plugins: MarkdownItPluginCb[];
|
|
10
10
|
}) => string;
|
|
11
11
|
export type Parser<T = any> = (transformer: Transformer, block: T) => T;
|
|
12
12
|
export declare const createItemsParser: (fields: string[]) => (transformer: Transformer, items: Item[]) => (string | {
|
|
13
13
|
[x: string]: string;
|
|
14
14
|
} | null)[];
|
|
15
|
-
export declare function yfmTransformer(lang: Lang
|
|
15
|
+
export declare function yfmTransformer(lang: `${Lang}`, content: string, options?: {
|
|
16
16
|
plugins?: MarkdownItPluginCb[];
|
|
17
17
|
}): string;
|
|
18
|
-
export declare function typografTransformer(lang: Lang
|
|
18
|
+
export declare function typografTransformer(lang: `${Lang}`, content: string): string;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.typografTransformer = exports.yfmTransformer = exports.createItemsParser = void 0;
|
|
7
|
-
const plugins_1 = __importDefault(require("@
|
|
7
|
+
const plugins_1 = __importDefault(require("@diplodoc/transform/lib/plugins"));
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
9
|
const createItemsParser = (fields) => (transformer, items) => items.map((item) => {
|
|
10
10
|
if (!item) {
|
|
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.filterContent = void 0;
|
|
9
|
-
const evaluation_1 = __importDefault(require("@
|
|
9
|
+
const evaluation_1 = __importDefault(require("@diplodoc/transform/lib/liquid/evaluation"));
|
|
10
10
|
function filterItems(items, vars, propertyName) {
|
|
11
11
|
if (!Array.isArray(items)) {
|
|
12
12
|
throw new Error(`Error while filtering: items has invalid key '${propertyName}' equals ${JSON.stringify(items)}`);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { MarkdownItPluginCb } from '@
|
|
1
|
+
import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings';
|
|
2
|
+
import { Lang } from '@gravity-ui/uikit';
|
|
2
3
|
import { ConstructorBlock } from '../models/constructor';
|
|
3
|
-
import { Lang } from '../utils/configure';
|
|
4
4
|
export type ContentVariables = Record<string, string>;
|
|
5
5
|
export type ContentTransformerProps = {
|
|
6
6
|
content: {
|
|
7
7
|
blocks?: ConstructorBlock[];
|
|
8
8
|
};
|
|
9
9
|
options: {
|
|
10
|
-
lang: Lang
|
|
10
|
+
lang: `${Lang}`;
|
|
11
11
|
customConfig?: {};
|
|
12
12
|
vars?: ContentVariables;
|
|
13
13
|
plugins?: MarkdownItPluginCb[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Options, Output } from '@
|
|
1
|
+
import { Options, Output } from '@diplodoc/transform';
|
|
2
|
+
import { Lang } from '@gravity-ui/uikit';
|
|
2
3
|
import sanitize from 'sanitize-html';
|
|
3
|
-
import { Lang } from '../utils/configure';
|
|
4
4
|
import AddRuleOptions = typograf.AddRuleOptions;
|
|
5
5
|
export declare enum TransformType {
|
|
6
6
|
Text = "text",
|
|
7
7
|
Html = "html"
|
|
8
8
|
}
|
|
9
9
|
interface TransformOptions extends Options {
|
|
10
|
-
lang: Lang
|
|
10
|
+
lang: `${Lang}`;
|
|
11
11
|
}
|
|
12
12
|
export declare const DEFAULT_ALLOWED_TAGS: string[];
|
|
13
13
|
export declare const typografConfig: {
|
|
@@ -16,16 +16,16 @@ export declare const typografConfig: {
|
|
|
16
16
|
};
|
|
17
17
|
export declare const sanitizeStripOptions: sanitize.IOptions;
|
|
18
18
|
export declare function addTypografRules(options: AddRuleOptions[]): void;
|
|
19
|
-
export declare function typograf(text: string, lang?: Lang): string;
|
|
19
|
+
export declare function typograf(text: string, lang?: `${Lang}`): string;
|
|
20
20
|
export declare function sanitizeHtml(html: string, options?: sanitize.IOptions): string;
|
|
21
|
-
export declare function typografToHTML(text: string, lang: Lang
|
|
22
|
-
export declare function typografToText(text: string, lang: Lang): string;
|
|
21
|
+
export declare function typografToHTML(text: string, lang: `${Lang}`, allowedTags?: string[]): string;
|
|
22
|
+
export declare function typografToText(text: string, lang: `${Lang}`): string;
|
|
23
23
|
export declare const transformMarkdown: (input: string, options: TransformOptions) => Output['result'];
|
|
24
24
|
export declare function fullTransform(input: string, { lang, ...options }: TransformOptions): Output['result'];
|
|
25
25
|
export interface TypografEntityParams {
|
|
26
26
|
entity: Record<string, string>;
|
|
27
27
|
fields: string[];
|
|
28
|
-
lang: Lang
|
|
28
|
+
lang: `${Lang}`;
|
|
29
29
|
transformType: TransformType;
|
|
30
30
|
}
|
|
31
31
|
export declare function typografEntity({ entity, fields, lang, transformType, }: TypografEntityParams): Record<string, string>;
|
|
@@ -15,10 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.addTypografRules = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
|
|
18
|
-
const transform_1 = __importDefault(require("@
|
|
18
|
+
const transform_1 = __importDefault(require("@diplodoc/transform"));
|
|
19
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
19
20
|
const sanitize_html_1 = __importDefault(require("sanitize-html"));
|
|
20
21
|
const typograf_1 = __importDefault(require("typograf"));
|
|
21
|
-
const configure_1 = require("../utils/configure");
|
|
22
22
|
var TransformType;
|
|
23
23
|
(function (TransformType) {
|
|
24
24
|
TransformType["Text"] = "text";
|
|
@@ -61,10 +61,10 @@ function enableRules(tp) {
|
|
|
61
61
|
enabled.forEach((rule) => tp.enableRule(rule));
|
|
62
62
|
disabled.forEach((rule) => tp.disableRule(rule));
|
|
63
63
|
}
|
|
64
|
-
function typograf(text, lang =
|
|
64
|
+
function typograf(text, lang = uikit_1.Lang.Ru) {
|
|
65
65
|
const localeByLang = {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
66
|
+
[uikit_1.Lang.Ru]: ['ru', 'en-US'],
|
|
67
|
+
[uikit_1.Lang.En]: ['en-US', 'ru'],
|
|
68
68
|
};
|
|
69
69
|
const tp = new typograf_1.default({
|
|
70
70
|
locale: localeByLang[lang],
|
|
@@ -98,7 +98,7 @@ function fullTransform(input, _a) {
|
|
|
98
98
|
return Object.assign(Object.assign({}, result), { html: typograf(html, lang), title: title && typograf(title, lang) });
|
|
99
99
|
}
|
|
100
100
|
exports.fullTransform = fullTransform;
|
|
101
|
-
function typografEntity({ entity, fields, lang =
|
|
101
|
+
function typografEntity({ entity, fields, lang = uikit_1.Lang.Ru, transformType = TransformType.Text, }) {
|
|
102
102
|
const transformTypeMap = {
|
|
103
103
|
text: typografToText,
|
|
104
104
|
html: typografToHTML,
|
package/server/utils/index.d.ts
CHANGED
|
@@ -5,6 +5,5 @@ export * from './url';
|
|
|
5
5
|
export * from './cn';
|
|
6
6
|
export * from './url';
|
|
7
7
|
export * from './theme';
|
|
8
|
-
export { Lang, configure } from './configure';
|
|
9
8
|
export type { HubspotEventData, HubspotEventHandlers, HubspotEventName } from './hubspot';
|
|
10
9
|
export { isHubspotEventData } from './hubspot';
|
package/server/utils/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isHubspotEventData =
|
|
17
|
+
exports.isHubspotEventData = void 0;
|
|
18
18
|
__exportStar(require("./common"), exports);
|
|
19
19
|
__exportStar(require("./analytics"), exports);
|
|
20
20
|
__exportStar(require("./blocks"), exports);
|
|
@@ -22,8 +22,5 @@ __exportStar(require("./url"), exports);
|
|
|
22
22
|
__exportStar(require("./cn"), exports);
|
|
23
23
|
__exportStar(require("./url"), exports);
|
|
24
24
|
__exportStar(require("./theme"), exports);
|
|
25
|
-
var configure_1 = require("./configure");
|
|
26
|
-
Object.defineProperty(exports, "Lang", { enumerable: true, get: function () { return configure_1.Lang; } });
|
|
27
|
-
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return configure_1.configure; } });
|
|
28
25
|
var hubspot_1 = require("./hubspot");
|
|
29
26
|
Object.defineProperty(exports, "isHubspotEventData", { enumerable: true, get: function () { return hubspot_1.isHubspotEventData; } });
|
package/styles/mixins.scss
CHANGED
|
@@ -496,10 +496,6 @@ unpredictable css rules order in build */
|
|
|
496
496
|
--g-button-background-color: #{$backgroundColor};
|
|
497
497
|
--g-button-background-color-hover: #{$hoverBackgroundColor};
|
|
498
498
|
|
|
499
|
-
//old named variables still in use in uikit, will be removed in next major ver
|
|
500
|
-
--yc-button-background-color: #{$backgroundColor};
|
|
501
|
-
--yc-button-background-color-hover: #{$hoverBackgroundColor};
|
|
502
|
-
|
|
503
499
|
&,
|
|
504
500
|
&:link,
|
|
505
501
|
&:visited,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import './common';
|
|
4
4
|
@import './palette';
|
|
5
5
|
@import './typography';
|
|
6
|
-
@import '~@
|
|
6
|
+
@import '~@diplodoc/transform/dist/css/yfm.css';
|
|
7
7
|
/**
|
|
8
8
|
* storybook-host container style overrides
|
|
9
9
|
* @see {@link https://github.com/philcockfield/storybook-host/issues/43}
|
package/styles/styles.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
@import '@gravity-ui/uikit/styles/fonts.css';
|
|
3
3
|
@import '~@gravity-ui/uikit/styles/styles.css';
|
|
4
|
-
@import '~@
|
|
4
|
+
@import '~@diplodoc/transform/dist/css/yfm.css';
|
|
5
5
|
/* use this for style redefinitions to awoid problems with
|
|
6
6
|
unpredictable css rules order in build */
|
|
7
7
|
/* use this for style redefinitions to awoid problems with
|
package/styles/yfm.scss
CHANGED