@cntrl-site/sdk-nextjs 1.4.2 → 1.4.3

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.
@@ -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.3",
4
4
  "description": "SDK for Next.js",
5
5
  "author": "arsen@momdesign.nyc",
6
6
  "license": "MIT",
@@ -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
  }