@builder.io/sdk-svelte 0.1.13 → 0.1.15

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.1.12",
4
+ "version": "0.1.14",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -1,3 +1,11 @@
1
+ ### 0.1.14
2
+
3
+ - No changes.
4
+
5
+ ### 0.1.13
6
+
7
+ - Fix: Columns block styling & `stackColumnsAt` prop
8
+
1
9
  ### 0.1.12
2
10
 
3
11
  - Fix: `RenderContent` not re-rendering when its `content` updates. This fixes Symbol rendering in the visual editor.
@@ -36,26 +36,26 @@ function getMobileStyle({ stackedStyle, desktopStyle }) {
36
36
  return stackAt === "never" ? desktopStyle : stackedStyle;
37
37
  }
38
38
  function columnCssVars(index) {
39
- const width = getColumnCssWidth(index);
40
- const gutter = `${index === 0 ? 0 : gutterSize}px`;
39
+ const gutter = index === 0 ? 0 : gutterSize;
41
40
  if (TARGET === "reactNative") {
42
41
  return {
43
- width,
44
- marginLeft: stackColumnsAt === "never" ? gutter : "0",
42
+ marginLeft: stackColumnsAt === "never" ? gutter : 0,
45
43
  };
46
44
  }
45
+ const width = getColumnCssWidth(index);
46
+ const gutterPixels = `${gutterSize}px`;
47
47
  const mobileWidth = "100%";
48
- const mobileMarginLeft = "0";
48
+ const mobileMarginLeft = 0;
49
49
  return {
50
50
  width,
51
- "margin-left": gutter,
51
+ "margin-left": gutterPixels,
52
52
  "--column-width-mobile": getMobileStyle({
53
53
  stackedStyle: mobileWidth,
54
54
  desktopStyle: width,
55
55
  }),
56
56
  "--column-margin-left-mobile": getMobileStyle({
57
57
  stackedStyle: mobileMarginLeft,
58
- desktopStyle: gutter,
58
+ desktopStyle: gutterPixels,
59
59
  }),
60
60
  "--column-width-tablet": getTabletStyle({
61
61
  stackedStyle: mobileWidth,
@@ -63,7 +63,7 @@ function columnCssVars(index) {
63
63
  }),
64
64
  "--column-margin-left-tablet": getTabletStyle({
65
65
  stackedStyle: mobileMarginLeft,
66
- desktopStyle: gutter,
66
+ desktopStyle: gutterPixels,
67
67
  }),
68
68
  };
69
69
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -3,11 +3,15 @@
3
3
 
4
4
  import type { SizeName } from "../../constants/device-sizes";
5
5
 
6
+ import type { Dictionary } from "../../types/typescript";
7
+
6
8
  type Column = {
7
9
  blocks: BuilderBlock[];
8
10
  width?: number;
9
11
  };
10
12
 
13
+ type CSSVal = string | number;
14
+
11
15
  type StackColumnsAt = "tablet" | "mobile" | "never";
12
16
 
13
17
  export interface ColumnProps {
@@ -64,26 +68,26 @@
64
68
  return stackAt === "never" ? desktopStyle : stackedStyle;
65
69
  }
66
70
  function columnCssVars(index) {
67
- const width = getColumnCssWidth(index);
68
- const gutter = `${index === 0 ? 0 : gutterSize}px`;
71
+ const gutter = index === 0 ? 0 : gutterSize;
69
72
  if (TARGET === "reactNative") {
70
73
  return {
71
- width,
72
- marginLeft: stackColumnsAt === "never" ? gutter : "0",
74
+ marginLeft: stackColumnsAt === "never" ? gutter : 0,
73
75
  };
74
76
  }
77
+ const width = getColumnCssWidth(index);
78
+ const gutterPixels = `${gutterSize}px`;
75
79
  const mobileWidth = "100%";
76
- const mobileMarginLeft = "0";
80
+ const mobileMarginLeft = 0;
77
81
  return {
78
82
  width,
79
- "margin-left": gutter,
83
+ "margin-left": gutterPixels,
80
84
  "--column-width-mobile": getMobileStyle({
81
85
  stackedStyle: mobileWidth,
82
86
  desktopStyle: width,
83
87
  }),
84
88
  "--column-margin-left-mobile": getMobileStyle({
85
89
  stackedStyle: mobileMarginLeft,
86
- desktopStyle: gutter,
90
+ desktopStyle: gutterPixels,
87
91
  }),
88
92
  "--column-width-tablet": getTabletStyle({
89
93
  stackedStyle: mobileWidth,
@@ -91,7 +95,7 @@
91
95
  }),
92
96
  "--column-margin-left-tablet": getTabletStyle({
93
97
  stackedStyle: mobileMarginLeft,
94
- desktopStyle: gutter,
98
+ desktopStyle: gutterPixels,
95
99
  }),
96
100
  };
97
101
  }