@builder.io/sdk-react-nextjs 0.18.10 → 0.18.13

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 (105) hide show
  1. package/lib/browser/blocks/image/image.cjs +4 -4
  2. package/lib/browser/blocks/image/image.mjs +19 -17
  3. package/lib/browser/blocks/personalization-container/component-info.cjs +1 -0
  4. package/lib/browser/blocks/personalization-container/component-info.mjs +40 -0
  5. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  6. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  7. package/lib/browser/blocks/personalization-container/helpers.cjs +5 -0
  8. package/lib/browser/blocks/personalization-container/helpers.mjs +64 -0
  9. package/lib/browser/blocks/personalization-container/personalization-container.cjs +1 -0
  10. package/lib/browser/blocks/personalization-container/personalization-container.mjs +211 -0
  11. package/lib/browser/blocks/symbol/symbol.cjs +1 -1
  12. package/lib/browser/blocks/symbol/symbol.mjs +23 -23
  13. package/lib/browser/blocks/text/component-info.cjs +1 -1
  14. package/lib/browser/blocks/text/component-info.mjs +1 -4
  15. package/lib/browser/components/block/block.cjs +1 -1
  16. package/lib/browser/components/block/block.helpers.cjs +2 -2
  17. package/lib/browser/components/block/block.helpers.mjs +19 -18
  18. package/lib/browser/components/block/block.mjs +34 -34
  19. package/lib/browser/components/block/components/interactive-element.cjs +1 -1
  20. package/lib/browser/components/block/components/interactive-element.mjs +18 -11
  21. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  22. package/lib/browser/components/blocks/blocks-wrapper.mjs +2 -2
  23. package/lib/browser/components/blocks/blocks.cjs +1 -1
  24. package/lib/browser/components/blocks/blocks.mjs +21 -18
  25. package/lib/browser/components/content-variants/content-variants.cjs +1 -1
  26. package/lib/browser/components/content-variants/content-variants.mjs +51 -40
  27. package/lib/browser/constants/builder-registered-components.cjs +1 -1
  28. package/lib/browser/constants/builder-registered-components.mjs +43 -36
  29. package/lib/browser/constants/sdk-version.cjs +1 -1
  30. package/lib/browser/constants/sdk-version.mjs +1 -1
  31. package/lib/edge/blocks/image/image.cjs +4 -4
  32. package/lib/edge/blocks/image/image.mjs +19 -17
  33. package/lib/edge/blocks/personalization-container/component-info.cjs +1 -0
  34. package/lib/edge/blocks/personalization-container/component-info.mjs +40 -0
  35. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  36. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  37. package/lib/edge/blocks/personalization-container/helpers.cjs +5 -0
  38. package/lib/edge/blocks/personalization-container/helpers.mjs +64 -0
  39. package/lib/edge/blocks/personalization-container/personalization-container.cjs +1 -0
  40. package/lib/edge/blocks/personalization-container/personalization-container.mjs +211 -0
  41. package/lib/edge/blocks/symbol/symbol.cjs +1 -1
  42. package/lib/edge/blocks/symbol/symbol.mjs +23 -23
  43. package/lib/edge/blocks/text/component-info.cjs +1 -1
  44. package/lib/edge/blocks/text/component-info.mjs +1 -4
  45. package/lib/edge/components/block/block.cjs +1 -1
  46. package/lib/edge/components/block/block.helpers.cjs +2 -2
  47. package/lib/edge/components/block/block.helpers.mjs +19 -18
  48. package/lib/edge/components/block/block.mjs +34 -34
  49. package/lib/edge/components/block/components/interactive-element.cjs +1 -1
  50. package/lib/edge/components/block/components/interactive-element.mjs +18 -11
  51. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  52. package/lib/edge/components/blocks/blocks-wrapper.mjs +2 -2
  53. package/lib/edge/components/blocks/blocks.cjs +1 -1
  54. package/lib/edge/components/blocks/blocks.mjs +21 -18
  55. package/lib/edge/components/content-variants/content-variants.cjs +1 -1
  56. package/lib/edge/components/content-variants/content-variants.mjs +51 -40
  57. package/lib/edge/constants/builder-registered-components.cjs +1 -1
  58. package/lib/edge/constants/builder-registered-components.mjs +41 -34
  59. package/lib/edge/constants/sdk-version.cjs +1 -1
  60. package/lib/edge/constants/sdk-version.mjs +1 -1
  61. package/lib/node/blocks/image/image.cjs +4 -4
  62. package/lib/node/blocks/image/image.mjs +19 -17
  63. package/lib/node/blocks/personalization-container/component-info.cjs +1 -0
  64. package/lib/node/blocks/personalization-container/component-info.mjs +40 -0
  65. package/lib/node/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  66. package/lib/node/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  67. package/lib/node/blocks/personalization-container/helpers.cjs +5 -0
  68. package/lib/node/blocks/personalization-container/helpers.mjs +64 -0
  69. package/lib/node/blocks/personalization-container/personalization-container.cjs +1 -0
  70. package/lib/node/blocks/personalization-container/personalization-container.mjs +211 -0
  71. package/lib/node/blocks/symbol/symbol.cjs +1 -1
  72. package/lib/node/blocks/symbol/symbol.mjs +23 -23
  73. package/lib/node/blocks/text/component-info.cjs +1 -1
  74. package/lib/node/blocks/text/component-info.mjs +1 -4
  75. package/lib/node/components/block/block.cjs +1 -1
  76. package/lib/node/components/block/block.helpers.cjs +2 -2
  77. package/lib/node/components/block/block.helpers.mjs +19 -18
  78. package/lib/node/components/block/block.mjs +34 -34
  79. package/lib/node/components/block/components/interactive-element.cjs +1 -1
  80. package/lib/node/components/block/components/interactive-element.mjs +18 -11
  81. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  82. package/lib/node/components/blocks/blocks-wrapper.mjs +2 -2
  83. package/lib/node/components/blocks/blocks.cjs +1 -1
  84. package/lib/node/components/blocks/blocks.mjs +21 -18
  85. package/lib/node/components/content-variants/content-variants.cjs +1 -1
  86. package/lib/node/components/content-variants/content-variants.mjs +51 -40
  87. package/lib/node/constants/builder-registered-components.cjs +1 -1
  88. package/lib/node/constants/builder-registered-components.mjs +41 -34
  89. package/lib/node/constants/sdk-version.cjs +1 -1
  90. package/lib/node/constants/sdk-version.mjs +1 -1
  91. package/package.json +2 -2
  92. package/types/cjs/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
  93. package/types/cjs/blocks/personalization-container/helpers.d.ts +24 -4
  94. package/types/cjs/blocks/personalization-container/personalization-container.types.d.ts +2 -2
  95. package/types/cjs/components/block/block.helpers.d.ts +1 -0
  96. package/types/cjs/components/blocks/blocks-wrapper.d.ts +13 -1
  97. package/types/cjs/components/blocks/blocks.types.d.ts +1 -1
  98. package/types/cjs/constants/sdk-version.d.ts +1 -1
  99. package/types/esm/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
  100. package/types/esm/blocks/personalization-container/helpers.d.ts +24 -4
  101. package/types/esm/blocks/personalization-container/personalization-container.types.d.ts +2 -2
  102. package/types/esm/components/block/block.helpers.d.ts +1 -0
  103. package/types/esm/components/blocks/blocks-wrapper.d.ts +13 -1
  104. package/types/esm/components/blocks/blocks.types.d.ts +1 -1
  105. package/types/esm/constants/sdk-version.d.ts +1 -1
@@ -5,38 +5,38 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
5
5
  model: r
6
6
  }) => {
7
7
  var i;
8
- const o = (i = e.component) == null ? void 0 : i.name;
9
- if (!o)
8
+ const n = (i = e.component) == null ? void 0 : i.name;
9
+ if (!n)
10
10
  return null;
11
- const n = t[o];
12
- if (!n || l(n, r)) {
11
+ const o = t[n];
12
+ if (!o || l(o, r)) {
13
13
  console.warn(`
14
- Could not find a registered component named "${o}".
14
+ Could not find a registered component named "${n}".
15
15
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
16
16
  return;
17
17
  } else
18
- return n;
18
+ return o;
19
19
  }, f = ({
20
20
  block: e,
21
21
  context: t
22
22
  }) => {
23
23
  const {
24
24
  repeat: r,
25
- ...o
25
+ ...n
26
26
  } = e;
27
27
  if (!(r != null && r.collection))
28
28
  return;
29
- const n = a({
29
+ const o = a({
30
30
  code: r.collection,
31
31
  localState: t.localState,
32
32
  rootState: t.rootState,
33
33
  rootSetState: t.rootSetState,
34
34
  context: t.context
35
35
  });
36
- if (!Array.isArray(n))
36
+ if (!Array.isArray(o))
37
37
  return;
38
38
  const i = r.collection.split(".").pop(), s = r.itemName || (i ? i + "Item" : "item");
39
- return n.map((d, u) => ({
39
+ return o.map((d, u) => ({
40
40
  context: {
41
41
  ...t,
42
42
  localState: {
@@ -47,7 +47,7 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
47
47
  [`$${s}Index`]: u
48
48
  }
49
49
  },
50
- block: o
50
+ block: n
51
51
  }));
52
52
  }, C = (e, t) => {
53
53
  var r;
@@ -55,26 +55,27 @@ const l = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.include
55
55
  builderLinkComponent: t
56
56
  } : {};
57
57
  }, v = (e, t, r) => {
58
- var o;
59
- return (o = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && o.builderComponents ? {
58
+ var n;
59
+ return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderComponents ? {
60
60
  builderComponents: Object.fromEntries(Object.entries(t).filter(([i, s]) => !l(s, r)))
61
61
  } : {};
62
- }, h = (e, t) => {
62
+ }, g = (e, t) => {
63
63
  var r;
64
64
  return (r = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && r.builderBlock ? {
65
65
  builderBlock: t
66
66
  } : {};
67
- }, R = (e, t) => {
67
+ }, h = (e, t) => {
68
68
  var r;
69
69
  return (r = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && r.builderContext ? {
70
70
  builderContext: t
71
71
  } : {};
72
- };
72
+ }, S = (e) => e.toString();
73
73
  export {
74
+ S as generateKey,
74
75
  c as getComponent,
75
76
  f as getRepeatItemData,
76
- h as provideBuilderBlock,
77
- R as provideBuilderContext,
77
+ g as provideBuilderBlock,
78
+ h as provideBuilderContext,
78
79
  C as provideLinkComponent,
79
80
  v as provideRegisteredComponents
80
81
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as l, Fragment as u, jsxs as h } from "react/jsx-runtime";
2
- import { TARGET as v } from "../../constants/target.mjs";
3
- import { getBlockComponentOptions as S } from "../../functions/get-block-component-options.mjs";
4
- import { getProcessedBlock as P } from "../../functions/get-processed-block.mjs";
5
- import { isPreviewing as I } from "../../functions/is-previewing.mjs";
2
+ import { TARGET as S } from "../../constants/target.mjs";
3
+ import { getBlockComponentOptions as P } from "../../functions/get-block-component-options.mjs";
4
+ import { getProcessedBlock as I } from "../../functions/get-processed-block.mjs";
5
+ import { isPreviewing as O } from "../../functions/is-previewing.mjs";
6
6
  import "../../functions/get-fetch.mjs";
7
- import { getRepeatItemData as O, getComponent as w, provideBuilderBlock as W, provideBuilderContext as T, provideLinkComponent as L, provideRegisteredComponents as U } from "./block.helpers.mjs";
8
- import j from "./components/block-styles.mjs";
7
+ import { generateKey as x, getRepeatItemData as w, getComponent as W, provideBuilderBlock as T, provideBuilderContext as L, provideLinkComponent as U, provideRegisteredComponents as j } from "./block.helpers.mjs";
8
+ import y from "./components/block-styles.mjs";
9
9
  import N from "./components/block-wrapper.mjs";
10
- import x from "./components/component-ref/component-ref.mjs";
11
- import b from "./components/repeated-block.mjs";
12
- function y(e) {
10
+ import b from "./components/component-ref/component-ref.mjs";
11
+ import g from "./components/repeated-block.mjs";
12
+ function A(e) {
13
13
  var a, C, p, f;
14
14
  const d = function() {
15
- return O({
15
+ return w({
16
16
  block: e.block,
17
17
  context: e.context
18
18
  });
@@ -21,9 +21,9 @@ function y(e) {
21
21
  update: !1
22
22
  }, n = function() {
23
23
  var i;
24
- if (s.value && !s.update && !I())
24
+ if (s.value && !s.update && !O())
25
25
  return s.value;
26
- const c = (i = e.block.repeat) != null && i.collection ? e.block : P({
26
+ const c = (i = e.block.repeat) != null && i.collection ? e.block : I({
27
27
  block: e.block,
28
28
  localState: e.context.localState,
29
29
  rootState: e.context.rootState,
@@ -32,21 +32,21 @@ function y(e) {
32
32
  });
33
33
  return s.value = c, s.update = !1, c;
34
34
  }, r = function() {
35
- return w({
35
+ return W({
36
36
  block: n(),
37
37
  registeredComponents: e.registeredComponents,
38
38
  model: e.context.model
39
39
  });
40
- }, g = function() {
40
+ }, B = function() {
41
41
  var i;
42
42
  return e.block.tagName === "a" || ((i = n().properties) == null ? void 0 : i.href) || n().href ? e.linkComponent || "a" : e.block.tagName || "div";
43
- }, B = function() {
43
+ }, R = function() {
44
44
  var m, k;
45
45
  if ((m = e.block.repeat) != null && m.collection)
46
46
  return !!((k = d()) != null && k.length);
47
47
  const c = "hide" in n() ? n().hide : !1;
48
48
  return ("show" in n() ? n().show : !0) && !c;
49
- }, R = function() {
49
+ }, v = function() {
50
50
  var i, m;
51
51
  return !((i = r()) != null && i.component) && !d() ? (m = n().children) != null ? m : [] : [];
52
52
  }, o = function() {
@@ -55,11 +55,11 @@ function y(e) {
55
55
  blockChildren: (c = n().children) != null ? c : [],
56
56
  componentRef: (i = r()) == null ? void 0 : i.component,
57
57
  componentOptions: {
58
- ...S(n(), e.context),
59
- ...W(r(), n()),
60
- ...T(r(), e.context),
61
- ...L(r(), e.linkComponent),
62
- ...U(
58
+ ...P(n(), e.context),
59
+ ...T(r(), n()),
60
+ ...L(r(), e.context),
61
+ ...U(r(), e.linkComponent),
62
+ ...j(
63
63
  r(),
64
64
  e.registeredComponents,
65
65
  e.context.model
@@ -70,22 +70,22 @@ function y(e) {
70
70
  registeredComponents: e.registeredComponents,
71
71
  builderBlock: n(),
72
72
  includeBlockProps: ((m = r()) == null ? void 0 : m.noWrap) === !0,
73
- isInteractive: !((k = r()) != null && k.isRSC && v === "rsc")
73
+ isInteractive: !((k = r()) != null && k.isRSC && S === "rsc")
74
74
  };
75
75
  };
76
- return /* @__PURE__ */ l(u, { children: B() ? /* @__PURE__ */ h(u, { children: [
77
- /* @__PURE__ */ l(j, { block: n(), context: e.context }),
76
+ return /* @__PURE__ */ l(u, { children: R() ? /* @__PURE__ */ h(u, { children: [
77
+ /* @__PURE__ */ l(y, { block: n(), context: e.context }),
78
78
  (a = r()) != null && a.noWrap ? d() ? /* @__PURE__ */ l(u, { children: (f = d()) == null ? void 0 : f.map((t, c) => /* @__PURE__ */ l(
79
- b,
79
+ g,
80
80
  {
81
81
  repeatContext: t.context,
82
82
  block: t.block,
83
83
  registeredComponents: e.registeredComponents,
84
84
  linkComponent: e.linkComponent
85
85
  },
86
- c
86
+ x(c)
87
87
  )) }) : /* @__PURE__ */ l(
88
- x,
88
+ b,
89
89
  {
90
90
  componentRef: o().componentRef,
91
91
  componentOptions: o().componentOptions,
@@ -98,23 +98,23 @@ function y(e) {
98
98
  isInteractive: o().isInteractive
99
99
  }
100
100
  ) : /* @__PURE__ */ l(u, { children: d() ? /* @__PURE__ */ l(u, { children: (p = d()) == null ? void 0 : p.map((t, c) => /* @__PURE__ */ l(
101
- b,
101
+ g,
102
102
  {
103
103
  repeatContext: t.context,
104
104
  block: t.block,
105
105
  registeredComponents: e.registeredComponents,
106
106
  linkComponent: e.linkComponent
107
107
  },
108
- c
108
+ x(c)
109
109
  )) }) : /* @__PURE__ */ h(
110
110
  N,
111
111
  {
112
- Wrapper: g(),
112
+ Wrapper: B(),
113
113
  block: n(),
114
114
  context: e.context,
115
115
  children: [
116
116
  /* @__PURE__ */ l(
117
- x,
117
+ b,
118
118
  {
119
119
  componentRef: o().componentRef,
120
120
  componentOptions: o().componentOptions,
@@ -127,8 +127,8 @@ function y(e) {
127
127
  isInteractive: o().isInteractive
128
128
  }
129
129
  ),
130
- (C = R()) == null ? void 0 : C.map((t) => /* @__PURE__ */ l(
131
- y,
130
+ (C = v()) == null ? void 0 : C.map((t) => /* @__PURE__ */ l(
131
+ A,
132
132
  {
133
133
  block: t,
134
134
  registeredComponents: e.registeredComponents,
@@ -143,5 +143,5 @@ function y(e) {
143
143
  ] }) : null });
144
144
  }
145
145
  export {
146
- y as default
146
+ A as default
147
147
  };
@@ -1 +1 @@
1
- "use client";"use strict";const e=require("react/jsx-runtime"),r=require("../../../functions/get-block-actions.cjs"),n=require("../../../functions/get-block-properties.cjs"),o=require("../../awaiter.cjs");function a(t){function c(){return t.includeBlockProps?{...n.getBlockProperties({block:t.block,context:t.context}),...r.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}return e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(o,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:c(),children:t.children})}):e.jsx(t.Wrapper,{...t.wrapperProps,attributes:c(),children:t.children})})}module.exports=a;
1
+ "use client";"use strict";const e=require("react/jsx-runtime"),o=require("react"),l=require("../../../functions/get-block-actions.cjs"),i=require("../../../functions/get-block-properties.cjs"),u=require("../../awaiter.cjs");function x(t){var r,n;o.useState(()=>0);function c(){return t.includeBlockProps?{...i.getBlockProperties({block:t.block,context:t.context}),...l.getBlockActions({block:t.block,rootState:t.context.rootState,rootSetState:t.context.rootSetState,localState:t.context.localState,context:t.context.context})}:{}}function a(){return t.wrapperProps}return o.useEffect(()=>{},[t.wrapperProps,(n=(r=t.block)==null?void 0:r.component)==null?void 0:n.options]),e.jsx(e.Fragment,{children:t.Wrapper.load?e.jsx(e.Fragment,{children:e.jsx(u,{load:t.Wrapper.load,fallback:t.Wrapper.fallback,props:t.wrapperProps,attributes:c(),children:t.children})}):e.jsx(t.Wrapper,{...a(),attributes:c(),children:t.children})})}module.exports=x;
@@ -1,16 +1,19 @@
1
1
  "use client";
2
- import { jsx as e, Fragment as c } from "react/jsx-runtime";
3
- import { getBlockActions as o } from "../../../functions/get-block-actions.mjs";
4
- import { getBlockProperties as a } from "../../../functions/get-block-properties.mjs";
5
- import l from "../../awaiter.mjs";
6
- function u(t) {
2
+ import { jsx as e, Fragment as a } from "react/jsx-runtime";
3
+ import { useState as l, useEffect as i } from "react";
4
+ import { getBlockActions as u } from "../../../functions/get-block-actions.mjs";
5
+ import { getBlockProperties as f } from "../../../functions/get-block-properties.mjs";
6
+ import m from "../../awaiter.mjs";
7
+ function h(t) {
8
+ var o, c;
9
+ l(() => 0);
7
10
  function r() {
8
11
  return t.includeBlockProps ? {
9
- ...a({
12
+ ...f({
10
13
  block: t.block,
11
14
  context: t.context
12
15
  }),
13
- ...o({
16
+ ...u({
14
17
  block: t.block,
15
18
  rootState: t.context.rootState,
16
19
  rootSetState: t.context.rootSetState,
@@ -19,8 +22,12 @@ function u(t) {
19
22
  })
20
23
  } : {};
21
24
  }
22
- return /* @__PURE__ */ e(c, { children: t.Wrapper.load ? /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
23
- l,
25
+ function n() {
26
+ return t.wrapperProps;
27
+ }
28
+ return i(() => {
29
+ }, [t.wrapperProps, (c = (o = t.block) == null ? void 0 : o.component) == null ? void 0 : c.options]), /* @__PURE__ */ e(a, { children: t.Wrapper.load ? /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
30
+ m,
24
31
  {
25
32
  load: t.Wrapper.load,
26
33
  fallback: t.Wrapper.fallback,
@@ -28,8 +35,8 @@ function u(t) {
28
35
  attributes: r(),
29
36
  children: t.children
30
37
  }
31
- ) }) : /* @__PURE__ */ e(t.Wrapper, { ...t.wrapperProps, attributes: r(), children: t.children }) });
38
+ ) }) : /* @__PURE__ */ e(t.Wrapper, { ...n(), attributes: r(), children: t.children }) });
32
39
  }
33
40
  export {
34
- u as default
41
+ h as default
35
42
  };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("../../functions/is-editing.cjs");function d(e){const c=i.useRef(null);i.useState(()=>!1);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function s(){if(!e.path)return;const t="this.",n="component.options.";return e.path.startsWith(t)?e.path.replace(t,""):e.path.startsWith(n)?e.path:`${n}${e.path||""}`}function l(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}function u(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}return i.useEffect(()=>{},[]),i.useEffect(()=>{},[e.blocks]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-2b05e766","builder-path":s(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>l(),onMouseEnter:t=>u(),onKeyPress:t=>l(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-2b05e766 {
1
+ "use client";"use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("../../functions/is-editing.cjs");function d(e){const c=i.useRef(null);i.useState(()=>!1);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function s(){if(!e.path)return;const t="this.",n="component.options.";return e.path.startsWith(t)?e.path.replace(t,""):e.path.startsWith(n)?e.path:`${n}${e.path||""}`}function l(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}function u(){var t,n;r.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:s()}},"*"))}return i.useEffect(()=>{},[]),i.useEffect(()=>{},[e.blocks]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-7d1e7a14","builder-path":s(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>l(),onMouseEnter:t=>u(),onKeyPress:t=>l(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7d1e7a14 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -52,7 +52,7 @@ function y(e) {
52
52
  e.BlocksWrapper,
53
53
  {
54
54
  ref: c,
55
- className: o() + " props-blocks-wrapper-2b05e766",
55
+ className: o() + " props-blocks-wrapper-7d1e7a14",
56
56
  "builder-path": a(),
57
57
  "builder-parent-id": e.parent,
58
58
  style: e.styleProp,
@@ -63,7 +63,7 @@ function y(e) {
63
63
  children: e.children
64
64
  }
65
65
  ),
66
- /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-2b05e766 {
66
+ /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-7d1e7a14 {
67
67
  display: flex;
68
68
  flex-direction: column;
69
69
  align-items: stretch;
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),l=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function a(e){var n,c,r;return t.jsx(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:(n=e.context)==null?void 0:n.BlocksWrapper,BlocksWrapperProps:(c=e.context)==null?void 0:c.BlocksWrapperProps,children:e.blocks?t.jsx(t.Fragment,{children:(r=e.blocks)==null?void 0:r.map(o=>t.jsx(l,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}module.exports=a;
1
+ "use strict";const t=require("react/jsx-runtime"),o=require("../block/block.cjs"),s=require("./blocks-wrapper.cjs");function a(e){var n,c,r;return t.jsxs(s,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapperProps:e.BlocksWrapperProps||((n=e.context)==null?void 0:n.BlocksWrapperProps),classNameProp:e.className,BlocksWrapper:(c=e.context)==null?void 0:c.BlocksWrapper,children:[e.children,e.blocks?t.jsx(t.Fragment,{children:(r=e.blocks)==null?void 0:r.map(l=>t.jsx(o,{block:l,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},l.id))}):null]})}module.exports=a;
@@ -1,31 +1,34 @@
1
- import { jsx as t, Fragment as c } from "react/jsx-runtime";
2
- import a from "../block/block.mjs";
1
+ import { jsxs as c, jsx as l, Fragment as a } from "react/jsx-runtime";
2
+ import s from "../block/block.mjs";
3
3
  import m from "./blocks-wrapper.mjs";
4
- function B(e) {
5
- var o, n, r;
6
- return /* @__PURE__ */ t(
4
+ function d(e) {
5
+ var t, n, o;
6
+ return /* @__PURE__ */ c(
7
7
  m,
8
8
  {
9
9
  blocks: e.blocks,
10
10
  parent: e.parent,
11
11
  path: e.path,
12
12
  styleProp: e.styleProp,
13
+ BlocksWrapperProps: e.BlocksWrapperProps || ((t = e.context) == null ? void 0 : t.BlocksWrapperProps),
13
14
  classNameProp: e.className,
14
- BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
15
- BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
16
- children: e.blocks ? /* @__PURE__ */ t(c, { children: (r = e.blocks) == null ? void 0 : r.map((l) => /* @__PURE__ */ t(
17
- a,
18
- {
19
- block: l,
20
- linkComponent: e.linkComponent,
21
- context: e.context,
22
- registeredComponents: e.registeredComponents
23
- },
24
- l.id
25
- )) }) : null
15
+ BlocksWrapper: (n = e.context) == null ? void 0 : n.BlocksWrapper,
16
+ children: [
17
+ e.children,
18
+ e.blocks ? /* @__PURE__ */ l(a, { children: (o = e.blocks) == null ? void 0 : o.map((r) => /* @__PURE__ */ l(
19
+ s,
20
+ {
21
+ block: r,
22
+ linkComponent: e.linkComponent,
23
+ context: e.context,
24
+ registeredComponents: e.registeredComponents
25
+ },
26
+ r.id
27
+ )) }) : null
28
+ ]
26
29
  }
27
30
  );
28
31
  }
29
32
  export {
30
- B as default
33
+ d as default
31
34
  };
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),S=require("../../constants/target.cjs"),C=require("../../helpers/ab-tests.cjs"),s=require("../../helpers/canTrack.cjs"),d=require("../content/content.cjs"),l=require("../inlined-script.cjs"),T=require("../inlined-styles.cjs"),a=require("./helpers.cjs");function V(t){var r;const c=a.checkShouldRenderVariants({canTrack:s.getDefaultCanTrack(t.canTrack),content:t.content}),u=function(){var n;return a.getUpdateCookieAndStylesScript(a.getVariants(t.content).map(o=>({id:o.testVariationId,testRatio:o.testRatio})),((n=t.content)==null?void 0:n.id)||"")},k=function(){return a.getVariants(t.content).map(n=>`.variant-${n.testVariationId} { display: none; } `).join("")},m=function(){var n;return c?{...t.content,testVariationId:(n=t.content)==null?void 0:n.id}:C.handleABTestingSync({item:t.content,canTrack:s.getDefaultCanTrack(t.canTrack)})};return e.jsxs(e.Fragment,{children:[!t.isNestedRender&&S.TARGET!=="reactNative"?e.jsx(l,{id:"builderio-init-variants-fns",scriptStr:a.getInitVariantsFnsScriptString(),nonce:t.nonce||""}):null,c?e.jsxs(e.Fragment,{children:[e.jsx(T,{id:"builderio-variants",styles:k(),nonce:t.nonce||""}),e.jsx(l,{id:"builderio-variants-visibility",scriptStr:u(),nonce:t.nonce||""}),(r=a.getVariants(t.content))==null?void 0:r.map(i=>e.jsx(d,{apiHost:t.apiHost,isNestedRender:t.isNestedRender,nonce:t.nonce,content:i,showContent:!1,model:t.model,data:t.data,context:t.context,apiKey:t.apiKey,apiVersion:t.apiVersion,customComponents:t.customComponents,linkComponent:t.linkComponent,canTrack:t.canTrack,locale:t.locale,enrich:t.enrich,isSsrAbTest:c,blocksWrapper:t.blocksWrapper,blocksWrapperProps:t.blocksWrapperProps,contentWrapper:t.contentWrapper,contentWrapperProps:t.contentWrapperProps,trustedHosts:t.trustedHosts},i.testVariationId))]}):null,e.jsx(d,{apiHost:t.apiHost,nonce:t.nonce,isNestedRender:t.isNestedRender,content:m(),showContent:!0,model:t.model,data:t.data,context:t.context,apiKey:t.apiKey,apiVersion:t.apiVersion,customComponents:t.customComponents,linkComponent:t.linkComponent,canTrack:t.canTrack,locale:t.locale,enrich:t.enrich,isSsrAbTest:c,blocksWrapper:t.blocksWrapper,blocksWrapperProps:t.blocksWrapperProps,contentWrapper:t.contentWrapper,contentWrapperProps:t.contentWrapperProps,trustedHosts:t.trustedHosts})]})}module.exports=V;
1
+ "use strict";const n=require("react/jsx-runtime"),l=require("../../blocks/personalization-container/helpers.cjs"),d=require("../../constants/target.cjs"),C=require("../../helpers/ab-tests.cjs"),u=require("../../helpers/canTrack.cjs"),S=require("../content/content.cjs"),r=require("../inlined-script.cjs"),V=require("../inlined-styles.cjs"),i=require("./helpers.cjs");function g(t){var o;const c=i.checkShouldRenderVariants({canTrack:u.getDefaultCanTrack(t.canTrack),content:t.content}),k=function(){var e;return i.getUpdateCookieAndStylesScript(i.getVariants(t.content).map(s=>({id:s.testVariationId,testRatio:s.testRatio})),((e=t.content)==null?void 0:e.id)||"")},m=function(){return i.getVariants(t.content).map(e=>`.variant-${e.testVariationId} { display: none; } `).join("")},T=function(){var e;return c?{...t.content,testVariationId:(e=t.content)==null?void 0:e.id}:C.handleABTestingSync({item:t.content,canTrack:u.getDefaultCanTrack(t.canTrack)})};return n.jsxs(n.Fragment,{children:[!t.isNestedRender&&d.TARGET!=="reactNative"?n.jsxs(n.Fragment,{children:[n.jsx(r,{id:"builderio-init-variants-fns",scriptStr:i.getInitVariantsFnsScriptString(),nonce:t.nonce||""}),l.SDKS_SUPPORTING_PERSONALIZATION.includes(d.TARGET)?n.jsx(r,{id:"builderio-init-personalization-variants-fns",nonce:t.nonce||"",scriptStr:l.getInitPersonalizationVariantsFnsScriptString()}):null]}):null,c?n.jsxs(n.Fragment,{children:[n.jsx(V,{id:"builderio-variants",styles:m(),nonce:t.nonce||""}),n.jsx(r,{id:"builderio-variants-visibility",scriptStr:k(),nonce:t.nonce||""}),(o=i.getVariants(t.content))==null?void 0:o.map(a=>n.jsx(S,{apiHost:t.apiHost,isNestedRender:t.isNestedRender,nonce:t.nonce,content:a,showContent:!1,model:t.model,data:t.data,context:t.context,apiKey:t.apiKey,apiVersion:t.apiVersion,customComponents:t.customComponents,linkComponent:t.linkComponent,canTrack:t.canTrack,locale:t.locale,enrich:t.enrich,isSsrAbTest:c,blocksWrapper:t.blocksWrapper,blocksWrapperProps:t.blocksWrapperProps,contentWrapper:t.contentWrapper,contentWrapperProps:t.contentWrapperProps,trustedHosts:t.trustedHosts},a.testVariationId))]}):null,n.jsx(S,{apiHost:t.apiHost,nonce:t.nonce,isNestedRender:t.isNestedRender,content:T(),showContent:!0,model:t.model,data:t.data,context:t.context,apiKey:t.apiKey,apiVersion:t.apiVersion,customComponents:t.customComponents,linkComponent:t.linkComponent,canTrack:t.canTrack,locale:t.locale,enrich:t.enrich,isSsrAbTest:c,blocksWrapper:t.blocksWrapper,blocksWrapperProps:t.blocksWrapperProps,contentWrapper:t.contentWrapper,contentWrapperProps:t.contentWrapperProps,trustedHosts:t.trustedHosts})]})}module.exports=g;
@@ -1,27 +1,28 @@
1
- import { jsxs as d, Fragment as s, jsx as i } from "react/jsx-runtime";
2
- import { TARGET as f } from "../../constants/target.mjs";
1
+ import { jsxs as o, Fragment as c, jsx as e } from "react/jsx-runtime";
2
+ import { SDKS_SUPPORTING_PERSONALIZATION as T, getInitPersonalizationVariantsFnsScriptString as V } from "../../blocks/personalization-container/helpers.mjs";
3
+ import { TARGET as m } from "../../constants/target.mjs";
3
4
  import { handleABTestingSync as W } from "../../helpers/ab-tests.mjs";
4
- import { getDefaultCanTrack as l } from "../../helpers/canTrack.mjs";
5
- import m from "../content/content.mjs";
6
- import u from "../inlined-script.mjs";
7
- import V from "../inlined-styles.mjs";
8
- import { checkShouldRenderVariants as b, getInitVariantsFnsScriptString as h, getVariants as o, getUpdateCookieAndStylesScript as y } from "./helpers.mjs";
9
- function N(t) {
10
- var c;
11
- const a = b({
12
- canTrack: l(t.canTrack),
5
+ import { getDefaultCanTrack as u } from "../../helpers/canTrack.mjs";
6
+ import S from "../content/content.mjs";
7
+ import r from "../inlined-script.mjs";
8
+ import b from "../inlined-styles.mjs";
9
+ import { checkShouldRenderVariants as h, getInitVariantsFnsScriptString as y, getVariants as d, getUpdateCookieAndStylesScript as P } from "./helpers.mjs";
10
+ function j(t) {
11
+ var s;
12
+ const a = h({
13
+ canTrack: u(t.canTrack),
13
14
  content: t.content
14
15
  }), k = function() {
15
16
  var n;
16
- return y(
17
- o(t.content).map((r) => ({
18
- id: r.testVariationId,
19
- testRatio: r.testRatio
17
+ return P(
18
+ d(t.content).map((l) => ({
19
+ id: l.testVariationId,
20
+ testRatio: l.testRatio
20
21
  })),
21
22
  ((n = t.content) == null ? void 0 : n.id) || ""
22
23
  );
23
- }, S = function() {
24
- return o(t.content).map((n) => `.variant-${n.testVariationId} { display: none; } `).join("");
24
+ }, f = function() {
25
+ return d(t.content).map((n) => `.variant-${n.testVariationId} { display: none; } `).join("");
25
26
  }, C = function() {
26
27
  var n;
27
28
  return a ? {
@@ -29,42 +30,52 @@ function N(t) {
29
30
  testVariationId: (n = t.content) == null ? void 0 : n.id
30
31
  } : W({
31
32
  item: t.content,
32
- canTrack: l(t.canTrack)
33
+ canTrack: u(t.canTrack)
33
34
  });
34
35
  };
35
- return /* @__PURE__ */ d(s, { children: [
36
- !t.isNestedRender && f !== "reactNative" ? /* @__PURE__ */ i(
37
- u,
38
- {
39
- id: "builderio-init-variants-fns",
40
- scriptStr: h(),
41
- nonce: t.nonce || ""
42
- }
43
- ) : null,
44
- a ? /* @__PURE__ */ d(s, { children: [
45
- /* @__PURE__ */ i(
46
- V,
36
+ return /* @__PURE__ */ o(c, { children: [
37
+ !t.isNestedRender && m !== "reactNative" ? /* @__PURE__ */ o(c, { children: [
38
+ /* @__PURE__ */ e(
39
+ r,
40
+ {
41
+ id: "builderio-init-variants-fns",
42
+ scriptStr: y(),
43
+ nonce: t.nonce || ""
44
+ }
45
+ ),
46
+ T.includes(m) ? /* @__PURE__ */ e(
47
+ r,
48
+ {
49
+ id: "builderio-init-personalization-variants-fns",
50
+ nonce: t.nonce || "",
51
+ scriptStr: V()
52
+ }
53
+ ) : null
54
+ ] }) : null,
55
+ a ? /* @__PURE__ */ o(c, { children: [
56
+ /* @__PURE__ */ e(
57
+ b,
47
58
  {
48
59
  id: "builderio-variants",
49
- styles: S(),
60
+ styles: f(),
50
61
  nonce: t.nonce || ""
51
62
  }
52
63
  ),
53
- /* @__PURE__ */ i(
54
- u,
64
+ /* @__PURE__ */ e(
65
+ r,
55
66
  {
56
67
  id: "builderio-variants-visibility",
57
68
  scriptStr: k(),
58
69
  nonce: t.nonce || ""
59
70
  }
60
71
  ),
61
- (c = o(t.content)) == null ? void 0 : c.map((e) => /* @__PURE__ */ i(
62
- m,
72
+ (s = d(t.content)) == null ? void 0 : s.map((i) => /* @__PURE__ */ e(
73
+ S,
63
74
  {
64
75
  apiHost: t.apiHost,
65
76
  isNestedRender: t.isNestedRender,
66
77
  nonce: t.nonce,
67
- content: e,
78
+ content: i,
68
79
  showContent: !1,
69
80
  model: t.model,
70
81
  data: t.data,
@@ -83,11 +94,11 @@ function N(t) {
83
94
  contentWrapperProps: t.contentWrapperProps,
84
95
  trustedHosts: t.trustedHosts
85
96
  },
86
- e.testVariationId
97
+ i.testVariationId
87
98
  ))
88
99
  ] }) : null,
89
- /* @__PURE__ */ i(
90
- m,
100
+ /* @__PURE__ */ e(
101
+ S,
91
102
  {
92
103
  apiHost: t.apiHost,
93
104
  nonce: t.nonce,
@@ -115,5 +126,5 @@ function N(t) {
115
126
  ] });
116
127
  }
117
128
  export {
118
- N as default
129
+ j as default
119
130
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");require("../functions/evaluate/node-runtime/safeDynamicRequire.cjs");require("../functions/get-fetch.cjs");const o=require("../blocks/button/component-info.cjs"),n=require("../blocks/button/button.cjs"),e=require("../blocks/columns/component-info.cjs"),t=require("../blocks/columns/columns.cjs"),r=require("../blocks/fragment/component-info.cjs"),c=require("../blocks/fragment/fragment.cjs"),m=require("../blocks/image/component-info.cjs"),s=require("../blocks/image/image.cjs"),p=require("../blocks/section/component-info.cjs"),i=require("../blocks/section/section.cjs"),u=require("../blocks/slot/component-info.cjs"),q=require("../blocks/slot/slot.cjs"),f=require("../blocks/symbol/component-info.cjs"),I=require("../blocks/symbol/symbol.cjs"),g=require("../blocks/text/component-info.cjs"),a=require("../blocks/text/text.cjs"),l=require("./extra-components.cjs"),$=()=>[{component:n,...o.componentInfo},{component:t,...e.componentInfo},{component:c,...r.componentInfo},{component:s,...m.componentInfo},{component:i,...p.componentInfo},{component:q,...u.componentInfo},{component:I,...f.componentInfo},{component:a,...g.componentInfo},...l.getExtraComponents()];exports.getDefaultRegisteredComponents=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./target.cjs");require("../functions/evaluate/node-runtime/safeDynamicRequire.cjs");require("../functions/get-fetch.cjs");const n=require("../blocks/button/component-info.cjs"),e=require("../blocks/button/button.cjs"),t=require("../blocks/columns/component-info.cjs"),r=require("../blocks/columns/columns.cjs"),c=require("../blocks/fragment/component-info.cjs"),s=require("../blocks/fragment/fragment.cjs"),i=require("../blocks/image/component-info.cjs"),m=require("../blocks/image/image.cjs"),p=require("../blocks/personalization-container/component-info.cjs"),u=require("../blocks/personalization-container/helpers.cjs"),q=require("../blocks/personalization-container/personalization-container.cjs"),f=require("../blocks/section/component-info.cjs"),I=require("../blocks/section/section.cjs"),a=require("../blocks/slot/component-info.cjs"),l=require("../blocks/slot/slot.cjs"),g=require("../blocks/symbol/component-info.cjs"),$=require("../blocks/symbol/symbol.cjs"),S=require("../blocks/text/component-info.cjs"),d=require("../blocks/text/text.cjs"),C=require("./extra-components.cjs"),R=()=>[{component:e,...n.componentInfo},{component:r,...t.componentInfo},{component:s,...c.componentInfo},{component:m,...i.componentInfo},{component:I,...f.componentInfo},{component:l,...a.componentInfo},{component:$,...g.componentInfo},{component:d,...S.componentInfo},...u.SDKS_SUPPORTING_PERSONALIZATION.includes(o.TARGET)?[{component:q,...p.componentInfo}]:[],...C.getExtraComponents()];exports.getDefaultRegisteredComponents=R;