@doyourjob/gravity-ui-page-constructor 5.31.228 → 5.31.231
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/HeaderMinify/HeaderMinify.css +2 -2
- package/build/cjs/blocks/LogoRotator/Item.d.ts +1 -1
- package/build/cjs/blocks/LogoRotator/Item.js +8 -2
- package/build/cjs/blocks/LogoRotator/LogoRotator.js +11 -2
- package/build/cjs/blocks/LogoRotator/schema.js +1 -1
- package/build/cjs/blocks/Scroller/Scroller.css +14 -9
- package/build/cjs/blocks/Scroller/Scroller.js +81 -27
- package/build/cjs/blocks/Scroller/schema.d.ts +28 -8
- package/build/cjs/blocks/Scroller/schema.js +17 -7
- package/build/cjs/blocks/WhatsNew/WhatsNew.js +2 -2
- package/build/cjs/blocks/WhatsNew/schema.d.ts +12 -0
- package/build/cjs/blocks/WhatsNew/schema.js +2 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +3 -2
- package/build/esm/blocks/HeaderMinify/HeaderMinify.css +2 -2
- package/build/esm/blocks/LogoRotator/Item.d.ts +1 -1
- package/build/esm/blocks/LogoRotator/Item.js +8 -2
- package/build/esm/blocks/LogoRotator/LogoRotator.js +11 -2
- package/build/esm/blocks/LogoRotator/schema.js +1 -1
- package/build/esm/blocks/Scroller/Scroller.css +14 -9
- package/build/esm/blocks/Scroller/Scroller.js +81 -27
- package/build/esm/blocks/Scroller/schema.d.ts +28 -8
- package/build/esm/blocks/Scroller/schema.js +16 -6
- package/build/esm/blocks/WhatsNew/WhatsNew.js +2 -2
- package/build/esm/blocks/WhatsNew/schema.d.ts +12 -0
- package/build/esm/blocks/WhatsNew/schema.js +2 -1
- package/build/esm/models/constructor-items/blocks.d.ts +3 -2
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +3 -2
- package/widget/index.js +1 -1
|
@@ -7,7 +7,7 @@ unpredictable css rules order in build */
|
|
|
7
7
|
}
|
|
8
8
|
.pc-header-minify-block_header-space {
|
|
9
9
|
padding-top: var(--header-height);
|
|
10
|
-
margin-top: calc(var(--header-height) * -1);
|
|
10
|
+
margin-top: calc((var(--header-height) + 30px) * -1);
|
|
11
11
|
}
|
|
12
12
|
.pc-header-minify-block__video {
|
|
13
13
|
position: absolute;
|
|
@@ -18,7 +18,7 @@ unpredictable css rules order in build */
|
|
|
18
18
|
height: 100%;
|
|
19
19
|
}
|
|
20
20
|
.pc-header-minify-block__container {
|
|
21
|
-
padding-top:
|
|
21
|
+
padding-top: 180px;
|
|
22
22
|
padding-bottom: 155px;
|
|
23
23
|
}
|
|
24
24
|
.pc-header-minify-block__title {
|
|
@@ -10,8 +10,14 @@ const utils_1 = require("../../utils");
|
|
|
10
10
|
const b = (0, utils_1.block)('logo-rotator-block');
|
|
11
11
|
const defaultColSizes = { all: 3 };
|
|
12
12
|
const Item = ({ url, src, hidden, colSizes }) => {
|
|
13
|
-
const renderItem = react_1.default.useMemo(() =>
|
|
14
|
-
|
|
13
|
+
const renderItem = react_1.default.useMemo(() => {
|
|
14
|
+
if (url) {
|
|
15
|
+
return (react_1.default.createElement(uikit_1.Link, { href: url, className: b('item', { hidden }) },
|
|
16
|
+
react_1.default.createElement(components_1.Image, { src: src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
17
|
+
}
|
|
18
|
+
return (react_1.default.createElement("div", { className: b('item', { hidden }) },
|
|
19
|
+
react_1.default.createElement(components_1.Image, { src: src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
20
|
+
}, [hidden, src, url]);
|
|
15
21
|
return react_1.default.createElement(grid_1.Col, { sizes: colSizes || defaultColSizes }, renderItem);
|
|
16
22
|
};
|
|
17
23
|
exports.Item = Item;
|
|
@@ -91,8 +91,17 @@ const LogoRotatorBlock = (props) => {
|
|
|
91
91
|
return (react_1.default.createElement(AnimateBlock_1.default, { className: b({ theme }), animate: animated },
|
|
92
92
|
react_1.default.createElement("div", { className: b('root') },
|
|
93
93
|
hasTitle && (react_1.default.createElement(components_1.Title, { title: titleProps, className: b('title'), colSizes: { all: 12 } })),
|
|
94
|
-
rowMode ? (react_1.default.createElement("div", { className: b('row-items') }, slots.map((slot, index) =>
|
|
95
|
-
|
|
94
|
+
rowMode ? (react_1.default.createElement("div", { className: b('row-items') }, slots.map((slot, index) => {
|
|
95
|
+
const item = items[slot];
|
|
96
|
+
if (!item)
|
|
97
|
+
return null;
|
|
98
|
+
if (item.url) {
|
|
99
|
+
return (react_1.default.createElement(uikit_1.Link, { key: index, href: item.url, className: b('row-item', { hidden: hidden[index] }) },
|
|
100
|
+
react_1.default.createElement(components_1.ImageBase, { src: item.src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
101
|
+
}
|
|
102
|
+
return (react_1.default.createElement("div", { key: index, className: b('row-item', { hidden: hidden[index] }) },
|
|
103
|
+
react_1.default.createElement(components_1.ImageBase, { src: item.src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
104
|
+
}))) : (react_1.default.createElement(grid_1.Grid, { className: b('items') },
|
|
96
105
|
react_1.default.createElement(grid_1.Row, { className: b('row') }, renderItems))))));
|
|
97
106
|
};
|
|
98
107
|
exports.LogoRotatorBlock = LogoRotatorBlock;
|
|
@@ -31,28 +31,33 @@ unpredictable css rules order in build */
|
|
|
31
31
|
.pc-scroller-block__content_gapLong {
|
|
32
32
|
gap: 48px;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
scroll-snap-align: center;
|
|
34
|
+
@media (min-width: 769px) {
|
|
35
|
+
.pc-scroller-block__content {
|
|
36
|
+
--scroller-edge-margin: calc(100% / 2.5);
|
|
37
|
+
}
|
|
39
38
|
}
|
|
40
|
-
.pc-scroller-
|
|
39
|
+
.pc-scroller-block__content .pc-scroller-block__item:first-child {
|
|
41
40
|
margin-left: 48px;
|
|
42
41
|
}
|
|
43
42
|
@media (min-width: 769px) {
|
|
44
|
-
.pc-scroller-
|
|
43
|
+
.pc-scroller-block__content .pc-scroller-block__item:first-child {
|
|
45
44
|
margin-left: var(--scroller-edge-margin);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
.pc-scroller-
|
|
47
|
+
.pc-scroller-block__content .pc-scroller-block__item:last-child {
|
|
49
48
|
margin-right: 48px;
|
|
50
49
|
}
|
|
51
50
|
@media (min-width: 769px) {
|
|
52
|
-
.pc-scroller-
|
|
51
|
+
.pc-scroller-block__content .pc-scroller-block__item:last-child {
|
|
53
52
|
margin-right: var(--scroller-edge-margin);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
55
|
+
.pc-scroller-block__content_scroll-snap-center {
|
|
56
|
+
scroll-snap-type: x mandatory;
|
|
57
|
+
}
|
|
58
|
+
.pc-scroller-block__content_scroll-snap-center .pc-scroller-block__item {
|
|
59
|
+
scroll-snap-align: center;
|
|
60
|
+
}
|
|
56
61
|
.pc-scroller-block__item {
|
|
57
62
|
position: relative;
|
|
58
63
|
z-index: 1;
|
|
@@ -4,9 +4,26 @@ exports.ScrollerBlock = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const components_1 = require("../../components");
|
|
7
|
-
const constants_1 = require("../../constants");
|
|
8
7
|
const utils_1 = require("../../utils");
|
|
9
8
|
const b = (0, utils_1.block)('scroller-block');
|
|
9
|
+
const getChild = (parent, index) => {
|
|
10
|
+
const child = parent.children[index];
|
|
11
|
+
return child instanceof HTMLElement ? child : null;
|
|
12
|
+
};
|
|
13
|
+
const getCenteredChildIndex = (content) => {
|
|
14
|
+
const midLine = content.getBoundingClientRect().left + content.clientWidth / 2;
|
|
15
|
+
for (let i = 0; i < content.children.length; i++) {
|
|
16
|
+
const rect = content.children[i].getBoundingClientRect();
|
|
17
|
+
if (rect.left <= midLine && rect.right >= midLine) {
|
|
18
|
+
return i;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return 0;
|
|
22
|
+
};
|
|
23
|
+
const scrollToChild = (content, child, behavior = 'smooth') => {
|
|
24
|
+
const left = child.offsetLeft - (content.offsetWidth - child.offsetWidth) / 2;
|
|
25
|
+
content.scrollTo({ left, behavior });
|
|
26
|
+
};
|
|
10
27
|
const PlayIcon = () => {
|
|
11
28
|
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", fill: "none" },
|
|
12
29
|
react_1.default.createElement("path", { d: "M13.765 9.83831L20.3154 13.7086C21.2977 14.289 21.298 15.7102 20.3159 16.2911L13.7714 20.1618C12.7719 20.7529 11.5086 20.033 11.5078 18.8718L11.502 11.1309C11.5011 9.96894 12.7646 9.24725 13.765 9.83831Z", fill: "currentColor" })));
|
|
@@ -16,7 +33,8 @@ const PauseIcon = () => {
|
|
|
16
33
|
react_1.default.createElement("path", { d: "M12.5 10C13.3284 10 14 10.6716 14 11.5V18.5C14 19.3284 13.3284 20 12.5 20C11.6716 20 11 19.3284 11 18.5V11.5C11 10.6716 11.6716 10 12.5 10ZM17.5 10C18.3284 10 19 10.6716 19 11.5V18.5C19 19.3284 18.3284 20 17.5 20C16.6716 20 16 19.3284 16 18.5V11.5C16 10.6716 16.6716 10 17.5 10Z", fill: "currentColor" })));
|
|
17
34
|
};
|
|
18
35
|
const ScrollerBlock = (props) => {
|
|
19
|
-
const { animated, widths, gapLong, fullWidth, scrollSnapCenter, children, autoScroll, autoScrollInterval = 3000, } = props;
|
|
36
|
+
const { animated, widths, gapLong, fullWidth, scrollSnapCenter, children, autoScroll = true, autoScrollInterval = 3000, infinite = false, } = props;
|
|
37
|
+
const childCount = react_1.default.Children.count(children);
|
|
20
38
|
const rootRef = (0, react_1.useRef)(null);
|
|
21
39
|
const contentRef = (0, react_1.useRef)(null);
|
|
22
40
|
const [currentElement, setCurrentElement] = (0, react_1.useState)(0);
|
|
@@ -35,28 +53,12 @@ const ScrollerBlock = (props) => {
|
|
|
35
53
|
content.style.setProperty('left', `${-space}px`);
|
|
36
54
|
content.style.setProperty('width', `calc(100% + ${2 * space}px)`);
|
|
37
55
|
}
|
|
38
|
-
if (scrollSnapCenter && window.innerWidth >= constants_1.BREAKPOINTS.md) {
|
|
39
|
-
content.style.setProperty('--scroller-edge-margin', `${content.clientWidth / 3}px`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
content.style.removeProperty('--scroller-edge-margin');
|
|
43
|
-
}
|
|
44
56
|
};
|
|
45
57
|
const determineCurrentElement = () => {
|
|
46
|
-
var _a;
|
|
47
|
-
const childCount = ((_a = content === null || content === void 0 ? void 0 : content.children) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
48
58
|
if (!content || childCount <= 1) {
|
|
49
59
|
return;
|
|
50
60
|
}
|
|
51
|
-
|
|
52
|
-
[...content.children].find((child, index) => {
|
|
53
|
-
const childRect = child.getBoundingClientRect();
|
|
54
|
-
if (currentMidLine > childRect.left && currentMidLine < childRect.right) {
|
|
55
|
-
setCurrentElement(index);
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
});
|
|
61
|
+
setCurrentElement(getCenteredChildIndex(content) % childCount);
|
|
60
62
|
};
|
|
61
63
|
updateSize();
|
|
62
64
|
determineCurrentElement();
|
|
@@ -66,23 +68,69 @@ const ScrollerBlock = (props) => {
|
|
|
66
68
|
window.removeEventListener('resize', updateSize);
|
|
67
69
|
content === null || content === void 0 ? void 0 : content.removeEventListener('scroll', determineCurrentElement);
|
|
68
70
|
};
|
|
69
|
-
}, [fullWidth,
|
|
71
|
+
}, [fullWidth, childCount, children]);
|
|
72
|
+
(0, react_1.useEffect)(() => {
|
|
73
|
+
const content = contentRef.current;
|
|
74
|
+
if (!content || !infinite || childCount <= 1) {
|
|
75
|
+
return () => { };
|
|
76
|
+
}
|
|
77
|
+
const middleCenterIndex = Math.floor(childCount * 1.5);
|
|
78
|
+
const copyStartIndex = childCount;
|
|
79
|
+
const endCopyStartIndex = childCount * 2;
|
|
80
|
+
const scrollToMiddle = () => {
|
|
81
|
+
const middleChild = getChild(content, middleCenterIndex);
|
|
82
|
+
if (middleChild) {
|
|
83
|
+
content.scrollTo(middleChild.offsetLeft + content.offsetWidth / 2 - middleChild.offsetWidth / 2, 0);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const handleInfiniteScroll = () => {
|
|
87
|
+
const scrollLeft = content.scrollLeft;
|
|
88
|
+
const endCopyChild = getChild(content, endCopyStartIndex);
|
|
89
|
+
const copyStartChild = getChild(content, copyStartIndex);
|
|
90
|
+
if (endCopyChild && scrollLeft > endCopyChild.offsetLeft) {
|
|
91
|
+
const delta = endCopyChild.offsetLeft - scrollLeft;
|
|
92
|
+
const resetChild = getChild(content, copyStartIndex);
|
|
93
|
+
if (resetChild) {
|
|
94
|
+
content.scrollTo(resetChild.offsetLeft + delta, 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (copyStartChild && scrollLeft < copyStartChild.offsetLeft - content.clientWidth) {
|
|
98
|
+
const endChild = getChild(content, endCopyStartIndex);
|
|
99
|
+
if (endChild) {
|
|
100
|
+
content.scrollTo(endChild.offsetLeft - content.clientWidth, 0);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
content.addEventListener('scroll', handleInfiniteScroll, { passive: true });
|
|
105
|
+
scrollToMiddle();
|
|
106
|
+
return () => {
|
|
107
|
+
content.removeEventListener('scroll', handleInfiniteScroll);
|
|
108
|
+
};
|
|
109
|
+
}, [infinite, childCount]);
|
|
70
110
|
(0, react_1.useEffect)(() => {
|
|
71
111
|
if (autoScroll) {
|
|
72
112
|
setIsPaused(false);
|
|
73
113
|
}
|
|
74
114
|
}, [autoScroll]);
|
|
75
|
-
const childCount = react_1.default.Children.count(children);
|
|
76
115
|
const scrollToNext = (0, react_1.useCallback)(() => {
|
|
77
116
|
const content = contentRef.current;
|
|
78
|
-
if (!content) {
|
|
117
|
+
if (!content || childCount <= 1) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (infinite) {
|
|
121
|
+
const centeredIndex = getCenteredChildIndex(content);
|
|
122
|
+
const nextElement = getChild(content, centeredIndex + 1);
|
|
123
|
+
if (nextElement) {
|
|
124
|
+
scrollToChild(content, nextElement);
|
|
125
|
+
}
|
|
79
126
|
return;
|
|
80
127
|
}
|
|
81
128
|
const nextIndex = (currentElement + 1) % childCount;
|
|
82
|
-
const nextElement = content
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
129
|
+
const nextElement = getChild(content, nextIndex);
|
|
130
|
+
if (nextElement) {
|
|
131
|
+
scrollToChild(content, nextElement);
|
|
132
|
+
}
|
|
133
|
+
}, [childCount, currentElement, infinite]);
|
|
86
134
|
(0, react_1.useEffect)(() => {
|
|
87
135
|
let timeout = null;
|
|
88
136
|
if (!isPaused) {
|
|
@@ -98,7 +146,13 @@ const ScrollerBlock = (props) => {
|
|
|
98
146
|
}, [isPaused, currentElement, autoScrollInterval, scrollToNext]);
|
|
99
147
|
return (react_1.default.createElement(components_1.AnimateBlock, { className: b({ fullWidth }), animate: animated },
|
|
100
148
|
react_1.default.createElement("div", { className: b('root'), ref: rootRef },
|
|
101
|
-
react_1.default.createElement("div", { className: b('content', {
|
|
149
|
+
react_1.default.createElement("div", { className: b('content', {
|
|
150
|
+
gapLong,
|
|
151
|
+
fullWidth,
|
|
152
|
+
'scroll-snap-center': infinite ? false : scrollSnapCenter,
|
|
153
|
+
}), ref: contentRef }, (infinite ? [0, 1, 2] : [0])
|
|
154
|
+
.map((mi) => react_1.default.Children.map(children, (child, index) => (react_1.default.createElement("div", { key: mi * childCount + index, className: b('item'), style: { width: (widths === null || widths === void 0 ? void 0 : widths[index]) || 'auto' } }, child))))
|
|
155
|
+
.flat())),
|
|
102
156
|
autoScroll && childCount > 0 && (react_1.default.createElement("div", { className: b('pagination-container') },
|
|
103
157
|
react_1.default.createElement("div", { className: b('pagination') }, Array.from({ length: childCount }, (_, index) => (react_1.default.createElement("div", { key: index, className: b('pip', { active: index === currentElement }) },
|
|
104
158
|
react_1.default.createElement("div", { style: {
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
+
export declare const ScrollerControlsProps: {
|
|
2
|
+
infinite: {
|
|
3
|
+
type: string;
|
|
4
|
+
};
|
|
5
|
+
scrollSnapCenter: {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
autoScroll: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
autoScrollInterval: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
1
15
|
export declare const ScrollerBlock: {
|
|
2
16
|
'scroller-block': {
|
|
3
17
|
additionalProperties: boolean;
|
|
4
18
|
required: boolean;
|
|
5
19
|
properties: {
|
|
6
|
-
|
|
20
|
+
children: {
|
|
7
21
|
type: string;
|
|
8
22
|
items: {
|
|
9
|
-
|
|
23
|
+
$ref: string;
|
|
10
24
|
};
|
|
11
25
|
};
|
|
12
|
-
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
|
-
fullWidth: {
|
|
26
|
+
infinite: {
|
|
16
27
|
type: string;
|
|
17
28
|
};
|
|
18
29
|
scrollSnapCenter: {
|
|
@@ -21,12 +32,21 @@ export declare const ScrollerBlock: {
|
|
|
21
32
|
autoScroll: {
|
|
22
33
|
type: string;
|
|
23
34
|
};
|
|
24
|
-
|
|
35
|
+
autoScrollInterval: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
widths: {
|
|
25
39
|
type: string;
|
|
26
40
|
items: {
|
|
27
|
-
|
|
41
|
+
type: string;
|
|
28
42
|
};
|
|
29
43
|
};
|
|
44
|
+
gapLong: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
fullWidth: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
30
50
|
animated: {
|
|
31
51
|
type: string;
|
|
32
52
|
};
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScrollerBlock = void 0;
|
|
3
|
+
exports.ScrollerBlock = exports.ScrollerControlsProps = void 0;
|
|
4
4
|
const common_1 = require("../../schema/validators/common");
|
|
5
|
+
exports.ScrollerControlsProps = {
|
|
6
|
+
infinite: {
|
|
7
|
+
type: 'boolean',
|
|
8
|
+
},
|
|
9
|
+
scrollSnapCenter: {
|
|
10
|
+
type: 'boolean',
|
|
11
|
+
},
|
|
12
|
+
autoScroll: {
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
},
|
|
15
|
+
autoScrollInterval: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
5
19
|
exports.ScrollerBlock = {
|
|
6
20
|
'scroller-block': {
|
|
7
21
|
additionalProperties: false,
|
|
8
22
|
required: false,
|
|
9
|
-
properties: Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), common_1.AnimatableProps), { widths: {
|
|
23
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BaseProps), common_1.AnimatableProps), { widths: {
|
|
10
24
|
type: 'array',
|
|
11
25
|
items: {
|
|
12
26
|
type: 'string',
|
|
@@ -15,10 +29,6 @@ exports.ScrollerBlock = {
|
|
|
15
29
|
type: 'boolean',
|
|
16
30
|
}, fullWidth: {
|
|
17
31
|
type: 'boolean',
|
|
18
|
-
},
|
|
19
|
-
type: 'boolean',
|
|
20
|
-
}, autoScroll: {
|
|
21
|
-
type: 'boolean',
|
|
22
|
-
}, children: common_1.ChildrenCardsProps }),
|
|
32
|
+
} }), exports.ScrollerControlsProps), { children: common_1.ChildrenCardsProps }),
|
|
23
33
|
},
|
|
24
34
|
};
|
|
@@ -7,12 +7,12 @@ const NewsCard_1 = tslib_1.__importDefault(require("../../sub-blocks/NewsCard/Ne
|
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
const Scroller_1 = tslib_1.__importDefault(require("../Scroller/Scroller"));
|
|
9
9
|
const b = (0, utils_1.block)('whats-new-block');
|
|
10
|
-
const WhatsNew = ({ title, items, footnote, links, animated }) => {
|
|
10
|
+
const WhatsNew = ({ title, items, footnote, links, animated, infinite, scrollSnapCenter, autoScroll, autoScrollInterval, }) => {
|
|
11
11
|
return (react_1.default.createElement(components_1.AnimateBlock, { className: b(), animate: animated },
|
|
12
12
|
react_1.default.createElement("div", { className: b('root') },
|
|
13
13
|
title && (react_1.default.createElement("div", { className: b('head') },
|
|
14
14
|
react_1.default.createElement("h2", { className: b('title') }, title))),
|
|
15
|
-
react_1.default.createElement(Scroller_1.default, { fullWidth: true, scrollSnapCenter:
|
|
15
|
+
react_1.default.createElement(Scroller_1.default, { fullWidth: true, infinite: infinite, scrollSnapCenter: scrollSnapCenter, autoScroll: autoScroll !== null && autoScroll !== void 0 ? autoScroll : true, autoScrollInterval: autoScrollInterval }, items.map((item, index) => (react_1.default.createElement(NewsCard_1.default, Object.assign({ key: index }, item))))),
|
|
16
16
|
(footnote || (links === null || links === void 0 ? void 0 : links.length)) && (react_1.default.createElement("div", { className: b('footer') },
|
|
17
17
|
footnote && react_1.default.createElement("div", { className: b('footnote') }, footnote),
|
|
18
18
|
(links === null || links === void 0 ? void 0 : links.length) ? (react_1.default.createElement("div", { className: b('links') }, links.map((link, index) => (react_1.default.createElement("a", { key: index, href: link.url, className: b('link'), target: "_blank", rel: "noopener noreferrer" },
|
|
@@ -56,6 +56,18 @@ export declare const WhatsNewBlock: {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
+
infinite: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
scrollSnapCenter: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
autoScroll: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
autoScrollInterval: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
59
71
|
title: {
|
|
60
72
|
oneOf: ({
|
|
61
73
|
type: string;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WhatsNewBlock = void 0;
|
|
4
4
|
const common_1 = require("../../schema/validators/common");
|
|
5
|
+
const schema_1 = require("../Scroller/schema");
|
|
5
6
|
exports.WhatsNewBlock = {
|
|
6
7
|
'whats-new-block': {
|
|
7
8
|
additionalProperties: false,
|
|
8
9
|
required: ['items'],
|
|
9
|
-
properties: Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), { items: {
|
|
10
|
+
properties: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common_1.BlockBaseProps), common_1.AnimatableProps), common_1.BlockHeaderProps), schema_1.ScrollerControlsProps), { items: {
|
|
10
11
|
type: 'array',
|
|
11
12
|
items: {
|
|
12
13
|
type: 'object',
|
|
@@ -298,7 +298,7 @@ export interface BannerBlockProps extends BannerCardProps, Animatable {
|
|
|
298
298
|
export interface LogoRotatorBlockProps extends Animatable {
|
|
299
299
|
title?: TitleItemBaseProps | string;
|
|
300
300
|
items: {
|
|
301
|
-
url
|
|
301
|
+
url?: string;
|
|
302
302
|
src: string;
|
|
303
303
|
isStatic?: boolean;
|
|
304
304
|
}[];
|
|
@@ -359,6 +359,7 @@ export interface ScrollerBlockProps extends Animatable {
|
|
|
359
359
|
widths?: string[];
|
|
360
360
|
gapLong?: boolean;
|
|
361
361
|
fullWidth?: boolean;
|
|
362
|
+
infinite?: boolean;
|
|
362
363
|
scrollSnapCenter?: boolean;
|
|
363
364
|
autoScroll?: boolean;
|
|
364
365
|
autoScrollInterval?: number;
|
|
@@ -641,7 +642,7 @@ export interface BenchmarkBlockProps extends Animatable {
|
|
|
641
642
|
postfix?: string;
|
|
642
643
|
}[];
|
|
643
644
|
}
|
|
644
|
-
export interface WhatsNewBlockProps extends Animatable {
|
|
645
|
+
export interface WhatsNewBlockProps extends Animatable, Pick<ScrollerBlockProps, 'infinite' | 'scrollSnapCenter' | 'autoScroll' | 'autoScrollInterval'> {
|
|
645
646
|
title?: string;
|
|
646
647
|
items: NewsCardProps[];
|
|
647
648
|
footnote?: string;
|
|
@@ -7,7 +7,7 @@ unpredictable css rules order in build */
|
|
|
7
7
|
}
|
|
8
8
|
.pc-header-minify-block_header-space {
|
|
9
9
|
padding-top: var(--header-height);
|
|
10
|
-
margin-top: calc(var(--header-height) * -1);
|
|
10
|
+
margin-top: calc((var(--header-height) + 30px) * -1);
|
|
11
11
|
}
|
|
12
12
|
.pc-header-minify-block__video {
|
|
13
13
|
position: absolute;
|
|
@@ -18,7 +18,7 @@ unpredictable css rules order in build */
|
|
|
18
18
|
height: 100%;
|
|
19
19
|
}
|
|
20
20
|
.pc-header-minify-block__container {
|
|
21
|
-
padding-top:
|
|
21
|
+
padding-top: 180px;
|
|
22
22
|
padding-bottom: 155px;
|
|
23
23
|
}
|
|
24
24
|
.pc-header-minify-block__title {
|
|
@@ -7,8 +7,14 @@ import './LogoRotator.css';
|
|
|
7
7
|
const b = block('logo-rotator-block');
|
|
8
8
|
const defaultColSizes = { all: 3 };
|
|
9
9
|
export const Item = ({ url, src, hidden, colSizes }) => {
|
|
10
|
-
const renderItem = React.useMemo(() =>
|
|
11
|
-
|
|
10
|
+
const renderItem = React.useMemo(() => {
|
|
11
|
+
if (url) {
|
|
12
|
+
return (React.createElement(Link, { href: url, className: b('item', { hidden }) },
|
|
13
|
+
React.createElement(Image, { src: src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
14
|
+
}
|
|
15
|
+
return (React.createElement("div", { className: b('item', { hidden }) },
|
|
16
|
+
React.createElement(Image, { src: src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
17
|
+
}, [hidden, src, url]);
|
|
12
18
|
return React.createElement(Col, { sizes: colSizes || defaultColSizes }, renderItem);
|
|
13
19
|
};
|
|
14
20
|
export default React.memo(Item);
|
|
@@ -88,8 +88,17 @@ export const LogoRotatorBlock = (props) => {
|
|
|
88
88
|
return (React.createElement(AnimateBlock, { className: b({ theme }), animate: animated },
|
|
89
89
|
React.createElement("div", { className: b('root') },
|
|
90
90
|
hasTitle && (React.createElement(Title, { title: titleProps, className: b('title'), colSizes: { all: 12 } })),
|
|
91
|
-
rowMode ? (React.createElement("div", { className: b('row-items') }, slots.map((slot, index) =>
|
|
92
|
-
|
|
91
|
+
rowMode ? (React.createElement("div", { className: b('row-items') }, slots.map((slot, index) => {
|
|
92
|
+
const item = items[slot];
|
|
93
|
+
if (!item)
|
|
94
|
+
return null;
|
|
95
|
+
if (item.url) {
|
|
96
|
+
return (React.createElement(Link, { key: index, href: item.url, className: b('row-item', { hidden: hidden[index] }) },
|
|
97
|
+
React.createElement(ImageBase, { src: item.src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
98
|
+
}
|
|
99
|
+
return (React.createElement("div", { key: index, className: b('row-item', { hidden: hidden[index] }) },
|
|
100
|
+
React.createElement(ImageBase, { src: item.src, className: b('image'), alt: "", "aria-hidden": "true" })));
|
|
101
|
+
}))) : (React.createElement(Grid, { className: b('items') },
|
|
93
102
|
React.createElement(Row, { className: b('row') }, renderItems))))));
|
|
94
103
|
};
|
|
95
104
|
export default LogoRotatorBlock;
|
|
@@ -31,28 +31,33 @@ unpredictable css rules order in build */
|
|
|
31
31
|
.pc-scroller-block__content_gapLong {
|
|
32
32
|
gap: 48px;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
scroll-snap-align: center;
|
|
34
|
+
@media (min-width: 769px) {
|
|
35
|
+
.pc-scroller-block__content {
|
|
36
|
+
--scroller-edge-margin: calc(100% / 2.5);
|
|
37
|
+
}
|
|
39
38
|
}
|
|
40
|
-
.pc-scroller-
|
|
39
|
+
.pc-scroller-block__content .pc-scroller-block__item:first-child {
|
|
41
40
|
margin-left: 48px;
|
|
42
41
|
}
|
|
43
42
|
@media (min-width: 769px) {
|
|
44
|
-
.pc-scroller-
|
|
43
|
+
.pc-scroller-block__content .pc-scroller-block__item:first-child {
|
|
45
44
|
margin-left: var(--scroller-edge-margin);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
.pc-scroller-
|
|
47
|
+
.pc-scroller-block__content .pc-scroller-block__item:last-child {
|
|
49
48
|
margin-right: 48px;
|
|
50
49
|
}
|
|
51
50
|
@media (min-width: 769px) {
|
|
52
|
-
.pc-scroller-
|
|
51
|
+
.pc-scroller-block__content .pc-scroller-block__item:last-child {
|
|
53
52
|
margin-right: var(--scroller-edge-margin);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
55
|
+
.pc-scroller-block__content_scroll-snap-center {
|
|
56
|
+
scroll-snap-type: x mandatory;
|
|
57
|
+
}
|
|
58
|
+
.pc-scroller-block__content_scroll-snap-center .pc-scroller-block__item {
|
|
59
|
+
scroll-snap-align: center;
|
|
60
|
+
}
|
|
56
61
|
.pc-scroller-block__item {
|
|
57
62
|
position: relative;
|
|
58
63
|
z-index: 1;
|