@builder.io/sdk-react-nextjs 0.12.2 → 0.12.4
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/{node/USE_CLIENT_BUNDLE-d30db795.js → browser/USE_CLIENT_BUNDLE-e6d429be.js} +212 -215
- package/lib/browser/{USE_CLIENT_BUNDLE-4b1b3c99.cjs → USE_CLIENT_BUNDLE-e9e1ee85.cjs} +3 -5
- package/lib/{edge/USE_SERVER_BUNDLE-70c27ea1.js → browser/USE_SERVER_BUNDLE-44c49b1e.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-f0eeb33e.cjs → browser/USE_SERVER_BUNDLE-9bcc0ad4.cjs} +1 -1
- package/lib/browser/bundle-0e5cec1c.cjs +168 -0
- package/lib/browser/{bundle-d905bf70.js → bundle-bab67847.js} +577 -516
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +14 -14
- package/lib/{browser/USE_CLIENT_BUNDLE-550679f9.js → edge/USE_CLIENT_BUNDLE-8d251b8b.js} +212 -215
- package/lib/{node/USE_CLIENT_BUNDLE-def5165a.cjs → edge/USE_CLIENT_BUNDLE-d87c391a.cjs} +3 -5
- package/lib/{node/USE_SERVER_BUNDLE-a5db98bc.cjs → edge/USE_SERVER_BUNDLE-816ab6e4.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-610c83b3.js → edge/USE_SERVER_BUNDLE-c0911af0.js} +1 -1
- package/lib/edge/{bundle-834dbf29.js → bundle-28d9d04c.js} +1022 -961
- package/lib/edge/{bundle-25fa71b1.cjs → bundle-e64fe0fd.cjs} +37 -37
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +14 -14
- package/lib/{edge/USE_CLIENT_BUNDLE-aa38a343.js → node/USE_CLIENT_BUNDLE-75f921e2.js} +212 -215
- package/lib/{edge/USE_CLIENT_BUNDLE-edb18eb8.cjs → node/USE_CLIENT_BUNDLE-ee5a9d6f.cjs} +3 -5
- package/lib/{browser/USE_SERVER_BUNDLE-6234c5ea.cjs → node/USE_SERVER_BUNDLE-793c12c9.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-464dccd7.js → node/USE_SERVER_BUNDLE-86d90afe.js} +1 -1
- package/lib/node/{bundle-1f73ead0.js → bundle-031e3608.js} +352 -291
- package/lib/node/{bundle-4efd9623.cjs → bundle-72df28b3.cjs} +10 -10
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +14 -14
- package/package.json +1 -1
- package/types/cjs/blocks/button/button.types.d.ts +2 -1
- package/types/cjs/blocks/columns/columns.types.d.ts +3 -3
- package/types/cjs/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/cjs/components/block/block.d.ts +1 -0
- package/types/cjs/components/block/components/block-wrapper.d.ts +1 -0
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/cjs/components/block/components/repeated-block.d.ts +3 -5
- package/types/cjs/components/blocks/blocks.types.d.ts +1 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-block-properties.d.ts +5 -1
- package/types/cjs/functions/get-class-prop-name.d.ts +1 -0
- package/types/cjs/functions/get-style.d.ts +12 -0
- package/types/cjs/functions/transform-block-properties.d.ts +7 -5
- package/types/cjs/functions/transform-style-property.d.ts +7 -0
- package/types/cjs/types/builder-block.d.ts +1 -0
- package/types/cjs/types/builder-props.d.ts +3 -0
- package/types/esm/blocks/button/button.types.d.ts +2 -1
- package/types/esm/blocks/columns/columns.types.d.ts +3 -3
- package/types/esm/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/esm/components/block/block.d.ts +1 -0
- package/types/esm/components/block/components/block-wrapper.d.ts +1 -0
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/esm/components/block/components/repeated-block.d.ts +3 -5
- package/types/esm/components/blocks/blocks.types.d.ts +1 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-block-properties.d.ts +5 -1
- package/types/esm/functions/get-class-prop-name.d.ts +1 -0
- package/types/esm/functions/get-style.d.ts +12 -0
- package/types/esm/functions/transform-block-properties.d.ts +7 -5
- package/types/esm/functions/transform-style-property.d.ts +7 -0
- package/types/esm/types/builder-block.d.ts +1 -0
- package/types/esm/types/builder-props.d.ts +3 -0
- package/lib/browser/bundle-1d763be7.cjs +0 -168
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-75f921e2.js";
|
|
4
|
+
import "react";
|
|
5
5
|
import "next/navigation";
|
|
6
|
+
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
|
|
7
|
+
switch (TARGET) {
|
|
8
|
+
case "react":
|
|
9
|
+
case "reactNative":
|
|
10
|
+
case "rsc":
|
|
11
|
+
return "className";
|
|
12
|
+
case "svelte":
|
|
13
|
+
case "vue":
|
|
14
|
+
case "solid":
|
|
15
|
+
case "qwik":
|
|
16
|
+
return "class";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
6
19
|
function getBlockComponentOptions(e) {
|
|
7
20
|
var t;
|
|
8
21
|
return {
|
|
@@ -23,7 +36,6 @@ const MSG_PREFIX = "[Builder.io]: ", logger = {
|
|
|
23
36
|
function isBrowser() {
|
|
24
37
|
return typeof window < "u" && typeof document < "u";
|
|
25
38
|
}
|
|
26
|
-
const TARGET = "rsc";
|
|
27
39
|
function isIframe() {
|
|
28
40
|
return isBrowser() && window.self !== window.top;
|
|
29
41
|
}
|
|
@@ -86,15 +98,15 @@ const getLocation = () => {
|
|
|
86
98
|
builder: t,
|
|
87
99
|
context: n,
|
|
88
100
|
event: o,
|
|
89
|
-
localState:
|
|
90
|
-
rootSetState:
|
|
101
|
+
localState: i,
|
|
102
|
+
rootSetState: r,
|
|
91
103
|
rootState: a
|
|
92
104
|
}) => {
|
|
93
105
|
const s = getFunctionArguments({
|
|
94
106
|
builder: t,
|
|
95
107
|
context: n,
|
|
96
108
|
event: o,
|
|
97
|
-
state: flattenState(a,
|
|
109
|
+
state: flattenState(a, i, r)
|
|
98
110
|
});
|
|
99
111
|
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
100
112
|
};
|
|
@@ -102,11 +114,11 @@ function flattenState(e, t, n) {
|
|
|
102
114
|
if (e === t)
|
|
103
115
|
throw new Error("rootState === localState");
|
|
104
116
|
return new Proxy(e, {
|
|
105
|
-
get: (o,
|
|
106
|
-
set: (o,
|
|
107
|
-
if (t &&
|
|
117
|
+
get: (o, i) => t && i in t ? t[i] : e[i],
|
|
118
|
+
set: (o, i, r) => {
|
|
119
|
+
if (t && i in t)
|
|
108
120
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
109
|
-
return e[
|
|
121
|
+
return e[i] = r, n == null || n(e), !0;
|
|
110
122
|
}
|
|
111
123
|
});
|
|
112
124
|
}
|
|
@@ -114,7 +126,7 @@ const fastClone = (e) => JSON.parse(JSON.stringify(e)), set = (e, t, n) => {
|
|
|
114
126
|
if (Object(e) !== e)
|
|
115
127
|
return e;
|
|
116
128
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
117
|
-
return o.slice(0, -1).reduce((
|
|
129
|
+
return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
118
130
|
}, noop = () => {
|
|
119
131
|
};
|
|
120
132
|
let safeDynamicRequire = noop;
|
|
@@ -175,13 +187,13 @@ output;
|
|
|
175
187
|
builder: t,
|
|
176
188
|
context: n,
|
|
177
189
|
event: o,
|
|
178
|
-
localState:
|
|
179
|
-
rootSetState:
|
|
190
|
+
localState: i,
|
|
191
|
+
rootSetState: r,
|
|
180
192
|
rootState: a
|
|
181
193
|
}) => {
|
|
182
194
|
const s = fastClone({
|
|
183
195
|
...a,
|
|
184
|
-
...
|
|
196
|
+
...i
|
|
185
197
|
}), c = getFunctionArguments({
|
|
186
198
|
builder: t,
|
|
187
199
|
context: n,
|
|
@@ -190,17 +202,17 @@ output;
|
|
|
190
202
|
}), m = getIsolateContext(), f = m.global;
|
|
191
203
|
f.setSync("global", f.derefInto()), f.setSync("log", function(...d) {
|
|
192
204
|
console.log(...d);
|
|
193
|
-
}), f.setSync(BUILDER_SET_STATE_NAME, function(d,
|
|
194
|
-
set(a, d,
|
|
195
|
-
}), c.forEach(([d,
|
|
196
|
-
const
|
|
205
|
+
}), f.setSync(BUILDER_SET_STATE_NAME, function(d, l) {
|
|
206
|
+
set(a, d, l), r == null || r(a);
|
|
207
|
+
}), c.forEach(([d, l]) => {
|
|
208
|
+
const u = typeof l == "object" ? new ivm.Reference(
|
|
197
209
|
// workaround: methods with default values for arguments is not being cloned over
|
|
198
210
|
d === "builder" ? {
|
|
199
|
-
...
|
|
200
|
-
getUserAttributes: () =>
|
|
201
|
-
} :
|
|
211
|
+
...l,
|
|
212
|
+
getUserAttributes: () => l.getUserAttributes()
|
|
213
|
+
} : l
|
|
202
214
|
) : null;
|
|
203
|
-
f.setSync(getSyncValName(d),
|
|
215
|
+
f.setSync(getSyncValName(d), u);
|
|
204
216
|
}), f.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
205
217
|
const p = processCode({
|
|
206
218
|
code: e,
|
|
@@ -217,8 +229,8 @@ function evaluate({
|
|
|
217
229
|
context: t,
|
|
218
230
|
localState: n,
|
|
219
231
|
rootState: o,
|
|
220
|
-
rootSetState:
|
|
221
|
-
event:
|
|
232
|
+
rootSetState: i,
|
|
233
|
+
event: r,
|
|
222
234
|
isExpression: a = !0
|
|
223
235
|
}) {
|
|
224
236
|
if (e === "") {
|
|
@@ -231,8 +243,8 @@ function evaluate({
|
|
|
231
243
|
}),
|
|
232
244
|
builder: getBuilderGlobals(),
|
|
233
245
|
context: t,
|
|
234
|
-
event:
|
|
235
|
-
rootSetState:
|
|
246
|
+
event: r,
|
|
247
|
+
rootSetState: i,
|
|
236
248
|
rootState: o,
|
|
237
249
|
localState: n
|
|
238
250
|
};
|
|
@@ -253,17 +265,17 @@ const evaluateBindings = ({
|
|
|
253
265
|
context: t,
|
|
254
266
|
localState: n,
|
|
255
267
|
rootState: o,
|
|
256
|
-
rootSetState:
|
|
268
|
+
rootSetState: i
|
|
257
269
|
}) => {
|
|
258
270
|
if (!e.bindings)
|
|
259
271
|
return e;
|
|
260
|
-
const
|
|
261
|
-
...
|
|
272
|
+
const r = fastClone(e), a = {
|
|
273
|
+
...r,
|
|
262
274
|
properties: {
|
|
263
|
-
...
|
|
275
|
+
...r.properties
|
|
264
276
|
},
|
|
265
277
|
actions: {
|
|
266
|
-
...
|
|
278
|
+
...r.actions
|
|
267
279
|
}
|
|
268
280
|
};
|
|
269
281
|
for (const s in e.bindings) {
|
|
@@ -271,7 +283,7 @@ const evaluateBindings = ({
|
|
|
271
283
|
code: c,
|
|
272
284
|
localState: n,
|
|
273
285
|
rootState: o,
|
|
274
|
-
rootSetState:
|
|
286
|
+
rootSetState: i,
|
|
275
287
|
context: t
|
|
276
288
|
});
|
|
277
289
|
set(a, s, m);
|
|
@@ -283,15 +295,15 @@ function getProcessedBlock({
|
|
|
283
295
|
context: t,
|
|
284
296
|
shouldEvaluateBindings: n,
|
|
285
297
|
localState: o,
|
|
286
|
-
rootState:
|
|
287
|
-
rootSetState:
|
|
298
|
+
rootState: i,
|
|
299
|
+
rootSetState: r
|
|
288
300
|
}) {
|
|
289
301
|
const a = e;
|
|
290
302
|
return n ? evaluateBindings({
|
|
291
303
|
block: a,
|
|
292
304
|
localState: o,
|
|
293
|
-
rootState:
|
|
294
|
-
rootSetState:
|
|
305
|
+
rootState: i,
|
|
306
|
+
rootSetState: r,
|
|
295
307
|
context: t
|
|
296
308
|
}) : a;
|
|
297
309
|
}
|
|
@@ -300,20 +312,20 @@ const getComponent = ({
|
|
|
300
312
|
context: t,
|
|
301
313
|
registeredComponents: n
|
|
302
314
|
}) => {
|
|
303
|
-
var
|
|
304
|
-
const o = (
|
|
315
|
+
var r;
|
|
316
|
+
const o = (r = getProcessedBlock({
|
|
305
317
|
block: e,
|
|
306
318
|
localState: t.localState,
|
|
307
319
|
rootState: t.rootState,
|
|
308
320
|
rootSetState: t.rootSetState,
|
|
309
321
|
context: t.context,
|
|
310
322
|
shouldEvaluateBindings: !1
|
|
311
|
-
}).component) == null ? void 0 :
|
|
323
|
+
}).component) == null ? void 0 : r.name;
|
|
312
324
|
if (!o)
|
|
313
325
|
return null;
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
316
|
-
return
|
|
326
|
+
const i = n[o];
|
|
327
|
+
if (i)
|
|
328
|
+
return i;
|
|
317
329
|
console.warn(`
|
|
318
330
|
Could not find a registered component named "${o}".
|
|
319
331
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
@@ -327,17 +339,17 @@ const getComponent = ({
|
|
|
327
339
|
} = e;
|
|
328
340
|
if (!(n != null && n.collection))
|
|
329
341
|
return;
|
|
330
|
-
const
|
|
342
|
+
const i = evaluate({
|
|
331
343
|
code: n.collection,
|
|
332
344
|
localState: t.localState,
|
|
333
345
|
rootState: t.rootState,
|
|
334
346
|
rootSetState: t.rootSetState,
|
|
335
347
|
context: t.context
|
|
336
348
|
});
|
|
337
|
-
if (!Array.isArray(
|
|
349
|
+
if (!Array.isArray(i))
|
|
338
350
|
return;
|
|
339
|
-
const
|
|
340
|
-
return
|
|
351
|
+
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
352
|
+
return i.map((c, m) => ({
|
|
341
353
|
context: {
|
|
342
354
|
...t,
|
|
343
355
|
localState: {
|
|
@@ -379,18 +391,18 @@ const getComponent = ({
|
|
|
379
391
|
min: o,
|
|
380
392
|
default: o + 1
|
|
381
393
|
};
|
|
382
|
-
const
|
|
394
|
+
const i = n.small.max + 1;
|
|
383
395
|
n.medium = {
|
|
384
396
|
max: t,
|
|
385
|
-
min:
|
|
386
|
-
default:
|
|
397
|
+
min: i,
|
|
398
|
+
default: i + 1
|
|
387
399
|
};
|
|
388
|
-
const
|
|
400
|
+
const r = n.medium.max + 1;
|
|
389
401
|
return n.large = {
|
|
390
402
|
max: 2e3,
|
|
391
403
|
// TODO: decide upper limit
|
|
392
|
-
min:
|
|
393
|
-
default:
|
|
404
|
+
min: r,
|
|
405
|
+
default: r + 1
|
|
394
406
|
}, n;
|
|
395
407
|
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), checkIsDefined = (e) => e != null, convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
396
408
|
if (typeof o == "string")
|
|
@@ -413,7 +425,7 @@ function InlinedStyles(e) {
|
|
|
413
425
|
}
|
|
414
426
|
function BlockStyles(e) {
|
|
415
427
|
const t = function() {
|
|
416
|
-
const
|
|
428
|
+
const i = getProcessedBlock({
|
|
417
429
|
block: e.block,
|
|
418
430
|
localState: e.context.localState,
|
|
419
431
|
rootState: e.context.rootState,
|
|
@@ -421,19 +433,19 @@ function BlockStyles(e) {
|
|
|
421
433
|
context: e.context.context,
|
|
422
434
|
shouldEvaluateBindings: !0
|
|
423
435
|
});
|
|
424
|
-
return checkIsDefined(
|
|
436
|
+
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
425
437
|
}, n = function() {
|
|
426
|
-
var
|
|
427
|
-
const
|
|
438
|
+
var u;
|
|
439
|
+
const i = getProcessedBlock({
|
|
428
440
|
block: e.block,
|
|
429
441
|
localState: e.context.localState,
|
|
430
442
|
rootState: e.context.rootState,
|
|
431
443
|
rootSetState: e.context.rootSetState,
|
|
432
444
|
context: e.context.context,
|
|
433
445
|
shouldEvaluateBindings: !0
|
|
434
|
-
}),
|
|
435
|
-
((
|
|
436
|
-
), c =
|
|
446
|
+
}), r = i.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
447
|
+
((u = a == null ? void 0 : a.meta) == null ? void 0 : u.breakpoints) || {}
|
|
448
|
+
), c = r == null ? void 0 : r.large, m = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, p = i.id;
|
|
437
449
|
if (!p)
|
|
438
450
|
return "";
|
|
439
451
|
const g = c ? createCssClass({
|
|
@@ -446,7 +458,7 @@ function BlockStyles(e) {
|
|
|
446
458
|
"medium",
|
|
447
459
|
s
|
|
448
460
|
)
|
|
449
|
-
}) : "",
|
|
461
|
+
}) : "", l = f ? createCssClass({
|
|
450
462
|
className: p,
|
|
451
463
|
styles: f,
|
|
452
464
|
mediaQuery: getMaxWidthQueryForSize(
|
|
@@ -454,7 +466,7 @@ function BlockStyles(e) {
|
|
|
454
466
|
s
|
|
455
467
|
)
|
|
456
468
|
}) : "";
|
|
457
|
-
return [g, d,
|
|
469
|
+
return [g, d, l].join(" ");
|
|
458
470
|
};
|
|
459
471
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
460
472
|
}
|
|
@@ -475,25 +487,51 @@ function getBlockActions(e) {
|
|
|
475
487
|
for (const o in n) {
|
|
476
488
|
if (!n.hasOwnProperty(o))
|
|
477
489
|
continue;
|
|
478
|
-
const
|
|
479
|
-
let
|
|
490
|
+
const i = n[o];
|
|
491
|
+
let r = getEventHandlerName(o);
|
|
480
492
|
if (e.stripPrefix)
|
|
481
493
|
switch (TARGET) {
|
|
482
494
|
case "vue":
|
|
483
|
-
|
|
495
|
+
r = r.replace("v-on:", "");
|
|
484
496
|
break;
|
|
485
497
|
case "svelte":
|
|
486
|
-
|
|
498
|
+
r = r.replace("on:", "");
|
|
487
499
|
break;
|
|
488
500
|
}
|
|
489
|
-
t[
|
|
501
|
+
t[r] = createEventHandler(i, e);
|
|
490
502
|
}
|
|
491
503
|
return t;
|
|
492
504
|
}
|
|
505
|
+
function transformStyleProperty({
|
|
506
|
+
style: e
|
|
507
|
+
}) {
|
|
508
|
+
return e;
|
|
509
|
+
}
|
|
510
|
+
const getStyle = ({
|
|
511
|
+
block: e,
|
|
512
|
+
context: t
|
|
513
|
+
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
514
|
+
style: e.style || {},
|
|
515
|
+
context: t,
|
|
516
|
+
block: e
|
|
517
|
+
}));
|
|
518
|
+
function mapStyleObjToStrIfNeeded(e) {
|
|
519
|
+
switch (TARGET) {
|
|
520
|
+
case "svelte":
|
|
521
|
+
case "vue":
|
|
522
|
+
case "solid":
|
|
523
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
524
|
+
case "qwik":
|
|
525
|
+
case "reactNative":
|
|
526
|
+
case "react":
|
|
527
|
+
case "rsc":
|
|
528
|
+
return e;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
493
531
|
function transformBlockProperties({
|
|
494
532
|
properties: e
|
|
495
533
|
}) {
|
|
496
|
-
return e
|
|
534
|
+
return e;
|
|
497
535
|
}
|
|
498
536
|
const extractRelevantRootBlockProperties = (e) => ({
|
|
499
537
|
href: e.href
|
|
@@ -507,8 +545,11 @@ function getBlockProperties({
|
|
|
507
545
|
...extractRelevantRootBlockProperties(e),
|
|
508
546
|
...e.properties,
|
|
509
547
|
"builder-id": e.id,
|
|
510
|
-
style:
|
|
511
|
-
|
|
548
|
+
style: getStyle({
|
|
549
|
+
block: e,
|
|
550
|
+
context: t
|
|
551
|
+
}),
|
|
552
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
512
553
|
};
|
|
513
554
|
return transformBlockProperties({
|
|
514
555
|
properties: n,
|
|
@@ -516,26 +557,13 @@ function getBlockProperties({
|
|
|
516
557
|
block: e
|
|
517
558
|
});
|
|
518
559
|
}
|
|
519
|
-
|
|
520
|
-
switch (TARGET) {
|
|
521
|
-
case "svelte":
|
|
522
|
-
case "vue":
|
|
523
|
-
case "solid":
|
|
524
|
-
return convertStyleMapToCSSArray(e).join(" ");
|
|
525
|
-
case "qwik":
|
|
526
|
-
case "reactNative":
|
|
527
|
-
case "react":
|
|
528
|
-
case "rsc":
|
|
529
|
-
return e;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), getWrapperProps = ({
|
|
560
|
+
const getWrapperProps = ({
|
|
533
561
|
componentOptions: e,
|
|
534
562
|
builderBlock: t,
|
|
535
563
|
context: n,
|
|
536
564
|
componentRef: o,
|
|
537
|
-
includeBlockProps:
|
|
538
|
-
isInteractive:
|
|
565
|
+
includeBlockProps: i,
|
|
566
|
+
isInteractive: r,
|
|
539
567
|
contextValue: a
|
|
540
568
|
}) => {
|
|
541
569
|
const s = {
|
|
@@ -544,19 +572,19 @@ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col"
|
|
|
544
572
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
545
573
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
546
574
|
*/
|
|
547
|
-
...
|
|
575
|
+
...i ? {
|
|
548
576
|
attributes: getBlockProperties({
|
|
549
577
|
block: t,
|
|
550
578
|
context: a
|
|
551
579
|
})
|
|
552
580
|
} : {}
|
|
553
581
|
};
|
|
554
|
-
return
|
|
582
|
+
return r ? {
|
|
555
583
|
Wrapper: o,
|
|
556
584
|
block: t,
|
|
557
585
|
context: n,
|
|
558
586
|
wrapperProps: e,
|
|
559
|
-
includeBlockProps:
|
|
587
|
+
includeBlockProps: i
|
|
560
588
|
} : s;
|
|
561
589
|
};
|
|
562
590
|
function ComponentRef(e) {
|
|
@@ -570,6 +598,7 @@ function ComponentRef(e) {
|
|
|
570
598
|
builderBlock: e.builderBlock,
|
|
571
599
|
context: e.context,
|
|
572
600
|
componentRef: e.componentRef,
|
|
601
|
+
linkComponent: e.linkComponent,
|
|
573
602
|
includeBlockProps: e.includeBlockProps,
|
|
574
603
|
isInteractive: e.isInteractive,
|
|
575
604
|
contextValue: e.context
|
|
@@ -579,7 +608,8 @@ function ComponentRef(e) {
|
|
|
579
608
|
{
|
|
580
609
|
block: o,
|
|
581
610
|
context: e.context,
|
|
582
|
-
registeredComponents: e.registeredComponents
|
|
611
|
+
registeredComponents: e.registeredComponents,
|
|
612
|
+
linkComponent: e.linkComponent
|
|
583
613
|
},
|
|
584
614
|
o.id
|
|
585
615
|
))
|
|
@@ -593,7 +623,8 @@ function RepeatedBlock(e) {
|
|
|
593
623
|
{
|
|
594
624
|
block: e.block,
|
|
595
625
|
context: t,
|
|
596
|
-
registeredComponents: e.registeredComponents
|
|
626
|
+
registeredComponents: e.registeredComponents,
|
|
627
|
+
linkComponent: e.linkComponent
|
|
597
628
|
}
|
|
598
629
|
);
|
|
599
630
|
}
|
|
@@ -620,37 +651,42 @@ function Block(e) {
|
|
|
620
651
|
context: e.context.context,
|
|
621
652
|
shouldEvaluateBindings: !0
|
|
622
653
|
});
|
|
623
|
-
}, r = function() {
|
|
624
|
-
return e.block.tagName || "div";
|
|
625
654
|
}, i = function() {
|
|
626
|
-
var l
|
|
627
|
-
|
|
628
|
-
|
|
655
|
+
var l;
|
|
656
|
+
return e.block.tagName === "a" || ((l = o().properties) == null ? void 0 : l.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
657
|
+
}, r = function() {
|
|
658
|
+
var u, b;
|
|
659
|
+
if ((u = e.block.repeat) != null && u.collection)
|
|
660
|
+
return !!((b = n()) != null && b.length);
|
|
629
661
|
const d = "hide" in o() ? o().hide : !1;
|
|
630
662
|
return ("show" in o() ? o().show : !0) && !d;
|
|
631
663
|
}, a = function() {
|
|
632
|
-
var
|
|
633
|
-
return !((
|
|
664
|
+
var l;
|
|
665
|
+
return !((l = t()) != null && l.component) && !n() ? o().children ?? [] : [];
|
|
634
666
|
}, s = function() {
|
|
635
|
-
var d, u,
|
|
667
|
+
var d, l, u, b, y, h, k, C;
|
|
636
668
|
return {
|
|
637
669
|
blockChildren: o().children ?? [],
|
|
638
670
|
componentRef: (d = t()) == null ? void 0 : d.component,
|
|
639
671
|
componentOptions: {
|
|
640
672
|
...getBlockComponentOptions(o()),
|
|
641
673
|
builderContext: e.context,
|
|
642
|
-
...((u = t()) == null ? void 0 : u.name) === "Symbol" || ((
|
|
674
|
+
...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((u = t()) == null ? void 0 : u.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
|
|
675
|
+
builderLinkComponent: e.linkComponent
|
|
676
|
+
} : {},
|
|
677
|
+
...((y = t()) == null ? void 0 : y.name) === "Symbol" || ((h = t()) == null ? void 0 : h.name) === "Columns" ? {
|
|
643
678
|
builderComponents: e.registeredComponents
|
|
644
679
|
} : {}
|
|
645
680
|
},
|
|
646
681
|
context: c,
|
|
682
|
+
linkComponent: e.linkComponent,
|
|
647
683
|
registeredComponents: e.registeredComponents,
|
|
648
684
|
builderBlock: o(),
|
|
649
|
-
includeBlockProps: ((
|
|
650
|
-
isInteractive: !((
|
|
685
|
+
includeBlockProps: ((k = t()) == null ? void 0 : k.noWrap) === !0,
|
|
686
|
+
isInteractive: !((C = t()) != null && C.isRSC)
|
|
651
687
|
};
|
|
652
688
|
}, c = e.context;
|
|
653
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
689
|
+
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
654
690
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
655
691
|
(m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
656
692
|
ComponentRef,
|
|
@@ -660,6 +696,7 @@ function Block(e) {
|
|
|
660
696
|
blockChildren: s().blockChildren,
|
|
661
697
|
context: s().context,
|
|
662
698
|
registeredComponents: s().registeredComponents,
|
|
699
|
+
linkComponent: s().linkComponent,
|
|
663
700
|
builderBlock: s().builderBlock,
|
|
664
701
|
includeBlockProps: s().includeBlockProps,
|
|
665
702
|
isInteractive: s().isInteractive
|
|
@@ -669,15 +706,17 @@ function Block(e) {
|
|
|
669
706
|
{
|
|
670
707
|
repeatContext: g.context,
|
|
671
708
|
block: g.block,
|
|
672
|
-
registeredComponents: e.registeredComponents
|
|
709
|
+
registeredComponents: e.registeredComponents,
|
|
710
|
+
linkComponent: e.linkComponent
|
|
673
711
|
},
|
|
674
712
|
d
|
|
675
713
|
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
676
714
|
BlockWrapper,
|
|
677
715
|
{
|
|
678
|
-
Wrapper:
|
|
716
|
+
Wrapper: i(),
|
|
679
717
|
block: o(),
|
|
680
718
|
context: e.context,
|
|
719
|
+
linkComponent: e.linkComponent,
|
|
681
720
|
children: [
|
|
682
721
|
/* @__PURE__ */ jsx(
|
|
683
722
|
ComponentRef,
|
|
@@ -687,6 +726,7 @@ function Block(e) {
|
|
|
687
726
|
blockChildren: s().blockChildren,
|
|
688
727
|
context: s().context,
|
|
689
728
|
registeredComponents: s().registeredComponents,
|
|
729
|
+
linkComponent: s().linkComponent,
|
|
690
730
|
builderBlock: s().builderBlock,
|
|
691
731
|
includeBlockProps: s().includeBlockProps,
|
|
692
732
|
isInteractive: s().isInteractive
|
|
@@ -697,7 +737,8 @@ function Block(e) {
|
|
|
697
737
|
{
|
|
698
738
|
block: g,
|
|
699
739
|
context: c,
|
|
700
|
-
registeredComponents: e.registeredComponents
|
|
740
|
+
registeredComponents: e.registeredComponents,
|
|
741
|
+
linkComponent: e.linkComponent
|
|
701
742
|
},
|
|
702
743
|
g.id
|
|
703
744
|
))
|
|
@@ -717,36 +758,37 @@ function Blocks(e) {
|
|
|
717
758
|
styleProp: e.styleProp,
|
|
718
759
|
BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
|
|
719
760
|
BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
|
|
720
|
-
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((
|
|
761
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((i) => /* @__PURE__ */ jsx(
|
|
721
762
|
Block,
|
|
722
763
|
{
|
|
723
|
-
block:
|
|
764
|
+
block: i,
|
|
765
|
+
linkComponent: e.linkComponent,
|
|
724
766
|
context: e.context,
|
|
725
767
|
registeredComponents: e.registeredComponents
|
|
726
768
|
},
|
|
727
|
-
|
|
769
|
+
i.id
|
|
728
770
|
)) }) : null
|
|
729
771
|
}
|
|
730
772
|
);
|
|
731
773
|
}
|
|
732
774
|
function Columns(e) {
|
|
733
775
|
var d;
|
|
734
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet",
|
|
735
|
-
var
|
|
736
|
-
return ((
|
|
737
|
-
},
|
|
738
|
-
const
|
|
739
|
-
return `calc(${
|
|
776
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(u) {
|
|
777
|
+
var b;
|
|
778
|
+
return ((b = n[u]) == null ? void 0 : b.width) || 100 / n.length;
|
|
779
|
+
}, r = function(u) {
|
|
780
|
+
const b = t * (n.length - 1) / n.length;
|
|
781
|
+
return `calc(${i(u)}% - ${b}px)`;
|
|
740
782
|
}, a = function({
|
|
741
|
-
stackedStyle:
|
|
742
|
-
desktopStyle:
|
|
783
|
+
stackedStyle: u,
|
|
784
|
+
desktopStyle: b
|
|
743
785
|
}) {
|
|
744
|
-
return o === "tablet" ?
|
|
786
|
+
return o === "tablet" ? u : b;
|
|
745
787
|
}, s = function({
|
|
746
|
-
stackedStyle:
|
|
747
|
-
desktopStyle:
|
|
788
|
+
stackedStyle: u,
|
|
789
|
+
desktopStyle: b
|
|
748
790
|
}) {
|
|
749
|
-
return o === "never" ?
|
|
791
|
+
return o === "never" ? b : u;
|
|
750
792
|
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
751
793
|
return {
|
|
752
794
|
"--flex-dir": c,
|
|
@@ -755,33 +797,38 @@ function Columns(e) {
|
|
|
755
797
|
desktopStyle: "row"
|
|
756
798
|
})
|
|
757
799
|
};
|
|
758
|
-
}, f = function(
|
|
759
|
-
const
|
|
800
|
+
}, f = function(u) {
|
|
801
|
+
const b = u === 0 ? 0 : t, y = r(u), h = `${b}px`, k = "100%", C = 0;
|
|
760
802
|
return {
|
|
803
|
+
...{
|
|
804
|
+
display: "flex",
|
|
805
|
+
flexDirection: "column",
|
|
806
|
+
alignItems: "stretch"
|
|
807
|
+
},
|
|
761
808
|
width: y,
|
|
762
|
-
["marginLeft"]:
|
|
809
|
+
["marginLeft"]: h,
|
|
763
810
|
"--column-width-mobile": s({
|
|
764
|
-
stackedStyle:
|
|
811
|
+
stackedStyle: k,
|
|
765
812
|
desktopStyle: y
|
|
766
813
|
}),
|
|
767
814
|
"--column-margin-left-mobile": s({
|
|
768
|
-
stackedStyle:
|
|
769
|
-
desktopStyle:
|
|
815
|
+
stackedStyle: C,
|
|
816
|
+
desktopStyle: h
|
|
770
817
|
}),
|
|
771
818
|
"--column-width-tablet": a({
|
|
772
|
-
stackedStyle:
|
|
819
|
+
stackedStyle: k,
|
|
773
820
|
desktopStyle: y
|
|
774
821
|
}),
|
|
775
822
|
"--column-margin-left-tablet": a({
|
|
776
|
-
stackedStyle:
|
|
777
|
-
desktopStyle:
|
|
823
|
+
stackedStyle: C,
|
|
824
|
+
desktopStyle: h
|
|
778
825
|
})
|
|
779
826
|
};
|
|
780
|
-
}, p = function(
|
|
781
|
-
var y,
|
|
827
|
+
}, p = function(u) {
|
|
828
|
+
var y, h;
|
|
782
829
|
return getSizesForBreakpoints(
|
|
783
|
-
((
|
|
784
|
-
)[
|
|
830
|
+
((h = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : h.breakpoints) || {}
|
|
831
|
+
)[u].max;
|
|
785
832
|
}, g = function() {
|
|
786
833
|
return `
|
|
787
834
|
@media (max-width: ${p("medium")}px) {
|
|
@@ -813,41 +860,45 @@ function Columns(e) {
|
|
|
813
860
|
/* @__PURE__ */ jsxs(
|
|
814
861
|
"div",
|
|
815
862
|
{
|
|
816
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
863
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-3d816b82`,
|
|
817
864
|
style: m(),
|
|
818
865
|
children: [
|
|
819
866
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: g() }) }),
|
|
820
|
-
(d = e.columns) == null ? void 0 : d.map((
|
|
821
|
-
|
|
867
|
+
(d = e.columns) == null ? void 0 : d.map((l, u) => /* @__PURE__ */ jsx(
|
|
868
|
+
DynamicRenderer,
|
|
822
869
|
{
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
870
|
+
TagName: l.link ? e.builderLinkComponent || "a" : "div",
|
|
871
|
+
actionAttributes: {},
|
|
872
|
+
attributes: {
|
|
873
|
+
...l.link ? {
|
|
874
|
+
href: l.link
|
|
875
|
+
} : {},
|
|
876
|
+
[getClassPropName()]: "builder-column",
|
|
877
|
+
style: mapStyleObjToStrIfNeeded(f(u))
|
|
878
|
+
},
|
|
879
|
+
children: /* @__PURE__ */ jsx(
|
|
880
|
+
Blocks,
|
|
881
|
+
{
|
|
882
|
+
path: `component.options.columns.${u}.blocks`,
|
|
883
|
+
parent: e.builderBlock.id,
|
|
884
|
+
styleProp: {
|
|
885
|
+
flexGrow: "1"
|
|
886
|
+
},
|
|
887
|
+
context: e.builderContext,
|
|
888
|
+
registeredComponents: e.builderComponents,
|
|
889
|
+
linkComponent: e.builderLinkComponent,
|
|
890
|
+
blocks: l.blocks
|
|
891
|
+
}
|
|
892
|
+
)
|
|
826
893
|
},
|
|
827
|
-
|
|
828
|
-
Blocks,
|
|
829
|
-
{
|
|
830
|
-
path: `component.options.columns.${l}.blocks`,
|
|
831
|
-
parent: e.builderBlock.id,
|
|
832
|
-
styleProp: {
|
|
833
|
-
flexGrow: "1"
|
|
834
|
-
},
|
|
835
|
-
context: e.builderContext,
|
|
836
|
-
registeredComponents: e.builderComponents,
|
|
837
|
-
blocks: u.blocks
|
|
838
|
-
}
|
|
839
|
-
)
|
|
894
|
+
u
|
|
840
895
|
))
|
|
841
896
|
]
|
|
842
897
|
}
|
|
843
898
|
),
|
|
844
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
899
|
+
/* @__PURE__ */ jsx("style", { children: `.div-3d816b82 {
|
|
845
900
|
display: flex;
|
|
846
901
|
line-height: normal;
|
|
847
|
-
}.div-39daef82-2 {
|
|
848
|
-
display: flex;
|
|
849
|
-
flex-direction: column;
|
|
850
|
-
align-items: stretch;
|
|
851
902
|
}` })
|
|
852
903
|
] });
|
|
853
904
|
}
|
|
@@ -855,8 +906,8 @@ function removeProtocol(e) {
|
|
|
855
906
|
return e.replace(/http(s)?:/, "");
|
|
856
907
|
}
|
|
857
908
|
function updateQueryParam(e = "", t, n) {
|
|
858
|
-
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"),
|
|
859
|
-
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e +
|
|
909
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
910
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
860
911
|
}
|
|
861
912
|
function getShopifyImageUrl(e, t) {
|
|
862
913
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
@@ -865,8 +916,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
865
916
|
return removeProtocol(e);
|
|
866
917
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
867
918
|
if (n) {
|
|
868
|
-
const o = e.split(n[0]),
|
|
869
|
-
return removeProtocol(`${o[0]}_${
|
|
919
|
+
const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
|
|
920
|
+
return removeProtocol(`${o[0]}_${r}${i}`);
|
|
870
921
|
}
|
|
871
922
|
return null;
|
|
872
923
|
}
|
|
@@ -877,7 +928,7 @@ function getSrcSet(e) {
|
|
|
877
928
|
if (e.match(/builder\.io/)) {
|
|
878
929
|
let n = e;
|
|
879
930
|
const o = Number(e.split("?width=")[1]);
|
|
880
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((
|
|
931
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${updateQueryParam(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
881
932
|
}
|
|
882
933
|
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
883
934
|
}
|
|
@@ -902,7 +953,7 @@ const getTopLevelDomain = (e) => {
|
|
|
902
953
|
value: t,
|
|
903
954
|
expires: n
|
|
904
955
|
}) => {
|
|
905
|
-
const
|
|
956
|
+
const i = (isBrowser() ? location.protocol === "https:" : !0) ? SECURE_CONFIG : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", getTopLevelDomain(window.location.hostname)], ...i];
|
|
906
957
|
return stringifyCookie(a);
|
|
907
958
|
}, setCookie = async ({
|
|
908
959
|
name: e,
|
|
@@ -913,14 +964,14 @@ const getTopLevelDomain = (e) => {
|
|
|
913
964
|
try {
|
|
914
965
|
if (!o)
|
|
915
966
|
return;
|
|
916
|
-
const
|
|
967
|
+
const i = createCookieString({
|
|
917
968
|
name: e,
|
|
918
969
|
value: t,
|
|
919
970
|
expires: n
|
|
920
971
|
});
|
|
921
|
-
document.cookie =
|
|
922
|
-
} catch (
|
|
923
|
-
logger.warn("[COOKIE] SET error: ", (
|
|
972
|
+
document.cookie = i;
|
|
973
|
+
} catch (i) {
|
|
974
|
+
logger.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
924
975
|
}
|
|
925
976
|
}, BUILDER_STORE_PREFIX = "builder.tests", getContentTestKey = (e) => `${BUILDER_STORE_PREFIX}.${e}`, getContentVariationCookie = ({
|
|
926
977
|
contentId: e
|
|
@@ -943,13 +994,13 @@ const getTopLevelDomain = (e) => {
|
|
|
943
994
|
id: e,
|
|
944
995
|
variations: t
|
|
945
996
|
}) => {
|
|
946
|
-
var
|
|
997
|
+
var i;
|
|
947
998
|
let n = 0;
|
|
948
999
|
const o = Math.random();
|
|
949
|
-
for (const
|
|
950
|
-
const a = (
|
|
1000
|
+
for (const r in t) {
|
|
1001
|
+
const a = (i = t[r]) == null ? void 0 : i.testRatio;
|
|
951
1002
|
if (n += a, o < n)
|
|
952
|
-
return
|
|
1003
|
+
return r;
|
|
953
1004
|
}
|
|
954
1005
|
return e;
|
|
955
1006
|
}, getAndSetVariantId = (e) => {
|
|
@@ -1008,13 +1059,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1008
1059
|
}) || getAndSetVariantId({
|
|
1009
1060
|
variations: e.variations,
|
|
1010
1061
|
id: e.id
|
|
1011
|
-
}),
|
|
1062
|
+
}), i = getTestFields({
|
|
1012
1063
|
item: e,
|
|
1013
1064
|
testGroupId: o
|
|
1014
1065
|
});
|
|
1015
1066
|
return {
|
|
1016
1067
|
...e,
|
|
1017
|
-
...
|
|
1068
|
+
...i
|
|
1018
1069
|
};
|
|
1019
1070
|
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, componentInfo$b = {
|
|
1020
1071
|
name: "Core:Button",
|
|
@@ -1228,7 +1279,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1228
1279
|
});
|
|
1229
1280
|
}
|
|
1230
1281
|
const n = e.get("columns");
|
|
1231
|
-
Array.isArray(n) && n.find((
|
|
1282
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1232
1283
|
}
|
|
1233
1284
|
}, {
|
|
1234
1285
|
name: "space",
|
|
@@ -1339,13 +1390,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1339
1390
|
function o(a) {
|
|
1340
1391
|
return Math.round(a * 1e3) / 1e3;
|
|
1341
1392
|
}
|
|
1342
|
-
const
|
|
1343
|
-
if (fetch(
|
|
1393
|
+
const i = e.get("image"), r = e.get("aspectRatio");
|
|
1394
|
+
if (fetch(i).then((a) => a.blob()).then((a) => {
|
|
1344
1395
|
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1345
|
-
}),
|
|
1346
|
-
return n(
|
|
1396
|
+
}), i && (!r || r === 0.7041))
|
|
1397
|
+
return n(i).then((a) => {
|
|
1347
1398
|
const s = e.get("aspectRatio");
|
|
1348
|
-
e.get("image") ===
|
|
1399
|
+
e.get("image") === i && (!s || s === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
|
|
1349
1400
|
});
|
|
1350
1401
|
}
|
|
1351
1402
|
}, {
|
|
@@ -1686,9 +1737,9 @@ const componentInfo = {
|
|
|
1686
1737
|
...t
|
|
1687
1738
|
}) => ({
|
|
1688
1739
|
...fastClone(t),
|
|
1689
|
-
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [
|
|
1740
|
+
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1690
1741
|
...o,
|
|
1691
|
-
[
|
|
1742
|
+
[i]: serializeValue(r)
|
|
1692
1743
|
}), {}))
|
|
1693
1744
|
}), UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1694
1745
|
function getAndSetVariantId() {
|
|
@@ -1836,14 +1887,14 @@ function getFetch() {
|
|
|
1836
1887
|
}
|
|
1837
1888
|
const fetch$1 = getFetch();
|
|
1838
1889
|
function flatten(e, t = null, n = ".") {
|
|
1839
|
-
return Object.keys(e).reduce((o,
|
|
1840
|
-
const
|
|
1841
|
-
return [typeof
|
|
1890
|
+
return Object.keys(e).reduce((o, i) => {
|
|
1891
|
+
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
1892
|
+
return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
|
|
1842
1893
|
...o,
|
|
1843
|
-
...flatten(
|
|
1894
|
+
...flatten(r, a, n)
|
|
1844
1895
|
} : {
|
|
1845
1896
|
...o,
|
|
1846
|
-
[a]:
|
|
1897
|
+
[a]: r
|
|
1847
1898
|
};
|
|
1848
1899
|
}, {});
|
|
1849
1900
|
}
|
|
@@ -1858,8 +1909,8 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1858
1909
|
const t = normalizeSearchParams(e), n = {};
|
|
1859
1910
|
return Object.keys(t).forEach((o) => {
|
|
1860
1911
|
if (o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
|
|
1861
|
-
const
|
|
1862
|
-
n[
|
|
1912
|
+
const i = o.replace(BUILDER_SEARCHPARAMS_PREFIX, "").replace(BUILDER_OPTIONS_PREFIX, "");
|
|
1913
|
+
n[i] = t[o];
|
|
1863
1914
|
}
|
|
1864
1915
|
}), n;
|
|
1865
1916
|
}, getBuilderSearchParamsFromWindow = () => {
|
|
@@ -1874,8 +1925,8 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1874
1925
|
const {
|
|
1875
1926
|
limit: n = 30,
|
|
1876
1927
|
userAttributes: o,
|
|
1877
|
-
query:
|
|
1878
|
-
model:
|
|
1928
|
+
query: i,
|
|
1929
|
+
model: r,
|
|
1879
1930
|
apiKey: a,
|
|
1880
1931
|
includeRefs: s = !0,
|
|
1881
1932
|
enrich: c,
|
|
@@ -1884,9 +1935,9 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1884
1935
|
fields: p,
|
|
1885
1936
|
omit: g,
|
|
1886
1937
|
offset: d,
|
|
1887
|
-
cacheSeconds:
|
|
1888
|
-
staleCacheSeconds:
|
|
1889
|
-
sort:
|
|
1938
|
+
cacheSeconds: l,
|
|
1939
|
+
staleCacheSeconds: u,
|
|
1940
|
+
sort: b,
|
|
1890
1941
|
includeUnpublished: y
|
|
1891
1942
|
} = e;
|
|
1892
1943
|
if (!a)
|
|
@@ -1894,28 +1945,28 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1894
1945
|
if (!["v2", "v3"].includes(f))
|
|
1895
1946
|
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1896
1947
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1897
|
-
const
|
|
1898
|
-
if (
|
|
1948
|
+
const h = new URL(`https://cdn.builder.io/api/${f}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1949
|
+
if (h.searchParams.set("omit", g || "meta.componentsUsed"), p && h.searchParams.set("fields", p), Number.isFinite(d) && d > -1 && h.searchParams.set("offset", String(Math.floor(d))), typeof y == "boolean" && h.searchParams.set("includeUnpublished", String(y)), l && isPositiveNumber(l) && h.searchParams.set("cacheSeconds", String(l)), u && isPositiveNumber(u) && h.searchParams.set("staleCacheSeconds", String(u)), b) {
|
|
1899
1950
|
const S = flatten({
|
|
1900
|
-
sort:
|
|
1951
|
+
sort: b
|
|
1901
1952
|
});
|
|
1902
|
-
for (const
|
|
1903
|
-
|
|
1953
|
+
for (const x in S)
|
|
1954
|
+
h.searchParams.set(x, JSON.stringify(S[x]));
|
|
1904
1955
|
}
|
|
1905
|
-
const
|
|
1956
|
+
const k = {
|
|
1906
1957
|
...getBuilderSearchParamsFromWindow(),
|
|
1907
1958
|
...normalizeSearchParams(e.options || {})
|
|
1908
|
-
},
|
|
1909
|
-
for (const S in
|
|
1910
|
-
|
|
1911
|
-
if (o &&
|
|
1959
|
+
}, C = flatten(k);
|
|
1960
|
+
for (const S in C)
|
|
1961
|
+
h.searchParams.set(S, String(C[S]));
|
|
1962
|
+
if (o && h.searchParams.set("userAttributes", JSON.stringify(o)), i) {
|
|
1912
1963
|
const S = flatten({
|
|
1913
|
-
query:
|
|
1964
|
+
query: i
|
|
1914
1965
|
});
|
|
1915
|
-
for (const
|
|
1916
|
-
|
|
1966
|
+
for (const x in S)
|
|
1967
|
+
h.searchParams.set(x, JSON.stringify(S[x]));
|
|
1917
1968
|
}
|
|
1918
|
-
return
|
|
1969
|
+
return h;
|
|
1919
1970
|
}, checkContentHasResults = (e) => "results" in e;
|
|
1920
1971
|
async function fetchOneEntry(e) {
|
|
1921
1972
|
const t = await fetchEntries({
|
|
@@ -1930,25 +1981,25 @@ const getContent = fetchOneEntry, _fetchContent = async (e) => {
|
|
|
1930
1981
|
}, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
|
|
1931
1982
|
const o = getDefaultCanTrack(e.canTrack);
|
|
1932
1983
|
if (n.search.includes("preview=")) {
|
|
1933
|
-
const
|
|
1984
|
+
const r = [];
|
|
1934
1985
|
for (const a of t.results) {
|
|
1935
1986
|
const s = getPreviewContent(n.searchParams);
|
|
1936
|
-
|
|
1987
|
+
r.push(s || a);
|
|
1937
1988
|
}
|
|
1938
|
-
t.results =
|
|
1989
|
+
t.results = r;
|
|
1939
1990
|
}
|
|
1940
1991
|
if (!o || !(isBrowser() || TARGET === "reactNative"))
|
|
1941
1992
|
return t.results;
|
|
1942
1993
|
try {
|
|
1943
|
-
const
|
|
1994
|
+
const r = [];
|
|
1944
1995
|
for (const a of t.results)
|
|
1945
|
-
|
|
1996
|
+
r.push(await handleABTesting({
|
|
1946
1997
|
item: a,
|
|
1947
1998
|
canTrack: o
|
|
1948
1999
|
}));
|
|
1949
|
-
t.results =
|
|
1950
|
-
} catch (
|
|
1951
|
-
logger.error("Could not process A/B tests. ",
|
|
2000
|
+
t.results = r;
|
|
2001
|
+
} catch (r) {
|
|
2002
|
+
logger.error("Could not process A/B tests. ", r);
|
|
1952
2003
|
}
|
|
1953
2004
|
return t.results;
|
|
1954
2005
|
};
|
|
@@ -1967,7 +2018,7 @@ async function fetchEntries(e) {
|
|
|
1967
2018
|
const getAllContent = fetchEntries, DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
1968
2019
|
function isFromTrustedHost(e, t) {
|
|
1969
2020
|
const n = new URL(t.origin), o = n.hostname;
|
|
1970
|
-
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((
|
|
2021
|
+
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
1971
2022
|
}
|
|
1972
2023
|
function isPreviewing() {
|
|
1973
2024
|
return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
@@ -2025,8 +2076,8 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
2025
2076
|
var o;
|
|
2026
2077
|
try {
|
|
2027
2078
|
t && ((o = getLocalStorage()) == null || o.setItem(e, n));
|
|
2028
|
-
} catch (
|
|
2029
|
-
console.debug("[LocalStorage] SET error: ",
|
|
2079
|
+
} catch (i) {
|
|
2080
|
+
console.debug("[LocalStorage] SET error: ", i);
|
|
2030
2081
|
}
|
|
2031
2082
|
}, VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId", getVisitorId = ({
|
|
2032
2083
|
canTrack: e
|
|
@@ -2075,11 +2126,11 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
2075
2126
|
canTrack: t,
|
|
2076
2127
|
apiKey: n,
|
|
2077
2128
|
metadata: o,
|
|
2078
|
-
...
|
|
2129
|
+
...i
|
|
2079
2130
|
}) => ({
|
|
2080
2131
|
type: e,
|
|
2081
2132
|
data: {
|
|
2082
|
-
...
|
|
2133
|
+
...i,
|
|
2083
2134
|
metadata: {
|
|
2084
2135
|
url: location.href,
|
|
2085
2136
|
...o
|
|
@@ -2135,9 +2186,9 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2135
2186
|
event: e,
|
|
2136
2187
|
target: t
|
|
2137
2188
|
}) => {
|
|
2138
|
-
const n = t.getBoundingClientRect(), o = e.clientX - n.left,
|
|
2189
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = round(o / n.width), a = round(i / n.height);
|
|
2139
2190
|
return {
|
|
2140
|
-
x:
|
|
2191
|
+
x: r,
|
|
2141
2192
|
y: a
|
|
2142
2193
|
};
|
|
2143
2194
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
@@ -2156,7 +2207,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2156
2207
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2157
2208
|
}
|
|
2158
2209
|
};
|
|
2159
|
-
}, SDK_VERSION = "0.12.
|
|
2210
|
+
}, SDK_VERSION = "0.12.4", registry = {};
|
|
2160
2211
|
function register(e, t) {
|
|
2161
2212
|
let n = registry[e];
|
|
2162
2213
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2169,8 +2220,8 @@ function register(e, t) {
|
|
|
2169
2220
|
};
|
|
2170
2221
|
try {
|
|
2171
2222
|
parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
|
|
2172
|
-
} catch (
|
|
2173
|
-
console.debug("Could not postmessage",
|
|
2223
|
+
} catch (i) {
|
|
2224
|
+
console.debug("Could not postmessage", i);
|
|
2174
2225
|
}
|
|
2175
2226
|
}
|
|
2176
2227
|
}
|
|
@@ -2217,31 +2268,31 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2217
2268
|
options: e
|
|
2218
2269
|
}
|
|
2219
2270
|
}, "*"), window.addEventListener("message", (o) => {
|
|
2220
|
-
var
|
|
2271
|
+
var r, a;
|
|
2221
2272
|
if (!isFromTrustedHost(e.trustedHosts, o))
|
|
2222
2273
|
return;
|
|
2223
2274
|
const {
|
|
2224
|
-
data:
|
|
2275
|
+
data: i
|
|
2225
2276
|
} = o;
|
|
2226
|
-
if (
|
|
2227
|
-
switch (
|
|
2277
|
+
if (i != null && i.type)
|
|
2278
|
+
switch (i.type) {
|
|
2228
2279
|
case "builder.evaluate": {
|
|
2229
|
-
const s =
|
|
2280
|
+
const s = i.data.text, c = i.data.arguments || [], m = i.data.id, f = new Function(s);
|
|
2230
2281
|
let p, g = null;
|
|
2231
2282
|
try {
|
|
2232
2283
|
p = f.apply(null, c);
|
|
2233
2284
|
} catch (d) {
|
|
2234
2285
|
g = d;
|
|
2235
2286
|
}
|
|
2236
|
-
g ? (
|
|
2287
|
+
g ? (r = window.parent) == null || r.postMessage({
|
|
2237
2288
|
type: "builder.evaluateError",
|
|
2238
2289
|
data: {
|
|
2239
2290
|
id: m,
|
|
2240
2291
|
error: g.message
|
|
2241
2292
|
}
|
|
2242
2293
|
}, "*") : p && typeof p.then == "function" ? p.then((d) => {
|
|
2243
|
-
var
|
|
2244
|
-
(
|
|
2294
|
+
var l;
|
|
2295
|
+
(l = window.parent) == null || l.postMessage({
|
|
2245
2296
|
type: "builder.evaluateResult",
|
|
2246
2297
|
data: {
|
|
2247
2298
|
id: m,
|
|
@@ -2260,10 +2311,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2260
2311
|
}
|
|
2261
2312
|
})));
|
|
2262
2313
|
}, getCssFromFont = (e) => {
|
|
2263
|
-
var
|
|
2264
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((
|
|
2265
|
-
let
|
|
2266
|
-
if (o && t && n && (
|
|
2314
|
+
var r;
|
|
2315
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
|
|
2316
|
+
let i = "";
|
|
2317
|
+
if (o && t && n && (i += `
|
|
2267
2318
|
@font-face {
|
|
2268
2319
|
font-family: "${t}";
|
|
2269
2320
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -2275,7 +2326,7 @@ font-weight: 400;
|
|
|
2275
2326
|
if (!(String(Number(a)) === a))
|
|
2276
2327
|
continue;
|
|
2277
2328
|
const c = e.files[a];
|
|
2278
|
-
c && c !== o && (
|
|
2329
|
+
c && c !== o && (i += `
|
|
2279
2330
|
@font-face {
|
|
2280
2331
|
font-family: "${t}";
|
|
2281
2332
|
src: url('${c}') format('woff2');
|
|
@@ -2284,7 +2335,7 @@ font-weight: ${a};
|
|
|
2284
2335
|
}
|
|
2285
2336
|
`.trim());
|
|
2286
2337
|
}
|
|
2287
|
-
return
|
|
2338
|
+
return i;
|
|
2288
2339
|
}, getFontCss = ({
|
|
2289
2340
|
customFonts: e
|
|
2290
2341
|
}) => {
|
|
@@ -2304,6 +2355,10 @@ ${getFontCss({
|
|
|
2304
2355
|
customFonts: e.customFonts
|
|
2305
2356
|
})}
|
|
2306
2357
|
|
|
2358
|
+
.builder-button {
|
|
2359
|
+
all: unset;
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2307
2362
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
2308
2363
|
margin: 0;
|
|
2309
2364
|
}
|
|
@@ -2324,13 +2379,13 @@ const getRootStateInitialValue = ({
|
|
|
2324
2379
|
data: t,
|
|
2325
2380
|
locale: n
|
|
2326
2381
|
}) => {
|
|
2327
|
-
var
|
|
2328
|
-
const o = {},
|
|
2382
|
+
var r, a, s;
|
|
2383
|
+
const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2329
2384
|
return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
|
|
2330
2385
|
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2331
2386
|
}), {
|
|
2332
2387
|
...o,
|
|
2333
|
-
...
|
|
2388
|
+
...i,
|
|
2334
2389
|
...t,
|
|
2335
2390
|
...n ? {
|
|
2336
2391
|
locale: n
|
|
@@ -2348,12 +2403,12 @@ const getRootStateInitialValue = ({
|
|
|
2348
2403
|
meta: e == null ? void 0 : e.meta
|
|
2349
2404
|
} : void 0;
|
|
2350
2405
|
function ContentComponent(e) {
|
|
2351
|
-
var
|
|
2406
|
+
var i, r, a, s, c, m, f, p, g;
|
|
2352
2407
|
const t = getUpdateVariantVisibilityScript({
|
|
2353
2408
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2354
|
-
variationId: (
|
|
2409
|
+
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
2355
2410
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2356
|
-
contentId: (
|
|
2411
|
+
contentId: (r = e.content) == null ? void 0 : r.id
|
|
2357
2412
|
}), n = [
|
|
2358
2413
|
...getDefaultRegisteredComponents(),
|
|
2359
2414
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2364,11 +2419,11 @@ function ContentComponent(e) {
|
|
|
2364
2419
|
...components,
|
|
2365
2420
|
...e.customComponents || []
|
|
2366
2421
|
].reduce(
|
|
2367
|
-
(d, { component:
|
|
2422
|
+
(d, { component: l, ...u }) => ({
|
|
2368
2423
|
...d,
|
|
2369
|
-
[
|
|
2370
|
-
component:
|
|
2371
|
-
...serializeComponentInfo(
|
|
2424
|
+
[u.name]: {
|
|
2425
|
+
component: l,
|
|
2426
|
+
...serializeComponentInfo(u)
|
|
2372
2427
|
}
|
|
2373
2428
|
}),
|
|
2374
2429
|
{}
|
|
@@ -2397,9 +2452,9 @@ function ContentComponent(e) {
|
|
|
2397
2452
|
...components,
|
|
2398
2453
|
...e.customComponents || []
|
|
2399
2454
|
].reduce(
|
|
2400
|
-
(d, { component:
|
|
2455
|
+
(d, { component: l, ...u }) => ({
|
|
2401
2456
|
...d,
|
|
2402
|
-
[
|
|
2457
|
+
[u.name]: serializeComponentInfo(u)
|
|
2403
2458
|
}),
|
|
2404
2459
|
{}
|
|
2405
2460
|
),
|
|
@@ -2423,6 +2478,7 @@ function ContentComponent(e) {
|
|
|
2423
2478
|
builderContextSignal: o,
|
|
2424
2479
|
contentWrapper: e.contentWrapper,
|
|
2425
2480
|
contentWrapperProps: e.contentWrapperProps,
|
|
2481
|
+
linkComponent: e.linkComponent,
|
|
2426
2482
|
trustedHosts: e.trustedHosts,
|
|
2427
2483
|
children: [
|
|
2428
2484
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
@@ -2439,7 +2495,8 @@ function ContentComponent(e) {
|
|
|
2439
2495
|
{
|
|
2440
2496
|
blocks: (g = (p = o.content) == null ? void 0 : p.data) == null ? void 0 : g.blocks,
|
|
2441
2497
|
context: o,
|
|
2442
|
-
registeredComponents: n
|
|
2498
|
+
registeredComponents: n,
|
|
2499
|
+
linkComponent: e.linkComponent
|
|
2443
2500
|
}
|
|
2444
2501
|
)
|
|
2445
2502
|
]
|
|
@@ -2447,7 +2504,7 @@ function ContentComponent(e) {
|
|
|
2447
2504
|
);
|
|
2448
2505
|
}
|
|
2449
2506
|
function ContentVariants(e) {
|
|
2450
|
-
var
|
|
2507
|
+
var r, a;
|
|
2451
2508
|
const t = checkShouldRenderVariants({
|
|
2452
2509
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2453
2510
|
content: e.content
|
|
@@ -2462,7 +2519,7 @@ function ContentVariants(e) {
|
|
|
2462
2519
|
);
|
|
2463
2520
|
}, o = function() {
|
|
2464
2521
|
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2465
|
-
},
|
|
2522
|
+
}, i = function() {
|
|
2466
2523
|
var c;
|
|
2467
2524
|
return t ? {
|
|
2468
2525
|
...e.content,
|
|
@@ -2478,7 +2535,7 @@ function ContentVariants(e) {
|
|
|
2478
2535
|
/* @__PURE__ */ jsx(
|
|
2479
2536
|
InlinedStyles,
|
|
2480
2537
|
{
|
|
2481
|
-
id: `variants-styles-${(
|
|
2538
|
+
id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
|
|
2482
2539
|
styles: o()
|
|
2483
2540
|
}
|
|
2484
2541
|
),
|
|
@@ -2494,6 +2551,7 @@ function ContentVariants(e) {
|
|
|
2494
2551
|
apiKey: e.apiKey,
|
|
2495
2552
|
apiVersion: e.apiVersion,
|
|
2496
2553
|
customComponents: e.customComponents,
|
|
2554
|
+
linkComponent: e.linkComponent,
|
|
2497
2555
|
canTrack: e.canTrack,
|
|
2498
2556
|
locale: e.locale,
|
|
2499
2557
|
includeRefs: e.includeRefs,
|
|
@@ -2511,7 +2569,7 @@ function ContentVariants(e) {
|
|
|
2511
2569
|
/* @__PURE__ */ jsx(
|
|
2512
2570
|
ContentComponent,
|
|
2513
2571
|
{
|
|
2514
|
-
content:
|
|
2572
|
+
content: i(),
|
|
2515
2573
|
showContent: !0,
|
|
2516
2574
|
model: e.model,
|
|
2517
2575
|
data: e.data,
|
|
@@ -2519,6 +2577,7 @@ function ContentVariants(e) {
|
|
|
2519
2577
|
apiKey: e.apiKey,
|
|
2520
2578
|
apiVersion: e.apiVersion,
|
|
2521
2579
|
customComponents: e.customComponents,
|
|
2580
|
+
linkComponent: e.linkComponent,
|
|
2522
2581
|
canTrack: e.canTrack,
|
|
2523
2582
|
locale: e.locale,
|
|
2524
2583
|
includeRefs: e.includeRefs,
|
|
@@ -2553,11 +2612,11 @@ const fetchSymbolContent = async ({
|
|
|
2553
2612
|
});
|
|
2554
2613
|
};
|
|
2555
2614
|
async function Symbol$1(e) {
|
|
2556
|
-
var o,
|
|
2615
|
+
var o, i, r, a, s;
|
|
2557
2616
|
const t = function() {
|
|
2558
2617
|
var m, f;
|
|
2559
2618
|
return [
|
|
2560
|
-
e.attributes
|
|
2619
|
+
e.attributes[getClassPropName()],
|
|
2561
2620
|
"builder-symbol",
|
|
2562
2621
|
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2563
2622
|
(f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
@@ -2574,16 +2633,17 @@ async function Symbol$1(e) {
|
|
|
2574
2633
|
apiKey: e.builderContext.apiKey,
|
|
2575
2634
|
context: {
|
|
2576
2635
|
...e.builderContext.context,
|
|
2577
|
-
symbolId: (
|
|
2636
|
+
symbolId: (i = e.builderBlock) == null ? void 0 : i.id
|
|
2578
2637
|
},
|
|
2579
2638
|
customComponents: Object.values(e.builderComponents),
|
|
2580
2639
|
data: {
|
|
2581
|
-
...(
|
|
2640
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
2582
2641
|
...e.builderContext.localState,
|
|
2583
2642
|
...(a = n == null ? void 0 : n.data) == null ? void 0 : a.state
|
|
2584
2643
|
},
|
|
2585
2644
|
model: (s = e.symbol) == null ? void 0 : s.model,
|
|
2586
|
-
content: n
|
|
2645
|
+
content: n,
|
|
2646
|
+
linkComponent: e.builderLinkComponent
|
|
2587
2647
|
}
|
|
2588
2648
|
) });
|
|
2589
2649
|
}
|
|
@@ -2599,8 +2659,8 @@ function setEditorSettings(e) {
|
|
|
2599
2659
|
}
|
|
2600
2660
|
}
|
|
2601
2661
|
const fetchBuilderProps = async (e) => {
|
|
2602
|
-
var o,
|
|
2603
|
-
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((
|
|
2662
|
+
var o, i, r;
|
|
2663
|
+
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2604
2664
|
...e,
|
|
2605
2665
|
apiKey: e.apiKey,
|
|
2606
2666
|
model: e.model || "page",
|
|
@@ -2610,7 +2670,7 @@ const fetchBuilderProps = async (e) => {
|
|
|
2610
2670
|
urlPath: t
|
|
2611
2671
|
} : {}
|
|
2612
2672
|
},
|
|
2613
|
-
options: getBuilderSearchParams(e.searchParams || ((
|
|
2673
|
+
options: getBuilderSearchParams(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
|
|
2614
2674
|
};
|
|
2615
2675
|
return {
|
|
2616
2676
|
apiKey: n.apiKey,
|
|
@@ -2619,41 +2679,42 @@ const fetchBuilderProps = async (e) => {
|
|
|
2619
2679
|
};
|
|
2620
2680
|
};
|
|
2621
2681
|
export {
|
|
2622
|
-
|
|
2682
|
+
fetchEntries as A,
|
|
2623
2683
|
Blocks as B,
|
|
2624
2684
|
ContentVariants as C,
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2685
|
+
getAllContent as D,
|
|
2686
|
+
getContent as E,
|
|
2687
|
+
getBuilderSearchParams as F,
|
|
2688
|
+
track as G,
|
|
2689
|
+
fetchBuilderProps as H,
|
|
2629
2690
|
RenderBlocks as R,
|
|
2630
2691
|
Symbol$1 as S,
|
|
2631
2692
|
Text as T,
|
|
2632
2693
|
_track as _,
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2694
|
+
getBlockProperties as a,
|
|
2695
|
+
getBlockActions as b,
|
|
2696
|
+
isEditing as c,
|
|
2697
|
+
getSrcSet as d,
|
|
2698
|
+
isJsScript as e,
|
|
2699
|
+
isBrowser as f,
|
|
2700
|
+
getClassPropName as g,
|
|
2701
|
+
getDefaultCanTrack as h,
|
|
2641
2702
|
isEmptyElement as i,
|
|
2642
|
-
|
|
2643
|
-
|
|
2703
|
+
isPreviewing as j,
|
|
2704
|
+
isFromTrustedHost as k,
|
|
2644
2705
|
logger as l,
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2706
|
+
evaluate as m,
|
|
2707
|
+
getInteractionPropertiesForEvent as n,
|
|
2708
|
+
fastClone as o,
|
|
2709
|
+
createRegisterComponentMessage as p,
|
|
2710
|
+
fetchOneEntry as q,
|
|
2650
2711
|
registerInsertMenu as r,
|
|
2651
2712
|
setupBrowserForEditing as s,
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2713
|
+
fetch$1 as t,
|
|
2714
|
+
init as u,
|
|
2715
|
+
RenderContent as v,
|
|
2716
|
+
Columns as w,
|
|
2717
|
+
register as x,
|
|
2718
|
+
setEditorSettings as y,
|
|
2719
|
+
_processContentResult as z
|
|
2659
2720
|
};
|