@gravity-ui/page-constructor 4.3.0 → 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/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/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/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/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/schema.d.ts +19 -0
- package/build/cjs/components/Image/schema.js +12 -1
- package/build/cjs/components/Link/Link.d.ts +2 -1
- package/build/cjs/components/Link/Link.js +4 -2
- 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 -6
- 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 +49 -25
- package/build/cjs/components/ReactPlayer/i18n/en.json +4 -1
- package/build/cjs/components/ReactPlayer/i18n/ru.json +4 -1
- 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/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 +2 -4
- 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 +12 -5
- package/build/cjs/models/constructor-items/common.d.ts +16 -34
- 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 +7 -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/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 +3 -6
- package/build/cjs/utils/blocks.js +25 -16
- 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/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/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/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/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/schema.d.ts +19 -0
- package/build/esm/components/Image/schema.js +12 -1
- package/build/esm/components/Link/Link.d.ts +2 -1
- package/build/esm/components/Link/Link.js +4 -2
- 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 -7
- 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 +52 -28
- package/build/esm/components/ReactPlayer/i18n/en.json +4 -1
- package/build/esm/components/ReactPlayer/i18n/ru.json +4 -1
- 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/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 +2 -4
- 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 +12 -5
- package/build/esm/models/constructor-items/common.d.ts +16 -34
- 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 +7 -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/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 +3 -6
- package/build/esm/utils/blocks.js +21 -11
- package/build/esm/utils/cn.d.ts +3 -3
- package/build/esm/utils/cn.js +3 -4
- package/package.json +6 -6
- package/server/models/constructor-items/blocks.d.ts +12 -5
- package/server/models/constructor-items/common.d.ts +16 -34
- 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 +3 -6
- package/server/utils/blocks.js +25 -16
- 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
package/README.md
CHANGED
|
@@ -386,3 +386,7 @@ export const MyAppEditor = ({initialContent, onChange, transformContent}: MyAppE
|
|
|
386
386
|
<Editor content={initialContent} onChange={onChange} transformContent={transformContent} />
|
|
387
387
|
);
|
|
388
388
|
```
|
|
389
|
+
|
|
390
|
+
## Tests
|
|
391
|
+
|
|
392
|
+
Comprehensive documentation is available at the provided [link](./test-utils/docs/README.md).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CardLayoutBlockProps as CardLayoutBlockParams, WithChildren } from '../../models';
|
|
3
|
-
export type CardLayoutBlockProps = WithChildren<Omit<CardLayoutBlockParams, 'children'
|
|
2
|
+
import { CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps, WithChildren } from '../../models';
|
|
3
|
+
export type CardLayoutBlockProps = WithChildren<Omit<CardLayoutBlockParams, 'children'>> & ClassNameProps;
|
|
4
4
|
declare const CardLayout: React.FC<CardLayoutBlockProps>;
|
|
5
5
|
export default CardLayout;
|
|
@@ -11,7 +11,7 @@ const DEFAULT_SIZES = {
|
|
|
11
11
|
md: 4,
|
|
12
12
|
};
|
|
13
13
|
const b = (0, utils_1.block)('card-layout-block');
|
|
14
|
-
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, }) => (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
|
|
14
|
+
const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, }) => (react_1.default.createElement(components_1.AnimateBlock, { className: b(null, className), animate: animated },
|
|
15
15
|
(title || description) && react_1.default.createElement(components_1.Title, { title: title, subtitle: description }),
|
|
16
16
|
react_1.default.createElement(grid_1.Row, null, react_1.default.Children.map(children, (child, index) => (react_1.default.createElement(grid_1.Col, { key: index, sizes: colSizes, className: b('item') }, child))))));
|
|
17
17
|
exports.default = CardLayout;
|
|
@@ -15,6 +15,25 @@ export declare const ContentLayoutBlock: {
|
|
|
15
15
|
type: string;
|
|
16
16
|
pattern: string;
|
|
17
17
|
};
|
|
18
|
+
style: {
|
|
19
|
+
type: string;
|
|
20
|
+
additionalProperties: boolean;
|
|
21
|
+
required: never[];
|
|
22
|
+
properties: {
|
|
23
|
+
backgroundColor: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
height: {
|
|
27
|
+
type: string[];
|
|
28
|
+
};
|
|
29
|
+
width: {
|
|
30
|
+
type: string[];
|
|
31
|
+
};
|
|
32
|
+
color: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
18
37
|
alt: {
|
|
19
38
|
type: string;
|
|
20
39
|
contentType: string;
|
|
@@ -153,6 +172,25 @@ export declare const ContentLayoutBlock: {
|
|
|
153
172
|
type: string;
|
|
154
173
|
pattern: string;
|
|
155
174
|
};
|
|
175
|
+
style: {
|
|
176
|
+
type: string;
|
|
177
|
+
additionalProperties: boolean;
|
|
178
|
+
required: never[];
|
|
179
|
+
properties: {
|
|
180
|
+
backgroundColor: {
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
height: {
|
|
184
|
+
type: string[];
|
|
185
|
+
};
|
|
186
|
+
width: {
|
|
187
|
+
type: string[];
|
|
188
|
+
};
|
|
189
|
+
color: {
|
|
190
|
+
type: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
156
194
|
alt: {
|
|
157
195
|
type: string;
|
|
158
196
|
contentType: string;
|
|
@@ -75,10 +75,6 @@ unpredictable css rules order in build */
|
|
|
75
75
|
}
|
|
76
76
|
.pc-header-block__description {
|
|
77
77
|
margin-top: 16px;
|
|
78
|
-
font-weight: normal;
|
|
79
|
-
font-size: var(--g-text-caption-2-font-size);
|
|
80
|
-
line-height: var(--g-text-caption-2-line-height);
|
|
81
|
-
margin-block-end: var(--g-text-body-1-line-height);
|
|
82
78
|
}
|
|
83
79
|
.pc-header-block__description .yfm,
|
|
84
80
|
.pc-header-block__description .yfm * {
|
|
@@ -170,9 +166,7 @@ unpredictable css rules order in build */
|
|
|
170
166
|
.pc-header-block__overtitle {
|
|
171
167
|
font-size: var(--g-text-body-3-font-size);
|
|
172
168
|
line-height: var(--g-text-body-3-line-height);
|
|
173
|
-
margin-block-start: var(--g-text-body-3-line-height);
|
|
174
169
|
margin-bottom: 8px;
|
|
175
|
-
font-weight: 400;
|
|
176
170
|
}
|
|
177
171
|
.pc-header-block__overtitle a {
|
|
178
172
|
outline: none;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const components_1 = require("../../components");
|
|
6
6
|
const locationContext_1 = require("../../context/locationContext");
|
|
7
|
+
const hooks_1 = require("../../hooks");
|
|
7
8
|
const utils_1 = require("../../utils");
|
|
8
9
|
const b = (0, utils_1.block)('icons-block');
|
|
9
10
|
const getItemContent = (item) => (react_1.default.createElement(react_1.Fragment, null,
|
|
@@ -11,11 +12,16 @@ const getItemContent = (item) => (react_1.default.createElement(react_1.Fragment
|
|
|
11
12
|
react_1.default.createElement("p", { className: b('text') }, item.text)));
|
|
12
13
|
const Icons = ({ title, size = 's', items }) => {
|
|
13
14
|
const { hostname } = (0, react_1.useContext)(locationContext_1.LocationContext);
|
|
15
|
+
const handleAnalytics = (0, hooks_1.useAnalytics)();
|
|
16
|
+
const onClick = (0, react_1.useCallback)(({ analyticsEvents, url }) => {
|
|
17
|
+
handleAnalytics(analyticsEvents, { url });
|
|
18
|
+
}, [handleAnalytics]);
|
|
14
19
|
return (react_1.default.createElement("div", { className: b({ size }) },
|
|
15
20
|
title && react_1.default.createElement(components_1.Title, { className: b('header'), title: title, colSizes: { all: 12 } }),
|
|
16
21
|
items.map((item) => {
|
|
17
22
|
const itemContent = getItemContent(item);
|
|
18
|
-
|
|
23
|
+
const { url, text } = item;
|
|
24
|
+
return url ? (react_1.default.createElement("a", Object.assign({ className: b('item'), key: url, href: url, "aria-label": text, title: text }, (0, utils_1.getLinkProps)(url, hostname), { onClick: () => onClick(item) }), itemContent)) : (react_1.default.createElement("div", { className: b('item'), key: url }, itemContent));
|
|
19
25
|
})));
|
|
20
26
|
};
|
|
21
27
|
exports.default = Icons;
|
|
@@ -29,6 +29,87 @@ export declare const IconsProps: {
|
|
|
29
29
|
type: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
analyticsEvents: {
|
|
33
|
+
oneOf: ({
|
|
34
|
+
optionName: string;
|
|
35
|
+
type: string;
|
|
36
|
+
additionalProperties: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
properties: {
|
|
41
|
+
name: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
type: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
counters: {
|
|
48
|
+
type: string;
|
|
49
|
+
additionalProperties: boolean;
|
|
50
|
+
required: never[];
|
|
51
|
+
properties: {
|
|
52
|
+
include: {
|
|
53
|
+
type: string;
|
|
54
|
+
items: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exclude: {
|
|
59
|
+
type: string;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
context: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
items?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
type: string;
|
|
73
|
+
items: {
|
|
74
|
+
type: string;
|
|
75
|
+
additionalProperties: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
required: string[];
|
|
79
|
+
properties: {
|
|
80
|
+
name: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
type: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
counters: {
|
|
87
|
+
type: string;
|
|
88
|
+
additionalProperties: boolean;
|
|
89
|
+
required: never[];
|
|
90
|
+
properties: {
|
|
91
|
+
include: {
|
|
92
|
+
type: string;
|
|
93
|
+
items: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
exclude: {
|
|
98
|
+
type: string;
|
|
99
|
+
items: {
|
|
100
|
+
type: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
context: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
optionName: string;
|
|
111
|
+
})[];
|
|
112
|
+
};
|
|
32
113
|
};
|
|
33
114
|
};
|
|
34
115
|
animated: {
|
|
@@ -96,6 +177,87 @@ export declare const IconsBlock: {
|
|
|
96
177
|
type: string;
|
|
97
178
|
};
|
|
98
179
|
};
|
|
180
|
+
analyticsEvents: {
|
|
181
|
+
oneOf: ({
|
|
182
|
+
optionName: string;
|
|
183
|
+
type: string;
|
|
184
|
+
additionalProperties: {
|
|
185
|
+
type: string;
|
|
186
|
+
};
|
|
187
|
+
required: string[];
|
|
188
|
+
properties: {
|
|
189
|
+
name: {
|
|
190
|
+
type: string;
|
|
191
|
+
};
|
|
192
|
+
type: {
|
|
193
|
+
type: string;
|
|
194
|
+
};
|
|
195
|
+
counters: {
|
|
196
|
+
type: string;
|
|
197
|
+
additionalProperties: boolean;
|
|
198
|
+
required: never[];
|
|
199
|
+
properties: {
|
|
200
|
+
include: {
|
|
201
|
+
type: string;
|
|
202
|
+
items: {
|
|
203
|
+
type: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
exclude: {
|
|
207
|
+
type: string;
|
|
208
|
+
items: {
|
|
209
|
+
type: string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
context: {
|
|
215
|
+
type: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
items?: undefined;
|
|
219
|
+
} | {
|
|
220
|
+
type: string;
|
|
221
|
+
items: {
|
|
222
|
+
type: string;
|
|
223
|
+
additionalProperties: {
|
|
224
|
+
type: string;
|
|
225
|
+
};
|
|
226
|
+
required: string[];
|
|
227
|
+
properties: {
|
|
228
|
+
name: {
|
|
229
|
+
type: string;
|
|
230
|
+
};
|
|
231
|
+
type: {
|
|
232
|
+
type: string;
|
|
233
|
+
};
|
|
234
|
+
counters: {
|
|
235
|
+
type: string;
|
|
236
|
+
additionalProperties: boolean;
|
|
237
|
+
required: never[];
|
|
238
|
+
properties: {
|
|
239
|
+
include: {
|
|
240
|
+
type: string;
|
|
241
|
+
items: {
|
|
242
|
+
type: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
exclude: {
|
|
246
|
+
type: string;
|
|
247
|
+
items: {
|
|
248
|
+
type: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
context: {
|
|
254
|
+
type: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
optionName: string;
|
|
259
|
+
})[];
|
|
260
|
+
};
|
|
99
261
|
};
|
|
100
262
|
};
|
|
101
263
|
animated: {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IconsBlock = exports.IconsProps = void 0;
|
|
4
4
|
const common_1 = require("../../schema/validators/common");
|
|
5
|
+
const event_1 = require("../../schema/validators/event");
|
|
5
6
|
exports.IconsProps = {
|
|
6
7
|
additionalProperties: false,
|
|
7
8
|
required: ['size', 'items'],
|
|
@@ -30,6 +31,16 @@ exports.IconsProps = {
|
|
|
30
31
|
type: 'string',
|
|
31
32
|
},
|
|
32
33
|
},
|
|
34
|
+
analyticsEvents: {
|
|
35
|
+
oneOf: [
|
|
36
|
+
Object.assign(Object.assign({}, event_1.AnalyticsEventSchema), { optionName: 'single' }),
|
|
37
|
+
{
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: event_1.AnalyticsEventSchema,
|
|
40
|
+
optionName: 'list',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
33
44
|
},
|
|
34
45
|
} }),
|
|
35
46
|
};
|
|
@@ -4,9 +4,10 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
const ToggleArrow_1 = tslib_1.__importDefault(require("../../../components/ToggleArrow/ToggleArrow"));
|
|
6
6
|
const utils_1 = require("../../../utils");
|
|
7
|
+
const i18n_1 = tslib_1.__importDefault(require("../i18n"));
|
|
7
8
|
const b = (0, utils_1.block)('slider-block-arrow');
|
|
8
9
|
const Arrow = ({ type, handleClick, className, size = 16 }) => (react_1.default.createElement("div", { className: b({ type }, className) },
|
|
9
|
-
react_1.default.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type) },
|
|
10
|
+
react_1.default.createElement("button", { className: b('button'), onClick: () => handleClick && handleClick(type), "aria-label": (0, i18n_1.default)(`arrow-${type}`) },
|
|
10
11
|
react_1.default.createElement("span", { className: b('icon-wrapper') },
|
|
11
12
|
react_1.default.createElement(ToggleArrow_1.default, { size: size, type: 'horizontal', iconType: "navigation", className: b('icon') })))));
|
|
12
13
|
exports.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
|
}
|
|
@@ -121,27 +121,53 @@ const SliderBlock = (props) => {
|
|
|
121
121
|
slider.slickGoTo(nextIndex);
|
|
122
122
|
}
|
|
123
123
|
}, [slider, currentIndex, slidesCountByBreakpoint]);
|
|
124
|
+
const barSlidesCount = childrenCount - slidesToShowCount + 1;
|
|
125
|
+
const barPosition = (DOT_GAP + DOT_WIDTH) * currentIndex;
|
|
126
|
+
const barWidth = DOT_WIDTH + (DOT_GAP + DOT_WIDTH) * (slidesCountByBreakpoint - 1);
|
|
124
127
|
const renderBar = () => {
|
|
125
|
-
const barPosition = (DOT_GAP + DOT_WIDTH) * currentIndex;
|
|
126
|
-
const barWidth = DOT_WIDTH + (DOT_GAP + DOT_WIDTH) * (slidesCountByBreakpoint - 1);
|
|
127
128
|
return (slidesCountByBreakpoint > 1 && (react_1.default.createElement("li", { className: b('bar'), style: {
|
|
128
129
|
left: barPosition,
|
|
129
130
|
width: barWidth,
|
|
130
131
|
} })));
|
|
131
132
|
};
|
|
133
|
+
// renders additional bar, not visible in the layout but visible for screenreaders
|
|
134
|
+
const renderAccessibleBar = (index) => {
|
|
135
|
+
return (
|
|
136
|
+
// To have this key differ from keys used in renderDot function, added `-accessible-bar` part
|
|
137
|
+
react_1.default.createElement(react_1.Fragment, { key: `${index}-accessible-bar` }, slidesCountByBreakpoint > 1 && (react_1.default.createElement("li", { className: b('accessible-bar'), "aria-current": true, "aria-label": `Slide ${currentIndex + 1} of ${barSlidesCount}`, style: {
|
|
138
|
+
left: barPosition,
|
|
139
|
+
width: barWidth,
|
|
140
|
+
} }))));
|
|
141
|
+
};
|
|
132
142
|
const renderDot = (index) => {
|
|
133
|
-
|
|
143
|
+
const currentIndexDiff = index - currentIndex;
|
|
144
|
+
let currentSlideNumber;
|
|
145
|
+
if (0 <= currentIndexDiff && currentIndexDiff < slidesToShowCount) {
|
|
146
|
+
currentSlideNumber = currentIndex + 1;
|
|
147
|
+
}
|
|
148
|
+
else if (currentIndexDiff >= slidesToShowCount) {
|
|
149
|
+
currentSlideNumber = index - slidesToShowCount + 2;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
currentSlideNumber = index + 1;
|
|
153
|
+
}
|
|
154
|
+
return (react_1.default.createElement("li", { key: index, className: b('dot', { active: index === currentIndex }), onClick: () => handleDotClick(index), "aria-hidden": (slidesCountByBreakpoint > 1 &&
|
|
155
|
+
0 <= currentIndexDiff &&
|
|
156
|
+
currentIndexDiff < slidesToShowCount) ||
|
|
157
|
+
undefined, "aria-label": `Slide ${currentSlideNumber} of ${barSlidesCount}` }));
|
|
134
158
|
};
|
|
135
159
|
const renderNavigation = () => {
|
|
136
160
|
if (childrenCount <= slidesCountByBreakpoint || !dots || childrenCount === 1) {
|
|
137
161
|
return null;
|
|
138
162
|
}
|
|
163
|
+
const dotsList = Array(childrenCount)
|
|
164
|
+
.fill(null)
|
|
165
|
+
.map((_item, index) => renderDot(index));
|
|
166
|
+
dotsList.splice(currentIndex, 0, renderAccessibleBar(currentIndex));
|
|
139
167
|
return (react_1.default.createElement("div", { className: b('dots', dotsClassName) },
|
|
140
168
|
react_1.default.createElement("ul", { className: b('dots-list') },
|
|
141
169
|
renderBar(),
|
|
142
|
-
|
|
143
|
-
.fill(null)
|
|
144
|
-
.map((_item, index) => renderDot(index)))));
|
|
170
|
+
dotsList)));
|
|
145
171
|
};
|
|
146
172
|
const renderDisclaimer = () => {
|
|
147
173
|
return disclaimer ? (react_1.default.createElement("div", { className: b('disclaimer', { size: disclaimer.size || 'm' }) }, disclaimer.text)) : null;
|
|
@@ -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 = 'SliderBlock';
|
|
8
|
+
exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.qaIdByDefault = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const utils_1 = require("../../utils");
|
|
6
7
|
const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
|
|
8
|
+
exports.qaIdByDefault = 'background-image';
|
|
7
9
|
const b = (0, utils_1.block)('storage-background-image');
|
|
8
10
|
const BackgroundImage = (props) => {
|
|
9
11
|
const { children, src, desktop, className, imageClassName, style, hide, qa } = props;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa || exports.qaIdByDefault);
|
|
13
|
+
return (react_1.default.createElement("div", { className: b(null, className), style: style, "data-qa": qa || exports.qaIdByDefault },
|
|
14
|
+
(src || desktop) && !hide && (react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('img', imageClassName), qa: qaAttributes.image }))),
|
|
12
15
|
children && react_1.default.createElement("div", { className: b('container') }, children)));
|
|
13
16
|
};
|
|
14
17
|
exports.default = BackgroundImage;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BackgroundMediaProps } from '../../models';
|
|
2
|
-
declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, fullWidthMedia, ...props }: BackgroundMediaProps) => JSX.Element;
|
|
2
|
+
declare const BackgroundMedia: ({ className, color, animated, parallax, video, mediaClassName, fullWidthMedia, qa, ...props }: BackgroundMediaProps) => JSX.Element;
|
|
3
3
|
export default BackgroundMedia;
|
|
@@ -8,10 +8,11 @@ const AnimateBlock_1 = tslib_1.__importDefault(require("../AnimateBlock/AnimateB
|
|
|
8
8
|
const Media_1 = tslib_1.__importDefault(require("../Media/Media"));
|
|
9
9
|
const b = (0, utils_1.block)('BackgroundMedia');
|
|
10
10
|
const BackgroundMedia = (_a) => {
|
|
11
|
-
var { className, color, animated, parallax = true, video, mediaClassName, fullWidthMedia } = _a, props = tslib_1.__rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName", "fullWidthMedia"]);
|
|
11
|
+
var { className, color, animated, parallax = true, video, mediaClassName, fullWidthMedia, qa } = _a, props = tslib_1.__rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName", "fullWidthMedia", "qa"]);
|
|
12
12
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'media');
|
|
14
|
+
return (react_1.default.createElement(AnimateBlock_1.default, { className: b(null, className), style: { backgroundColor: color }, animate: animated, qa: qaAttributes.animate },
|
|
15
|
+
react_1.default.createElement(Media_1.default, 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,
|
|
15
16
|
parallax, video: isMobile ? undefined : video }, props)))));
|
|
16
17
|
};
|
|
17
18
|
exports.default = BackgroundMedia;
|
|
@@ -17,6 +17,11 @@ const ButtonTabs = ({ className, items, activeTab, onSelectTab, tabSize = 'l', q
|
|
|
17
17
|
onSelectTab(tabId, e);
|
|
18
18
|
}
|
|
19
19
|
}, [onSelectTab]);
|
|
20
|
-
return (react_1.default.createElement("div", { className: b(null, className), "data-qa": qa }, items.map(({ id, title }) =>
|
|
20
|
+
return (react_1.default.createElement("div", { className: b(null, className), "data-qa": qa }, items.map(({ id, title }) => {
|
|
21
|
+
const isActive = id === activeTabId;
|
|
22
|
+
return (react_1.default.createElement(index_1.Button, { text: title, className: b('item', { active: isActive }), key: title, size: tabSize, onClick: handleClick(id), extraProps: {
|
|
23
|
+
'aria-current': isActive,
|
|
24
|
+
} }));
|
|
25
|
+
})));
|
|
21
26
|
};
|
|
22
27
|
exports.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;
|
|
@@ -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;
|
|
@@ -3,7 +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 HTML = ({ children, block = false, className, itemProp }) => {
|
|
6
|
+
const HTML = ({ children, block = false, className, itemProp, id, qa, }) => {
|
|
7
7
|
if (!children) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
@@ -11,6 +11,8 @@ const HTML = ({ children, block = false, className, itemProp }) => {
|
|
|
11
11
|
dangerouslySetInnerHTML: { __html: children },
|
|
12
12
|
className,
|
|
13
13
|
itemProp,
|
|
14
|
+
id,
|
|
15
|
+
'data-qa': qa,
|
|
14
16
|
});
|
|
15
17
|
};
|
|
16
18
|
exports.default = HTML;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const projectSettingsContext_1 = require("../../context/projectSettingsContext");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
7
8
|
const imageCompress_1 = require("../../utils/imageCompress");
|
|
8
9
|
const ImageBase_1 = tslib_1.__importDefault(require("../ImageBase/ImageBase"));
|
|
9
10
|
const i18n_1 = tslib_1.__importDefault(require("./i18n"));
|
|
@@ -18,18 +19,19 @@ const Image = (props) => {
|
|
|
18
19
|
if (!src) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
22
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'display-source');
|
|
21
23
|
const disableWebp = projectSettings.disableCompress ||
|
|
22
24
|
disableCompress ||
|
|
23
25
|
!(0, imageCompress_1.isCompressible)(src) ||
|
|
24
26
|
imgLoadingError;
|
|
25
27
|
return (react_1.default.createElement("picture", { className: containerClassName, "data-qa": qa },
|
|
26
28
|
mobile && (react_1.default.createElement(react_1.Fragment, null,
|
|
27
|
-
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)
|
|
28
|
-
react_1.default.createElement("source", { srcSet: mobile, media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)
|
|
29
|
+
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(mobile), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)`, "data-qa": qaAttributes.mobileWebpSource })),
|
|
30
|
+
react_1.default.createElement("source", { srcSet: mobile, media: `(max-width: ${constants_1.BREAKPOINTS.sm}px)`, "data-qa": qaAttributes.mobileSource }))),
|
|
29
31
|
tablet && (react_1.default.createElement(react_1.Fragment, null,
|
|
30
|
-
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(tablet), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.md}px)
|
|
31
|
-
react_1.default.createElement("source", { srcSet: tablet, media: `(max-width: ${constants_1.BREAKPOINTS.md}px)
|
|
32
|
-
src && !disableWebp && react_1.default.createElement("source", { srcSet: checkWebP(src), type: "image/webp" }),
|
|
32
|
+
!disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(tablet), type: "image/webp", media: `(max-width: ${constants_1.BREAKPOINTS.md}px)`, "data-qa": qaAttributes.tabletWebpSource })),
|
|
33
|
+
react_1.default.createElement("source", { srcSet: tablet, media: `(max-width: ${constants_1.BREAKPOINTS.md}px)`, "data-qa": qaAttributes.tabletSource }))),
|
|
34
|
+
src && !disableWebp && (react_1.default.createElement("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.displaySource })),
|
|
33
35
|
react_1.default.createElement(ImageBase_1.default, { className: className, alt: alt, src: src, style: style, onClick: onClick, onError: () => setImgLoadingError(true) })));
|
|
34
36
|
};
|
|
35
37
|
exports.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;
|