@builder.io/sdk-react-nextjs 0.12.6 → 0.12.7
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/{USE_CLIENT_BUNDLE-4d4e23b4.js → USE_CLIENT_BUNDLE-456ca2b5.js} +46 -42
- package/lib/{node/USE_CLIENT_BUNDLE-343cb348.cjs → browser/USE_CLIENT_BUNDLE-9d2b983d.cjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-fda604b6.js → browser/USE_SERVER_BUNDLE-e0f1c15b.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-19879780.cjs → browser/USE_SERVER_BUNDLE-ee4a5d19.cjs} +1 -1
- package/lib/browser/{bundle-b3104268.js → bundle-56e0b400.js} +477 -434
- package/lib/browser/{bundle-6e21e129.cjs → bundle-a408994f.cjs} +20 -20
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +6 -6
- package/lib/{node/USE_CLIENT_BUNDLE-aa8ab44a.js → edge/USE_CLIENT_BUNDLE-789e694f.js} +46 -42
- package/lib/{browser/USE_CLIENT_BUNDLE-e5d64246.cjs → edge/USE_CLIENT_BUNDLE-a6a0becc.cjs} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-cbcb1baf.cjs → edge/USE_SERVER_BUNDLE-dbf92938.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-2fdc522e.js → edge/USE_SERVER_BUNDLE-dffaa191.js} +1 -1
- package/lib/edge/{bundle-ee1ebe27.js → bundle-4bf88f38.js} +482 -439
- package/lib/edge/{bundle-f2d4a6db.cjs → bundle-97ad81d1.cjs} +28 -28
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +6 -6
- package/lib/{edge/USE_CLIENT_BUNDLE-41ee32e4.js → node/USE_CLIENT_BUNDLE-499aeaa2.js} +46 -42
- package/lib/{edge/USE_CLIENT_BUNDLE-cc55e91d.cjs → node/USE_CLIENT_BUNDLE-b2f9be29.cjs} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-ccca985e.cjs → node/USE_SERVER_BUNDLE-b3ad9a89.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-2bf0dc28.js → node/USE_SERVER_BUNDLE-e3da6caa.js} +1 -1
- package/lib/node/{bundle-c799b7fc.cjs → bundle-97b4832a.cjs} +4 -4
- package/lib/node/{bundle-99e5b33f.js → bundle-d3f89e99.js} +216 -173
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +6 -6
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +5 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/types/builder-block.d.ts +18 -1
- package/types/esm/components/block/animator.d.ts +5 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/types/builder-block.d.ts +18 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
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-
|
|
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-499aeaa2.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "next/navigation";
|
|
6
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 = () => {
|
|
@@ -98,8 +98,8 @@ const getLocation = () => {
|
|
|
98
98
|
builder: t,
|
|
99
99
|
context: n,
|
|
100
100
|
event: o,
|
|
101
|
-
localState:
|
|
102
|
-
rootSetState:
|
|
101
|
+
localState: r,
|
|
102
|
+
rootSetState: i,
|
|
103
103
|
rootState: a
|
|
104
104
|
}) => {
|
|
105
105
|
const s = getFunctionArguments({
|
|
@@ -108,8 +108,8 @@ const getLocation = () => {
|
|
|
108
108
|
event: o,
|
|
109
109
|
state: flattenState({
|
|
110
110
|
rootState: a,
|
|
111
|
-
localState:
|
|
112
|
-
rootSetState:
|
|
111
|
+
localState: r,
|
|
112
|
+
rootSetState: i
|
|
113
113
|
})
|
|
114
114
|
});
|
|
115
115
|
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
@@ -120,22 +120,22 @@ function flattenState({
|
|
|
120
120
|
rootSetState: n
|
|
121
121
|
}) {
|
|
122
122
|
return new Proxy(e, {
|
|
123
|
-
get: (o,
|
|
124
|
-
if (t &&
|
|
125
|
-
return t[
|
|
126
|
-
const
|
|
127
|
-
return typeof
|
|
128
|
-
rootState:
|
|
123
|
+
get: (o, r) => {
|
|
124
|
+
if (t && r in t)
|
|
125
|
+
return t[r];
|
|
126
|
+
const i = o[r];
|
|
127
|
+
return typeof i == "object" ? flattenState({
|
|
128
|
+
rootState: i,
|
|
129
129
|
localState: void 0,
|
|
130
130
|
rootSetState: n ? (a) => {
|
|
131
|
-
o[
|
|
131
|
+
o[r] = a, n(o);
|
|
132
132
|
} : void 0
|
|
133
|
-
}) :
|
|
133
|
+
}) : i;
|
|
134
134
|
},
|
|
135
|
-
set: (o,
|
|
136
|
-
if (t &&
|
|
135
|
+
set: (o, r, i) => {
|
|
136
|
+
if (t && r in t)
|
|
137
137
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
138
|
-
return o[
|
|
138
|
+
return o[r] = i, n == null || n(o), !0;
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
}
|
|
@@ -143,7 +143,7 @@ const fastClone = (e) => JSON.parse(JSON.stringify(e)), set = (e, t, n) => {
|
|
|
143
143
|
if (Object(e) !== e)
|
|
144
144
|
return e;
|
|
145
145
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
146
|
-
return o.slice(0, -1).reduce((
|
|
146
|
+
return o.slice(0, -1).reduce((r, i, a) => Object(r[i]) === r[i] ? r[i] : r[i] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
147
147
|
}, noop = () => {
|
|
148
148
|
};
|
|
149
149
|
let safeDynamicRequire = noop;
|
|
@@ -204,13 +204,13 @@ output;
|
|
|
204
204
|
builder: t,
|
|
205
205
|
context: n,
|
|
206
206
|
event: o,
|
|
207
|
-
localState:
|
|
208
|
-
rootSetState:
|
|
207
|
+
localState: r,
|
|
208
|
+
rootSetState: i,
|
|
209
209
|
rootState: a
|
|
210
210
|
}) => {
|
|
211
211
|
const s = fastClone({
|
|
212
212
|
...a,
|
|
213
|
-
...
|
|
213
|
+
...r
|
|
214
214
|
}), c = getFunctionArguments({
|
|
215
215
|
builder: t,
|
|
216
216
|
context: n,
|
|
@@ -220,7 +220,7 @@ output;
|
|
|
220
220
|
f.setSync("global", f.derefInto()), f.setSync("log", function(...d) {
|
|
221
221
|
console.log(...d);
|
|
222
222
|
}), f.setSync(BUILDER_SET_STATE_NAME, function(d, l) {
|
|
223
|
-
set(a, d, l),
|
|
223
|
+
set(a, d, l), i == null || i(a);
|
|
224
224
|
}), c.forEach(([d, l]) => {
|
|
225
225
|
const u = typeof l == "object" ? new ivm.Reference(
|
|
226
226
|
// workaround: methods with default values for arguments is not being cloned over
|
|
@@ -257,8 +257,8 @@ function evaluate({
|
|
|
257
257
|
context: t,
|
|
258
258
|
localState: n,
|
|
259
259
|
rootState: o,
|
|
260
|
-
rootSetState:
|
|
261
|
-
event:
|
|
260
|
+
rootSetState: r,
|
|
261
|
+
event: i,
|
|
262
262
|
isExpression: a = !0
|
|
263
263
|
}) {
|
|
264
264
|
if (e === "") {
|
|
@@ -271,8 +271,8 @@ function evaluate({
|
|
|
271
271
|
}),
|
|
272
272
|
builder: getBuilderGlobals(),
|
|
273
273
|
context: t,
|
|
274
|
-
event:
|
|
275
|
-
rootSetState:
|
|
274
|
+
event: i,
|
|
275
|
+
rootSetState: r,
|
|
276
276
|
rootState: o,
|
|
277
277
|
localState: n
|
|
278
278
|
};
|
|
@@ -293,17 +293,17 @@ const evaluateBindings = ({
|
|
|
293
293
|
context: t,
|
|
294
294
|
localState: n,
|
|
295
295
|
rootState: o,
|
|
296
|
-
rootSetState:
|
|
296
|
+
rootSetState: r
|
|
297
297
|
}) => {
|
|
298
298
|
if (!e.bindings)
|
|
299
299
|
return e;
|
|
300
|
-
const
|
|
301
|
-
...
|
|
300
|
+
const i = fastClone(e), a = {
|
|
301
|
+
...i,
|
|
302
302
|
properties: {
|
|
303
|
-
...
|
|
303
|
+
...i.properties
|
|
304
304
|
},
|
|
305
305
|
actions: {
|
|
306
|
-
...
|
|
306
|
+
...i.actions
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
309
|
for (const s in e.bindings) {
|
|
@@ -311,7 +311,7 @@ const evaluateBindings = ({
|
|
|
311
311
|
code: c,
|
|
312
312
|
localState: n,
|
|
313
313
|
rootState: o,
|
|
314
|
-
rootSetState:
|
|
314
|
+
rootSetState: r,
|
|
315
315
|
context: t
|
|
316
316
|
});
|
|
317
317
|
set(a, s, m);
|
|
@@ -323,15 +323,15 @@ function getProcessedBlock({
|
|
|
323
323
|
context: t,
|
|
324
324
|
shouldEvaluateBindings: n,
|
|
325
325
|
localState: o,
|
|
326
|
-
rootState:
|
|
327
|
-
rootSetState:
|
|
326
|
+
rootState: r,
|
|
327
|
+
rootSetState: i
|
|
328
328
|
}) {
|
|
329
329
|
const a = e;
|
|
330
330
|
return n ? evaluateBindings({
|
|
331
331
|
block: a,
|
|
332
332
|
localState: o,
|
|
333
|
-
rootState:
|
|
334
|
-
rootSetState:
|
|
333
|
+
rootState: r,
|
|
334
|
+
rootSetState: i,
|
|
335
335
|
context: t
|
|
336
336
|
}) : a;
|
|
337
337
|
}
|
|
@@ -340,20 +340,20 @@ const getComponent = ({
|
|
|
340
340
|
context: t,
|
|
341
341
|
registeredComponents: n
|
|
342
342
|
}) => {
|
|
343
|
-
var
|
|
344
|
-
const o = (
|
|
343
|
+
var i;
|
|
344
|
+
const o = (i = getProcessedBlock({
|
|
345
345
|
block: e,
|
|
346
346
|
localState: t.localState,
|
|
347
347
|
rootState: t.rootState,
|
|
348
348
|
rootSetState: t.rootSetState,
|
|
349
349
|
context: t.context,
|
|
350
350
|
shouldEvaluateBindings: !1
|
|
351
|
-
}).component) == null ? void 0 :
|
|
351
|
+
}).component) == null ? void 0 : i.name;
|
|
352
352
|
if (!o)
|
|
353
353
|
return null;
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
356
|
-
return
|
|
354
|
+
const r = n[o];
|
|
355
|
+
if (r)
|
|
356
|
+
return r;
|
|
357
357
|
console.warn(`
|
|
358
358
|
Could not find a registered component named "${o}".
|
|
359
359
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
@@ -367,17 +367,17 @@ const getComponent = ({
|
|
|
367
367
|
} = e;
|
|
368
368
|
if (!(n != null && n.collection))
|
|
369
369
|
return;
|
|
370
|
-
const
|
|
370
|
+
const r = evaluate({
|
|
371
371
|
code: n.collection,
|
|
372
372
|
localState: t.localState,
|
|
373
373
|
rootState: t.rootState,
|
|
374
374
|
rootSetState: t.rootSetState,
|
|
375
375
|
context: t.context
|
|
376
376
|
});
|
|
377
|
-
if (!Array.isArray(
|
|
377
|
+
if (!Array.isArray(r))
|
|
378
378
|
return;
|
|
379
|
-
const
|
|
380
|
-
return
|
|
379
|
+
const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
|
|
380
|
+
return r.map((c, m) => ({
|
|
381
381
|
context: {
|
|
382
382
|
...t,
|
|
383
383
|
localState: {
|
|
@@ -419,18 +419,18 @@ const getComponent = ({
|
|
|
419
419
|
min: o,
|
|
420
420
|
default: o + 1
|
|
421
421
|
};
|
|
422
|
-
const
|
|
422
|
+
const r = n.small.max + 1;
|
|
423
423
|
n.medium = {
|
|
424
424
|
max: t,
|
|
425
|
-
min:
|
|
426
|
-
default:
|
|
425
|
+
min: r,
|
|
426
|
+
default: r + 1
|
|
427
427
|
};
|
|
428
|
-
const
|
|
428
|
+
const i = n.medium.max + 1;
|
|
429
429
|
return n.large = {
|
|
430
430
|
max: 2e3,
|
|
431
431
|
// TODO: decide upper limit
|
|
432
|
-
min:
|
|
433
|
-
default:
|
|
432
|
+
min: i,
|
|
433
|
+
default: i + 1
|
|
434
434
|
}, n;
|
|
435
435
|
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
436
436
|
if (typeof o == "string")
|
|
@@ -453,7 +453,7 @@ function InlinedStyles(e) {
|
|
|
453
453
|
}
|
|
454
454
|
function BlockStyles(e) {
|
|
455
455
|
const t = function() {
|
|
456
|
-
const
|
|
456
|
+
const r = getProcessedBlock({
|
|
457
457
|
block: e.block,
|
|
458
458
|
localState: e.context.localState,
|
|
459
459
|
rootState: e.context.rootState,
|
|
@@ -461,19 +461,19 @@ function BlockStyles(e) {
|
|
|
461
461
|
context: e.context.context,
|
|
462
462
|
shouldEvaluateBindings: !0
|
|
463
463
|
});
|
|
464
|
-
return checkIsDefined(
|
|
464
|
+
return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
|
|
465
465
|
}, n = function() {
|
|
466
466
|
var u;
|
|
467
|
-
const
|
|
467
|
+
const r = getProcessedBlock({
|
|
468
468
|
block: e.block,
|
|
469
469
|
localState: e.context.localState,
|
|
470
470
|
rootState: e.context.rootState,
|
|
471
471
|
rootSetState: e.context.rootSetState,
|
|
472
472
|
context: e.context.context,
|
|
473
473
|
shouldEvaluateBindings: !0
|
|
474
|
-
}),
|
|
474
|
+
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
475
475
|
((u = a == null ? void 0 : a.meta) == null ? void 0 : u.breakpoints) || {}
|
|
476
|
-
), c =
|
|
476
|
+
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium, f = i == null ? void 0 : i.small, p = r.id;
|
|
477
477
|
if (!p)
|
|
478
478
|
return "";
|
|
479
479
|
const g = c ? createCssClass({
|
|
@@ -515,18 +515,18 @@ function getBlockActions(e) {
|
|
|
515
515
|
for (const o in n) {
|
|
516
516
|
if (!n.hasOwnProperty(o))
|
|
517
517
|
continue;
|
|
518
|
-
const
|
|
519
|
-
let
|
|
518
|
+
const r = n[o];
|
|
519
|
+
let i = getEventHandlerName(o);
|
|
520
520
|
if (e.stripPrefix)
|
|
521
521
|
switch (TARGET) {
|
|
522
522
|
case "vue":
|
|
523
|
-
|
|
523
|
+
i = i.replace("v-on:", "");
|
|
524
524
|
break;
|
|
525
525
|
case "svelte":
|
|
526
|
-
|
|
526
|
+
i = i.replace("on:", "");
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
|
-
t[
|
|
529
|
+
t[i] = createEventHandler(r, e);
|
|
530
530
|
}
|
|
531
531
|
return t;
|
|
532
532
|
}
|
|
@@ -590,8 +590,8 @@ const getWrapperProps = ({
|
|
|
590
590
|
builderBlock: t,
|
|
591
591
|
context: n,
|
|
592
592
|
componentRef: o,
|
|
593
|
-
includeBlockProps:
|
|
594
|
-
isInteractive:
|
|
593
|
+
includeBlockProps: r,
|
|
594
|
+
isInteractive: i,
|
|
595
595
|
contextValue: a
|
|
596
596
|
}) => {
|
|
597
597
|
const s = {
|
|
@@ -600,19 +600,19 @@ const getWrapperProps = ({
|
|
|
600
600
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
601
601
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
602
602
|
*/
|
|
603
|
-
...
|
|
603
|
+
...r ? {
|
|
604
604
|
attributes: getBlockProperties({
|
|
605
605
|
block: t,
|
|
606
606
|
context: a
|
|
607
607
|
})
|
|
608
608
|
} : {}
|
|
609
609
|
};
|
|
610
|
-
return
|
|
610
|
+
return i ? {
|
|
611
611
|
Wrapper: o,
|
|
612
612
|
block: t,
|
|
613
613
|
context: n,
|
|
614
614
|
wrapperProps: e,
|
|
615
|
-
includeBlockProps:
|
|
615
|
+
includeBlockProps: r
|
|
616
616
|
} : s;
|
|
617
617
|
};
|
|
618
618
|
function ComponentRef(e) {
|
|
@@ -679,10 +679,10 @@ function Block(e) {
|
|
|
679
679
|
context: e.context.context,
|
|
680
680
|
shouldEvaluateBindings: !0
|
|
681
681
|
});
|
|
682
|
-
},
|
|
682
|
+
}, r = function() {
|
|
683
683
|
var l;
|
|
684
684
|
return e.block.tagName === "a" || ((l = o().properties) == null ? void 0 : l.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
685
|
-
},
|
|
685
|
+
}, i = function() {
|
|
686
686
|
var u, b;
|
|
687
687
|
if ((u = e.block.repeat) != null && u.collection)
|
|
688
688
|
return !!((b = n()) != null && b.length);
|
|
@@ -714,7 +714,7 @@ function Block(e) {
|
|
|
714
714
|
isInteractive: !((C = t()) != null && C.isRSC)
|
|
715
715
|
};
|
|
716
716
|
}, c = e.context;
|
|
717
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
717
|
+
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
718
718
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
719
719
|
(m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
720
720
|
ComponentRef,
|
|
@@ -741,7 +741,7 @@ function Block(e) {
|
|
|
741
741
|
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
742
742
|
BlockWrapper,
|
|
743
743
|
{
|
|
744
|
-
Wrapper:
|
|
744
|
+
Wrapper: r(),
|
|
745
745
|
block: o(),
|
|
746
746
|
context: e.context,
|
|
747
747
|
linkComponent: e.linkComponent,
|
|
@@ -786,27 +786,27 @@ function Blocks(e) {
|
|
|
786
786
|
styleProp: e.styleProp,
|
|
787
787
|
BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
|
|
788
788
|
BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
|
|
789
|
-
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((
|
|
789
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((r) => /* @__PURE__ */ jsx(
|
|
790
790
|
Block,
|
|
791
791
|
{
|
|
792
|
-
block:
|
|
792
|
+
block: r,
|
|
793
793
|
linkComponent: e.linkComponent,
|
|
794
794
|
context: e.context,
|
|
795
795
|
registeredComponents: e.registeredComponents
|
|
796
796
|
},
|
|
797
|
-
|
|
797
|
+
r.id
|
|
798
798
|
)) }) : null
|
|
799
799
|
}
|
|
800
800
|
);
|
|
801
801
|
}
|
|
802
802
|
function Columns(e) {
|
|
803
803
|
var d;
|
|
804
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet",
|
|
804
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(u) {
|
|
805
805
|
var b;
|
|
806
806
|
return ((b = n[u]) == null ? void 0 : b.width) || 100 / n.length;
|
|
807
|
-
},
|
|
807
|
+
}, i = function(u) {
|
|
808
808
|
const b = t * (n.length - 1) / n.length;
|
|
809
|
-
return `calc(${
|
|
809
|
+
return `calc(${r(u)}% - ${b}px)`;
|
|
810
810
|
}, a = function({
|
|
811
811
|
stackedStyle: u,
|
|
812
812
|
desktopStyle: b
|
|
@@ -826,7 +826,7 @@ function Columns(e) {
|
|
|
826
826
|
})
|
|
827
827
|
};
|
|
828
828
|
}, f = function(u) {
|
|
829
|
-
const b = u === 0 ? 0 : t, y =
|
|
829
|
+
const b = u === 0 ? 0 : t, y = i(u), h = `${b}px`, k = "100%", C = 0;
|
|
830
830
|
return {
|
|
831
831
|
...{
|
|
832
832
|
display: "flex",
|
|
@@ -934,8 +934,8 @@ function removeProtocol(e) {
|
|
|
934
934
|
return e.replace(/http(s)?:/, "");
|
|
935
935
|
}
|
|
936
936
|
function updateQueryParam(e = "", t, n) {
|
|
937
|
-
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"),
|
|
938
|
-
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e +
|
|
937
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
|
|
938
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + r + t + "=" + encodeURIComponent(n);
|
|
939
939
|
}
|
|
940
940
|
function getShopifyImageUrl(e, t) {
|
|
941
941
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
@@ -944,8 +944,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
944
944
|
return removeProtocol(e);
|
|
945
945
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
946
946
|
if (n) {
|
|
947
|
-
const o = e.split(n[0]),
|
|
948
|
-
return removeProtocol(`${o[0]}_${
|
|
947
|
+
const o = e.split(n[0]), r = n[3], i = t.match("x") ? t : `${t}x`;
|
|
948
|
+
return removeProtocol(`${o[0]}_${i}${r}`);
|
|
949
949
|
}
|
|
950
950
|
return null;
|
|
951
951
|
}
|
|
@@ -956,7 +956,7 @@ function getSrcSet(e) {
|
|
|
956
956
|
if (e.match(/builder\.io/)) {
|
|
957
957
|
let n = e;
|
|
958
958
|
const o = Number(e.split("?width=")[1]);
|
|
959
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((
|
|
959
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((r) => r !== o).map((r) => `${updateQueryParam(e, "width", r)} ${r}w`).concat([n]).join(", ");
|
|
960
960
|
}
|
|
961
961
|
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;
|
|
962
962
|
}
|
|
@@ -981,7 +981,7 @@ const getTopLevelDomain = (e) => {
|
|
|
981
981
|
value: t,
|
|
982
982
|
expires: n
|
|
983
983
|
}) => {
|
|
984
|
-
const
|
|
984
|
+
const r = (isBrowser() ? location.protocol === "https:" : !0) ? SECURE_CONFIG : [[]], i = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...i, ["path", "/"], ["domain", getTopLevelDomain(window.location.hostname)], ...r];
|
|
985
985
|
return stringifyCookie(a);
|
|
986
986
|
}, setCookie = async ({
|
|
987
987
|
name: e,
|
|
@@ -992,14 +992,14 @@ const getTopLevelDomain = (e) => {
|
|
|
992
992
|
try {
|
|
993
993
|
if (!o)
|
|
994
994
|
return;
|
|
995
|
-
const
|
|
995
|
+
const r = createCookieString({
|
|
996
996
|
name: e,
|
|
997
997
|
value: t,
|
|
998
998
|
expires: n
|
|
999
999
|
});
|
|
1000
|
-
document.cookie =
|
|
1001
|
-
} catch (
|
|
1002
|
-
logger.warn("[COOKIE] SET error: ", (
|
|
1000
|
+
document.cookie = r;
|
|
1001
|
+
} catch (r) {
|
|
1002
|
+
logger.warn("[COOKIE] SET error: ", (r == null ? void 0 : r.message) || r);
|
|
1003
1003
|
}
|
|
1004
1004
|
}, BUILDER_STORE_PREFIX = "builder.tests", getContentTestKey = (e) => `${BUILDER_STORE_PREFIX}.${e}`, getContentVariationCookie = ({
|
|
1005
1005
|
contentId: e
|
|
@@ -1022,13 +1022,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1022
1022
|
id: e,
|
|
1023
1023
|
variations: t
|
|
1024
1024
|
}) => {
|
|
1025
|
-
var
|
|
1025
|
+
var r;
|
|
1026
1026
|
let n = 0;
|
|
1027
1027
|
const o = Math.random();
|
|
1028
|
-
for (const
|
|
1029
|
-
const a = (
|
|
1028
|
+
for (const i in t) {
|
|
1029
|
+
const a = (r = t[i]) == null ? void 0 : r.testRatio;
|
|
1030
1030
|
if (n += a, o < n)
|
|
1031
|
-
return
|
|
1031
|
+
return i;
|
|
1032
1032
|
}
|
|
1033
1033
|
return e;
|
|
1034
1034
|
}, getAndSetVariantId = (e) => {
|
|
@@ -1087,13 +1087,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1087
1087
|
}) || getAndSetVariantId({
|
|
1088
1088
|
variations: e.variations,
|
|
1089
1089
|
id: e.id
|
|
1090
|
-
}),
|
|
1090
|
+
}), r = getTestFields({
|
|
1091
1091
|
item: e,
|
|
1092
1092
|
testGroupId: o
|
|
1093
1093
|
});
|
|
1094
1094
|
return {
|
|
1095
1095
|
...e,
|
|
1096
|
-
...
|
|
1096
|
+
...r
|
|
1097
1097
|
};
|
|
1098
1098
|
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, componentInfo$b = {
|
|
1099
1099
|
name: "Core:Button",
|
|
@@ -1307,7 +1307,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1307
1307
|
});
|
|
1308
1308
|
}
|
|
1309
1309
|
const n = e.get("columns");
|
|
1310
|
-
Array.isArray(n) && n.find((
|
|
1310
|
+
Array.isArray(n) && n.find((r) => r.get("width")) && (n.find((i) => !i.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1311
1311
|
}
|
|
1312
1312
|
}, {
|
|
1313
1313
|
name: "space",
|
|
@@ -1418,13 +1418,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1418
1418
|
function o(a) {
|
|
1419
1419
|
return Math.round(a * 1e3) / 1e3;
|
|
1420
1420
|
}
|
|
1421
|
-
const
|
|
1422
|
-
if (fetch(
|
|
1421
|
+
const r = e.get("image"), i = e.get("aspectRatio");
|
|
1422
|
+
if (fetch(r).then((a) => a.blob()).then((a) => {
|
|
1423
1423
|
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1424
|
-
}),
|
|
1425
|
-
return n(
|
|
1424
|
+
}), r && (!i || i === 0.7041))
|
|
1425
|
+
return n(r).then((a) => {
|
|
1426
1426
|
const s = e.get("aspectRatio");
|
|
1427
|
-
e.get("image") ===
|
|
1427
|
+
e.get("image") === r && (!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));
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
1430
|
}, {
|
|
@@ -1765,9 +1765,9 @@ const componentInfo = {
|
|
|
1765
1765
|
...t
|
|
1766
1766
|
}) => ({
|
|
1767
1767
|
...fastClone(t),
|
|
1768
|
-
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [
|
|
1768
|
+
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [r, i]) => ({
|
|
1769
1769
|
...o,
|
|
1770
|
-
[
|
|
1770
|
+
[r]: serializeValue(i)
|
|
1771
1771
|
}), {}))
|
|
1772
1772
|
}), UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1773
1773
|
function getAndSetVariantId() {
|
|
@@ -1915,14 +1915,14 @@ function getFetch() {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
const fetch$1 = getFetch();
|
|
1917
1917
|
function flatten(e, t = null, n = ".") {
|
|
1918
|
-
return Object.keys(e).reduce((o,
|
|
1919
|
-
const
|
|
1920
|
-
return [typeof
|
|
1918
|
+
return Object.keys(e).reduce((o, r) => {
|
|
1919
|
+
const i = e[r], a = [t, r].filter(Boolean).join(n);
|
|
1920
|
+
return [typeof i == "object", i !== null, !(Array.isArray(i) && i.length === 0)].every(Boolean) ? {
|
|
1921
1921
|
...o,
|
|
1922
|
-
...flatten(
|
|
1922
|
+
...flatten(i, a, n)
|
|
1923
1923
|
} : {
|
|
1924
1924
|
...o,
|
|
1925
|
-
[a]:
|
|
1925
|
+
[a]: i
|
|
1926
1926
|
};
|
|
1927
1927
|
}, {});
|
|
1928
1928
|
}
|
|
@@ -1937,8 +1937,8 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1937
1937
|
const t = normalizeSearchParams(e), n = {};
|
|
1938
1938
|
return Object.keys(t).forEach((o) => {
|
|
1939
1939
|
if (o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
|
|
1940
|
-
const
|
|
1941
|
-
n[
|
|
1940
|
+
const r = o.replace(BUILDER_SEARCHPARAMS_PREFIX, "").replace(BUILDER_OPTIONS_PREFIX, "");
|
|
1941
|
+
n[r] = t[o];
|
|
1942
1942
|
}
|
|
1943
1943
|
}), n;
|
|
1944
1944
|
}, getBuilderSearchParamsFromWindow = () => {
|
|
@@ -1953,8 +1953,8 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1953
1953
|
const {
|
|
1954
1954
|
limit: n = 30,
|
|
1955
1955
|
userAttributes: o,
|
|
1956
|
-
query:
|
|
1957
|
-
model:
|
|
1956
|
+
query: r,
|
|
1957
|
+
model: i,
|
|
1958
1958
|
apiKey: a,
|
|
1959
1959
|
includeRefs: s = !0,
|
|
1960
1960
|
enrich: c,
|
|
@@ -1973,7 +1973,7 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1973
1973
|
if (!["v2", "v3"].includes(f))
|
|
1974
1974
|
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1975
1975
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1976
|
-
const h = new URL(`https://cdn.builder.io/api/${f}/content/${
|
|
1976
|
+
const h = new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1977
1977
|
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) {
|
|
1978
1978
|
const S = flatten({
|
|
1979
1979
|
sort: b
|
|
@@ -1987,9 +1987,9 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1987
1987
|
}, C = flatten(k);
|
|
1988
1988
|
for (const S in C)
|
|
1989
1989
|
h.searchParams.set(S, String(C[S]));
|
|
1990
|
-
if (o && h.searchParams.set("userAttributes", JSON.stringify(o)),
|
|
1990
|
+
if (o && h.searchParams.set("userAttributes", JSON.stringify(o)), r) {
|
|
1991
1991
|
const S = flatten({
|
|
1992
|
-
query:
|
|
1992
|
+
query: r
|
|
1993
1993
|
});
|
|
1994
1994
|
for (const x in S)
|
|
1995
1995
|
h.searchParams.set(x, JSON.stringify(S[x]));
|
|
@@ -2009,25 +2009,25 @@ const getContent = fetchOneEntry, _fetchContent = async (e) => {
|
|
|
2009
2009
|
}, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
|
|
2010
2010
|
const o = getDefaultCanTrack(e.canTrack);
|
|
2011
2011
|
if (n.search.includes("preview=")) {
|
|
2012
|
-
const
|
|
2012
|
+
const i = [];
|
|
2013
2013
|
for (const a of t.results) {
|
|
2014
2014
|
const s = getPreviewContent(n.searchParams);
|
|
2015
|
-
|
|
2015
|
+
i.push(s || a);
|
|
2016
2016
|
}
|
|
2017
|
-
t.results =
|
|
2017
|
+
t.results = i;
|
|
2018
2018
|
}
|
|
2019
2019
|
if (!o || !(isBrowser() || TARGET === "reactNative"))
|
|
2020
2020
|
return t.results;
|
|
2021
2021
|
try {
|
|
2022
|
-
const
|
|
2022
|
+
const i = [];
|
|
2023
2023
|
for (const a of t.results)
|
|
2024
|
-
|
|
2024
|
+
i.push(await handleABTesting({
|
|
2025
2025
|
item: a,
|
|
2026
2026
|
canTrack: o
|
|
2027
2027
|
}));
|
|
2028
|
-
t.results =
|
|
2029
|
-
} catch (
|
|
2030
|
-
logger.error("Could not process A/B tests. ",
|
|
2028
|
+
t.results = i;
|
|
2029
|
+
} catch (i) {
|
|
2030
|
+
logger.error("Could not process A/B tests. ", i);
|
|
2031
2031
|
}
|
|
2032
2032
|
return t.results;
|
|
2033
2033
|
};
|
|
@@ -2046,7 +2046,7 @@ async function fetchEntries(e) {
|
|
|
2046
2046
|
const getAllContent = fetchEntries, DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
2047
2047
|
function isFromTrustedHost(e, t) {
|
|
2048
2048
|
const n = new URL(t.origin), o = n.hostname;
|
|
2049
|
-
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((
|
|
2049
|
+
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2050
2050
|
}
|
|
2051
2051
|
function isPreviewing() {
|
|
2052
2052
|
return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
@@ -2104,8 +2104,8 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
2104
2104
|
var o;
|
|
2105
2105
|
try {
|
|
2106
2106
|
t && ((o = getLocalStorage()) == null || o.setItem(e, n));
|
|
2107
|
-
} catch (
|
|
2108
|
-
console.debug("[LocalStorage] SET error: ",
|
|
2107
|
+
} catch (r) {
|
|
2108
|
+
console.debug("[LocalStorage] SET error: ", r);
|
|
2109
2109
|
}
|
|
2110
2110
|
}, VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId", getVisitorId = ({
|
|
2111
2111
|
canTrack: e
|
|
@@ -2154,11 +2154,11 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
2154
2154
|
canTrack: t,
|
|
2155
2155
|
apiKey: n,
|
|
2156
2156
|
metadata: o,
|
|
2157
|
-
...
|
|
2157
|
+
...r
|
|
2158
2158
|
}) => ({
|
|
2159
2159
|
type: e,
|
|
2160
2160
|
data: {
|
|
2161
|
-
...
|
|
2161
|
+
...r,
|
|
2162
2162
|
metadata: {
|
|
2163
2163
|
url: location.href,
|
|
2164
2164
|
...o
|
|
@@ -2214,9 +2214,9 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2214
2214
|
event: e,
|
|
2215
2215
|
target: t
|
|
2216
2216
|
}) => {
|
|
2217
|
-
const n = t.getBoundingClientRect(), o = e.clientX - n.left,
|
|
2217
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, r = e.clientY - n.top, i = round(o / n.width), a = round(r / n.height);
|
|
2218
2218
|
return {
|
|
2219
|
-
x:
|
|
2219
|
+
x: i,
|
|
2220
2220
|
y: a
|
|
2221
2221
|
};
|
|
2222
2222
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
@@ -2235,7 +2235,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2235
2235
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2236
2236
|
}
|
|
2237
2237
|
};
|
|
2238
|
-
}, SDK_VERSION = "0.12.
|
|
2238
|
+
}, SDK_VERSION = "0.12.7", registry = {};
|
|
2239
2239
|
function register(e, t) {
|
|
2240
2240
|
let n = registry[e];
|
|
2241
2241
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2248,8 +2248,8 @@ function register(e, t) {
|
|
|
2248
2248
|
};
|
|
2249
2249
|
try {
|
|
2250
2250
|
parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
|
|
2251
|
-
} catch (
|
|
2252
|
-
console.debug("Could not postmessage",
|
|
2251
|
+
} catch (r) {
|
|
2252
|
+
console.debug("Could not postmessage", r);
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
2255
|
}
|
|
@@ -2296,23 +2296,23 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2296
2296
|
options: e
|
|
2297
2297
|
}
|
|
2298
2298
|
}, "*"), window.addEventListener("message", (o) => {
|
|
2299
|
-
var
|
|
2299
|
+
var i, a;
|
|
2300
2300
|
if (!isFromTrustedHost(e.trustedHosts, o))
|
|
2301
2301
|
return;
|
|
2302
2302
|
const {
|
|
2303
|
-
data:
|
|
2303
|
+
data: r
|
|
2304
2304
|
} = o;
|
|
2305
|
-
if (
|
|
2306
|
-
switch (
|
|
2305
|
+
if (r != null && r.type)
|
|
2306
|
+
switch (r.type) {
|
|
2307
2307
|
case "builder.evaluate": {
|
|
2308
|
-
const s =
|
|
2308
|
+
const s = r.data.text, c = r.data.arguments || [], m = r.data.id, f = new Function(s);
|
|
2309
2309
|
let p, g = null;
|
|
2310
2310
|
try {
|
|
2311
2311
|
p = f.apply(null, c);
|
|
2312
2312
|
} catch (d) {
|
|
2313
2313
|
g = d;
|
|
2314
2314
|
}
|
|
2315
|
-
g ? (
|
|
2315
|
+
g ? (i = window.parent) == null || i.postMessage({
|
|
2316
2316
|
type: "builder.evaluateError",
|
|
2317
2317
|
data: {
|
|
2318
2318
|
id: m,
|
|
@@ -2338,11 +2338,53 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
}
|
|
2340
2340
|
})));
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
const
|
|
2344
|
-
let
|
|
2345
|
-
|
|
2341
|
+
};
|
|
2342
|
+
function assign(e, ...t) {
|
|
2343
|
+
const n = Object(e);
|
|
2344
|
+
for (let o = 1; o < arguments.length; o++) {
|
|
2345
|
+
const r = arguments[o];
|
|
2346
|
+
if (r != null)
|
|
2347
|
+
for (const i in r)
|
|
2348
|
+
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
2349
|
+
}
|
|
2350
|
+
return n;
|
|
2351
|
+
}
|
|
2352
|
+
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
2353
|
+
function warnElementNotPresent(e) {
|
|
2354
|
+
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2355
|
+
}
|
|
2356
|
+
function augmentAnimation(e, t) {
|
|
2357
|
+
const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
|
|
2358
|
+
for (const s of a)
|
|
2359
|
+
for (const c of n)
|
|
2360
|
+
c in s || (s[c] = o[c]);
|
|
2361
|
+
}
|
|
2362
|
+
function getAllStylesUsed(e) {
|
|
2363
|
+
const t = [];
|
|
2364
|
+
for (const n of e.steps)
|
|
2365
|
+
for (const o in n.styles)
|
|
2366
|
+
t.indexOf(o) === -1 && t.push(o);
|
|
2367
|
+
return t;
|
|
2368
|
+
}
|
|
2369
|
+
function triggerAnimation(e) {
|
|
2370
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2371
|
+
if (!t.length) {
|
|
2372
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
Array.from(t).forEach((n) => {
|
|
2376
|
+
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2377
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
|
|
2378
|
+
n.style.transition = "", n.style.transitionDelay = "";
|
|
2379
|
+
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2380
|
+
});
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
const getCssFromFont = (e) => {
|
|
2384
|
+
var i;
|
|
2385
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((i = e == null ? void 0 : e.files) == null ? void 0 : i.regular);
|
|
2386
|
+
let r = "";
|
|
2387
|
+
if (o && t && n && (r += `
|
|
2346
2388
|
@font-face {
|
|
2347
2389
|
font-family: "${t}";
|
|
2348
2390
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -2354,7 +2396,7 @@ font-weight: 400;
|
|
|
2354
2396
|
if (!(String(Number(a)) === a))
|
|
2355
2397
|
continue;
|
|
2356
2398
|
const c = e.files[a];
|
|
2357
|
-
c && c !== o && (
|
|
2399
|
+
c && c !== o && (r += `
|
|
2358
2400
|
@font-face {
|
|
2359
2401
|
font-family: "${t}";
|
|
2360
2402
|
src: url('${c}') format('woff2');
|
|
@@ -2363,7 +2405,7 @@ font-weight: ${a};
|
|
|
2363
2405
|
}
|
|
2364
2406
|
`.trim());
|
|
2365
2407
|
}
|
|
2366
|
-
return
|
|
2408
|
+
return r;
|
|
2367
2409
|
}, getFontCss = ({
|
|
2368
2410
|
customFonts: e
|
|
2369
2411
|
}) => {
|
|
@@ -2407,13 +2449,13 @@ const getRootStateInitialValue = ({
|
|
|
2407
2449
|
data: t,
|
|
2408
2450
|
locale: n
|
|
2409
2451
|
}) => {
|
|
2410
|
-
var
|
|
2411
|
-
const o = {},
|
|
2452
|
+
var i, a, s;
|
|
2453
|
+
const o = {}, r = ((i = e == null ? void 0 : e.data) == null ? void 0 : i.state) || {};
|
|
2412
2454
|
return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
|
|
2413
2455
|
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2414
2456
|
}), {
|
|
2415
2457
|
...o,
|
|
2416
|
-
...
|
|
2458
|
+
...r,
|
|
2417
2459
|
...t,
|
|
2418
2460
|
...n ? {
|
|
2419
2461
|
locale: n
|
|
@@ -2431,12 +2473,12 @@ const getRootStateInitialValue = ({
|
|
|
2431
2473
|
meta: e == null ? void 0 : e.meta
|
|
2432
2474
|
} : void 0;
|
|
2433
2475
|
function ContentComponent(e) {
|
|
2434
|
-
var
|
|
2476
|
+
var r, i, a, s, c, m, f, p, g;
|
|
2435
2477
|
const t = getUpdateVariantVisibilityScript({
|
|
2436
2478
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2437
|
-
variationId: (
|
|
2479
|
+
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
2438
2480
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2439
|
-
contentId: (
|
|
2481
|
+
contentId: (i = e.content) == null ? void 0 : i.id
|
|
2440
2482
|
}), n = [
|
|
2441
2483
|
...getDefaultRegisteredComponents(),
|
|
2442
2484
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2532,7 +2574,7 @@ function ContentComponent(e) {
|
|
|
2532
2574
|
);
|
|
2533
2575
|
}
|
|
2534
2576
|
function ContentVariants(e) {
|
|
2535
|
-
var
|
|
2577
|
+
var i, a;
|
|
2536
2578
|
const t = checkShouldRenderVariants({
|
|
2537
2579
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2538
2580
|
content: e.content
|
|
@@ -2547,7 +2589,7 @@ function ContentVariants(e) {
|
|
|
2547
2589
|
);
|
|
2548
2590
|
}, o = function() {
|
|
2549
2591
|
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2550
|
-
},
|
|
2592
|
+
}, r = function() {
|
|
2551
2593
|
var c;
|
|
2552
2594
|
return t ? {
|
|
2553
2595
|
...e.content,
|
|
@@ -2563,7 +2605,7 @@ function ContentVariants(e) {
|
|
|
2563
2605
|
/* @__PURE__ */ jsx(
|
|
2564
2606
|
InlinedStyles,
|
|
2565
2607
|
{
|
|
2566
|
-
id: `variants-styles-${(
|
|
2608
|
+
id: `variants-styles-${(i = e.content) == null ? void 0 : i.id}`,
|
|
2567
2609
|
styles: o()
|
|
2568
2610
|
}
|
|
2569
2611
|
),
|
|
@@ -2597,7 +2639,7 @@ function ContentVariants(e) {
|
|
|
2597
2639
|
/* @__PURE__ */ jsx(
|
|
2598
2640
|
ContentComponent,
|
|
2599
2641
|
{
|
|
2600
|
-
content:
|
|
2642
|
+
content: r(),
|
|
2601
2643
|
showContent: !0,
|
|
2602
2644
|
model: e.model,
|
|
2603
2645
|
data: e.data,
|
|
@@ -2640,7 +2682,7 @@ const fetchSymbolContent = async ({
|
|
|
2640
2682
|
});
|
|
2641
2683
|
};
|
|
2642
2684
|
async function Symbol$1(e) {
|
|
2643
|
-
var o,
|
|
2685
|
+
var o, r, i, a, s;
|
|
2644
2686
|
const t = function() {
|
|
2645
2687
|
var m, f;
|
|
2646
2688
|
return [
|
|
@@ -2661,11 +2703,11 @@ async function Symbol$1(e) {
|
|
|
2661
2703
|
apiKey: e.builderContext.apiKey,
|
|
2662
2704
|
context: {
|
|
2663
2705
|
...e.builderContext.context,
|
|
2664
|
-
symbolId: (
|
|
2706
|
+
symbolId: (r = e.builderBlock) == null ? void 0 : r.id
|
|
2665
2707
|
},
|
|
2666
2708
|
customComponents: Object.values(e.builderComponents),
|
|
2667
2709
|
data: {
|
|
2668
|
-
...(
|
|
2710
|
+
...(i = e.symbol) == null ? void 0 : i.data,
|
|
2669
2711
|
...e.builderContext.localState,
|
|
2670
2712
|
...(a = n == null ? void 0 : n.data) == null ? void 0 : a.state
|
|
2671
2713
|
},
|
|
@@ -2687,8 +2729,8 @@ function setEditorSettings(e) {
|
|
|
2687
2729
|
}
|
|
2688
2730
|
}
|
|
2689
2731
|
const fetchBuilderProps = async (e) => {
|
|
2690
|
-
var o,
|
|
2691
|
-
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((
|
|
2732
|
+
var o, r, i;
|
|
2733
|
+
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((r = e.userAttributes) == null ? void 0 : r.urlPath), n = {
|
|
2692
2734
|
...e,
|
|
2693
2735
|
apiKey: e.apiKey,
|
|
2694
2736
|
model: e.model || "page",
|
|
@@ -2698,7 +2740,7 @@ const fetchBuilderProps = async (e) => {
|
|
|
2698
2740
|
urlPath: t
|
|
2699
2741
|
} : {}
|
|
2700
2742
|
},
|
|
2701
|
-
options: getBuilderSearchParams(e.searchParams || ((
|
|
2743
|
+
options: getBuilderSearchParams(e.searchParams || ((i = e.url) == null ? void 0 : i.searchParams) || e.options)
|
|
2702
2744
|
};
|
|
2703
2745
|
return {
|
|
2704
2746
|
apiKey: n.apiKey,
|
|
@@ -2707,14 +2749,15 @@ const fetchBuilderProps = async (e) => {
|
|
|
2707
2749
|
};
|
|
2708
2750
|
};
|
|
2709
2751
|
export {
|
|
2710
|
-
|
|
2752
|
+
_processContentResult as A,
|
|
2711
2753
|
Blocks as B,
|
|
2712
2754
|
ContentVariants as C,
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2755
|
+
fetchEntries as D,
|
|
2756
|
+
getAllContent as E,
|
|
2757
|
+
getContent as F,
|
|
2758
|
+
getBuilderSearchParams as G,
|
|
2759
|
+
track as H,
|
|
2760
|
+
fetchBuilderProps as I,
|
|
2718
2761
|
RenderBlocks as R,
|
|
2719
2762
|
Symbol$1 as S,
|
|
2720
2763
|
Text as T,
|
|
@@ -2738,11 +2781,11 @@ export {
|
|
|
2738
2781
|
fetchOneEntry as q,
|
|
2739
2782
|
registerInsertMenu as r,
|
|
2740
2783
|
setupBrowserForEditing as s,
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2784
|
+
triggerAnimation as t,
|
|
2785
|
+
fetch$1 as u,
|
|
2786
|
+
init as v,
|
|
2787
|
+
RenderContent as w,
|
|
2788
|
+
Columns as x,
|
|
2789
|
+
register as y,
|
|
2790
|
+
setEditorSettings as z
|
|
2748
2791
|
};
|