@cntrl-site/sdk-nextjs 1.4.2 → 1.4.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.
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,15 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="1">
8
+ <item index="0" class="java.lang.String" itemvalue="jsx" />
9
+ </list>
10
+ </value>
11
+ </option>
12
+ <option name="myCustomValuesEnabled" value="true" />
13
+ </inspection_tool>
14
+ </profile>
15
+ </component>
@@ -78,7 +78,7 @@ const Item = ({ item, sectionId, articleHeight, isParentVisible = true, isInGrou
78
78
  }
79
79
  const itemArticleOffset = sectionTop / window.innerWidth + stickyTop;
80
80
  const maxStickyTo = articleHeight - itemArticleOffset - height;
81
- const end = sticky.to
81
+ const end = sticky.to !== undefined
82
82
  ? Math.min(maxStickyTo, sticky.to)
83
83
  : articleHeight - itemArticleOffset - height;
84
84
  const wrapperHeight = end - sticky.from + height;
@@ -14,7 +14,7 @@ const positionMatrix = {
14
14
  [sdk_1.AreaAnchor.BottomRight]: [1, 1]
15
15
  };
16
16
  function getCompoundHeight(compoundSettings, height) {
17
- if (!height || !compoundSettings)
17
+ if (height === undefined || !compoundSettings)
18
18
  return;
19
19
  if (compoundSettings.heightMode === 'relative') {
20
20
  return `${height * 100}%`;
@@ -23,7 +23,7 @@ function getCompoundHeight(compoundSettings, height) {
23
23
  }
24
24
  exports.getCompoundHeight = getCompoundHeight;
25
25
  function getCompoundWidth(compoundSettings, width, isRichText, exemplary) {
26
- if (!width || !compoundSettings)
26
+ if (width === undefined || !compoundSettings)
27
27
  return;
28
28
  if (compoundSettings.widthMode === 'relative') {
29
29
  return `${width * 100}%`;
@@ -32,7 +32,7 @@ function getCompoundWidth(compoundSettings, width, isRichText, exemplary) {
32
32
  }
33
33
  exports.getCompoundWidth = getCompoundWidth;
34
34
  function getCompoundTop(compoundSettings, top) {
35
- if (!top || !compoundSettings)
35
+ if (top === undefined || !compoundSettings)
36
36
  return;
37
37
  if (compoundSettings.heightMode === 'relative') {
38
38
  return `${top * 100}%`;
@@ -42,7 +42,7 @@ function getCompoundTop(compoundSettings, top) {
42
42
  }
43
43
  exports.getCompoundTop = getCompoundTop;
44
44
  function getCompoundLeft(compoundSettings, left) {
45
- if (!left || !compoundSettings)
45
+ if (left === undefined || !compoundSettings)
46
46
  return;
47
47
  if (compoundSettings.widthMode === 'relative') {
48
48
  return `${left * 100}%`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -107,7 +107,7 @@ export const Item: FC<ItemWrapperProps> = ({ item, sectionId, articleHeight, isP
107
107
  }
108
108
  const itemArticleOffset = sectionTop / window.innerWidth + stickyTop;
109
109
  const maxStickyTo = articleHeight - itemArticleOffset - height;
110
- const end = sticky.to
110
+ const end = sticky.to !== undefined
111
111
  ? Math.min(maxStickyTo, sticky.to)
112
112
  : articleHeight - itemArticleOffset - height;
113
113
  const wrapperHeight = end - sticky.from + height;
@@ -14,7 +14,7 @@ const positionMatrix: Record<AreaAnchor, [number, number]> = {
14
14
  };
15
15
 
16
16
  export function getCompoundHeight(compoundSettings: CompoundSettings | undefined, height: number | undefined) {
17
- if (!height || !compoundSettings) return;
17
+ if (height === undefined || !compoundSettings) return;
18
18
  if (compoundSettings.heightMode === 'relative') {
19
19
  return `${height * 100}%`;
20
20
  }
@@ -22,7 +22,7 @@ export function getCompoundHeight(compoundSettings: CompoundSettings | undefined
22
22
  }
23
23
 
24
24
  export function getCompoundWidth(compoundSettings: CompoundSettings | undefined, width: number | undefined, isRichText: boolean, exemplary?: number) {
25
- if (!width || !compoundSettings) return;
25
+ if (width === undefined || !compoundSettings) return;
26
26
  if (compoundSettings.widthMode === 'relative') {
27
27
  return `${width * 100}%`;
28
28
  }
@@ -30,7 +30,7 @@ export function getCompoundWidth(compoundSettings: CompoundSettings | undefined,
30
30
  }
31
31
 
32
32
  export function getCompoundTop(compoundSettings: CompoundSettings | undefined, top: number | undefined) {
33
- if (!top || !compoundSettings) return;
33
+ if (top === undefined || !compoundSettings) return;
34
34
  if (compoundSettings.heightMode === 'relative') {
35
35
  return `${top * 100}%`;
36
36
  }
@@ -39,7 +39,7 @@ export function getCompoundTop(compoundSettings: CompoundSettings | undefined, t
39
39
  }
40
40
 
41
41
  export function getCompoundLeft(compoundSettings: CompoundSettings | undefined, left: number | undefined) {
42
- if (!left || !compoundSettings) return;
42
+ if (left === undefined || !compoundSettings) return;
43
43
  if (compoundSettings.widthMode === 'relative') {
44
44
  return `${left * 100}%`;
45
45
  }
Binary file
Binary file