@gravity-ui/page-constructor 7.0.0-alpha.6 → 7.0.0-alpha.8
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/build/cjs/blocks/CardLayout/schema.d.ts +76 -0
- package/build/cjs/blocks/ContentLayout/schema.d.ts +76 -0
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.css +43 -21
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js +3 -1
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js.map +1 -1
- package/build/cjs/blocks/Slider/Arrow/Arrow.css +13 -13
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/cjs/blocks/Slider/Arrow/Arrow.js.map +1 -1
- package/build/cjs/blocks/Slider/Slider.css +2 -2
- package/build/cjs/blocks/Tabs/TabContent/TabContent.js +1 -1
- package/build/cjs/blocks/Tabs/TabContent/TabContent.js.map +1 -1
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/cjs/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/cjs/components/Image/Image.d.ts +3 -1
- package/build/cjs/components/Image/Image.js +25 -8
- package/build/cjs/components/Image/Image.js.map +1 -1
- package/build/cjs/components/Image/schema.d.ts +95 -0
- package/build/cjs/components/Image/schema.js +15 -0
- package/build/cjs/components/Image/schema.js.map +1 -1
- package/build/cjs/models/constructor-items/common.d.ts +13 -6
- package/build/cjs/models/constructor-items/common.js +8 -1
- package/build/cjs/models/constructor-items/common.js.map +1 -1
- package/build/cjs/schema/constants.d.ts +19 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +19 -0
- package/build/cjs/text-transform/config.js +5 -0
- package/build/cjs/text-transform/config.js.map +1 -1
- package/build/cjs/text-transform/utils.js +4 -1
- package/build/cjs/text-transform/utils.js.map +1 -1
- package/build/esm/blocks/CardLayout/schema.d.ts +76 -0
- package/build/esm/blocks/ContentLayout/schema.d.ts +76 -0
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.css +43 -21
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js +4 -2
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js.map +1 -1
- package/build/esm/blocks/Slider/Arrow/Arrow.css +13 -13
- package/build/esm/blocks/Slider/Arrow/Arrow.js +1 -1
- package/build/esm/blocks/Slider/Arrow/Arrow.js.map +1 -1
- package/build/esm/blocks/Slider/Slider.css +2 -2
- package/build/esm/blocks/Tabs/TabContent/TabContent.js +1 -1
- package/build/esm/blocks/Tabs/TabContent/TabContent.js.map +1 -1
- package/build/esm/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/esm/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/build/esm/components/Image/Image.d.ts +3 -1
- package/build/esm/components/Image/Image.js +24 -8
- package/build/esm/components/Image/Image.js.map +1 -1
- package/build/esm/components/Image/schema.d.ts +95 -0
- package/build/esm/components/Image/schema.js +15 -0
- package/build/esm/components/Image/schema.js.map +1 -1
- package/build/esm/models/constructor-items/common.d.ts +13 -6
- package/build/esm/models/constructor-items/common.js +7 -0
- package/build/esm/models/constructor-items/common.js.map +1 -1
- package/build/esm/schema/constants.d.ts +19 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +19 -0
- package/build/esm/text-transform/config.js +5 -0
- package/build/esm/text-transform/config.js.map +1 -1
- package/build/esm/text-transform/utils.js +4 -1
- package/build/esm/text-transform/utils.js.map +1 -1
- package/package.json +2 -2
- package/schema/index.js +1 -1
- package/server/models/constructor-items/common.d.ts +13 -6
- package/server/models/constructor-items/common.js +8 -1
- package/server/text-transform/config.js +5 -0
- package/server/text-transform/utils.js +4 -1
- package/widget/1130.index.js +1 -1
|
@@ -52,6 +52,25 @@ export declare const CardLayoutProps: {
|
|
|
52
52
|
type: string;
|
|
53
53
|
enum: string[];
|
|
54
54
|
};
|
|
55
|
+
hide: {
|
|
56
|
+
oneOf: ({
|
|
57
|
+
type: string;
|
|
58
|
+
properties?: undefined;
|
|
59
|
+
} | {
|
|
60
|
+
type: string;
|
|
61
|
+
properties: {
|
|
62
|
+
mobile: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
tablet: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
desktop: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
})[];
|
|
73
|
+
};
|
|
55
74
|
};
|
|
56
75
|
optionName: string;
|
|
57
76
|
type: string;
|
|
@@ -89,6 +108,25 @@ export declare const CardLayoutProps: {
|
|
|
89
108
|
type: string;
|
|
90
109
|
enum: string[];
|
|
91
110
|
};
|
|
111
|
+
hide: {
|
|
112
|
+
oneOf: ({
|
|
113
|
+
type: string;
|
|
114
|
+
properties?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
type: string;
|
|
117
|
+
properties: {
|
|
118
|
+
mobile: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
tablet: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
desktop: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
})[];
|
|
129
|
+
};
|
|
92
130
|
};
|
|
93
131
|
optionName: string;
|
|
94
132
|
type: string;
|
|
@@ -240,6 +278,25 @@ export declare const CardLayoutBlock: {
|
|
|
240
278
|
type: string;
|
|
241
279
|
enum: string[];
|
|
242
280
|
};
|
|
281
|
+
hide: {
|
|
282
|
+
oneOf: ({
|
|
283
|
+
type: string;
|
|
284
|
+
properties?: undefined;
|
|
285
|
+
} | {
|
|
286
|
+
type: string;
|
|
287
|
+
properties: {
|
|
288
|
+
mobile: {
|
|
289
|
+
type: string;
|
|
290
|
+
};
|
|
291
|
+
tablet: {
|
|
292
|
+
type: string;
|
|
293
|
+
};
|
|
294
|
+
desktop: {
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
})[];
|
|
299
|
+
};
|
|
243
300
|
};
|
|
244
301
|
optionName: string;
|
|
245
302
|
type: string;
|
|
@@ -277,6 +334,25 @@ export declare const CardLayoutBlock: {
|
|
|
277
334
|
type: string;
|
|
278
335
|
enum: string[];
|
|
279
336
|
};
|
|
337
|
+
hide: {
|
|
338
|
+
oneOf: ({
|
|
339
|
+
type: string;
|
|
340
|
+
properties?: undefined;
|
|
341
|
+
} | {
|
|
342
|
+
type: string;
|
|
343
|
+
properties: {
|
|
344
|
+
mobile: {
|
|
345
|
+
type: string;
|
|
346
|
+
};
|
|
347
|
+
tablet: {
|
|
348
|
+
type: string;
|
|
349
|
+
};
|
|
350
|
+
desktop: {
|
|
351
|
+
type: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
})[];
|
|
355
|
+
};
|
|
280
356
|
};
|
|
281
357
|
optionName: string;
|
|
282
358
|
type: string;
|
|
@@ -50,6 +50,25 @@ export declare const ContentLayoutBlock: {
|
|
|
50
50
|
type: string;
|
|
51
51
|
enum: string[];
|
|
52
52
|
};
|
|
53
|
+
hide: {
|
|
54
|
+
oneOf: ({
|
|
55
|
+
type: string;
|
|
56
|
+
properties?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
mobile: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
tablet: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
desktop: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
})[];
|
|
71
|
+
};
|
|
53
72
|
};
|
|
54
73
|
} | {
|
|
55
74
|
optionName: string;
|
|
@@ -84,6 +103,25 @@ export declare const ContentLayoutBlock: {
|
|
|
84
103
|
type: string;
|
|
85
104
|
enum: string[];
|
|
86
105
|
};
|
|
106
|
+
hide: {
|
|
107
|
+
oneOf: ({
|
|
108
|
+
type: string;
|
|
109
|
+
properties?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
mobile: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
tablet: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
desktop: {
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
})[];
|
|
124
|
+
};
|
|
87
125
|
};
|
|
88
126
|
})[];
|
|
89
127
|
};
|
|
@@ -256,6 +294,25 @@ export declare const ContentLayoutBlock: {
|
|
|
256
294
|
type: string;
|
|
257
295
|
enum: string[];
|
|
258
296
|
};
|
|
297
|
+
hide: {
|
|
298
|
+
oneOf: ({
|
|
299
|
+
type: string;
|
|
300
|
+
properties?: undefined;
|
|
301
|
+
} | {
|
|
302
|
+
type: string;
|
|
303
|
+
properties: {
|
|
304
|
+
mobile: {
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
tablet: {
|
|
308
|
+
type: string;
|
|
309
|
+
};
|
|
310
|
+
desktop: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
})[];
|
|
315
|
+
};
|
|
259
316
|
};
|
|
260
317
|
} | {
|
|
261
318
|
optionName: string;
|
|
@@ -290,6 +347,25 @@ export declare const ContentLayoutBlock: {
|
|
|
290
347
|
type: string;
|
|
291
348
|
enum: string[];
|
|
292
349
|
};
|
|
350
|
+
hide: {
|
|
351
|
+
oneOf: ({
|
|
352
|
+
type: string;
|
|
353
|
+
properties?: undefined;
|
|
354
|
+
} | {
|
|
355
|
+
type: string;
|
|
356
|
+
properties: {
|
|
357
|
+
mobile: {
|
|
358
|
+
type: string;
|
|
359
|
+
};
|
|
360
|
+
tablet: {
|
|
361
|
+
type: string;
|
|
362
|
+
};
|
|
363
|
+
desktop: {
|
|
364
|
+
type: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
})[];
|
|
368
|
+
};
|
|
293
369
|
};
|
|
294
370
|
})[];
|
|
295
371
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.pc-FoldableListBlockItem__title {
|
|
1
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -11,45 +11,55 @@ unpredictable css rules order in build */
|
|
|
11
11
|
.pc-FoldableListBlockItem + .pc-FoldableListBlockItem {
|
|
12
12
|
padding-top: 32px;
|
|
13
13
|
}
|
|
14
|
-
.pc-FoldableListBlockItem__title {
|
|
15
|
-
display: inline-block;
|
|
16
|
-
margin: 0;
|
|
17
|
-
padding: 0;
|
|
18
|
-
font: inherit;
|
|
19
|
-
border: none;
|
|
20
|
-
outline: none;
|
|
21
|
-
color: inherit;
|
|
22
|
-
background: none;
|
|
23
|
-
cursor: pointer;
|
|
14
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title {
|
|
24
15
|
font-size: var(--g-text-header-1-font-size);
|
|
25
16
|
line-height: var(--g-text-header-1-line-height);
|
|
26
17
|
color: var(--pc-text-header-color);
|
|
27
18
|
font-weight: var(--g-text-accent-font-weight);
|
|
28
|
-
position: relative;
|
|
29
|
-
display: block;
|
|
30
|
-
width: 100%;
|
|
31
|
-
padding-right: 24px;
|
|
32
|
-
text-align: start;
|
|
33
19
|
cursor: pointer;
|
|
34
20
|
border-radius: var(--g-focus-border-radius);
|
|
35
21
|
}
|
|
36
|
-
.pc-FoldableListBlockItem__title:focus {
|
|
22
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title:focus {
|
|
37
23
|
outline: 2px solid var(--g-color-line-focus);
|
|
38
24
|
outline-offset: 0;
|
|
39
25
|
}
|
|
40
|
-
.pc-FoldableListBlockItem__title:focus:not(:focus-visible) {
|
|
26
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title:focus:not(:focus-visible) {
|
|
41
27
|
outline: 0;
|
|
42
28
|
}
|
|
43
|
-
.pc-FoldableListBlockItem__title a {
|
|
29
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title a {
|
|
44
30
|
outline: none;
|
|
45
31
|
color: var(--g-color-text-link);
|
|
46
32
|
text-decoration: none;
|
|
47
33
|
cursor: pointer;
|
|
48
34
|
}
|
|
49
|
-
.utilityfocus .pc-FoldableListBlockItem__title a:focus {
|
|
35
|
+
.utilityfocus .pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title a:focus {
|
|
50
36
|
outline: 2px solid #ffdb4d;
|
|
51
37
|
}
|
|
52
|
-
.pc-FoldableListBlockItem__title a:hover, .pc-FoldableListBlockItem__title a:active {
|
|
38
|
+
.pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title a:hover, .pc-FoldableListBlockItem__title.pc-FoldableListBlockItem__title a:active {
|
|
39
|
+
--pc-text-header-color: var(--g-color-text-link-hover);
|
|
40
|
+
color: var(--g-color-text-link-hover);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pc-FoldableListBlockItem__title-container {
|
|
44
|
+
margin: 0;
|
|
45
|
+
position: relative;
|
|
46
|
+
display: block;
|
|
47
|
+
width: 100%;
|
|
48
|
+
padding-right: 24px;
|
|
49
|
+
text-align: start;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
border-radius: var(--g-focus-border-radius);
|
|
52
|
+
}
|
|
53
|
+
.pc-FoldableListBlockItem__title-container a {
|
|
54
|
+
outline: none;
|
|
55
|
+
color: var(--g-color-text-link);
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
.utilityfocus .pc-FoldableListBlockItem__title-container a:focus {
|
|
60
|
+
outline: 2px solid #ffdb4d;
|
|
61
|
+
}
|
|
62
|
+
.pc-FoldableListBlockItem__title-container a:hover, .pc-FoldableListBlockItem__title-container a:active {
|
|
53
63
|
--pc-text-header-color: var(--g-color-text-link-hover);
|
|
54
64
|
color: var(--g-color-text-link-hover);
|
|
55
65
|
}
|
|
@@ -75,4 +85,16 @@ unpredictable css rules order in build */
|
|
|
75
85
|
font-size: var(--g-text-body-2-font-size);
|
|
76
86
|
line-height: var(--g-text-body-2-line-height);
|
|
77
87
|
margin-top: 12px;
|
|
88
|
+
}
|
|
89
|
+
.pc-FoldableListBlockItem__button {
|
|
90
|
+
display: inline-block;
|
|
91
|
+
margin: 0;
|
|
92
|
+
padding: 0;
|
|
93
|
+
font: inherit;
|
|
94
|
+
border: none;
|
|
95
|
+
outline: none;
|
|
96
|
+
color: inherit;
|
|
97
|
+
background: none;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
width: 100%;
|
|
78
100
|
}
|
|
@@ -10,7 +10,9 @@ const utils_1 = require("../../../utils/index.js");
|
|
|
10
10
|
const b = (0, utils_1.block)('FoldableListBlockItem');
|
|
11
11
|
const FoldableListBlockItem = ({ title: itemTitle, text: itemText, link, listStyle = 'dash', isOpened, onClick, }) => {
|
|
12
12
|
const { onKeyDown } = (0, uikit_1.useActionHandlers)(onClick);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: b(), itemScope: true, role: 'listitem', children: [(0, jsx_runtime_1.
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: b(), itemScope: true, role: 'listitem', children: [(0, jsx_runtime_1.jsx)("button", { className: b('button'), onClick: onClick, "aria-expanded": isOpened, onKeyDown: onKeyDown, children: (0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { tagName: "h3", className: b('title-container'), contentClassName: b('title'), content: itemTitle, modifiers: {
|
|
14
|
+
constructor: true,
|
|
15
|
+
}, onClick: onClick, tabIndex: 0, children: (0, jsx_runtime_1.jsx)(components_1.ToggleArrow, { open: isOpened, size: 16, type: 'vertical', iconType: "navigation", className: b('arrow') }) }) }), (0, jsx_runtime_1.jsx)(components_1.Foldable, { isOpened: isOpened, children: (0, jsx_runtime_1.jsxs)("div", { className: b('text'), "aria-hidden": !isOpened, children: [(0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { content: itemText, modifiers: {
|
|
14
16
|
constructor: true,
|
|
15
17
|
constructorListStyle: true,
|
|
16
18
|
constructorListStyleDash: listStyle === 'dash',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldableListBlockItem.js","sourceRoot":"../../../../../src","sources":["blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.tsx"],"names":[],"mappings":";;;;;AAAA,6CAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"FoldableListBlockItem.js","sourceRoot":"../../../../../src","sources":["blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.tsx"],"names":[],"mappings":";;;;;AAAA,6CAAoD;AAEpD,6DAAsE;AACtE,oFAAiD;AAEjD,mDAAqC;AAIrC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,uBAAuB,CAAC,CAAC;AAElC,MAAM,qBAAqB,GAAG,CAAC,EAClC,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EACJ,SAAS,GAAG,MAAM,EAClB,QAAQ,EACR,OAAO,GACkB,EAAE,EAAE;IAC7B,MAAM,EAAC,SAAS,EAAC,GAAG,IAAA,yBAAiB,EAAC,OAAO,CAAC,CAAC;IAE/C,OAAO,CACH,iCAAK,SAAS,EAAE,CAAC,EAAE,EAAE,SAAS,QAAC,IAAI,EAAE,UAAU,aAC3C,mCACI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,OAAO,EAAE,OAAO,mBACD,QAAQ,EACvB,SAAS,EAAE,SAAS,YAEpB,uBAAC,uBAAU,IACP,OAAO,EAAC,IAAI,EACZ,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAC/B,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,EAC5B,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE;wBACP,WAAW,EAAE,IAAI;qBACpB,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,YAEX,uBAAC,wBAAW,IACR,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,EAAE,EACR,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GACvB,GACO,GACR,EACT,uBAAC,qBAAQ,IAAC,QAAQ,EAAE,QAAQ,YACxB,iCAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAe,CAAC,QAAQ,aAC7C,uBAAC,uBAAU,IACP,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE;gCACP,WAAW,EAAE,IAAI;gCACjB,oBAAoB,EAAE,IAAI;gCAC1B,wBAAwB,EAAE,SAAS,KAAK,MAAM;6BACjD,GACH,EACD,IAAI,IAAI,uBAAC,cAAI,OAAK,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,GAAI,IAC5E,GACC,IACT,CACT,CAAC;AACN,CAAC,CAAC;AArDW,QAAA,qBAAqB,yBAqDhC","sourcesContent":["import {useActionHandlers} from '@gravity-ui/uikit';\n\nimport {Foldable, ToggleArrow, YFMWrapper} from '../../../components';\nimport Link from '../../../components/Link/Link';\nimport {FoldableListBlockItemProps} from '../../../models';\nimport {block} from '../../../utils';\n\nimport './FoldableListBlockItem.scss';\n\nconst b = block('FoldableListBlockItem');\n\nexport const FoldableListBlockItem = ({\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n isOpened,\n onClick,\n}: FoldableListBlockItemProps) => {\n const {onKeyDown} = useActionHandlers(onClick);\n\n return (\n <div className={b()} itemScope role={'listitem'}>\n <button\n className={b('button')}\n onClick={onClick}\n aria-expanded={isOpened}\n onKeyDown={onKeyDown}\n >\n <YFMWrapper\n tagName=\"h3\"\n className={b('title-container')}\n contentClassName={b('title')}\n content={itemTitle}\n modifiers={{\n constructor: true,\n }}\n onClick={onClick}\n tabIndex={0}\n >\n <ToggleArrow\n open={isOpened}\n size={16}\n type={'vertical'}\n iconType=\"navigation\"\n className={b('arrow')}\n />\n </YFMWrapper>\n </button>\n <Foldable isOpened={isOpened}>\n <div className={b('text')} aria-hidden={!isOpened}>\n <YFMWrapper\n content={itemText}\n modifiers={{\n constructor: true,\n constructorListStyle: true,\n constructorListStyleDash: listStyle === 'dash',\n }}\n />\n {link && <Link {...link} tabIndex={isOpened ? 0 : -1} className={b('link')} />}\n </div>\n </Foldable>\n </div>\n );\n};\n"]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
.pc-slider-
|
|
1
|
+
.pc-slider-arrow__inner {
|
|
2
2
|
box-shadow: 0px 4px 24px var(--pc-color-sfx-shadow), 0px 2px 8px var(--pc-color-sfx-shadow);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.pc-slider-
|
|
5
|
+
.pc-slider-arrow__inner:hover {
|
|
6
6
|
box-shadow: 0px 4px 24px var(--g-color-sfx-shadow), 0px 2px 8px var(--g-color-sfx-shadow);
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/* use this for style redefinitions to awoid problems with
|
|
11
11
|
unpredictable css rules order in build */
|
|
12
|
-
.pc-slider-
|
|
12
|
+
.pc-slider-arrow__icon-wrapper, .pc-slider-arrow__inner, .pc-slider-arrow {
|
|
13
13
|
display: flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: center;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
@media (max-width: 576px) {
|
|
19
|
-
.pc-slider-
|
|
19
|
+
.pc-slider-arrow {
|
|
20
20
|
display: none;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
.pc-slider-
|
|
23
|
+
.pc-slider-arrow__button {
|
|
24
24
|
display: inline-block;
|
|
25
25
|
margin: 0;
|
|
26
26
|
padding: 0;
|
|
@@ -31,14 +31,14 @@ unpredictable css rules order in build */
|
|
|
31
31
|
background: none;
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
}
|
|
34
|
-
.pc-slider-
|
|
34
|
+
.pc-slider-arrow__button:focus {
|
|
35
35
|
outline: 2px solid var(--g-color-line-focus);
|
|
36
36
|
outline-offset: 0;
|
|
37
37
|
}
|
|
38
|
-
.pc-slider-
|
|
38
|
+
.pc-slider-arrow__button:focus:not(:focus-visible) {
|
|
39
39
|
outline: 0;
|
|
40
40
|
}
|
|
41
|
-
.pc-slider-
|
|
41
|
+
.pc-slider-arrow__inner {
|
|
42
42
|
width: 42px;
|
|
43
43
|
height: 42px;
|
|
44
44
|
color: var(--g-color-text-secondary);
|
|
@@ -47,20 +47,20 @@ unpredictable css rules order in build */
|
|
|
47
47
|
box-shadow: 0 4px 24px var(--pc-color-sfx-shadow), 0 2px 8px var(--pc-color-sfx-shadow);
|
|
48
48
|
transition: box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), color 1s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
49
49
|
}
|
|
50
|
-
.pc-slider-
|
|
50
|
+
.pc-slider-arrow__inner_type_left .pc-slider-arrow__icon-wrapper {
|
|
51
51
|
transform: rotate(180deg);
|
|
52
52
|
}
|
|
53
|
-
.pc-slider-
|
|
53
|
+
.pc-slider-arrow__inner:hover {
|
|
54
54
|
color: var(--g-color-text-primary);
|
|
55
55
|
box-shadow: 0 2px 12px var(--pc-color-sfx-shadow), 0 4px 24px var(--pc-color-sfx-shadow);
|
|
56
56
|
}
|
|
57
|
-
.pc-slider-
|
|
57
|
+
.pc-slider-arrow__inner_transparent {
|
|
58
58
|
background-color: transparent;
|
|
59
59
|
box-shadow: none;
|
|
60
60
|
}
|
|
61
|
-
.pc-slider-
|
|
61
|
+
.pc-slider-arrow__inner_transparent:hover {
|
|
62
62
|
box-shadow: none;
|
|
63
63
|
}
|
|
64
|
-
.pc-slider-
|
|
64
|
+
.pc-slider-arrow__icon {
|
|
65
65
|
position: relative;
|
|
66
66
|
}
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ToggleArrow_1 = tslib_1.__importDefault(require("../../../components/ToggleArrow/ToggleArrow.js"));
|
|
6
6
|
const utils_1 = require("../../../utils/index.js");
|
|
7
7
|
const i18n_1 = require("../i18n/index.js");
|
|
8
|
-
const b = (0, utils_1.block)('slider-
|
|
8
|
+
const b = (0, utils_1.block)('slider-arrow');
|
|
9
9
|
const Arrow = ({ type, transparent, onClick, className, size = 16, extraProps, }) => ((0, jsx_runtime_1.jsx)("div", { className: b(null, className), children: (0, jsx_runtime_1.jsx)("button", { className: b('button'), onClick: onClick, "aria-label": (0, i18n_1.i18n)(`arrow-${type}`), ...extraProps, children: (0, jsx_runtime_1.jsx)("div", { className: b('inner', { type, transparent }), children: (0, jsx_runtime_1.jsx)("span", { className: b('icon-wrapper'), children: (0, jsx_runtime_1.jsx)(ToggleArrow_1.default, { size: size, type: 'horizontal', iconType: "navigation", className: b('icon') }) }) }) }) }));
|
|
10
10
|
exports.default = Arrow;
|
|
11
11
|
//# sourceMappingURL=Arrow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrow.js","sourceRoot":"../../../../../src","sources":["blocks/Slider/Arrow/Arrow.tsx"],"names":[],"mappings":";;;;AAAA,yGAAsE;AAEtE,mDAAqC;AACrC,2CAA6B;AAI7B,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"Arrow.js","sourceRoot":"../../../../../src","sources":["blocks/Slider/Arrow/Arrow.tsx"],"names":[],"mappings":";;;;AAAA,yGAAsE;AAEtE,mDAAqC;AACrC,2CAA6B;AAI7B,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAYhC,MAAM,KAAK,GAAG,CAAC,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,IAAI,GAAG,EAAE,EACT,UAAU,GACgB,EAAE,EAAE,CAAC,CAC/B,gCAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,YAC9B,mCACI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,OAAO,EAAE,OAAO,gBACJ,IAAA,WAAI,EAAC,SAAS,IAAI,EAAE,CAAC,KAC7B,UAAU,YAEd,gCAAK,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,YAC3C,iCAAM,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,YAC9B,uBAAC,qBAAW,IACR,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,GACtB,GACC,GACL,GACD,GACP,CACT,CAAC;AAEF,kBAAe,KAAK,CAAC","sourcesContent":["import ToggleArrow from '../../../components/ToggleArrow/ToggleArrow';\nimport {ClassNameProps} from '../../../models';\nimport {block} from '../../../utils';\nimport {i18n} from '../i18n';\n\nimport './Arrow.scss';\n\nconst b = block('slider-arrow');\n\nexport type ArrowType = 'left' | 'right';\n\nexport interface ArrowProps {\n type: ArrowType;\n transparent?: boolean;\n onClick?: () => void;\n size?: number;\n extraProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\nconst Arrow = ({\n type,\n transparent,\n onClick,\n className,\n size = 16,\n extraProps,\n}: ArrowProps & ClassNameProps) => (\n <div className={b(null, className)}>\n <button\n className={b('button')}\n onClick={onClick}\n aria-label={i18n(`arrow-${type}`)}\n {...extraProps}\n >\n <div className={b('inner', {type, transparent})}>\n <span className={b('icon-wrapper')}>\n <ToggleArrow\n size={size}\n type={'horizontal'}\n iconType=\"navigation\"\n className={b('icon')}\n />\n </span>\n </div>\n </button>\n </div>\n);\n\nexport default Arrow;\n"]}
|
|
@@ -788,7 +788,7 @@ unpredictable css rules order in build */
|
|
|
788
788
|
left: 0;
|
|
789
789
|
margin-right: 0;
|
|
790
790
|
}
|
|
791
|
-
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_light) .pc-slider-
|
|
791
|
+
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_light) .pc-slider-arrow__inner {
|
|
792
792
|
color: var(--g-color-text-dark-primary);
|
|
793
793
|
}
|
|
794
794
|
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_light) .pc-SliderBlock__dot {
|
|
@@ -797,7 +797,7 @@ unpredictable css rules order in build */
|
|
|
797
797
|
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_light) .pc-SliderBlock__dot_active {
|
|
798
798
|
background-color: var(--g-color-private-black-300);
|
|
799
799
|
}
|
|
800
|
-
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_dark) .pc-slider-
|
|
800
|
+
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_dark) .pc-slider-arrow__inner {
|
|
801
801
|
color: var(--g-color-text-light-primary);
|
|
802
802
|
}
|
|
803
803
|
.pc-SliderBlock_type_header-card:has(.swiper-slide-active .pc-header-block_controls-view_dark) .pc-SliderBlock__dot {
|
|
@@ -61,7 +61,7 @@ const TabContent = ({ tabData, isActive, isReverse, contentSize, centered, play,
|
|
|
61
61
|
}, className: b('col', { centered: centered }), children: [tabData.media && ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: mediaVideoHeight || minImageHeight }, children: (0, jsx_runtime_1.jsx)("div", { ref: mediaContainerRef, children: (0, react_1.createElement)(Media_1.default, { ...(0, microdata_1.mergeVideoMicrodata)((0, utils_1.getThemedValue)(tabData.media, theme), {
|
|
62
62
|
name: tabData.tabName,
|
|
63
63
|
description: tabData.caption ? tabData.caption : undefined,
|
|
64
|
-
}), key: tabName, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }) }) })), imageProps && ((0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)(components_1.FullscreenImage, { ...imageProps, imageClassName: b('image', { border }) }) })), tabData.caption && ((0, jsx_runtime_1.jsx)("
|
|
64
|
+
}), key: tabName, className: b('media', { border }), playVideo: play, height: mediaVideoHeight || undefined, onImageLoad: handleImageHeight }) }) })), imageProps && ((0, jsx_runtime_1.jsx)(React.Fragment, { children: (0, jsx_runtime_1.jsx)(components_1.FullscreenImage, { ...imageProps, imageClassName: b('image', { border }) }) })), tabData.caption && ((0, jsx_runtime_1.jsx)("div", { className: b('caption'), id: captionId, children: (0, jsx_runtime_1.jsx)(components_1.YFMWrapper, { content: tabData.caption, modifiers: { constructor: true }, id: captionId }) }))] }));
|
|
65
65
|
return ((0, jsx_runtime_1.jsxs)(grid_1.Row, { className: b('row', { reverse: isReverse, hidden: !isActive }), id: getTabContentElementId?.(tabName), role: "tabpanel", ariaProps: {
|
|
66
66
|
'aria-labelledby': getTabElementId?.(tabName),
|
|
67
67
|
}, children: [mediaContent, textContent] }, tabName));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContent.js","sourceRoot":"../../../../../src","sources":["blocks/Tabs/TabContent/TabContent.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA+B;AAE/B,6FAA+E;AAC/E,mDAAqD;AACrD,2DAAgD;AAChD,6EAAoE;AACpE,oEAAoE;AACpE,oGAAiE;AACjE,iDAA+D;AAC/D,uFAAoD;AACpD,2DAA6D;AAC7D,6DAAgE;AAChE,6CAA4C;AAI5C,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,aAAa,CAAC,CAAC;AAaxB,MAAM,UAAU,GAAG,CAAC,EACvB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,sBAAsB,GACR,EAAE,EAAE;IAClB,MAAM,EAAC,OAAO,EAAC,G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AK,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAC,CAAC,EAC5D,EAAE,EAAE,sBAAsB,EAAE,CAAC,OAAO,CAAC,EACrC,IAAI,EAAC,UAAU,EACf,SAAS,EAAE;YACP,iBAAiB,EAAE,eAAe,EAAE,CAAC,OAAO,CAAC;SAChD,aAEA,YAAY,EACZ,WAAW,KATP,OAAO,CAUV,CACT,CAAC;AACN,CAAC,CAAC;AAlIW,QAAA,UAAU,cAkIrB","sourcesContent":["import * as React from 'react';\nimport {ContentSize, TabsBlockItem} from '../../../models';\nimport {ProjectSettingsContext} from '../../../context/projectSettingsContext';\nimport {block, getThemedValue} from '../../../utils';\nimport {useTheme} from '../../../context/theme';\nimport {getHeight} from '../../../components/VideoBlock/VideoBlock';\nimport {getMediaImage} from '../../../components/Media/Image/utils';\nimport TabsTextContent from '../TabsTextContent/TabsTextContent';\nimport {Col, GridColumnOrderClasses, Row} from '../../../grid';\nimport Media from '../../../components/Media/Media';\nimport {mergeVideoMicrodata} from '../../../utils/microdata';\nimport {FullscreenImage, YFMWrapper} from '../../../components';\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport './TabContent.scss';\n\nconst b = block('tab-content');\n\nexport interface TabContentProps {\n tabData: TabsBlockItem;\n isActive: boolean;\n isReverse: boolean;\n contentSize: ContentSize;\n centered?: boolean;\n play: boolean;\n getTabElementId?: (tabId: string) => string;\n getTabContentElementId?: (tabId: string) => string;\n}\n\nexport const TabContent = ({\n tabData,\n isActive,\n isReverse,\n contentSize,\n centered,\n play,\n getTabElementId,\n getTabContentElementId,\n}: TabContentProps) => {\n const {tabName} = tabData;\n\n const mediaContainerRef = React.useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const {renderInvisibleBlocks} = React.useContext(ProjectSettingsContext);\n\n const captionId = useUniqId();\n\n const mediaWidth = mediaContainerRef?.current?.offsetWidth;\n const [minImageHeight, setMinImageHeight] = React.useState(\n mediaContainerRef?.current?.offsetHeight,\n );\n\n const shouldRender = renderInvisibleBlocks || isActive;\n\n const themedImage = getThemedValue(tabData.image, theme);\n const themedMedia = getThemedValue(tabData.media, theme);\n\n const hasNoImage = !themedMedia?.image && !tabData.image;\n const mediaVideoHeight = hasNoImage && mediaWidth && getHeight(mediaWidth);\n\n // TODO remove property support activeTabData?.image. Use only activeTabData?.media?.image\n const imageProps = React.useMemo(() => {\n const imagePropsResult = themedImage && getMediaImage(themedImage);\n\n if (tabData.caption && imagePropsResult) {\n Object.assign(imagePropsResult, {\n 'aria-describedby': captionId,\n });\n }\n\n return imagePropsResult;\n }, [captionId, tabData.caption, themedImage]);\n\n const handleImageHeight = React.useCallback(() => {\n if (minImageHeight !== mediaContainerRef?.current?.offsetHeight) {\n setMinImageHeight(mediaContainerRef?.current?.offsetHeight);\n }\n }, [minImageHeight]);\n\n React.useEffect(() => {\n handleImageHeight();\n }, [isActive, handleImageHeight]);\n\n if (!shouldRender) {\n return null;\n }\n\n const showMedia = isActive && Boolean(tabData.media || imageProps);\n const showText = Boolean(tabData.text);\n const border = tabData.border || 'shadow';\n\n const textContent = showText && (\n <TabsTextContent\n showMedia={showMedia}\n data={tabData}\n imageProps={imageProps || undefined}\n isReverse={isReverse}\n contentSize={contentSize}\n centered={centered}\n />\n );\n\n const mediaContent = showMedia && (\n <Col\n sizes={{all: 12, md: 8}}\n orders={{\n all: GridColumnOrderClasses.Last,\n md: GridColumnOrderClasses.First,\n }}\n className={b('col', {centered: centered})}\n >\n {tabData.media && (\n <div style={{minHeight: mediaVideoHeight || minImageHeight}}>\n <div ref={mediaContainerRef}>\n <Media\n {...mergeVideoMicrodata(getThemedValue(tabData.media, theme), {\n name: tabData.tabName,\n description: tabData.caption ? tabData.caption : undefined,\n })}\n key={tabName}\n className={b('media', {border})}\n playVideo={play}\n height={mediaVideoHeight || undefined}\n onImageLoad={handleImageHeight}\n />\n </div>\n </div>\n )}\n {imageProps && (\n <React.Fragment>\n <FullscreenImage {...imageProps} imageClassName={b('image', {border})} />\n </React.Fragment>\n )}\n {tabData.caption && (\n <div className={b('caption')} id={captionId}>\n <YFMWrapper\n content={tabData.caption}\n modifiers={{constructor: true}}\n id={captionId}\n />\n </div>\n )}\n </Col>\n );\n\n return (\n <Row\n key={tabName}\n className={b('row', {reverse: isReverse, hidden: !isActive})}\n id={getTabContentElementId?.(tabName)}\n role=\"tabpanel\"\n ariaProps={{\n 'aria-labelledby': getTabElementId?.(tabName),\n }}\n >\n {mediaContent}\n {textContent}\n </Row>\n );\n};\n"]}
|
|
@@ -8,9 +8,9 @@ const Image_1 = tslib_1.__importDefault(require("../Image/Image.js"));
|
|
|
8
8
|
exports.qaIdByDefault = 'background-image';
|
|
9
9
|
const b = (0, utils_1.block)('storage-background-image');
|
|
10
10
|
const BackgroundImage = (props) => {
|
|
11
|
-
const { children, src, desktop, className, imageClassName, style,
|
|
11
|
+
const { children, src, desktop, className, imageClassName, style, qa } = props;
|
|
12
12
|
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa || exports.qaIdByDefault);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), style: style, "data-qa": qa || exports.qaIdByDefault, children: [(src || desktop) &&
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), style: style, "data-qa": qa || exports.qaIdByDefault, children: [(src || desktop) && ((0, jsx_runtime_1.jsx)(Image_1.default, { ...props, className: b('img', imageClassName), qa: qaAttributes.image })), children && (0, jsx_runtime_1.jsx)("div", { className: b('container'), children: children })] }));
|
|
14
14
|
};
|
|
15
15
|
exports.default = BackgroundImage;
|
|
16
16
|
//# sourceMappingURL=BackgroundImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundImage.js","sourceRoot":"../../../../src","sources":["components/BackgroundImage/BackgroundImage.tsx"],"names":[],"mappings":";;;;;AAGA,gDAAmD;AACnD,sEAAmC;AAItB,QAAA,aAAa,GAAG,kBAAkB,CAAC;AAEhD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,0BAA0B,CAAC,CAAC;AAE5C,MAAM,eAAe,GAAG,CAAC,KAAoD,EAAE,EAAE;IAC7E,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BackgroundImage.js","sourceRoot":"../../../../src","sources":["components/BackgroundImage/BackgroundImage.tsx"],"names":[],"mappings":";;;;;AAGA,gDAAmD;AACnD,sEAAmC;AAItB,QAAA,aAAa,GAAG,kBAAkB,CAAC;AAEhD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,0BAA0B,CAAC,CAAC;AAE5C,MAAM,eAAe,GAAG,CAAC,KAAoD,EAAE,EAAE;IAC7E,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,EAAC,GAAG,KAAK,CAAC;IAC7E,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,EAAE,IAAI,qBAAa,CAAC,CAAC;IAE1D,OAAO,CACH,iCAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,aAAW,EAAE,IAAI,qBAAa,aACzE,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CACjB,uBAAC,eAAK,OAAK,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,KAAK,GAAI,CACpF,EACA,QAAQ,IAAI,gCAAK,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,YAAG,QAAQ,GAAO,IAC3D,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImageProps} from '../../models';\nimport {block, getQaAttrubutes} from '../../utils';\nimport Image from '../Image/Image';\n\nimport './BackgroundImage.scss';\n\nexport const qaIdByDefault = 'background-image';\n\nconst b = block('storage-background-image');\n\nconst BackgroundImage = (props: React.PropsWithChildren<BackgroundImageProps>) => {\n const {children, src, desktop, className, imageClassName, style, qa} = props;\n const qaAttributes = getQaAttrubutes(qa || qaIdByDefault);\n\n return (\n <div className={b(null, className)} style={style} data-qa={qa || qaIdByDefault}>\n {(src || desktop) && (\n <Image {...props} className={b('img', imageClassName)} qa={qaAttributes.image} />\n )}\n {children && <div className={b('container')}>{children}</div>}\n </div>\n );\n};\n\nexport default BackgroundImage;\n"]}
|
|
@@ -10,7 +10,9 @@ export interface ImageProps extends Partial<ImageObjectProps>, Partial<ImageDevi
|
|
|
10
10
|
export interface DeviceSpecificFragmentProps extends QAProps {
|
|
11
11
|
disableWebp: boolean;
|
|
12
12
|
src: string;
|
|
13
|
-
|
|
13
|
+
maxBreakpoint?: number;
|
|
14
|
+
minBreakpoint?: number;
|
|
14
15
|
}
|
|
16
|
+
export declare const EMPTY_IMG = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==";
|
|
15
17
|
declare const Image: (props: ImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
18
|
export default Image;
|
|
@@ -1,31 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMPTY_IMG = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const React = tslib_1.__importStar(require("react"));
|
|
6
7
|
const constants_1 = require("../../constants.js");
|
|
7
8
|
const projectSettingsContext_1 = require("../../context/projectSettingsContext/index.js");
|
|
9
|
+
const models_1 = require("../../models/index.js");
|
|
8
10
|
const utils_1 = require("../../utils/index.js");
|
|
9
11
|
const imageCompress_1 = require("../../utils/imageCompress.js");
|
|
10
12
|
const ImageBase_1 = tslib_1.__importDefault(require("../ImageBase/ImageBase.js"));
|
|
11
13
|
const checkWebP = (src) => {
|
|
12
14
|
return src.endsWith('.webp') ? src : src + '.webp';
|
|
13
15
|
};
|
|
14
|
-
|
|
16
|
+
exports.EMPTY_IMG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjwvc3ZnPg==';
|
|
17
|
+
const DeviceSpecificFragment = ({ disableWebp, src, maxBreakpoint, minBreakpoint, qa, }) => {
|
|
18
|
+
const media = [];
|
|
19
|
+
if (maxBreakpoint) {
|
|
20
|
+
media.push(`(max-width: ${maxBreakpoint}px)`);
|
|
21
|
+
}
|
|
22
|
+
if (minBreakpoint) {
|
|
23
|
+
media.push(`(min-width: ${minBreakpoint}px)`);
|
|
24
|
+
}
|
|
25
|
+
const mediaString = media.join(' and ');
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [!disableWebp && ((0, jsx_runtime_1.jsx)("source", { srcSet: checkWebP(src), type: "image/webp", media: mediaString, "data-qa": `${qa}-compressed` })), (0, jsx_runtime_1.jsx)("source", { srcSet: src, media: mediaString, "data-qa": qa })] }));
|
|
27
|
+
};
|
|
15
28
|
const Image = (props) => {
|
|
16
29
|
const projectSettings = React.useContext(projectSettingsContext_1.ProjectSettingsContext);
|
|
17
|
-
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, containerClassName, qa, fetchPriority, loading, } = props;
|
|
30
|
+
const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, onLoad, containerClassName, qa, fetchPriority, loading, hide, } = props;
|
|
18
31
|
const [imgLoadingError, setImgLoadingError] = React.useState(false);
|
|
19
32
|
const src = imageSrc || desktop;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'desktop-source-compressed');
|
|
24
|
-
const disableWebp =
|
|
33
|
+
const hideDevices = typeof hide === 'boolean' || !hide
|
|
34
|
+
? Object.values(models_1.Device).reduce((acc, device) => ({ ...acc, [device]: Boolean(hide) }), {})
|
|
35
|
+
: hide;
|
|
36
|
+
const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, 'mobile-webp-source', 'mobile-source', 'tablet-webp-source', 'tablet-source', 'desktop-source', 'desktop-source-compressed');
|
|
37
|
+
const disableWebp = !src ||
|
|
38
|
+
projectSettings.disableCompress ||
|
|
25
39
|
disableCompress ||
|
|
26
40
|
!(0, imageCompress_1.isCompressible)(src) ||
|
|
27
41
|
imgLoadingError;
|
|
28
|
-
|
|
42
|
+
if (!src) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("picture", { className: containerClassName, "data-qa": qa, children: [(mobile || hideDevices.mobile) && ((0, jsx_runtime_1.jsx)(DeviceSpecificFragment, { src: mobile || exports.EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.mobile), maxBreakpoint: constants_1.BREAKPOINTS.sm, qa: qaAttributes.mobileSource })), (tablet || hideDevices.tablet) && ((0, jsx_runtime_1.jsx)(DeviceSpecificFragment, { src: tablet || exports.EMPTY_IMG, disableWebp: disableWebp || Boolean(hideDevices.tablet), maxBreakpoint: constants_1.BREAKPOINTS.md, minBreakpoint: constants_1.BREAKPOINTS.sm, qa: qaAttributes.tabletSource })), hideDevices.desktop && ((0, jsx_runtime_1.jsx)(DeviceSpecificFragment, { src: exports.EMPTY_IMG, disableWebp: true, minBreakpoint: constants_1.BREAKPOINTS.md, qa: qaAttributes.desktopSource })), src && !disableWebp && ((0, jsx_runtime_1.jsx)("source", { srcSet: checkWebP(src), type: "image/webp", "data-qa": qaAttributes.desktopSourceCompressed })), (0, jsx_runtime_1.jsx)(ImageBase_1.default, { className: className, alt: alt, src: src, style: style, fetchPriority: fetchPriority, loading: loading, onClick: onClick, onError: () => setImgLoadingError(true), onLoad: onLoad })] }));
|
|
29
46
|
};
|
|
30
47
|
exports.default = Image;
|
|
31
48
|
//# sourceMappingURL=Image.js.map
|