@gxpl/sdk 0.0.52 → 0.0.53
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.
|
@@ -33,7 +33,7 @@ const stickyFix = `
|
|
|
33
33
|
`;
|
|
34
34
|
const noop = () => null;
|
|
35
35
|
const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGroup = false, isInFixedLayer = false, articleId }) => {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
37
37
|
const itemWrapperRef = (0, react_1.useRef)(null);
|
|
38
38
|
const itemInnerRef = (0, react_1.useRef)(null);
|
|
39
39
|
const rectObserver = (0, react_1.useContext)(ArticleRectContext_1.ArticleRectContext);
|
|
@@ -94,10 +94,8 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
94
94
|
};
|
|
95
95
|
const isRichText = (0, isItemType_1.isItemType)(item, ArticleItemType_1.ArticleItemType.RichText);
|
|
96
96
|
const anchorSide = (_g = item.area.anchorSide) !== null && _g !== void 0 ? _g : ItemArea_1.AnchorSide.Top;
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const scale = (_k = (_j = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _j === void 0 ? void 0 : _j.scale) !== null && _k !== void 0 ? _k : itemScale;
|
|
100
|
-
const hasClickTriggers = (_l = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getHasTrigger(item.id, 'click')) !== null && _l !== void 0 ? _l : false;
|
|
97
|
+
const scale = (_j = (_h = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.styles) === null || _h === void 0 ? void 0 : _h.scale) !== null && _j !== void 0 ? _j : itemScale;
|
|
98
|
+
const hasClickTriggers = (_k = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.getHasTrigger(item.id, 'click')) !== null && _k !== void 0 ? _k : false;
|
|
101
99
|
const scroll = rectObserver === null || rectObserver === void 0 ? void 0 : rectObserver.scroll;
|
|
102
100
|
const realTop = item.area.positionType === ItemArea_1.PositionType.ScreenBased && isSceneTransitioning && scroll !== undefined
|
|
103
101
|
? top + scroll
|
|
@@ -106,7 +104,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
106
104
|
var _a;
|
|
107
105
|
e.stopPropagation();
|
|
108
106
|
(_a = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.handleTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(interactionCtrl, e.propertyName);
|
|
109
|
-
}, style: Object.assign(Object.assign({ top:
|
|
107
|
+
}, style: Object.assign(Object.assign({ top: (0, getItemTopStyle_1.getItemTopStyle)(realTop, anchorSide), left: `${left * 100}vw` }, (wrapperHeight !== undefined ? { height: `${wrapperHeight * 100}vw` } : {})), { transition: (_l = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _l !== void 0 ? _l : 'none' }), children: [(0, jsx_runtime_1.jsx)("div", { suppressHydrationWarning: true, className: `item-${item.id}`, style: {
|
|
110
108
|
top: item.sticky ? (0, getAnchoredItemTop_1.getAnchoredItemTop)(stickyTop, sectionHeight, anchorSide) : 0,
|
|
111
109
|
height: isRichText && itemHeight !== undefined ? `${itemHeight * 100}vw` : 'unset'
|
|
112
110
|
}, children: (0, jsx_runtime_1.jsx)(RichTextWrapper_1.RichTextWrapper, { isRichText: isRichText, children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `item-${item.id}-inner`, ref: itemInnerRef, style: Object.assign(Object.assign(Object.assign({ top: `${position.y}px`, left: `${position.x}px` }, ((width !== undefined && height !== undefined)
|
|
@@ -118,7 +116,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
118
116
|
: 'max-content'}`,
|
|
119
117
|
height: `${sizingAxis.y === 'manual' ? `${height * 100}vw` : 'unset'}`
|
|
120
118
|
}
|
|
121
|
-
: {})), (scale !== undefined ? { transform: `scale(${scale})`, WebkitTransform: `scale(${scale})` } : {})), { transition: (
|
|
119
|
+
: {})), (scale !== undefined ? { transform: `scale(${scale})`, WebkitTransform: `scale(${scale})` } : {})), { transition: (_m = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _m !== void 0 ? _m : 'none', cursor: isDraggingActive
|
|
122
120
|
? 'grabbing'
|
|
123
121
|
: isDraggable
|
|
124
122
|
? 'grab'
|
|
@@ -147,8 +145,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
|
|
|
147
145
|
z-index: ${item.area.zIndex};
|
|
148
146
|
${!isInGroup && stickyFix}
|
|
149
147
|
pointer-events: none;
|
|
150
|
-
|
|
151
|
-
top: ${isScreenBasedBottom ? 'unset' : (0, getItemTopStyle_1.getItemTopStyle)(item.area.top, item.area.anchorSide)};
|
|
148
|
+
top: ${(0, getItemTopStyle_1.getItemTopStyle)(item.area.top, item.area.anchorSide)};
|
|
152
149
|
left: ${item.area.left * 100}vw;
|
|
153
150
|
}
|
|
154
151
|
` })] }));
|