@cntrl-site/sdk-nextjs 1.8.39 → 1.8.40-0

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 (125) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +4 -4
  3. package/TODO.md +1 -1
  4. package/cntrl-site-sdk-nextjs-1.8.40.tgz +0 -0
  5. package/eslint.config.mjs +35 -35
  6. package/jest.config.js +6 -6
  7. package/lib/common/useItemFXData.js +7 -7
  8. package/lib/components/Article.js +5 -5
  9. package/lib/components/LayoutStyle.js +4 -4
  10. package/lib/components/Section/Section.js +27 -27
  11. package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +36 -36
  12. package/lib/components/items/ComponentItem/ComponentItem.js +13 -13
  13. package/lib/components/items/CompoundItem/CompoundChild.js +20 -20
  14. package/lib/components/items/CompoundItem/CompoundItem.js +14 -14
  15. package/lib/components/items/CustomItem/CustomItem.js +9 -9
  16. package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +24 -24
  17. package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +27 -27
  18. package/lib/components/items/FileItem/ImageItem.js +39 -39
  19. package/lib/components/items/FileItem/VideoItem.js +63 -63
  20. package/lib/components/items/GroupItem/GroupItem.js +14 -14
  21. package/lib/components/items/Item.js +30 -30
  22. package/lib/components/items/RectangleItem/RectangleItem.js +21 -21
  23. package/lib/components/items/RichTextItem/RichTextItem.js +22 -22
  24. package/lib/utils/RichTextConverter/RichTextConverter.js +21 -21
  25. package/package.json +58 -57
  26. package/src/common/useCurrentLayout.ts +52 -52
  27. package/src/common/useExemplary.ts +9 -9
  28. package/src/common/useItemFXData.ts +47 -47
  29. package/src/common/useKeyframeValue.ts +85 -85
  30. package/src/common/useRegisterResize.ts +16 -16
  31. package/src/components/Article.tsx +73 -73
  32. package/src/components/ArticleWrapper.tsx +21 -21
  33. package/src/components/Head.tsx +56 -56
  34. package/src/components/LayoutStyle.tsx +21 -21
  35. package/src/components/Page.tsx +33 -33
  36. package/src/components/ScrollPlaybackVideo.tsx +56 -56
  37. package/src/components/Section/Section.tsx +127 -127
  38. package/src/components/Section/SectionImage.tsx +48 -48
  39. package/src/components/Section/SectionVideo.tsx +144 -144
  40. package/src/components/Section/useSectionColor.ts +19 -19
  41. package/src/components/Section/useSectionHeightMap.ts +19 -19
  42. package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +145 -145
  43. package/src/components/items/CodeEmbedItem/useCodeEmbedItem.ts +36 -36
  44. package/src/components/items/ComponentItem/ComponentItem.tsx +67 -67
  45. package/src/components/items/ComponentItem/useComponentItem.ts +35 -35
  46. package/src/components/items/CompoundItem/CompoundChild.tsx +150 -150
  47. package/src/components/items/CompoundItem/CompoundItem.tsx +70 -70
  48. package/src/components/items/CompoundItem/useCompoundItem.ts +21 -21
  49. package/src/components/items/CustomItem/CustomItem.tsx +48 -48
  50. package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +206 -206
  51. package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +193 -193
  52. package/src/components/items/EmbedVideoItem/useEmbedVideoItem.ts +46 -46
  53. package/src/components/items/FileItem/ImageItem.tsx +158 -158
  54. package/src/components/items/FileItem/VideoItem.tsx +275 -275
  55. package/src/components/items/FileItem/useFileItem.ts +73 -73
  56. package/src/components/items/GroupItem/GroupItem.tsx +81 -81
  57. package/src/components/items/GroupItem/useGroupItem.ts +34 -34
  58. package/src/components/items/Item.tsx +251 -251
  59. package/src/components/items/LinkWrapper.tsx +39 -39
  60. package/src/components/items/RectangleItem/RectangleItem.tsx +97 -97
  61. package/src/components/items/RectangleItem/useRectangleItem.ts +82 -82
  62. package/src/components/items/RichTextItem/RichTextItem.tsx +107 -107
  63. package/src/components/items/RichTextItem/useRichTextItem.ts +12 -12
  64. package/src/components/items/RichTextWrapper.tsx +15 -15
  65. package/src/components/items/itemsMap.ts +28 -28
  66. package/src/components/items/useDraggable.ts +252 -252
  67. package/src/components/items/useItemAngle.ts +13 -13
  68. package/src/components/items/useItemArea.ts +35 -35
  69. package/src/components/items/useItemPointerEvents.ts +23 -23
  70. package/src/components/items/useItemScale.ts +17 -17
  71. package/src/components/items/useItemTriggers.ts +15 -15
  72. package/src/components/items/useRichTextItemValues.ts +65 -65
  73. package/src/components/items/useSizing.ts +25 -25
  74. package/src/components/items/useStickyItemTop.ts +21 -21
  75. package/src/components/useLayoutContext.ts +7 -7
  76. package/src/index.ts +24 -24
  77. package/src/interactions/CSSPropertyNameMap.ts +38 -38
  78. package/src/interactions/InteractionsRegistry.ts +380 -380
  79. package/src/interactions/ItemInteractionCtrl.ts +78 -78
  80. package/src/interactions/getTransition.ts +27 -27
  81. package/src/interactions/types.ts +36 -36
  82. package/src/interactions/useItemInteractionCtrl.ts +18 -18
  83. package/src/provider/ArticleRectContext.ts +4 -4
  84. package/src/provider/CntrlContext.ts +5 -5
  85. package/src/provider/CntrlProvider.tsx +11 -11
  86. package/src/provider/CntrlSdkContext.ts +83 -83
  87. package/src/provider/CustomItemRegistry.ts +14 -14
  88. package/src/provider/CustomItemTypes.ts +3 -3
  89. package/src/provider/CustomSectionRegistry.ts +25 -25
  90. package/src/provider/InteractionsContext.old.tsx +66 -66
  91. package/src/provider/InteractionsContext.test.tsx +97 -97
  92. package/src/provider/InteractionsContext.tsx +59 -59
  93. package/src/provider/Keyframes.ts +11 -11
  94. package/src/provider/KeyframesContext.ts +5 -5
  95. package/src/provider/LayoutContext.ts +3 -3
  96. package/src/provider/WebGLContextManagerContext.tsx +4 -4
  97. package/src/provider/defaultContext.ts +8 -8
  98. package/src/provider/useCntrlContext.ts +8 -8
  99. package/src/styled-jsx.d.ts +1 -1
  100. package/src/utils/Animator/Animator.ts +371 -371
  101. package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
  102. package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
  103. package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
  104. package/src/utils/EventEmitter.ts +41 -41
  105. package/src/utils/RichTextConverter/RichTextConverter.tsx +326 -326
  106. package/src/utils/ScaleAnchorMap.ts +13 -13
  107. package/src/utils/StickyManager/StickyManager.ts +23 -23
  108. package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
  109. package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
  110. package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
  111. package/src/utils/binSearchInsertAt.ts +33 -33
  112. package/src/utils/castObject.ts +10 -10
  113. package/src/utils/checkOverflowClipSupport.ts +13 -13
  114. package/src/utils/effects/useImageFx.ts +156 -156
  115. package/src/utils/effects/useVideoFx.ts +158 -158
  116. package/src/utils/getAnchoredItemTop.ts +12 -12
  117. package/src/utils/getCompoundBoundaryStyles.ts +60 -60
  118. package/src/utils/getFontFamilyValue.ts +3 -3
  119. package/src/utils/getInvertedRanges.ts +43 -43
  120. package/src/utils/getItemTopStyle.ts +14 -14
  121. package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
  122. package/src/utils/getValidYoutubeUrl.ts +29 -29
  123. package/src/utils/isItemType.ts +5 -5
  124. package/src/utils/rangeMap.ts +13 -13
  125. package/src/utils/useElementRect.ts +23 -23
@@ -132,35 +132,35 @@ const YoutubeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibi
132
132
  top: '0',
133
133
  left: '0',
134
134
  zIndex: 1
135
- }, 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: `
136
- .embed-youtube-video-wrapper-${item.id},
137
- .embed-${item.id} {
138
- position: absolute;
139
- width: 100%;
140
- height: 100%;
141
- }
142
- .embed-${item.id} {
143
- overflow: hidden;
144
- }
145
- .embed-youtube-video-wrapper-${item.id} iframe {
146
- width: 100%;
147
- height: 100%;
148
- z-index: 1;
149
- border: none;
150
- }
135
+ }, 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: `
136
+ .embed-youtube-video-wrapper-${item.id},
137
+ .embed-${item.id} {
138
+ position: absolute;
139
+ width: 100%;
140
+ height: 100%;
141
+ }
142
+ .embed-${item.id} {
143
+ overflow: hidden;
144
+ }
145
+ .embed-youtube-video-wrapper-${item.id} iframe {
146
+ width: 100%;
147
+ height: 100%;
148
+ z-index: 1;
149
+ border: none;
150
+ }
151
151
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
152
- return (`
153
- .embed-youtube-video-wrapper-${item.id} {
154
- opacity: ${layoutParams.opacity};
155
- transform: rotate(${area.angle}deg);
156
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
157
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
158
- }
159
- .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
160
- border-radius: ${layoutParams.radius * 100}vw;
161
- }
152
+ return (`
153
+ .embed-youtube-video-wrapper-${item.id} {
154
+ opacity: ${layoutParams.opacity};
155
+ transform: rotate(${area.angle}deg);
156
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
157
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
158
+ }
159
+ .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
160
+ border-radius: ${layoutParams.radius * 100}vw;
161
+ }
162
162
  `);
163
- })}
163
+ })}
164
164
  ` })] }));
165
165
  };
166
166
  exports.YoutubeEmbedItem = YoutubeEmbedItem;
@@ -67,47 +67,47 @@ const ImageItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
67
67
  }, [isInteractive, onVisibilityChange]);
68
68
  return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_l = item.link) === null || _l === void 0 ? void 0 : _l.url, target: (_m = item.link) === null || _m === void 0 ? void 0 : _m.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: (_o = wrapperStateParams === null || wrapperStateParams === void 0 ? void 0 : wrapperStateParams.transition) !== null && _o !== void 0 ? _o : 'none' }), children: hasGLEffect && isFXAllowed
69
69
  ? ((0, jsx_runtime_1.jsx)("canvas", { style: inlineStyles, ref: fxCanvas, className: `img-canvas image-${item.id}`, width: rectWidth, height: rectHeight }))
70
- : ((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: `
71
- .image-wrapper-${item.id} {
72
- position: absolute;
73
- width: 100%;
74
- height: 100%;
75
- box-sizing: border-box;
76
- display: flex;
77
- }
78
- .image {
79
- width: 100%;
80
- height: 100%;
81
- opacity: 1;
82
- object-fit: cover;
83
- pointer-events: none;
84
- border-style: solid;
85
- overflow: hidden;
86
- box-sizing: border-box;
87
- }
88
- .img-canvas {
89
- border: solid;
90
- width: 100%;
91
- height: 100%;
92
- pointer-events: none;
93
- border-width: 0;
94
- box-sizing: border-box;
95
- }
70
+ : ((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: `
71
+ .image-wrapper-${item.id} {
72
+ position: absolute;
73
+ width: 100%;
74
+ height: 100%;
75
+ box-sizing: border-box;
76
+ display: flex;
77
+ }
78
+ .image {
79
+ width: 100%;
80
+ height: 100%;
81
+ opacity: 1;
82
+ object-fit: cover;
83
+ pointer-events: none;
84
+ border-style: solid;
85
+ overflow: hidden;
86
+ box-sizing: border-box;
87
+ }
88
+ .img-canvas {
89
+ border: solid;
90
+ width: 100%;
91
+ height: 100%;
92
+ pointer-events: none;
93
+ border-width: 0;
94
+ box-sizing: border-box;
95
+ }
96
96
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
97
- return (`
98
- .image-wrapper-${item.id} {
99
- opacity: ${layoutParams.opacity};
100
- transform: rotate(${area.angle}deg);
101
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
102
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
103
- }
104
- .image-${item.id} {
105
- border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
106
- border-radius: ${layoutParams.radius * 100}vw;
107
- border-width: ${layoutParams.strokeWidth * 100}vw;
108
- }
97
+ return (`
98
+ .image-wrapper-${item.id} {
99
+ opacity: ${layoutParams.opacity};
100
+ transform: rotate(${area.angle}deg);
101
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
102
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
103
+ }
104
+ .image-${item.id} {
105
+ border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
106
+ border-radius: ${layoutParams.radius * 100}vw;
107
+ border-width: ${layoutParams.strokeWidth * 100}vw;
108
+ }
109
109
  `);
110
- })}
110
+ })}
111
111
  ` })] }) }));
112
112
  };
113
113
  exports.ImageItem = ImageItem;
@@ -130,71 +130,71 @@ const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
130
130
  else {
131
131
  videoRef.play();
132
132
  }
133
- } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
134
- .video-wrapper-${item.id} {
135
- position: absolute;
136
- overflow: hidden;
137
- width: 100%;
138
- height: 100%;
139
- box-sizing: border-box;
140
- opacity: ${opacity};
141
- }
142
- .video-overlay-${item.id} {
143
- position: absolute;
144
- top: 0;
145
- left: 0;
146
- cursor: pointer;
147
- width: 100%;
148
- height: 100%;
149
- }
150
- .video-cover-${item.id} {
151
- position: absolute;
152
- top: 0;
153
- left: 0;
154
- cursor: pointer;
155
- width: 100%;
156
- height: 100%;
157
- object-fit: cover;
158
- }
159
- .video {
160
- width: 100%;
161
- height: 100%;
162
- box-sizing: border-box;
163
- opacity: 1;
164
- object-fit: cover;
165
- overflow: hidden;
166
- border-style: solid;
167
- }
168
- .video-${item.id} {
169
- border-color: ${itemStrokeColor};
170
- }
171
- .video-playback-wrapper {
172
- display: flex;
173
- justify-content: center;
174
- }
175
- .video-canvas {
176
- border: solid;
177
- width: 100%;
178
- height: 100%;
179
- pointer-events: none;
180
- border-width: 0;
181
- box-sizing: border-box;
182
- }
133
+ } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
134
+ .video-wrapper-${item.id} {
135
+ position: absolute;
136
+ overflow: hidden;
137
+ width: 100%;
138
+ height: 100%;
139
+ box-sizing: border-box;
140
+ opacity: ${opacity};
141
+ }
142
+ .video-overlay-${item.id} {
143
+ position: absolute;
144
+ top: 0;
145
+ left: 0;
146
+ cursor: pointer;
147
+ width: 100%;
148
+ height: 100%;
149
+ }
150
+ .video-cover-${item.id} {
151
+ position: absolute;
152
+ top: 0;
153
+ left: 0;
154
+ cursor: pointer;
155
+ width: 100%;
156
+ height: 100%;
157
+ object-fit: cover;
158
+ }
159
+ .video {
160
+ width: 100%;
161
+ height: 100%;
162
+ box-sizing: border-box;
163
+ opacity: 1;
164
+ object-fit: cover;
165
+ overflow: hidden;
166
+ border-style: solid;
167
+ }
168
+ .video-${item.id} {
169
+ border-color: ${itemStrokeColor};
170
+ }
171
+ .video-playback-wrapper {
172
+ display: flex;
173
+ justify-content: center;
174
+ }
175
+ .video-canvas {
176
+ border: solid;
177
+ width: 100%;
178
+ height: 100%;
179
+ pointer-events: none;
180
+ border-width: 0;
181
+ box-sizing: border-box;
182
+ }
183
183
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
184
- return (`
185
- .video-wrapper-${item.id} {
186
- opacity: ${layoutParams.opacity};
187
- transform: rotate(${area.angle}deg);
188
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
189
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
190
- }
191
- .video-${item.id} {
192
- border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
193
- border-radius: ${layoutParams.radius * 100}vw;
194
- border-width: ${layoutParams.strokeWidth * 100}vw;
195
- }
184
+ return (`
185
+ .video-wrapper-${item.id} {
186
+ opacity: ${layoutParams.opacity};
187
+ transform: rotate(${area.angle}deg);
188
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
189
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
190
+ }
191
+ .video-${item.id} {
192
+ border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
193
+ border-radius: ${layoutParams.radius * 100}vw;
194
+ border-width: ${layoutParams.strokeWidth * 100}vw;
195
+ }
196
196
  `);
197
- })}
197
+ })}
198
198
  ` })] }));
199
199
  };
200
200
  exports.VideoItem = VideoItem;
@@ -34,22 +34,22 @@ const GroupItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
34
34
  (0, react_1.useEffect)(() => {
35
35
  onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(isInteractive);
36
36
  }, [isInteractive, onVisibilityChange]);
37
- 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: `
38
- .group-${item.id} {
39
- position: absolute;
40
- width: 100%;
41
- height: 100%;
42
- box-sizing: border-box;
43
- }
37
+ 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: `
38
+ .group-${item.id} {
39
+ position: absolute;
40
+ width: 100%;
41
+ height: 100%;
42
+ box-sizing: border-box;
43
+ }
44
44
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
45
- return (`
46
- .group-${item.id} {
47
- opacity: ${layoutParams.opacity};
48
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
49
- transform: rotate(${area.angle}deg);
50
- }
45
+ return (`
46
+ .group-${item.id} {
47
+ opacity: ${layoutParams.opacity};
48
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
49
+ transform: rotate(${area.angle}deg);
50
+ }
51
51
  `);
52
- })}
52
+ })}
53
53
  ` })] }) }));
54
54
  };
55
55
  exports.GroupItem = GroupItem;
@@ -28,9 +28,9 @@ const useSizing_1 = require("./useSizing");
28
28
  const useItemPointerEvents_1 = require("./useItemPointerEvents");
29
29
  const useItemArea_1 = require("./useItemArea");
30
30
  const useDraggable_1 = require("./useDraggable");
31
- const stickyFix = `
32
- -webkit-transform: translate3d(0, 0, 0);
33
- transform: translate3d(0, 0, 0);
31
+ const stickyFix = `
32
+ -webkit-transform: translate3d(0, 0, 0);
33
+ transform: translate3d(0, 0, 0);
34
34
  `;
35
35
  const noop = () => null;
36
36
  const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false }) => {
@@ -134,40 +134,40 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
134
134
  ? 'grab'
135
135
  : hasClickTriggers
136
136
  ? 'pointer'
137
- : '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: `
137
+ : '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: `
138
138
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, sticky, sectionHeight, layoutParams]) => {
139
139
  const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
140
140
  const isScreenBasedBottom = area.positionType === sdk_1.PositionType.ScreenBased && area.anchorSide === sdk_1.AnchorSide.Bottom;
141
141
  const scaleAnchor = area.scaleAnchor;
142
- return (`
143
- .item-${item.id} {
144
- position: ${sticky ? 'sticky' : 'absolute'};
145
- top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
146
- transition: opacity 0.2s linear 0.1s;
147
- pointer-events: none;
148
- display: ${hidden ? 'none' : 'block'};
149
- height: fit-content;
150
- }
151
- .item-${item.id}-inner {
142
+ return (`
143
+ .item-${item.id} {
144
+ position: ${sticky ? 'sticky' : 'absolute'};
145
+ top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
146
+ transition: opacity 0.2s linear 0.1s;
147
+ pointer-events: none;
148
+ display: ${hidden ? 'none' : 'block'};
149
+ height: fit-content;
150
+ }
151
+ .item-${item.id}-inner {
152
152
  width: ${sizingAxis.x === 'manual'
153
153
  ? `${area.width * 100}vw`
154
- : 'max-content'};
155
- height: ${sizingAxis.y === 'manual' ? `${area.height * 100}vw` : 'unset'};
156
- transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
157
- transform: scale(${area.scale});
158
- position: relative;
159
- }
160
- .item-wrapper-${item.id} {
161
- position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
162
- z-index: ${area.zIndex};
163
- ${!isInGroup && stickyFix}
164
- pointer-events: none;
165
- bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
166
- top: ${isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
167
- left: ${area.left * 100}vw;
168
- }
154
+ : 'max-content'};
155
+ height: ${sizingAxis.y === 'manual' ? `${area.height * 100}vw` : 'unset'};
156
+ transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
157
+ transform: scale(${area.scale});
158
+ position: relative;
159
+ }
160
+ .item-wrapper-${item.id} {
161
+ position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
162
+ z-index: ${area.zIndex};
163
+ ${!isInGroup && stickyFix}
164
+ pointer-events: none;
165
+ bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
166
+ top: ${isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
167
+ left: ${area.left * 100}vw;
168
+ }
169
169
  `);
170
- })}
170
+ })}
171
171
  ` })] }));
172
172
  };
173
173
  exports.Item = Item;
@@ -46,29 +46,29 @@ const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
46
46
  }, [isInteractive, onVisibilityChange]);
47
47
  return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_b = item.link) === null || _b === void 0 ? void 0 : _b.url, target: (_c = item.link) === null || _c === void 0 ? void 0 : _c.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `rectangle-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (backgroundColor ? { backgroundColor: `${backgroundColor.fmt('rgba')}` } : {})), (borderColor ? { borderColor: `${borderColor.fmt('rgba')}` } : {})), (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})), (strokeWidth !== undefined ? { borderWidth: `${strokeWidth * 100}vw` } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), { willChange: blur !== 0 && blur !== undefined ? 'transform' : 'unset' }), (backdropFilterValue !== undefined
48
48
  ? { backdropFilter: backdropFilterValue, WebkitBackdropFilter: backdropFilterValue }
49
- : {})), { transition: (_d = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _d !== void 0 ? _d : 'none' }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
50
- .rectangle-${item.id} {
51
- position: absolute;
52
- width: 100%;
53
- height: 100%;
54
- border-style: solid;
55
- box-sizing: border-box;
56
- }
49
+ : {})), { transition: (_d = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _d !== void 0 ? _d : 'none' }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
50
+ .rectangle-${item.id} {
51
+ position: absolute;
52
+ width: 100%;
53
+ height: 100%;
54
+ border-style: solid;
55
+ box-sizing: border-box;
56
+ }
57
57
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
58
- return (`
59
- .rectangle-${item.id} {
60
- background-color: ${color_1.CntrlColor.parse(layoutParams.fillColor).fmt('rgba')};
61
- border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
62
- border-radius: ${layoutParams.radius * 100}vw;
63
- border-width: ${layoutParams.strokeWidth * 100}vw;
64
- transform: rotate(${area.angle}deg);
65
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
66
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
67
- backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
68
- -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
69
- }
58
+ return (`
59
+ .rectangle-${item.id} {
60
+ background-color: ${color_1.CntrlColor.parse(layoutParams.fillColor).fmt('rgba')};
61
+ border-color: ${color_1.CntrlColor.parse(layoutParams.strokeColor).fmt('rgba')};
62
+ border-radius: ${layoutParams.radius * 100}vw;
63
+ border-width: ${layoutParams.strokeWidth * 100}vw;
64
+ transform: rotate(${area.angle}deg);
65
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
66
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
67
+ backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
68
+ -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
69
+ }
70
70
  `);
71
- })}
71
+ })}
72
72
  ` })] }) }));
73
73
  };
74
74
  exports.RectangleItem = RectangleItem;
@@ -55,28 +55,28 @@ const RichTextItem = ({ item, sectionId, onResize, interactionCtrl, onVisibility
55
55
  }, [isInteractive, onVisibilityChange]);
56
56
  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]) => {
57
57
  const color = color_1.CntrlColor.parse(layoutParams.color);
58
- return (`
59
- .rich-text-wrapper-${item.id} {
60
- font-size: ${layoutParams.fontSize * 100}vw;
61
- line-height: ${layoutParams.lineHeight * 100}vw;
62
- letter-spacing: ${layoutParams.letterSpacing * 100}vw;
63
- word-spacing: ${layoutParams.wordSpacing * 100}vw;
64
- font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
65
- font-weight: ${layoutParams.fontWeight};
66
- font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
67
- vertical-align: ${layoutParams.verticalAlign};
68
- font-variant: ${layoutParams.fontVariant};
69
- color: ${color.fmt('rgba')};
70
- transform: rotate(${area.angle}deg);
71
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
72
- text-transform: ${layoutParams.textTransform};
73
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
74
- }
75
- @supports not (color: oklch(42% 0.3 90 / 1)) {
76
- .rich-text-wrapper-${item.id} {
77
- color: ${color.fmt('rgba')};
78
- }
79
- }
58
+ return (`
59
+ .rich-text-wrapper-${item.id} {
60
+ font-size: ${layoutParams.fontSize * 100}vw;
61
+ line-height: ${layoutParams.lineHeight * 100}vw;
62
+ letter-spacing: ${layoutParams.letterSpacing * 100}vw;
63
+ word-spacing: ${layoutParams.wordSpacing * 100}vw;
64
+ font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
65
+ font-weight: ${layoutParams.fontWeight};
66
+ font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
67
+ vertical-align: ${layoutParams.verticalAlign};
68
+ font-variant: ${layoutParams.fontVariant};
69
+ color: ${color.fmt('rgba')};
70
+ transform: rotate(${area.angle}deg);
71
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
72
+ text-transform: ${layoutParams.textTransform};
73
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
74
+ }
75
+ @supports not (color: oklch(42% 0.3 90 / 1)) {
76
+ .rich-text-wrapper-${item.id} {
77
+ color: ${color.fmt('rgba')};
78
+ }
79
+ }
80
80
  `);
81
81
  })}`] })] }));
82
82
  };
@@ -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,