@cntrl-site/sdk-nextjs 1.9.31 → 1.9.32

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 (140) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/sdk-nextjs.iml +12 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/LICENSE +21 -21
  6. package/README.md +4 -4
  7. package/TODO.md +1 -1
  8. package/eslint.config.mjs +35 -35
  9. package/jest.config.js +6 -6
  10. package/lib/common/useItemFXData.js +7 -7
  11. package/lib/components/Article.js +5 -5
  12. package/lib/components/LayoutStyle.js +4 -4
  13. package/lib/components/Section/Section.js +27 -27
  14. package/lib/components/items/CodeEmbedItem/CodeEmbedItem.js +36 -36
  15. package/lib/components/items/ComponentItem/ComponentItem.js +13 -13
  16. package/lib/components/items/CompoundItem/CompoundChild.js +20 -20
  17. package/lib/components/items/CompoundItem/CompoundItem.js +14 -14
  18. package/lib/components/items/CustomItem/CustomItem.js +9 -9
  19. package/lib/components/items/EmbedVideoItem/VimeoEmbed.js +24 -24
  20. package/lib/components/items/EmbedVideoItem/YoutubeEmbed.js +27 -27
  21. package/lib/components/items/FileItem/ImageItem.js +40 -40
  22. package/lib/components/items/FileItem/VideoItem.js +64 -64
  23. package/lib/components/items/GroupItem/GroupItem.js +14 -14
  24. package/lib/components/items/Item.js +30 -30
  25. package/lib/components/items/RectangleItem/RectangleItem.js +27 -27
  26. package/lib/components/items/RichTextItem/RichTextItem.js +22 -22
  27. package/lib/interactions/InteractionsRegistry.js +30 -0
  28. package/lib/provider/InteractionsContext.js +11 -0
  29. package/lib/utils/RichTextConverter/RichTextConverter.js +21 -21
  30. package/package.json +60 -60
  31. package/src/ItemGeometry/CSSPropertyNameMap.ts +37 -37
  32. package/src/ItemGeometry/GenericGeometryController.ts +59 -59
  33. package/src/ItemGeometry/ItemGeometryContext.ts +4 -4
  34. package/src/ItemGeometry/ItemGeometryController.ts +22 -22
  35. package/src/ItemGeometry/ItemGeometryService.ts +34 -34
  36. package/src/ItemGeometry/RichTextGeometryController.ts +166 -166
  37. package/src/ItemGeometry/useItemGeometry.ts +25 -25
  38. package/src/common/useCurrentLayout.ts +52 -52
  39. package/src/common/useExemplary.ts +9 -9
  40. package/src/common/useItemFXData.ts +47 -47
  41. package/src/common/useKeyframeValue.ts +85 -85
  42. package/src/common/useRegisterResize.ts +16 -16
  43. package/src/components/Article.tsx +73 -73
  44. package/src/components/ArticleWrapper.tsx +21 -21
  45. package/src/components/Head.tsx +56 -56
  46. package/src/components/LayoutStyle.tsx +21 -21
  47. package/src/components/Page.tsx +38 -38
  48. package/src/components/ScrollPlaybackVideo.tsx +56 -56
  49. package/src/components/Section/Section.tsx +127 -127
  50. package/src/components/Section/SectionImage.tsx +48 -48
  51. package/src/components/Section/SectionVideo.tsx +144 -144
  52. package/src/components/Section/useSectionColor.ts +19 -19
  53. package/src/components/Section/useSectionHeightMap.ts +19 -19
  54. package/src/components/items/CodeEmbedItem/CodeEmbedItem.tsx +147 -147
  55. package/src/components/items/CodeEmbedItem/useCodeEmbedItem.ts +36 -36
  56. package/src/components/items/ComponentItem/ComponentItem.tsx +71 -70
  57. package/src/components/items/ComponentItem/useComponentItem.ts +35 -35
  58. package/src/components/items/CompoundItem/CompoundChild.tsx +150 -150
  59. package/src/components/items/CompoundItem/CompoundItem.tsx +87 -87
  60. package/src/components/items/CompoundItem/useCompoundItem.ts +21 -21
  61. package/src/components/items/CustomItem/CustomItem.tsx +50 -50
  62. package/src/components/items/EmbedVideoItem/VimeoEmbed.tsx +216 -216
  63. package/src/components/items/EmbedVideoItem/YoutubeEmbed.tsx +200 -200
  64. package/src/components/items/EmbedVideoItem/useEmbedVideoItem.ts +46 -46
  65. package/src/components/items/FileItem/ImageItem.tsx +165 -165
  66. package/src/components/items/FileItem/VideoItem.tsx +282 -282
  67. package/src/components/items/FileItem/useFileItem.ts +81 -81
  68. package/src/components/items/GroupItem/GroupItem.tsx +98 -98
  69. package/src/components/items/GroupItem/useGroupItem.ts +34 -34
  70. package/src/components/items/Item.tsx +262 -262
  71. package/src/components/items/LinkWrapper.tsx +39 -39
  72. package/src/components/items/RectangleItem/RectangleItem.tsx +184 -184
  73. package/src/components/items/RectangleItem/useRectangleItem.ts +89 -89
  74. package/src/components/items/RichTextItem/RichTextItem.tsx +112 -112
  75. package/src/components/items/RichTextItem/useRichTextItem.ts +12 -12
  76. package/src/components/items/RichTextWrapper.tsx +15 -15
  77. package/src/components/items/itemsMap.ts +28 -28
  78. package/src/components/items/useDraggable.ts +252 -252
  79. package/src/components/items/useItemAngle.ts +13 -13
  80. package/src/components/items/useItemArea.ts +35 -35
  81. package/src/components/items/useItemPointerEvents.ts +23 -23
  82. package/src/components/items/useItemScale.ts +17 -17
  83. package/src/components/items/useItemTriggers.ts +15 -15
  84. package/src/components/items/useRichTextItemValues.ts +66 -66
  85. package/src/components/items/useSizing.ts +25 -25
  86. package/src/components/items/useStickyItemTop.ts +21 -21
  87. package/src/components/useLayoutContext.ts +7 -7
  88. package/src/index.ts +24 -24
  89. package/src/interactions/InteractionsRegistry.ts +531 -508
  90. package/src/interactions/ItemInteractionCtrl.ts +78 -78
  91. package/src/interactions/getTransition.ts +27 -27
  92. package/src/interactions/types.ts +36 -36
  93. package/src/interactions/useItemInteractionCtrl.ts +18 -18
  94. package/src/provider/ArticleRectContext.ts +4 -4
  95. package/src/provider/CntrlContext.ts +5 -5
  96. package/src/provider/CntrlProvider.tsx +11 -11
  97. package/src/provider/CntrlSdkContext.ts +84 -84
  98. package/src/provider/CustomItemRegistry.ts +14 -14
  99. package/src/provider/CustomItemTypes.ts +3 -3
  100. package/src/provider/CustomSectionRegistry.ts +25 -25
  101. package/src/provider/InteractionsContext.tsx +72 -61
  102. package/src/provider/Keyframes.ts +11 -11
  103. package/src/provider/KeyframesContext.ts +5 -5
  104. package/src/provider/LayoutContext.ts +3 -3
  105. package/src/provider/WebGLContextManagerContext.tsx +4 -4
  106. package/src/provider/defaultContext.ts +8 -8
  107. package/src/provider/useCntrlContext.ts +8 -8
  108. package/src/styled-jsx.d.ts +1 -1
  109. package/src/utils/Animator/Animator.ts +570 -570
  110. package/src/utils/ArticleRectManager/ArticleRectObserver.ts +93 -93
  111. package/src/utils/ArticleRectManager/useArticleRectObserver.ts +17 -17
  112. package/src/utils/ArticleRectManager/useSectionRegistry.ts +11 -11
  113. package/src/utils/CSSNumeric.ts +19 -19
  114. package/src/utils/EventEmitter.ts +41 -41
  115. package/src/utils/RichTextConverter/RichTextConverter.tsx +342 -342
  116. package/src/utils/ScaleAnchorMap.ts +13 -13
  117. package/src/utils/StickyManager/StickyManager.ts +23 -23
  118. package/src/utils/Youtube/YouTubeIframeApiLoader.ts +58 -58
  119. package/src/utils/Youtube/YoutubeIframeApi.ts +101 -101
  120. package/src/utils/Youtube/useYouTubeIframeApi.ts +12 -12
  121. package/src/utils/areFillsVisible/areFillsVisible.test.ts +63 -63
  122. package/src/utils/areFillsVisible/areFillsVisible.ts +37 -37
  123. package/src/utils/binSearchInsertAt.ts +33 -33
  124. package/src/utils/castObject.ts +10 -10
  125. package/src/utils/checkOverflowClipSupport.ts +13 -13
  126. package/src/utils/domDfs.ts +11 -11
  127. package/src/utils/effects/useImageFx.ts +156 -156
  128. package/src/utils/effects/useVideoFx.ts +158 -158
  129. package/src/utils/getAnchoredItemTop.ts +12 -12
  130. package/src/utils/getCompoundBoundaryStyles.ts +60 -60
  131. package/src/utils/getFill.ts +46 -46
  132. package/src/utils/getFontFamilyValue.ts +3 -3
  133. package/src/utils/getInvertedRanges.ts +43 -43
  134. package/src/utils/getItemTopStyle.ts +14 -14
  135. package/src/utils/getStyleFromItemStateAndParams.ts +8 -8
  136. package/src/utils/getValidYoutubeUrl.ts +29 -29
  137. package/src/utils/isItemType.ts +5 -5
  138. package/src/utils/rangeMap.ts +13 -13
  139. package/src/utils/useElementRect.ts +23 -23
  140. package/cntrl-site-sdk-nextjs-1.9.28-0.tgz +0 -0
@@ -139,35 +139,35 @@ const YoutubeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibi
139
139
  top: '0',
140
140
  left: '0',
141
141
  zIndex: 1
142
- }, 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: `
143
- .embed-youtube-video-wrapper-${item.id},
144
- .embed-${item.id} {
145
- position: absolute;
146
- width: 100%;
147
- height: 100%;
148
- }
149
- .embed-${item.id} {
150
- overflow: hidden;
151
- }
152
- .embed-youtube-video-wrapper-${item.id} iframe {
153
- width: 100%;
154
- height: 100%;
155
- z-index: 1;
156
- border: none;
157
- }
142
+ }, 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: `
143
+ .embed-youtube-video-wrapper-${item.id},
144
+ .embed-${item.id} {
145
+ position: absolute;
146
+ width: 100%;
147
+ height: 100%;
148
+ }
149
+ .embed-${item.id} {
150
+ overflow: hidden;
151
+ }
152
+ .embed-youtube-video-wrapper-${item.id} iframe {
153
+ width: 100%;
154
+ height: 100%;
155
+ z-index: 1;
156
+ border: none;
157
+ }
158
158
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
159
- return (`
160
- .embed-youtube-video-wrapper-${item.id} {
161
- opacity: ${layoutParams.opacity};
162
- transform: rotate(${area.angle}deg);
163
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
164
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
165
- }
166
- .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
167
- border-radius: ${layoutParams.radius * 100}vw;
168
- }
159
+ return (`
160
+ .embed-youtube-video-wrapper-${item.id} {
161
+ opacity: ${layoutParams.opacity};
162
+ transform: rotate(${area.angle}deg);
163
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
164
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
165
+ }
166
+ .embed-youtube-video-wrapper-${item.id} .embed-${item.id} {
167
+ border-radius: ${layoutParams.radius * 100}vw;
168
+ }
169
169
  `);
170
- })}
170
+ })}
171
171
  ` })] }));
172
172
  };
173
173
  exports.YoutubeEmbedItem = YoutubeEmbedItem;
@@ -73,48 +73,48 @@ const ImageItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
73
73
  }, [isInteractive, onVisibilityChange]);
74
74
  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
75
75
  ? ((0, jsx_runtime_1.jsx)("canvas", { style: inlineStyles, ref: fxCanvas, className: `img-canvas image-${item.id}`, width: rectWidth, height: rectHeight }))
76
- : ((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: `
77
- .image-wrapper-${item.id} {
78
- position: absolute;
79
- width: 100%;
80
- height: 100%;
81
- box-sizing: border-box;
82
- display: flex;
83
- }
84
- .image {
85
- width: 100%;
86
- height: 100%;
87
- opacity: 1;
88
- object-fit: cover;
89
- pointer-events: none;
90
- border-style: solid;
91
- overflow: hidden;
92
- box-sizing: border-box;
93
- }
94
- .img-canvas {
95
- border: solid;
96
- width: 100%;
97
- height: 100%;
98
- pointer-events: none;
99
- border-width: 0;
100
- box-sizing: border-box;
101
- }
76
+ : ((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: `
77
+ .image-wrapper-${item.id} {
78
+ position: absolute;
79
+ width: 100%;
80
+ height: 100%;
81
+ box-sizing: border-box;
82
+ display: flex;
83
+ }
84
+ .image {
85
+ width: 100%;
86
+ height: 100%;
87
+ opacity: 1;
88
+ object-fit: cover;
89
+ pointer-events: none;
90
+ border-style: solid;
91
+ overflow: hidden;
92
+ box-sizing: border-box;
93
+ }
94
+ .img-canvas {
95
+ border: solid;
96
+ width: 100%;
97
+ height: 100%;
98
+ pointer-events: none;
99
+ border-width: 0;
100
+ box-sizing: border-box;
101
+ }
102
102
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
103
- return (`
104
- .image-wrapper-${item.id} {
105
- opacity: ${layoutParams.opacity};
106
- transform: rotate(${area.angle}deg);
107
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
108
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
109
- }
110
- .image-${item.id} {
111
- border: solid;
112
- border-color: ${stroke};
113
- border-radius: ${layoutParams.radius * 100}vw;
114
- border-width: ${layoutParams.strokeWidth * 100}vw;
115
- }
103
+ return (`
104
+ .image-wrapper-${item.id} {
105
+ opacity: ${layoutParams.opacity};
106
+ transform: rotate(${area.angle}deg);
107
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
108
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
109
+ }
110
+ .image-${item.id} {
111
+ border: solid;
112
+ border-color: ${stroke};
113
+ border-radius: ${layoutParams.radius * 100}vw;
114
+ border-width: ${layoutParams.strokeWidth * 100}vw;
115
+ }
116
116
  `);
117
- })}
117
+ })}
118
118
  ` })] }) }));
119
119
  };
120
120
  exports.ImageItem = ImageItem;
@@ -136,72 +136,72 @@ const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
136
136
  else {
137
137
  videoRef.play();
138
138
  }
139
- } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
140
- .video-wrapper-${item.id} {
141
- position: absolute;
142
- overflow: hidden;
143
- width: 100%;
144
- height: 100%;
145
- box-sizing: border-box;
146
- opacity: ${opacity};
147
- }
148
- .video-overlay-${item.id} {
149
- position: absolute;
150
- top: 0;
151
- left: 0;
152
- cursor: pointer;
153
- width: 100%;
154
- height: 100%;
155
- }
156
- .video-cover-${item.id} {
157
- position: absolute;
158
- top: 0;
159
- left: 0;
160
- cursor: pointer;
161
- width: 100%;
162
- height: 100%;
163
- object-fit: cover;
164
- }
165
- .video {
166
- width: 100%;
167
- height: 100%;
168
- box-sizing: border-box;
169
- opacity: 1;
170
- object-fit: cover;
171
- overflow: hidden;
172
- border-style: solid;
173
- }
174
- .video-${item.id} {
175
- border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
176
- }
177
- .video-playback-wrapper {
178
- display: flex;
179
- justify-content: center;
180
- }
181
- .video-canvas {
182
- border: solid;
183
- width: 100%;
184
- height: 100%;
185
- pointer-events: none;
186
- border-width: 0;
187
- box-sizing: border-box;
188
- }
139
+ } })))] }))] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
140
+ .video-wrapper-${item.id} {
141
+ position: absolute;
142
+ overflow: hidden;
143
+ width: 100%;
144
+ height: 100%;
145
+ box-sizing: border-box;
146
+ opacity: ${opacity};
147
+ }
148
+ .video-overlay-${item.id} {
149
+ position: absolute;
150
+ top: 0;
151
+ left: 0;
152
+ cursor: pointer;
153
+ width: 100%;
154
+ height: 100%;
155
+ }
156
+ .video-cover-${item.id} {
157
+ position: absolute;
158
+ top: 0;
159
+ left: 0;
160
+ cursor: pointer;
161
+ width: 100%;
162
+ height: 100%;
163
+ object-fit: cover;
164
+ }
165
+ .video {
166
+ width: 100%;
167
+ height: 100%;
168
+ box-sizing: border-box;
169
+ opacity: 1;
170
+ object-fit: cover;
171
+ overflow: hidden;
172
+ border-style: solid;
173
+ }
174
+ .video-${item.id} {
175
+ border-radius: ${radius !== undefined ? `${radius * 100}vw` : '0'};
176
+ }
177
+ .video-playback-wrapper {
178
+ display: flex;
179
+ justify-content: center;
180
+ }
181
+ .video-canvas {
182
+ border: solid;
183
+ width: 100%;
184
+ height: 100%;
185
+ pointer-events: none;
186
+ border-width: 0;
187
+ box-sizing: border-box;
188
+ }
189
189
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
190
- return (`
191
- .video-wrapper-${item.id} {
192
- opacity: ${layoutParams.opacity};
193
- transform: rotate(${area.angle}deg);
194
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
195
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
196
- }
197
- .video-${item.id} {
198
- border: solid;
199
- border-color: ${stroke};
200
- border-radius: ${layoutParams.radius * 100}vw;
201
- border-width: ${layoutParams.strokeWidth * 100}vw;
202
- }
190
+ return (`
191
+ .video-wrapper-${item.id} {
192
+ opacity: ${layoutParams.opacity};
193
+ transform: rotate(${area.angle}deg);
194
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
195
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
196
+ }
197
+ .video-${item.id} {
198
+ border: solid;
199
+ border-color: ${stroke};
200
+ border-radius: ${layoutParams.radius * 100}vw;
201
+ border-width: ${layoutParams.strokeWidth * 100}vw;
202
+ }
203
203
  `);
204
- })}
204
+ })}
205
205
  ` })] }));
206
206
  };
207
207
  exports.VideoItem = VideoItem;
@@ -51,22 +51,22 @@ const GroupItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityCha
51
51
  }
52
52
  }, 0);
53
53
  }, [itemIds, item.id]);
54
- 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: `
55
- .group-${item.id} {
56
- position: absolute;
57
- width: 100%;
58
- height: 100%;
59
- box-sizing: border-box;
60
- }
54
+ 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: `
55
+ .group-${item.id} {
56
+ position: absolute;
57
+ width: 100%;
58
+ height: 100%;
59
+ box-sizing: border-box;
60
+ }
61
61
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
62
- return (`
63
- .group-${item.id} {
64
- opacity: ${layoutParams.opacity};
65
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
66
- transform: rotate(${area.angle}deg);
67
- }
62
+ return (`
63
+ .group-${item.id} {
64
+ opacity: ${layoutParams.opacity};
65
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
66
+ transform: rotate(${area.angle}deg);
67
+ }
68
68
  `);
69
- })}
69
+ })}
70
70
  ` })] }) }));
71
71
  };
72
72
  exports.GroupItem = GroupItem;
@@ -29,9 +29,9 @@ const useItemPointerEvents_1 = require("./useItemPointerEvents");
29
29
  const useItemArea_1 = require("./useItemArea");
30
30
  const useDraggable_1 = require("./useDraggable");
31
31
  const ItemGeometryContext_1 = require("../../ItemGeometry/ItemGeometryContext");
32
- const stickyFix = `
33
- -webkit-transform: translate3d(0, 0, 0);
34
- transform: translate3d(0, 0, 0);
32
+ const stickyFix = `
33
+ -webkit-transform: translate3d(0, 0, 0);
34
+ transform: translate3d(0, 0, 0);
35
35
  `;
36
36
  const noop = () => null;
37
37
  const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false }) => {
@@ -144,40 +144,40 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
144
144
  ? 'grab'
145
145
  : hasClickTriggers
146
146
  ? 'pointer'
147
- : '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: `
147
+ : '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: `
148
148
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, sticky, sectionHeight, layoutParams]) => {
149
149
  const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
150
150
  const isScreenBasedBottom = area.positionType === sdk_1.PositionType.ScreenBased && area.anchorSide === sdk_1.AnchorSide.Bottom;
151
151
  const scaleAnchor = area.scaleAnchor;
152
- return (`
153
- .item-${item.id} {
154
- position: ${sticky ? 'sticky' : 'absolute'};
155
- top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
156
- transition: opacity 0.2s linear 0.1s;
157
- pointer-events: none;
158
- display: ${hidden ? 'none' : 'block'};
159
- height: fit-content;
160
- }
161
- .item-${item.id}-inner {
152
+ return (`
153
+ .item-${item.id} {
154
+ position: ${sticky ? 'sticky' : 'absolute'};
155
+ top: ${sticky ? `${(0, getAnchoredItemTop_1.getAnchoredItemTop)(area.top - sticky.from, sectionHeight, area.anchorSide)}` : 0};
156
+ transition: opacity 0.2s linear 0.1s;
157
+ pointer-events: none;
158
+ display: ${hidden ? 'none' : 'block'};
159
+ height: fit-content;
160
+ }
161
+ .item-${item.id}-inner {
162
162
  width: ${sizingAxis.x === 'manual'
163
163
  ? `${area.width * 100}vw`
164
- : 'max-content'};
165
- height: ${sizingAxis.y === 'manual' ? `${area.height * 100}vw` : 'unset'};
166
- transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
167
- transform: scale(${area.scale});
168
- position: relative;
169
- }
170
- .item-wrapper-${item.id} {
171
- position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
172
- z-index: ${area.zIndex};
173
- ${!isInGroup && stickyFix}
174
- pointer-events: none;
175
- bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
176
- top: ${isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
177
- left: ${area.left * 100}vw;
178
- }
164
+ : 'max-content'};
165
+ height: ${sizingAxis.y === 'manual' ? `${area.height * 100}vw` : 'unset'};
166
+ transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
167
+ transform: scale(${area.scale});
168
+ position: relative;
169
+ }
170
+ .item-wrapper-${item.id} {
171
+ position: ${area.positionType === sdk_1.PositionType.ScreenBased ? 'fixed' : 'absolute'};
172
+ z-index: ${area.zIndex};
173
+ ${!isInGroup && stickyFix}
174
+ pointer-events: none;
175
+ bottom: ${isScreenBasedBottom ? `${-area.top * 100}vw` : 'unset'};
176
+ top: ${isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(area.top, area.anchorSide)};
177
+ left: ${area.left * 100}vw;
178
+ }
179
179
  `);
180
- })}
180
+ })}
181
181
  ` })] }));
182
182
  };
183
183
  exports.Item = Item;
@@ -60,35 +60,35 @@ const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilit
60
60
  ? (_b = (0, getFill_1.getFill)(value)) !== null && _b !== void 0 ? _b : 'transparent'
61
61
  : 'transparent';
62
62
  return ((0, jsx_runtime_1.jsx)(Fill, { fill: value, itemId: item.id, background: background, solidTransition: solidTransition, transition: (stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) || '', radius: radius, strokeWidth: strokeWidth, isHighest: index === itemFill.length - 1, borderColor: stroke }, fill.id));
63
- }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
64
- .rectangle-${item.id} {
65
- position: absolute;
66
- width: 100%;
67
- height: 100%;
68
- box-sizing: border-box;
69
- },
70
- .image-fill-${item.id} {
71
- position: absolute;
72
- top: 0;
73
- left: 0;
74
- width: 100%;
75
- height: 100%;
76
- transform-origin: center center;
77
- z-index: 1;
78
- background-position: center;
79
- },
63
+ }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
64
+ .rectangle-${item.id} {
65
+ position: absolute;
66
+ width: 100%;
67
+ height: 100%;
68
+ box-sizing: border-box;
69
+ },
70
+ .image-fill-${item.id} {
71
+ position: absolute;
72
+ top: 0;
73
+ left: 0;
74
+ width: 100%;
75
+ height: 100%;
76
+ transform-origin: center center;
77
+ z-index: 1;
78
+ background-position: center;
79
+ },
80
80
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
81
- return (`
82
- .rectangle-${item.id} {
83
- border-radius: ${layoutParams.radius * 100}vw
84
- transform: rotate(${area.angle}deg);
85
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
86
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
87
- backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
88
- -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
89
- }
81
+ return (`
82
+ .rectangle-${item.id} {
83
+ border-radius: ${layoutParams.radius * 100}vw
84
+ transform: rotate(${area.angle}deg);
85
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
86
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
87
+ backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
88
+ -webkit-backdrop-filter: ${layoutParams.backdropBlur !== 0 ? `blur(${layoutParams.backdropBlur * 100}vw)` : 'unset'};
89
+ }
90
90
  `);
91
- })}
91
+ })}
92
92
  ` })] }) }));
93
93
  };
94
94
  exports.RectangleItem = RectangleItem;
@@ -59,28 +59,28 @@ const RichTextItem = ({ item, sectionId, onResize, interactionCtrl, onVisibility
59
59
  }, [isInteractive, onVisibilityChange]);
60
60
  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]) => {
61
61
  const color = color_1.CntrlColor.parse(layoutParams.color);
62
- return (`
63
- .rich-text-wrapper-${item.id} {
64
- font-size: ${layoutParams.fontSize * 100}vw;
65
- line-height: ${layoutParams.lineHeight * 100}vw;
66
- letter-spacing: ${layoutParams.letterSpacing * 100}vw;
67
- word-spacing: ${layoutParams.wordSpacing * 100}vw;
68
- font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
69
- font-weight: ${layoutParams.fontWeight};
70
- font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
71
- vertical-align: ${layoutParams.verticalAlign};
72
- font-variant: ${layoutParams.fontVariant};
73
- color: ${color.fmt('rgba')};
74
- transform: rotate(${area.angle}deg);
75
- filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
76
- text-transform: ${layoutParams.textTransform};
77
- ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
78
- }
79
- @supports not (color: oklch(42% 0.3 90 / 1)) {
80
- .rich-text-wrapper-${item.id} {
81
- color: ${color.fmt('rgba')};
82
- }
83
- }
62
+ return (`
63
+ .rich-text-wrapper-${item.id} {
64
+ font-size: ${layoutParams.fontSize * 100}vw;
65
+ line-height: ${layoutParams.lineHeight * 100}vw;
66
+ letter-spacing: ${layoutParams.letterSpacing * 100}vw;
67
+ word-spacing: ${layoutParams.wordSpacing * 100}vw;
68
+ font-family: ${(0, getFontFamilyValue_1.getFontFamilyValue)(layoutParams.typeFace)};
69
+ font-weight: ${layoutParams.fontWeight};
70
+ font-style: ${layoutParams.fontStyle ? layoutParams.fontStyle : 'normal'};
71
+ vertical-align: ${layoutParams.verticalAlign};
72
+ font-variant: ${layoutParams.fontVariant};
73
+ color: ${color.fmt('rgba')};
74
+ transform: rotate(${area.angle}deg);
75
+ filter: ${layoutParams.blur !== 0 ? `blur(${layoutParams.blur * 100}vw)` : 'unset'};
76
+ text-transform: ${layoutParams.textTransform};
77
+ ${layoutParams.blur !== 0 ? 'will-change: transform;' : ''}
78
+ }
79
+ @supports not (color: oklch(42% 0.3 90 / 1)) {
80
+ .rich-text-wrapper-${item.id} {
81
+ color: ${color.fmt('rgba')};
82
+ }
83
+ }
84
84
  `);
85
85
  })}`] })] }));
86
86
  };
@@ -400,6 +400,36 @@ class InteractionsRegistry {
400
400
  });
401
401
  (_a = this.ctrls.get(itemId)) === null || _a === void 0 ? void 0 : _a.receiveChange();
402
402
  }
403
+ notifyPageOverlay() {
404
+ for (const interaction of this.interactions) {
405
+ const currentStateId = this.getCurrentStateByInteractionId(interaction.id);
406
+ const startStateId = interaction.startStateId;
407
+ if (currentStateId === startStateId)
408
+ continue;
409
+ const hasScrollTriggers = interaction.triggers.find((trigger) => trigger.type === 'item-scroll-position' || trigger.type === 'scroll-position');
410
+ if (hasScrollTriggers)
411
+ continue;
412
+ const hoverOutTriggers = interaction.triggers.filter((trigger) => {
413
+ if (!('triggerEvent' in trigger))
414
+ return false;
415
+ if (trigger.triggerEvent !== 'hover-out')
416
+ return false;
417
+ if (trigger.from !== currentStateId)
418
+ return false;
419
+ if (trigger.to !== startStateId)
420
+ return false;
421
+ return true;
422
+ });
423
+ for (const trigger of hoverOutTriggers) {
424
+ if (!('itemId' in trigger))
425
+ continue;
426
+ const itemId = trigger.itemId;
427
+ if (this.isItemScrollBasedTrigger(itemId))
428
+ continue;
429
+ this.notifyItemTrigger(itemId, 'hover-out');
430
+ }
431
+ }
432
+ }
403
433
  getCurrentStateByInteractionId(id) {
404
434
  let state;
405
435
  for (const interactionId of Object.keys(this.interactionStateMap)) {
@@ -35,6 +35,17 @@ const InteractionsProvider = ({ article, children }) => {
35
35
  }, 0);
36
36
  });
37
37
  }, [registry]);
38
+ (0, react_1.useEffect)(() => {
39
+ const handlePageOverlay = () => {
40
+ if (!registry)
41
+ return;
42
+ registry.notifyPageOverlay();
43
+ };
44
+ window.addEventListener('page-overlay', handlePageOverlay);
45
+ return () => {
46
+ window.removeEventListener('page-overlay', handlePageOverlay);
47
+ };
48
+ }, [registry]);
38
49
  (0, react_1.useEffect)(() => {
39
50
  if (document.readyState === 'complete') {
40
51
  notifyLoad();