@gravity-ui/page-constructor 8.2.2 → 8.4.0
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 +1 -1
- package/build/cjs/blocks/ContentLayout/ContentLayout.css +2 -2
- package/build/cjs/blocks/ContentLayout/ContentLayout.js +2 -0
- package/build/cjs/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -11
- package/build/cjs/blocks/FoldableList/schema.d.ts +0 -11
- package/build/cjs/blocks/Form/Form.css +10 -1
- package/build/cjs/blocks/Form/Form.js +4 -2
- package/build/cjs/blocks/Form/Form.js.map +1 -1
- package/build/cjs/blocks/Form/schema.d.ts +0 -11
- package/build/cjs/blocks/Header/Header.css +6 -0
- package/build/cjs/blocks/Header/schema.js +1 -25
- package/build/cjs/blocks/Header/schema.js.map +1 -1
- package/build/cjs/blocks/Hero/Hero.css +211 -0
- package/build/cjs/blocks/Hero/Hero.d.ts +3 -0
- package/build/cjs/blocks/Hero/Hero.js +50 -0
- package/build/cjs/blocks/Hero/Hero.js.map +1 -0
- package/build/cjs/blocks/Hero/hooks.d.ts +4 -0
- package/build/cjs/blocks/Hero/hooks.js +38 -0
- package/build/cjs/blocks/Hero/hooks.js.map +1 -0
- package/build/cjs/blocks/Hero/schema.d.ts +2076 -0
- package/build/cjs/blocks/Hero/schema.js +66 -0
- package/build/cjs/blocks/Hero/schema.js.map +1 -0
- package/build/cjs/blocks/Info/schema.d.ts +0 -22
- package/build/cjs/blocks/Map/schema.d.ts +0 -11
- package/build/cjs/blocks/Media/schema.d.ts +0 -22
- package/build/cjs/blocks/Questions/schema.d.ts +0 -11
- package/build/cjs/blocks/Tabs/schema.d.ts +0 -11
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/blocks/index.js.map +1 -1
- package/build/cjs/components/Buttons/Buttons.css +2 -2
- package/build/cjs/components/Buttons/Buttons.d.ts +2 -1
- package/build/cjs/components/Buttons/Buttons.js +8 -3
- package/build/cjs/components/Buttons/Buttons.js.map +1 -1
- package/build/cjs/components/ContentList/ContentList.css +8 -8
- package/build/cjs/components/ContentList/ContentList.js +2 -0
- package/build/cjs/components/ContentList/ContentList.js.map +1 -1
- package/build/cjs/components/DefaultVideo/DefaultVideo.d.ts +1 -0
- package/build/cjs/components/DefaultVideo/DefaultVideo.js +2 -2
- package/build/cjs/components/DefaultVideo/DefaultVideo.js.map +1 -1
- package/build/cjs/components/IconWrapper/IconWrapper.css +6 -0
- package/build/cjs/components/Image/Image.d.ts +5 -1
- package/build/cjs/components/Image/Image.js +4 -2
- package/build/cjs/components/Image/Image.js.map +1 -1
- package/build/cjs/components/ImageBase/ImageBase.d.ts +2 -2
- package/build/cjs/components/ImageBase/ImageBase.js +5 -5
- package/build/cjs/components/ImageBase/ImageBase.js.map +1 -1
- package/build/cjs/components/Links/Links.css +1 -1
- package/build/cjs/components/Links/Links.js +2 -0
- package/build/cjs/components/Links/Links.js.map +1 -1
- package/build/cjs/components/Media/Image/Image.d.ts +4 -0
- package/build/cjs/components/Media/Image/Image.js +3 -3
- package/build/cjs/components/Media/Image/Image.js.map +1 -1
- package/build/cjs/components/Media/Media.js +8 -4
- package/build/cjs/components/Media/Media.js.map +1 -1
- package/build/cjs/components/Media/Video/Video.d.ts +5 -0
- package/build/cjs/components/Media/Video/Video.js +30 -4
- package/build/cjs/components/Media/Video/Video.js.map +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.css +5 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +5 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +12 -4
- package/build/cjs/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/cjs/components/Title/TitleItem.css +6 -0
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/components/index.js +3 -1
- package/build/cjs/components/index.js.map +1 -1
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +1 -0
- package/build/cjs/constructor-items.js.map +1 -1
- package/build/cjs/context/imageContext/imageContext.d.ts +1 -1
- package/build/cjs/context/imageContext/imageContext.js.map +1 -1
- package/build/cjs/demo/ComponentsText.stories.js +3 -3
- package/build/cjs/demo/ComponentsText.stories.js.map +1 -1
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +1 -0
- package/build/cjs/hooks/index.js.map +1 -1
- package/build/cjs/hooks/useImageSize.d.ts +8 -0
- package/build/cjs/hooks/useImageSize.js +52 -0
- package/build/cjs/hooks/useImageSize.js.map +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +31 -22
- package/build/cjs/models/constructor-items/blocks.js +6 -1
- package/build/cjs/models/constructor-items/blocks.js.map +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +1 -1
- package/build/cjs/models/constructor-items/common.js.map +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +6 -6
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/schema/constants.d.ts +5 -30
- package/build/cjs/schema/constants.js +1 -0
- package/build/cjs/schema/constants.js.map +1 -1
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/schema/validators/blocks.js.map +1 -1
- package/build/cjs/schema/validators/common.d.ts +28 -0
- package/build/cjs/schema/validators/common.js +27 -2
- package/build/cjs/schema/validators/common.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +3 -10
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +2 -9
- package/build/cjs/sub-blocks/BasicCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/Content/Content.css +29 -17
- package/build/cjs/sub-blocks/Content/Content.js +7 -13
- package/build/cjs/sub-blocks/Content/Content.js.map +1 -1
- package/build/cjs/sub-blocks/Content/schema.d.ts +0 -100
- package/build/cjs/sub-blocks/Content/schema.js +1 -14
- package/build/cjs/sub-blocks/Content/schema.js.map +1 -1
- package/build/cjs/sub-blocks/ImageCard/schema.d.ts +0 -11
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +0 -11
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/cjs/text-transform/config.js +17 -0
- package/build/cjs/text-transform/config.js.map +1 -1
- package/build/esm/blocks/ContentLayout/ContentLayout.css +2 -2
- package/build/esm/blocks/ContentLayout/ContentLayout.js +2 -0
- package/build/esm/blocks/ContentLayout/ContentLayout.js.map +1 -1
- package/build/esm/blocks/ContentLayout/schema.d.ts +0 -11
- package/build/esm/blocks/FoldableList/schema.d.ts +0 -11
- package/build/esm/blocks/Form/Form.css +10 -1
- package/build/esm/blocks/Form/Form.js +4 -2
- package/build/esm/blocks/Form/Form.js.map +1 -1
- package/build/esm/blocks/Form/schema.d.ts +0 -11
- package/build/esm/blocks/Header/Header.css +6 -0
- package/build/esm/blocks/Header/schema.js +2 -26
- package/build/esm/blocks/Header/schema.js.map +1 -1
- package/build/esm/blocks/Hero/Hero.css +211 -0
- package/build/esm/blocks/Hero/Hero.d.ts +4 -0
- package/build/esm/blocks/Hero/Hero.js +48 -0
- package/build/esm/blocks/Hero/Hero.js.map +1 -0
- package/build/esm/blocks/Hero/hooks.d.ts +4 -0
- package/build/esm/blocks/Hero/hooks.js +33 -0
- package/build/esm/blocks/Hero/hooks.js.map +1 -0
- package/build/esm/blocks/Hero/schema.d.ts +2076 -0
- package/build/esm/blocks/Hero/schema.js +62 -0
- package/build/esm/blocks/Hero/schema.js.map +1 -0
- package/build/esm/blocks/Info/schema.d.ts +0 -22
- package/build/esm/blocks/Map/schema.d.ts +0 -11
- package/build/esm/blocks/Media/schema.d.ts +0 -22
- package/build/esm/blocks/Questions/schema.d.ts +0 -11
- package/build/esm/blocks/Tabs/schema.d.ts +0 -11
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/blocks/index.js.map +1 -1
- package/build/esm/components/Buttons/Buttons.css +2 -2
- package/build/esm/components/Buttons/Buttons.d.ts +2 -1
- package/build/esm/components/Buttons/Buttons.js +8 -3
- package/build/esm/components/Buttons/Buttons.js.map +1 -1
- package/build/esm/components/ContentList/ContentList.css +8 -8
- package/build/esm/components/ContentList/ContentList.js +2 -0
- package/build/esm/components/ContentList/ContentList.js.map +1 -1
- package/build/esm/components/DefaultVideo/DefaultVideo.d.ts +1 -0
- package/build/esm/components/DefaultVideo/DefaultVideo.js +2 -2
- package/build/esm/components/DefaultVideo/DefaultVideo.js.map +1 -1
- package/build/esm/components/IconWrapper/IconWrapper.css +6 -0
- package/build/esm/components/Image/Image.d.ts +5 -1
- package/build/esm/components/Image/Image.js +4 -2
- package/build/esm/components/Image/Image.js.map +1 -1
- package/build/esm/components/ImageBase/ImageBase.d.ts +2 -2
- package/build/esm/components/ImageBase/ImageBase.js +5 -4
- package/build/esm/components/ImageBase/ImageBase.js.map +1 -1
- package/build/esm/components/Links/Links.css +1 -1
- package/build/esm/components/Links/Links.js +2 -0
- package/build/esm/components/Links/Links.js.map +1 -1
- package/build/esm/components/Media/Image/Image.d.ts +4 -0
- package/build/esm/components/Media/Image/Image.js +3 -3
- package/build/esm/components/Media/Image/Image.js.map +1 -1
- package/build/esm/components/Media/Media.js +8 -4
- package/build/esm/components/Media/Media.js.map +1 -1
- package/build/esm/components/Media/Video/Video.d.ts +5 -0
- package/build/esm/components/Media/Video/Video.js +30 -4
- package/build/esm/components/Media/Video/Video.js.map +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.css +5 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +5 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +13 -5
- package/build/esm/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/esm/components/Title/TitleItem.css +6 -0
- package/build/esm/components/index.d.ts +1 -0
- package/build/esm/components/index.js +1 -0
- package/build/esm/components/index.js.map +1 -1
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +2 -1
- package/build/esm/constructor-items.js.map +1 -1
- package/build/esm/context/imageContext/imageContext.d.ts +1 -1
- package/build/esm/context/imageContext/imageContext.js.map +1 -1
- package/build/esm/demo/ComponentsText.stories.js +3 -3
- package/build/esm/demo/ComponentsText.stories.js.map +1 -1
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/index.js.map +1 -1
- package/build/esm/hooks/useImageSize.d.ts +8 -0
- package/build/esm/hooks/useImageSize.js +47 -0
- package/build/esm/hooks/useImageSize.js.map +1 -0
- package/build/esm/models/constructor-items/blocks.d.ts +31 -22
- package/build/esm/models/constructor-items/blocks.js +6 -1
- package/build/esm/models/constructor-items/blocks.js.map +1 -1
- package/build/esm/models/constructor-items/common.d.ts +1 -1
- package/build/esm/models/constructor-items/common.js.map +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +6 -6
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/schema/constants.d.ts +5 -30
- package/build/esm/schema/constants.js +2 -1
- package/build/esm/schema/constants.js.map +1 -1
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/schema/validators/blocks.js.map +1 -1
- package/build/esm/schema/validators/common.d.ts +28 -0
- package/build/esm/schema/validators/common.js +26 -1
- package/build/esm/schema/validators/common.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +3 -10
- package/build/esm/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +2 -9
- package/build/esm/sub-blocks/BasicCard/schema.js +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/Content/Content.css +29 -17
- package/build/esm/sub-blocks/Content/Content.js +7 -12
- package/build/esm/sub-blocks/Content/Content.js.map +1 -1
- package/build/esm/sub-blocks/Content/schema.d.ts +0 -100
- package/build/esm/sub-blocks/Content/schema.js +0 -13
- package/build/esm/sub-blocks/Content/schema.js.map +1 -1
- package/build/esm/sub-blocks/ImageCard/schema.d.ts +0 -11
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +0 -11
- package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/esm/text-transform/config.js +17 -0
- package/build/esm/text-transform/config.js.map +1 -1
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +31 -22
- package/server/models/constructor-items/blocks.js +6 -1
- package/server/models/constructor-items/common.d.ts +1 -1
- package/server/models/constructor-items/sub-blocks.d.ts +6 -6
- package/server/text-transform/config.js +17 -0
- package/styles/mixins.scss +4 -0
- package/widget/index.js +1 -1
- package/build/cjs/components/ContentLabels/ContentLabels.css +0 -53
- package/build/cjs/components/ContentLabels/ContentLabels.d.ts +0 -3
- package/build/cjs/components/ContentLabels/ContentLabels.js +0 -16
- package/build/cjs/components/ContentLabels/ContentLabels.js.map +0 -1
- package/build/esm/components/ContentLabels/ContentLabels.css +0 -53
- package/build/esm/components/ContentLabels/ContentLabels.d.ts +0 -4
- package/build/esm/components/ContentLabels/ContentLabels.js +0 -14
- package/build/esm/components/ContentLabels/ContentLabels.js.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import pick from "lodash/pick.js";
|
|
2
|
+
import { BlockBaseProps, ButtonProps, HeaderBreadcrumbsProps, MediaProps, withTheme, } from "../../schema/validators/common.js";
|
|
3
|
+
import { ContentBase } from "../../sub-blocks/Content/schema.js";
|
|
4
|
+
export const HeroBlockButton = {
|
|
5
|
+
type: 'object',
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
required: ['text', 'url'],
|
|
8
|
+
properties: pick(ButtonProps, ['text', 'url', 'theme', 'primary', 'size', 'extraProps']),
|
|
9
|
+
};
|
|
10
|
+
export const HeroBlockBackground = {
|
|
11
|
+
type: 'object',
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
required: [],
|
|
14
|
+
properties: {
|
|
15
|
+
...pick(MediaProps, ['image', 'video', 'parallax', 'height', 'ratio', 'previewImg']),
|
|
16
|
+
color: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const HeroBlockProps = {
|
|
22
|
+
...pick(ContentBase, ['title', 'text', 'list', 'additionalInfo', 'links', 'theme']),
|
|
23
|
+
breadcrumbs: HeaderBreadcrumbsProps,
|
|
24
|
+
overtitle: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
contentType: 'text',
|
|
27
|
+
},
|
|
28
|
+
buttons: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: withTheme(HeroBlockButton),
|
|
31
|
+
},
|
|
32
|
+
media: withTheme({
|
|
33
|
+
type: 'object',
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
required: [],
|
|
36
|
+
properties: {
|
|
37
|
+
...MediaProps,
|
|
38
|
+
roundCorners: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
fullWidth: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
},
|
|
46
|
+
verticalOffset: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
enum: ['s', 'm', 'l', 'xl'],
|
|
49
|
+
},
|
|
50
|
+
background: withTheme(HeroBlockBackground),
|
|
51
|
+
};
|
|
52
|
+
export const HeroBlock = {
|
|
53
|
+
'hero-block': {
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
required: ['title'],
|
|
56
|
+
properties: {
|
|
57
|
+
...BlockBaseProps,
|
|
58
|
+
...HeroBlockProps,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Hero/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EACH,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,UAAU,EACV,SAAS,GACZ,0CAAuC;AACxC,OAAO,EAAC,WAAW,EAAC,2CAAwC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACzB,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;CAC3F,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE;QACR,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;QACpF,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnF,WAAW,EAAE,sBAAsB;IACnC,SAAS,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,MAAM;KACtB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC;KACpC;IACD,KAAK,EAAE,SAAS,CAAC;QACb,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,UAAU;YACb,YAAY,EAAE;gBACV,IAAI,EAAE,SAAS;aAClB;SACJ;KACJ,CAAC;IACF,SAAS,EAAE;QACP,IAAI,EAAE,SAAS;KAClB;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;KAC9B;IACD,UAAU,EAAE,SAAS,CAAC,mBAAmB,CAAC;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,cAAc;YACjB,GAAG,cAAc;SACpB;KACJ;CACJ,CAAC","sourcesContent":["import pick from 'lodash/pick';\n\nimport {\n BlockBaseProps,\n ButtonProps,\n HeaderBreadcrumbsProps,\n MediaProps,\n withTheme,\n} from '../../schema/validators/common';\nimport {ContentBase} from '../../sub-blocks/Content/schema';\n\nexport const HeroBlockButton = {\n type: 'object',\n additionalProperties: false,\n required: ['text', 'url'],\n properties: pick(ButtonProps, ['text', 'url', 'theme', 'primary', 'size', 'extraProps']),\n};\n\nexport const HeroBlockBackground = {\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n ...pick(MediaProps, ['image', 'video', 'parallax', 'height', 'ratio', 'previewImg']),\n color: {\n type: 'string',\n },\n },\n};\n\nexport const HeroBlockProps = {\n ...pick(ContentBase, ['title', 'text', 'list', 'additionalInfo', 'links', 'theme']),\n breadcrumbs: HeaderBreadcrumbsProps,\n overtitle: {\n type: 'string',\n contentType: 'text',\n },\n buttons: {\n type: 'array',\n items: withTheme(HeroBlockButton),\n },\n media: withTheme({\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n ...MediaProps,\n roundCorners: {\n type: 'boolean',\n },\n },\n }),\n fullWidth: {\n type: 'boolean',\n },\n verticalOffset: {\n type: 'string',\n enum: ['s', 'm', 'l', 'xl'],\n },\n background: withTheme(HeroBlockBackground),\n};\n\nexport const HeroBlock = {\n 'hero-block': {\n additionalProperties: false,\n required: ['title'],\n properties: {\n ...BlockBaseProps,\n ...HeroBlockProps,\n },\n },\n};\n"]}
|
|
@@ -213,17 +213,6 @@ export declare const InfoBlock: {
|
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
labels: {
|
|
217
|
-
type: string;
|
|
218
|
-
items: {
|
|
219
|
-
type: string;
|
|
220
|
-
properties: {
|
|
221
|
-
when: {
|
|
222
|
-
type: string;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
216
|
controlPosition: {
|
|
228
217
|
type: string;
|
|
229
218
|
enum: string[];
|
|
@@ -393,17 +382,6 @@ export declare const InfoBlock: {
|
|
|
393
382
|
};
|
|
394
383
|
};
|
|
395
384
|
};
|
|
396
|
-
labels: {
|
|
397
|
-
type: string;
|
|
398
|
-
items: {
|
|
399
|
-
type: string;
|
|
400
|
-
properties: {
|
|
401
|
-
when: {
|
|
402
|
-
type: string;
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
385
|
controlPosition: {
|
|
408
386
|
type: string;
|
|
409
387
|
enum: string[];
|
|
@@ -499,17 +499,6 @@ export declare const MapBlock: {
|
|
|
499
499
|
type: string;
|
|
500
500
|
enum: string[];
|
|
501
501
|
};
|
|
502
|
-
labels: {
|
|
503
|
-
type: string;
|
|
504
|
-
items: {
|
|
505
|
-
type: string;
|
|
506
|
-
properties: {
|
|
507
|
-
when: {
|
|
508
|
-
type: string;
|
|
509
|
-
};
|
|
510
|
-
};
|
|
511
|
-
};
|
|
512
|
-
};
|
|
513
502
|
additionalInfo: {
|
|
514
503
|
type: string;
|
|
515
504
|
contentType: string;
|
|
@@ -615,17 +615,6 @@ export declare const MediaBlockBaseProps: {
|
|
|
615
615
|
type: string;
|
|
616
616
|
enum: string[];
|
|
617
617
|
};
|
|
618
|
-
labels: {
|
|
619
|
-
type: string;
|
|
620
|
-
items: {
|
|
621
|
-
type: string;
|
|
622
|
-
properties: {
|
|
623
|
-
when: {
|
|
624
|
-
type: string;
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
};
|
|
629
618
|
additionalInfo: {
|
|
630
619
|
type: string;
|
|
631
620
|
contentType: string;
|
|
@@ -1345,17 +1334,6 @@ export declare const MediaBlock: {
|
|
|
1345
1334
|
type: string;
|
|
1346
1335
|
enum: string[];
|
|
1347
1336
|
};
|
|
1348
|
-
labels: {
|
|
1349
|
-
type: string;
|
|
1350
|
-
items: {
|
|
1351
|
-
type: string;
|
|
1352
|
-
properties: {
|
|
1353
|
-
when: {
|
|
1354
|
-
type: string;
|
|
1355
|
-
};
|
|
1356
|
-
};
|
|
1357
|
-
};
|
|
1358
|
-
};
|
|
1359
1337
|
additionalInfo: {
|
|
1360
1338
|
type: string;
|
|
1361
1339
|
contentType: string;
|
|
@@ -129,17 +129,6 @@ export declare const QuestionsBlock: {
|
|
|
129
129
|
contentType: string;
|
|
130
130
|
inputType: string;
|
|
131
131
|
};
|
|
132
|
-
labels: {
|
|
133
|
-
type: string;
|
|
134
|
-
items: {
|
|
135
|
-
type: string;
|
|
136
|
-
properties: {
|
|
137
|
-
when: {
|
|
138
|
-
type: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
132
|
additionalInfo: {
|
|
144
133
|
type: string;
|
|
145
134
|
contentType: string;
|
|
@@ -649,17 +649,6 @@ export declare const tabsItem: {
|
|
|
649
649
|
};
|
|
650
650
|
};
|
|
651
651
|
} | undefined;
|
|
652
|
-
labels?: {
|
|
653
|
-
type: string;
|
|
654
|
-
items: {
|
|
655
|
-
type: string;
|
|
656
|
-
properties: {
|
|
657
|
-
when: {
|
|
658
|
-
type: string;
|
|
659
|
-
};
|
|
660
|
-
};
|
|
661
|
-
};
|
|
662
|
-
} | undefined;
|
|
663
652
|
controlPosition?: {
|
|
664
653
|
type: string;
|
|
665
654
|
enum: string[];
|
|
@@ -13,6 +13,7 @@ export { default as FoldableListBlock } from "./FoldableList/FoldableList.js";
|
|
|
13
13
|
export { default as TableBlock } from "./Table/Table.js";
|
|
14
14
|
export { default as TabsBlock } from "./Tabs/Tabs.js";
|
|
15
15
|
export { default as HeaderBlock } from "./Header/Header.js";
|
|
16
|
+
export { default as HeroBlock } from "./Hero/Hero.js";
|
|
16
17
|
export { default as IconsBlock } from "./Icons/Icons.js";
|
|
17
18
|
export { default as HeaderSliderBlock } from "./HeaderSlider/HeaderSlider.js";
|
|
18
19
|
export { default as CardLayoutBlock } from "./CardLayout/CardLayout.js";
|
|
@@ -12,6 +12,7 @@ export { default as FoldableListBlock } from "./FoldableList/FoldableList.js";
|
|
|
12
12
|
export { default as TableBlock } from "./Table/Table.js";
|
|
13
13
|
export { default as TabsBlock } from "./Tabs/Tabs.js";
|
|
14
14
|
export { default as HeaderBlock } from "./Header/Header.js";
|
|
15
|
+
export { default as HeroBlock } from "./Hero/Hero.js";
|
|
15
16
|
export { default as IconsBlock } from "./Icons/Icons.js";
|
|
16
17
|
export { default as HeaderSliderBlock } from "./HeaderSlider/HeaderSlider.js";
|
|
17
18
|
export { default as CardLayoutBlock } from "./CardLayout/CardLayout.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../../../src","sources":["blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AACvD,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB;AACjD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,qBAAkB;AAC9C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AAEvD,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,+CAA4C;AACrF,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,mDAAgD;AACtF,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,uCAAoC;AACzE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB;AACjD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AACvD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,uCAAoC;AACzE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,mCAAgC;AACnE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,yCAAsC;AAC5E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,qCAAkC;AACjE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB","sourcesContent":["export {default as BannerBlock} from './Banner/Banner';\nexport {default as CompaniesBlock} from './Companies/Companies';\nexport {default as InfoBlock} from './Info/Info';\nexport {default as MediaBlock} from './Media/Media';\nexport {default as MapBlock} from './Map/Map';\nexport {default as SliderOldBlock} from './SliderOld/SliderOld';\nexport {default as SliderBlock} from './Slider/Slider';\nexport type {Swiper, SwiperOptions} from './Slider/Slider';\nexport {default as ExtendedFeaturesBlock} from './ExtendedFeatures/ExtendedFeatures';\nexport {default as PromoFeaturesBlock} from './PromoFeaturesBlock/PromoFeaturesBlock';\nexport {default as QuestionsBlock} from './Questions/Questions';\nexport {default as FoldableListBlock} from './FoldableList/FoldableList';\nexport {default as TableBlock} from './Table/Table';\nexport {default as TabsBlock} from './Tabs/Tabs';\nexport {default as HeaderBlock} from './Header/Header';\nexport {default as IconsBlock} from './Icons/Icons';\nexport {default as HeaderSliderBlock} from './HeaderSlider/HeaderSlider';\nexport {default as CardLayoutBlock} from './CardLayout/CardLayout';\nexport {default as ContentLayoutBlock} from './ContentLayout/ContentLayout';\nexport {default as ShareBlock} from './Share/Share';\nexport {default as FilterBlock} from './FilterBlock/FilterBlock';\nexport {default as FormBlock} from './Form/Form';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../src","sources":["blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AACvD,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB;AACjD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,qBAAkB;AAC9C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AAEvD,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,+CAA4C;AACrF,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,mDAAgD;AACtF,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,iCAA8B;AAChE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,uCAAoC;AACzE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB;AACjD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,2BAAwB;AACvD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB;AACjD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,uCAAoC;AACzE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,mCAAgC;AACnE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,yCAAsC;AAC5E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,yBAAsB;AACpD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,qCAAkC;AACjE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,uBAAoB","sourcesContent":["export {default as BannerBlock} from './Banner/Banner';\nexport {default as CompaniesBlock} from './Companies/Companies';\nexport {default as InfoBlock} from './Info/Info';\nexport {default as MediaBlock} from './Media/Media';\nexport {default as MapBlock} from './Map/Map';\nexport {default as SliderOldBlock} from './SliderOld/SliderOld';\nexport {default as SliderBlock} from './Slider/Slider';\nexport type {Swiper, SwiperOptions} from './Slider/Slider';\nexport {default as ExtendedFeaturesBlock} from './ExtendedFeatures/ExtendedFeatures';\nexport {default as PromoFeaturesBlock} from './PromoFeaturesBlock/PromoFeaturesBlock';\nexport {default as QuestionsBlock} from './Questions/Questions';\nexport {default as FoldableListBlock} from './FoldableList/FoldableList';\nexport {default as TableBlock} from './Table/Table';\nexport {default as TabsBlock} from './Tabs/Tabs';\nexport {default as HeaderBlock} from './Header/Header';\nexport {default as HeroBlock} from './Hero/Hero';\nexport {default as IconsBlock} from './Icons/Icons';\nexport {default as HeaderSliderBlock} from './HeaderSlider/HeaderSlider';\nexport {default as CardLayoutBlock} from './CardLayout/CardLayout';\nexport {default as ContentLayoutBlock} from './ContentLayout/ContentLayout';\nexport {default as ShareBlock} from './Share/Share';\nexport {default as FilterBlock} from './FilterBlock/FilterBlock';\nexport {default as FormBlock} from './Form/Form';\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { ButtonProps, ContentSize } from "../../models/index.js";
|
|
2
3
|
import './Buttons.css';
|
|
3
4
|
type ButtonsProps = {
|
|
4
5
|
className?: string;
|
|
5
|
-
buttons?: ButtonProps[];
|
|
6
|
+
buttons?: (ButtonProps | React.ReactNode)[];
|
|
6
7
|
size?: ContentSize;
|
|
7
8
|
titleId?: string;
|
|
8
9
|
qa?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { block } from "../../utils/index.js";
|
|
4
5
|
import Button from "../Button/Button.js";
|
|
5
6
|
import './Buttons.css';
|
|
@@ -8,13 +9,17 @@ function getButtonSize(size) {
|
|
|
8
9
|
switch (size) {
|
|
9
10
|
case 's':
|
|
10
11
|
return 'm';
|
|
12
|
+
case 'm':
|
|
11
13
|
case 'l':
|
|
14
|
+
case 'xl':
|
|
12
15
|
default:
|
|
13
16
|
return 'xl';
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
|
-
const Buttons = ({ className, titleId, buttons, size = 's', qa, buttonQa }) => buttons ? (_jsx("div", { className: b({ size }, className), "data-qa": qa, children: buttons.map((item) => (_createElement(Button, { className: b('button'), ...item, key: item.url, size: getButtonSize(size), qa: buttonQa, extraProps: {
|
|
17
|
-
'aria-describedby': item.urlTitle
|
|
19
|
+
const Buttons = ({ className, titleId, buttons, size = 's', qa, buttonQa }) => buttons ? (_jsx("div", { className: b({ size }, className), "data-qa": qa, children: buttons.map((item, index) => React.isValidElement(item) ? (_jsx(React.Fragment, { children: item }, index)) : (_createElement(Button, { className: b('button'), ...item, key: item.url, size: getButtonSize(size), qa: buttonQa, extraProps: {
|
|
20
|
+
'aria-describedby': item.urlTitle
|
|
21
|
+
? undefined
|
|
22
|
+
: titleId,
|
|
18
23
|
...item.extraProps,
|
|
19
24
|
} }))) })) : null;
|
|
20
25
|
export default Buttons;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buttons.js","sourceRoot":"../../../../src","sources":["components/Buttons/Buttons.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Buttons.js","sourceRoot":"../../../../src","sources":["components/Buttons/Buttons.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,MAAM,4BAAyB;AAEtC,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAW3B,SAAS,aAAa,CAAC,IAAiB;IACpC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,GAAG,CAAC;QACf,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;QACV;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAe,EAAE,EAAE,CACtF,OAAO,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,aAAW,EAAE,YAC5C,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACzB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACzB,KAAC,KAAK,CAAC,QAAQ,cAAc,IAAI,IAAZ,KAAK,CAAyB,CACtD,CAAC,CAAC,CAAC,CACA,eAAC,MAAM,IACH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KACjB,IAAoB,EACzB,GAAG,EAAG,IAAoB,CAAC,GAAG,EAC9B,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EACzB,EAAE,EAAE,QAAQ,EACZ,UAAU,EAAE;YACR,kBAAkB,EAAG,IAAoB,CAAC,QAAQ;gBAC9C,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,OAAO;YACb,GAAI,IAAoB,CAAC,UAAU;SACtC,GACH,CACL,CACJ,GACC,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;AAEb,eAAe,OAAO,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ButtonProps, ContentSize} from '../../models';\nimport {block} from '../../utils';\nimport Button from '../Button/Button';\n\nimport './Buttons.scss';\n\nconst b = block('buttons');\n\ntype ButtonsProps = {\n className?: string;\n buttons?: (ButtonProps | React.ReactNode)[];\n size?: ContentSize;\n titleId?: string;\n qa?: string;\n buttonQa?: string;\n};\n\nfunction getButtonSize(size: ContentSize) {\n switch (size) {\n case 's':\n return 'm';\n case 'm':\n case 'l':\n case 'xl':\n default:\n return 'xl';\n }\n}\n\nconst Buttons = ({className, titleId, buttons, size = 's', qa, buttonQa}: ButtonsProps) =>\n buttons ? (\n <div className={b({size}, className)} data-qa={qa}>\n {buttons.map((item, index) =>\n React.isValidElement(item) ? (\n <React.Fragment key={index}>{item}</React.Fragment>\n ) : (\n <Button\n className={b('button')}\n {...(item as ButtonProps)}\n key={(item as ButtonProps).url}\n size={getButtonSize(size)}\n qa={buttonQa}\n extraProps={{\n 'aria-describedby': (item as ButtonProps).urlTitle\n ? undefined\n : titleId,\n ...(item as ButtonProps).extraProps,\n }}\n />\n ),\n )}\n </div>\n ) : null;\n\nexport default Buttons;\n"]}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
|
-
.pc-content-list_size_l, .pc-content-list_size_m {
|
|
3
|
+
.pc-content-list_size_xl, .pc-content-list_size_l, .pc-content-list_size_m {
|
|
4
4
|
max-width: 480px;
|
|
5
5
|
}
|
|
6
|
-
.pc-content-list_size_l .pc-content-list__title, .pc-content-list_size_m .pc-content-list__title {
|
|
6
|
+
.pc-content-list_size_xl .pc-content-list__title, .pc-content-list_size_l .pc-content-list__title, .pc-content-list_size_m .pc-content-list__title {
|
|
7
7
|
font-size: var(--g-text-header-1-font-size);
|
|
8
8
|
line-height: var(--g-text-header-1-line-height);
|
|
9
9
|
margin: 0 0 8px;
|
|
10
10
|
}
|
|
11
|
-
.pc-content-list_size_l .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__icon {
|
|
11
|
+
.pc-content-list_size_xl .pc-content-list__icon, .pc-content-list_size_l .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__icon {
|
|
12
12
|
width: 22px;
|
|
13
13
|
height: 22px;
|
|
14
14
|
margin-top: 1px;
|
|
15
15
|
margin-bottom: 1px;
|
|
16
16
|
margin-right: 12px;
|
|
17
17
|
}
|
|
18
|
-
.pc-content-list_size_l .pc-content-list__item:not(:last-child), .pc-content-list_size_m .pc-content-list__item:not(:last-child) {
|
|
18
|
+
.pc-content-list_size_xl .pc-content-list__item:not(:last-child), .pc-content-list_size_l .pc-content-list__item:not(:last-child), .pc-content-list_size_m .pc-content-list__item:not(:last-child) {
|
|
19
19
|
margin-bottom: 16px;
|
|
20
20
|
}
|
|
21
|
-
.pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_m .pc-content-list__item_without-title:not(:last-child) {
|
|
21
|
+
.pc-content-list_size_xl .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_l .pc-content-list__item_without-title:not(:last-child), .pc-content-list_size_m .pc-content-list__item_without-title:not(:last-child) {
|
|
22
22
|
margin-bottom: 12px;
|
|
23
23
|
}
|
|
24
|
-
.pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__item_without-title .pc-content-list__icon {
|
|
24
|
+
.pc-content-list_size_xl .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_l .pc-content-list__item_without-title .pc-content-list__icon, .pc-content-list_size_m .pc-content-list__item_without-title .pc-content-list__icon {
|
|
25
25
|
width: 20px;
|
|
26
26
|
height: 20px;
|
|
27
27
|
margin-top: 2px;
|
|
28
28
|
margin-bottom: 2px;
|
|
29
29
|
margin-right: 8px;
|
|
30
30
|
}
|
|
31
|
-
.pc-content-list_size_l .pc-content-list__text, .pc-content-list_size_m .pc-content-list__text {
|
|
31
|
+
.pc-content-list_size_xl .pc-content-list__text, .pc-content-list_size_l .pc-content-list__text, .pc-content-list_size_m .pc-content-list__text {
|
|
32
32
|
font-size: var(--g-text-subheader-2-font-size);
|
|
33
33
|
line-height: var(--g-text-subheader-2-line-height);
|
|
34
34
|
}
|
|
35
|
-
.pc-content-list_size_l .pc-content-list__text_without-title, .pc-content-list_size_m .pc-content-list__text_without-title {
|
|
35
|
+
.pc-content-list_size_xl .pc-content-list__text_without-title, .pc-content-list_size_l .pc-content-list__text_without-title, .pc-content-list_size_m .pc-content-list__text_without-title {
|
|
36
36
|
font-size: var(--g-text-subheader-3-font-size);
|
|
37
37
|
line-height: var(--g-text-subheader-3-line-height);
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,eAAe,EAAC,8BAA2B;AACnD,OAAO,WAAW,sCAAmC;AACrD,OAAO,UAAU,oCAAiC;AAElD,OAAO,mBAAmB,CAAC;AAE3B,MAAM,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;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E,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,MAAM,EAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport ContentIcon from '../ContentIcon/ContentIcon';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ContentIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
|
|
1
|
+
{"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings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,GAC1B,EACF,0BACK,KAAK;gCACF,KAAK,CAAC,aAAa,CACf,eAAe,CAAC,IAAI,CAAC,EACrB,EAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,KAAK,EAAC,EACtD,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,GAAI,CACjE,EACJ,IAAI,IAAI,CACL,KAAC,UAAU,IACP,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,MAAM,EAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport ContentIcon from '../ContentIcon/ContentIcon';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'm':\n case 'l':\n case 'xl':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ContentIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
|
|
@@ -7,6 +7,7 @@ interface DefaultVideoProps {
|
|
|
7
7
|
qa?: string;
|
|
8
8
|
customBarControlsClassName?: string;
|
|
9
9
|
className?: string;
|
|
10
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLVideoElement>;
|
|
10
11
|
}
|
|
11
12
|
export declare const DefaultVideo: React.ForwardRefExoticComponent<DefaultVideoProps & React.RefAttributes<DefaultVideoRefType>>;
|
|
12
13
|
export {};
|
|
@@ -7,7 +7,7 @@ import CustomBarControls from "../ReactPlayer/CustomBarControls.js";
|
|
|
7
7
|
import './DefaultVideo.css';
|
|
8
8
|
const b = block('default-video');
|
|
9
9
|
export const DefaultVideo = React.forwardRef((props, ref) => {
|
|
10
|
-
const { video, qa, customBarControlsClassName } = props;
|
|
10
|
+
const { video, qa, customBarControlsClassName, onLoadedMetadata } = props;
|
|
11
11
|
const { controls, customControlsOptions, muted: initiallyMuted = true, onVideoEnd, loop, } = video;
|
|
12
12
|
const { muteButtonShown, positioning, type: customControlsType, } = customControlsOptions || {};
|
|
13
13
|
const [isPaused, setIsPaused] = React.useState(false);
|
|
@@ -68,7 +68,7 @@ export const DefaultVideo = React.forwardRef((props, ref) => {
|
|
|
68
68
|
return (_jsxs(React.Fragment, { children: [_jsxs("video", { disablePictureInPicture: true, playsInline: true,
|
|
69
69
|
// @ts-ignore
|
|
70
70
|
// eslint-disable-next-line react/no-unknown-property
|
|
71
|
-
pip: "false", className: b(), ref: videoRef, preload: "metadata", muted: isMuted, "aria-label": video.ariaLabel, onClick: onClick, onEnded: onEnded, children: [getVideoTypesWithPriority(video.src).map(({ src, type }, index) => (_jsx("source", { src: src, type: type, "data-qa": qa }, index))), _jsx("track", { default: true, kind: "captions" })] }), controls === MediaVideoControlsType.Custom && (_jsx(CustomBarControls, { className: customBarControlsClassName, type: customControlsType, isPaused: isPaused, onPlayClick: onPlayToggle, muteButtonShown: muteButtonShown, shown: true, positioning: positioning, mute: {
|
|
71
|
+
pip: "false", className: b(), ref: videoRef, preload: "metadata", muted: isMuted, "aria-label": video.ariaLabel, onClick: onClick, onEnded: onEnded, onLoadedMetadata: onLoadedMetadata, children: [getVideoTypesWithPriority(video.src).map(({ src, type }, index) => (_jsx("source", { src: src, type: type, "data-qa": qa }, index))), _jsx("track", { default: true, kind: "captions" })] }), controls === MediaVideoControlsType.Custom && (_jsx(CustomBarControls, { className: customBarControlsClassName, type: customControlsType, isPaused: isPaused, onPlayClick: onPlayToggle, muteButtonShown: muteButtonShown, shown: true, positioning: positioning, mute: {
|
|
72
72
|
isMuted: Boolean(isMuted),
|
|
73
73
|
changeMute: onMuteToggle,
|
|
74
74
|
} }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultVideo.js","sourceRoot":"../../../../src","sources":["components/DefaultVideo/DefaultVideo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAkB,8BAAqB;AACzF,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAClC,OAAO,EAAC,yBAAyB,EAAC,gCAA6B;AAC/D,OAAO,iBAAiB,4CAAyC;AAEjE,OAAO,oBAAoB,CAAC;AAE5B,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultVideo.js","sourceRoot":"../../../../src","sources":["components/DefaultVideo/DefaultVideo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KA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C,KAAK,QACL,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE;oBACF,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;oBACzB,UAAU,EAAE,YAAY;iBAC3B,GACH,CACL,IACY,CACpB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {CustomControlsType, MediaVideoControlsType, MediaVideoProps} from '../../models';\nimport {block} from '../../utils';\nimport {getVideoTypesWithPriority} from '../Media/Video/utils';\nimport CustomBarControls from '../ReactPlayer/CustomBarControls';\n\nimport './DefaultVideo.scss';\n\nconst b = block('default-video');\n\ntype DefaultVideoRefType = HTMLVideoElement | undefined;\n\ninterface DefaultVideoProps {\n video: MediaVideoProps;\n qa?: string;\n customBarControlsClassName?: string;\n className?: string;\n onLoadedMetadata?: React.ReactEventHandler<HTMLVideoElement>;\n}\n\nexport const DefaultVideo = React.forwardRef<DefaultVideoRefType, DefaultVideoProps>(\n (props, ref) => {\n const {video, qa, customBarControlsClassName, onLoadedMetadata} = props;\n const {\n controls,\n customControlsOptions,\n muted: initiallyMuted = true,\n onVideoEnd,\n loop,\n } = video;\n const {\n muteButtonShown,\n positioning,\n type: customControlsType,\n } = customControlsOptions || {};\n const [isPaused, setIsPaused] = React.useState(false);\n const [isMuted, setIsMuted] = React.useState(initiallyMuted);\n const videoRef = React.useRef<HTMLVideoElement>(null);\n\n // one may not use this hook and work with `ref` variable only, but\n // in this case one should support both function type and object type,\n // according to ForwardedRef type.\n // Currently used way with extra ref and useImperativeHandle is more\n // convenient and allows us to work with object typed ref only,\n // avoiding typeof ref === 'function' statements\n React.useImperativeHandle(ref, () => {\n if (!videoRef?.current) {\n return undefined;\n }\n\n return videoRef.current;\n }, [videoRef]);\n\n // to guarantee setting a muted attribute in HTML. https://github.com/facebook/react/issues/10389\n React.useEffect(() => {\n const videoElement = videoRef.current;\n\n if (videoElement && initiallyMuted) {\n videoElement.defaultMuted = true;\n }\n }, [videoRef, initiallyMuted]);\n\n const onPlayToggle = React.useCallback(() => {\n setIsPaused((value) => {\n if (value) {\n videoRef?.current?.play();\n } else {\n videoRef?.current?.pause();\n }\n\n return !value;\n });\n }, [videoRef]);\n\n const onMuteToggle = React.useCallback(() => {\n setIsMuted((value) => !value);\n }, []);\n\n const onClick = React.useCallback(() => {\n if (customControlsType === CustomControlsType.WithPlayPauseButton) {\n onPlayToggle();\n }\n }, [onPlayToggle, customControlsType]);\n\n const onEnded = React.useCallback(() => {\n const videoElement = videoRef.current;\n if (!videoElement) {\n return;\n }\n\n if (loop) {\n const {start = 0, end = videoElement.duration} =\n typeof loop === 'boolean' ? {} : loop;\n\n if (videoElement.currentTime >= end) {\n videoElement.currentTime = start;\n videoElement.play();\n }\n }\n\n onVideoEnd?.();\n }, [loop, onVideoEnd]);\n\n return (\n <React.Fragment>\n <video\n disablePictureInPicture\n playsInline\n // @ts-ignore\n // eslint-disable-next-line react/no-unknown-property\n pip=\"false\"\n className={b()}\n ref={videoRef}\n preload=\"metadata\"\n muted={isMuted}\n aria-label={video.ariaLabel}\n onClick={onClick}\n onEnded={onEnded}\n onLoadedMetadata={onLoadedMetadata}\n >\n {getVideoTypesWithPriority(video.src).map(({src, type}, index) => (\n <source key={index} src={src} type={type} data-qa={qa} />\n ))}\n <track default kind=\"captions\" />\n </video>\n\n {controls === MediaVideoControlsType.Custom && (\n <CustomBarControls\n className={customBarControlsClassName}\n type={customControlsType}\n isPaused={isPaused}\n onPlayClick={onPlayToggle}\n muteButtonShown={muteButtonShown}\n shown\n positioning={positioning}\n mute={{\n isMuted: Boolean(isMuted),\n changeMute: onMuteToggle,\n }}\n />\n )}\n </React.Fragment>\n );\n },\n);\n\nDefaultVideo.displayName = 'DefaultVideo';\n"]}
|
|
@@ -37,6 +37,12 @@ unpredictable css rules order in build */
|
|
|
37
37
|
margin-bottom: 4px;
|
|
38
38
|
margin-top: 4px;
|
|
39
39
|
}
|
|
40
|
+
.pc-icon-wrapper__icon_icon-position_left.pc-icon-wrapper__icon_size_xl {
|
|
41
|
+
height: 44px;
|
|
42
|
+
width: 44px;
|
|
43
|
+
margin-bottom: 4px;
|
|
44
|
+
margin-top: 4px;
|
|
45
|
+
}
|
|
40
46
|
.pc-icon-wrapper__content {
|
|
41
47
|
display: flex;
|
|
42
48
|
flex-direction: column;
|
|
@@ -4,7 +4,11 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: React.MouseEventHandler;
|
|
7
|
-
onLoad?: React.ReactEventHandler<
|
|
7
|
+
onLoad?: React.ReactEventHandler<HTMLImageElement>;
|
|
8
|
+
onIntrinsicSizeChange?: (size: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}) => void;
|
|
8
12
|
containerClassName?: string;
|
|
9
13
|
}
|
|
10
14
|
export interface DeviceSpecificFragmentProps extends QAProps {
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { BREAKPOINTS } from "../../constants.js";
|
|
4
4
|
import { ProjectSettingsContext } from "../../context/projectSettingsContext/index.js";
|
|
5
|
+
import { useImageSize } from "../../hooks/index.js";
|
|
5
6
|
import { Device } from "../../models/index.js";
|
|
6
7
|
import { getQaAttrubutes } from "../../utils/index.js";
|
|
7
8
|
import { isCompressible } from "../../utils/imageCompress.js";
|
|
@@ -23,7 +24,8 @@ const DeviceSpecificFragment = ({ disableWebp, src, maxBreakpoint, minBreakpoint
|
|
|
23
24
|
};
|
|
24
25
|
const Image = (props) => {
|
|
25
26
|
const projectSettings = React.useContext(ProjectSettingsContext);
|
|
26
|
-
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, containerClassName, qa, fetchPriority, loading, hide, } = props;
|
|
27
|
+
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, onIntrinsicSizeChange, containerClassName, qa, fetchPriority, loading, hide, } = props;
|
|
28
|
+
const { imageRef, onLoad: onLoadOverride } = useImageSize({ onIntrinsicSizeChange, onLoad });
|
|
27
29
|
const [imgLoadingError, setImgLoadingError] = React.useState(false);
|
|
28
30
|
const src = imageSrc || desktop;
|
|
29
31
|
const hideDevices = typeof hide === 'boolean' || !hide
|
|
@@ -38,7 +40,7 @@ const Image = (props) => {
|
|
|
38
40
|
if (!src) {
|
|
39
41
|
return null;
|
|
40
42
|
}
|
|
41
|
-
return (_jsxs("picture", { className: containerClassName, "data-qa": qa, children: [(mobile || hideDevices.mobile) && (_jsx(DeviceSpecificFragment, { src: mobile || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.mobile), maxBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.mobileSource })), (tablet || hideDevices.tablet) && (_jsx(DeviceSpecificFragment, { src: tablet || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.tablet), maxBreakpoint: BREAKPOINTS.md, minBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.tabletSource })), hideDevices.desktop && (_jsx(DeviceSpecificFragment, { src: EMPTY_IMG, disableWebp: true, minBreakpoint: BREAKPOINTS.md, qa: qaAttributes.desktopSource })), src && !disableWebp && (_jsx("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })), _jsx(ImageBase, { className: className, alt: alt, src: src, style: style, fetchPriority: fetchPriority, loading: loading, onClick: onClick, onError: () => setImgLoadingError(true), onLoad:
|
|
43
|
+
return (_jsxs("picture", { className: containerClassName, "data-qa": qa, children: [(mobile || hideDevices.mobile) && (_jsx(DeviceSpecificFragment, { src: mobile || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.mobile), maxBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.mobileSource })), (tablet || hideDevices.tablet) && (_jsx(DeviceSpecificFragment, { src: tablet || EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.tablet), maxBreakpoint: BREAKPOINTS.md, minBreakpoint: BREAKPOINTS.sm, qa: qaAttributes.tabletSource })), hideDevices.desktop && (_jsx(DeviceSpecificFragment, { src: EMPTY_IMG, disableWebp: true, minBreakpoint: BREAKPOINTS.md, qa: qaAttributes.desktopSource })), src && !disableWebp && (_jsx("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })), _jsx(ImageBase, { className: className, alt: alt, src: src, style: style, fetchPriority: fetchPriority, loading: loading, onClick: onClick, onError: () => setImgLoadingError(true), onLoad: onLoadOverride, ref: imageRef })] }));
|
|
42
44
|
};
|
|
43
45
|
export default Image;
|
|
44
46
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"../../../../src","sources":["components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,sBAAsB,EAAC,sDAA6C;AAC5E,OAAO,EAAC,MAAM,EAA8C,8BAAqB;AACjF,OAAO,EAAC,eAAe,EAAC,6BAAoB;AAC5C,OAAO,EAAC,cAAc,EAAC,qCAAkC;AACzD,OAAO,SAAS,kCAA+B;
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"../../../../src","sources":["components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAC5C,OAAO,EAAC,sBAAsB,EAAC,sDAA6C;AAC5E,OAAO,EAAC,YAAY,EAAC,6BAAoB;AACzC,OAAO,EAAC,MAAM,EAA8C,8BAAqB;AACjF,OAAO,EAAC,eAAe,EAAC,6BAAoB;AAC5C,OAAO,EAAC,cAAc,EAAC,qCAAkC;AACzD,OAAO,S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EACvD,aAAa,EAAE,WAAW,CAAC,EAAE,EAC7B,EAAE,EAAE,YAAY,CAAC,YAAY,GAC/B,CACL,EACA,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAC/B,KAAC,sBAAsB,IACnB,GAAG,EAAE,MAAM,IAAI,SAAS,EACxB,WAAW,EAAE,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,EACvD,aAAa,EAAE,WAAW,CAAC,EAAE,EAC7B,aAAa,EAAE,WAAW,CAAC,EAAE,EAC7B,EAAE,EAAE,YAAY,CAAC,YAAY,GAC/B,CACL,EACA,WAAW,CAAC,OAAO,IAAI,CACpB,KAAC,sBAAsB,IACnB,GAAG,EAAE,SAAS,EACd,WAAW,QACX,aAAa,EAAE,WAAW,CAAC,EAAE,EAC7B,EAAE,EAAE,YAAY,CAAC,aAAa,GAChC,CACL,EACA,GAAG,IAAI,CAAC,WAAW,IAAI,CACpB,iBACI,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,IAAI,EAAC,YAAY,aACR,YAAY,CAAC,uBAAuB,GAC/C,CACL,EACD,KAAC,SAAS,IACN,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,EACvC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,QAAQ,GACf,IACI,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BREAKPOINTS} from '../../constants';\nimport {ProjectSettingsContext} from '../../context/projectSettingsContext';\nimport {useImageSize} from '../../hooks';\nimport {Device, ImageDeviceProps, ImageObjectProps, QAProps} from '../../models';\nimport {getQaAttrubutes} from '../../utils';\nimport {isCompressible} from '../../utils/imageCompress';\nimport ImageBase from '../ImageBase/ImageBase';\n\nexport interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDeviceProps>, QAProps {\n style?: React.CSSProperties;\n className?: string;\n onClick?: React.MouseEventHandler;\n onLoad?: React.ReactEventHandler<HTMLImageElement>;\n onIntrinsicSizeChange?: (size: {width: number; height: number}) => void;\n containerClassName?: string;\n}\n\nexport interface DeviceSpecificFragmentProps extends QAProps {\n disableWebp: boolean;\n src: string;\n maxBreakpoint?: number;\n minBreakpoint?: number;\n}\n\nconst checkWebP = (src: string) => {\n return src.endsWith('.webp') ? src : src + '.webp';\n};\n\nexport const EMPTY_IMG =\n 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==';\n\nconst DeviceSpecificFragment = ({\n disableWebp,\n src,\n maxBreakpoint,\n minBreakpoint,\n qa,\n}: DeviceSpecificFragmentProps) => {\n const media: string[] = [];\n\n if (maxBreakpoint) {\n media.push(`(max-width: ${maxBreakpoint}px)`);\n }\n\n if (minBreakpoint) {\n media.push(`(min-width: ${minBreakpoint}px)`);\n }\n\n const mediaString = media.join(' and ');\n\n return (\n <React.Fragment>\n {!disableWebp && (\n <source\n srcSet={checkWebP(src)}\n type=\"image/webp\"\n media={mediaString}\n data-qa={`${qa}-compressed`}\n />\n )}\n <source srcSet={src} media={mediaString} data-qa={qa} />\n </React.Fragment>\n );\n};\n\nconst Image = (props: ImageProps) => {\n const projectSettings = React.useContext(ProjectSettingsContext);\n const {\n src: imageSrc,\n alt,\n disableCompress,\n tablet,\n desktop,\n mobile,\n style,\n className,\n onClick,\n onLoad,\n onIntrinsicSizeChange,\n containerClassName,\n qa,\n fetchPriority,\n loading,\n hide,\n } = props;\n\n const {imageRef, onLoad: onLoadOverride} = useImageSize({onIntrinsicSizeChange, onLoad});\n\n const [imgLoadingError, setImgLoadingError] = React.useState(false);\n\n const src = imageSrc || desktop;\n\n const hideDevices =\n typeof hide === 'boolean' || !hide\n ? Object.values(Device).reduce(\n (acc, device) => ({...acc, [device]: Boolean(hide)}),\n {} as Record<Device, boolean>,\n )\n : hide;\n\n const qaAttributes = getQaAttrubutes(\n qa,\n 'mobile-webp-source',\n 'mobile-source',\n 'tablet-webp-source',\n 'tablet-source',\n 'desktop-source',\n 'desktop-source-compressed',\n );\n\n const disableWebp =\n !src ||\n projectSettings.disableCompress ||\n disableCompress ||\n !isCompressible(src) ||\n imgLoadingError;\n\n if (!src) {\n return null;\n }\n\n return (\n <picture className={containerClassName} data-qa={qa}>\n {(mobile || hideDevices.mobile) && (\n <DeviceSpecificFragment\n src={mobile || EMPTY_IMG}\n disableWebp={disableWebp || Boolean(hideDevices.mobile)}\n maxBreakpoint={BREAKPOINTS.sm}\n qa={qaAttributes.mobileSource}\n />\n )}\n {(tablet || hideDevices.tablet) && (\n <DeviceSpecificFragment\n src={tablet || EMPTY_IMG}\n disableWebp={disableWebp || Boolean(hideDevices.tablet)}\n maxBreakpoint={BREAKPOINTS.md}\n minBreakpoint={BREAKPOINTS.sm}\n qa={qaAttributes.tabletSource}\n />\n )}\n {hideDevices.desktop && (\n <DeviceSpecificFragment\n src={EMPTY_IMG}\n disableWebp\n minBreakpoint={BREAKPOINTS.md}\n qa={qaAttributes.desktopSource}\n />\n )}\n {src && !disableWebp && (\n <source\n srcSet={checkWebP(src)}\n type=\"image/webp\"\n data-qa={qaAttributes.desktopSourceCompressed}\n />\n )}\n <ImageBase\n className={className}\n alt={alt}\n src={src}\n style={style}\n fetchPriority={fetchPriority}\n loading={loading}\n onClick={onClick}\n onError={() => setImgLoadingError(true)}\n onLoad={onLoadOverride}\n ref={imageRef}\n />\n </picture>\n );\n};\n\nexport default Image;\n"]}
|
|
@@ -4,8 +4,8 @@ export interface ImageBaseProps extends Partial<ImageObjectProps> {
|
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: React.MouseEventHandler;
|
|
7
|
-
onLoad?: React.ReactEventHandler<
|
|
7
|
+
onLoad?: React.ReactEventHandler<HTMLImageElement>;
|
|
8
8
|
onError?: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const ImageBase:
|
|
10
|
+
export declare const ImageBase: React.ForwardRefExoticComponent<ImageBaseProps & React.RefAttributes<HTMLImageElement>>;
|
|
11
11
|
export default ImageBase;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ImageContext } from "../../context/imageContext/imageContext.js";
|
|
4
|
-
export const ImageBase = ({ fetchPriority, alt, ...props }) => {
|
|
4
|
+
export const ImageBase = React.forwardRef(({ fetchPriority, alt, ...props }, ref) => {
|
|
5
5
|
const { Image } = React.useContext(ImageContext);
|
|
6
|
-
return Image ? (_jsx(Image, { fetchPriority: fetchPriority, alt: alt, ...props })) : (
|
|
6
|
+
return Image ? (_jsx(Image, { fetchPriority: fetchPriority, alt: alt, ...props, ref: ref })) : (
|
|
7
7
|
// There is an issue with fetchpriority attr in img in React.
|
|
8
8
|
// It is still not supported. However it's nice to have ability to manage
|
|
9
9
|
// this prop is good to have to improve Core Web Vitals.
|
|
10
10
|
// So, here is a workaround to assign the attr.
|
|
11
|
-
_jsx("img", { fetchPriority: fetchPriority, alt: alt, ...props }));
|
|
12
|
-
};
|
|
11
|
+
_jsx("img", { fetchPriority: fetchPriority, alt: alt, ...props, ref: ref }));
|
|
12
|
+
});
|
|
13
|
+
ImageBase.displayName = 'ImageBase';
|
|
13
14
|
export default ImageBase;
|
|
14
15
|
//# sourceMappingURL=ImageBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBase.js","sourceRoot":"../../../../src","sources":["components/ImageBase/ImageBase.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,YAAY,EAAC,mDAAgD;AAWrE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAC,aAAa,EAAE,GAAG,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"ImageBase.js","sourceRoot":"../../../../src","sources":["components/ImageBase/ImageBase.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,YAAY,EAAC,mDAAgD;AAWrE,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CACrC,CAAC,EAAC,aAAa,EAAE,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,GAAG,EAAE,EAAE;IACpC,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/C,OAAO,KAAK,CAAC,CAAC,CAAC,CACX,KAAC,KAAK,IAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,KAAM,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CACzE,CAAC,CAAC,CAAC;IACA,6DAA6D;IAC7D,yEAAyE;IACzE,wDAAwD;IACxD,+CAA+C;IAC/C,cAAU,aAAa,EAAE,aAAa,EAAG,GAAG,EAAE,GAAG,KAAM,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAC7E,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ImageContext} from '../../context/imageContext/imageContext';\nimport {ImageObjectProps} from '../../models';\n\nexport interface ImageBaseProps extends Partial<ImageObjectProps> {\n style?: React.CSSProperties;\n className?: string;\n onClick?: React.MouseEventHandler;\n onLoad?: React.ReactEventHandler<HTMLImageElement>;\n onError?: () => void;\n}\n\nexport const ImageBase = React.forwardRef<HTMLImageElement, ImageBaseProps>(\n ({fetchPriority, alt, ...props}, ref) => {\n const {Image} = React.useContext(ImageContext);\n\n return Image ? (\n <Image fetchPriority={fetchPriority} alt={alt} {...props} ref={ref} />\n ) : (\n // There is an issue with fetchpriority attr in img in React.\n // It is still not supported. However it's nice to have ability to manage\n // this prop is good to have to improve Core Web Vitals.\n // So, here is a workaround to assign the attr.\n <img {...{fetchPriority: fetchPriority}} alt={alt} {...props} ref={ref} />\n );\n },\n);\n\nImageBase.displayName = 'ImageBase';\n\nexport default ImageBase;\n"]}
|