@cntrl-site/sdk-nextjs 1.9.71-9 → 1.9.72

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 (143) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +4 -4
  3. package/TODO.md +1 -1
  4. package/eslint.config.mjs +35 -35
  5. package/jest.config.js +6 -6
  6. package/lib/common/useItemFXData.js +5 -5
  7. package/lib/components/Article.js +7 -6
  8. package/lib/components/LayoutStyle.js +4 -4
  9. package/lib/components/Section/Section.js +30 -48
  10. package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +36 -36
  11. package/lib/components/items/ComponentItem/ComponentItem.js +13 -13
  12. package/lib/components/items/CompoundItem/CompoundChild.js +20 -20
  13. package/lib/components/items/CompoundItem/CompoundItem.js +14 -14
  14. package/lib/components/items/CustomItem/CustomItem.js +9 -9
  15. package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +24 -24
  16. package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +27 -27
  17. package/lib/components/items/FileItem/ImageItem.js +40 -40
  18. package/lib/components/items/FileItem/VideoItem.js +64 -64
  19. package/lib/components/items/GroupItem/GroupItem.js +14 -14
  20. package/lib/components/items/Item.js +33 -32
  21. package/lib/components/items/RectangleItem/RectangleItem.js +27 -27
  22. package/lib/components/items/RichTextItem/RichTextItem.js +22 -22
  23. package/lib/provider/CntrlSdkContext.js +1 -1
  24. package/lib/utils/RichTextConverter/RichTextConverter.js +21 -21
  25. package/package.json +62 -62
  26. package/src/ItemGeometry/CSSPropertyNameMap.ts +37 -37
  27. package/src/ItemGeometry/GenericGeometryController.ts +59 -59
  28. package/src/ItemGeometry/ItemGeometryContext.ts +4 -4
  29. package/src/ItemGeometry/ItemGeometryController.ts +22 -22
  30. package/src/ItemGeometry/ItemGeometryService.ts +34 -34
  31. package/src/ItemGeometry/RichTextGeometryController.ts +166 -166
  32. package/src/ItemGeometry/useItemGeometry.ts +25 -25
  33. package/src/common/useCurrentLayout.ts +52 -52
  34. package/src/common/useExemplary.ts +9 -9
  35. package/src/common/useItemFXData.ts +63 -63
  36. package/src/common/useKeyframeValue.ts +85 -85
  37. package/src/common/useRegisterResize.ts +16 -16
  38. package/src/components/Article.tsx +75 -69
  39. package/src/components/ArticleWrapper.tsx +21 -21
  40. package/src/components/Head.tsx +95 -95
  41. package/src/components/LayoutStyle.tsx +21 -21
  42. package/src/components/Page.tsx +47 -47
  43. package/src/components/ScrollPlaybackVideo.tsx +75 -75
  44. package/src/components/Section/Section.tsx +130 -162
  45. package/src/components/Section/SectionImage.tsx +48 -48
  46. package/src/components/Section/SectionVideo.tsx +144 -144
  47. package/src/components/Section/useSectionColor.ts +19 -19
  48. package/src/components/Section/useSectionHeightMap.ts +19 -19
  49. package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +148 -148
  50. package/src/components/items/CodeEmbedItem/useCodeEmbedItem.ts +36 -36
  51. package/src/components/items/ComponentItem/ComponentItem.tsx +85 -85
  52. package/src/components/items/ComponentItem/useComponentItem.ts +35 -35
  53. package/src/components/items/CompoundItem/CompoundChild.tsx +151 -151
  54. package/src/components/items/CompoundItem/CompoundItem.tsx +88 -88
  55. package/src/components/items/CompoundItem/useCompoundItem.ts +21 -21
  56. package/src/components/items/CustomItem/CustomItem.tsx +50 -50
  57. package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +217 -217
  58. package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +201 -201
  59. package/src/components/items/EmbedVideoItem/useEmbedVideoItem.ts +46 -46
  60. package/src/components/items/FileItem/ImageItem.tsx +166 -166
  61. package/src/components/items/FileItem/VideoItem.tsx +287 -287
  62. package/src/components/items/FileItem/useFileItem.ts +81 -81
  63. package/src/components/items/GroupItem/GroupItem.tsx +99 -99
  64. package/src/components/items/GroupItem/useGroupItem.ts +34 -34
  65. package/src/components/items/Item.tsx +268 -268
  66. package/src/components/items/LinkWrapper.tsx +39 -39
  67. package/src/components/items/RectangleItem/RectangleItem.tsx +177 -177
  68. package/src/components/items/RectangleItem/useRectangleItem.ts +89 -89
  69. package/src/components/items/RichTextItem/RichTextItem.tsx +113 -113
  70. package/src/components/items/RichTextItem/useRichTextItem.ts +12 -12
  71. package/src/components/items/RichTextWrapper.tsx +15 -15
  72. package/src/components/items/itemsMap.ts +28 -28
  73. package/src/components/items/useDraggable.ts +252 -252
  74. package/src/components/items/useItemAngle.ts +13 -13
  75. package/src/components/items/useItemArea.ts +35 -35
  76. package/src/components/items/useItemPointerEvents.ts +23 -23
  77. package/src/components/items/useItemScale.ts +17 -17
  78. package/src/components/items/useItemTriggers.ts +15 -15
  79. package/src/components/items/useRichTextItemValues.ts +66 -66
  80. package/src/components/items/useSizing.ts +25 -25
  81. package/src/components/items/useStickyItemTop.ts +21 -21
  82. package/src/components/useLayoutContext.ts +7 -7
  83. package/src/index.ts +25 -25
  84. package/src/interactions/InteractionsRegistry.ts +512 -513
  85. package/src/interactions/ItemInteractionCtrl.ts +78 -78
  86. package/src/interactions/getTransition.ts +27 -27
  87. package/src/interactions/types.ts +36 -36
  88. package/src/interactions/useItemInteractionCtrl.ts +18 -18
  89. package/src/provider/ArticleRectContext.ts +4 -4
  90. package/src/provider/CntrlContext.ts +5 -5
  91. package/src/provider/CntrlProvider.tsx +11 -11
  92. package/src/provider/CntrlSdkContext.ts +113 -113
  93. package/src/provider/CustomItemRegistry.ts +14 -14
  94. package/src/provider/CustomItemTypes.ts +3 -3
  95. package/src/provider/CustomSectionRegistry.ts +25 -25
  96. package/src/provider/InteractionsContext.tsx +73 -73
  97. package/src/provider/Keyframes.ts +11 -11
  98. package/src/provider/KeyframesContext.ts +5 -5
  99. package/src/provider/LayoutContext.ts +3 -3
  100. package/src/provider/WebGLContextManagerContext.tsx +4 -4
  101. package/src/provider/defaultContext.ts +8 -8
  102. package/src/provider/useCntrlContext.ts +8 -8
  103. package/src/styled-jsx.d.ts +1 -1
  104. package/src/types/components-utils.d.ts +7 -7
  105. package/src/utils/Animator/Animator.ts +570 -570
  106. package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
  107. package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
  108. package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
  109. package/src/utils/CSSNumeric.ts +19 -19
  110. package/src/utils/EventEmitter.ts +41 -41
  111. package/src/utils/RichTextConverter/RichTextConverter.tsx +342 -342
  112. package/src/utils/ScaleAnchorMap.ts +13 -13
  113. package/src/utils/StickyManager/StickyManager.ts +23 -23
  114. package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
  115. package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
  116. package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
  117. package/src/utils/areFillsVisible/areFillsVisible.test.ts +63 -63
  118. package/src/utils/areFillsVisible/areFillsVisible.ts +37 -37
  119. package/src/utils/binSearchInsertAt.ts +33 -33
  120. package/src/utils/castObject.ts +10 -10
  121. package/src/utils/checkOverflowClipSupport.ts +13 -13
  122. package/src/utils/domDfs.ts +11 -11
  123. package/src/utils/effects/useImageFx.ts +154 -154
  124. package/src/utils/effects/useVideoFx.ts +156 -156
  125. package/src/utils/evaluateComponentBundle.ts +83 -83
  126. package/src/utils/getAnchoredItemTop.ts +12 -12
  127. package/src/utils/getCompoundBoundaryStyles.ts +60 -60
  128. package/src/utils/getFill.ts +46 -46
  129. package/src/utils/getFontFamilyValue.ts +3 -3
  130. package/src/utils/getInvertedRanges.ts +43 -43
  131. package/src/utils/getItemTopStyle.ts +39 -39
  132. package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
  133. package/src/utils/getValidYoutubeUrl.ts +29 -29
  134. package/src/utils/isItemType.ts +5 -5
  135. package/src/utils/rangeMap.ts +13 -13
  136. package/src/utils/useElementRect.ts +23 -23
  137. package/cntrl-site-sdk-nextjs-1.9.71-3.tgz +0 -0
  138. package/lib/components/StructuredBlockItem/StructuredBlockItem.js +0 -58
  139. package/lib/components/StructuredBlockItem/StructuredComponent/StructuredComponent.js +0 -48
  140. package/lib/components/StructuredContent/StructuredContent.js +0 -37
  141. package/src/components/StructuredBlockItem/StructuredBlockItem.tsx +0 -69
  142. package/src/components/StructuredBlockItem/StructuredComponent/StructuredComponent.tsx +0 -66
  143. package/src/components/StructuredContent/StructuredContent.tsx +0 -42
@@ -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,12 +29,12 @@ 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
- const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false, sectionHeight = 0 }) => {
37
+ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false }) => {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
39
39
  const itemWrapperRef = (0, react_1.useRef)(null);
40
40
  const itemInnerRef = (0, react_1.useRef)(null);
@@ -69,6 +69,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
69
69
  height: (_e = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _e === void 0 ? void 0 : _e.height
70
70
  });
71
71
  const sectionHeightLayoutMap = (0, useSectionHeightMap_1.useSectionHeightData)(sectionId);
72
+ const sectionHeight = layout && sectionHeightLayoutMap[layout] ? sectionHeightLayoutMap[layout] : '0';
72
73
  const stickyTop = (0, useStickyItemTop_1.useStickyItemTop)(item, sectionId, (_f = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.styles) === null || _f === void 0 ? void 0 : _f.top);
73
74
  const layoutValues = [item.area, item.hidden];
74
75
  layoutValues.push(item.sticky);
@@ -130,7 +131,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
130
131
  (_a = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.handleTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(interactionCtrl, e.propertyName);
131
132
  }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (top !== undefined ? { top: isScreenBasedBottom ? 'unset' : isContainItem ? (0, getItemTopStyle_1.getPercentageBasedTopStyle)(top, height, anchorSide) : (0, getItemTopStyle_1.getItemTopStyle)(top, anchorSide) } : {})), (left !== undefined ? { left: `${left * 100}vw` } : {})), (top !== undefined ? { bottom: isScreenBasedBottom ? `${-top * 100}vw` : 'unset' } : {})), (wrapperHeight !== undefined ? { height: `${wrapperHeight * 100}vw` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none' }), (blendMode && { mixBlendMode: blendMode })), children: [(0, jsx_runtime_1.jsx)("div", { suppressHydrationWarning: true, className: `item-${item.id}`, style: {
132
133
  opacity: (keyframes.length !== 0 && !layout) ? 0 : 1,
133
- top: sticky ? (0, getAnchoredItemTop_1.getAnchoredItemTop)(stickyTop, `${sectionHeight}px`, anchorSide) : 0,
134
+ top: sticky ? (0, getAnchoredItemTop_1.getAnchoredItemTop)(stickyTop, sectionHeight, anchorSide) : 0,
134
135
  height: isRichText && itemHeight !== undefined ? `${itemHeight * 100}vw` : 'unset'
135
136
  }, children: (0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `item-${item.id}-inner`, ref: itemInnerRef, style: Object.assign(Object.assign(Object.assign({ top: `${position.y}px`, left: `${position.x}px` }, ((width !== undefined && height !== undefined)
136
137
  ? {
@@ -147,41 +148,41 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
147
148
  ? 'grab'
148
149
  : hasClickTriggers
149
150
  ? '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: `
151
+ : '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
152
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, sticky, sectionHeight, layoutParams]) => {
152
153
  const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
153
154
  const isScreenBasedBottom = area.positionType === sdk_1.PositionType.ScreenBased && area.anchorSide === sdk_1.AnchorSide.Bottom;
154
155
  const scaleAnchor = area.scaleAnchor;
155
156
  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 {
157
+ return (`
158
+ .item-${item.id} {
159
+ position: ${sticky ? 'sticky' : 'absolute'};
160
+ top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
161
+ transition: opacity 0.2s linear 0.1s;
162
+ pointer-events: none;
163
+ display: ${hidden ? 'none' : 'block'};
164
+ height: fit-content;
165
+ }
166
+ .item-${item.id}-inner {
166
167
  width: ${sizingAxis.x === 'manual'
167
168
  ? `${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
- }
169
+ : 'max-content'};
170
+ height: ${sizingAxis.y === 'manual' ? innerHeight : 'unset'};
171
+ transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
172
+ transform: scale(${area.scale});
173
+ position: relative;
174
+ }
175
+ .item-wrapper-${item.id} {
176
+ position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
177
+ z-index: ${area.zIndex};
178
+ ${!isInGroup && sticky ? stickyFix : ''}
179
+ pointer-events: none;
180
+ bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
181
+ top: ${isScreenBasedBottom ? 'unset' : isContainItem ? (0, getItemTopStyle_1.getPercentageBasedTopStyle)(area.top, area.height, area.anchorSide) : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
182
+ left: ${area.left * 100}vw;
183
+ }
183
184
  `);
184
- })}
185
+ })}
185
186
  ` })] }));
186
187
  };
187
188
  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;
@@ -60,28 +60,28 @@ const RichTextItem = ({ item, sectionId, onResize, interactionCtrl, onVisibility
60
60
  }, [isInteractive, onVisibilityChange]);
61
61
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { ref: setRef, className: `rich-text-wrapper-${item.id}`, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), (textColor ? { color: `${textColor.fmt('rgba')}` } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (letterSpacing !== undefined ? { letterSpacing: `${letterSpacing * exemplary}px` } : {})), (wordSpacing !== undefined ? { wordSpacing: `${wordSpacing * exemplary}px` } : {})), (fontSize !== undefined ? { fontSize: `${Math.round(fontSize * exemplary)}px` } : {})), (lineHeight !== undefined ? { lineHeight: `${lineHeight * exemplary}px` } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset', transition }), children: content }), (0, jsx_runtime_1.jsxs)(style_1.default, { id: id, children: [styles, `${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
62
62
  const color = color_1.CntrlColor.parse(layoutParams.color);
63
- return (`
64
- .rich-text-wrapper-${item.id} {
65
- font-size: ${layoutParams.fontSize * 100}vw;
66
- line-height: ${layoutParams.lineHeight * 100}vw;
67
- letter-spacing: ${layoutParams.letterSpacing * 100}vw;
68
- word-spacing: ${layoutParams.wordSpacing * 100}vw;
69
- font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
70
- font-weight: ${layoutParams.fontWeight};
71
- font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
72
- vertical-align: ${layoutParams.verticalAlign};
73
- font-variant: ${layoutParams.fontVariant};
74
- color: ${color.fmt('rgba')};
75
- transform: rotate(${area.angle}deg);
76
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
77
- text-transform: ${layoutParams.textTransform};
78
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
79
- }
80
- @supports not (color: oklch(42% 0.3 90 / 1)) {
81
- .rich-text-wrapper-${item.id} {
82
- color: ${color.fmt('rgba')};
83
- }
84
- }
63
+ return (`
64
+ .rich-text-wrapper-${item.id} {
65
+ font-size: ${layoutParams.fontSize * 100}vw;
66
+ line-height: ${layoutParams.lineHeight * 100}vw;
67
+ letter-spacing: ${layoutParams.letterSpacing * 100}vw;
68
+ word-spacing: ${layoutParams.wordSpacing * 100}vw;
69
+ font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
70
+ font-weight: ${layoutParams.fontWeight};
71
+ font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
72
+ vertical-align: ${layoutParams.verticalAlign};
73
+ font-variant: ${layoutParams.fontVariant};
74
+ color: ${color.fmt('rgba')};
75
+ transform: rotate(${area.angle}deg);
76
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
77
+ text-transform: ${layoutParams.textTransform};
78
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
79
+ }
80
+ @supports not (color: oklch(42% 0.3 90 / 1)) {
81
+ .rich-text-wrapper-${item.id} {
82
+ color: ${color.fmt('rgba')};
83
+ }
84
+ }
85
85
  `);
86
86
  })}`] })] }));
87
87
  };
@@ -78,7 +78,7 @@ class CntrlSdkContext {
78
78
  }
79
79
  setSectionsHeight(sections) {
80
80
  for (const section of sections) {
81
- this.sectionHeightMap.set(section.id, section.minHeight);
81
+ this.sectionHeightMap.set(section.id, section.height);
82
82
  }
83
83
  }
84
84
  getSectionHeightData(sectionId) {
@@ -61,13 +61,13 @@ class RichTextConverter {
61
61
  const kids = [];
62
62
  layouts.forEach(l => {
63
63
  const ta = richText.layoutParams[l.id].textAlign;
64
- styleRules[l.id].push(`
65
- .${blockClass} {
66
- display: ${group.some(g => g.layout === l.id) ? 'block' : 'none'};
67
- text-align: ${ta};
68
- white-space: pre-wrap;
69
- overflow-wrap: break-word;
70
- }
64
+ styleRules[l.id].push(`
65
+ .${blockClass} {
66
+ display: ${group.some(g => g.layout === l.id) ? 'block' : 'none'};
67
+ text-align: ${ta};
68
+ white-space: pre-wrap;
69
+ overflow-wrap: break-word;
70
+ }
71
71
  `);
72
72
  });
73
73
  const item = group[0];
@@ -111,18 +111,18 @@ class RichTextConverter {
111
111
  if (lineHeight === null || lineHeight === void 0 ? void 0 : lineHeight.value) {
112
112
  currentLineHeight[item.layout] = lineHeight.value;
113
113
  }
114
- styleRules[item.layout].push(`
115
- .${blockClass} .s-${styleGroup.start}-${styleGroup.end} {
116
- ${styleGroup.styles.map(s => RichTextConverter.fromRangeStylesToInline(s, exemplary)).join('\n')}
117
- }
114
+ styleRules[item.layout].push(`
115
+ .${blockClass} .s-${styleGroup.start}-${styleGroup.end} {
116
+ ${styleGroup.styles.map(s => RichTextConverter.fromRangeStylesToInline(s, exemplary)).join('\n')}
117
+ }
118
118
  `);
119
119
  if (color) {
120
- styleRules[item.layout].push(`
121
- @supports not (color: oklch(42% 0.3 90 / 1)) {
122
- .${blockClass} .s-${styleGroup.start}-${styleGroup.end} {
123
- color: ${color_1.CntrlColor.parse(getResolvedValue(color.value, 'COLOR')).fmt('rgba')};
124
- }
125
- }
120
+ styleRules[item.layout].push(`
121
+ @supports not (color: oklch(42% 0.3 90 / 1)) {
122
+ .${blockClass} .s-${styleGroup.start}-${styleGroup.end} {
123
+ color: ${color_1.CntrlColor.parse(getResolvedValue(color.value, 'COLOR')).fmt('rgba')};
124
+ }
125
+ }
126
126
  `);
127
127
  }
128
128
  }
@@ -131,10 +131,10 @@ class RichTextConverter {
131
131
  root.push((0, jsx_runtime_1.jsx)("div", { className: blockClass, children: kids }, blockClass));
132
132
  }
133
133
  }
134
- const styles = layouts.map(l => `
135
- ${(0, sdk_1.getLayoutMediaQuery)(l.id, layouts)} {
136
- ${styleRules[l.id].join('\n')}
137
- }
134
+ const styles = layouts.map(l => `
135
+ ${(0, sdk_1.getLayoutMediaQuery)(l.id, layouts)} {
136
+ ${styleRules[l.id].join('\n')}
137
+ }
138
138
  `).join('\n');
139
139
  return [
140
140
  root,