@cntrl-site/sdk-nextjs 1.8.2 → 1.8.4

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.
@@ -17,7 +17,7 @@ const ScaleAnchorMap_1 = require("../../../utils/ScaleAnchorMap");
17
17
  const isItemType_1 = require("../../../utils/isItemType");
18
18
  const RichTextWrapper_1 = require("../RichTextWrapper");
19
19
  const itemsMap_1 = require("../itemsMap");
20
- const getCompoundBondaryStyles_1 = require("../../../utils/getCompoundBondaryStyles");
20
+ const getCompoundBoundaryStyles_1 = require("../../../utils/getCompoundBoundaryStyles");
21
21
  const useItemTriggers_1 = require("../useItemTriggers");
22
22
  const useSizing_1 = require("../useSizing");
23
23
  const useItemPointerEvents_1 = require("../useItemPointerEvents");
@@ -62,15 +62,15 @@ const CompoundChild = ({ item, sectionId, isParentVisible = true }) => {
62
62
  var _a;
63
63
  e.stopPropagation();
64
64
  (_a = interactionCtrl === null || interactionCtrl === void 0 ? void 0 : interactionCtrl.handleTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(interactionCtrl, e.propertyName);
65
- }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (top !== undefined && compoundSettings ? { top: (0, getCompoundBondaryStyles_1.getCompoundTop)(compoundSettings, top) } : {})), (left !== undefined && compoundSettings ? { left: (0, getCompoundBondaryStyles_1.getCompoundLeft)(compoundSettings, left) } : {})), (width !== undefined && compoundSettings
65
+ }, style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (top !== undefined && compoundSettings ? { top: (0, getCompoundBoundaryStyles_1.getCompoundTop)(compoundSettings, top) } : {})), (left !== undefined && compoundSettings ? { left: (0, getCompoundBoundaryStyles_1.getCompoundLeft)(compoundSettings, left) } : {})), (width !== undefined && compoundSettings
66
66
  ? { width: `${sizingAxis.x === 'manual'
67
- ? (0, getCompoundBondaryStyles_1.getCompoundWidth)(compoundSettings, width, isRichText, exemplary)
67
+ ? (0, getCompoundBoundaryStyles_1.getCompoundWidth)(compoundSettings, width, isRichText, exemplary)
68
68
  : 'max-content'}` }
69
69
  : {})), (height !== undefined && compoundSettings
70
70
  ? { height: `${sizingAxis.y === 'manual'
71
- ? (0, getCompoundBondaryStyles_1.getCompoundHeight)(compoundSettings, height)
71
+ ? (0, getCompoundBoundaryStyles_1.getCompoundHeight)(compoundSettings, height)
72
72
  : 'unset'}` }
73
- : {})), (compoundSettings ? { transform: `${(0, getCompoundBondaryStyles_1.getCompoundTransform)(compoundSettings)}` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none', cursor: hasClickTriggers ? 'pointer' : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none' }) }, triggers, { children: [(0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, style: Object.assign({ transition: (_l = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _l !== void 0 ? _l : 'none' }, (scale !== undefined ? { transform: `scale(${scale})` } : {})), 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, isInCompound: true }) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
73
+ : {})), (compoundSettings ? { transform: `${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)}` } : {})), { transition: (_k = wrapperStateProps === null || wrapperStateProps === void 0 ? void 0 : wrapperStateProps.transition) !== null && _k !== void 0 ? _k : 'none', cursor: hasClickTriggers ? 'pointer' : 'unset', pointerEvents: allowPointerEvents ? 'auto' : 'none' }) }, triggers, { children: [(0, jsx_runtime_1.jsx)("div", { className: `item-${item.id}-inner`, style: Object.assign({ transition: (_l = innerStateProps === null || innerStateProps === void 0 ? void 0 : innerStateProps.transition) !== null && _l !== void 0 ? _l : 'none' }, (scale !== undefined ? { transform: `scale(${scale})` } : {})), 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, isInCompound: true }) }) }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
74
74
  ${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([area, hidden, compoundSettings, layoutParams]) => {
75
75
  const sizingAxis = (0, useSizing_1.parseSizing)(layoutParams.sizing);
76
76
  const scaleAnchor = area.scaleAnchor;
@@ -83,15 +83,15 @@ const CompoundChild = ({ item, sectionId, isParentVisible = true }) => {
83
83
  }
84
84
  .item-${item.id} {
85
85
  position: absolute;
86
- top: ${(0, getCompoundBondaryStyles_1.getCompoundTop)(compoundSettings, area.top)};
87
- left: ${(0, getCompoundBondaryStyles_1.getCompoundLeft)(compoundSettings, area.left)};
86
+ top: ${(0, getCompoundBoundaryStyles_1.getCompoundTop)(compoundSettings, area.top)};
87
+ left: ${(0, getCompoundBoundaryStyles_1.getCompoundLeft)(compoundSettings, area.left)};
88
88
  transition: opacity 0.2s linear 0.1s;
89
89
  display: ${hidden ? 'none' : 'block'};
90
90
  width: ${sizingAxis.x === 'manual'
91
- ? `${(0, getCompoundBondaryStyles_1.getCompoundWidth)(compoundSettings, area.width, isRichText)}`
91
+ ? `${(0, getCompoundBoundaryStyles_1.getCompoundWidth)(compoundSettings, area.width, isRichText)}`
92
92
  : 'max-content'};
93
- height: ${sizingAxis.y === 'manual' ? `${(0, getCompoundBondaryStyles_1.getCompoundHeight)(compoundSettings, area.height)}` : 'unset'};
94
- transform: ${(0, getCompoundBondaryStyles_1.getCompoundTransform)(compoundSettings)};
93
+ height: ${sizingAxis.y === 'manual' ? `${(0, getCompoundBoundaryStyles_1.getCompoundHeight)(compoundSettings, area.height)}` : 'unset'};
94
+ transform: ${(0, getCompoundBoundaryStyles_1.getCompoundTransform)(compoundSettings)};
95
95
  z-index: ${area.zIndex};
96
96
  }
97
97
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "@antfu/eslint-config": "^3.8.0",
32
32
  "@cntrl-site/color": "^1.0.0",
33
33
  "@cntrl-site/effects": "^1.3.2",
34
- "@cntrl-site/sdk": "^1.22.2",
34
+ "@cntrl-site/sdk": "^1.22.4",
35
35
  "@types/vimeo__player": "^2.18.0",
36
36
  "@vimeo/player": "^2.25.0",
37
37
  "html-react-parser": "^3.0.1",
@@ -21,7 +21,7 @@ import {
21
21
  getCompoundTop,
22
22
  getCompoundTransform,
23
23
  getCompoundWidth
24
- } from '../../../utils/getCompoundBondaryStyles';
24
+ } from '../../../utils/getCompoundBoundaryStyles';
25
25
  import { useItemTriggers } from '../useItemTriggers';
26
26
  import { parseSizing, useSizing } from '../useSizing';
27
27
  import { useItemPointerEvents } from '../useItemPointerEvents';
@@ -1,5 +1,4 @@
1
- import { AreaAnchor } from '@cntrl-site/sdk';
2
- import { DimensionMode } from '@cntrl-site/sdk/dist/types/article/ItemArea';
1
+ import { AreaAnchor, DimensionMode } from '@cntrl-site/sdk';
3
2
 
4
3
  const positionMatrix: Record<AreaAnchor, [number, number]> = {
5
4
  [AreaAnchor.TopLeft]: [0, 0],
@@ -1,5 +1,4 @@
1
- import { ArticleItemType, ItemAny } from '@cntrl-site/sdk';
2
- import { Item as TItem } from '@cntrl-site/sdk/dist/types/article/Item';
1
+ import { ArticleItemType, ItemAny, Item as TItem } from '@cntrl-site/sdk';
3
2
 
4
3
  export function isItemType<T extends ArticleItemType>(item: ItemAny, itemType: T): item is TItem<T> {
5
4
  return item.type === itemType;
Binary file