@cntrl-site/sdk-nextjs 1.8.38-1 → 1.8.39
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.
|
@@ -31,12 +31,11 @@ const ComponentItem = ({ item, sectionId, onResize, interactionCtrl }) => {
|
|
|
31
31
|
const blur = (0, getStyleFromItemStateAndParams_1.getStyleFromItemStateAndParams)((_c = stateParams === null || stateParams === void 0 ? void 0 : stateParams.styles) === null || _c === void 0 ? void 0 : _c.blur, itemBlur);
|
|
32
32
|
const Element = component ? component.element : undefined;
|
|
33
33
|
const parameters = layout ? item.layoutParams[layout].parameters : undefined;
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `custom-component-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), { transition: (_d = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _d !== void 0 ? _d : 'none' }), children: parameters && Element && ((0, jsx_runtime_1.jsx)(Element, Object.assign({ content: item.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: item.id, children: `
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `custom-component-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset', transition: (_d = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _d !== void 0 ? _d : 'none' }), children: parameters && Element && ((0, jsx_runtime_1.jsx)(Element, Object.assign({ content: item.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: item.id, children: `
|
|
35
35
|
.custom-component-${item.id} {
|
|
36
36
|
width: 100%;
|
|
37
37
|
height: 100%;
|
|
38
38
|
pointer-events: auto;
|
|
39
|
-
will-change: transform;
|
|
40
39
|
}
|
|
41
40
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
|
|
42
41
|
return (`
|
|
@@ -44,6 +43,7 @@ const ComponentItem = ({ item, sectionId, onResize, interactionCtrl }) => {
|
|
|
44
43
|
transform: rotate(${area.angle}deg);
|
|
45
44
|
opacity: ${layoutParams.opacity};
|
|
46
45
|
filter: blur(${layoutParams.blur}vw);
|
|
46
|
+
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
47
47
|
}
|
|
48
48
|
`);
|
|
49
49
|
})}` })] }));
|
|
@@ -76,7 +76,7 @@ const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibili
|
|
|
76
76
|
vimeoPlayer.on('ended', () => {
|
|
77
77
|
setIsCoverVisible(true);
|
|
78
78
|
});
|
|
79
|
-
}, [vimeoPlayer, imgRef]);
|
|
79
|
+
}, [vimeoPlayer, imgRef, layoutParams]);
|
|
80
80
|
const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
81
|
if (!vimeoPlayer)
|
|
82
82
|
return;
|
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ export const ComponentItem: FC<ItemProps<TComponentItem>> = ({ item, sectionId,
|
|
|
34
34
|
...(opacity !== undefined ? { opacity } : {}),
|
|
35
35
|
...(angle !== undefined ? { transform: `rotate(${angle}deg)` } : {}),
|
|
36
36
|
...(blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {}),
|
|
37
|
+
willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset',
|
|
37
38
|
transition: stateParams?.transition ?? 'none'
|
|
38
39
|
}}
|
|
39
40
|
>
|
|
@@ -49,7 +50,6 @@ export const ComponentItem: FC<ItemProps<TComponentItem>> = ({ item, sectionId,
|
|
|
49
50
|
width: 100%;
|
|
50
51
|
height: 100%;
|
|
51
52
|
pointer-events: auto;
|
|
52
|
-
will-change: transform;
|
|
53
53
|
}
|
|
54
54
|
${getLayoutStyles(layouts, layoutValues, ([area, layoutParams]) => {
|
|
55
55
|
return (`
|
|
@@ -57,6 +57,7 @@ export const ComponentItem: FC<ItemProps<TComponentItem>> = ({ item, sectionId,
|
|
|
57
57
|
transform: rotate(${area.angle}deg);
|
|
58
58
|
opacity: ${layoutParams.opacity};
|
|
59
59
|
filter: blur(${layoutParams.blur}vw);
|
|
60
|
+
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
60
61
|
}
|
|
61
62
|
`);
|
|
62
63
|
})}`}
|
|
@@ -66,7 +66,7 @@ export const VimeoEmbedItem: FC<ItemProps<TVimeoEmbedItem>> = ({ item, sectionId
|
|
|
66
66
|
vimeoPlayer.on('ended', () => {
|
|
67
67
|
setIsCoverVisible(true);
|
|
68
68
|
});
|
|
69
|
-
}, [vimeoPlayer, imgRef]);
|
|
69
|
+
}, [vimeoPlayer, imgRef, layoutParams]);
|
|
70
70
|
|
|
71
71
|
const handleClick = async () => {
|
|
72
72
|
if (!vimeoPlayer) return;
|