@cntrl-site/sdk-nextjs 1.9.78 → 1.9.80

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.
Files changed (145) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/sdk-nextjs.iml +12 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/LICENSE +21 -21
  6. package/README.md +4 -4
  7. package/TODO.md +1 -1
  8. package/eslint.config.mjs +35 -35
  9. package/jest.config.js +6 -6
  10. package/lib/common/useItemFXData.js +5 -5
  11. package/lib/components/Article.js +5 -5
  12. package/lib/components/LayoutStyle.js +4 -4
  13. package/lib/components/Section/Section.js +27 -27
  14. package/lib/components/StructuredBlockItem/StructuredBlockItem.js +13 -13
  15. package/lib/components/StructuredBlockItem/StructuredComponent/StructuredComponent.js +12 -12
  16. package/lib/components/StructuredContent/StructuredContent.js +11 -11
  17. package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +36 -36
  18. package/lib/components/items/ComponentItem/ComponentItem.js +13 -13
  19. package/lib/components/items/CompoundItem/CompoundChild.js +20 -20
  20. package/lib/components/items/CompoundItem/CompoundItem.js +14 -14
  21. package/lib/components/items/CustomItem/CustomItem.js +9 -9
  22. package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +24 -24
  23. package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +27 -27
  24. package/lib/components/items/FileItem/ImageItem.js +40 -40
  25. package/lib/components/items/FileItem/VideoItem.js +64 -64
  26. package/lib/components/items/GroupItem/GroupItem.js +14 -14
  27. package/lib/components/items/Item.js +30 -30
  28. package/lib/components/items/RectangleItem/RectangleItem.js +27 -27
  29. package/lib/components/items/RichTextItem/RichTextItem.js +22 -22
  30. package/lib/utils/RichTextConverter/RichTextConverter.js +21 -21
  31. package/package.json +62 -62
  32. package/src/ItemGeometry/CSSPropertyNameMap.ts +37 -37
  33. package/src/ItemGeometry/GenericGeometryController.ts +59 -59
  34. package/src/ItemGeometry/ItemGeometryContext.ts +4 -4
  35. package/src/ItemGeometry/ItemGeometryController.ts +22 -22
  36. package/src/ItemGeometry/ItemGeometryService.ts +34 -34
  37. package/src/ItemGeometry/RichTextGeometryController.ts +166 -166
  38. package/src/ItemGeometry/useItemGeometry.ts +25 -25
  39. package/src/common/useCurrentLayout.ts +52 -52
  40. package/src/common/useExemplary.ts +9 -9
  41. package/src/common/useItemFXData.ts +63 -63
  42. package/src/common/useKeyframeValue.ts +85 -85
  43. package/src/common/useRegisterResize.ts +16 -16
  44. package/src/components/Article.tsx +69 -69
  45. package/src/components/ArticleWrapper.tsx +21 -21
  46. package/src/components/Head.tsx +95 -95
  47. package/src/components/LayoutStyle.tsx +21 -21
  48. package/src/components/Page.tsx +47 -47
  49. package/src/components/ScrollPlaybackVideo.tsx +75 -75
  50. package/src/components/Section/Section.tsx +162 -162
  51. package/src/components/Section/SectionImage.tsx +48 -48
  52. package/src/components/Section/SectionVideo.tsx +144 -144
  53. package/src/components/Section/useSectionColor.ts +19 -19
  54. package/src/components/Section/useSectionHeightMap.ts +19 -19
  55. package/src/components/StructuredBlockItem/StructuredBlockItem.tsx +69 -69
  56. package/src/components/StructuredBlockItem/StructuredComponent/StructuredComponent.tsx +66 -66
  57. package/src/components/StructuredContent/StructuredContent.tsx +42 -42
  58. package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +148 -148
  59. package/src/components/items/CodeEmbedItem/useCodeEmbedItem.ts +36 -36
  60. package/src/components/items/ComponentItem/ComponentItem.tsx +85 -85
  61. package/src/components/items/ComponentItem/useComponentItem.ts +35 -35
  62. package/src/components/items/CompoundItem/CompoundChild.tsx +151 -151
  63. package/src/components/items/CompoundItem/CompoundItem.tsx +88 -88
  64. package/src/components/items/CompoundItem/useCompoundItem.ts +21 -21
  65. package/src/components/items/CustomItem/CustomItem.tsx +50 -50
  66. package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +217 -217
  67. package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +201 -201
  68. package/src/components/items/EmbedVideoItem/useEmbedVideoItem.ts +46 -46
  69. package/src/components/items/FileItem/ImageItem.tsx +166 -166
  70. package/src/components/items/FileItem/VideoItem.tsx +287 -287
  71. package/src/components/items/FileItem/useFileItem.ts +81 -81
  72. package/src/components/items/GroupItem/GroupItem.tsx +99 -99
  73. package/src/components/items/GroupItem/useGroupItem.ts +34 -34
  74. package/src/components/items/Item.tsx +268 -268
  75. package/src/components/items/LinkWrapper.tsx +39 -39
  76. package/src/components/items/RectangleItem/RectangleItem.tsx +177 -177
  77. package/src/components/items/RectangleItem/useRectangleItem.ts +89 -89
  78. package/src/components/items/RichTextItem/RichTextItem.tsx +113 -113
  79. package/src/components/items/RichTextItem/useRichTextItem.ts +12 -12
  80. package/src/components/items/RichTextWrapper.tsx +15 -15
  81. package/src/components/items/itemsMap.ts +28 -28
  82. package/src/components/items/useDraggable.ts +252 -252
  83. package/src/components/items/useItemAngle.ts +13 -13
  84. package/src/components/items/useItemArea.ts +35 -35
  85. package/src/components/items/useItemPointerEvents.ts +23 -23
  86. package/src/components/items/useItemScale.ts +17 -17
  87. package/src/components/items/useItemTriggers.ts +15 -15
  88. package/src/components/items/useRichTextItemValues.ts +66 -66
  89. package/src/components/items/useSizing.ts +25 -25
  90. package/src/components/items/useStickyItemTop.ts +21 -21
  91. package/src/components/useLayoutContext.ts +7 -7
  92. package/src/index.ts +25 -25
  93. package/src/interactions/InteractionsRegistry.ts +513 -513
  94. package/src/interactions/ItemInteractionCtrl.ts +78 -78
  95. package/src/interactions/getTransition.ts +27 -27
  96. package/src/interactions/types.ts +36 -36
  97. package/src/interactions/useItemInteractionCtrl.ts +18 -18
  98. package/src/provider/ArticleRectContext.ts +4 -4
  99. package/src/provider/CntrlContext.ts +5 -5
  100. package/src/provider/CntrlProvider.tsx +11 -11
  101. package/src/provider/CntrlSdkContext.ts +113 -113
  102. package/src/provider/CustomItemRegistry.ts +14 -14
  103. package/src/provider/CustomItemTypes.ts +3 -3
  104. package/src/provider/CustomSectionRegistry.ts +25 -25
  105. package/src/provider/InteractionsContext.tsx +73 -73
  106. package/src/provider/Keyframes.ts +11 -11
  107. package/src/provider/KeyframesContext.ts +5 -5
  108. package/src/provider/LayoutContext.ts +3 -3
  109. package/src/provider/WebGLContextManagerContext.tsx +4 -4
  110. package/src/provider/defaultContext.ts +8 -8
  111. package/src/provider/useCntrlContext.ts +8 -8
  112. package/src/styled-jsx.d.ts +1 -1
  113. package/src/types/components-utils.d.ts +7 -7
  114. package/src/utils/Animator/Animator.ts +570 -570
  115. package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
  116. package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
  117. package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
  118. package/src/utils/CSSNumeric.ts +19 -19
  119. package/src/utils/EventEmitter.ts +41 -41
  120. package/src/utils/RichTextConverter/RichTextConverter.tsx +342 -342
  121. package/src/utils/ScaleAnchorMap.ts +13 -13
  122. package/src/utils/StickyManager/StickyManager.ts +23 -23
  123. package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
  124. package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
  125. package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
  126. package/src/utils/areFillsVisible/areFillsVisible.test.ts +63 -63
  127. package/src/utils/areFillsVisible/areFillsVisible.ts +37 -37
  128. package/src/utils/binSearchInsertAt.ts +33 -33
  129. package/src/utils/castObject.ts +10 -10
  130. package/src/utils/checkOverflowClipSupport.ts +13 -13
  131. package/src/utils/domDfs.ts +11 -11
  132. package/src/utils/effects/useImageFx.ts +154 -154
  133. package/src/utils/effects/useVideoFx.ts +156 -156
  134. package/src/utils/evaluateComponentBundle.ts +83 -83
  135. package/src/utils/getAnchoredItemTop.ts +12 -12
  136. package/src/utils/getCompoundBoundaryStyles.ts +60 -60
  137. package/src/utils/getFill.ts +46 -46
  138. package/src/utils/getFontFamilyValue.ts +3 -3
  139. package/src/utils/getInvertedRanges.ts +43 -43
  140. package/src/utils/getItemTopStyle.ts +39 -39
  141. package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
  142. package/src/utils/getValidYoutubeUrl.ts +29 -29
  143. package/src/utils/isItemType.ts +5 -5
  144. package/src/utils/rangeMap.ts +13 -13
  145. package/src/utils/useElementRect.ts +23 -23
@@ -50,22 +50,22 @@ const CompoundItem = ({ item, sectionId, onResize, interactionCtrl, onVisibility
50
50
  }
51
51
  }, 0);
52
52
  }, [itemIds, item.id]);
53
- return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_c = item.link) === null || _c === void 0 ? void 0 : _c.url, target: (_d = item.link) === null || _d === void 0 ? void 0 : _d.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `compound-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_e = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _e !== void 0 ? _e : 'none' }), children: items && items.map(item => ((0, jsx_runtime_1.jsx)(CompoundChild_1.CompoundChild, { item: item, sectionId: sectionId, isParentVisible: isInteractive }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
54
- .compound-${item.id} {
55
- overflow: ${item.commonParams.overflow};
56
- position: absolute;
57
- width: 100%;
58
- height: 100%;
59
- box-sizing: border-box;
60
- }
53
+ return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_c = item.link) === null || _c === void 0 ? void 0 : _c.url, target: (_d = item.link) === null || _d === void 0 ? void 0 : _d.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `compound-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_e = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _e !== void 0 ? _e : 'none' }), children: items && items.map(item => ((0, jsx_runtime_1.jsx)(CompoundChild_1.CompoundChild, { item: item, sectionId: sectionId, isParentVisible: isInteractive }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
54
+ .compound-${item.id} {
55
+ overflow: ${item.commonParams.overflow};
56
+ position: absolute;
57
+ width: 100%;
58
+ height: 100%;
59
+ box-sizing: border-box;
60
+ }
61
61
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
62
- return (`
63
- .compound-${item.id} {
64
- opacity: ${layoutParams.opacity};
65
- transform: rotate(${area.angle}deg);
66
- }
62
+ return (`
63
+ .compound-${item.id} {
64
+ opacity: ${layoutParams.opacity};
65
+ transform: rotate(${area.angle}deg);
66
+ }
67
67
  `);
68
- })}
68
+ })}
69
69
  ` })] }) }));
70
70
  };
71
71
  exports.CompoundItem = CompoundItem;
@@ -27,15 +27,15 @@ const CustomItem = ({ item, onResize, sectionId, interactionCtrl }) => {
27
27
  if (!component)
28
28
  return null;
29
29
  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({}, (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_c = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _c !== void 0 ? _c : 'none' }), children: component({}) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: item.id, children: `${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area]) => {
30
- return (`
31
- .custom-component-${item.id} {
32
- transform: rotate(${area.angle}deg);
33
- height: 100%;
34
- width: 100%;
35
- position: absolute;
36
- left: 0;
37
- top: 0;
38
- }
30
+ return (`
31
+ .custom-component-${item.id} {
32
+ transform: rotate(${area.angle}deg);
33
+ height: 100%;
34
+ width: 100%;
35
+ position: absolute;
36
+ left: 0;
37
+ top: 0;
38
+ }
39
39
  `);
40
40
  })}` })] }));
41
41
  };
@@ -150,32 +150,32 @@ const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibili
150
150
  width: '100%',
151
151
  top: '0',
152
152
  left: '0'
153
- } })), (0, jsx_runtime_1.jsx)("iframe", { ref: setIframeRef, className: "embed-video", src: validUrl || '', allow: "autoplay; fullscreen; picture-in-picture;", allowFullScreen: true, style: Object.assign(Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})), { transition: (_j = frameStateParams === null || frameStateParams === void 0 ? void 0 : frameStateParams.transition) !== null && _j !== void 0 ? _j : 'none' }) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
154
- .embed-video-wrapper-${item.id} {
155
- position: absolute;
156
- width: 100%;
157
- height: 100%;
158
- }
159
- .embed-video {
160
- width: 100%;
161
- height: 100%;
162
- z-index: 1;
163
- border: none;
164
- overflow: hidden;
165
- }
153
+ } })), (0, jsx_runtime_1.jsx)("iframe", { ref: setIframeRef, className: "embed-video", src: validUrl || '', allow: "autoplay; fullscreen; picture-in-picture;", allowFullScreen: true, style: Object.assign(Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})), { transition: (_j = frameStateParams === null || frameStateParams === void 0 ? void 0 : frameStateParams.transition) !== null && _j !== void 0 ? _j : 'none' }) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
154
+ .embed-video-wrapper-${item.id} {
155
+ position: absolute;
156
+ width: 100%;
157
+ height: 100%;
158
+ }
159
+ .embed-video {
160
+ width: 100%;
161
+ height: 100%;
162
+ z-index: 1;
163
+ border: none;
164
+ overflow: hidden;
165
+ }
166
166
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
167
- return (`
168
- .embed-video-wrapper-${item.id} {
169
- opacity: ${layoutParams.opacity};
170
- transform: rotate(${area.angle}deg);
171
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
172
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
173
- }
174
- .embed-video-wrapper-${item.id} .embed-video {
175
- border-radius: ${layoutParams.radius * 100}vw;
176
- }
167
+ return (`
168
+ .embed-video-wrapper-${item.id} {
169
+ opacity: ${layoutParams.opacity};
170
+ transform: rotate(${area.angle}deg);
171
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
172
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
173
+ }
174
+ .embed-video-wrapper-${item.id} .embed-video {
175
+ border-radius: ${layoutParams.radius * 100}vw;
176
+ }
177
177
  `);
178
- })}
178
+ })}
179
179
  ` })] }));
180
180
  };
181
181
  exports.VimeoEmbedItem = VimeoEmbedItem;
@@ -140,35 +140,35 @@ const YoutubeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibi
140
140
  top: '0',
141
141
  left: '0',
142
142
  zIndex: 1
143
- }, alt: "Cover img" }))), (0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, ref: setDiv, style: Object.assign(Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})), { transition: (_j = frameStateParams === null || frameStateParams === void 0 ? void 0 : frameStateParams.transition) !== null && _j !== void 0 ? _j : 'none' }) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
144
- .embed-youtube-video-wrapper-${item.id},
145
- .embed-${item.id} {
146
- position: absolute;
147
- width: 100%;
148
- height: 100%;
149
- }
150
- .embed-${item.id} {
151
- overflow: hidden;
152
- }
153
- .embed-youtube-video-wrapper-${item.id} iframe {
154
- width: 100%;
155
- height: 100%;
156
- z-index: 1;
157
- border: none;
158
- }
143
+ }, alt: "Cover img" }))), (0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, ref: setDiv, style: Object.assign(Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})), { transition: (_j = frameStateParams === null || frameStateParams === void 0 ? void 0 : frameStateParams.transition) !== null && _j !== void 0 ? _j : 'none' }) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
144
+ .embed-youtube-video-wrapper-${item.id},
145
+ .embed-${item.id} {
146
+ position: absolute;
147
+ width: 100%;
148
+ height: 100%;
149
+ }
150
+ .embed-${item.id} {
151
+ overflow: hidden;
152
+ }
153
+ .embed-youtube-video-wrapper-${item.id} iframe {
154
+ width: 100%;
155
+ height: 100%;
156
+ z-index: 1;
157
+ border: none;
158
+ }
159
159
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
160
- return (`
161
- .embed-youtube-video-wrapper-${item.id} {
162
- opacity: ${layoutParams.opacity};
163
- transform: rotate(${area.angle}deg);
164
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
165
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
166
- }
167
- .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
168
- border-radius: ${layoutParams.radius * 100}vw;
169
- }
160
+ return (`
161
+ .embed-youtube-video-wrapper-${item.id} {
162
+ opacity: ${layoutParams.opacity};
163
+ transform: rotate(${area.angle}deg);
164
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
165
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
166
+ }
167
+ .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
168
+ border-radius: ${layoutParams.radius * 100}vw;
169
+ }
170
170
  `);
171
- })}
171
+ })}
172
172
  ` })] }));
173
173
  };
174
174
  exports.YoutubeEmbedItem = YoutubeEmbedItem;
@@ -75,48 +75,48 @@ const ImageItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
75
75
  }, [isInteractive, onVisibilityChange]);
76
76
  return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_p = item.link) === null || _p === void 0 ? void 0 : _p.url, target: (_q = item.link) === null || _q === void 0 ? void 0 : _q.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `image-wrapper-${item.id}`, ref: setWrapperRef, 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: (_r = wrapperStateParams === null || wrapperStateParams === void 0 ? void 0 : wrapperStateParams.transition) !== null && _r !== void 0 ? _r : 'none' }), children: hasGLEffect && isFXAllowed
77
77
  ? ((0, jsx_runtime_1.jsx)("canvas", { style: inlineStyles, ref: fxCanvas, className: `img-canvas image-${item.id}`, width: rectWidth, height: rectHeight }))
78
- : ((0, jsx_runtime_1.jsx)("img", { alt: "", className: `image image-${item.id}`, style: inlineStyles, src: item.commonParams.url })) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
79
- .image-wrapper-${item.id} {
80
- position: absolute;
81
- width: 100%;
82
- height: 100%;
83
- box-sizing: border-box;
84
- display: flex;
85
- }
86
- .image {
87
- width: 100%;
88
- height: 100%;
89
- opacity: 1;
90
- object-fit: cover;
91
- pointer-events: none;
92
- border-style: solid;
93
- overflow: hidden;
94
- box-sizing: border-box;
95
- }
96
- .img-canvas {
97
- border: solid;
98
- width: 100%;
99
- height: 100%;
100
- pointer-events: none;
101
- border-width: 0;
102
- box-sizing: border-box;
103
- }
78
+ : ((0, jsx_runtime_1.jsx)("img", { alt: "", className: `image image-${item.id}`, style: inlineStyles, src: item.commonParams.url })) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
79
+ .image-wrapper-${item.id} {
80
+ position: absolute;
81
+ width: 100%;
82
+ height: 100%;
83
+ box-sizing: border-box;
84
+ display: flex;
85
+ }
86
+ .image {
87
+ width: 100%;
88
+ height: 100%;
89
+ opacity: 1;
90
+ object-fit: cover;
91
+ pointer-events: none;
92
+ border-style: solid;
93
+ overflow: hidden;
94
+ box-sizing: border-box;
95
+ }
96
+ .img-canvas {
97
+ border: solid;
98
+ width: 100%;
99
+ height: 100%;
100
+ pointer-events: none;
101
+ border-width: 0;
102
+ box-sizing: border-box;
103
+ }
104
104
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
105
- return (`
106
- .image-wrapper-${item.id} {
107
- opacity: ${layoutParams.opacity};
108
- transform: rotate(${area.angle}deg);
109
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
110
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
111
- }
112
- .image-${item.id} {
113
- border: solid;
114
- border-color: ${stroke};
115
- border-radius: ${layoutParams.radius * 100}vw;
116
- border-width: ${layoutParams.strokeWidth * 100}vw;
117
- }
105
+ return (`
106
+ .image-wrapper-${item.id} {
107
+ opacity: ${layoutParams.opacity};
108
+ transform: rotate(${area.angle}deg);
109
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
110
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
111
+ }
112
+ .image-${item.id} {
113
+ border: solid;
114
+ border-color: ${stroke};
115
+ border-radius: ${layoutParams.radius * 100}vw;
116
+ border-width: ${layoutParams.strokeWidth * 100}vw;
117
+ }
118
118
  `);
119
- })}
119
+ })}
120
120
  ` })] }) }));
121
121
  };
122
122
  exports.ImageItem = ImageItem;
@@ -139,72 +139,72 @@ const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
139
139
  else {
140
140
  videoRef.play();
141
141
  }
142
- } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
143
- .video-wrapper-${item.id} {
144
- position: absolute;
145
- overflow: hidden;
146
- width: 100%;
147
- height: 100%;
148
- box-sizing: border-box;
149
- opacity: ${opacity};
150
- }
151
- .video-overlay-${item.id} {
152
- position: absolute;
153
- top: 0;
154
- left: 0;
155
- cursor: pointer;
156
- width: 100%;
157
- height: 100%;
158
- }
159
- .video-cover-${item.id} {
160
- position: absolute;
161
- top: 0;
162
- left: 0;
163
- cursor: pointer;
164
- width: 100%;
165
- height: 100%;
166
- object-fit: cover;
167
- }
168
- .video {
169
- width: 100%;
170
- height: 100%;
171
- box-sizing: border-box;
172
- opacity: 1;
173
- object-fit: cover;
174
- overflow: hidden;
175
- border-style: solid;
176
- }
177
- .video-${item.id} {
178
- border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
179
- }
180
- .video-playback-wrapper {
181
- display: flex;
182
- justify-content: center;
183
- }
184
- .video-canvas {
185
- border: solid;
186
- width: 100%;
187
- height: 100%;
188
- pointer-events: none;
189
- border-width: 0;
190
- box-sizing: border-box;
191
- }
142
+ } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
143
+ .video-wrapper-${item.id} {
144
+ position: absolute;
145
+ overflow: hidden;
146
+ width: 100%;
147
+ height: 100%;
148
+ box-sizing: border-box;
149
+ opacity: ${opacity};
150
+ }
151
+ .video-overlay-${item.id} {
152
+ position: absolute;
153
+ top: 0;
154
+ left: 0;
155
+ cursor: pointer;
156
+ width: 100%;
157
+ height: 100%;
158
+ }
159
+ .video-cover-${item.id} {
160
+ position: absolute;
161
+ top: 0;
162
+ left: 0;
163
+ cursor: pointer;
164
+ width: 100%;
165
+ height: 100%;
166
+ object-fit: cover;
167
+ }
168
+ .video {
169
+ width: 100%;
170
+ height: 100%;
171
+ box-sizing: border-box;
172
+ opacity: 1;
173
+ object-fit: cover;
174
+ overflow: hidden;
175
+ border-style: solid;
176
+ }
177
+ .video-${item.id} {
178
+ border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
179
+ }
180
+ .video-playback-wrapper {
181
+ display: flex;
182
+ justify-content: center;
183
+ }
184
+ .video-canvas {
185
+ border: solid;
186
+ width: 100%;
187
+ height: 100%;
188
+ pointer-events: none;
189
+ border-width: 0;
190
+ box-sizing: border-box;
191
+ }
192
192
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
193
- return (`
194
- .video-wrapper-${item.id} {
195
- opacity: ${layoutParams.opacity};
196
- transform: rotate(${area.angle}deg);
197
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
198
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
199
- }
200
- .video-${item.id} {
201
- border: solid;
202
- border-color: ${stroke};
203
- border-radius: ${layoutParams.radius * 100}vw;
204
- border-width: ${layoutParams.strokeWidth * 100}vw;
205
- }
193
+ return (`
194
+ .video-wrapper-${item.id} {
195
+ opacity: ${layoutParams.opacity};
196
+ transform: rotate(${area.angle}deg);
197
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
198
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
199
+ }
200
+ .video-${item.id} {
201
+ border: solid;
202
+ border-color: ${stroke};
203
+ border-radius: ${layoutParams.radius * 100}vw;
204
+ border-width: ${layoutParams.strokeWidth * 100}vw;
205
+ }
206
206
  `);
207
- })}
207
+ })}
208
208
  ` })] }));
209
209
  };
210
210
  exports.VideoItem = VideoItem;
@@ -52,22 +52,22 @@ const GroupItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
52
52
  }
53
53
  }, 0);
54
54
  }, [itemIds, item.id]);
55
- return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_d = item.link) === null || _d === void 0 ? void 0 : _d.url, target: (_e = item.link) === null || _e === void 0 ? void 0 : _e.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `group-${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: (_f = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _f !== void 0 ? _f : 'none', willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset' }), children: items && items.map(item => isInCompound ? ((0, jsx_runtime_1.jsx)(CompoundChild_1.CompoundChild, { item: item, sectionId: sectionId, isParentVisible: isInteractive }, item.id)) : ((0, jsx_runtime_1.jsx)(Item_1.Item, { item: item, sectionId: sectionId, isParentVisible: isInteractive, isInGroup: true }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
56
- .group-${item.id} {
57
- position: absolute;
58
- width: 100%;
59
- height: 100%;
60
- box-sizing: border-box;
61
- }
55
+ return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_d = item.link) === null || _d === void 0 ? void 0 : _d.url, target: (_e = item.link) === null || _e === void 0 ? void 0 : _e.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `group-${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: (_f = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _f !== void 0 ? _f : 'none', willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset' }), children: items && items.map(item => isInCompound ? ((0, jsx_runtime_1.jsx)(CompoundChild_1.CompoundChild, { item: item, sectionId: sectionId, isParentVisible: isInteractive }, item.id)) : ((0, jsx_runtime_1.jsx)(Item_1.Item, { item: item, sectionId: sectionId, isParentVisible: isInteractive, isInGroup: true }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
56
+ .group-${item.id} {
57
+ position: absolute;
58
+ width: 100%;
59
+ height: 100%;
60
+ box-sizing: border-box;
61
+ }
62
62
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
63
- return (`
64
- .group-${item.id} {
65
- opacity: ${layoutParams.opacity};
66
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
67
- transform: rotate(${area.angle}deg);
68
- }
63
+ return (`
64
+ .group-${item.id} {
65
+ opacity: ${layoutParams.opacity};
66
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
67
+ transform: rotate(${area.angle}deg);
68
+ }
69
69
  `);
70
- })}
70
+ })}
71
71
  ` })] }) }));
72
72
  };
73
73
  exports.GroupItem = GroupItem;
@@ -29,9 +29,9 @@ const useItemPointerEvents_1 = require("./useItemPointerEvents");
29
29
  const useItemArea_1 = require("./useItemArea");
30
30
  const useDraggable_1 = require("./useDraggable");
31
31
  const ItemGeometryContext_1 = require("../../ItemGeometry/ItemGeometryContext");
32
- const stickyFix = `
33
- -webkit-transform: translate3d(0, 0, 0);
34
- transform: translate3d(0, 0, 0);
32
+ const stickyFix = `
33
+ -webkit-transform: translate3d(0, 0, 0);
34
+ transform: translate3d(0, 0, 0);
35
35
  `;
36
36
  const noop = () => null;
37
37
  const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false, sectionHeight = 0 }) => {
@@ -147,41 +147,41 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
147
147
  ? 'grab'
148
148
  : hasClickTriggers
149
149
  ? 'pointer'
150
- : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none', userSelect: isDraggable ? 'none' : 'unset', WebkitUserSelect: isDraggable ? 'none' : 'unset', MozUserSelect: isDraggable ? 'none' : 'unset', msUserSelect: isDraggable ? 'none' : 'unset' }) }, triggers, { children: (0, jsx_runtime_1.jsx)(ItemComponent, { item: item, sectionId: sectionId, onResize: handleItemResize, articleHeight: articleHeight, interactionCtrl: interactionCtrl, onVisibilityChange: handleVisibilityChange }) })) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
150
+ : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none', userSelect: isDraggable ? 'none' : 'unset', WebkitUserSelect: isDraggable ? 'none' : 'unset', MozUserSelect: isDraggable ? 'none' : 'unset', msUserSelect: isDraggable ? 'none' : 'unset' }) }, triggers, { children: (0, jsx_runtime_1.jsx)(ItemComponent, { item: item, sectionId: sectionId, onResize: handleItemResize, articleHeight: articleHeight, interactionCtrl: interactionCtrl, onVisibilityChange: handleVisibilityChange }) })) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
151
151
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, sticky, sectionHeight, layoutParams]) => {
152
152
  const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
153
153
  const isScreenBasedBottom = area.positionType === sdk_1.PositionType.ScreenBased && area.anchorSide === sdk_1.AnchorSide.Bottom;
154
154
  const scaleAnchor = area.scaleAnchor;
155
155
  const innerHeight = (area === null || area === void 0 ? void 0 : area.dimensionsType) && (area === null || area === void 0 ? void 0 : area.dimensionsType) === sdk_1.DimensionsType.PercentageBased ? `${area.height}vh` : `${area.height * 100}vw`;
156
- return (`
157
- .item-${item.id} {
158
- position: ${sticky ? 'sticky' : 'absolute'};
159
- top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
160
- transition: opacity 0.2s linear 0.1s;
161
- pointer-events: none;
162
- display: ${hidden ? 'none' : 'block'};
163
- height: fit-content;
164
- }
165
- .item-${item.id}-inner {
156
+ return (`
157
+ .item-${item.id} {
158
+ position: ${sticky ? 'sticky' : 'absolute'};
159
+ top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
160
+ transition: opacity 0.2s linear 0.1s;
161
+ pointer-events: none;
162
+ display: ${hidden ? 'none' : 'block'};
163
+ height: fit-content;
164
+ }
165
+ .item-${item.id}-inner {
166
166
  width: ${sizingAxis.x === 'manual'
167
167
  ? `${area.width * 100}vw`
168
- : 'max-content'};
169
- height: ${sizingAxis.y === 'manual' ? innerHeight : 'unset'};
170
- transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
171
- transform: scale(${area.scale});
172
- position: relative;
173
- }
174
- .item-wrapper-${item.id} {
175
- position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
176
- z-index: ${area.zIndex};
177
- ${!isInGroup && sticky ? stickyFix : ''}
178
- pointer-events: none;
179
- bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
180
- top: ${isScreenBasedBottom ? 'unset' : isContainItem ? (0, getItemTopStyle_1.getPercentageBasedTopStyle)(area.top, area.height, area.anchorSide) : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
181
- left: ${area.left * 100}vw;
182
- }
168
+ : 'max-content'};
169
+ height: ${sizingAxis.y === 'manual' ? innerHeight : 'unset'};
170
+ transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
171
+ transform: scale(${area.scale});
172
+ position: relative;
173
+ }
174
+ .item-wrapper-${item.id} {
175
+ position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
176
+ z-index: ${area.zIndex};
177
+ ${!isInGroup && sticky ? stickyFix : ''}
178
+ pointer-events: none;
179
+ bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
180
+ top: ${isScreenBasedBottom ? 'unset' : isContainItem ? (0, getItemTopStyle_1.getPercentageBasedTopStyle)(area.top, area.height, area.anchorSide) : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
181
+ left: ${area.left * 100}vw;
182
+ }
183
183
  `);
184
- })}
184
+ })}
185
185
  ` })] }));
186
186
  };
187
187
  exports.Item = Item;
@@ -61,35 +61,35 @@ const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
61
61
  ? (_b = (0, getFill_1.getFill)(value)) !== null && _b !== void 0 ? _b : 'transparent'
62
62
  : 'transparent';
63
63
  return ((0, jsx_runtime_1.jsx)(Fill, { fill: value, itemId: item.id, background: background, fillTransition: fillTransition, radius: radius, strokeWidth: strokeWidth, isHighest: index === itemFill.length - 1, borderColor: stroke }, fill.id));
64
- }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
65
- .rectangle-${item.id} {
66
- position: absolute;
67
- width: 100%;
68
- height: 100%;
69
- box-sizing: border-box;
70
- },
71
- .image-fill-${item.id} {
72
- position: absolute;
73
- top: 0;
74
- left: 0;
75
- width: 100%;
76
- height: 100%;
77
- transform-origin: center center;
78
- z-index: 1;
79
- background-position: center;
80
- },
64
+ }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
65
+ .rectangle-${item.id} {
66
+ position: absolute;
67
+ width: 100%;
68
+ height: 100%;
69
+ box-sizing: border-box;
70
+ },
71
+ .image-fill-${item.id} {
72
+ position: absolute;
73
+ top: 0;
74
+ left: 0;
75
+ width: 100%;
76
+ height: 100%;
77
+ transform-origin: center center;
78
+ z-index: 1;
79
+ background-position: center;
80
+ },
81
81
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
82
- return (`
83
- .rectangle-${item.id} {
84
- border-radius: ${layoutParams.radius * 100}vw;
85
- transform: rotate(${area.angle}deg);
86
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
87
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''};
88
- backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
89
- -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
90
- }
82
+ return (`
83
+ .rectangle-${item.id} {
84
+ border-radius: ${layoutParams.radius * 100}vw;
85
+ transform: rotate(${area.angle}deg);
86
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
87
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''};
88
+ backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
89
+ -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
90
+ }
91
91
  `);
92
- })}
92
+ })}
93
93
  ` })] }) }));
94
94
  };
95
95
  exports.RectangleItem = RectangleItem;