@cntrl-site/sdk-nextjs 1.1.5-alpha.2 → 1.2.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 (75) hide show
  1. package/cntrl-site-sdk-nextjs-1.2.3.tgz +0 -0
  2. package/lib/components/Article.js +2 -2
  3. package/lib/components/{Section.js → Section/Section.js} +2 -2
  4. package/lib/components/{useSectionHeightMap.js → Section/useSectionHeightMap.js} +1 -1
  5. package/lib/components/items/{CodeEmbedItem.js → CodeEmbedItem/CodeEmbedItem.js} +2 -2
  6. package/lib/components/items/{useCodeEmbedItem.js → CodeEmbedItem/useCodeEmbedItem.js} +2 -2
  7. package/lib/components/items/CompoundItem/CompoundChild.js +115 -0
  8. package/lib/components/items/CompoundItem/CompoundItem.js +52 -0
  9. package/lib/components/items/CompoundItem/useCompoundItem.js +17 -0
  10. package/lib/components/items/{CustomItem.js → CustomItem/CustomItem.js} +2 -2
  11. package/lib/components/items/{VimeoEmbed.js → EmbedVideoItem/VimeoEmbed.js} +4 -4
  12. package/lib/components/items/{YoutubeEmbed.js → EmbedVideoItem/YoutubeEmbed.js} +5 -5
  13. package/lib/components/items/{useEmbedVideoItem.js → EmbedVideoItem/useEmbedVideoItem.js} +2 -2
  14. package/lib/components/items/{ImageItem.js → FileItem/ImageItem.js} +6 -6
  15. package/lib/components/items/{VideoItem.js → FileItem/VideoItem.js} +5 -5
  16. package/lib/components/items/{useFileItem.js → FileItem/useFileItem.js} +2 -2
  17. package/lib/components/items/{GroupItem.js → GroupItem/GroupItem.js} +5 -5
  18. package/lib/components/items/{useGroupItem.js → GroupItem/useGroupItem.js} +2 -2
  19. package/lib/components/{Item.js → items/Item.js} +24 -47
  20. package/lib/components/items/{RectangleItem.js → RectangleItem/RectangleItem.js} +3 -3
  21. package/lib/components/items/{useRectangleItem.js → RectangleItem/useRectangleItem.js} +2 -2
  22. package/lib/components/items/{RichTextItem.js → RichTextItem/RichTextItem.js} +7 -7
  23. package/lib/components/items/{useRichTextItem.js → RichTextItem/useRichTextItem.js} +2 -2
  24. package/lib/components/items/RichTextWrapper.js +10 -0
  25. package/lib/components/items/itemsMap.js +26 -0
  26. package/lib/components/{useItemAngle.js → items/useItemAngle.js} +1 -1
  27. package/lib/components/{useItemDimensions.js → items/useItemDimensions.js} +2 -2
  28. package/lib/components/{useItemPosition.js → items/useItemPosition.js} +4 -9
  29. package/lib/components/{useItemScale.js → items/useItemScale.js} +2 -2
  30. package/lib/index.js +8 -8
  31. package/lib/interactions/InteractionsRegistry.js +6 -14
  32. package/lib/utils/RichTextConverter/RichTextConverter.js +1 -1
  33. package/lib/utils/getCompoundBondaryStyles.js +61 -0
  34. package/lib/utils/isItemType.js +7 -0
  35. package/package.json +2 -4
  36. package/src/components/Article.tsx +2 -2
  37. package/src/components/{Section.tsx → Section/Section.tsx} +2 -2
  38. package/src/components/{useSectionColor.ts → Section/useSectionColor.ts} +1 -1
  39. package/src/components/{useSectionHeightMap.ts → Section/useSectionHeightMap.ts} +1 -1
  40. package/src/components/items/{CodeEmbedItem.tsx → CodeEmbedItem/CodeEmbedItem.tsx} +2 -2
  41. package/src/components/items/{useCodeEmbedItem.ts → CodeEmbedItem/useCodeEmbedItem.ts} +2 -2
  42. package/src/components/items/CompoundItem/CompoundChild.tsx +160 -0
  43. package/src/components/items/CompoundItem/CompoundItem.tsx +70 -0
  44. package/src/components/items/CompoundItem/useCompoundItem.ts +21 -0
  45. package/src/components/items/{CustomItem.tsx → CustomItem/CustomItem.tsx} +2 -2
  46. package/src/components/items/{VimeoEmbed.tsx → EmbedVideoItem/VimeoEmbed.tsx} +4 -5
  47. package/src/components/items/{YoutubeEmbed.tsx → EmbedVideoItem/YoutubeEmbed.tsx} +6 -6
  48. package/src/components/items/{useEmbedVideoItem.ts → EmbedVideoItem/useEmbedVideoItem.ts} +2 -2
  49. package/src/components/items/{ImageItem.tsx → FileItem/ImageItem.tsx} +6 -6
  50. package/src/components/items/{VideoItem.tsx → FileItem/VideoItem.tsx} +5 -5
  51. package/src/components/items/{useFileItem.ts → FileItem/useFileItem.ts} +2 -2
  52. package/src/components/items/{GroupItem.tsx → GroupItem/GroupItem.tsx} +4 -5
  53. package/src/components/items/{useGroupItem.ts → GroupItem/useGroupItem.ts} +2 -2
  54. package/src/components/{Item.tsx → items/Item.tsx} +24 -59
  55. package/src/components/items/{RectangleItem.tsx → RectangleItem/RectangleItem.tsx} +3 -3
  56. package/src/components/items/{useRectangleItem.ts → RectangleItem/useRectangleItem.ts} +2 -2
  57. package/src/components/items/{RichTextItem.tsx → RichTextItem/RichTextItem.tsx} +7 -7
  58. package/src/components/items/{useRichTextItem.ts → RichTextItem/useRichTextItem.ts} +2 -2
  59. package/src/components/items/RichTextWrapper.tsx +15 -0
  60. package/src/components/items/itemsMap.ts +26 -0
  61. package/src/components/{useItemAngle.ts → items/useItemAngle.ts} +1 -1
  62. package/src/components/{useItemDimensions.ts → items/useItemDimensions.ts} +2 -2
  63. package/src/components/{useItemPosition.ts → items/useItemPosition.ts} +6 -9
  64. package/src/components/{useItemScale.ts → items/useItemScale.ts} +2 -2
  65. package/src/index.ts +8 -8
  66. package/src/interactions/InteractionsRegistry.ts +7 -14
  67. package/src/utils/RichTextConverter/RichTextConverter.tsx +1 -1
  68. package/src/utils/getCompoundBondaryStyles.ts +62 -0
  69. package/src/utils/isItemType.ts +6 -0
  70. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  71. package/.idea/inspectionProfiles/Project_Default.xml +0 -15
  72. package/lib/interactions/AudioPlayer.js +0 -16
  73. package/src/interactions/AudioPlayer.ts +0 -16
  74. /package/lib/components/{LinkWrapper.js → items/LinkWrapper.js} +0 -0
  75. /package/src/components/{LinkWrapper.tsx → items/LinkWrapper.tsx} +0 -0
Binary file
@@ -7,8 +7,8 @@ exports.Article = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const style_1 = __importDefault(require("styled-jsx/style"));
10
- const Section_1 = require("./Section");
11
- const Item_1 = require("./Item");
10
+ const Section_1 = require("./Section/Section");
11
+ const Item_1 = require("./items/Item");
12
12
  const useArticleRectObserver_1 = require("../utils/ArticleRectManager/useArticleRectObserver");
13
13
  const ArticleRectContext_1 = require("../provider/ArticleRectContext");
14
14
  const ArticleWrapper_1 = require("./ArticleWrapper");
@@ -8,8 +8,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const style_1 = __importDefault(require("styled-jsx/style"));
10
10
  const sdk_1 = require("@cntrl-site/sdk");
11
- const useCntrlContext_1 = require("../provider/useCntrlContext");
12
- const useSectionRegistry_1 = require("../utils/ArticleRectManager/useSectionRegistry");
11
+ const useCntrlContext_1 = require("../../provider/useCntrlContext");
12
+ const useSectionRegistry_1 = require("../../utils/ArticleRectManager/useSectionRegistry");
13
13
  const color_1 = require("@cntrl-site/color");
14
14
  const DEFAULT_COLOR = 'rgba(0, 0, 0, 0)';
15
15
  const Section = ({ section, data, children }) => {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSectionHeightMap = exports.useSectionHeightData = void 0;
4
4
  const react_1 = require("react");
5
- const CntrlContext_1 = require("../provider/CntrlContext");
5
+ const CntrlContext_1 = require("../../provider/CntrlContext");
6
6
  const Section_1 = require("./Section");
7
7
  const useSectionHeightData = (sectionId) => {
8
8
  const sectionHeightContext = (0, react_1.useContext)(CntrlContext_1.CntrlContext);
@@ -7,9 +7,9 @@ exports.CodeEmbedItem = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const sdk_1 = require("@cntrl-site/sdk");
9
9
  const react_1 = require("react");
10
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
10
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
11
11
  const style_1 = __importDefault(require("styled-jsx/style"));
12
- const useRegisterResize_1 = require("../../common/useRegisterResize");
12
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
13
13
  const useItemAngle_1 = require("../useItemAngle");
14
14
  const LinkWrapper_1 = require("../LinkWrapper");
15
15
  const useCodeEmbedItem_1 = require("./useCodeEmbedItem");
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCodeEmbedItem = void 0;
4
4
  const sdk_1 = require("@cntrl-site/sdk");
5
- const useLayoutContext_1 = require("../useLayoutContext");
6
- const useKeyframeValue_1 = require("../../common/useKeyframeValue");
5
+ const useLayoutContext_1 = require("../../useLayoutContext");
6
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
7
7
  const useCodeEmbedItem = (item, sectionId) => {
8
8
  const layoutId = (0, useLayoutContext_1.useLayoutContext)();
9
9
  const blur = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.Blur, (item, layoutId) => {
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CompoundChild = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
10
+ const useLayoutContext_1 = require("../../useLayoutContext");
11
+ const useExemplary_1 = require("../../../common/useExemplary");
12
+ const useItemScale_1 = require("../useItemScale");
13
+ const useItemInteractionCtrl_1 = require("../../../interactions/useItemInteractionCtrl");
14
+ const useItemPosition_1 = require("../useItemPosition");
15
+ const useItemDimensions_1 = require("../useItemDimensions");
16
+ const sdk_1 = require("@cntrl-site/sdk");
17
+ const style_1 = __importDefault(require("styled-jsx/style"));
18
+ const ScaleAnchorMap_1 = require("../../../utils/ScaleAnchorMap");
19
+ const isItemType_1 = require("../../../utils/isItemType");
20
+ const RichTextWrapper_1 = require("../RichTextWrapper");
21
+ const itemsMap_1 = require("../itemsMap");
22
+ const getCompoundBondaryStyles_1 = require("../../../utils/getCompoundBondaryStyles");
23
+ const noop = () => null;
24
+ const CompoundChild = ({ item, sectionId, isParentVisible = true }) => {
25
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26
+ const id = (0, react_1.useId)();
27
+ const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
28
+ const layout = (0, useLayoutContext_1.useLayoutContext)();
29
+ const exemplary = (0, useExemplary_1.useExemplary)();
30
+ const [allowPointerEvents, setAllowPointerEvents] = (0, react_1.useState)(isParentVisible);
31
+ const itemScale = (0, useItemScale_1.useItemScale)(item, sectionId);
32
+ const interactionCtrl = (0, useItemInteractionCtrl_1.useItemInteractionCtrl)(item.id);
33
+ const wrapperStateProps = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getState(['top', 'left']);
34
+ const innerStateProps = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getState(['width', 'height', 'scale']);
35
+ const position = (0, useItemPosition_1.useItemPosition)(item, sectionId, {
36
+ top: (_a = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.styles) === null || _a === void 0 ? void 0 : _a.top,
37
+ left: (_b = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.styles) === null || _b === void 0 ? void 0 : _b.left,
38
+ });
39
+ const compoundSettings = layout && item.compoundSettings ? item.compoundSettings[layout] : undefined;
40
+ const dimensions = (0, useItemDimensions_1.useItemDimensions)(item, sectionId);
41
+ const isInitialRef = (0, react_1.useRef)(true);
42
+ const sizing = layout && (0, isItemType_1.isItemType)(item, sdk_1.ArticleItemType.RichText)
43
+ ? item.layoutParams[layout].sizing
44
+ : undefined;
45
+ const sizingAxis = parseSizing(sizing);
46
+ const ItemComponent = itemsMap_1.itemsMap[item.type] || noop;
47
+ const handleVisibilityChange = (0, react_1.useCallback)((isVisible) => {
48
+ if (!isParentVisible)
49
+ return;
50
+ setAllowPointerEvents(isVisible);
51
+ }, [isParentVisible]);
52
+ (0, react_1.useEffect)(() => {
53
+ isInitialRef.current = false;
54
+ }, []);
55
+ const transformOrigin = compoundSettings ? ScaleAnchorMap_1.ScaleAnchorMap[compoundSettings.positionAnchor] : 'top left';
56
+ const isRichText = (0, isItemType_1.isItemType)(item, sdk_1.ArticleItemType.RichText);
57
+ const width = ((_d = (_c = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : dimensions === null || dimensions === void 0 ? void 0 : dimensions.width);
58
+ const height = ((_f = (_e = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : dimensions === null || dimensions === void 0 ? void 0 : dimensions.height);
59
+ const scale = (_h = (_g = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _g === void 0 ? void 0 : _g.scale) !== null && _h !== void 0 ? _h : itemScale;
60
+ const hasClickTriggers = (_j = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getHasTrigger(item.id, 'click')) !== null && _j !== void 0 ? _j : false;
61
+ if (!item.compoundSettings)
62
+ return null;
63
+ const layoutValues = [item.area, item.hidden, item.compoundSettings];
64
+ if (item.layoutParams) {
65
+ layoutValues.push(item.layoutParams);
66
+ }
67
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `item-${item.id}`, onTransitionEnd: (e) => {
68
+ var _a;
69
+ e.stopPropagation();
70
+ (_a = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.handleTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(interactionCtrl, e.propertyName);
71
+ }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (position && compoundSettings ? { top: (0, getCompoundBondaryStyles_1.getCompoundTop)(compoundSettings, position.top) } : {})), (position && compoundSettings ? { left: (0, getCompoundBondaryStyles_1.getCompoundLeft)(compoundSettings, position.left) } : {})), (width && compoundSettings
72
+ ? { width: `${sizingAxis.x === 'manual'
73
+ ? (0, getCompoundBondaryStyles_1.getCompoundWidth)(compoundSettings, width, isRichText, exemplary)
74
+ : 'max-content'}` }
75
+ : {})), (height && compoundSettings
76
+ ? { height: `${sizingAxis.y === 'manual'
77
+ ? (0, getCompoundBondaryStyles_1.getCompoundHeight)(compoundSettings, height)
78
+ : 'unset'}` }
79
+ : {})), (scale && compoundSettings ? { transform: `scale(${scale}) ${(0, getCompoundBondaryStyles_1.getCompoundTransform)(compoundSettings)}` } : {})), { transition: (_k = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _k !== void 0 ? _k : 'none', cursor: hasClickTriggers ? 'pointer' : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none' }), onClick: () => {
80
+ interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.sendTrigger('click');
81
+ }, onMouseEnter: () => {
82
+ interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.sendTrigger('hover-in');
83
+ }, onMouseLeave: () => {
84
+ interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.sendTrigger('hover-out');
85
+ }, children: [(0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, transformOrigin: transformOrigin, children: (0, jsx_runtime_1.jsx)(ItemComponent, { item: item, sectionId: sectionId, interactionCtrl: interactionCtrl, onVisibilityChange: handleVisibilityChange }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
86
+ ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, compoundSettings, layoutParams]) => {
87
+ const sizingAxis = parseSizing(layoutParams.sizing);
88
+ const scaleAnchor = area.scaleAnchor;
89
+ return (`
90
+ .item-${item.id} {
91
+ position: absolute;
92
+ top: ${(0, getCompoundBondaryStyles_1.getCompoundTop)(compoundSettings, area.top)};
93
+ left: ${(0, getCompoundBondaryStyles_1.getCompoundLeft)(compoundSettings, area.left)};
94
+ transition: opacity 0.2s linear 0.1s;
95
+ display: ${hidden ? 'none' : 'block'};
96
+ width: ${sizingAxis.x === 'manual'
97
+ ? `${(0, getCompoundBondaryStyles_1.getCompoundWidth)(compoundSettings, area.width, isRichText)}`
98
+ : 'max-content'};
99
+ height: ${sizingAxis.y === 'manual' ? `${(0, getCompoundBondaryStyles_1.getCompoundHeight)(compoundSettings, area.height)}` : 'unset'};
100
+ transform-origin: ${ScaleAnchorMap_1.ScaleAnchorMap[scaleAnchor]};
101
+ transform: scale(${area.scale}) ${(0, getCompoundBondaryStyles_1.getCompoundTransform)(compoundSettings)};
102
+ z-index: ${area.zIndex};
103
+ }
104
+ `);
105
+ })}
106
+ ` })] }));
107
+ };
108
+ exports.CompoundChild = CompoundChild;
109
+ function parseSizing(sizing = 'manual') {
110
+ const axisSizing = sizing.split(' ');
111
+ return {
112
+ y: axisSizing[0],
113
+ x: axisSizing[1] ? axisSizing[1] : axisSizing[0]
114
+ };
115
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CompoundItem = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const useItemAngle_1 = require("../useItemAngle");
10
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
11
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
12
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
13
+ const LinkWrapper_1 = require("../LinkWrapper");
14
+ const style_1 = __importDefault(require("styled-jsx/style"));
15
+ const sdk_1 = require("@cntrl-site/sdk");
16
+ const CompoundChild_1 = require("./CompoundChild");
17
+ const useCompoundItem_1 = require("./useCompoundItem");
18
+ const CompoundItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
19
+ var _a, _b, _c, _d, _e;
20
+ const id = (0, react_1.useId)();
21
+ const { items } = item;
22
+ const itemAngle = (0, useItemAngle_1.useItemAngle)(item, sectionId);
23
+ const { layouts } = (0, useCntrlContext_1.useCntrlContext)();
24
+ const { opacity: itemOpacity } = (0, useCompoundItem_1.useCompoundItem)(item, sectionId);
25
+ const layoutValues = [item.area, item.layoutParams];
26
+ const [ref, setRef] = (0, react_1.useState)(null);
27
+ (0, useRegisterResize_1.useRegisterResize)(ref, onResize);
28
+ const stateParams = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getState(['opacity', 'angle']);
29
+ const angle = (0, getStyleFromItemStateAndParams_1.getStyleFromItemStateAndParams)((_a = stateParams === null || stateParams === void 0 ? void 0 : stateParams.styles) === null || _a === void 0 ? void 0 : _a.angle, itemAngle);
30
+ const opacity = (0, getStyleFromItemStateAndParams_1.getStyleFromItemStateAndParams)((_b = stateParams === null || stateParams === void 0 ? void 0 : stateParams.styles) === null || _b === void 0 ? void 0 : _b.opacity, itemOpacity);
31
+ const isInteractive = opacity !== 0 && opacity !== undefined;
32
+ (0, react_1.useEffect)(() => {
33
+ onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(isInteractive);
34
+ }, [isInteractive, onVisibilityChange]);
35
+ return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_c = item.link) === null || _c === void 0 ? void 0 : _c.url, target: (_d = item.link) === null || _d === void 0 ? void 0 : _d.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `compound-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_e = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _e !== void 0 ? _e : 'none' }), children: items && items.map(item => ((0, jsx_runtime_1.jsx)(CompoundChild_1.CompoundChild, { item: item, sectionId: sectionId, isParentVisible: isInteractive }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
36
+ .compound-${item.id} {
37
+ position: absolute;
38
+ width: 100%;
39
+ height: 100%;
40
+ box-sizing: border-box;
41
+ }
42
+ ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, layoutParams]) => {
43
+ return (`
44
+ .compound-${item.id} {
45
+ opacity: ${layoutParams.opacity};
46
+ transform: rotate(${area.angle}deg);
47
+ }
48
+ `);
49
+ })}
50
+ ` })] }) }));
51
+ };
52
+ exports.CompoundItem = CompoundItem;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCompoundItem = void 0;
4
+ const sdk_1 = require("@cntrl-site/sdk");
5
+ const useLayoutContext_1 = require("../../useLayoutContext");
6
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
7
+ function useCompoundItem(item, sectionId) {
8
+ const layoutId = (0, useLayoutContext_1.useLayoutContext)();
9
+ const opacity = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.Opacity, (item, layoutId) => {
10
+ if (!layoutId)
11
+ return;
12
+ const layoutParams = item.layoutParams[layoutId];
13
+ return 'opacity' in layoutParams ? layoutParams.opacity : 1;
14
+ }, (animator, scroll, value) => value !== undefined ? animator.getOpacity({ opacity: value }, scroll).opacity : undefined, sectionId, [layoutId]);
15
+ return { opacity };
16
+ }
17
+ exports.useCompoundItem = useCompoundItem;
@@ -7,9 +7,9 @@ exports.CustomItem = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const sdk_1 = require("@cntrl-site/sdk");
9
9
  const react_1 = require("react");
10
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
10
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
11
11
  const style_1 = __importDefault(require("styled-jsx/style"));
12
- const useRegisterResize_1 = require("../../common/useRegisterResize");
12
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
13
13
  const useItemAngle_1 = require("../useItemAngle");
14
14
  const CustomItem = ({ item, onResize, sectionId, interactionCtrl }) => {
15
15
  var _a, _b, _c;
@@ -21,9 +21,9 @@ const LinkWrapper_1 = require("../LinkWrapper");
21
21
  const useEmbedVideoItem_1 = require("./useEmbedVideoItem");
22
22
  const useItemAngle_1 = require("../useItemAngle");
23
23
  const sdk_1 = require("@cntrl-site/sdk");
24
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
25
- const useRegisterResize_1 = require("../../common/useRegisterResize");
26
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
24
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
25
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
26
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
27
27
  const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
28
28
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
29
29
  const id = (0, react_1.useId)();
@@ -61,7 +61,7 @@ const VimeoEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibili
61
61
  (0, react_1.useEffect)(() => {
62
62
  if (!vimeoPlayer || !imgRef)
63
63
  return;
64
- if (play === 'on-click') {
64
+ if (play === 'on-click' && !controls) {
65
65
  setIsCoverVisible(true);
66
66
  }
67
67
  vimeoPlayer.on('pause', (e) => {
@@ -8,14 +8,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const style_1 = __importDefault(require("styled-jsx/style"));
10
10
  const LinkWrapper_1 = require("../LinkWrapper");
11
- const getValidYoutubeUrl_1 = require("../../utils/getValidYoutubeUrl");
11
+ const getValidYoutubeUrl_1 = require("../../../utils/getValidYoutubeUrl");
12
12
  const useEmbedVideoItem_1 = require("./useEmbedVideoItem");
13
13
  const useItemAngle_1 = require("../useItemAngle");
14
14
  const sdk_1 = require("@cntrl-site/sdk");
15
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
16
- const useYouTubeIframeApi_1 = require("../../utils/Youtube/useYouTubeIframeApi");
17
- const useRegisterResize_1 = require("../../common/useRegisterResize");
18
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
15
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
16
+ const useYouTubeIframeApi_1 = require("../../../utils/Youtube/useYouTubeIframeApi");
17
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
18
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
19
19
  const YoutubeEmbedItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
20
20
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21
21
  const id = (0, react_1.useId)();
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useEmbedVideoItem = void 0;
4
4
  const sdk_1 = require("@cntrl-site/sdk");
5
- const useKeyframeValue_1 = require("../../common/useKeyframeValue");
6
- const useLayoutContext_1 = require("../useLayoutContext");
5
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
6
+ const useLayoutContext_1 = require("../../useLayoutContext");
7
7
  const useEmbedVideoItem = (item, sectionId) => {
8
8
  const layoutId = (0, useLayoutContext_1.useLayoutContext)();
9
9
  const radius = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.BorderRadius, (item, layoutId) => {
@@ -12,12 +12,12 @@ const sdk_1 = require("@cntrl-site/sdk");
12
12
  const LinkWrapper_1 = require("../LinkWrapper");
13
13
  const useFileItem_1 = require("./useFileItem");
14
14
  const useItemAngle_1 = require("../useItemAngle");
15
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
16
- const useRegisterResize_1 = require("../../common/useRegisterResize");
17
- const useImageFx_1 = require("../../utils/effects/useImageFx");
18
- const useElementRect_1 = require("../../utils/useElementRect");
19
- const useLayoutContext_1 = require("../useLayoutContext");
20
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
15
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
16
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
17
+ const useImageFx_1 = require("../../../utils/effects/useImageFx");
18
+ const useElementRect_1 = require("../../../utils/useElementRect");
19
+ const useLayoutContext_1 = require("../../useLayoutContext");
20
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
21
21
  const baseVariables = `precision mediump float;
22
22
  uniform sampler2D u_image;
23
23
  uniform sampler2D u_pattern;
@@ -12,11 +12,11 @@ const sdk_1 = require("@cntrl-site/sdk");
12
12
  const LinkWrapper_1 = require("../LinkWrapper");
13
13
  const useFileItem_1 = require("./useFileItem");
14
14
  const useItemAngle_1 = require("../useItemAngle");
15
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
16
- const useRegisterResize_1 = require("../../common/useRegisterResize");
17
- const useLayoutContext_1 = require("../useLayoutContext");
18
- const ScrollPlaybackVideo_1 = require("../ScrollPlaybackVideo");
19
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
15
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
16
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
17
+ const useLayoutContext_1 = require("../../useLayoutContext");
18
+ const ScrollPlaybackVideo_1 = require("../../ScrollPlaybackVideo");
19
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
20
20
  const VideoItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
21
21
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
22
22
  const id = (0, react_1.useId)();
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFileItem = void 0;
4
4
  const sdk_1 = require("@cntrl-site/sdk");
5
- const useKeyframeValue_1 = require("../../common/useKeyframeValue");
6
- const useLayoutContext_1 = require("../useLayoutContext");
5
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
6
+ const useLayoutContext_1 = require("../../useLayoutContext");
7
7
  const DEFAULT_COLOR = 'rgba(0, 0, 0, 1)';
8
8
  const useFileItem = (item, sectionId) => {
9
9
  const layoutId = (0, useLayoutContext_1.useLayoutContext)();
@@ -10,12 +10,12 @@ const Item_1 = require("../Item");
10
10
  const style_1 = __importDefault(require("styled-jsx/style"));
11
11
  const sdk_1 = require("@cntrl-site/sdk");
12
12
  const LinkWrapper_1 = require("../LinkWrapper");
13
- const useRegisterResize_1 = require("../../common/useRegisterResize");
14
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
13
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
14
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
15
15
  const useItemAngle_1 = require("../useItemAngle");
16
16
  const useGroupItem_1 = require("./useGroupItem");
17
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
18
- const GroupItem = ({ item, sectionId, onResize, articleHeight, interactionCtrl, onVisibilityChange }) => {
17
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
18
+ const GroupItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
19
19
  var _a, _b, _c, _d, _e;
20
20
  const id = (0, react_1.useId)();
21
21
  const { items } = item;
@@ -32,7 +32,7 @@ const GroupItem = ({ item, sectionId, onResize, articleHeight, interactionCtrl,
32
32
  (0, react_1.useEffect)(() => {
33
33
  onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(isInteractive);
34
34
  }, [isInteractive, onVisibilityChange]);
35
- return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_c = item.link) === null || _c === void 0 ? void 0 : _c.url, target: (_d = item.link) === null || _d === void 0 ? void 0 : _d.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `group-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_e = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _e !== void 0 ? _e : 'none' }), children: items && items.map(item => ((0, jsx_runtime_1.jsx)(Item_1.Item, { item: item, sectionId: sectionId, articleHeight: articleHeight, isParentVisible: isInteractive, isInGroup: true }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
35
+ return ((0, jsx_runtime_1.jsx)(LinkWrapper_1.LinkWrapper, { url: (_c = item.link) === null || _c === void 0 ? void 0 : _c.url, target: (_d = item.link) === null || _d === void 0 ? void 0 : _d.target, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `group-${item.id}`, ref: setRef, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), { transition: (_e = stateParams === null || stateParams === void 0 ? void 0 : stateParams.transition) !== null && _e !== void 0 ? _e : 'none' }), children: items && items.map(item => ((0, jsx_runtime_1.jsx)(Item_1.Item, { item: item, sectionId: sectionId, isParentVisible: isInteractive, isInGroup: true }, item.id))) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
36
36
  .group-${item.id} {
37
37
  position: absolute;
38
38
  width: 100%;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGroupItem = void 0;
4
- const useKeyframeValue_1 = require("../../common/useKeyframeValue");
4
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
5
5
  const sdk_1 = require("@cntrl-site/sdk");
6
- const useLayoutContext_1 = require("../useLayoutContext");
6
+ const useLayoutContext_1 = require("../../useLayoutContext");
7
7
  function useGroupItem(item, sectionId) {
8
8
  const layoutId = (0, useLayoutContext_1.useLayoutContext)();
9
9
  const opacity = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.Opacity, (item, layoutId) => {
@@ -3,54 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isItemType = exports.Item = void 0;
6
+ exports.Item = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const style_1 = __importDefault(require("styled-jsx/style"));
10
10
  const sdk_1 = require("@cntrl-site/sdk");
11
- const RectangleItem_1 = require("./items/RectangleItem");
12
- const ImageItem_1 = require("./items/ImageItem");
13
- const VideoItem_1 = require("./items/VideoItem");
14
- const RichTextItem_1 = require("./items/RichTextItem");
15
- const VimeoEmbed_1 = require("./items/VimeoEmbed");
16
- const YoutubeEmbed_1 = require("./items/YoutubeEmbed");
17
- const CustomItem_1 = require("./items/CustomItem");
18
- const useCntrlContext_1 = require("../provider/useCntrlContext");
11
+ const useCntrlContext_1 = require("../../provider/useCntrlContext");
19
12
  const useItemPosition_1 = require("./useItemPosition");
20
13
  const useItemDimensions_1 = require("./useItemDimensions");
21
14
  const useItemScale_1 = require("./useItemScale");
22
- const ScaleAnchorMap_1 = require("../utils/ScaleAnchorMap");
23
- const useSectionHeightMap_1 = require("./useSectionHeightMap");
24
- const getItemTopStyle_1 = require("../utils/getItemTopStyle");
25
- const useStickyItemTop_1 = require("./items/useStickyItemTop");
26
- const getAnchoredItemTop_1 = require("../utils/getAnchoredItemTop");
27
- const useLayoutContext_1 = require("./useLayoutContext");
28
- const ArticleRectContext_1 = require("../provider/ArticleRectContext");
29
- const useExemplary_1 = require("../common/useExemplary");
30
- const GroupItem_1 = require("./items/GroupItem");
31
- const CodeEmbedItem_1 = require("./items/CodeEmbedItem");
32
- const KeyframesContext_1 = require("../provider/KeyframesContext");
33
- const useItemInteractionCtrl_1 = require("../interactions/useItemInteractionCtrl");
34
- const itemsMap = {
35
- [sdk_1.ArticleItemType.Rectangle]: RectangleItem_1.RectangleItem,
36
- [sdk_1.ArticleItemType.Image]: ImageItem_1.ImageItem,
37
- [sdk_1.ArticleItemType.Video]: VideoItem_1.VideoItem,
38
- [sdk_1.ArticleItemType.RichText]: RichTextItem_1.RichTextItem,
39
- [sdk_1.ArticleItemType.YoutubeEmbed]: YoutubeEmbed_1.YoutubeEmbedItem,
40
- [sdk_1.ArticleItemType.VimeoEmbed]: VimeoEmbed_1.VimeoEmbedItem,
41
- [sdk_1.ArticleItemType.Custom]: CustomItem_1.CustomItem,
42
- [sdk_1.ArticleItemType.Group]: GroupItem_1.GroupItem,
43
- [sdk_1.ArticleItemType.CodeEmbed]: CodeEmbedItem_1.CodeEmbedItem
44
- };
15
+ const ScaleAnchorMap_1 = require("../../utils/ScaleAnchorMap");
16
+ const useSectionHeightMap_1 = require("../Section/useSectionHeightMap");
17
+ const getItemTopStyle_1 = require("../../utils/getItemTopStyle");
18
+ const useStickyItemTop_1 = require("./useStickyItemTop");
19
+ const getAnchoredItemTop_1 = require("../../utils/getAnchoredItemTop");
20
+ const useLayoutContext_1 = require("../useLayoutContext");
21
+ const ArticleRectContext_1 = require("../../provider/ArticleRectContext");
22
+ const useExemplary_1 = require("../../common/useExemplary");
23
+ const KeyframesContext_1 = require("../../provider/KeyframesContext");
24
+ const useItemInteractionCtrl_1 = require("../../interactions/useItemInteractionCtrl");
25
+ const isItemType_1 = require("../../utils/isItemType");
26
+ const RichTextWrapper_1 = require("./RichTextWrapper");
27
+ const itemsMap_1 = require("./itemsMap");
45
28
  const stickyFix = `
46
29
  -webkit-transform: translate3d(0, 0, 0);
47
30
  transform: translate3d(0, 0, 0);
48
31
  `;
49
- const RichTextWrapper = ({ isRichText, children }) => {
50
- if (!isRichText)
51
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
52
- return ((0, jsx_runtime_1.jsx)("div", { style: { transformOrigin: 'top left', transform: 'scale(var(--layout-deviation))' }, children: children }));
53
- };
54
32
  const noop = () => null;
55
33
  const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false }) => {
56
34
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -84,17 +62,17 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
84
62
  if (item.layoutParams) {
85
63
  layoutValues.push(item.layoutParams);
86
64
  }
87
- const sizing = layout && isItemType(item, sdk_1.ArticleItemType.RichText)
65
+ const sizing = layout && (0, isItemType_1.isItemType)(item, sdk_1.ArticleItemType.RichText)
88
66
  ? item.layoutParams[layout].sizing
89
67
  : undefined;
90
68
  const sizingAxis = parseSizing(sizing);
91
- const ItemComponent = itemsMap[item.type] || noop;
69
+ const ItemComponent = itemsMap_1.itemsMap[item.type] || noop;
92
70
  const sectionTop = rectObserver ? rectObserver.getSectionTop(sectionId) : 0;
93
71
  const handleItemResize = (height) => {
94
72
  if (!layout)
95
73
  return;
96
74
  const sticky = item.sticky[layout];
97
- if (!sticky || stickyTop === undefined) {
75
+ if (!sticky || stickyTop === undefined || !articleHeight) {
98
76
  setWrapperHeight(undefined);
99
77
  return;
100
78
  }
@@ -115,20 +93,23 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
115
93
  (0, react_1.useEffect)(() => {
116
94
  isInitialRef.current = false;
117
95
  }, []);
118
- const isRichText = isItemType(item, sdk_1.ArticleItemType.RichText);
96
+ const isRichText = (0, isItemType_1.isItemType)(item, sdk_1.ArticleItemType.RichText);
119
97
  const width = ((_d = (_c = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : dimensions === null || dimensions === void 0 ? void 0 : dimensions.width);
120
98
  const height = ((_f = (_e = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : dimensions === null || dimensions === void 0 ? void 0 : dimensions.height);
99
+ const anchorSide = layout ? item.area[layout].anchorSide : sdk_1.AnchorSide.Top;
100
+ const positionType = layout ? item.area[layout].positionType : sdk_1.PositionType.ScreenBased;
101
+ const isScreenBasedBottom = positionType === sdk_1.PositionType.ScreenBased && anchorSide === sdk_1.AnchorSide.Bottom;
121
102
  const scale = (_h = (_g = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _g === void 0 ? void 0 : _g.scale) !== null && _h !== void 0 ? _h : itemScale;
122
103
  const hasClickTriggers = (_j = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getHasTrigger(item.id, 'click')) !== null && _j !== void 0 ? _j : false;
123
104
  return ((0, jsx_runtime_1.jsxs)("div", { className: `item-wrapper-${item.id}`, ref: itemWrapperRef, onTransitionEnd: (e) => {
124
105
  var _a;
125
106
  e.stopPropagation();
126
107
  (_a = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.handleTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(interactionCtrl, e.propertyName);
127
- }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (position ? { top: position.top } : {})), (position ? { left: position.left } : {})), (position ? { bottom: position.bottom } : {})), (wrapperHeight !== undefined ? { height: `${wrapperHeight * 100}vw` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none' }), children: [(0, jsx_runtime_1.jsx)("div", { suppressHydrationWarning: true, className: `item-${item.id}`, style: {
108
+ }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (position ? { top: isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(position.top, anchorSide) } : {})), (position ? { left: `${position.left * 100}vw` } : {})), (position ? { bottom: isScreenBasedBottom ? `${-position.top * 100}vw` : 'unset' } : {})), (wrapperHeight !== undefined ? { height: `${wrapperHeight * 100}vw` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none' }), children: [(0, jsx_runtime_1.jsx)("div", { suppressHydrationWarning: true, className: `item-${item.id}`, style: {
128
109
  opacity: (keyframes.length !== 0 && !layout) ? 0 : 1,
129
110
  top: `${stickyTop * 100}vw`,
130
111
  height: isRichText && itemHeight ? `${itemHeight * 100}vw` : 'unset',
131
- }, children: (0, jsx_runtime_1.jsx)(RichTextWrapper, { isRichText: isRichText, children: (0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, ref: itemInnerRef, onClick: () => {
112
+ }, children: (0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, children: (0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, ref: itemInnerRef, onClick: () => {
132
113
  interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.sendTrigger('click');
133
114
  }, onMouseEnter: () => {
134
115
  interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.sendTrigger('hover-in');
@@ -184,7 +165,3 @@ function parseSizing(sizing = 'manual') {
184
165
  x: axisSizing[1] ? axisSizing[1] : axisSizing[0]
185
166
  };
186
167
  }
187
- function isItemType(item, itemType) {
188
- return item.type === itemType;
189
- }
190
- exports.isItemType = isItemType;
@@ -12,9 +12,9 @@ const sdk_1 = require("@cntrl-site/sdk");
12
12
  const LinkWrapper_1 = require("../LinkWrapper");
13
13
  const useRectangleItem_1 = require("./useRectangleItem");
14
14
  const useItemAngle_1 = require("../useItemAngle");
15
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
16
- const useRegisterResize_1 = require("../../common/useRegisterResize");
17
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
15
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
16
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
17
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
18
18
  const RectangleItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
19
19
  var _a, _b, _c, _d;
20
20
  const id = (0, react_1.useId)();
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useRectangleItem = void 0;
4
4
  const sdk_1 = require("@cntrl-site/sdk");
5
- const useKeyframeValue_1 = require("../../common/useKeyframeValue");
6
- const useLayoutContext_1 = require("../useLayoutContext");
5
+ const useKeyframeValue_1 = require("../../../common/useKeyframeValue");
6
+ const useLayoutContext_1 = require("../../useLayoutContext");
7
7
  const defaultColor = 'rgba(0, 0, 0, 1)';
8
8
  const useRectangleItem = (item, sectionId) => {
9
9
  const layoutId = (0, useLayoutContext_1.useLayoutContext)();
@@ -10,14 +10,14 @@ const color_1 = require("@cntrl-site/color");
10
10
  const sdk_1 = require("@cntrl-site/sdk");
11
11
  const style_1 = __importDefault(require("styled-jsx/style"));
12
12
  const useRichTextItem_1 = require("./useRichTextItem");
13
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
14
- const useRichTextItemValues_1 = require("./useRichTextItemValues");
15
- const useRegisterResize_1 = require("../../common/useRegisterResize");
16
- const getFontFamilyValue_1 = require("../../utils/getFontFamilyValue");
17
- const useExemplary_1 = require("../../common/useExemplary");
13
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
14
+ const useRichTextItemValues_1 = require("../useRichTextItemValues");
15
+ const useRegisterResize_1 = require("../../../common/useRegisterResize");
16
+ const getFontFamilyValue_1 = require("../../../utils/getFontFamilyValue");
17
+ const useExemplary_1 = require("../../../common/useExemplary");
18
18
  const useItemAngle_1 = require("../useItemAngle");
19
- const getStyleFromItemStateAndParams_1 = require("../../utils/getStyleFromItemStateAndParams");
20
- const useCurrentLayout_1 = require("../../common/useCurrentLayout");
19
+ const getStyleFromItemStateAndParams_1 = require("../../../utils/getStyleFromItemStateAndParams");
20
+ const useCurrentLayout_1 = require("../../../common/useCurrentLayout");
21
21
  const RichTextItem = ({ item, sectionId, onResize, interactionCtrl, onVisibilityChange }) => {
22
22
  var _a, _b, _c, _d;
23
23
  const id = (0, react_1.useId)();
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useRichTextItem = void 0;
4
- const RichTextConverter_1 = require("../../utils/RichTextConverter/RichTextConverter");
5
- const useCntrlContext_1 = require("../../provider/useCntrlContext");
4
+ const RichTextConverter_1 = require("../../../utils/RichTextConverter/RichTextConverter");
5
+ const useCntrlContext_1 = require("../../../provider/useCntrlContext");
6
6
  const richTextConverter = new RichTextConverter_1.RichTextConverter();
7
7
  const useRichTextItem = (item) => {
8
8
  const { layouts } = (0, useCntrlContext_1.useCntrlContext)();