@cntrl-site/sdk-nextjs 1.9.77 → 1.9.79
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/sdk-nextjs.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +21 -21
- package/README.md +4 -4
- package/TODO.md +1 -1
- package/eslint.config.mjs +35 -35
- package/jest.config.js +6 -6
- package/lib/common/useItemFXData.js +5 -5
- package/lib/components/Article.js +5 -5
- package/lib/components/LayoutStyle.js +4 -4
- package/lib/components/Section/Section.js +27 -27
- package/lib/components/StructuredBlockItem/StructuredBlockItem.js +13 -13
- package/lib/components/StructuredBlockItem/StructuredComponent/StructuredComponent.js +12 -12
- package/lib/components/StructuredContent/StructuredContent.js +11 -11
- package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +36 -36
- package/lib/components/items/ComponentItem/ComponentItem.js +13 -13
- package/lib/components/items/CompoundItem/CompoundChild.js +20 -20
- package/lib/components/items/CompoundItem/CompoundItem.js +14 -14
- package/lib/components/items/CustomItem/CustomItem.js +9 -9
- package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +24 -24
- package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +27 -27
- package/lib/components/items/FileItem/ImageItem.js +40 -40
- package/lib/components/items/FileItem/VideoItem.js +64 -64
- package/lib/components/items/GroupItem/GroupItem.js +14 -14
- package/lib/components/items/Item.js +30 -30
- package/lib/components/items/RectangleItem/RectangleItem.js +27 -27
- package/lib/components/items/RichTextItem/RichTextItem.js +22 -22
- package/lib/utils/RichTextConverter/RichTextConverter.js +21 -21
- package/package.json +62 -62
- package/src/ItemGeometry/CSSPropertyNameMap.ts +37 -37
- package/src/ItemGeometry/GenericGeometryController.ts +59 -59
- package/src/ItemGeometry/ItemGeometryContext.ts +4 -4
- package/src/ItemGeometry/ItemGeometryController.ts +22 -22
- package/src/ItemGeometry/ItemGeometryService.ts +34 -34
- package/src/ItemGeometry/RichTextGeometryController.ts +166 -166
- package/src/ItemGeometry/useItemGeometry.ts +25 -25
- package/src/common/useCurrentLayout.ts +52 -52
- package/src/common/useExemplary.ts +9 -9
- package/src/common/useItemFXData.ts +63 -63
- package/src/common/useKeyframeValue.ts +85 -85
- package/src/common/useRegisterResize.ts +16 -16
- package/src/components/Article.tsx +69 -69
- package/src/components/ArticleWrapper.tsx +21 -21
- package/src/components/Head.tsx +95 -95
- package/src/components/LayoutStyle.tsx +21 -21
- package/src/components/Page.tsx +47 -47
- package/src/components/ScrollPlaybackVideo.tsx +75 -75
- package/src/components/Section/Section.tsx +162 -162
- package/src/components/Section/SectionImage.tsx +48 -48
- package/src/components/Section/SectionVideo.tsx +144 -144
- package/src/components/Section/useSectionColor.ts +19 -19
- package/src/components/Section/useSectionHeightMap.ts +19 -19
- package/src/components/StructuredBlockItem/StructuredBlockItem.tsx +69 -69
- package/src/components/StructuredBlockItem/StructuredComponent/StructuredComponent.tsx +66 -66
- package/src/components/StructuredContent/StructuredContent.tsx +42 -42
- package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +148 -148
- package/src/components/items/CodeEmbedItem/useCodeEmbedItem.ts +36 -36
- package/src/components/items/ComponentItem/ComponentItem.tsx +85 -85
- package/src/components/items/ComponentItem/useComponentItem.ts +35 -35
- package/src/components/items/CompoundItem/CompoundChild.tsx +151 -151
- package/src/components/items/CompoundItem/CompoundItem.tsx +88 -88
- package/src/components/items/CompoundItem/useCompoundItem.ts +21 -21
- package/src/components/items/CustomItem/CustomItem.tsx +50 -50
- package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +217 -217
- package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +201 -201
- package/src/components/items/EmbedVideoItem/useEmbedVideoItem.ts +46 -46
- package/src/components/items/FileItem/ImageItem.tsx +166 -166
- package/src/components/items/FileItem/VideoItem.tsx +287 -287
- package/src/components/items/FileItem/useFileItem.ts +81 -81
- package/src/components/items/GroupItem/GroupItem.tsx +99 -99
- package/src/components/items/GroupItem/useGroupItem.ts +34 -34
- package/src/components/items/Item.tsx +268 -268
- package/src/components/items/LinkWrapper.tsx +39 -39
- package/src/components/items/RectangleItem/RectangleItem.tsx +177 -177
- package/src/components/items/RectangleItem/useRectangleItem.ts +89 -89
- package/src/components/items/RichTextItem/RichTextItem.tsx +113 -113
- package/src/components/items/RichTextItem/useRichTextItem.ts +12 -12
- package/src/components/items/RichTextWrapper.tsx +15 -15
- package/src/components/items/itemsMap.ts +28 -28
- package/src/components/items/useDraggable.ts +252 -252
- package/src/components/items/useItemAngle.ts +13 -13
- package/src/components/items/useItemArea.ts +35 -35
- package/src/components/items/useItemPointerEvents.ts +23 -23
- package/src/components/items/useItemScale.ts +17 -17
- package/src/components/items/useItemTriggers.ts +15 -15
- package/src/components/items/useRichTextItemValues.ts +66 -66
- package/src/components/items/useSizing.ts +25 -25
- package/src/components/items/useStickyItemTop.ts +21 -21
- package/src/components/useLayoutContext.ts +7 -7
- package/src/index.ts +25 -25
- package/src/interactions/InteractionsRegistry.ts +513 -513
- package/src/interactions/ItemInteractionCtrl.ts +78 -78
- package/src/interactions/getTransition.ts +27 -27
- package/src/interactions/types.ts +36 -36
- package/src/interactions/useItemInteractionCtrl.ts +18 -18
- package/src/provider/ArticleRectContext.ts +4 -4
- package/src/provider/CntrlContext.ts +5 -5
- package/src/provider/CntrlProvider.tsx +11 -11
- package/src/provider/CntrlSdkContext.ts +113 -113
- package/src/provider/CustomItemRegistry.ts +14 -14
- package/src/provider/CustomItemTypes.ts +3 -3
- package/src/provider/CustomSectionRegistry.ts +25 -25
- package/src/provider/InteractionsContext.tsx +73 -73
- package/src/provider/Keyframes.ts +11 -11
- package/src/provider/KeyframesContext.ts +5 -5
- package/src/provider/LayoutContext.ts +3 -3
- package/src/provider/WebGLContextManagerContext.tsx +4 -4
- package/src/provider/defaultContext.ts +8 -8
- package/src/provider/useCntrlContext.ts +8 -8
- package/src/styled-jsx.d.ts +1 -1
- package/src/types/components-utils.d.ts +7 -7
- package/src/utils/Animator/Animator.ts +570 -570
- package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
- package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
- package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
- package/src/utils/CSSNumeric.ts +19 -19
- package/src/utils/EventEmitter.ts +41 -41
- package/src/utils/RichTextConverter/RichTextConverter.tsx +342 -342
- package/src/utils/ScaleAnchorMap.ts +13 -13
- package/src/utils/StickyManager/StickyManager.ts +23 -23
- package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
- package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
- package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
- package/src/utils/areFillsVisible/areFillsVisible.test.ts +63 -63
- package/src/utils/areFillsVisible/areFillsVisible.ts +37 -37
- package/src/utils/binSearchInsertAt.ts +33 -33
- package/src/utils/castObject.ts +10 -10
- package/src/utils/checkOverflowClipSupport.ts +13 -13
- package/src/utils/domDfs.ts +11 -11
- package/src/utils/effects/useImageFx.ts +154 -154
- package/src/utils/effects/useVideoFx.ts +156 -156
- package/src/utils/evaluateComponentBundle.ts +83 -83
- package/src/utils/getAnchoredItemTop.ts +12 -12
- package/src/utils/getCompoundBoundaryStyles.ts +60 -60
- package/src/utils/getFill.ts +46 -46
- package/src/utils/getFontFamilyValue.ts +3 -3
- package/src/utils/getInvertedRanges.ts +43 -43
- package/src/utils/getItemTopStyle.ts +39 -39
- package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
- package/src/utils/getValidYoutubeUrl.ts +29 -29
- package/src/utils/isItemType.ts +5 -5
- package/src/utils/rangeMap.ts +13 -13
- package/src/utils/useElementRect.ts +23 -23
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/sdk-nextjs.iml" filepath="$PROJECT_DIR$/.idea/sdk-nextjs.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 CNTRL
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 CNTRL
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# sdk-nextjs
|
|
2
|
-
SDK is the code that transforms the raw data from the API
|
|
3
|
-
into React components. In Control this happens at build time,
|
|
4
|
-
when users hit the "Publish" button from the Project Dashboard.
|
|
1
|
+
# sdk-nextjs
|
|
2
|
+
SDK is the code that transforms the raw data from the API
|
|
3
|
+
into React components. In Control this happens at build time,
|
|
4
|
+
when users hit the "Publish" button from the Project Dashboard.
|
package/TODO.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1. Uninstall `@types/isomorphic-fetch` package and run `npm run build` - results in a TS compile error
|
|
1
|
+
1. Uninstall `@types/isomorphic-fetch` package and run `npm run build` - results in a TS compile error
|
package/eslint.config.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import antfu from '@antfu/eslint-config';
|
|
2
|
-
|
|
3
|
-
export default antfu(
|
|
4
|
-
{
|
|
5
|
-
ignores: [],
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
rules: {
|
|
9
|
-
'import/order': 'off',
|
|
10
|
-
'style/semi': 'off',
|
|
11
|
-
'antfu/if-newline': 'off',
|
|
12
|
-
'style/comma-dangle': 'off',
|
|
13
|
-
'style/member-delimiter-style': 'off',
|
|
14
|
-
'semi': ['error', 'always'],
|
|
15
|
-
'no-alert': 'off',
|
|
16
|
-
'ts/consistent-type-definitions': 'off',
|
|
17
|
-
'perfectionist/sort-imports': 'off',
|
|
18
|
-
'perfectionist/sort-named-imports': 'off',
|
|
19
|
-
'ts/consistent-type-imports': 'off',
|
|
20
|
-
'jsonc/sort-keys': 'off',
|
|
21
|
-
'node/prefer-global/process': 'off',
|
|
22
|
-
'style/arrow-parens': 'off',
|
|
23
|
-
'ts/method-signature-style': 'off',
|
|
24
|
-
'style/brace-style': 'off',
|
|
25
|
-
'style/jsx-one-expression-per-line': 'off',
|
|
26
|
-
'test/prefer-lowercase-title': 'off',
|
|
27
|
-
'perfectionist/sort-exports': 'off',
|
|
28
|
-
'no-extra-boolean-cast': 'off',
|
|
29
|
-
'prefer-promise-reject-errors': 'off',
|
|
30
|
-
'new-cap': 'off',
|
|
31
|
-
'perfectionist/sort-named-exports': 'off',
|
|
32
|
-
'style/multiline-ternary': 'off'
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
);
|
|
1
|
+
import antfu from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
export default antfu(
|
|
4
|
+
{
|
|
5
|
+
ignores: [],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
'import/order': 'off',
|
|
10
|
+
'style/semi': 'off',
|
|
11
|
+
'antfu/if-newline': 'off',
|
|
12
|
+
'style/comma-dangle': 'off',
|
|
13
|
+
'style/member-delimiter-style': 'off',
|
|
14
|
+
'semi': ['error', 'always'],
|
|
15
|
+
'no-alert': 'off',
|
|
16
|
+
'ts/consistent-type-definitions': 'off',
|
|
17
|
+
'perfectionist/sort-imports': 'off',
|
|
18
|
+
'perfectionist/sort-named-imports': 'off',
|
|
19
|
+
'ts/consistent-type-imports': 'off',
|
|
20
|
+
'jsonc/sort-keys': 'off',
|
|
21
|
+
'node/prefer-global/process': 'off',
|
|
22
|
+
'style/arrow-parens': 'off',
|
|
23
|
+
'ts/method-signature-style': 'off',
|
|
24
|
+
'style/brace-style': 'off',
|
|
25
|
+
'style/jsx-one-expression-per-line': 'off',
|
|
26
|
+
'test/prefer-lowercase-title': 'off',
|
|
27
|
+
'perfectionist/sort-exports': 'off',
|
|
28
|
+
'no-extra-boolean-cast': 'off',
|
|
29
|
+
'prefer-promise-reject-errors': 'off',
|
|
30
|
+
'new-cap': 'off',
|
|
31
|
+
'perfectionist/sort-named-exports': 'off',
|
|
32
|
+
'style/multiline-ternary': 'off'
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
package/jest.config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
preset: 'ts-jest',
|
|
4
|
-
testEnvironment: 'jsdom',
|
|
5
|
-
rootDir: './src'
|
|
6
|
-
};
|
|
1
|
+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
preset: 'ts-jest',
|
|
4
|
+
testEnvironment: 'jsdom',
|
|
5
|
+
rootDir: './src'
|
|
6
|
+
};
|
|
@@ -4,11 +4,11 @@ exports.useItemFXData = void 0;
|
|
|
4
4
|
const sdk_1 = require("@cntrl-site/sdk");
|
|
5
5
|
const useKeyframeValue_1 = require("./useKeyframeValue");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const baseVariables = `precision mediump float;
|
|
8
|
-
uniform sampler2D u_image;
|
|
9
|
-
uniform vec2 u_imgDimensions;
|
|
10
|
-
uniform float u_time;
|
|
11
|
-
uniform vec2 u_cursor;
|
|
7
|
+
const baseVariables = `precision mediump float;
|
|
8
|
+
uniform sampler2D u_image;
|
|
9
|
+
uniform vec2 u_imgDimensions;
|
|
10
|
+
uniform float u_time;
|
|
11
|
+
uniform vec2 u_cursor;
|
|
12
12
|
varying vec2 v_texCoord;`;
|
|
13
13
|
function useItemFXData(item, sectionId) {
|
|
14
14
|
const { fragmentShader: shaderBody, FXControls, FXTextures } = item.commonParams;
|
|
@@ -31,11 +31,11 @@ const Article = ({ article, sectionData }) => {
|
|
|
31
31
|
return ((0, jsx_runtime_1.jsx)(ArticleRectContext_1.ArticleRectContext.Provider, { value: articleRectObserver, children: (0, jsx_runtime_1.jsxs)(InteractionsContext_1.InteractionsProvider, { article: article, children: [(0, jsx_runtime_1.jsx)(ArticleWrapper_1.ArticleWrapper, { children: (0, jsx_runtime_1.jsxs)("div", { className: "article", ref: articleRef, children: [(0, jsx_runtime_1.jsx)(WebGLContextManagerContext_1.WebglContextManagerContext.Provider, { value: webglContextManager, children: article.sections.map((section, i) => {
|
|
32
32
|
const data = section.name ? sectionData[section.name] : {};
|
|
33
33
|
return ((0, jsx_runtime_1.jsx)(Section_1.Section, { articleHeight: articleHeight, section: section, data: data, zIndex: sectionsLength - i }, section.id));
|
|
34
|
-
}) }), (0, jsx_runtime_1.jsx)("div", { id: "component-portal" }), (0, jsx_runtime_1.jsx)("div", { id: "grid-component-lightbox-portal" })] }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
35
|
-
.article {
|
|
36
|
-
position: relative;
|
|
37
|
-
overflow: clip;
|
|
38
|
-
}
|
|
34
|
+
}) }), (0, jsx_runtime_1.jsx)("div", { id: "component-portal" }), (0, jsx_runtime_1.jsx)("div", { id: "grid-component-lightbox-portal" })] }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
35
|
+
.article {
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: clip;
|
|
38
|
+
}
|
|
39
39
|
` })] }) }));
|
|
40
40
|
};
|
|
41
41
|
exports.Article = Article;
|
|
@@ -9,10 +9,10 @@ const sdk_1 = require("@cntrl-site/sdk");
|
|
|
9
9
|
const style_1 = __importDefault(require("styled-jsx/style"));
|
|
10
10
|
const LayoutStyle = ({ id, layouts, layoutId, children }) => {
|
|
11
11
|
const layout = layouts.find(l => l.id === layoutId);
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
13
|
-
${(0, sdk_1.getLayoutMediaQuery)(layoutId, layouts)} {
|
|
14
|
-
${children === null || children === void 0 ? void 0 : children(layout)}
|
|
15
|
-
}
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
13
|
+
${(0, sdk_1.getLayoutMediaQuery)(layoutId, layouts)} {
|
|
14
|
+
${children === null || children === void 0 ? void 0 : children(layout)}
|
|
15
|
+
}
|
|
16
16
|
` }));
|
|
17
17
|
};
|
|
18
18
|
exports.LayoutStyle = LayoutStyle;
|
|
@@ -45,12 +45,12 @@ const Section = ({ section, data, zIndex, articleHeight }) => {
|
|
|
45
45
|
.sort((a, b) => a.startsWith - b.startsWith)
|
|
46
46
|
.reduce((acc, layout) => {
|
|
47
47
|
const isHidden = section.hidden[layout.id];
|
|
48
|
-
return `
|
|
49
|
-
${acc}
|
|
50
|
-
${(0, sdk_1.getLayoutMediaQuery)(layout.id, layouts)} {
|
|
51
|
-
.section-${section.id} {
|
|
52
|
-
display: ${isHidden ? 'none' : 'block'};
|
|
53
|
-
}
|
|
48
|
+
return `
|
|
49
|
+
${acc}
|
|
50
|
+
${(0, sdk_1.getLayoutMediaQuery)(layout.id, layouts)} {
|
|
51
|
+
.section-${section.id} {
|
|
52
|
+
display: ${isHidden ? 'none' : 'block'};
|
|
53
|
+
}
|
|
54
54
|
}`;
|
|
55
55
|
}, '');
|
|
56
56
|
};
|
|
@@ -68,27 +68,27 @@ const Section = ({ section, data, zIndex, articleHeight }) => {
|
|
|
68
68
|
const children = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StructuredContent_1.StructuredContent, { section: section }), section.items.map(item => ((0, jsx_runtime_1.jsx)(Item_1.Item, { sectionHeight: sectionHeight, item: item, sectionId: section.id, articleHeight: articleHeight }, item.id)))] }));
|
|
69
69
|
if (SectionComponent)
|
|
70
70
|
return (0, jsx_runtime_1.jsx)("div", { ref: sectionRef, children: (0, jsx_runtime_1.jsx)(SectionComponent, { data: data, children: children }) });
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: `section-${section.id}`, id: section.name, ref: sectionRef, style: { zIndex }, children: [media && media.size !== 'none' && sectionRef.current && ((0, jsx_runtime_1.jsx)("div", { className: `section-background-overlay-${section.id}`, children: (0, jsx_runtime_1.jsxs)("div", { className: `section-background-wrapper-${section.id}`, style: Object.assign({ transform: media.position === 'fixed' ? 'translateY(-100vh)' : 'unset' }, (sectionHeight && { height: media.position === 'fixed' ? `calc(${sectionHeight}px + 200vh)` : `${sectionHeight}px` })), children: [media.type === 'video' && ((0, jsx_runtime_1.jsx)(SectionVideo_1.SectionVideo, { container: sectionRef.current, sectionId: section.id, media: media })), media.type === 'image' && ((0, jsx_runtime_1.jsx)(SectionImage_1.SectionImage, { media: media, sectionId: section.id }))] }, `section-background-wrapper-${section.id}`) })), children] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
72
|
-
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([height, color, media]) => (`
|
|
73
|
-
.section-${section.id} {
|
|
74
|
-
min-height: ${getSectionHeight(height)};
|
|
75
|
-
position: relative;
|
|
76
|
-
background-color: ${color_1.CntrlColor.parse(color !== null && color !== void 0 ? color : DEFAULT_COLOR).fmt('rgba')};
|
|
77
|
-
}
|
|
78
|
-
.section-background-overlay-${section.id} {
|
|
79
|
-
height: 100%;
|
|
80
|
-
width: 100%;
|
|
81
|
-
position: absolute;
|
|
82
|
-
overflow: clip;
|
|
83
|
-
}
|
|
84
|
-
.section-background-wrapper-${section.id} {
|
|
85
|
-
transform: ${(media === null || media === void 0 ? void 0 : media.position) === 'fixed' ? 'translateY(-100vh)' : 'unset'};
|
|
86
|
-
position: relative;
|
|
87
|
-
height: ${(media === null || media === void 0 ? void 0 : media.position) === 'fixed' ? `calc(${getSectionHeight(height)} + 200vh)` : getSectionHeight(height)};
|
|
88
|
-
width: 100%;
|
|
89
|
-
}
|
|
90
|
-
`))}
|
|
91
|
-
${getSectionVisibilityStyles()}
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: `section-${section.id}`, id: section.name, ref: sectionRef, style: { zIndex }, children: [media && media.size !== 'none' && sectionRef.current && ((0, jsx_runtime_1.jsx)("div", { className: `section-background-overlay-${section.id}`, children: (0, jsx_runtime_1.jsxs)("div", { className: `section-background-wrapper-${section.id}`, style: Object.assign({ transform: media.position === 'fixed' ? 'translateY(-100vh)' : 'unset' }, (sectionHeight && { height: media.position === 'fixed' ? `calc(${sectionHeight}px + 200vh)` : `${sectionHeight}px` })), children: [media.type === 'video' && ((0, jsx_runtime_1.jsx)(SectionVideo_1.SectionVideo, { container: sectionRef.current, sectionId: section.id, media: media })), media.type === 'image' && ((0, jsx_runtime_1.jsx)(SectionImage_1.SectionImage, { media: media, sectionId: section.id }))] }, `section-background-wrapper-${section.id}`) })), children] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
72
|
+
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([height, color, media]) => (`
|
|
73
|
+
.section-${section.id} {
|
|
74
|
+
min-height: ${getSectionHeight(height)};
|
|
75
|
+
position: relative;
|
|
76
|
+
background-color: ${color_1.CntrlColor.parse(color !== null && color !== void 0 ? color : DEFAULT_COLOR).fmt('rgba')};
|
|
77
|
+
}
|
|
78
|
+
.section-background-overlay-${section.id} {
|
|
79
|
+
height: 100%;
|
|
80
|
+
width: 100%;
|
|
81
|
+
position: absolute;
|
|
82
|
+
overflow: clip;
|
|
83
|
+
}
|
|
84
|
+
.section-background-wrapper-${section.id} {
|
|
85
|
+
transform: ${(media === null || media === void 0 ? void 0 : media.position) === 'fixed' ? 'translateY(-100vh)' : 'unset'};
|
|
86
|
+
position: relative;
|
|
87
|
+
height: ${(media === null || media === void 0 ? void 0 : media.position) === 'fixed' ? `calc(${getSectionHeight(height)} + 200vh)` : getSectionHeight(height)};
|
|
88
|
+
width: 100%;
|
|
89
|
+
}
|
|
90
|
+
`))}
|
|
91
|
+
${getSectionVisibilityStyles()}
|
|
92
92
|
` })] }));
|
|
93
93
|
};
|
|
94
94
|
exports.Section = Section;
|
|
@@ -26,23 +26,23 @@ const StructuredBlockItem = ({ block, maxWidthMap }) => {
|
|
|
26
26
|
const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
|
|
27
27
|
const layoutValues = [block.area, block.layoutParams, (_a = block.hidden) !== null && _a !== void 0 ? _a : {}, maxWidthMap];
|
|
28
28
|
const ItemComponent = itemsMap[block.type] || noop;
|
|
29
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: `structured-block-item-${block.id}`, children: [(0, jsx_runtime_1.jsx)(ItemComponent, { block: block }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `structured-block-item-${block.id}`, children: [(0, jsx_runtime_1.jsx)(ItemComponent, { block: block }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
30
30
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams, hidden, maxWidth]) => {
|
|
31
31
|
var _a, _b;
|
|
32
32
|
const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
|
|
33
|
-
return (`
|
|
34
|
-
.structured-block-item-${block.id} {
|
|
35
|
-
display: ${hidden ? 'none' : 'block'};
|
|
36
|
-
align-self: ${getAlignSelf((_a = area.alignment) !== null && _a !== void 0 ? _a : 'center')};
|
|
37
|
-
width: ${sizingAxis.x === 'manual' && area.width ? `${area.width * 100}vw` : maxWidth !== null && maxWidth !== void 0 ? maxWidth : 'max-content'};
|
|
38
|
-
height: ${sizingAxis.y === 'manual' && area.height ? `${area.height * 100}vw` : 'unset'};
|
|
39
|
-
padding-top: ${area.paddingTop ? `${area.paddingTop * 100}vw` : 'unset'};
|
|
40
|
-
outline: none;
|
|
41
|
-
left: ${((_b = area.horizontalOffset) !== null && _b !== void 0 ? _b : 0) * 100}vw;
|
|
42
|
-
position: relative;
|
|
43
|
-
}
|
|
33
|
+
return (`
|
|
34
|
+
.structured-block-item-${block.id} {
|
|
35
|
+
display: ${hidden ? 'none' : 'block'};
|
|
36
|
+
align-self: ${getAlignSelf((_a = area.alignment) !== null && _a !== void 0 ? _a : 'center')};
|
|
37
|
+
width: ${sizingAxis.x === 'manual' && area.width ? `${area.width * 100}vw` : maxWidth !== null && maxWidth !== void 0 ? maxWidth : 'max-content'};
|
|
38
|
+
height: ${sizingAxis.y === 'manual' && area.height ? `${area.height * 100}vw` : 'unset'};
|
|
39
|
+
padding-top: ${area.paddingTop ? `${area.paddingTop * 100}vw` : 'unset'};
|
|
40
|
+
outline: none;
|
|
41
|
+
left: ${((_b = area.horizontalOffset) !== null && _b !== void 0 ? _b : 0) * 100}vw;
|
|
42
|
+
position: relative;
|
|
43
|
+
}
|
|
44
44
|
`);
|
|
45
|
-
})}
|
|
45
|
+
})}
|
|
46
46
|
` })] }));
|
|
47
47
|
};
|
|
48
48
|
exports.StructuredBlockItem = StructuredBlockItem;
|
|
@@ -29,19 +29,19 @@ const StructuredComponent = ({ block }) => {
|
|
|
29
29
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `custom-component-${block.id}`, ref: setRef, children: parameters && Element && ((0, jsx_runtime_1.jsx)(Element, Object.assign({ metadata: {
|
|
30
30
|
itemId: block.id,
|
|
31
31
|
submitUrl: sdk.getSubmitUrl(commonParameters === null || commonParameters === void 0 ? void 0 : commonParameters.pluginConfigId)
|
|
32
|
-
}, portalId: "component-portal", content: block.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: block.id, children: `
|
|
33
|
-
.custom-component-${block.id} {
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: 100%;
|
|
36
|
-
pointer-events: auto;
|
|
37
|
-
}
|
|
32
|
+
}, portalId: "component-portal", content: block.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: block.id, children: `
|
|
33
|
+
.custom-component-${block.id} {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
pointer-events: auto;
|
|
37
|
+
}
|
|
38
38
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([layoutParams]) => {
|
|
39
|
-
return (`
|
|
40
|
-
.custom-component-${block.id} {
|
|
41
|
-
opacity: ${layoutParams.opacity};
|
|
42
|
-
filter: blur(${layoutParams.blur}vw);
|
|
43
|
-
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
44
|
-
}
|
|
39
|
+
return (`
|
|
40
|
+
.custom-component-${block.id} {
|
|
41
|
+
opacity: ${layoutParams.opacity};
|
|
42
|
+
filter: blur(${layoutParams.blur}vw);
|
|
43
|
+
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
44
|
+
}
|
|
45
45
|
`);
|
|
46
46
|
})}` })] }));
|
|
47
47
|
};
|
|
@@ -19,19 +19,19 @@ const StructuredContent = ({ section }) => {
|
|
|
19
19
|
const layoutValues = [section.structuredContentSettings.paddingBottom, defaultWidthRecord];
|
|
20
20
|
if (structuredContentLength === 0)
|
|
21
21
|
return null;
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: `structured-content-${section.id}`, children: [section.structuredContent.map(block => ((0, jsx_runtime_1.jsx)(StructuredBlockItem_1.StructuredBlockItem, { block: block, maxWidthMap: defaultWidthRecord }, block.id))), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `structured-content-${section.id}`, children: [section.structuredContent.map(block => ((0, jsx_runtime_1.jsx)(StructuredBlockItem_1.StructuredBlockItem, { block: block, maxWidthMap: defaultWidthRecord }, block.id))), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
23
23
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([paddingBottom, defaultWidth]) => {
|
|
24
|
-
return (`
|
|
25
|
-
.structured-content-${section.id} {
|
|
26
|
-
padding-bottom: ${paddingBottom * 100}vw;
|
|
27
|
-
max-width: ${defaultWidth < 1 ? `${defaultWidth * 100}vw` : 'unset'};
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
margin: 0 auto;
|
|
31
|
-
width: 100%;
|
|
32
|
-
}
|
|
24
|
+
return (`
|
|
25
|
+
.structured-content-${section.id} {
|
|
26
|
+
padding-bottom: ${paddingBottom * 100}vw;
|
|
27
|
+
max-width: ${defaultWidth < 1 ? `${defaultWidth * 100}vw` : 'unset'};
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
margin: 0 auto;
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
33
|
`);
|
|
34
|
-
})}
|
|
34
|
+
})}
|
|
35
35
|
` })] }));
|
|
36
36
|
};
|
|
37
37
|
exports.StructuredContent = StructuredContent;
|
|
@@ -65,18 +65,18 @@ const CodeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
|
|
|
65
65
|
const iframe = ref.querySelector(`[data-embed="${item.id}"]`);
|
|
66
66
|
if (!iframe)
|
|
67
67
|
return;
|
|
68
|
-
const htmlWithStyles = `
|
|
69
|
-
${fontGoogleTags}
|
|
70
|
-
${fontAdobeTags}
|
|
71
|
-
<style>
|
|
72
|
-
${fontCustomTags}
|
|
73
|
-
html, body {
|
|
74
|
-
height: 100%;
|
|
75
|
-
margin: 0 !important;
|
|
76
|
-
padding: 0 !important;
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
79
|
-
${html}
|
|
68
|
+
const htmlWithStyles = `
|
|
69
|
+
${fontGoogleTags}
|
|
70
|
+
${fontAdobeTags}
|
|
71
|
+
<style>
|
|
72
|
+
${fontCustomTags}
|
|
73
|
+
html, body {
|
|
74
|
+
height: 100%;
|
|
75
|
+
margin: 0 !important;
|
|
76
|
+
padding: 0 !important;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
${html}
|
|
80
80
|
`;
|
|
81
81
|
iframe.srcdoc = htmlWithStyles;
|
|
82
82
|
}, [html, item.commonParams.iframe, ref]);
|
|
@@ -84,32 +84,32 @@ const CodeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
|
|
|
84
84
|
(0, react_1.useEffect)(() => {
|
|
85
85
|
onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(isInteractive);
|
|
86
86
|
}, [isInteractive, onVisibilityChange]);
|
|
87
|
-
return ((0, jsx_runtime_1.jsxs)(LinkWrapper_1.LinkWrapper, { url: (_h = item.link) === null || _h === void 0 ? void 0 : _h.url, target: (_j = item.link) === null || _j === void 0 ? void 0 : _j.target, children: [(0, jsx_runtime_1.jsx)("div", { className: `embed-wrapper-${item.id}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), (opacity !== undefined ? { opacity } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset', transition: (_k = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _k !== void 0 ? _k : 'none' }), ref: setRef, children: item.commonParams.iframe ? ((0, jsx_runtime_1.jsx)("iframe", { "data-embed": item.id, className: `embed-${item.id}`, style: Object.assign(Object.assign({}, pos), { border: 'unset' }) })) : ((0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, style: Object.assign({}, pos), dangerouslySetInnerHTML: { __html: html } })) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
88
|
-
.embed-wrapper-${item.id} {
|
|
89
|
-
position: absolute;
|
|
90
|
-
width: 100%;
|
|
91
|
-
height: 100%;
|
|
92
|
-
}
|
|
93
|
-
.embed-${item.id} {
|
|
94
|
-
transform: ${item.commonParams.scale ? 'scale(var(--layout-deviation))' : 'none'};
|
|
95
|
-
transform-origin: top left;
|
|
96
|
-
z-index: 1;
|
|
97
|
-
border: none;
|
|
98
|
-
}
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(LinkWrapper_1.LinkWrapper, { url: (_h = item.link) === null || _h === void 0 ? void 0 : _h.url, target: (_j = item.link) === null || _j === void 0 ? void 0 : _j.target, children: [(0, jsx_runtime_1.jsx)("div", { className: `embed-wrapper-${item.id}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), (opacity !== undefined ? { opacity } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset', transition: (_k = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _k !== void 0 ? _k : 'none' }), ref: setRef, children: item.commonParams.iframe ? ((0, jsx_runtime_1.jsx)("iframe", { "data-embed": item.id, className: `embed-${item.id}`, style: Object.assign(Object.assign({}, pos), { border: 'unset' }) })) : ((0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, style: Object.assign({}, pos), dangerouslySetInnerHTML: { __html: html } })) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
88
|
+
.embed-wrapper-${item.id} {
|
|
89
|
+
position: absolute;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
93
|
+
.embed-${item.id} {
|
|
94
|
+
transform: ${item.commonParams.scale ? 'scale(var(--layout-deviation))' : 'none'};
|
|
95
|
+
transform-origin: top left;
|
|
96
|
+
z-index: 1;
|
|
97
|
+
border: none;
|
|
98
|
+
}
|
|
99
99
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams], exemplary) => {
|
|
100
|
-
return (`
|
|
101
|
-
.embed-wrapper-${item.id} {
|
|
102
|
-
opacity: ${layoutParams.opacity};
|
|
103
|
-
transform: rotate(${area.angle}deg);
|
|
104
|
-
filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
|
|
105
|
-
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
106
|
-
}
|
|
107
|
-
.embed-${item.id} {
|
|
108
|
-
width: ${item.commonParams.scale ? `${area.width * exemplary}px` : '100%'};
|
|
109
|
-
height: ${item.commonParams.scale ? `${area.height * exemplary}px` : '100%'};
|
|
110
|
-
}
|
|
100
|
+
return (`
|
|
101
|
+
.embed-wrapper-${item.id} {
|
|
102
|
+
opacity: ${layoutParams.opacity};
|
|
103
|
+
transform: rotate(${area.angle}deg);
|
|
104
|
+
filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
|
|
105
|
+
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
106
|
+
}
|
|
107
|
+
.embed-${item.id} {
|
|
108
|
+
width: ${item.commonParams.scale ? `${area.width * exemplary}px` : '100%'};
|
|
109
|
+
height: ${item.commonParams.scale ? `${area.height * exemplary}px` : '100%'};
|
|
110
|
+
}
|
|
111
111
|
`);
|
|
112
|
-
})}
|
|
112
|
+
})}
|
|
113
113
|
` })] }));
|
|
114
114
|
};
|
|
115
115
|
exports.CodeEmbedItem = CodeEmbedItem;
|
|
@@ -42,20 +42,20 @@ const ComponentItem = ({ item, sectionId, onResize, interactionCtrl }) => {
|
|
|
42
42
|
: layout == null ? { opacity: 0 } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset', transition: (_f = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _f !== void 0 ? _f : 'none' }), children: parameters && Element && ((0, jsx_runtime_1.jsx)(Element, Object.assign({ metadata: {
|
|
43
43
|
itemId: item.id,
|
|
44
44
|
submitUrl: sdk.getSubmitUrl(commonParameters === null || commonParameters === void 0 ? void 0 : commonParameters.pluginConfigId)
|
|
45
|
-
}, portalId: "component-portal", content: item.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: item.id, children: `
|
|
46
|
-
.custom-component-${item.id} {
|
|
47
|
-
width: 100%;
|
|
48
|
-
height: 100%;
|
|
49
|
-
pointer-events: auto;
|
|
50
|
-
}
|
|
45
|
+
}, portalId: "component-portal", content: item.commonParams.content }, parameters))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: item.id, children: `
|
|
46
|
+
.custom-component-${item.id} {
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
pointer-events: auto;
|
|
50
|
+
}
|
|
51
51
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
|
|
52
|
-
return (`
|
|
53
|
-
.custom-component-${item.id} {
|
|
54
|
-
transform: rotate(${area.angle}deg);
|
|
55
|
-
opacity: ${layoutParams.opacity};
|
|
56
|
-
filter: blur(${layoutParams.blur}vw);
|
|
57
|
-
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
58
|
-
}
|
|
52
|
+
return (`
|
|
53
|
+
.custom-component-${item.id} {
|
|
54
|
+
transform: rotate(${area.angle}deg);
|
|
55
|
+
opacity: ${layoutParams.opacity};
|
|
56
|
+
filter: blur(${layoutParams.blur}vw);
|
|
57
|
+
${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
|
|
58
|
+
}
|
|
59
59
|
`);
|
|
60
60
|
})}` })] }));
|
|
61
61
|
};
|
|
@@ -71,32 +71,32 @@ const CompoundChild = ({ item, sectionId, isParentVisible = true }) => {
|
|
|
71
71
|
? { height: `${sizingAxis.y === 'manual'
|
|
72
72
|
? (0, getCompoundBoundaryStyles_1.getCompoundHeight)(compoundSettings, height)
|
|
73
73
|
: 'unset'}` }
|
|
74
|
-
: {})), (compoundSettings ? { transform: `${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)}` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none', cursor: hasClickTriggers ? 'pointer' : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none' }) }, triggers, { children: [(0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, style: Object.assign({ transition: (_l = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _l !== void 0 ? _l : 'none' }, (scale !== undefined ? { transform: `scale(${scale})` } : {})), children: (0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, transformOrigin: transformOrigin, children: (0, jsx_runtime_1.jsx)(ItemComponent, { item: item, sectionId: sectionId, interactionCtrl: interactionCtrl, onVisibilityChange: handleVisibilityChange, isInCompound: true }) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
74
|
+
: {})), (compoundSettings ? { transform: `${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)}` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none', cursor: hasClickTriggers ? 'pointer' : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none' }) }, triggers, { children: [(0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, style: Object.assign({ transition: (_l = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _l !== void 0 ? _l : 'none' }, (scale !== undefined ? { transform: `scale(${scale})` } : {})), children: (0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, transformOrigin: transformOrigin, children: (0, jsx_runtime_1.jsx)(ItemComponent, { item: item, sectionId: sectionId, interactionCtrl: interactionCtrl, onVisibilityChange: handleVisibilityChange, isInCompound: true }) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
75
75
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, compoundSettings, layoutParams]) => {
|
|
76
76
|
const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
|
|
77
77
|
const scaleAnchor = area.scaleAnchor;
|
|
78
|
-
return (`
|
|
79
|
-
.item-${item.id}-inner {
|
|
80
|
-
width: 100%;
|
|
81
|
-
height: 100%;
|
|
82
|
-
transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
|
|
83
|
-
transform: scale(${area.scale});
|
|
84
|
-
}
|
|
85
|
-
.item-${item.id} {
|
|
86
|
-
position: absolute;
|
|
87
|
-
top: ${(0, getCompoundBoundaryStyles_1.getCompoundTop)(compoundSettings, area.top)};
|
|
88
|
-
left: ${(0, getCompoundBoundaryStyles_1.getCompoundLeft)(compoundSettings, area.left)};
|
|
89
|
-
transition: opacity 0.2s linear 0.1s;
|
|
90
|
-
display: ${hidden ? 'none' : 'block'};
|
|
78
|
+
return (`
|
|
79
|
+
.item-${item.id}-inner {
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
|
|
83
|
+
transform: scale(${area.scale});
|
|
84
|
+
}
|
|
85
|
+
.item-${item.id} {
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: ${(0, getCompoundBoundaryStyles_1.getCompoundTop)(compoundSettings, area.top)};
|
|
88
|
+
left: ${(0, getCompoundBoundaryStyles_1.getCompoundLeft)(compoundSettings, area.left)};
|
|
89
|
+
transition: opacity 0.2s linear 0.1s;
|
|
90
|
+
display: ${hidden ? 'none' : 'block'};
|
|
91
91
|
width: ${sizingAxis.x === 'manual'
|
|
92
92
|
? `${(0, getCompoundBoundaryStyles_1.getCompoundWidth)(compoundSettings, area.width, isRichText)}`
|
|
93
|
-
: 'max-content'};
|
|
94
|
-
height: ${sizingAxis.y === 'manual' ? `${(0, getCompoundBoundaryStyles_1.getCompoundHeight)(compoundSettings, area.height)}` : 'unset'};
|
|
95
|
-
transform: ${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)};
|
|
96
|
-
z-index: ${area.zIndex};
|
|
97
|
-
}
|
|
93
|
+
: 'max-content'};
|
|
94
|
+
height: ${sizingAxis.y === 'manual' ? `${(0, getCompoundBoundaryStyles_1.getCompoundHeight)(compoundSettings, area.height)}` : 'unset'};
|
|
95
|
+
transform: ${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)};
|
|
96
|
+
z-index: ${area.zIndex};
|
|
97
|
+
}
|
|
98
98
|
`);
|
|
99
|
-
})}
|
|
99
|
+
})}
|
|
100
100
|
` })] })));
|
|
101
101
|
};
|
|
102
102
|
exports.CompoundChild = CompoundChild;
|