@builder.io/sdk-react 2.0.0 → 2.0.2

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.
Files changed (72) hide show
  1. package/lib/browser/blocks-exports.cjs +17 -17
  2. package/lib/browser/blocks-exports.mjs +268 -227
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +1 -1
  6. package/lib/browser/init.mjs +1 -1
  7. package/lib/browser/{server-entry-e0454364.cjs → server-entry-419c051e.cjs} +1 -1
  8. package/lib/browser/{server-entry-709e09e3.js → server-entry-825b4408.js} +1 -1
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{accordion-12c2d408.cjs → accordion-4f96554c.cjs} +1 -1
  12. package/lib/edge/{accordion-bd80745a.js → accordion-ca081054.js} +1 -1
  13. package/lib/edge/{blocks-ac8970f1.cjs → blocks-078044bc.cjs} +2 -2
  14. package/lib/edge/blocks-exports.cjs +1 -1
  15. package/lib/edge/blocks-exports.mjs +4 -3
  16. package/lib/edge/{blocks-6d6258ba.js → blocks-f55c7d3e.js} +12 -4
  17. package/lib/edge/{button-4e842584.js → button-41169061.js} +2 -2
  18. package/lib/edge/{button-c2e45e64.cjs → button-5d140f8e.cjs} +1 -1
  19. package/lib/edge/columns-354bf349.cjs +28 -0
  20. package/lib/edge/{columns-a51238cc.js → columns-f8916a18.js} +53 -46
  21. package/lib/edge/{content-variants-f3c6baad.js → content-variants-71ee0c76.js} +239 -217
  22. package/lib/edge/{content-variants-3fe9b1c0.cjs → content-variants-89a9389a.cjs} +8 -8
  23. package/lib/edge/{form-00c8cc55.js → form-ac2f2a0e.js} +3 -3
  24. package/lib/edge/{form-b4cdf7cd.cjs → form-f2d2c2bf.cjs} +1 -1
  25. package/lib/edge/{get-class-prop-name-1bbed5bf.js → get-class-prop-name-a677d7a5.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-3c5f7a7d.cjs → get-class-prop-name-a9b4959e.cjs} +1 -1
  27. package/lib/edge/image-344ddbb0.cjs +17 -0
  28. package/lib/edge/{image-68451fc8.js → image-e3fcd611.js} +24 -22
  29. package/lib/edge/{img-e7db1475.js → img-8fc26395.js} +1 -1
  30. package/lib/edge/{img-6671da9a.cjs → img-b91cb4fd.cjs} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +1 -1
  33. package/lib/edge/init.cjs +1 -1
  34. package/lib/edge/init.mjs +1 -1
  35. package/lib/edge/{input-2db47a83.js → input-549f090e.js} +1 -1
  36. package/lib/edge/{input-0f7a9f1c.cjs → input-ec7c695a.cjs} +1 -1
  37. package/lib/edge/{select-f0859c5f.cjs → select-3ffa9294.cjs} +1 -1
  38. package/lib/edge/{select-2facacf2.js → select-6a5a28ac.js} +1 -1
  39. package/lib/edge/{server-entry-ff6a2e2d.cjs → server-entry-966ac144.cjs} +1 -1
  40. package/lib/edge/{server-entry-75aa714e.js → server-entry-d2020acf.js} +1 -1
  41. package/lib/edge/server-entry.cjs +1 -1
  42. package/lib/edge/server-entry.mjs +1 -1
  43. package/lib/edge/{slot-8159ca1d.js → slot-40de071b.js} +3 -3
  44. package/lib/edge/{slot-aee43b86.cjs → slot-8b27e15e.cjs} +1 -1
  45. package/lib/edge/symbol-76e76298.cjs +1 -0
  46. package/lib/edge/symbol-e6515a5f.js +85 -0
  47. package/lib/edge/{tabs-4112a80e.cjs → tabs-9c5af0ec.cjs} +1 -1
  48. package/lib/edge/{tabs-f5357a4e.js → tabs-b75be82d.js} +3 -3
  49. package/lib/node/blocks-exports.cjs +15 -15
  50. package/lib/node/blocks-exports.mjs +269 -228
  51. package/lib/node/index.cjs +1 -1
  52. package/lib/node/index.mjs +2 -2
  53. package/lib/node/init.cjs +1 -1
  54. package/lib/node/init.mjs +2 -2
  55. package/lib/node/{node-runtime-eb72e084.cjs → node-runtime-0e37d6f7.cjs} +1 -1
  56. package/lib/node/{node-runtime-80c4bfc8.js → node-runtime-0f3a5df1.js} +1 -1
  57. package/lib/node/{server-entry-e8ac67b5.js → server-entry-5ebd1c9b.js} +1 -1
  58. package/lib/node/{server-entry-b2103255.cjs → server-entry-8002325b.cjs} +1 -1
  59. package/lib/node/server-entry.cjs +1 -1
  60. package/lib/node/server-entry.mjs +1 -1
  61. package/package.json +15 -15
  62. package/types/components/content/components/styles.d.ts +2 -1
  63. package/types/components/content-variants/content-variants.types.d.ts +4 -0
  64. package/types/components/inlined-script.d.ts +2 -1
  65. package/types/components/inlined-styles.d.ts +2 -1
  66. package/types/constants/sdk-version.d.ts +1 -1
  67. package/types/context/types.d.ts +1 -0
  68. package/types/types/builder-props.d.ts +3 -0
  69. package/lib/edge/columns-bc2b0674.cjs +0 -28
  70. package/lib/edge/image-ea37781b.cjs +0 -17
  71. package/lib/edge/symbol-36a155f3.js +0 -84
  72. package/lib/edge/symbol-a244cc31.cjs +0 -1
@@ -1,45 +1,45 @@
1
1
  import { jsxs as y, Fragment as B, jsx as o } from "react/jsx-runtime";
2
2
  import { useState as r } from "react";
3
- import { InlinedStyles as z, Blocks as A, mapStyleObjToStrIfNeeded as L, getSizesForBreakpoints as W } from "./blocks-6d6258ba.js";
3
+ import { InlinedStyles as z, Blocks as A, mapStyleObjToStrIfNeeded as L, getSizesForBreakpoints as W } from "./blocks-f55c7d3e.js";
4
4
  import { DynamicRenderer as N } from "./dynamic-renderer-8b343325.js";
5
- import { getClassPropName as D } from "./get-class-prop-name-1bbed5bf.js";
5
+ import { getClassPropName as D } from "./get-class-prop-name-a677d7a5.js";
6
6
  import "./blocks-exports.mjs";
7
- import "./server-entry-75aa714e.js";
8
- const F = (e) => `builder-columns ${e}-breakpoints`;
9
- function J(e) {
7
+ import "./server-entry-d2020acf.js";
8
+ const F = (t) => `builder-columns ${t}-breakpoints`;
9
+ function J(t) {
10
10
  var f, k;
11
11
  const [c, T] = r(
12
- () => typeof e.space == "number" ? e.space || 0 : 20
13
- ), [s, j] = r(() => e.columns || []), [m, I] = r(
14
- () => e.stackColumnsAt || "tablet"
12
+ () => typeof t.space == "number" ? t.space || 0 : 20
13
+ ), [s, j] = r(() => t.columns || []), [m, I] = r(
14
+ () => t.stackColumnsAt || "tablet"
15
15
  );
16
- function S(t) {
17
- return t.link ? e.builderLinkComponent || "a" : "div";
16
+ function S(e) {
17
+ return e.link ? t.builderLinkComponent || "a" : "div";
18
18
  }
19
- function x(t) {
19
+ function x(e) {
20
20
  var n;
21
- return ((n = s[t]) == null ? void 0 : n.width) || 100 / s.length;
21
+ return ((n = s[e]) == null ? void 0 : n.width) || 100 / s.length;
22
22
  }
23
- function C(t) {
24
- const n = x(t), i = c * (s.length - 1) * (n / 100);
23
+ function C(e) {
24
+ const n = x(e), i = c * (s.length - 1) * (n / 100);
25
25
  return `calc(${n}% - ${i}px)`;
26
26
  }
27
27
  function a({
28
- stackedStyle: t,
28
+ stackedStyle: e,
29
29
  desktopStyle: n
30
30
  }) {
31
- return m === "tablet" ? t : n;
31
+ return m === "tablet" ? e : n;
32
32
  }
33
33
  function u({
34
- stackedStyle: t,
34
+ stackedStyle: e,
35
35
  desktopStyle: n
36
36
  }) {
37
- return m === "never" ? n : t;
37
+ return m === "never" ? n : e;
38
38
  }
39
39
  const [d, P] = r(
40
- () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
40
+ () => t.stackColumnsAt === "never" ? "row" : t.reverseColumnsWhenStacked ? "column-reverse" : "column"
41
41
  );
42
- function p() {
42
+ function v() {
43
43
  return {
44
44
  "--flex-dir": d,
45
45
  "--flex-dir-tablet": a({
@@ -48,8 +48,8 @@ function J(e) {
48
48
  })
49
49
  };
50
50
  }
51
- function v(t) {
52
- const n = t === 0 ? 0 : c, i = C(t), l = `${n}px`, g = "100%", h = 0;
51
+ function w(e) {
52
+ const n = e === 0 ? 0 : c, i = C(e), l = `${n}px`, g = "100%", h = 0;
53
53
  return {
54
54
  ...{
55
55
  display: "flex",
@@ -76,74 +76,81 @@ function J(e) {
76
76
  })
77
77
  };
78
78
  }
79
- function b(t) {
79
+ function b(e) {
80
80
  var i, l;
81
81
  return W(
82
- ((l = (i = e.builderContext.content) == null ? void 0 : i.meta) == null ? void 0 : l.breakpoints) || {}
83
- )[t].max;
82
+ ((l = (i = t.builderContext.content) == null ? void 0 : i.meta) == null ? void 0 : l.breakpoints) || {}
83
+ )[e].max;
84
84
  }
85
- function w() {
85
+ function p() {
86
86
  return `
87
87
  @media (max-width: ${b("medium")}px) {
88
- .${e.builderBlock.id}-breakpoints {
88
+ .${t.builderBlock.id}-breakpoints {
89
89
  flex-direction: var(--flex-dir-tablet);
90
90
  align-items: stretch;
91
91
  }
92
92
 
93
- .${e.builderBlock.id}-breakpoints > .builder-column {
93
+ .${t.builderBlock.id}-breakpoints > .builder-column {
94
94
  width: var(--column-width-tablet) !important;
95
95
  margin-left: var(--column-margin-left-tablet) !important;
96
96
  }
97
97
  }
98
98
 
99
99
  @media (max-width: ${b("small")}px) {
100
- .${e.builderBlock.id}-breakpoints {
100
+ .${t.builderBlock.id}-breakpoints {
101
101
  flex-direction: var(--flex-dir);
102
102
  align-items: stretch;
103
103
  }
104
104
 
105
- .${e.builderBlock.id}-breakpoints > .builder-column {
105
+ .${t.builderBlock.id}-breakpoints > .builder-column {
106
106
  width: var(--column-width-mobile) !important;
107
107
  margin-left: var(--column-margin-left-mobile) !important;
108
108
  }
109
109
  },
110
110
  `;
111
111
  }
112
- function $(t, n) {
112
+ function $(e, n) {
113
113
  return {
114
- ...t.link ? {
115
- href: t.link
114
+ ...e.link ? {
115
+ href: e.link
116
116
  } : {},
117
117
  [D()]: "builder-column",
118
- style: L(v(n))
118
+ style: L(w(n))
119
119
  };
120
120
  }
121
121
  return /* @__PURE__ */ y(B, { children: [
122
122
  /* @__PURE__ */ y(
123
123
  "div",
124
124
  {
125
- className: F((f = e.builderBlock) == null ? void 0 : f.id) + " div-b622c1bc",
126
- style: p(),
125
+ className: F((f = t.builderBlock) == null ? void 0 : f.id) + " div-fe220f58",
126
+ style: v(),
127
127
  children: [
128
- /* @__PURE__ */ o(z, { id: "builderio-columns", styles: w() }),
129
- (k = e.columns) == null ? void 0 : k.map((t, n) => /* @__PURE__ */ o(
128
+ /* @__PURE__ */ o(
129
+ z,
130
+ {
131
+ id: "builderio-columns",
132
+ styles: p(),
133
+ nonce: t.builderContext.nonce
134
+ }
135
+ ),
136
+ (k = t.columns) == null ? void 0 : k.map((e, n) => /* @__PURE__ */ o(
130
137
  N,
131
138
  {
132
- TagName: S(t),
139
+ TagName: S(e),
133
140
  actionAttributes: {},
134
- attributes: $(t, n),
141
+ attributes: $(e, n),
135
142
  children: /* @__PURE__ */ o(
136
143
  A,
137
144
  {
138
145
  path: `component.options.columns.${n}.blocks`,
139
- parent: e.builderBlock.id,
146
+ parent: t.builderBlock.id,
140
147
  styleProp: {
141
148
  flexGrow: "1"
142
149
  },
143
- context: e.builderContext,
144
- registeredComponents: e.builderComponents,
145
- linkComponent: e.builderLinkComponent,
146
- blocks: t.blocks
150
+ context: t.builderContext,
151
+ registeredComponents: t.builderComponents,
152
+ linkComponent: t.builderLinkComponent,
153
+ blocks: e.blocks
147
154
  }
148
155
  )
149
156
  },
@@ -152,7 +159,7 @@ function J(e) {
152
159
  ]
153
160
  }
154
161
  ),
155
- /* @__PURE__ */ o("style", { children: `.div-b622c1bc {
162
+ /* @__PURE__ */ o("style", { children: `.div-fe220f58 {
156
163
  display: flex;
157
164
  line-height: normal;
158
165
  }` })