@gravity-ui/page-constructor 4.1.2 → 4.3.12-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/build/cjs/blocks/CardLayout/CardLayout.d.ts +2 -2
- package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
- package/build/cjs/blocks/ContentLayout/schema.d.ts +38 -0
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +7 -3
- package/build/cjs/blocks/Header/Header.css +0 -6
- package/build/cjs/blocks/Icons/Icons.js +7 -1
- package/build/cjs/blocks/Icons/schema.d.ts +162 -0
- package/build/cjs/blocks/Icons/schema.js +11 -0
- package/build/cjs/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +2 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +27 -0
- package/build/cjs/blocks/Questions/Questions.css +0 -48
- package/build/cjs/blocks/Questions/Questions.js +7 -27
- package/build/cjs/blocks/Questions/models.d.ts +10 -0
- package/build/cjs/blocks/Questions/models.js +13 -0
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -1
- package/build/cjs/blocks/Slider/Slider.css +4 -1
- package/build/cjs/blocks/Slider/Slider.js +32 -6
- package/build/cjs/blocks/Slider/i18n/en.json +4 -0
- package/build/cjs/blocks/Slider/i18n/index.d.ts +2 -0
- package/build/cjs/blocks/Slider/i18n/index.js +8 -0
- package/build/cjs/blocks/Slider/i18n/ru.json +4 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +2 -1
- package/build/cjs/components/BackLink/BackLink.js +2 -2
- package/build/cjs/components/BackgroundImage/BackgroundImage.d.ts +1 -0
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +5 -2
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +4 -3
- package/build/cjs/components/ButtonTabs/ButtonTabs.js +6 -1
- package/build/cjs/components/CardBase/CardBase.css +4 -4
- package/build/cjs/components/FileLink/FileLink.js +2 -2
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/cjs/components/FullscreenImage/i18n/en.json +2 -1
- package/build/cjs/components/FullscreenImage/i18n/ru.json +2 -1
- package/build/cjs/components/HTML/HTML.d.ts +5 -1
- package/build/cjs/components/HTML/HTML.js +3 -1
- package/build/cjs/components/Image/Image.js +7 -5
- package/build/cjs/components/Image/i18n/en.json +1 -1
- package/build/cjs/components/Image/i18n/ru.json +1 -1
- package/build/cjs/components/Image/schema.d.ts +19 -0
- package/build/cjs/components/Image/schema.js +12 -1
- package/build/cjs/components/Link/Link.d.ts +3 -2
- package/build/cjs/components/Link/Link.js +8 -6
- package/build/cjs/components/Media/Image/Image.d.ts +3 -2
- package/build/cjs/components/Media/Image/Image.js +8 -5
- package/build/cjs/components/Media/Media.d.ts +2 -2
- package/build/cjs/components/Media/Media.js +9 -7
- package/build/cjs/components/Media/Video/Video.d.ts +2 -2
- package/build/cjs/components/Media/Video/Video.js +15 -6
- package/build/cjs/components/MetaInfo/MetaInfo.css +0 -2
- package/build/cjs/components/MetaInfo/MetaInfo.js +2 -1
- package/build/cjs/components/ReactPlayer/CustomBarControls.css +46 -14
- package/build/cjs/components/ReactPlayer/CustomBarControls.d.ts +4 -1
- package/build/cjs/components/ReactPlayer/CustomBarControls.js +33 -9
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +12 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +52 -27
- package/build/cjs/components/ReactPlayer/i18n/en.json +6 -0
- package/build/cjs/components/ReactPlayer/i18n/index.d.ts +2 -0
- package/build/cjs/components/ReactPlayer/i18n/index.js +8 -0
- package/build/cjs/components/ReactPlayer/i18n/ru.json +6 -0
- package/build/cjs/components/Table/Table.js +11 -5
- package/build/cjs/components/VideoBlock/VideoBlock.js +7 -6
- package/build/cjs/components/YFMWrapper/YFMWrapper.d.ts +4 -3
- package/build/cjs/components/YFMWrapper/YFMWrapper.js +3 -3
- package/build/cjs/components/constants.d.ts +0 -4
- package/build/cjs/components/constants.js +1 -5
- package/build/cjs/constructor-items.d.ts +10 -3
- package/build/cjs/constructor-items.js +11 -1
- package/build/cjs/containers/Loadable/Loadable.js +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.css +4 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +2 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js +10 -6
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +3 -2
- package/build/cjs/context/innerContext/InnerContext.d.ts +3 -1
- package/build/cjs/context/innerContext/InnerContext.js +2 -0
- package/build/cjs/editor/components/AddBlock/AddBlock.css +1 -1
- package/build/cjs/editor/components/EditBlock/EditBlock.css +1 -0
- package/build/cjs/editor/components/Layout/Layout.css +2 -1
- package/build/cjs/editor/containers/Form/Form.css +14 -35
- package/build/cjs/editor/store/index.js +1 -1
- package/build/cjs/editor/styles/root.css +2 -1
- package/build/cjs/editor/utils/index.d.ts +1 -0
- package/build/cjs/grid/Col/Col.d.ts +3 -4
- package/build/cjs/grid/Col/Col.js +2 -2
- package/build/cjs/icons/Mute.d.ts +2 -0
- package/build/cjs/icons/Mute.js +12 -0
- package/build/cjs/icons/MuteSmall.d.ts +2 -0
- package/build/cjs/icons/MuteSmall.js +15 -0
- package/build/cjs/icons/Unmute.d.ts +2 -0
- package/build/cjs/icons/Unmute.js +12 -0
- package/build/cjs/icons/UnmuteSmall.d.ts +2 -0
- package/build/cjs/icons/UnmuteSmall.js +17 -0
- package/build/cjs/icons/VideoControlPause.d.ts +2 -0
- package/build/cjs/icons/VideoControlPause.js +16 -0
- package/build/cjs/icons/VideoControlPlay.d.ts +2 -0
- package/build/cjs/icons/VideoControlPlay.js +12 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +16 -5
- package/build/cjs/models/constructor-items/common.d.ts +22 -36
- package/build/cjs/models/constructor-items/common.js +6 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/cjs/models/constructor.d.ts +7 -1
- package/build/cjs/models/navigation.d.ts +1 -0
- package/build/cjs/models/navigation.js +2 -1
- package/build/cjs/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +1 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +4 -16
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
- package/build/cjs/navigation/components/NavigationItem/index.d.ts +6 -0
- package/build/cjs/navigation/components/NavigationItem/index.js +14 -0
- package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
- package/build/cjs/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
- package/build/cjs/navigation/components/SocialIcon/SocialIcon.js +2 -1
- package/build/cjs/schema/constants.d.ts +181 -78
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +100 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +10 -0
- package/build/cjs/sub-blocks/Content/Content.d.ts +3 -1
- package/build/cjs/sub-blocks/Content/Content.js +7 -5
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
- package/build/cjs/sub-blocks/Content/ContentList/ContentList.js +17 -5
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +3 -3
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +81 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/cjs/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/cjs/sub-blocks/MediaCard/MediaCard.js +2 -2
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +81 -78
- package/build/cjs/sub-blocks/MediaCard/schema.js +11 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
- package/build/cjs/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +7 -4
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +11 -1
- package/build/cjs/sub-blocks/Quote/Quote.css +0 -3
- package/build/cjs/text-transform/common.d.ts +7 -2
- package/build/cjs/text-transform/common.js +8 -2
- package/build/cjs/text-transform/config.js +1 -1
- package/build/cjs/text-transform/transformers.d.ts +2 -0
- package/build/cjs/text-transform/transformers.js +11 -8
- package/build/cjs/utils/blocks.d.ts +4 -7
- package/build/cjs/utils/blocks.js +27 -18
- package/build/cjs/utils/cn.d.ts +3 -3
- package/build/cjs/utils/cn.js +4 -7
- package/build/esm/blocks/CardLayout/CardLayout.d.ts +2 -2
- package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
- package/build/esm/blocks/ContentLayout/schema.d.ts +38 -0
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +7 -3
- package/build/esm/blocks/Header/Header.css +0 -6
- package/build/esm/blocks/Icons/Icons.js +8 -2
- package/build/esm/blocks/Icons/schema.d.ts +162 -0
- package/build/esm/blocks/Icons/schema.js +11 -0
- package/build/esm/blocks/PromoFeaturesBlock/PromoFeaturesBlock.js +1 -1
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +50 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.d.ts +3 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +23 -0
- package/build/esm/blocks/Questions/Questions.css +0 -48
- package/build/esm/blocks/Questions/Questions.js +6 -26
- package/build/esm/blocks/Questions/models.d.ts +10 -0
- package/build/esm/blocks/Questions/models.js +10 -0
- package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -1
- package/build/esm/blocks/Slider/Slider.css +4 -1
- package/build/esm/blocks/Slider/Slider.js +33 -7
- package/build/esm/blocks/Slider/i18n/en.json +4 -0
- package/build/esm/blocks/Slider/i18n/index.d.ts +2 -0
- package/build/esm/blocks/Slider/i18n/index.js +5 -0
- package/build/esm/blocks/Slider/i18n/ru.json +4 -0
- package/build/esm/components/BackLink/BackLink.d.ts +2 -1
- package/build/esm/components/BackLink/BackLink.js +2 -2
- package/build/esm/components/BackgroundImage/BackgroundImage.d.ts +1 -0
- package/build/esm/components/BackgroundImage/BackgroundImage.js +5 -3
- package/build/esm/components/BackgroundMedia/BackgroundMedia.d.ts +1 -1
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +5 -4
- package/build/esm/components/ButtonTabs/ButtonTabs.js +6 -1
- package/build/esm/components/CardBase/CardBase.css +4 -4
- package/build/esm/components/FileLink/FileLink.js +2 -2
- package/build/esm/components/FullscreenImage/FullscreenImage.js +1 -1
- package/build/esm/components/FullscreenImage/i18n/en.json +2 -1
- package/build/esm/components/FullscreenImage/i18n/ru.json +2 -1
- package/build/esm/components/HTML/HTML.d.ts +5 -1
- package/build/esm/components/HTML/HTML.js +3 -1
- package/build/esm/components/Image/Image.js +7 -5
- package/build/esm/components/Image/i18n/en.json +1 -1
- package/build/esm/components/Image/i18n/ru.json +1 -1
- package/build/esm/components/Image/schema.d.ts +19 -0
- package/build/esm/components/Image/schema.js +12 -1
- package/build/esm/components/Link/Link.d.ts +3 -2
- package/build/esm/components/Link/Link.js +9 -7
- package/build/esm/components/Media/Image/Image.d.ts +3 -2
- package/build/esm/components/Media/Image/Image.js +8 -6
- package/build/esm/components/Media/Media.d.ts +2 -2
- package/build/esm/components/Media/Media.js +10 -8
- package/build/esm/components/Media/Video/Video.d.ts +2 -2
- package/build/esm/components/Media/Video/Video.js +16 -7
- package/build/esm/components/MetaInfo/MetaInfo.css +0 -2
- package/build/esm/components/MetaInfo/MetaInfo.js +2 -1
- package/build/esm/components/ReactPlayer/CustomBarControls.css +46 -14
- package/build/esm/components/ReactPlayer/CustomBarControls.d.ts +4 -1
- package/build/esm/components/ReactPlayer/CustomBarControls.js +34 -10
- package/build/esm/components/ReactPlayer/ReactPlayer.css +12 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +55 -30
- package/build/esm/components/ReactPlayer/i18n/en.json +6 -0
- package/build/esm/components/ReactPlayer/i18n/index.d.ts +2 -0
- package/build/esm/components/ReactPlayer/i18n/index.js +5 -0
- package/build/esm/components/ReactPlayer/i18n/ru.json +6 -0
- package/build/esm/components/Table/Table.js +11 -5
- package/build/esm/components/VideoBlock/VideoBlock.js +7 -6
- package/build/esm/components/YFMWrapper/YFMWrapper.d.ts +4 -3
- package/build/esm/components/YFMWrapper/YFMWrapper.js +3 -3
- package/build/esm/components/constants.d.ts +0 -4
- package/build/esm/components/constants.js +0 -4
- package/build/esm/constructor-items.d.ts +10 -3
- package/build/esm/constructor-items.js +10 -1
- package/build/esm/containers/Loadable/Loadable.js +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +4 -0
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +2 -1
- package/build/esm/containers/PageConstructor/PageConstructor.js +12 -8
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.css +38 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.d.ts +1 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +4 -2
- package/build/esm/context/innerContext/InnerContext.d.ts +3 -1
- package/build/esm/context/innerContext/InnerContext.js +2 -0
- package/build/esm/editor/components/AddBlock/AddBlock.css +1 -1
- package/build/esm/editor/components/EditBlock/EditBlock.css +1 -0
- package/build/esm/editor/components/Layout/Layout.css +2 -1
- package/build/esm/editor/containers/Form/Form.css +14 -35
- package/build/esm/editor/store/index.js +2 -2
- package/build/esm/editor/styles/root.css +2 -1
- package/build/esm/editor/utils/index.d.ts +1 -0
- package/build/esm/grid/Col/Col.d.ts +3 -4
- package/build/esm/grid/Col/Col.js +2 -2
- package/build/esm/icons/Mute.d.ts +2 -0
- package/build/esm/icons/Mute.js +7 -0
- package/build/esm/icons/MuteSmall.d.ts +2 -0
- package/build/esm/icons/MuteSmall.js +10 -0
- package/build/esm/icons/Unmute.d.ts +2 -0
- package/build/esm/icons/Unmute.js +7 -0
- package/build/esm/icons/UnmuteSmall.d.ts +2 -0
- package/build/esm/icons/UnmuteSmall.js +12 -0
- package/build/esm/icons/VideoControlPause.d.ts +2 -0
- package/build/esm/icons/VideoControlPause.js +11 -0
- package/build/esm/icons/VideoControlPlay.d.ts +2 -0
- package/build/esm/icons/VideoControlPlay.js +7 -0
- package/build/esm/models/constructor-items/blocks.d.ts +16 -5
- package/build/esm/models/constructor-items/common.d.ts +22 -36
- package/build/esm/models/constructor-items/common.js +5 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -4
- package/build/esm/models/constructor.d.ts +7 -1
- package/build/esm/models/navigation.d.ts +1 -0
- package/build/esm/models/navigation.js +1 -0
- package/build/esm/navigation/components/MobileMenuButton/MobileMenuButton.js +1 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +1 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -17
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.js +1 -1
- package/build/esm/navigation/components/NavigationItem/index.d.ts +6 -0
- package/build/esm/navigation/components/NavigationItem/index.js +6 -0
- package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
- package/build/esm/navigation/components/NavigationPopup/NavigationPopup.js +1 -1
- package/build/esm/navigation/components/SocialIcon/SocialIcon.js +2 -1
- package/build/esm/schema/constants.d.ts +181 -78
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +2 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +100 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.js +10 -0
- package/build/esm/sub-blocks/Content/Content.d.ts +3 -1
- package/build/esm/sub-blocks/Content/Content.js +7 -5
- package/build/esm/sub-blocks/Content/ContentList/ContentList.d.ts +2 -1
- package/build/esm/sub-blocks/Content/ContentList/ContentList.js +17 -5
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +2 -2
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +3 -3
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +81 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +10 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -0
- package/build/esm/sub-blocks/MediaCard/MediaCard.d.ts +1 -1
- package/build/esm/sub-blocks/MediaCard/MediaCard.js +2 -2
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +81 -78
- package/build/esm/sub-blocks/MediaCard/schema.js +11 -1
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.d.ts +2 -2
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +2 -2
- package/build/esm/sub-blocks/PriceDetailed/SeparatePriceDetailed/SeparatePriceDetailed.js +8 -4
- package/build/esm/sub-blocks/PriceDetailed/schema.js +11 -1
- package/build/esm/sub-blocks/Quote/Quote.css +0 -3
- package/build/esm/text-transform/common.d.ts +7 -2
- package/build/esm/text-transform/common.js +7 -2
- package/build/esm/text-transform/config.js +1 -1
- package/build/esm/text-transform/transformers.d.ts +2 -0
- package/build/esm/text-transform/transformers.js +11 -8
- package/build/esm/utils/blocks.d.ts +4 -7
- package/build/esm/utils/blocks.js +23 -13
- package/build/esm/utils/cn.d.ts +3 -3
- package/build/esm/utils/cn.js +3 -4
- package/package.json +7 -7
- package/server/components/constants.d.ts +0 -4
- package/server/components/constants.js +1 -5
- package/server/models/constructor-items/blocks.d.ts +16 -5
- package/server/models/constructor-items/common.d.ts +22 -36
- package/server/models/constructor-items/common.js +6 -1
- package/server/models/constructor-items/sub-blocks.d.ts +4 -4
- package/server/models/constructor.d.ts +7 -1
- package/server/models/navigation.d.ts +1 -0
- package/server/models/navigation.js +2 -1
- package/server/text-transform/common.d.ts +7 -2
- package/server/text-transform/common.js +10 -2
- package/server/text-transform/config.js +1 -1
- package/server/text-transform/transformers.d.ts +2 -0
- package/server/text-transform/transformers.js +11 -8
- package/server/utils/blocks.d.ts +4 -7
- package/server/utils/blocks.js +27 -18
- package/server/utils/cn.d.ts +3 -3
- package/server/utils/cn.js +4 -9
- package/styles/mixins.scss +4 -1
- package/styles/storybook/common.scss +2 -0
- package/styles/styles.css +4 -0
- package/styles/yfm.scss +7 -0
- package/widget/index.js +1 -1
|
@@ -8,7 +8,8 @@ const ReactPlayer_1 = tslib_1.__importDefault(require("../../ReactPlayer/ReactPl
|
|
|
8
8
|
const utils_2 = require("./utils");
|
|
9
9
|
const b = (0, utils_1.block)('media-component-video');
|
|
10
10
|
const Video = (props) => {
|
|
11
|
-
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, } = props;
|
|
11
|
+
const { video, height, metrika, analyticsEvents, previewImg, playButton: commonPlayButton, customBarControlsClassName, videoClassName, playVideo, setHasVideoFallback, hasVideoFallback, qa, } = props;
|
|
12
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'source');
|
|
12
13
|
const ref = (0, react_1.useRef)(null);
|
|
13
14
|
(0, react_1.useEffect)(() => {
|
|
14
15
|
if (ref && ref.current) {
|
|
@@ -30,8 +31,8 @@ const Video = (props) => {
|
|
|
30
31
|
}
|
|
31
32
|
}, [playVideo, video, setHasVideoFallback]);
|
|
32
33
|
const reactPlayerBlock = (0, react_1.useMemo)(() => {
|
|
33
|
-
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton } = video;
|
|
34
|
-
return (react_1.default.createElement(ReactPlayer_1.default, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height }));
|
|
34
|
+
const { src, loop, controls, muted, autoplay = true, elapsedTime, playButton, ariaLabel, customControlsOptions, } = video;
|
|
35
|
+
return (react_1.default.createElement(ReactPlayer_1.default, { className: b('react-player', videoClassName), src: src, previewImgUrl: previewImg, loop: Boolean(loop), controls: controls, muted: muted, autoplay: autoplay && playVideo, elapsedTime: elapsedTime, playButton: playButton || commonPlayButton, customBarControlsClassName: customBarControlsClassName, metrika: metrika, analyticsEvents: analyticsEvents, height: height, ariaLabel: ariaLabel, customControlsOptions: customControlsOptions }));
|
|
35
36
|
}, [
|
|
36
37
|
video,
|
|
37
38
|
height,
|
|
@@ -44,12 +45,20 @@ const Video = (props) => {
|
|
|
44
45
|
analyticsEvents,
|
|
45
46
|
]);
|
|
46
47
|
const defaultVideoBlock = (0, react_1.useMemo)(() => {
|
|
47
|
-
return video.src.length && !hasVideoFallback ? (react_1.default.createElement("div", { className: b('wrap', videoClassName), style: { height } },
|
|
48
|
+
return video.src.length && !hasVideoFallback ? (react_1.default.createElement("div", { className: b('wrap', videoClassName), style: { height }, "data-qa": qaAttributes.default },
|
|
48
49
|
react_1.default.createElement("video", { disablePictureInPicture: true, playsInline: true,
|
|
49
50
|
// @ts-ignore
|
|
50
51
|
// eslint-disable-next-line react/no-unknown-property
|
|
51
|
-
pip: "false", className: b('item'), ref: ref, preload: "metadata", muted: true }, (0, utils_2.getVideoTypesWithPriority)(video.src).map(({ src, type }, index) => (react_1.default.createElement("source", { key: index, src: src, type: type })))))) : null;
|
|
52
|
-
}, [
|
|
52
|
+
pip: "false", className: b('item'), ref: ref, preload: "metadata", muted: true, "aria-label": video.ariaLabel }, (0, utils_2.getVideoTypesWithPriority)(video.src).map(({ src, type }, index) => (react_1.default.createElement("source", { key: index, src: src, type: type, "data-qa": qaAttributes.source })))))) : null;
|
|
53
|
+
}, [
|
|
54
|
+
video.src,
|
|
55
|
+
video.ariaLabel,
|
|
56
|
+
hasVideoFallback,
|
|
57
|
+
videoClassName,
|
|
58
|
+
height,
|
|
59
|
+
qaAttributes.default,
|
|
60
|
+
qaAttributes.source,
|
|
61
|
+
]);
|
|
53
62
|
switch (video.type) {
|
|
54
63
|
case models_1.MediaVideoType.Player:
|
|
55
64
|
return reactPlayerBlock;
|
|
@@ -5,8 +5,6 @@ unpredictable css rules order in build */
|
|
|
5
5
|
line-height: var(--g-text-body-2-line-height);
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
font-weight: 500;
|
|
9
|
-
color: var(--pc-media-card-meta-info-color);
|
|
10
8
|
}
|
|
11
9
|
.pc-meta-info__item:not(:first-child) {
|
|
12
10
|
margin-left: 16px;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
|
+
const index_1 = require("../index");
|
|
6
7
|
const b = (0, utils_1.block)('meta-info');
|
|
7
|
-
const MetaInfo = ({ items, className }) => (react_1.default.createElement("h4", { className: b(null, className) }, items.map((metaInfoItem) => (react_1.default.createElement(
|
|
8
|
+
const MetaInfo = ({ items, className }) => (react_1.default.createElement("h4", { className: b(null, className) }, items.map((metaInfoItem) => (react_1.default.createElement(index_1.YFMWrapper, { content: metaInfoItem, key: metaInfoItem, className: b('item'), modifiers: { constructor: true, constructorMetaInfo: true } })))));
|
|
8
9
|
exports.default = MetaInfo;
|
|
@@ -4,32 +4,64 @@ unpredictable css rules order in build */
|
|
|
4
4
|
position: absolute;
|
|
5
5
|
bottom: 0;
|
|
6
6
|
}
|
|
7
|
+
.pc-CustomBarControls__wrapper_type_with-play-pause-button {
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: 20px;
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 20px;
|
|
12
|
+
}
|
|
7
13
|
.pc-CustomBarControls__button {
|
|
8
|
-
|
|
14
|
+
border: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
.pc-CustomBarControls__button_type_with-play-pause-button {
|
|
19
|
+
opacity: 0.9;
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
transition: opacity 300ms ease 3s;
|
|
22
|
+
}
|
|
23
|
+
.pc-CustomBarControls__button_type_with-play-pause-button:hover, .pc-CustomBarControls__button_type_with-play-pause-button:focus {
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}
|
|
26
|
+
.pc-CustomBarControls__button_type_with-play-pause-button:focus {
|
|
27
|
+
outline: 1px solid var(--g-color-line-light);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
border-radius: 4px;
|
|
30
|
+
}
|
|
31
|
+
.pc-CustomBarControls__button_type_with-play-pause-button:focus:not(:focus-visible) {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
.pc-CustomBarControls__button_type_with-mute-button {
|
|
9
35
|
border-radius: 50%;
|
|
10
36
|
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
11
39
|
cursor: pointer;
|
|
12
40
|
position: relative;
|
|
13
41
|
width: 64px;
|
|
14
42
|
height: 64px;
|
|
15
43
|
background: var(--g-color-base-background);
|
|
16
44
|
transition: background-color 300ms;
|
|
45
|
+
margin: 12px;
|
|
17
46
|
}
|
|
18
|
-
.pc-
|
|
47
|
+
.pc-CustomBarControls__button_type_with-mute-button:hover, .pc-CustomBarControls__button_type_with-mute-button:focus {
|
|
19
48
|
background: #eff2f8;
|
|
20
49
|
}
|
|
21
|
-
.pc-
|
|
22
|
-
|
|
50
|
+
.pc-CustomBarControls__button_type_with-mute-button:focus {
|
|
51
|
+
outline: 2px solid var(--g-color-line-misc);
|
|
23
52
|
}
|
|
24
|
-
.pc-
|
|
25
|
-
|
|
53
|
+
.pc-CustomBarControls__button_type_with-mute-button:focus:not(:focus-visible) {
|
|
54
|
+
outline: none;
|
|
55
|
+
}
|
|
56
|
+
.pc-CustomBarControls__play-icon {
|
|
57
|
+
height: 24px;
|
|
58
|
+
width: 24px;
|
|
59
|
+
}
|
|
60
|
+
.pc-CustomBarControls__mute-icon_type_with-mute-button {
|
|
26
61
|
height: 22px;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
.pc-CustomBarControls__mute-button_muted {
|
|
34
|
-
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjkiIGhlaWdodD0iMjIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTcgNyA3LTdoMnYyMmgtMmwtNy03SDBWN2g3eiIgZmlsbD0iIzI2MjYyNiIvPgogICAgPHBhdGggZD0ibTIwIDcgNCA0bTAgMC00IDRtNC00IDQtNG0tNCA0IDQgNCIgc3Ryb2tlPSIjMjYyNjI2IiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg==");
|
|
62
|
+
width: 32px;
|
|
63
|
+
}
|
|
64
|
+
.pc-CustomBarControls__mute-icon_type_with-play-pause-button {
|
|
65
|
+
height: 24px;
|
|
66
|
+
width: 24px;
|
|
35
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ClassNameProps } from '../../models';
|
|
2
|
+
import { ClassNameProps, CustomControlsType } from '../../models';
|
|
3
3
|
interface MuteConfigProps {
|
|
4
4
|
isMuted: boolean;
|
|
5
5
|
changeMute: (event: React.MouseEvent) => void;
|
|
@@ -7,6 +7,9 @@ interface MuteConfigProps {
|
|
|
7
7
|
export interface CustomBarControlsProps extends ClassNameProps {
|
|
8
8
|
mute?: MuteConfigProps;
|
|
9
9
|
elapsedTimePercent?: number;
|
|
10
|
+
type?: CustomControlsType;
|
|
11
|
+
isPaused?: boolean;
|
|
12
|
+
onPlayClick?: () => void;
|
|
10
13
|
}
|
|
11
14
|
declare const CustomBarControls: (props: CustomBarControlsProps) => JSX.Element;
|
|
12
15
|
export default CustomBarControls;
|
|
@@ -2,20 +2,44 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
|
+
const Mute_1 = require("../../icons/Mute");
|
|
7
|
+
const MuteSmall_1 = require("../../icons/MuteSmall");
|
|
8
|
+
const Unmute_1 = require("../../icons/Unmute");
|
|
9
|
+
const UnmuteSmall_1 = require("../../icons/UnmuteSmall");
|
|
10
|
+
const VideoControlPause_1 = require("../../icons/VideoControlPause");
|
|
11
|
+
const VideoControlPlay_1 = require("../../icons/VideoControlPlay");
|
|
12
|
+
const models_1 = require("../../models");
|
|
5
13
|
const utils_1 = require("../../utils");
|
|
6
14
|
const CircleProgress_1 = tslib_1.__importDefault(require("./CircleProgress"));
|
|
15
|
+
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
7
16
|
const b = (0, utils_1.block)('CustomBarControls');
|
|
8
17
|
const CustomBarControls = (props) => {
|
|
9
|
-
const { mute, elapsedTimePercent = 0, className } = props;
|
|
10
|
-
const
|
|
11
|
-
|
|
18
|
+
const { mute, elapsedTimePercent = 0, className, type = models_1.CustomControlsType.WithMuteButton, isPaused, onPlayClick, } = props;
|
|
19
|
+
const muteIcon = (0, react_1.useMemo)(() => {
|
|
20
|
+
return type === models_1.CustomControlsType.WithMuteButton ? Mute_1.Mute : MuteSmall_1.MuteSmall;
|
|
21
|
+
}, [type]);
|
|
22
|
+
const unmuteIcon = (0, react_1.useMemo)(() => {
|
|
23
|
+
return type === models_1.CustomControlsType.WithMuteButton ? Unmute_1.Unmute : UnmuteSmall_1.UnmuteSmall;
|
|
24
|
+
}, [type]);
|
|
25
|
+
const muteButton = (0, react_1.useMemo)(() => {
|
|
26
|
+
if (!mute) {
|
|
12
27
|
return null;
|
|
13
28
|
}
|
|
14
|
-
const { isMuted, changeMute } =
|
|
15
|
-
return (react_1.default.createElement("
|
|
16
|
-
react_1.default.createElement(
|
|
17
|
-
!isMuted && react_1.default.createElement(CircleProgress_1.default, { elapsedTime:
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
29
|
+
const { isMuted, changeMute } = mute;
|
|
30
|
+
return (react_1.default.createElement("button", { className: b('button', { type }), onClick: changeMute, "aria-label": (0, i18n_1.default)(isMuted ? 'unmute' : 'mute') },
|
|
31
|
+
react_1.default.createElement(uikit_1.Icon, { data: isMuted ? unmuteIcon : muteIcon, className: b('mute-icon', { type }) }),
|
|
32
|
+
type === models_1.CustomControlsType.WithMuteButton && !isMuted && (react_1.default.createElement(CircleProgress_1.default, { elapsedTime: elapsedTimePercent, strokeWidth: 5 }))));
|
|
33
|
+
}, [elapsedTimePercent, mute, muteIcon, type, unmuteIcon]);
|
|
34
|
+
const playPauseButton = (0, react_1.useMemo)(() => {
|
|
35
|
+
if (type !== models_1.CustomControlsType.WithPlayPauseButton) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (react_1.default.createElement("button", { onClick: onPlayClick, className: b('button', { type }), "aria-label": (0, i18n_1.default)(isPaused ? 'play' : 'pause') },
|
|
39
|
+
react_1.default.createElement(uikit_1.Icon, { data: isPaused ? VideoControlPlay_1.VideoControlPlay : VideoControlPause_1.VideoControlPause, className: b('play-icon') })));
|
|
40
|
+
}, [isPaused, onPlayClick, type]);
|
|
41
|
+
return (react_1.default.createElement("div", { className: b('wrapper', { type }, className) },
|
|
42
|
+
playPauseButton,
|
|
43
|
+
muteButton));
|
|
20
44
|
};
|
|
21
45
|
exports.default = CustomBarControls;
|
|
@@ -50,6 +50,18 @@ unpredictable css rules order in build */
|
|
|
50
50
|
opacity: 1;
|
|
51
51
|
transition: opacity 300ms ease 0s;
|
|
52
52
|
}
|
|
53
|
+
.pc-ReactPlayer_started.pc-ReactPlayer_controls_custom.pc-ReactPlayer_hovered::before {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
.pc-ReactPlayer_started.pc-ReactPlayer_controls_custom::before {
|
|
57
|
+
position: absolute;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
content: "";
|
|
61
|
+
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 65.36%, rgba(0, 0, 0, 0.2) 100%);
|
|
62
|
+
opacity: 0;
|
|
63
|
+
transition: opacity 300ms;
|
|
64
|
+
}
|
|
53
65
|
.pc-ReactPlayer__custom-bar-controls {
|
|
54
66
|
opacity: 0;
|
|
55
67
|
transition: opacity 300ms ease 3s;
|
|
@@ -14,6 +14,7 @@ const icons_1 = require("../../icons");
|
|
|
14
14
|
const models_1 = require("../../models");
|
|
15
15
|
const utils_1 = require("../../utils");
|
|
16
16
|
const CustomBarControls_1 = tslib_1.__importDefault(require("./CustomBarControls"));
|
|
17
|
+
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
17
18
|
const utils_2 = require("./utils");
|
|
18
19
|
const b = (0, utils_1.block)('ReactPlayer');
|
|
19
20
|
const FPS = 60;
|
|
@@ -21,8 +22,9 @@ const FPS = 60;
|
|
|
21
22
|
exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
22
23
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
23
24
|
const { metrika } = (0, react_1.useContext)(metrikaContext_1.MetrikaContext);
|
|
24
|
-
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, } = props;
|
|
25
|
+
const { src, previewImgUrl, loop = false, controls = models_1.MediaVideoControlsType.Default, customControlsOptions = {}, muted: initiallyMuted = false, elapsedTime, playButton, className, customBarControlsClassName, showPreview, onClickPreview, metrika: videoMetrika, analyticsEvents, height, ariaLabel, } = props;
|
|
25
26
|
const { type = models_1.PlayButtonType.Default, theme = models_1.PlayButtonThemes.Blue, text, className: buttonClassName, } = playButton || {};
|
|
27
|
+
const { type: customControlsType = models_1.CustomControlsType.WithMuteButton } = customControlsOptions;
|
|
26
28
|
const autoPlay = Boolean(!isMobile && !previewImgUrl && props.autoplay);
|
|
27
29
|
const mute = initiallyMuted || autoPlay;
|
|
28
30
|
const { playingVideoRef, setProps } = (0, react_1.useContext)(videoContext_1.VideoContext);
|
|
@@ -34,8 +36,10 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
34
36
|
const [width, setWidth] = (0, react_1.useState)(0);
|
|
35
37
|
const [muted, setMuted] = (0, react_1.useState)(mute);
|
|
36
38
|
const [started, setStarted] = (0, react_1.useState)(autoPlay);
|
|
37
|
-
const [paused, setPaused] = (0, react_1.useState)(false);
|
|
38
39
|
const [ended, setEnded] = (0, react_1.useState)(false);
|
|
40
|
+
const [isMounted, setIsMounted] = (0, react_1.useState)(false);
|
|
41
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
42
|
+
(0, hooks_1.useMount)(() => setIsMounted(true));
|
|
39
43
|
const videoSrc = (0, react_1.useMemo)(() => (0, utils_2.checkYoutubeVideos)(src), [src]);
|
|
40
44
|
const eventsArray = (0, react_1.useMemo)(() => {
|
|
41
45
|
if (analyticsEvents) {
|
|
@@ -105,10 +109,12 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
105
109
|
playButtonContent = react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayVideo, size: 24 });
|
|
106
110
|
break;
|
|
107
111
|
}
|
|
108
|
-
return (react_1.default.createElement("button", { className: b('button', { theme, text: Boolean(text) }, buttonClassName) }, playButtonContent));
|
|
112
|
+
return (react_1.default.createElement("button", { className: b('button', { theme, text: Boolean(text) }, buttonClassName), "aria-label": (0, i18n_1.default)('play') }, playButtonContent));
|
|
109
113
|
}, [type, theme, text, buttonClassName]);
|
|
110
114
|
const changeMute = (0, react_1.useCallback)((isMuted) => {
|
|
111
|
-
if (isMuted &&
|
|
115
|
+
if (isMuted &&
|
|
116
|
+
playerRef &&
|
|
117
|
+
customControlsType !== models_1.CustomControlsType.WithPlayPauseButton) {
|
|
112
118
|
playerRef.seekTo(0);
|
|
113
119
|
setPlayedPercent(0);
|
|
114
120
|
}
|
|
@@ -126,8 +132,16 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
126
132
|
}
|
|
127
133
|
// In order to the progress bar to update (equals 0) before displaying
|
|
128
134
|
setTimeout(() => setMuted(!isMuted), 0);
|
|
129
|
-
}, [
|
|
130
|
-
|
|
135
|
+
}, [
|
|
136
|
+
playerRef,
|
|
137
|
+
customControlsType,
|
|
138
|
+
metrika,
|
|
139
|
+
videoMetrika,
|
|
140
|
+
playEvents,
|
|
141
|
+
stopEvents,
|
|
142
|
+
handleAnalytics,
|
|
143
|
+
setProps,
|
|
144
|
+
]);
|
|
131
145
|
const handleClickPreview = (0, react_1.useCallback)(() => {
|
|
132
146
|
setIsPlaying(true);
|
|
133
147
|
onClickPreview === null || onClickPreview === void 0 ? void 0 : onClickPreview();
|
|
@@ -141,12 +155,11 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
141
155
|
}, [onClickPreview, metrika, videoMetrika, handleAnalytics, playEvents]);
|
|
142
156
|
const onPause = (0, react_1.useCallback)(() => {
|
|
143
157
|
// For support correct state for youtube
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
setIsPlaying(true);
|
|
158
|
+
if (controls !== models_1.MediaVideoControlsType.Custom ||
|
|
159
|
+
customControlsType === models_1.CustomControlsType.WithPlayPauseButton) {
|
|
160
|
+
setIsPlaying(false);
|
|
148
161
|
}
|
|
149
|
-
}, [controls,
|
|
162
|
+
}, [controls, customControlsType]);
|
|
150
163
|
const onStart = (0, react_1.useCallback)(() => {
|
|
151
164
|
if (!autoPlay && !initiallyMuted) {
|
|
152
165
|
setMuted(false);
|
|
@@ -154,17 +167,17 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
154
167
|
}, [autoPlay, initiallyMuted]);
|
|
155
168
|
const onPlay = (0, react_1.useCallback)(() => {
|
|
156
169
|
setIsPlaying(true);
|
|
157
|
-
if (controls === models_1.MediaVideoControlsType.Custom
|
|
170
|
+
if (controls === models_1.MediaVideoControlsType.Custom &&
|
|
171
|
+
customControlsType === models_1.CustomControlsType.WithMuteButton) {
|
|
158
172
|
if (ended) {
|
|
159
173
|
changeMute(false);
|
|
160
174
|
}
|
|
161
|
-
else if (
|
|
175
|
+
else if (!isPlaying) {
|
|
162
176
|
changeMute(muted);
|
|
163
177
|
}
|
|
164
178
|
setEnded(false);
|
|
165
|
-
setPaused(false);
|
|
166
179
|
}
|
|
167
|
-
}, [changeMute, controls, ended,
|
|
180
|
+
}, [changeMute, controls, customControlsType, ended, isPlaying, muted]);
|
|
168
181
|
const onProgress = (0, react_1.useCallback)((progress) => {
|
|
169
182
|
setPlayedPercent(progress.played);
|
|
170
183
|
if (progress.played === 1) {
|
|
@@ -182,21 +195,33 @@ exports.ReactPlayerBlock = react_1.default.forwardRef((props, originRef) => {
|
|
|
182
195
|
}
|
|
183
196
|
setEnded(true);
|
|
184
197
|
}, [loop, playerRef]);
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
198
|
+
const onPlayClick = (0, react_1.useCallback)(() => {
|
|
199
|
+
if (isPlaying) {
|
|
200
|
+
onPause();
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
onPlay();
|
|
204
|
+
}
|
|
205
|
+
}, [isPlaying, onPlay, onPause]);
|
|
206
|
+
const handleClick = (0, react_1.useCallback)(() => {
|
|
207
|
+
if (customControlsType === models_1.CustomControlsType.WithMuteButton) {
|
|
208
|
+
changeMute(muted);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
onPlayClick();
|
|
212
|
+
}
|
|
213
|
+
}, [changeMute, customControlsType, muted, onPlayClick]);
|
|
214
|
+
const onFocusIn = (0, react_1.useCallback)(() => setHovered(true), []);
|
|
215
|
+
const onFocusOut = (0, react_1.useCallback)(() => setHovered(false), []);
|
|
216
|
+
return (react_1.default.createElement("div", { className: b({ wrapper: !currentHeight, controls, started, hovered }, className), ref: ref, onClick: handleClick, onMouseEnter: onFocusIn, onMouseLeave: onFocusOut, onFocus: onFocusIn, onBlur: onFocusOut }, isMounted ? (react_1.default.createElement(react_1.Fragment, null,
|
|
217
|
+
react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: onPause, onProgress: onProgress, onEnded: onEnded, "aria-label": ariaLabel }),
|
|
218
|
+
controls === models_1.MediaVideoControlsType.Custom && started && (react_1.default.createElement(CustomBarControls_1.default, { className: b('custom-bar-controls', { muted }, customBarControlsClassName), mute: {
|
|
219
|
+
isMuted: muted,
|
|
191
220
|
changeMute: (event) => {
|
|
192
221
|
event.stopPropagation();
|
|
193
|
-
changeMute(
|
|
222
|
+
changeMute(muted);
|
|
194
223
|
},
|
|
195
|
-
}, elapsedTimePercent:
|
|
196
|
-
}, [controls, isPlaying, customBarControlsClassName, changeMute]);
|
|
197
|
-
return (react_1.default.createElement("div", { className: b({ wrapper: !currentHeight }, className), ref: ref, onClick: handleClick },
|
|
198
|
-
react_1.default.createElement(react_player_1.default, { className: b('player'), url: videoSrc, muted: muted, controls: controls === models_1.MediaVideoControlsType.Default, height: currentHeight || '100%', width: width || '100%', light: previewImgUrl, playing: isPlaying, playIcon: playIcon, progressInterval: FPS, onClickPreview: handleClickPreview, onStart: onStart, onReady: setPlayerRef, onPlay: onPlay, onPause: onPause, onProgress: onProgress, onEnded: onEnded }),
|
|
199
|
-
renderCustomBarControls(muted, playedPercent)));
|
|
224
|
+
}, elapsedTimePercent: playedPercent, type: customControlsType, isPaused: !isPlaying, onPlayClick: onPlayClick })))) : null));
|
|
200
225
|
});
|
|
201
226
|
function getHeight(width) {
|
|
202
227
|
return (width / 16) * 9;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const registerKeyset_1 = require("../../../utils/registerKeyset");
|
|
5
|
+
const en_json_1 = tslib_1.__importDefault(require("./en.json"));
|
|
6
|
+
const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
|
|
7
|
+
const COMPONENT = 'ReactPlayer';
|
|
8
|
+
exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
|
|
@@ -4,28 +4,34 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const __1 = require("../");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
+
function getMarkerId(index) {
|
|
8
|
+
if (isNaN(index)) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return `marker-${index}`;
|
|
12
|
+
}
|
|
7
13
|
const b = (0, utils_1.block)('table');
|
|
8
14
|
class Table extends react_1.default.Component {
|
|
9
15
|
render() {
|
|
10
|
-
const { content, legend, marker = 'disk', className } = this.props;
|
|
16
|
+
const { content, legend, marker = 'disk', className, caption } = this.props;
|
|
11
17
|
if (!content || !content.length || !content[0].length) {
|
|
12
18
|
return null;
|
|
13
19
|
}
|
|
14
|
-
return (react_1.default.createElement("div", { className: b(null, className) },
|
|
20
|
+
return (react_1.default.createElement("div", { className: b(null, className), role: 'table', "aria-label": caption },
|
|
15
21
|
this.renderTable(content, marker, legend),
|
|
16
22
|
legend && this.renderLegend(legend, marker)));
|
|
17
23
|
}
|
|
18
24
|
renderTable(content, marker, legend) {
|
|
19
25
|
const justify = this.getDefaultJustify(content, this.props.justify);
|
|
20
|
-
return (react_1.default.createElement("div", { className: b('table') }, content.map((row, i) => (react_1.default.createElement("div", { key: i, className: b('row') }, row.map((cell, j) => (react_1.default.createElement("div", { key: j, className: b('cell', { justify: justify[j] }) }, legend && i && j ? (this.renderMarker(marker, cell)) : (react_1.default.createElement(__1.HTML, null, cell))))))))));
|
|
26
|
+
return (react_1.default.createElement("div", { className: b('table'), role: 'rowgroup' }, content.map((row, i) => (react_1.default.createElement("div", { key: i, className: b('row'), role: 'row' }, row.map((cell, j) => (react_1.default.createElement("div", { key: j, className: b('cell', { justify: justify[j] }), role: 'cell' }, legend && i && j ? (this.renderMarker(marker, cell)) : (react_1.default.createElement(__1.HTML, null, cell))))))))));
|
|
21
27
|
}
|
|
22
28
|
renderMarker(type, cell) {
|
|
23
|
-
return react_1.default.createElement("div", { className: b('marker', { type, index: String(cell) }) });
|
|
29
|
+
return (react_1.default.createElement("div", { "aria-labelledby": getMarkerId(Number(cell)), className: b('marker', { type, index: String(cell) }) }));
|
|
24
30
|
}
|
|
25
31
|
renderLegend(legend, marker) {
|
|
26
32
|
return (react_1.default.createElement("div", { className: b('legend') }, legend.map((item, index) => (react_1.default.createElement("div", { key: item, className: b('legend-item') },
|
|
27
33
|
this.renderMarker(marker, String(index)),
|
|
28
|
-
react_1.default.createElement(__1.YFMWrapper, { className: b('legent-item-text'), content: item, modifiers: { constructor: true } }))))));
|
|
34
|
+
react_1.default.createElement(__1.YFMWrapper, { className: b('legent-item-text'), content: item, modifiers: { constructor: true }, id: getMarkerId(index) }))))));
|
|
29
35
|
}
|
|
30
36
|
getDefaultJustify(content, justify) {
|
|
31
37
|
return justify || new Array(content[0].length).fill('center');
|
|
@@ -4,7 +4,7 @@ exports.getHeight = exports.AUTOPLAY_ATTRIBUTES = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
-
const
|
|
7
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
9
|
const useAnalytics_1 = require("../../hooks/useAnalytics");
|
|
10
10
|
const icons_1 = require("../../icons");
|
|
@@ -58,7 +58,7 @@ const VideoBlock = (props) => {
|
|
|
58
58
|
setTimeout(() => setHidePreview(true), AUTOPLAY_DELAY);
|
|
59
59
|
}, [handleAnalytics, analyticsEvents, src, attributes]);
|
|
60
60
|
(0, react_1.useEffect)(() => {
|
|
61
|
-
const updateSize =
|
|
61
|
+
const updateSize = (0, debounce_1.default)(() => {
|
|
62
62
|
setCurrentHeight(ref.current ? Math.round(getHeight(ref.current.offsetWidth)) : undefined);
|
|
63
63
|
}, 100);
|
|
64
64
|
updateSize();
|
|
@@ -71,11 +71,12 @@ const VideoBlock = (props) => {
|
|
|
71
71
|
if (norender) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
const fullSrc = `${src}?${(0, utils_1.getPageSearchParams)(attributes || {})}`;
|
|
75
74
|
if (ref.current && !iframeRef.current) {
|
|
76
75
|
const iframe = document.createElement('iframe');
|
|
77
76
|
iframe.id = fullId;
|
|
78
|
-
|
|
77
|
+
if (!previewImg) {
|
|
78
|
+
iframe.src = `${src}?${(0, utils_1.getPageSearchParams)(attributes || {})}`;
|
|
79
|
+
}
|
|
79
80
|
iframe.width = '100%';
|
|
80
81
|
iframe.height = '100%';
|
|
81
82
|
iframe.title = (0, i18n_1.default)('iframe-title');
|
|
@@ -86,7 +87,7 @@ const VideoBlock = (props) => {
|
|
|
86
87
|
ref.current.appendChild(iframe);
|
|
87
88
|
iframeRef.current = iframe;
|
|
88
89
|
}
|
|
89
|
-
}, [stream, record, norender, src, fullId, attributes, iframeRef,
|
|
90
|
+
}, [stream, record, norender, src, fullId, attributes, iframeRef, previewImg]);
|
|
90
91
|
(0, react_1.useEffect)(() => {
|
|
91
92
|
setHidePreview(false);
|
|
92
93
|
}, [src, setHidePreview]);
|
|
@@ -95,7 +96,7 @@ const VideoBlock = (props) => {
|
|
|
95
96
|
}
|
|
96
97
|
return (react_1.default.createElement("div", { className: b(null, className), ref: ref, style: { height: currentHeight } }, previewImg && !hidePreview && !fullscreen && (react_1.default.createElement("div", { className: b('preview'), onClick: onPreviewClick },
|
|
97
98
|
react_1.default.createElement(Image_1.default, { src: previewImg, className: b('image'), containerClassName: b('image-wrapper') }),
|
|
98
|
-
playButton || (react_1.default.createElement("button", { className: b('button') },
|
|
99
|
+
playButton || (react_1.default.createElement("button", { title: "Play", className: b('button') },
|
|
99
100
|
react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.PlayVideo, size: 24 })))))));
|
|
100
101
|
};
|
|
101
102
|
exports.default = VideoBlock;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ClassNameProps, Modifiers } from '../../models';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { QAProps } from '../../models/common';
|
|
3
|
+
export interface YFMWrapperProps extends ClassNameProps, QAProps {
|
|
4
4
|
content: string;
|
|
5
5
|
modifiers?: Modifiers;
|
|
6
6
|
itemProp?: string;
|
|
7
|
+
id?: string;
|
|
7
8
|
}
|
|
8
|
-
declare const YFMWrapper: ({ content, modifiers, className, itemProp, }: YFMWrapperProps
|
|
9
|
+
declare const YFMWrapper: ({ content, modifiers, className, itemProp, id, qa }: YFMWrapperProps) => JSX.Element;
|
|
9
10
|
export default YFMWrapper;
|
|
@@ -4,9 +4,9 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
/* we won't use 'pc' class prefix here to let you opportunity to define yfm styles
|
|
5
5
|
in your project via global 'yfm' class */
|
|
6
6
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
8
7
|
const snakecase_keys_1 = tslib_1.__importDefault(require("snakecase-keys"));
|
|
9
8
|
const components_1 = require("../../components");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const yfm = (0, utils_1.cn)('yfm');
|
|
11
|
+
const YFMWrapper = ({ content, modifiers, className, itemProp, id, qa }) => (react_1.default.createElement(components_1.HTML, { className: yfm(modifiers ? (0, snakecase_keys_1.default)(modifiers) : {}, className), itemProp: itemProp, id: id, qa: qa }, content));
|
|
12
12
|
exports.default = YFMWrapper;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HEADER_HEIGHT = exports.
|
|
3
|
+
exports.HEADER_HEIGHT = exports.UIKIT_ROOT_CLASS = exports.DEFAULT_THEME = void 0;
|
|
4
4
|
const models_1 = require("../models");
|
|
5
5
|
exports.DEFAULT_THEME = models_1.Theme.Light;
|
|
6
6
|
exports.UIKIT_ROOT_CLASS = 'g-root';
|
|
7
|
-
exports.KEY = {
|
|
8
|
-
ENTER: 'Enter',
|
|
9
|
-
TAB: 'Tab',
|
|
10
|
-
};
|
|
11
7
|
exports.HEADER_HEIGHT = 64;
|
|
@@ -21,11 +21,18 @@ export declare const blockMap: {
|
|
|
21
21
|
export declare const subBlockMap: {
|
|
22
22
|
divider: ({ size, border }: import("./models").DividerProps) => JSX.Element;
|
|
23
23
|
"price-detailed": (props: import("./models").PriceDetailedProps) => JSX.Element;
|
|
24
|
-
"media-card": ({ border, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
24
|
+
"media-card": ({ border, analyticsEvents, ...mediaProps }: import("./models").MediaCardProps) => JSX.Element;
|
|
25
25
|
"banner-card": (props: import("./models").BannerCardProps) => JSX.Element;
|
|
26
|
-
"layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
26
|
+
"layout-item": ({ content: { links, ...content }, metaInfo, media, border, fullscreen, className, analyticsEvents, }: import("./models").LayoutItemProps) => JSX.Element;
|
|
27
27
|
"background-card": (props: import("./models").BackgroundCardProps) => JSX.Element;
|
|
28
28
|
"basic-card": (props: import("./models").BasicCardProps) => JSX.Element;
|
|
29
|
-
content: (props: import("./
|
|
29
|
+
content: (props: import("./sub-blocks/Content/Content").ContentProps) => JSX.Element;
|
|
30
30
|
quote: (props: import("./models").QuoteProps) => JSX.Element;
|
|
31
31
|
};
|
|
32
|
+
export declare const navItemMap: {
|
|
33
|
+
button: import("react").FC<Pick<import("./navigation/models").NavigationItemProps, "className"> & import("./models").ButtonProps>;
|
|
34
|
+
social: import("react").FC<import("./navigation/components/SocialIcon/SocialIcon").NavigationSocialItemOwnProps>;
|
|
35
|
+
dropdown: ({ text, icon, className, iconSize, hidePopup, items, isActive, ...props }: import("./navigation/models").NavigationItemProps & import("./models").NavigationDropdownItem) => JSX.Element;
|
|
36
|
+
link: import("react").FC<import("./navigation/models").NavigationItemProps & import("./models").NavigationLinkItem>;
|
|
37
|
+
"github-button": ({ text, url, className, label, size, icon, }: import("./navigation/models").NavigationItemProps & import("./models").NavigationGithubButton) => JSX.Element;
|
|
38
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subBlockMap = exports.blockMap = void 0;
|
|
3
|
+
exports.navItemMap = exports.subBlockMap = exports.blockMap = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const blocks_1 = require("./blocks");
|
|
5
6
|
const models_1 = require("./models");
|
|
7
|
+
const NavigationItem_1 = require("./navigation/components/NavigationItem");
|
|
8
|
+
const SocialIcon_1 = tslib_1.__importDefault(require("./navigation/components/SocialIcon/SocialIcon"));
|
|
6
9
|
const sub_blocks_1 = require("./sub-blocks");
|
|
7
10
|
exports.blockMap = {
|
|
8
11
|
[models_1.BlockType.SliderBlock]: blocks_1.SliderBlock,
|
|
@@ -35,3 +38,10 @@ exports.subBlockMap = {
|
|
|
35
38
|
[models_1.SubBlockType.Content]: sub_blocks_1.Content,
|
|
36
39
|
[models_1.SubBlockType.Quote]: sub_blocks_1.Quote,
|
|
37
40
|
};
|
|
41
|
+
exports.navItemMap = {
|
|
42
|
+
[models_1.NavigationItemType.Button]: NavigationItem_1.NavigationButton,
|
|
43
|
+
[models_1.NavigationItemType.Social]: SocialIcon_1.default,
|
|
44
|
+
[models_1.NavigationItemType.Dropdown]: NavigationItem_1.NavigationDropdown,
|
|
45
|
+
[models_1.NavigationItemType.Link]: NavigationItem_1.NavigationLink,
|
|
46
|
+
[models_1.NavigationItemType.GithubButton]: NavigationItem_1.GithubButton,
|
|
47
|
+
};
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
|
-
const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
|
|
7
6
|
const ErrorWrapper_1 = tslib_1.__importDefault(require("../../components/ErrorWrapper/ErrorWrapper"));
|
|
7
|
+
const cn_1 = require("../../utils/cn");
|
|
8
8
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
9
|
-
const b = (0,
|
|
9
|
+
const b = (0, cn_1.block)('loadable-block');
|
|
10
10
|
const initData = {
|
|
11
11
|
loading: false,
|
|
12
12
|
error: false,
|