@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
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
.pc-QuestionsBlock__item-title {
|
|
2
|
-
margin: 0;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
/* use this for style redefinitions to awoid problems with
|
|
6
2
|
unpredictable css rules order in build */
|
|
7
3
|
.pc-QuestionsBlock__title {
|
|
@@ -10,50 +6,6 @@ unpredictable css rules order in build */
|
|
|
10
6
|
margin-bottom: 32px;
|
|
11
7
|
margin-right: 64px;
|
|
12
8
|
}
|
|
13
|
-
.pc-QuestionsBlock__item {
|
|
14
|
-
padding-bottom: 32px;
|
|
15
|
-
border-bottom: 1px solid var(--g-color-line-generic);
|
|
16
|
-
}
|
|
17
|
-
.pc-QuestionsBlock__item + .pc-QuestionsBlock__item {
|
|
18
|
-
padding-top: 32px;
|
|
19
|
-
}
|
|
20
|
-
.pc-QuestionsBlock__item-title {
|
|
21
|
-
font-size: var(--g-text-header-1-font-size);
|
|
22
|
-
line-height: var(--g-text-header-1-line-height);
|
|
23
|
-
color: var(--pc-text-header-color);
|
|
24
|
-
font-weight: var(--g-text-accent-font-weight);
|
|
25
|
-
position: relative;
|
|
26
|
-
padding-right: 24px;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
}
|
|
29
|
-
.pc-QuestionsBlock__item-title a {
|
|
30
|
-
outline: none;
|
|
31
|
-
color: var(--g-color-text-link);
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
}
|
|
35
|
-
.utilityfocus .pc-QuestionsBlock__item-title a:focus {
|
|
36
|
-
outline: 2px solid #ffdb4d;
|
|
37
|
-
}
|
|
38
|
-
.pc-QuestionsBlock__item-title a:hover, .pc-QuestionsBlock__item-title a:active {
|
|
39
|
-
--pc-text-header-color: var(--g-color-text-link-hover);
|
|
40
|
-
color: var(--g-color-text-link-hover);
|
|
41
|
-
}
|
|
42
|
-
.pc-QuestionsBlock__text {
|
|
43
|
-
font-size: var(--g-text-body-2-font-size);
|
|
44
|
-
line-height: var(--g-text-body-2-line-height);
|
|
45
|
-
margin-top: 12px;
|
|
46
|
-
}
|
|
47
|
-
.pc-QuestionsBlock__arrow {
|
|
48
|
-
position: absolute;
|
|
49
|
-
right: 0;
|
|
50
|
-
top: 0;
|
|
51
|
-
color: var(--g-color-text-primary);
|
|
52
|
-
}
|
|
53
|
-
.pc-QuestionsBlock__link {
|
|
54
|
-
font-size: var(--g-text-body-2-font-size);
|
|
55
|
-
line-height: var(--g-text-body-2-line-height);
|
|
56
|
-
}
|
|
57
9
|
@media (max-width: 769px) {
|
|
58
10
|
.pc-QuestionsBlock__title {
|
|
59
11
|
margin-right: 0;
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Foldable, HTML, ToggleArrow, YFMWrapper } from '../../components';
|
|
3
|
-
import Link from '../../components/Link/Link';
|
|
4
2
|
import { Col, Row } from '../../grid';
|
|
5
3
|
import { Content } from '../../sub-blocks';
|
|
6
4
|
import { block } from '../../utils';
|
|
5
|
+
import { QuestionBlockItem } from './QuestionBlockItem/QuestionBlockItem';
|
|
6
|
+
import { FaqMicrodataValues } from './models';
|
|
7
7
|
import './Questions.css';
|
|
8
8
|
const b = block('QuestionsBlock');
|
|
9
|
-
const FaqMicrodataValues = {
|
|
10
|
-
PageType: 'https://schema.org/FAQPage',
|
|
11
|
-
QuestionType: 'https://schema.org/Question',
|
|
12
|
-
QuestionProp: 'mainEntity',
|
|
13
|
-
QuestionNameProp: 'name',
|
|
14
|
-
QuestionTextProp: 'text',
|
|
15
|
-
AnswerType: 'https://schema.org/Answer',
|
|
16
|
-
AnswerProp: 'acceptedAnswer',
|
|
17
|
-
AnswerTextProp: 'text',
|
|
18
|
-
};
|
|
19
9
|
const QuestionsBlock = (props) => {
|
|
20
10
|
const { title, text, additionalInfo, links, buttons, items } = props;
|
|
21
11
|
const [opened, setOpened] = useState([0]);
|
|
22
12
|
const toggleItem = (index) => {
|
|
23
13
|
let newState;
|
|
24
14
|
if (opened.includes(index)) {
|
|
25
|
-
newState = opened.filter((
|
|
15
|
+
newState = opened.filter((itemIndex) => itemIndex !== index);
|
|
26
16
|
}
|
|
27
17
|
else {
|
|
28
18
|
newState = [...opened, index];
|
|
@@ -34,20 +24,10 @@ const QuestionsBlock = (props) => {
|
|
|
34
24
|
React.createElement(Col, { sizes: { all: 12, md: 4 } },
|
|
35
25
|
React.createElement("div", { className: b('title') },
|
|
36
26
|
React.createElement(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, buttons: buttons, colSizes: { all: 12, md: 12 } }))),
|
|
37
|
-
React.createElement(Col, { sizes: { all: 12, md: 8 } }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
27
|
+
React.createElement(Col, { sizes: { all: 12, md: 8 }, role: 'list' }, items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
|
|
38
28
|
const isOpened = opened.includes(index);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
React.createElement(HTML, { itemProp: FaqMicrodataValues.QuestionNameProp }, itemTitle),
|
|
42
|
-
React.createElement(ToggleArrow, { open: isOpened, size: 16, type: 'vertical', iconType: "navigation", className: b('arrow') })),
|
|
43
|
-
React.createElement(Foldable, { isOpened: isOpened },
|
|
44
|
-
React.createElement("div", { className: b('text'), itemScope: true, itemProp: FaqMicrodataValues.AnswerProp, itemType: FaqMicrodataValues.AnswerType },
|
|
45
|
-
React.createElement(YFMWrapper, { content: itemText, modifiers: {
|
|
46
|
-
constructor: true,
|
|
47
|
-
constructorListStyle: true,
|
|
48
|
-
constructorListStyleDash: listStyle === 'dash',
|
|
49
|
-
}, itemProp: FaqMicrodataValues.QuestionTextProp }),
|
|
50
|
-
link && React.createElement(Link, Object.assign({}, link, { className: b('link') }))))));
|
|
29
|
+
const onClick = () => toggleItem(index);
|
|
30
|
+
return (React.createElement(QuestionBlockItem, { key: itemTitle, title: itemTitle, text: itemText, link: link, listStyle: listStyle, isOpened: isOpened, onClick: onClick }));
|
|
51
31
|
})))));
|
|
52
32
|
};
|
|
53
33
|
export default QuestionsBlock;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const FaqMicrodataValues: {
|
|
2
|
+
readonly PageType: "https://schema.org/FAQPage";
|
|
3
|
+
readonly QuestionType: "https://schema.org/Question";
|
|
4
|
+
readonly QuestionProp: "mainEntity";
|
|
5
|
+
readonly QuestionNameProp: "name";
|
|
6
|
+
readonly QuestionTextProp: "text";
|
|
7
|
+
readonly AnswerType: "https://schema.org/Answer";
|
|
8
|
+
readonly AnswerProp: "acceptedAnswer";
|
|
9
|
+
readonly AnswerTextProp: "text";
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const FaqMicrodataValues = {
|
|
2
|
+
PageType: 'https://schema.org/FAQPage',
|
|
3
|
+
QuestionType: 'https://schema.org/Question',
|
|
4
|
+
QuestionProp: 'mainEntity',
|
|
5
|
+
QuestionNameProp: 'name',
|
|
6
|
+
QuestionTextProp: 'text',
|
|
7
|
+
AnswerType: 'https://schema.org/Answer',
|
|
8
|
+
AnswerProp: 'acceptedAnswer',
|
|
9
|
+
AnswerTextProp: 'text',
|
|
10
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ToggleArrow from '../../../components/ToggleArrow/ToggleArrow';
|
|
3
3
|
import { block } from '../../../utils';
|
|
4
|
+
import i18n from '../i18n';
|
|
4
5
|
import './Arrow.css';
|
|
5
6
|
const b = block('slider-block-arrow');
|
|
6
7
|
const Arrow = ({ type, handleClick, className, size = 16 }) => (React.createElement("div", { className: b({ type }, className) },
|
|
7
|
-
React.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type) },
|
|
8
|
+
React.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type), "aria-label": i18n(`arrow-${type}`) },
|
|
8
9
|
React.createElement("span", { className: b('icon-wrapper') },
|
|
9
10
|
React.createElement(ToggleArrow, { size: size, type: 'horizontal', iconType: "navigation", className: b('icon') })))));
|
|
10
11
|
export default Arrow;
|
|
@@ -134,6 +134,7 @@ unpredictable css rules order in build */
|
|
|
134
134
|
justify-content: center;
|
|
135
135
|
}
|
|
136
136
|
.pc-SliderBlock__dots-list li.pc-SliderBlock__bar,
|
|
137
|
+
.pc-SliderBlock__dots-list li.pc-SliderBlock__accessible-bar,
|
|
137
138
|
.pc-SliderBlock__dots-list li.pc-SliderBlock__dot {
|
|
138
139
|
margin: calc(12px / 2) 8px;
|
|
139
140
|
top: 0;
|
|
@@ -155,13 +156,15 @@ unpredictable css rules order in build */
|
|
|
155
156
|
.pc-SliderBlock__dot_active {
|
|
156
157
|
background-color: var(--g-color-line-generic-active);
|
|
157
158
|
}
|
|
158
|
-
.pc-SliderBlock__bar {
|
|
159
|
+
.pc-SliderBlock__bar, .pc-SliderBlock__accessible-bar {
|
|
159
160
|
position: absolute;
|
|
160
161
|
top: 12px;
|
|
161
162
|
left: 0;
|
|
162
163
|
width: 24px;
|
|
163
164
|
height: 8px;
|
|
164
165
|
border-radius: var(--pc-border-radius);
|
|
166
|
+
}
|
|
167
|
+
.pc-SliderBlock__bar {
|
|
165
168
|
transition: left 0.3s;
|
|
166
169
|
background-color: var(--pc-color-line-generic-active-solid);
|
|
167
170
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import React, { Fragment, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import SlickSlider from 'react-slick';
|
|
4
4
|
import Anchor from '../../components/Anchor/Anchor';
|
|
@@ -118,27 +118,53 @@ export const SliderBlock = (props) => {
|
|
|
118
118
|
slider.slickGoTo(nextIndex);
|
|
119
119
|
}
|
|
120
120
|
}, [slider, currentIndex, slidesCountByBreakpoint]);
|
|
121
|
+
const barSlidesCount = childrenCount - slidesToShowCount + 1;
|
|
122
|
+
const barPosition = (DOT_GAP + DOT_WIDTH) * currentIndex;
|
|
123
|
+
const barWidth = DOT_WIDTH + (DOT_GAP + DOT_WIDTH) * (slidesCountByBreakpoint - 1);
|
|
121
124
|
const renderBar = () => {
|
|
122
|
-
const barPosition = (DOT_GAP + DOT_WIDTH) * currentIndex;
|
|
123
|
-
const barWidth = DOT_WIDTH + (DOT_GAP + DOT_WIDTH) * (slidesCountByBreakpoint - 1);
|
|
124
125
|
return (slidesCountByBreakpoint > 1 && (React.createElement("li", { className: b('bar'), style: {
|
|
125
126
|
left: barPosition,
|
|
126
127
|
width: barWidth,
|
|
127
128
|
} })));
|
|
128
129
|
};
|
|
130
|
+
// renders additional bar, not visible in the layout but visible for screenreaders
|
|
131
|
+
const renderAccessibleBar = (index) => {
|
|
132
|
+
return (
|
|
133
|
+
// To have this key differ from keys used in renderDot function, added `-accessible-bar` part
|
|
134
|
+
React.createElement(Fragment, { key: `${index}-accessible-bar` }, slidesCountByBreakpoint > 1 && (React.createElement("li", { className: b('accessible-bar'), "aria-current": true, "aria-label": `Slide ${currentIndex + 1} of ${barSlidesCount}`, style: {
|
|
135
|
+
left: barPosition,
|
|
136
|
+
width: barWidth,
|
|
137
|
+
} }))));
|
|
138
|
+
};
|
|
129
139
|
const renderDot = (index) => {
|
|
130
|
-
|
|
140
|
+
const currentIndexDiff = index - currentIndex;
|
|
141
|
+
let currentSlideNumber;
|
|
142
|
+
if (0 <= currentIndexDiff && currentIndexDiff < slidesToShowCount) {
|
|
143
|
+
currentSlideNumber = currentIndex + 1;
|
|
144
|
+
}
|
|
145
|
+
else if (currentIndexDiff >= slidesToShowCount) {
|
|
146
|
+
currentSlideNumber = index - slidesToShowCount + 2;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
currentSlideNumber = index + 1;
|
|
150
|
+
}
|
|
151
|
+
return (React.createElement("li", { key: index, className: b('dot', { active: index === currentIndex }), onClick: () => handleDotClick(index), "aria-hidden": (slidesCountByBreakpoint > 1 &&
|
|
152
|
+
0 <= currentIndexDiff &&
|
|
153
|
+
currentIndexDiff < slidesToShowCount) ||
|
|
154
|
+
undefined, "aria-label": `Slide ${currentSlideNumber} of ${barSlidesCount}` }));
|
|
131
155
|
};
|
|
132
156
|
const renderNavigation = () => {
|
|
133
157
|
if (childrenCount <= slidesCountByBreakpoint || !dots || childrenCount === 1) {
|
|
134
158
|
return null;
|
|
135
159
|
}
|
|
160
|
+
const dotsList = Array(childrenCount)
|
|
161
|
+
.fill(null)
|
|
162
|
+
.map((_item, index) => renderDot(index));
|
|
163
|
+
dotsList.splice(currentIndex, 0, renderAccessibleBar(currentIndex));
|
|
136
164
|
return (React.createElement("div", { className: b('dots', dotsClassName) },
|
|
137
165
|
React.createElement("ul", { className: b('dots-list') },
|
|
138
166
|
renderBar(),
|
|
139
|
-
|
|
140
|
-
.fill(null)
|
|
141
|
-
.map((_item, index) => renderDot(index)))));
|
|
167
|
+
dotsList)));
|
|
142
168
|
};
|
|
143
169
|
const renderDisclaimer = () => {
|
|
144
170
|
return disclaimer ? (React.createElement("div", { className: b('disclaimer', { size: disclaimer.size || 'm' }) }, disclaimer.text)) : null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize } from '@gravity-ui/uikit';
|
|
3
|
+
import { Tabbable } from '../../models';
|
|
3
4
|
export type Theme = 'default' | 'special';
|
|
4
|
-
export interface BackLinkProps {
|
|
5
|
+
export interface BackLinkProps extends Tabbable {
|
|
5
6
|
url: string;
|
|
6
7
|
title: ReactNode;
|
|
7
8
|
theme?: Theme;
|
|
@@ -6,7 +6,7 @@ import { ArrowSidebar } from '../../icons';
|
|
|
6
6
|
import { DefaultEventNames } from '../../models';
|
|
7
7
|
export default function BackLink(props) {
|
|
8
8
|
const { history } = useContext(LocationContext);
|
|
9
|
-
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, } = props;
|
|
9
|
+
const { url, title, theme = 'default', size = 'l', className, shouldHandleBackAction = false, onClick, tabIndex, } = props;
|
|
10
10
|
const handleAnalytics = useAnalytics(DefaultEventNames.ShareButton, url);
|
|
11
11
|
const backActionHandler = useCallback(async () => {
|
|
12
12
|
handleAnalytics();
|
|
@@ -23,7 +23,7 @@ export default function BackLink(props) {
|
|
|
23
23
|
history.push({ pathname: url });
|
|
24
24
|
}
|
|
25
25
|
}, [handleAnalytics, history, onClick, url]);
|
|
26
|
-
return (React.createElement(Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined },
|
|
26
|
+
return (React.createElement(Button, { className: className, view: theme === 'special' ? 'flat-contrast' : 'flat-secondary', size: size, href: shouldHandleBackAction ? undefined : url, onClick: shouldHandleBackAction ? backActionHandler : undefined, tabIndex: tabIndex },
|
|
27
27
|
React.createElement(Icon, { data: ArrowSidebar, size: 24 }),
|
|
28
28
|
React.createElement("span", null, title)));
|
|
29
29
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BackgroundImageProps, WithChildren } from '../../models';
|
|
2
2
|
import './BackgroundImage.css';
|
|
3
|
+
export declare const qaIdByDefault = "background-image";
|
|
3
4
|
declare const BackgroundImage: (props: WithChildren<BackgroundImageProps>) => JSX.Element;
|
|
4
5
|
export default BackgroundImage;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { block } from '../../utils';
|
|
2
|
+
import { block, getQaAttrubutes } from '../../utils';
|
|
3
3
|
import Image from '../Image/Image';
|
|
4
4
|
import './BackgroundImage.css';
|
|
5
|
+
export const qaIdByDefault = 'background-image';
|
|
5
6
|
const b = block('storage-background-image');
|
|
6
7
|
const BackgroundImage = (props) => {
|
|
7
8
|
const { children, src, desktop, className, imageClassName, style, hide, qa } = props;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const qaAttributes = getQaAttrubutes(qa || qaIdByDefault);
|
|
10
|
+
return (React.createElement("div", { className: b(null, className), style: style, "data-qa": qa || qaIdByDefault },
|
|
11
|
+
(src || desktop) && !hide && (React.createElement(Image, Object.assign({}, props, { className: b('img', imageClassName), qa: qaAttributes.image }))),
|
|
10
12
|
children && React.createElement("div", { className: b('container') }, children)));
|
|
11
13
|
};
|
|
12
14
|
export default BackgroundImage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BackgroundMediaProps } from '../../models';
|
|
2
2
|
import './BackgroundMedia.css';
|
|
3
|
-
declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, fullWidthMedia, ...props }: BackgroundMediaProps) => JSX.Element;
|
|
3
|
+
declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, fullWidthMedia, qa, ...props }: BackgroundMediaProps) => JSX.Element;
|
|
4
4
|
export default BackgroundMedia;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { MobileContext } from '../../context/mobileContext';
|
|
4
|
-
import { block } from '../../utils';
|
|
4
|
+
import { block, getQaAttrubutes } from '../../utils';
|
|
5
5
|
import AnimateBlock from '../AnimateBlock/AnimateBlock';
|
|
6
6
|
import Media from '../Media/Media';
|
|
7
7
|
import './BackgroundMedia.css';
|
|
8
8
|
const b = block('BackgroundMedia');
|
|
9
9
|
const BackgroundMedia = (_a) => {
|
|
10
|
-
var { className, color, animated, parallax = true, video, mediaClassName, fullWidthMedia } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName", "fullWidthMedia"]);
|
|
10
|
+
var { className, color, animated, parallax = true, video, mediaClassName, fullWidthMedia, qa } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName", "fullWidthMedia", "qa"]);
|
|
11
11
|
const isMobile = useContext(MobileContext);
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const qaAttributes = getQaAttrubutes(qa, 'media');
|
|
13
|
+
return (React.createElement(AnimateBlock, { className: b(null, className), style: { backgroundColor: color }, animate: animated, qa: qaAttributes.animate },
|
|
14
|
+
React.createElement(Media, Object.assign({ className: b('media', { 'full-width-media': fullWidthMedia }, mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true, qa: qaAttributes.media }, Object.assign({ height: 720, color,
|
|
14
15
|
parallax, video: isMobile ? undefined : video }, props)))));
|
|
15
16
|
};
|
|
16
17
|
export default BackgroundMedia;
|
|
@@ -15,6 +15,11 @@ const ButtonTabs = ({ className, items, activeTab, onSelectTab, tabSize = 'l', q
|
|
|
15
15
|
onSelectTab(tabId, e);
|
|
16
16
|
}
|
|
17
17
|
}, [onSelectTab]);
|
|
18
|
-
return (React.createElement("div", { className: b(null, className), "data-qa": qa }, items.map(({ id, title }) =>
|
|
18
|
+
return (React.createElement("div", { className: b(null, className), "data-qa": qa }, items.map(({ id, title }) => {
|
|
19
|
+
const isActive = id === activeTabId;
|
|
20
|
+
return (React.createElement(Button, { text: title, className: b('item', { active: isActive }), key: title, size: tabSize, onClick: handleClick(id), extraProps: {
|
|
21
|
+
'aria-current': isActive,
|
|
22
|
+
} }));
|
|
23
|
+
})));
|
|
19
24
|
};
|
|
20
25
|
export default ButtonTabs;
|
|
@@ -22,9 +22,6 @@ unpredictable css rules order in build */
|
|
|
22
22
|
.pc-card-base-block_border_line {
|
|
23
23
|
border: 1px solid var(--g-color-line-generic);
|
|
24
24
|
}
|
|
25
|
-
.pc-card-base-block_border_line, .pc-card-base-block_border_none {
|
|
26
|
-
cursor: default;
|
|
27
|
-
}
|
|
28
25
|
@media (min-width: 577px) {
|
|
29
26
|
.slick-slide:not(.slick-active) .pc-card-base-block {
|
|
30
27
|
box-shadow: none;
|
|
@@ -80,7 +77,10 @@ a.pc-card-base-block_border_line {
|
|
|
80
77
|
border: 1px solid var(--g-color-line-generic);
|
|
81
78
|
}
|
|
82
79
|
a.pc-card-base-block_border_line, a.pc-card-base-block_border_none {
|
|
83
|
-
|
|
80
|
+
transition: transform 0.3s ease-out;
|
|
81
|
+
}
|
|
82
|
+
a.pc-card-base-block_border_line:hover, a.pc-card-base-block_border_none:hover {
|
|
83
|
+
transform: translateY(-8px);
|
|
84
84
|
}
|
|
85
85
|
a.pc-card-base-block_border_shadow {
|
|
86
86
|
transition: transform 0.3s ease-out;
|
|
@@ -37,13 +37,13 @@ const LabelSizeMap = {
|
|
|
37
37
|
};
|
|
38
38
|
const FileLink = (props) => {
|
|
39
39
|
const { hostname } = useContext(LocationContext);
|
|
40
|
-
const { href, text, type = 'vertical', textSize = 'm', className, theme = 'default', onClick, } = props;
|
|
40
|
+
const { href, text, type = 'vertical', textSize = 'm', className, theme = 'default', onClick, tabIndex, } = props;
|
|
41
41
|
const fileExt = getFileExt(href);
|
|
42
42
|
const labelTheme = (FileExtensionThemes[fileExt] || 'unknown');
|
|
43
43
|
const labelSize = LabelSizeMap[textSize];
|
|
44
44
|
return (React.createElement("div", { className: b({ ext: fileExt, type, size: textSize, theme }, className) },
|
|
45
45
|
React.createElement(Label, { className: b('file-label'), size: labelSize, theme: labelTheme }, fileExt),
|
|
46
46
|
React.createElement("div", { className: b('link') },
|
|
47
|
-
React.createElement("a", Object.assign({ href: href }, getLinkProps(href, hostname)
|
|
47
|
+
React.createElement("a", Object.assign({ href: href, onClick: onClick, tabIndex: tabIndex }, getLinkProps(href, hostname)), text))));
|
|
48
48
|
};
|
|
49
49
|
export default FileLink;
|
|
@@ -23,7 +23,7 @@ const FullscreenImage = (props) => {
|
|
|
23
23
|
React.createElement(Icon, { data: Fullscreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
|
|
24
24
|
isOpened && (React.createElement(Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
|
|
25
25
|
React.createElement("div", { className: b('modal-content') },
|
|
26
|
-
React.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal },
|
|
26
|
+
React.createElement("div", { className: b('icon-wrapper', { visible: true }), onClick: closeModal, "aria-label": i18n('close') },
|
|
27
27
|
React.createElement(Icon, { data: PreviewClose, width: CLOSE_ICON_SIZE, height: CLOSE_ICON_SIZE, className: b('icon', { hover: true }) })),
|
|
28
28
|
React.createElement(Image, Object.assign({}, props, { className: b('modal-image', modalImageClass) })))))));
|
|
29
29
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithChildren } from '../../models';
|
|
3
|
+
import { QAProps } from '../../models/common';
|
|
3
4
|
export interface HTMLProps {
|
|
4
5
|
children?: string;
|
|
5
6
|
block?: boolean;
|
|
6
7
|
className?: string;
|
|
7
8
|
itemProp?: string;
|
|
9
|
+
id?: string;
|
|
8
10
|
}
|
|
9
|
-
declare const HTML: ({ children, block, className, itemProp }: WithChildren<HTMLProps>) => React.DetailedReactHTMLElement<{
|
|
11
|
+
declare const HTML: ({ children, block, className, itemProp, id, qa, }: WithChildren<HTMLProps & QAProps>) => React.DetailedReactHTMLElement<{
|
|
10
12
|
dangerouslySetInnerHTML: {
|
|
11
13
|
__html: string | (string & React.ReactElement<any, string | React.JSXElementConstructor<any>>) | (string & React.ReactFragment) | (string & React.ReactPortal);
|
|
12
14
|
};
|
|
13
15
|
className: string | undefined;
|
|
14
16
|
itemProp: string | undefined;
|
|
17
|
+
id: string | undefined;
|
|
18
|
+
'data-qa': string | undefined;
|
|
15
19
|
}, HTMLElement> | null;
|
|
16
20
|
export default HTML;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { hasBlockTag } from '../../utils';
|
|
3
|
-
const HTML = ({ children, block = false, className, itemProp }) => {
|
|
3
|
+
const HTML = ({ children, block = false, className, itemProp, id, qa, }) => {
|
|
4
4
|
if (!children) {
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
@@ -8,6 +8,8 @@ const HTML = ({ children, block = false, className, itemProp }) => {
|
|
|
8
8
|
dangerouslySetInnerHTML: { __html: children },
|
|
9
9
|
className,
|
|
10
10
|
itemProp,
|
|
11
|
+
id,
|
|
12
|
+
'data-qa': qa,
|
|
11
13
|
});
|
|
12
14
|
};
|
|
13
15
|
export default HTML;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Fragment, useContext, useState } from 'react';
|
|
2
2
|
import { BREAKPOINTS } from '../../constants';
|
|
3
3
|
import { ProjectSettingsContext } from '../../context/projectSettingsContext';
|
|
4
|
+
import { getQaAttrubutes } from '../../utils';
|
|
4
5
|
import { isCompressible } from '../../utils/imageCompress';
|
|
5
6
|
import ImageBase from '../ImageBase/ImageBase';
|
|
6
7
|
import i18n from './i18n';
|
|
@@ -15,18 +16,19 @@ const Image = (props) => {
|
|
|
15
16
|
if (!src) {
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
19
|
+
const qaAttributes = getQaAttrubutes(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'display-source');
|
|
18
20
|
const disableWebp = projectSettings.disableCompress ||
|
|
19
21
|
disableCompress ||
|
|
20
22
|
!isCompressible(src) ||
|
|
21
23
|
imgLoadingError;
|
|
22
24
|
return (React.createElement("picture", { className: containerClassName, "data-qa": qa },
|
|
23
25
|
mobile && (React.createElement(Fragment, null,
|
|
24
|
-
!disableWebp && (React.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${BREAKPOINTS.sm}px)
|
|
25
|
-
React.createElement("source", { srcSet: mobile, media: `(max-width: ${BREAKPOINTS.sm}px)
|
|
26
|
+
!disableWebp && (React.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${BREAKPOINTS.sm}px)`, "data-qa": qaAttributes.mobileWebpSource })),
|
|
27
|
+
React.createElement("source", { srcSet: mobile, media: `(max-width: ${BREAKPOINTS.sm}px)`, "data-qa": qaAttributes.mobileSource }))),
|
|
26
28
|
tablet && (React.createElement(Fragment, null,
|
|
27
|
-
!disableWebp && (React.createElement("source", { srcSet: checkWebP(tablet), type: "image/webp", media: `(max-width: ${BREAKPOINTS.md}px)
|
|
28
|
-
React.createElement("source", { srcSet: tablet, media: `(max-width: ${BREAKPOINTS.md}px)
|
|
29
|
-
src && !disableWebp && React.createElement("source", { srcSet: checkWebP(src), type: "image/webp" }),
|
|
29
|
+
!disableWebp && (React.createElement("source", { srcSet: checkWebP(tablet), type: "image/webp", media: `(max-width: ${BREAKPOINTS.md}px)`, "data-qa": qaAttributes.tabletWebpSource })),
|
|
30
|
+
React.createElement("source", { srcSet: tablet, media: `(max-width: ${BREAKPOINTS.md}px)`, "data-qa": qaAttributes.tabletSource }))),
|
|
31
|
+
src && !disableWebp && (React.createElement("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.displaySource })),
|
|
30
32
|
React.createElement(ImageBase, { className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true) })));
|
|
31
33
|
};
|
|
32
34
|
export default Image;
|
|
@@ -34,6 +34,25 @@ export declare const ImageObjectProps: {
|
|
|
34
34
|
type: string;
|
|
35
35
|
pattern: string;
|
|
36
36
|
};
|
|
37
|
+
style: {
|
|
38
|
+
type: string;
|
|
39
|
+
additionalProperties: boolean;
|
|
40
|
+
required: never[];
|
|
41
|
+
properties: {
|
|
42
|
+
backgroundColor: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
height: {
|
|
46
|
+
type: string[];
|
|
47
|
+
};
|
|
48
|
+
width: {
|
|
49
|
+
type: string[];
|
|
50
|
+
};
|
|
51
|
+
color: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
37
56
|
alt: {
|
|
38
57
|
type: string;
|
|
39
58
|
contentType: string;
|
|
@@ -9,6 +9,17 @@ const ImageBase = {
|
|
|
9
9
|
type: 'boolean',
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
|
+
const StyleBase = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
required: [],
|
|
16
|
+
properties: {
|
|
17
|
+
backgroundColor: { type: 'string' },
|
|
18
|
+
height: { type: ['string', 'number'] },
|
|
19
|
+
width: { type: ['string', 'number'] },
|
|
20
|
+
color: { type: 'string' },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
12
23
|
export const ImageDeviceProps = {
|
|
13
24
|
type: 'object',
|
|
14
25
|
additionalProperties: false,
|
|
@@ -28,7 +39,7 @@ export const ImageObjectProps = {
|
|
|
28
39
|
properties: Object.assign(Object.assign({}, ImageBase), { src: {
|
|
29
40
|
type: 'string',
|
|
30
41
|
pattern: imageUrlPattern,
|
|
31
|
-
} }),
|
|
42
|
+
}, style: StyleBase }),
|
|
32
43
|
};
|
|
33
44
|
export const ImageProps = {
|
|
34
45
|
oneOf: [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ClassNameProps, LinkProps, WithChildren } from '../../models';
|
|
1
|
+
import { ClassNameProps, LinkProps, Tabbable, WithChildren } from '../../models';
|
|
2
|
+
import { QAProps } from '../../models/common';
|
|
2
3
|
import './Link.css';
|
|
3
|
-
export type LinkFullProps = LinkProps & ClassNameProps;
|
|
4
|
+
export type LinkFullProps = LinkProps & ClassNameProps & Tabbable & QAProps;
|
|
4
5
|
declare const LinkBlock: (props: WithChildren<LinkFullProps>) => JSX.Element;
|
|
5
6
|
export default LinkBlock;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { Fragment, useContext } from 'react';
|
|
2
2
|
import { Icon } from '@gravity-ui/uikit';
|
|
3
|
-
import { LocaleContext } from '../../context/localeContext
|
|
4
|
-
import { LocationContext } from '../../context/locationContext
|
|
3
|
+
import { LocaleContext } from '../../context/localeContext';
|
|
4
|
+
import { LocationContext } from '../../context/locationContext';
|
|
5
5
|
import { useAnalytics } from '../../hooks';
|
|
6
6
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
7
7
|
import { Chevron } from '../../icons';
|
|
8
|
-
import { DefaultEventNames } from '../../models';
|
|
8
|
+
import { DefaultEventNames, } from '../../models';
|
|
9
9
|
import { block, getLinkProps, setUrlTld } from '../../utils';
|
|
10
|
+
import { getQaAttrubutes } from '../../utils/index';
|
|
10
11
|
import BackLink from '../BackLink/BackLink';
|
|
11
12
|
import FileLink from '../FileLink/FileLink';
|
|
12
13
|
import './Link.css';
|
|
@@ -25,7 +26,8 @@ function getArrowSize(size) {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
const LinkBlock = (props) => {
|
|
28
|
-
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, } = props;
|
|
29
|
+
const { text, url, arrow, metrikaGoals, pixelEvents, analyticsEvents, theme = 'file-link', colorTheme = 'light', textSize = 'm', className, target, children, tabIndex, qa, } = props;
|
|
30
|
+
const qaAttributes = getQaAttrubutes(qa, ['normal']);
|
|
29
31
|
const handleMetrika = useMetrika();
|
|
30
32
|
const handleAnalytics = useAnalytics(DefaultEventNames.Link, url);
|
|
31
33
|
const { hostname } = useContext(LocationContext);
|
|
@@ -39,14 +41,14 @@ const LinkBlock = (props) => {
|
|
|
39
41
|
const getLinkByType = () => {
|
|
40
42
|
switch (theme) {
|
|
41
43
|
case 'back':
|
|
42
|
-
return React.createElement(BackLink, { title: children || text, url: href, onClick: onClick });
|
|
44
|
+
return (React.createElement(BackLink, { title: children || text, url: href, onClick: onClick, tabIndex: tabIndex }));
|
|
43
45
|
case 'file-link':
|
|
44
46
|
case 'underline':
|
|
45
|
-
return (React.createElement(FileLink, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick }));
|
|
47
|
+
return (React.createElement(FileLink, { text: children || text, href: href, type: "horizontal", textSize: textSize, onClick: onClick, tabIndex: tabIndex }));
|
|
46
48
|
case 'normal': {
|
|
47
49
|
const linkProps = getLinkProps(url, hostname, target);
|
|
48
50
|
const content = children || text;
|
|
49
|
-
return (React.createElement("a", Object.assign({ className: b('link', { theme: colorTheme, 'has-arrow': arrow }), href: href, onClick: onClick }, linkProps), arrow ? (React.createElement(Fragment, null,
|
|
51
|
+
return (React.createElement("a", Object.assign({ className: b('link', { theme: colorTheme, 'has-arrow': arrow }), href: href, onClick: onClick, tabIndex: tabIndex }, linkProps, { "data-qa": qaAttributes.normal }), arrow ? (React.createElement(Fragment, null,
|
|
50
52
|
React.createElement("span", { className: b('content') }, content),
|
|
51
53
|
WORD_JOINER_SYM,
|
|
52
54
|
React.createElement(Icon, { className: b('arrow'), data: Chevron, size: getArrowSize(textSize) }))) : (content)));
|