@cntrl-site/sdk-nextjs 1.9.0 → 1.9.1

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 (130) 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 +52 -52
  19. package/lib/components/items/FileItem/VideoItem.js +76 -76
  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 +39 -39
  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 +211 -211
  54. package/src/components/items/FileItem/VideoItem.tsx +328 -328
  55. package/src/components/items/FileItem/useFileItem.ts +81 -81
  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 +199 -199
  61. package/src/components/items/RectangleItem/useRectangleItem.ts +89 -89
  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 +37 -37
  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.tsx +59 -59
  91. package/src/provider/Keyframes.ts +11 -11
  92. package/src/provider/KeyframesContext.ts +5 -5
  93. package/src/provider/LayoutContext.ts +3 -3
  94. package/src/provider/WebGLContextManagerContext.tsx +4 -4
  95. package/src/provider/defaultContext.ts +8 -8
  96. package/src/provider/useCntrlContext.ts +8 -8
  97. package/src/styled-jsx.d.ts +1 -1
  98. package/src/utils/Animator/Animator.ts +571 -571
  99. package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
  100. package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
  101. package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
  102. package/src/utils/EventEmitter.ts +41 -41
  103. package/src/utils/RichTextConverter/RichTextConverter.tsx +326 -326
  104. package/src/utils/ScaleAnchorMap.ts +13 -13
  105. package/src/utils/StickyManager/StickyManager.ts +23 -23
  106. package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
  107. package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
  108. package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
  109. package/src/utils/areFillsVisible/areFillsVisible.test.ts +63 -63
  110. package/src/utils/areFillsVisible/areFillsVisible.ts +37 -37
  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/getFill.ts +46 -46
  119. package/src/utils/getFontFamilyValue.ts +3 -3
  120. package/src/utils/getInvertedRanges.ts +43 -43
  121. package/src/utils/getItemTopStyle.ts +14 -14
  122. package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
  123. package/src/utils/getValidYoutubeUrl.ts +29 -29
  124. package/src/utils/isItemType.ts +5 -5
  125. package/src/utils/rangeMap.ts +13 -13
  126. package/src/utils/useElementRect.ts +23 -23
  127. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  128. package/.idea/modules.xml +0 -8
  129. package/.idea/sdk-nextjs.iml +0 -12
  130. package/.idea/vcs.xml +0 -6
@@ -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;
@@ -81,60 +81,60 @@ const ImageItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
81
81
  backgroundRepeat: strokeValue.behavior === 'repeat' ? 'repeat' : 'no-repeat'
82
82
  } : {
83
83
  background: stroke,
84
- })) : { background: stroke })) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
85
- .image-wrapper-${item.id} {
86
- position: absolute;
87
- width: 100%;
88
- height: 100%;
89
- box-sizing: border-box;
90
- display: flex;
91
- }
92
- .image {
93
- width: 100%;
94
- height: 100%;
95
- opacity: 1;
96
- object-fit: cover;
97
- pointer-events: none;
98
- border-style: solid;
99
- overflow: hidden;
100
- box-sizing: border-box;
101
- }
102
- .img-canvas {
103
- border: solid;
104
- width: 100%;
105
- height: 100%;
106
- pointer-events: none;
107
- border-width: 0;
108
- box-sizing: border-box;
109
- }
84
+ })) : { background: stroke })) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
85
+ .image-wrapper-${item.id} {
86
+ position: absolute;
87
+ width: 100%;
88
+ height: 100%;
89
+ box-sizing: border-box;
90
+ display: flex;
91
+ }
92
+ .image {
93
+ width: 100%;
94
+ height: 100%;
95
+ opacity: 1;
96
+ object-fit: cover;
97
+ pointer-events: none;
98
+ border-style: solid;
99
+ overflow: hidden;
100
+ box-sizing: border-box;
101
+ }
102
+ .img-canvas {
103
+ border: solid;
104
+ width: 100%;
105
+ height: 100%;
106
+ pointer-events: none;
107
+ border-width: 0;
108
+ box-sizing: border-box;
109
+ }
110
110
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
111
- return (`
112
- .image-wrapper-${item.id} {
113
- opacity: ${layoutParams.opacity};
114
- transform: rotate(${area.angle}deg);
115
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
116
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
117
- }
118
- .image-${item.id} {
119
- border: solid;
120
- border-color: transparent;
121
- border-width: ${layoutParams.strokeWidth * 100}vw;
122
- border-radius: ${layoutParams.radius * 100}vw;
123
- }
124
- .image-border-${item.id} {
125
- position: absolute;
126
- inset: 0;
127
- border-radius: inherit;
128
- pointer-events: none;
129
- z-index: 2;
130
- -webkit-mask:
131
- linear-gradient(#fff 0 0) content-box,
132
- linear-gradient(#fff 0 0);
133
- -webkit-mask-composite: xor;
134
- mask-composite: exclude;
135
- }
111
+ return (`
112
+ .image-wrapper-${item.id} {
113
+ opacity: ${layoutParams.opacity};
114
+ transform: rotate(${area.angle}deg);
115
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
116
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
117
+ }
118
+ .image-${item.id} {
119
+ border: solid;
120
+ border-color: transparent;
121
+ border-width: ${layoutParams.strokeWidth * 100}vw;
122
+ border-radius: ${layoutParams.radius * 100}vw;
123
+ }
124
+ .image-border-${item.id} {
125
+ position: absolute;
126
+ inset: 0;
127
+ border-radius: inherit;
128
+ pointer-events: none;
129
+ z-index: 2;
130
+ -webkit-mask:
131
+ linear-gradient(#fff 0 0) content-box,
132
+ linear-gradient(#fff 0 0);
133
+ -webkit-mask-composite: xor;
134
+ mask-composite: exclude;
135
+ }
136
136
  `);
137
- })}
137
+ })}
138
138
  ` })] }) }));
139
139
  };
140
140
  exports.ImageItem = ImageItem;
@@ -144,84 +144,84 @@ const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
144
144
  backgroundRepeat: strokeValue.behavior === 'repeat' ? 'repeat' : 'no-repeat'
145
145
  } : {
146
146
  background: stroke,
147
- })) : { background: stroke })) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
148
- .video-wrapper-${item.id} {
149
- position: absolute;
150
- overflow: hidden;
151
- width: 100%;
152
- height: 100%;
153
- box-sizing: border-box;
154
- opacity: ${opacity};
155
- }
156
- .video-overlay-${item.id} {
157
- position: absolute;
158
- top: 0;
159
- left: 0;
160
- cursor: pointer;
161
- width: 100%;
162
- height: 100%;
163
- }
164
- .video-cover-${item.id} {
165
- position: absolute;
166
- top: 0;
167
- left: 0;
168
- cursor: pointer;
169
- width: 100%;
170
- height: 100%;
171
- object-fit: cover;
172
- }
173
- .video {
174
- width: 100%;
175
- height: 100%;
176
- box-sizing: border-box;
177
- opacity: 1;
178
- object-fit: cover;
179
- overflow: hidden;
180
- border-style: solid;
181
- }
182
- .video-${item.id} {
183
- border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
184
- }
185
- .video-playback-wrapper {
186
- display: flex;
187
- justify-content: center;
188
- }
189
- .video-canvas {
190
- border: solid;
191
- width: 100%;
192
- height: 100%;
193
- pointer-events: none;
194
- border-width: 0;
195
- box-sizing: border-box;
196
- }
147
+ })) : { background: stroke })) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
148
+ .video-wrapper-${item.id} {
149
+ position: absolute;
150
+ overflow: hidden;
151
+ width: 100%;
152
+ height: 100%;
153
+ box-sizing: border-box;
154
+ opacity: ${opacity};
155
+ }
156
+ .video-overlay-${item.id} {
157
+ position: absolute;
158
+ top: 0;
159
+ left: 0;
160
+ cursor: pointer;
161
+ width: 100%;
162
+ height: 100%;
163
+ }
164
+ .video-cover-${item.id} {
165
+ position: absolute;
166
+ top: 0;
167
+ left: 0;
168
+ cursor: pointer;
169
+ width: 100%;
170
+ height: 100%;
171
+ object-fit: cover;
172
+ }
173
+ .video {
174
+ width: 100%;
175
+ height: 100%;
176
+ box-sizing: border-box;
177
+ opacity: 1;
178
+ object-fit: cover;
179
+ overflow: hidden;
180
+ border-style: solid;
181
+ }
182
+ .video-${item.id} {
183
+ border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
184
+ }
185
+ .video-playback-wrapper {
186
+ display: flex;
187
+ justify-content: center;
188
+ }
189
+ .video-canvas {
190
+ border: solid;
191
+ width: 100%;
192
+ height: 100%;
193
+ pointer-events: none;
194
+ border-width: 0;
195
+ box-sizing: border-box;
196
+ }
197
197
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
198
- return (`
199
- .video-wrapper-${item.id} {
200
- opacity: ${layoutParams.opacity};
201
- transform: rotate(${area.angle}deg);
202
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
203
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
204
- }
205
- .video-${item.id} {
206
- border: solid;
207
- border-color: transparent;
208
- border-width: ${layoutParams.strokeWidth * 100}vw;
209
- border-radius: ${layoutParams.radius * 100}vw;
210
- }
211
- .video-border-${item.id} {
212
- position: absolute;
213
- inset: 0;
214
- border-radius: inherit;
215
- pointer-events: none;
216
- z-index: 2;
217
- -webkit-mask:
218
- linear-gradient(#fff 0 0) content-box,
219
- linear-gradient(#fff 0 0);
220
- -webkit-mask-composite: xor;
221
- mask-composite: exclude;
222
- }
198
+ return (`
199
+ .video-wrapper-${item.id} {
200
+ opacity: ${layoutParams.opacity};
201
+ transform: rotate(${area.angle}deg);
202
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
203
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
204
+ }
205
+ .video-${item.id} {
206
+ border: solid;
207
+ border-color: transparent;
208
+ border-width: ${layoutParams.strokeWidth * 100}vw;
209
+ border-radius: ${layoutParams.radius * 100}vw;
210
+ }
211
+ .video-border-${item.id} {
212
+ position: absolute;
213
+ inset: 0;
214
+ border-radius: inherit;
215
+ pointer-events: none;
216
+ z-index: 2;
217
+ -webkit-mask:
218
+ linear-gradient(#fff 0 0) content-box,
219
+ linear-gradient(#fff 0 0);
220
+ -webkit-mask-composite: xor;
221
+ mask-composite: exclude;
222
+ }
223
223
  `);
224
- })}
224
+ })}
225
225
  ` })] }));
226
226
  };
227
227
  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;
@@ -71,47 +71,47 @@ const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
71
71
  ? (_b = (0, getFill_1.getFill)(value)) !== null && _b !== void 0 ? _b : 'transparent'
72
72
  : 'transparent';
73
73
  return ((0, jsx_runtime_1.jsx)(Fill, { fill: value, itemId: item.id, background: background, solidTransition: solidTransition }));
74
- })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
75
- .rectangle-${item.id} {
76
- position: absolute;
77
- width: 100%;
78
- height: 100%;
79
- box-sizing: border-box;
80
- },
81
- .image-fill-${item.id} {
82
- position: absolute;
83
- top: 0;
84
- left: 0;
85
- width: 100%;
86
- height: 100%;
87
- transform-origin: center center;
88
- z-index: 1;
89
- background-position: center;
90
- },
74
+ })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
75
+ .rectangle-${item.id} {
76
+ position: absolute;
77
+ width: 100%;
78
+ height: 100%;
79
+ box-sizing: border-box;
80
+ },
81
+ .image-fill-${item.id} {
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ transform-origin: center center;
88
+ z-index: 1;
89
+ background-position: center;
90
+ },
91
91
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
92
- return (`
93
- .rectangle-${item.id} {
94
- border-radius: ${layoutParams.radius * 100}vw
95
- transform: rotate(${area.angle}deg);
96
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
97
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
98
- backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
99
- -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
100
- },
101
- .rectangle-border-${item.id} {
102
- position: absolute;
103
- inset: 0;
104
- border-radius: inherit;
105
- pointer-events: none;
106
- z-index: 2;
107
- -webkit-mask:
108
- linear-gradient(#fff 0 0) content-box,
109
- linear-gradient(#fff 0 0);
110
- -webkit-mask-composite: xor;
111
- mask-composite: exclude;
112
- }
92
+ return (`
93
+ .rectangle-${item.id} {
94
+ border-radius: ${layoutParams.radius * 100}vw
95
+ transform: rotate(${area.angle}deg);
96
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
97
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
98
+ backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
99
+ -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
100
+ },
101
+ .rectangle-border-${item.id} {
102
+ position: absolute;
103
+ inset: 0;
104
+ border-radius: inherit;
105
+ pointer-events: none;
106
+ z-index: 2;
107
+ -webkit-mask:
108
+ linear-gradient(#fff 0 0) content-box,
109
+ linear-gradient(#fff 0 0);
110
+ -webkit-mask-composite: xor;
111
+ mask-composite: exclude;
112
+ }
113
113
  `);
114
- })}
114
+ })}
115
115
  ` })] }) }));
116
116
  };
117
117
  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
  };