@builder.io/sdk-react 2.0.8 → 2.0.12
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.
- package/lib/browser/blocks-exports.cjs +28 -28
- package/lib/browser/blocks-exports.mjs +991 -966
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +3 -3
- package/lib/browser/init.mjs +3 -3
- package/lib/browser/server-entry-acf08871.cjs +2 -0
- package/lib/{node/server-entry-f6ee5d92.js → browser/server-entry-dc66de59.js} +346 -342
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-ef5e6161.js → accordion-37ff8319.js} +1 -1
- package/lib/edge/{accordion-88007399.cjs → accordion-b3b8c262.cjs} +1 -1
- package/lib/edge/blocks-793430a0.cjs +12 -0
- package/lib/edge/blocks-e0e60319.js +833 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-8d307faf.js → button-15992755.js} +2 -2
- package/lib/edge/{button-228f448d.cjs → button-875ac10b.cjs} +1 -1
- package/lib/edge/{columns-3547be8c.cjs → columns-11ead988.cjs} +1 -1
- package/lib/edge/{columns-77b7011a.js → columns-cfe663b2.js} +4 -4
- package/lib/edge/{content-variants-4f7cad1a.js → content-variants-e780597b.js} +11 -11
- package/lib/edge/{content-variants-f0edf280.cjs → content-variants-f8ef104d.cjs} +4 -4
- package/lib/edge/{evaluate-384a03ed.js → evaluate-6408d64d.js} +87 -87
- package/lib/edge/{evaluate-39c2c786.cjs → evaluate-938a955e.cjs} +6 -6
- package/lib/edge/{form-c6da17f5.cjs → form-75a774bc.cjs} +1 -1
- package/lib/edge/{form-d40e9eca.js → form-7735178f.js} +4 -4
- package/lib/edge/{get-class-prop-name-767dbeb0.js → get-class-prop-name-d005a2bb.js} +1 -1
- package/lib/edge/{get-class-prop-name-4f8743e9.cjs → get-class-prop-name-e596650d.cjs} +1 -1
- package/lib/edge/{img-d650b796.js → img-045bb860.js} +1 -1
- package/lib/edge/{img-c50b3839.cjs → img-dd79e34b.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +3 -3
- package/lib/edge/init.mjs +3 -3
- package/lib/edge/{input-aaba7df0.cjs → input-3bd0ac03.cjs} +1 -1
- package/lib/edge/{input-5646dcb2.js → input-adf80016.js} +1 -1
- package/lib/edge/{select-2e7bf7d0.cjs → select-882193d4.cjs} +1 -1
- package/lib/edge/{select-d3905dcd.js → select-90b076db.js} +1 -1
- package/lib/edge/{server-entry-29a170e3.js → server-entry-84c3cdd6.js} +59 -58
- package/lib/edge/server-entry-d5ae6221.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-82c0b340.js → slot-293114eb.js} +4 -4
- package/lib/edge/{slot-695259cf.cjs → slot-42b9b358.cjs} +1 -1
- package/lib/edge/{symbol-5a6a783f.cjs → symbol-3e0799b8.cjs} +1 -1
- package/lib/edge/{symbol-91897bd4.js → symbol-aed9cd2b.js} +2 -2
- package/lib/edge/{tabs-a191e7b1.js → tabs-0cf37bf4.js} +4 -4
- package/lib/edge/{tabs-4c4a6b19.cjs → tabs-f5c4f350.cjs} +1 -1
- package/lib/edge/{text-ca974245.js → text-9e2166c7.js} +2 -2
- package/lib/edge/{text-7a00e2f8.cjs → text-abb84188.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +29 -29
- package/lib/node/blocks-exports.mjs +983 -958
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-a6fb6ac7.cjs → node-runtime-11912803.cjs} +4 -4
- package/lib/node/{node-runtime-d8e6d827.js → node-runtime-49e4c6cb.js} +3 -3
- package/lib/node/server-entry-acf08871.cjs +2 -0
- package/lib/{browser/server-entry-f6ee5d92.js → node/server-entry-dc66de59.js} +346 -342
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +3 -3
- package/types/components/block/block.helpers.d.ts +1 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/init.d.ts +1 -0
- package/types/functions/get-processed-block.d.ts +1 -0
- package/types/functions/register-component.d.ts +1 -1
- package/lib/browser/server-entry-ba3e0524.cjs +0 -2
- package/lib/edge/blocks-90fd2fd8.js +0 -808
- package/lib/edge/blocks-dc478c97.cjs +0 -12
- package/lib/edge/server-entry-b0e7430b.cjs +0 -2
- package/lib/node/server-entry-ba3e0524.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-d5ae6221.cjs");function i(e){var u;return n.createElement("select",{...e.attributes,value:e.value,key:r.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(u=e.options)==null?void 0:u.map((t,a)=>l.jsx("option",{value:t.value,children:t.name||t.value},`${t.name}-${a}`)))}exports.default=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as m } from "react";
|
|
3
|
-
import { isEditing as n } from "./server-entry-
|
|
3
|
+
import { isEditing as n } from "./server-entry-84c3cdd6.js";
|
|
4
4
|
function r(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ m(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const v = "react",
|
|
1
|
+
const v = "react", Q = (t) => {
|
|
2
2
|
const e = {};
|
|
3
3
|
return t.forEach((n, r) => {
|
|
4
4
|
e[r] = n;
|
|
5
5
|
}), e;
|
|
6
|
-
}, L = (t) => t instanceof URLSearchParams ?
|
|
6
|
+
}, L = (t) => t instanceof URLSearchParams ? Q(t) : t, V = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
7
7
|
function c() {
|
|
8
8
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Y() {
|
|
11
11
|
return c() && window.self !== window.top;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function Z(t) {
|
|
14
|
+
return Y() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
15
15
|
V(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
16
16
|
}
|
|
17
17
|
function _t(t) {
|
|
@@ -20,16 +20,17 @@ function _t(t) {
|
|
|
20
20
|
}
|
|
21
21
|
const $t = (t) => ({
|
|
22
22
|
type: "builder.registerComponent",
|
|
23
|
-
data:
|
|
24
|
-
}),
|
|
23
|
+
data: U(t)
|
|
24
|
+
}), tt = (t) => {
|
|
25
25
|
const e = t.toString().trim();
|
|
26
26
|
return `return (${!e.startsWith("function") && !e.startsWith("(") ? "function " : ""}${e}).apply(this, arguments)`;
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
28
|
+
function U(t) {
|
|
29
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? tt(n) : n));
|
|
30
30
|
}
|
|
31
31
|
const x = {};
|
|
32
32
|
function et(t, e) {
|
|
33
|
+
t === "plugin" && (e = U(e));
|
|
33
34
|
let n = x[t];
|
|
34
35
|
if (n || (n = x[t] = []), n.push(e), c()) {
|
|
35
36
|
const r = {
|
|
@@ -57,7 +58,7 @@ function Gt(t) {
|
|
|
57
58
|
parent.postMessage(e, "*");
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
const T = "builder.", nt = "options.",
|
|
61
|
+
const T = "builder.", nt = "options.", M = (t) => {
|
|
61
62
|
if (!t)
|
|
62
63
|
return {};
|
|
63
64
|
const e = L(t), n = {};
|
|
@@ -71,7 +72,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
71
72
|
if (!c())
|
|
72
73
|
return {};
|
|
73
74
|
const t = new URLSearchParams(window.location.search);
|
|
74
|
-
return
|
|
75
|
+
return M(t);
|
|
75
76
|
}, b = "[Builder.io]: ", f = {
|
|
76
77
|
log: (...t) => console.log(b, ...t),
|
|
77
78
|
error: (...t) => console.error(b, ...t),
|
|
@@ -82,7 +83,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
82
83
|
return t;
|
|
83
84
|
const e = t.split(".");
|
|
84
85
|
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
85
|
-
},
|
|
86
|
+
}, F = ({
|
|
86
87
|
name: t,
|
|
87
88
|
canTrack: e
|
|
88
89
|
}) => {
|
|
@@ -93,14 +94,14 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
93
94
|
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
|
-
}, N = async (t) =>
|
|
97
|
+
}, N = async (t) => F(t), st = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(m).join("; "), it = [["secure", ""], ["SameSite", "None"]], at = ({
|
|
97
98
|
name: t,
|
|
98
99
|
value: e,
|
|
99
100
|
expires: n
|
|
100
101
|
}) => {
|
|
101
102
|
const o = (c() ? location.protocol === "https:" : !0) ? it : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], a = [[t, e], ...s, ["path", "/"], ["domain", ot(window.location.hostname)], ...o];
|
|
102
103
|
return st(a);
|
|
103
|
-
},
|
|
104
|
+
}, j = async ({
|
|
104
105
|
name: t,
|
|
105
106
|
value: e,
|
|
106
107
|
expires: n,
|
|
@@ -125,16 +126,16 @@ function ct() {
|
|
|
125
126
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function D() {
|
|
129
130
|
return ct().replace(/-/g, "");
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const K = "builderSessionId", ut = async ({
|
|
132
133
|
canTrack: t
|
|
133
134
|
}) => {
|
|
134
135
|
if (!t)
|
|
135
136
|
return;
|
|
136
137
|
const e = await N({
|
|
137
|
-
name:
|
|
138
|
+
name: K,
|
|
138
139
|
canTrack: t
|
|
139
140
|
});
|
|
140
141
|
if (m(e))
|
|
@@ -146,20 +147,20 @@ const D = "builderSessionId", ut = async ({
|
|
|
146
147
|
canTrack: t
|
|
147
148
|
}), n;
|
|
148
149
|
}
|
|
149
|
-
}, dt = () =>
|
|
150
|
+
}, dt = () => D(), lt = ({
|
|
150
151
|
id: t,
|
|
151
152
|
canTrack: e
|
|
152
|
-
}) =>
|
|
153
|
-
name:
|
|
153
|
+
}) => j({
|
|
154
|
+
name: K,
|
|
154
155
|
value: t,
|
|
155
156
|
canTrack: e
|
|
156
|
-
}),
|
|
157
|
+
}), W = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, ft = ({
|
|
157
158
|
key: t,
|
|
158
159
|
canTrack: e
|
|
159
160
|
}) => {
|
|
160
161
|
var n;
|
|
161
162
|
try {
|
|
162
|
-
return e ? (n =
|
|
163
|
+
return e ? (n = W()) == null ? void 0 : n.getItem(t) : void 0;
|
|
163
164
|
} catch (r) {
|
|
164
165
|
console.debug("[LocalStorage] GET error: ", r);
|
|
165
166
|
return;
|
|
@@ -171,17 +172,17 @@ const D = "builderSessionId", ut = async ({
|
|
|
171
172
|
}) => {
|
|
172
173
|
var r;
|
|
173
174
|
try {
|
|
174
|
-
e && ((r =
|
|
175
|
+
e && ((r = W()) == null || r.setItem(t, n));
|
|
175
176
|
} catch (o) {
|
|
176
177
|
console.debug("[LocalStorage] SET error: ", o);
|
|
177
178
|
}
|
|
178
|
-
},
|
|
179
|
+
}, _ = "builderVisitorId", gt = ({
|
|
179
180
|
canTrack: t
|
|
180
181
|
}) => {
|
|
181
182
|
if (!t)
|
|
182
183
|
return;
|
|
183
184
|
const e = ft({
|
|
184
|
-
key:
|
|
185
|
+
key: _,
|
|
185
186
|
canTrack: t
|
|
186
187
|
});
|
|
187
188
|
if (m(e))
|
|
@@ -193,11 +194,11 @@ const D = "builderSessionId", ut = async ({
|
|
|
193
194
|
canTrack: t
|
|
194
195
|
}), n;
|
|
195
196
|
}
|
|
196
|
-
}, pt = () =>
|
|
197
|
+
}, pt = () => D(), mt = ({
|
|
197
198
|
id: t,
|
|
198
199
|
canTrack: e
|
|
199
200
|
}) => ht({
|
|
200
|
-
key:
|
|
201
|
+
key: _,
|
|
201
202
|
value: t,
|
|
202
203
|
canTrack: e
|
|
203
204
|
}), yt = () => {
|
|
@@ -275,7 +276,7 @@ async function It(t) {
|
|
|
275
276
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
if (t.canTrack && !
|
|
279
|
+
if (t.canTrack && !Z() && (c() || v === "reactNative"))
|
|
279
280
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
280
281
|
method: "POST",
|
|
281
282
|
body: JSON.stringify({
|
|
@@ -293,13 +294,13 @@ const Jt = (t) => It({
|
|
|
293
294
|
...t,
|
|
294
295
|
canTrack: !0
|
|
295
296
|
}), kt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
296
|
-
function
|
|
297
|
+
function $(t, e) {
|
|
297
298
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
298
299
|
return !1;
|
|
299
300
|
const n = new URL(e.origin), r = n.hostname;
|
|
300
301
|
return (t || kt).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
301
302
|
}
|
|
302
|
-
const Et = "2.0.
|
|
303
|
+
const Et = "2.0.12", zt = () => {
|
|
303
304
|
et("insertMenu", {
|
|
304
305
|
name: "_default",
|
|
305
306
|
default: !0,
|
|
@@ -343,7 +344,7 @@ const Pt = (t = {}) => {
|
|
|
343
344
|
}
|
|
344
345
|
}, "*"), window.addEventListener("message", (r) => {
|
|
345
346
|
var s, a;
|
|
346
|
-
if (
|
|
347
|
+
if (!$(t.trustedHosts, r))
|
|
347
348
|
return;
|
|
348
349
|
const {
|
|
349
350
|
data: o
|
|
@@ -389,7 +390,7 @@ const Pt = (t = {}) => {
|
|
|
389
390
|
trustedHosts: e,
|
|
390
391
|
callbacks: n
|
|
391
392
|
}) => (r) => {
|
|
392
|
-
if (
|
|
393
|
+
if (!$(e, r))
|
|
393
394
|
return;
|
|
394
395
|
const {
|
|
395
396
|
data: o
|
|
@@ -436,17 +437,17 @@ const Pt = (t = {}) => {
|
|
|
436
437
|
canTrack: !0
|
|
437
438
|
}), At = ({
|
|
438
439
|
contentId: t
|
|
439
|
-
}) =>
|
|
440
|
+
}) => F({
|
|
440
441
|
name: E(t),
|
|
441
442
|
canTrack: !0
|
|
442
443
|
}), Tt = ({
|
|
443
444
|
contentId: t,
|
|
444
445
|
value: e
|
|
445
|
-
}) =>
|
|
446
|
+
}) => j({
|
|
446
447
|
name: E(t),
|
|
447
448
|
value: e,
|
|
448
449
|
canTrack: !0
|
|
449
|
-
}),
|
|
450
|
+
}), G = (t) => m(t.id) && m(t.variations) && Object.keys(t.variations).length > 0, Rt = ({
|
|
450
451
|
id: t,
|
|
451
452
|
variations: e
|
|
452
453
|
}) => {
|
|
@@ -459,7 +460,7 @@ const Pt = (t = {}) => {
|
|
|
459
460
|
return s;
|
|
460
461
|
}
|
|
461
462
|
return t;
|
|
462
|
-
},
|
|
463
|
+
}, J = (t) => {
|
|
463
464
|
const e = Rt(t);
|
|
464
465
|
return Tt({
|
|
465
466
|
contentId: t.id,
|
|
@@ -467,7 +468,7 @@ const Pt = (t = {}) => {
|
|
|
467
468
|
}).catch((n) => {
|
|
468
469
|
f.error("could not store A/B test variation: ", n);
|
|
469
470
|
}), e;
|
|
470
|
-
},
|
|
471
|
+
}, z = ({
|
|
471
472
|
item: t,
|
|
472
473
|
testGroupId: e
|
|
473
474
|
}) => {
|
|
@@ -489,14 +490,14 @@ const Pt = (t = {}) => {
|
|
|
489
490
|
return t;
|
|
490
491
|
if (!t)
|
|
491
492
|
return;
|
|
492
|
-
if (
|
|
493
|
+
if (!G(t))
|
|
493
494
|
return t;
|
|
494
495
|
const n = At({
|
|
495
496
|
contentId: t.id
|
|
496
|
-
}) ||
|
|
497
|
+
}) || J({
|
|
497
498
|
variations: t.variations,
|
|
498
499
|
id: t.id
|
|
499
|
-
}), r =
|
|
500
|
+
}), r = z({
|
|
500
501
|
item: t,
|
|
501
502
|
testGroupId: n
|
|
502
503
|
});
|
|
@@ -508,14 +509,14 @@ const Pt = (t = {}) => {
|
|
|
508
509
|
item: t,
|
|
509
510
|
canTrack: e
|
|
510
511
|
}) => {
|
|
511
|
-
if (!e ||
|
|
512
|
+
if (!e || !G(t))
|
|
512
513
|
return t;
|
|
513
514
|
const r = await xt({
|
|
514
515
|
contentId: t.id
|
|
515
|
-
}) ||
|
|
516
|
+
}) || J({
|
|
516
517
|
variations: t.variations,
|
|
517
518
|
id: t.id
|
|
518
|
-
}), o =
|
|
519
|
+
}), o = z({
|
|
519
520
|
item: t,
|
|
520
521
|
testGroupId: r
|
|
521
522
|
});
|
|
@@ -547,14 +548,14 @@ function k(t, e = null, n = ".") {
|
|
|
547
548
|
};
|
|
548
549
|
}, {});
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
+
function H(t, e, n = {}) {
|
|
551
552
|
for (const r in t) {
|
|
552
553
|
const o = t[r], s = e ? e + "." + r : r;
|
|
553
|
-
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ?
|
|
554
|
+
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ? H(o, s, n) : n[s] = o;
|
|
554
555
|
}
|
|
555
556
|
return n;
|
|
556
557
|
}
|
|
557
|
-
const
|
|
558
|
+
const Ft = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t) => {
|
|
558
559
|
const {
|
|
559
560
|
limit: e = 30,
|
|
560
561
|
userAttributes: n,
|
|
@@ -563,7 +564,7 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
563
564
|
apiKey: s,
|
|
564
565
|
enrich: a,
|
|
565
566
|
locale: d,
|
|
566
|
-
apiVersion: y =
|
|
567
|
+
apiVersion: y = Ft,
|
|
567
568
|
fields: p,
|
|
568
569
|
omit: I,
|
|
569
570
|
offset: u,
|
|
@@ -576,29 +577,29 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
576
577
|
throw new Error("Missing API key");
|
|
577
578
|
if (!["v3"].includes(y))
|
|
578
579
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);
|
|
579
|
-
const
|
|
580
|
-
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(
|
|
580
|
+
const X = e !== 1, i = new URL(`https://cdn.builder.io/api/${y}/content/${o}`);
|
|
581
|
+
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(X)), i.searchParams.set("includeRefs", String(!0)), d && i.searchParams.set("locale", d), a && i.searchParams.set("enrich", String(a)), i.searchParams.set("omit", I || "meta.componentsUsed"), p && i.searchParams.set("fields", p), Number.isFinite(u) && u > -1 && i.searchParams.set("offset", String(Math.floor(u))), typeof O == "boolean" && i.searchParams.set("includeUnpublished", String(O)), h && B(h) && i.searchParams.set("cacheSeconds", String(h)), g && B(g) && i.searchParams.set("staleCacheSeconds", String(g)), w) {
|
|
581
582
|
const l = k({
|
|
582
583
|
sort: w
|
|
583
584
|
});
|
|
584
585
|
for (const S in l)
|
|
585
586
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
586
587
|
}
|
|
587
|
-
const
|
|
588
|
+
const q = {
|
|
588
589
|
...rt(),
|
|
589
590
|
...L(t.options || {})
|
|
590
|
-
}, C = k(
|
|
591
|
+
}, C = k(q);
|
|
591
592
|
for (const l in C)
|
|
592
593
|
i.searchParams.set(l, String(C[l]));
|
|
593
594
|
if (n && i.searchParams.set("userAttributes", JSON.stringify(n)), r) {
|
|
594
|
-
const l =
|
|
595
|
+
const l = H({
|
|
595
596
|
query: r
|
|
596
597
|
});
|
|
597
598
|
for (const S in l)
|
|
598
599
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
599
600
|
}
|
|
600
601
|
return i;
|
|
601
|
-
},
|
|
602
|
+
}, Nt = (t) => "results" in t;
|
|
602
603
|
async function jt(t) {
|
|
603
604
|
const e = await Wt({
|
|
604
605
|
...t,
|
|
@@ -630,7 +631,7 @@ const Dt = async (t) => {
|
|
|
630
631
|
async function Wt(t) {
|
|
631
632
|
try {
|
|
632
633
|
const e = P(t), n = await Dt(t);
|
|
633
|
-
return
|
|
634
|
+
return Nt(n) ? Kt(t, n) : (f.error("Error fetching data. ", {
|
|
634
635
|
url: e,
|
|
635
636
|
content: n,
|
|
636
637
|
options: t
|
|
@@ -651,7 +652,7 @@ const qt = async (t) => {
|
|
|
651
652
|
urlPath: e
|
|
652
653
|
} : {}
|
|
653
654
|
},
|
|
654
|
-
options:
|
|
655
|
+
options: M(t.searchParams || ((s = t.url) == null ? void 0 : s.searchParams) || t.options)
|
|
655
656
|
};
|
|
656
657
|
return {
|
|
657
658
|
apiKey: n.apiKey,
|
|
@@ -671,17 +672,17 @@ export {
|
|
|
671
672
|
qt as fetchBuilderProps,
|
|
672
673
|
Wt as fetchEntries,
|
|
673
674
|
jt as fetchOneEntry,
|
|
674
|
-
|
|
675
|
+
M as getBuilderSearchParams,
|
|
675
676
|
Lt as getDefaultCanTrack,
|
|
676
677
|
St as getUserAttributes,
|
|
677
678
|
Xt as handleABTestingSync,
|
|
678
679
|
c as isBrowser,
|
|
679
|
-
|
|
680
|
+
Z as isEditing,
|
|
680
681
|
_t as isPreviewing,
|
|
681
682
|
f as logger,
|
|
682
683
|
et as register,
|
|
683
684
|
zt as registerInsertMenu,
|
|
684
|
-
|
|
685
|
+
U as serializeIncludingFunctions,
|
|
685
686
|
Gt as setEditorSettings,
|
|
686
687
|
Pt as setupBrowserForEditing,
|
|
687
688
|
Ht as subscribeToEditor,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const I="react",ce=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ce(e):e,U=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function c(){return typeof window!="undefined"&&typeof document!="undefined"}function ue(){return c()&&window.self!==window.top}function F(e){return ue()&&U(e||window.location.search).indexOf("builder.frameEditing=")!==-1}function de(e){const t=e||(c()?window.location.search:void 0);return t?U(t).indexOf("builder.preview=")!==-1:!1}const le=e=>({type:"builder.registerComponent",data:k(e)}),fe=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?fe(n):n))}const x={};function N(e,t){e==="plugin"&&(t=k(t));let n=x[e];if(n||(n=x[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const R={};function ge(e){if(c()){Object.assign(R,e);const t={type:"builder.settingsChange",data:R};parent.postMessage(t,"*")}}const B="builder.",he="options.",P=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(he,"");n[o]=t[r]}}),n},pe=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)},p=e=>e!=null,me=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},D=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},j=async e=>D(e),ye=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),Se=[["secure",""],["SameSite","None"]],we=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?Se:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",me(window.location.hostname)],...o];return ye(a)},K=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=we({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function be(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function _(){return be().replace(/-/g,"")}const W="builderSessionId",Ie=async({canTrack:e})=>{if(!e)return;const t=await j({name:W,canTrack:e});if(p(t))return t;{const n=ve();return Ee({id:n,canTrack:e}),n}},ve=()=>_(),Ee=({id:e,canTrack:t})=>K({name:W,value:e,canTrack:t}),$=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,ke=({key:e,canTrack:t})=>{var n;try{return t?(n=$())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Pe=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=$())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},G="builderVisitorId",Ce=({canTrack:e})=>{if(!e)return;const t=ke({key:G,canTrack:e});if(p(t))return t;{const n=Oe();return Ae({id:n,canTrack:e}),n}},Oe=()=>_(),Ae=({id:e,canTrack:t})=>Pe({key:G,value:e,canTrack:t}),Te=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},xe=()=>typeof navigator=="object"&&navigator.userAgent||"",z=()=>{const e=xe(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=Te();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Re=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ie({canTrack:e}),n=Ce({canTrack:e});return{sessionId:t,visitorId:n}},Be=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Re({canTrack:t}),userAttributes:z(),ownerId:n}});async function J(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Be(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Le=e=>J({...e,canTrack:!0}),Ve=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function H(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Ve).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Me="2.0.12",Ue=()=>{N("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let L=!1;const X=(e={})=>{var t,n;L||(L=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Me,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,a;if(!H(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const l=o.data.text,y=o.data.arguments||[],m=o.data.id,v=new Function(l);let u,g=null;try{u=v.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var S;(S=window.parent)==null||S.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:m}},"*");break}}})))},q=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!H(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,a=s.key||s.alias||s.entry||s.modelName,l=s.data;a===e&&n.contentUpdate(l);break}}},Fe=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};X();const r=q({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},Ne="builder.tests",C=e=>`${Ne}.${e}`,De=({contentId:e})=>j({name:C(e),canTrack:!0}),je=({contentId:e})=>D({name:C(e),canTrack:!0}),Ke=({contentId:e,value:t})=>K({name:C(e),value:t,canTrack:!0}),Q=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,_e=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const a=(o=t[s])==null?void 0:o.testRatio;if(n+=a,r<n)return s}return e},Y=e=>{const t=_e(e);return Ke({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},Z=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},We=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Q(e))return e;const n=je({contentId:e.id})||Y({variations:e.variations,id:e.id}),r=Z({item:e,testGroupId:n});return{...e,...r}},$e=async({item:e,canTrack:t})=>{if(!t||!Q(e))return e;const r=await De({contentId:e.id})||Y({variations:e.variations,id:e.id}),o=Z({item:e,testGroupId:r});return{...e,...o}},ee=e=>p(e)?e:!0;function Ge(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function ze(){const e=Ge().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const te=ze();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,a,n)}:{...r,[a]:s}},{})}function ne(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(a=>a.startsWith("$"))?ne(o,s,n):n[s]=o}return n}const Je="v3",V=e=>typeof e=="number"&&!isNaN(e)&&e>=0,O=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Je,fields:m,omit:v,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:S,includeUnpublished:A}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",v||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof A=="boolean"&&i.searchParams.set("includeUnpublished",String(A)),g&&V(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&V(h)&&i.searchParams.set("staleCacheSeconds",String(h)),S){const f=E({sort:S});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}const ae={...pe(),...M(e.options||{})},T=E(ae);for(const f in T)i.searchParams.set(f,String(T[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=ne({query:r});for(const w in f)i.searchParams.set(w,JSON.stringify(f[w]))}return i},He=e=>"results"in e;async function re(e){const t=await se({...e,limit:1});return t&&t[0]||null}const Xe=async e=>{var s;const t=O(e);return await(await((s=e.fetch)!=null?s:te)(t.href,e.fetchOptions)).json()},oe=async(e,t,n=O(e))=>{const r=ee(e.canTrack);if(n.search.includes("preview="),!r||!(c()||I==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await $e({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function se(e){try{const t=O(e),n=await Xe(e);return He(n)?oe(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}const qe=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:P(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await re(n)}};exports.MSG_PREFIX=b;exports.TARGET=I;exports._processContentResult=oe;exports._track=J;exports.checkIsDefined=p;exports.createEditorListener=q;exports.createRegisterComponentMessage=le;exports.fetch=te;exports.fetchBuilderProps=qe;exports.fetchEntries=se;exports.fetchOneEntry=re;exports.getBuilderSearchParams=P;exports.getDefaultCanTrack=ee;exports.getUserAttributes=z;exports.handleABTestingSync=We;exports.isBrowser=c;exports.isEditing=F;exports.isPreviewing=de;exports.logger=d;exports.register=N;exports.registerInsertMenu=Ue;exports.serializeIncludingFunctions=k;exports.setEditorSettings=ge;exports.setupBrowserForEditing=X;exports.subscribeToEditor=Fe;exports.track=Le;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-d5ae6221.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-84c3cdd6.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as m } from "./blocks-
|
|
2
|
+
import { Blocks as m } from "./blocks-e0e60319.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-84c3cdd6.js";
|
|
6
|
+
import "./evaluate-6408d64d.js";
|
|
7
|
+
import "./get-class-prop-name-d005a2bb.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function f(t) {
|
|
10
10
|
var e, o, i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-793430a0.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-d5ae6221.cjs");require("./evaluate-938a955e.cjs");require("./get-class-prop-name-e596650d.cjs");require("./dynamic-renderer-b29b45ca.cjs");function o(e){var t,r,n;return i.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:i.jsx(u.Blocks,{parent:(r=e.builderContext.context)==null?void 0:r.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(n=e.builderContext.rootState)==null?void 0:n[e.name]})})}exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-e596650d.cjs"),m=require("./server-entry-d5ae6221.cjs"),k=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return m.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(r=>{m.logger.error("Could not fetch symbol content: ",r)})};function x(e){var c,a,d,u;function t(){return"div"}function r(){return"div"}function b(){var n,l;return[e.attributes[v.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,y]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function f(){i||k({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&y(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{f()},[e.symbol]),s.jsx("div",{...e.attributes,className:b(),children:s.jsx(C.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(d=i==null?void 0:i.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:r()})})}exports.default=x;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useEffect as u } from "react";
|
|
3
3
|
import { Content as C } from "./blocks-exports.mjs";
|
|
4
|
-
import { getClassPropName as v } from "./get-class-prop-name-
|
|
5
|
-
import { fetchOneEntry as k, logger as h } from "./server-entry-
|
|
4
|
+
import { getClassPropName as v } from "./get-class-prop-name-d005a2bb.js";
|
|
5
|
+
import { fetchOneEntry as k, logger as h } from "./server-entry-84c3cdd6.js";
|
|
6
6
|
const x = async ({
|
|
7
7
|
builderContextValue: e,
|
|
8
8
|
symbol: t
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-e0e60319.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-84c3cdd6.js";
|
|
6
|
+
import "./evaluate-6408d64d.js";
|
|
7
|
+
import "./get-class-prop-name-d005a2bb.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function x(t) {
|
|
10
10
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-793430a0.cjs");require("./blocks-exports.cjs");require("./server-entry-d5ae6221.cjs");require("./evaluate-938a955e.cjs");require("./get-class-prop-name-e596650d.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var c;const[t,a]=b.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function o(n){return e.tabs&&e.tabs[n].content}function u(n){n===t&&e.collapsible?a(-1):a(n)}return i.jsxs("div",{children:[i.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(c=e.tabs)==null?void 0:c.map((n,l)=>i.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:d=>u(l),children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${l}.label`,blocks:n.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),o(t)?i.jsx("div",{children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:o(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { evaluate as s } from "./evaluate-
|
|
3
|
-
import "./server-entry-
|
|
2
|
+
import { evaluate as s } from "./evaluate-6408d64d.js";
|
|
3
|
+
import "./server-entry-84c3cdd6.js";
|
|
4
4
|
function f(t) {
|
|
5
5
|
function o() {
|
|
6
6
|
var e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-938a955e.cjs");require("./server-entry-d5ae6221.cjs");function x(e){function n(){var t;const o=e.builderContext,{context:r,localState:a,rootState:c,rootSetState:l}=o;return String(((t=e.text)==null?void 0:t.toString())||"").replace(/{{([^}]+)}}/g,(d,u)=>s.evaluate({code:u,context:r,localState:a,rootState:c,rootSetState:l,enableCache:!1}))}return i.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}exports.default=x;
|