@builder.io/sdk-react 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +5 -5
- package/lib/browser/blocks-exports.mjs +48 -24
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-60192a70.cjs → server-entry-11e01841.cjs} +1 -1
- package/lib/browser/{server-entry-3d9c0013.js → server-entry-afeff3cb.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-874a3da2.js → blocks-8e5cc463.js} +10 -4
- package/lib/edge/{blocks-8cf047ac.cjs → blocks-a0a9d452.cjs} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-e8062d3a.cjs → button-66c46316.cjs} +1 -1
- package/lib/edge/{button-f921801d.js → button-764707c4.js} +2 -2
- package/lib/edge/{columns-cd3277d0.cjs → columns-0a14db0e.cjs} +2 -2
- package/lib/edge/{columns-3d6fd99f.js → columns-0bdc7586.js} +27 -27
- package/lib/edge/{content-variants-23991643.cjs → content-variants-c03ec7a1.cjs} +8 -8
- package/lib/edge/{content-variants-716e35d3.js → content-variants-db1e0281.js} +140 -122
- package/lib/edge/{form-ed39d763.js → form-7a6f998f.js} +3 -3
- package/lib/edge/{form-9e4155f9.cjs → form-a5d18c89.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-63df96dc.js → get-class-prop-name-49cbb2c6.js} +1 -1
- package/lib/edge/{get-class-prop-name-97c37936.cjs → get-class-prop-name-bbc4d2f3.cjs} +1 -1
- package/lib/edge/{img-4c6f100c.cjs → img-058cb6f0.cjs} +1 -1
- package/lib/edge/{img-60cd5cd5.js → img-c9630f56.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-cf3adf1f.js → input-3de90790.js} +1 -1
- package/lib/edge/{input-2d8eb4bc.cjs → input-ceacd029.cjs} +1 -1
- package/lib/edge/{select-8e2ef3ed.cjs → select-df72f987.cjs} +1 -1
- package/lib/edge/{select-03974bcf.js → select-ee266e60.js} +1 -1
- package/lib/edge/{server-entry-24e90a71.js → server-entry-2b1068fd.js} +1 -1
- package/lib/edge/{server-entry-1263a732.cjs → server-entry-ef266884.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-972c3844.cjs → slot-83d735d6.cjs} +1 -1
- package/lib/edge/{slot-1408ceff.js → slot-f246e67e.js} +3 -3
- package/lib/edge/{symbol-781970fe.cjs → symbol-991f09b3.cjs} +1 -1
- package/lib/edge/{symbol-80a11943.js → symbol-f68a7357.js} +2 -2
- package/lib/node/blocks-exports.cjs +9 -9
- package/lib/node/blocks-exports.mjs +257 -233
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-71df0c38.cjs → server-entry-4ba58cf3.cjs} +1 -1
- package/lib/node/{server-entry-016a36f7.js → server-entry-a221fe66.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/helpers.d.ts +1 -1
- package/types/components/inlined-script.d.ts +1 -1
- package/types/components/inlined-styles.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var F = (e, t, n) => (
|
|
2
|
+
var V = Object.defineProperty;
|
|
3
|
+
var N = (e, t, n) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var F = (e, t, n) => (N(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-
|
|
6
|
+
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-a221fe66.js";
|
|
7
7
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
8
8
|
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());
|
|
9
9
|
function DynamicRenderer(e) {
|
|
@@ -72,9 +72,9 @@ const getFunctionArguments = ({
|
|
|
72
72
|
builder: e,
|
|
73
73
|
context: t,
|
|
74
74
|
event: n,
|
|
75
|
-
state:
|
|
75
|
+
state: i
|
|
76
76
|
}) => Object.entries({
|
|
77
|
-
state:
|
|
77
|
+
state: i,
|
|
78
78
|
Builder: e,
|
|
79
79
|
// legacy
|
|
80
80
|
builder: e,
|
|
@@ -91,18 +91,18 @@ const getFunctionArguments = ({
|
|
|
91
91
|
code: e,
|
|
92
92
|
builder: t,
|
|
93
93
|
context: n,
|
|
94
|
-
event:
|
|
95
|
-
localState:
|
|
94
|
+
event: i,
|
|
95
|
+
localState: o,
|
|
96
96
|
rootSetState: a,
|
|
97
97
|
rootState: r
|
|
98
98
|
}) => {
|
|
99
99
|
const s = getFunctionArguments({
|
|
100
100
|
builder: t,
|
|
101
101
|
context: n,
|
|
102
|
-
event:
|
|
102
|
+
event: i,
|
|
103
103
|
state: flattenState({
|
|
104
104
|
rootState: r,
|
|
105
|
-
localState:
|
|
105
|
+
localState: o,
|
|
106
106
|
rootSetState: a
|
|
107
107
|
})
|
|
108
108
|
});
|
|
@@ -114,30 +114,30 @@ function flattenState({
|
|
|
114
114
|
rootSetState: n
|
|
115
115
|
}) {
|
|
116
116
|
return new Proxy(e, {
|
|
117
|
-
get: (
|
|
118
|
-
if (t &&
|
|
119
|
-
return t[
|
|
120
|
-
const a = o
|
|
117
|
+
get: (i, o) => {
|
|
118
|
+
if (t && o in t)
|
|
119
|
+
return t[o];
|
|
120
|
+
const a = i[o];
|
|
121
121
|
return typeof a == "object" && a !== null ? flattenState({
|
|
122
122
|
rootState: a,
|
|
123
123
|
localState: void 0,
|
|
124
124
|
rootSetState: n ? (r) => {
|
|
125
|
-
o
|
|
125
|
+
i[o] = r, n(i);
|
|
126
126
|
} : void 0
|
|
127
127
|
}) : a;
|
|
128
128
|
},
|
|
129
|
-
set: (
|
|
130
|
-
if (t &&
|
|
129
|
+
set: (i, o, a) => {
|
|
130
|
+
if (t && o in t)
|
|
131
131
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
132
|
-
return o
|
|
132
|
+
return i[o] = a, n == null || n(i), !0;
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
const set = (e, t, n) => {
|
|
137
137
|
if (Object(e) !== e)
|
|
138
138
|
return e;
|
|
139
|
-
const
|
|
140
|
-
return
|
|
139
|
+
const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
140
|
+
return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
|
|
141
141
|
}, noop = () => {
|
|
142
142
|
};
|
|
143
143
|
let safeDynamicRequire = noop;
|
|
@@ -175,7 +175,7 @@ var refToProxy = (obj) => {
|
|
|
175
175
|
code: e,
|
|
176
176
|
args: t
|
|
177
177
|
}) => {
|
|
178
|
-
const n = t.map(([
|
|
178
|
+
const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
|
|
179
179
|
return `
|
|
180
180
|
${REF_TO_PROXY_FN}
|
|
181
181
|
${n}
|
|
@@ -200,18 +200,18 @@ output;
|
|
|
200
200
|
code: e,
|
|
201
201
|
builder: t,
|
|
202
202
|
context: n,
|
|
203
|
-
event:
|
|
204
|
-
localState:
|
|
203
|
+
event: i,
|
|
204
|
+
localState: o,
|
|
205
205
|
rootSetState: a,
|
|
206
206
|
rootState: r
|
|
207
207
|
}) => {
|
|
208
208
|
const s = safeDynamicRequire("isolated-vm"), c = fastClone({
|
|
209
209
|
...r,
|
|
210
|
-
...
|
|
210
|
+
...o
|
|
211
211
|
}), l = getFunctionArguments({
|
|
212
212
|
builder: t,
|
|
213
213
|
context: n,
|
|
214
|
-
event:
|
|
214
|
+
event: i,
|
|
215
215
|
state: c
|
|
216
216
|
}), d = getIsolateContext(), m = d.global;
|
|
217
217
|
m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
|
|
@@ -243,10 +243,10 @@ function isNodeRuntime() {
|
|
|
243
243
|
return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
244
244
|
}
|
|
245
245
|
const shouldForceBrowserRuntimeInNode = () => {
|
|
246
|
-
var
|
|
246
|
+
var i;
|
|
247
247
|
if (!isNodeRuntime())
|
|
248
248
|
return !1;
|
|
249
|
-
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (
|
|
249
|
+
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
|
|
250
250
|
return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
251
251
|
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), R = class R {
|
|
252
252
|
static getCacheKey(t) {
|
|
@@ -272,8 +272,8 @@ function evaluate({
|
|
|
272
272
|
code: e,
|
|
273
273
|
context: t,
|
|
274
274
|
localState: n,
|
|
275
|
-
rootState:
|
|
276
|
-
rootSetState:
|
|
275
|
+
rootState: i,
|
|
276
|
+
rootSetState: o,
|
|
277
277
|
event: a,
|
|
278
278
|
isExpression: r = !0,
|
|
279
279
|
enableCache: s
|
|
@@ -289,8 +289,8 @@ function evaluate({
|
|
|
289
289
|
builder: getBuilderGlobals(),
|
|
290
290
|
context: t,
|
|
291
291
|
event: a,
|
|
292
|
-
rootSetState:
|
|
293
|
-
rootState:
|
|
292
|
+
rootSetState: o,
|
|
293
|
+
rootState: i,
|
|
294
294
|
localState: n
|
|
295
295
|
};
|
|
296
296
|
if (s) {
|
|
@@ -319,8 +319,8 @@ const evaluateBindings = ({
|
|
|
319
319
|
block: e,
|
|
320
320
|
context: t,
|
|
321
321
|
localState: n,
|
|
322
|
-
rootState:
|
|
323
|
-
rootSetState:
|
|
322
|
+
rootState: i,
|
|
323
|
+
rootSetState: o
|
|
324
324
|
}) => {
|
|
325
325
|
if (!e.bindings)
|
|
326
326
|
return e;
|
|
@@ -337,8 +337,8 @@ const evaluateBindings = ({
|
|
|
337
337
|
const c = e.bindings[s], l = evaluate({
|
|
338
338
|
code: c,
|
|
339
339
|
localState: n,
|
|
340
|
-
rootState:
|
|
341
|
-
rootSetState:
|
|
340
|
+
rootState: i,
|
|
341
|
+
rootSetState: o,
|
|
342
342
|
context: t,
|
|
343
343
|
enableCache: !0
|
|
344
344
|
});
|
|
@@ -350,38 +350,38 @@ function getProcessedBlock({
|
|
|
350
350
|
block: e,
|
|
351
351
|
context: t,
|
|
352
352
|
shouldEvaluateBindings: n,
|
|
353
|
-
localState:
|
|
354
|
-
rootState:
|
|
353
|
+
localState: i,
|
|
354
|
+
rootState: o,
|
|
355
355
|
rootSetState: a
|
|
356
356
|
}) {
|
|
357
357
|
const r = e;
|
|
358
358
|
return n ? evaluateBindings({
|
|
359
359
|
block: r,
|
|
360
|
-
localState:
|
|
361
|
-
rootState:
|
|
360
|
+
localState: i,
|
|
361
|
+
rootState: o,
|
|
362
362
|
rootSetState: a,
|
|
363
363
|
context: t
|
|
364
364
|
}) : r;
|
|
365
365
|
}
|
|
366
366
|
function throttle(e, t, n = {}) {
|
|
367
|
-
let
|
|
367
|
+
let i, o, a, r = null, s = 0;
|
|
368
368
|
const c = function() {
|
|
369
|
-
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(
|
|
369
|
+
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
|
|
370
370
|
};
|
|
371
371
|
return function() {
|
|
372
372
|
const l = Date.now();
|
|
373
373
|
!s && n.leading === !1 && (s = l);
|
|
374
374
|
const d = t - (l - s);
|
|
375
|
-
return
|
|
375
|
+
return i = this, o = arguments, d <= 0 || d > t ? (r && (clearTimeout(r), r = null), s = l, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, d)), a;
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
function assign(e, ...t) {
|
|
379
379
|
const n = Object(e);
|
|
380
|
-
for (let
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
for (const a in
|
|
384
|
-
Object.prototype.hasOwnProperty.call(
|
|
380
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
381
|
+
const o = arguments[i];
|
|
382
|
+
if (o != null)
|
|
383
|
+
for (const a in o)
|
|
384
|
+
Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
|
|
385
385
|
}
|
|
386
386
|
return n;
|
|
387
387
|
}
|
|
@@ -404,16 +404,16 @@ function warnElementNotPresent(e) {
|
|
|
404
404
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
405
405
|
}
|
|
406
406
|
function augmentAnimation(e, t) {
|
|
407
|
-
const n = getAllStylesUsed(e),
|
|
407
|
+
const n = getAllStylesUsed(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
|
|
408
408
|
for (const s of r)
|
|
409
409
|
for (const c of n)
|
|
410
|
-
c in s || (s[c] =
|
|
410
|
+
c in s || (s[c] = i[c]);
|
|
411
411
|
}
|
|
412
412
|
function getAllStylesUsed(e) {
|
|
413
413
|
const t = [];
|
|
414
414
|
for (const n of e.steps)
|
|
415
|
-
for (const
|
|
416
|
-
t.indexOf(
|
|
415
|
+
for (const i in n.styles)
|
|
416
|
+
t.indexOf(i) === -1 && t.push(i);
|
|
417
417
|
return t;
|
|
418
418
|
}
|
|
419
419
|
function triggerAnimation(e) {
|
|
@@ -438,12 +438,12 @@ function bindHoverAnimation(e) {
|
|
|
438
438
|
}
|
|
439
439
|
Array.from(t).forEach((n) => {
|
|
440
440
|
augmentAnimation(e, n);
|
|
441
|
-
const
|
|
441
|
+
const i = e.steps[0].styles, o = e.steps[1].styles;
|
|
442
442
|
function a() {
|
|
443
|
-
assign(n.style,
|
|
443
|
+
assign(n.style, i);
|
|
444
444
|
}
|
|
445
445
|
function r() {
|
|
446
|
-
assign(n.style,
|
|
446
|
+
assign(n.style, o);
|
|
447
447
|
}
|
|
448
448
|
a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
|
|
449
449
|
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
@@ -458,13 +458,13 @@ function bindScrollInViewAnimation(e) {
|
|
|
458
458
|
}
|
|
459
459
|
Array.from(t).forEach((n) => {
|
|
460
460
|
augmentAnimation(e, n);
|
|
461
|
-
let
|
|
461
|
+
let i = !1, o = !1;
|
|
462
462
|
function a() {
|
|
463
|
-
!
|
|
463
|
+
!i && s(n) ? (i = !0, o = !0, setTimeout(() => {
|
|
464
464
|
assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
|
|
465
|
-
|
|
465
|
+
o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
|
|
466
466
|
}, (e.duration + (e.delay || 0)) * 1e3 + 100);
|
|
467
|
-
})) : e.repeat &&
|
|
467
|
+
})) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
|
|
468
468
|
}
|
|
469
469
|
const r = throttle(a, 200, {
|
|
470
470
|
leading: !1
|
|
@@ -485,21 +485,21 @@ function bindScrollInViewAnimation(e) {
|
|
|
485
485
|
}), a();
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n,
|
|
489
|
-
if (typeof
|
|
490
|
-
return `${camelToKebabCase(n)}: ${
|
|
488
|
+
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
|
|
489
|
+
if (typeof i == "string")
|
|
490
|
+
return `${camelToKebabCase(n)}: ${i};`;
|
|
491
491
|
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
492
492
|
`), createCssClass = ({
|
|
493
493
|
mediaQuery: e,
|
|
494
494
|
className: t,
|
|
495
495
|
styles: n
|
|
496
496
|
}) => {
|
|
497
|
-
const
|
|
497
|
+
const i = `.${t} {
|
|
498
498
|
${convertStyleMapToCSS(n)}
|
|
499
499
|
}`;
|
|
500
500
|
return e ? `${e} {
|
|
501
|
-
${
|
|
502
|
-
}` :
|
|
501
|
+
${i}
|
|
502
|
+
}` : i;
|
|
503
503
|
};
|
|
504
504
|
function transformStyleProperty({
|
|
505
505
|
style: e
|
|
@@ -533,7 +533,7 @@ const getComponent = ({
|
|
|
533
533
|
registeredComponents: n
|
|
534
534
|
}) => {
|
|
535
535
|
var a;
|
|
536
|
-
const
|
|
536
|
+
const i = (a = getProcessedBlock({
|
|
537
537
|
block: e,
|
|
538
538
|
localState: t.localState,
|
|
539
539
|
rootState: t.rootState,
|
|
@@ -541,13 +541,13 @@ const getComponent = ({
|
|
|
541
541
|
context: t.context,
|
|
542
542
|
shouldEvaluateBindings: !1
|
|
543
543
|
}).component) == null ? void 0 : a.name;
|
|
544
|
-
if (!
|
|
544
|
+
if (!i)
|
|
545
545
|
return null;
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
return
|
|
546
|
+
const o = n[i];
|
|
547
|
+
if (o)
|
|
548
|
+
return o;
|
|
549
549
|
console.warn(`
|
|
550
|
-
Could not find a registered component named "${
|
|
550
|
+
Could not find a registered component named "${i}".
|
|
551
551
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
552
552
|
}, getRepeatItemData = ({
|
|
553
553
|
block: e,
|
|
@@ -555,11 +555,11 @@ const getComponent = ({
|
|
|
555
555
|
}) => {
|
|
556
556
|
const {
|
|
557
557
|
repeat: n,
|
|
558
|
-
...
|
|
558
|
+
...i
|
|
559
559
|
} = e;
|
|
560
560
|
if (!(n != null && n.collection))
|
|
561
561
|
return;
|
|
562
|
-
const
|
|
562
|
+
const o = evaluate({
|
|
563
563
|
code: n.collection,
|
|
564
564
|
localState: t.localState,
|
|
565
565
|
rootState: t.rootState,
|
|
@@ -567,10 +567,10 @@ const getComponent = ({
|
|
|
567
567
|
context: t.context,
|
|
568
568
|
enableCache: !0
|
|
569
569
|
});
|
|
570
|
-
if (!Array.isArray(
|
|
570
|
+
if (!Array.isArray(o))
|
|
571
571
|
return;
|
|
572
572
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
573
|
-
return
|
|
573
|
+
return o.map((c, l) => ({
|
|
574
574
|
context: {
|
|
575
575
|
...t,
|
|
576
576
|
localState: {
|
|
@@ -581,7 +581,7 @@ const getComponent = ({
|
|
|
581
581
|
[`$${r}Index`]: l
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
|
-
block:
|
|
584
|
+
block: i
|
|
585
585
|
}));
|
|
586
586
|
}, SIZES = {
|
|
587
587
|
small: {
|
|
@@ -606,17 +606,17 @@ const getComponent = ({
|
|
|
606
606
|
const n = fastClone(SIZES);
|
|
607
607
|
if (!e || !t)
|
|
608
608
|
return n;
|
|
609
|
-
const
|
|
609
|
+
const i = Math.floor(e / 2);
|
|
610
610
|
n.small = {
|
|
611
611
|
max: e,
|
|
612
|
-
min:
|
|
613
|
-
default:
|
|
612
|
+
min: i,
|
|
613
|
+
default: i + 1
|
|
614
614
|
};
|
|
615
|
-
const
|
|
615
|
+
const o = n.small.max + 1;
|
|
616
616
|
n.medium = {
|
|
617
617
|
max: t,
|
|
618
|
-
min:
|
|
619
|
-
default:
|
|
618
|
+
min: o,
|
|
619
|
+
default: o + 1
|
|
620
620
|
};
|
|
621
621
|
const a = n.medium.max + 1;
|
|
622
622
|
return n.large = {
|
|
@@ -627,11 +627,17 @@ const getComponent = ({
|
|
|
627
627
|
}, n;
|
|
628
628
|
};
|
|
629
629
|
function InlinedStyles(e) {
|
|
630
|
-
return /* @__PURE__ */ jsx(
|
|
630
|
+
return /* @__PURE__ */ jsx(
|
|
631
|
+
"style",
|
|
632
|
+
{
|
|
633
|
+
dangerouslySetInnerHTML: { __html: e.styles },
|
|
634
|
+
"data-id": e.id
|
|
635
|
+
}
|
|
636
|
+
);
|
|
631
637
|
}
|
|
632
638
|
function BlockStyles(e) {
|
|
633
639
|
function t() {
|
|
634
|
-
const
|
|
640
|
+
const i = getProcessedBlock({
|
|
635
641
|
block: e.block,
|
|
636
642
|
localState: e.context.localState,
|
|
637
643
|
rootState: e.context.rootState,
|
|
@@ -639,20 +645,20 @@ function BlockStyles(e) {
|
|
|
639
645
|
context: e.context.context,
|
|
640
646
|
shouldEvaluateBindings: !0
|
|
641
647
|
});
|
|
642
|
-
return checkIsDefined(
|
|
648
|
+
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
643
649
|
}
|
|
644
650
|
function n() {
|
|
645
651
|
var y;
|
|
646
|
-
const
|
|
652
|
+
const i = getProcessedBlock({
|
|
647
653
|
block: e.block,
|
|
648
654
|
localState: e.context.localState,
|
|
649
655
|
rootState: e.context.rootState,
|
|
650
656
|
rootSetState: e.context.rootSetState,
|
|
651
657
|
context: e.context.context,
|
|
652
658
|
shouldEvaluateBindings: !0
|
|
653
|
-
}),
|
|
659
|
+
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
654
660
|
((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
|
|
655
|
-
), s =
|
|
661
|
+
), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, d = i.id;
|
|
656
662
|
if (!d)
|
|
657
663
|
return "";
|
|
658
664
|
const m = s ? createCssClass({
|
|
@@ -675,7 +681,7 @@ function BlockStyles(e) {
|
|
|
675
681
|
}) : "";
|
|
676
682
|
return [m, g, b].join(" ");
|
|
677
683
|
}
|
|
678
|
-
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
684
|
+
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
679
685
|
}
|
|
680
686
|
function capitalizeFirstLetter(e) {
|
|
681
687
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
@@ -691,13 +697,13 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
|
|
|
691
697
|
enableCache: !0
|
|
692
698
|
});
|
|
693
699
|
function getBlockActions(e) {
|
|
694
|
-
var
|
|
695
|
-
const t = {}, n = (
|
|
696
|
-
for (const
|
|
697
|
-
if (!n.hasOwnProperty(
|
|
700
|
+
var i;
|
|
701
|
+
const t = {}, n = (i = e.block.actions) != null ? i : {};
|
|
702
|
+
for (const o in n) {
|
|
703
|
+
if (!n.hasOwnProperty(o))
|
|
698
704
|
continue;
|
|
699
|
-
const a = n[
|
|
700
|
-
let r = getEventHandlerName(
|
|
705
|
+
const a = n[o];
|
|
706
|
+
let r = getEventHandlerName(o);
|
|
701
707
|
if (e.stripPrefix)
|
|
702
708
|
switch (TARGET) {
|
|
703
709
|
case "vue":
|
|
@@ -723,7 +729,7 @@ function getBlockProperties({
|
|
|
723
729
|
block: e,
|
|
724
730
|
context: t
|
|
725
731
|
}) {
|
|
726
|
-
var
|
|
732
|
+
var i;
|
|
727
733
|
const n = {
|
|
728
734
|
...extractRelevantRootBlockProperties(e),
|
|
729
735
|
...e.properties,
|
|
@@ -732,7 +738,7 @@ function getBlockProperties({
|
|
|
732
738
|
block: e,
|
|
733
739
|
context: t
|
|
734
740
|
}),
|
|
735
|
-
[getClassPropName()]: [e.id, "builder-block", e.class, (
|
|
741
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
|
|
736
742
|
};
|
|
737
743
|
return transformBlockProperties({
|
|
738
744
|
properties: n,
|
|
@@ -787,8 +793,8 @@ const getWrapperProps = ({
|
|
|
787
793
|
componentOptions: e,
|
|
788
794
|
builderBlock: t,
|
|
789
795
|
context: n,
|
|
790
|
-
componentRef:
|
|
791
|
-
includeBlockProps:
|
|
796
|
+
componentRef: i,
|
|
797
|
+
includeBlockProps: o,
|
|
792
798
|
isInteractive: a,
|
|
793
799
|
contextValue: r
|
|
794
800
|
}) => {
|
|
@@ -798,7 +804,7 @@ const getWrapperProps = ({
|
|
|
798
804
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
799
805
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
800
806
|
*/
|
|
801
|
-
...
|
|
807
|
+
...o ? {
|
|
802
808
|
attributes: getBlockProperties({
|
|
803
809
|
block: t,
|
|
804
810
|
context: r
|
|
@@ -806,15 +812,15 @@ const getWrapperProps = ({
|
|
|
806
812
|
} : {}
|
|
807
813
|
};
|
|
808
814
|
return a ? {
|
|
809
|
-
Wrapper:
|
|
815
|
+
Wrapper: i,
|
|
810
816
|
block: t,
|
|
811
817
|
context: n,
|
|
812
818
|
wrapperProps: e,
|
|
813
|
-
includeBlockProps:
|
|
819
|
+
includeBlockProps: o
|
|
814
820
|
} : s;
|
|
815
821
|
};
|
|
816
822
|
function ComponentRef(e) {
|
|
817
|
-
var
|
|
823
|
+
var i;
|
|
818
824
|
const [t, n] = useState(
|
|
819
825
|
() => e.isInteractive ? InteractiveElement : e.componentRef
|
|
820
826
|
);
|
|
@@ -831,15 +837,15 @@ function ComponentRef(e) {
|
|
|
831
837
|
isInteractive: e.isInteractive,
|
|
832
838
|
contextValue: e.context
|
|
833
839
|
}),
|
|
834
|
-
children: (
|
|
840
|
+
children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
|
|
835
841
|
Block,
|
|
836
842
|
{
|
|
837
|
-
block:
|
|
843
|
+
block: o,
|
|
838
844
|
context: e.context,
|
|
839
845
|
registeredComponents: e.registeredComponents,
|
|
840
846
|
linkComponent: e.linkComponent
|
|
841
847
|
},
|
|
842
|
-
|
|
848
|
+
o.id
|
|
843
849
|
))
|
|
844
850
|
}
|
|
845
851
|
) }) : null });
|
|
@@ -871,7 +877,7 @@ function Block(e) {
|
|
|
871
877
|
context: e.context
|
|
872
878
|
});
|
|
873
879
|
}
|
|
874
|
-
function
|
|
880
|
+
function i() {
|
|
875
881
|
var m;
|
|
876
882
|
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
877
883
|
block: e.block,
|
|
@@ -882,28 +888,28 @@ function Block(e) {
|
|
|
882
888
|
shouldEvaluateBindings: !0
|
|
883
889
|
});
|
|
884
890
|
}
|
|
885
|
-
function
|
|
891
|
+
function o() {
|
|
886
892
|
var g;
|
|
887
|
-
return e.block.tagName === "a" || ((g =
|
|
893
|
+
return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
888
894
|
}
|
|
889
895
|
function a() {
|
|
890
896
|
var b, y;
|
|
891
897
|
if ((b = e.block.repeat) != null && b.collection)
|
|
892
898
|
return !!((y = n == null ? void 0 : n()) != null && y.length);
|
|
893
|
-
const m = "hide" in
|
|
894
|
-
return ("show" in
|
|
899
|
+
const m = "hide" in i() ? i().hide : !1;
|
|
900
|
+
return ("show" in i() ? i().show : !0) && !m;
|
|
895
901
|
}
|
|
896
902
|
function r() {
|
|
897
903
|
var g, b;
|
|
898
|
-
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (b =
|
|
904
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (b = i().children) != null ? b : [] : [];
|
|
899
905
|
}
|
|
900
906
|
function s() {
|
|
901
907
|
var m, g, b, y, S, k, T, x, C, E, I;
|
|
902
908
|
return {
|
|
903
|
-
blockChildren: (m =
|
|
909
|
+
blockChildren: (m = i().children) != null ? m : [],
|
|
904
910
|
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
905
911
|
componentOptions: {
|
|
906
|
-
...getBlockComponentOptions(
|
|
912
|
+
...getBlockComponentOptions(i()),
|
|
907
913
|
builderContext: e.context,
|
|
908
914
|
...((b = t == null ? void 0 : t()) == null ? void 0 : b.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
|
|
909
915
|
builderLinkComponent: e.linkComponent
|
|
@@ -915,13 +921,13 @@ function Block(e) {
|
|
|
915
921
|
context: e.context,
|
|
916
922
|
linkComponent: e.linkComponent,
|
|
917
923
|
registeredComponents: e.registeredComponents,
|
|
918
|
-
builderBlock:
|
|
924
|
+
builderBlock: i(),
|
|
919
925
|
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
920
926
|
isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
|
|
921
927
|
};
|
|
922
928
|
}
|
|
923
929
|
return useEffect(() => {
|
|
924
|
-
const m =
|
|
930
|
+
const m = i().id, g = i().animations;
|
|
925
931
|
g && m && bindAnimations(
|
|
926
932
|
g.filter((b) => b.trigger !== "hover").map((b) => ({
|
|
927
933
|
...b,
|
|
@@ -955,8 +961,8 @@ function Block(e) {
|
|
|
955
961
|
)) }) : /* @__PURE__ */ jsxs(
|
|
956
962
|
BlockWrapper,
|
|
957
963
|
{
|
|
958
|
-
Wrapper:
|
|
959
|
-
block:
|
|
964
|
+
Wrapper: o(),
|
|
965
|
+
block: i(),
|
|
960
966
|
context: e.context,
|
|
961
967
|
linkComponent: e.linkComponent,
|
|
962
968
|
children: [
|
|
@@ -991,12 +997,12 @@ function Block(e) {
|
|
|
991
997
|
}
|
|
992
998
|
function BlocksWrapper(e) {
|
|
993
999
|
function t() {
|
|
994
|
-
var
|
|
995
|
-
return "builder-blocks" + ((
|
|
1000
|
+
var o;
|
|
1001
|
+
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
996
1002
|
}
|
|
997
1003
|
function n() {
|
|
998
|
-
var
|
|
999
|
-
isEditing() && !((
|
|
1004
|
+
var o, a;
|
|
1005
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
1000
1006
|
{
|
|
1001
1007
|
type: "builder.clickEmptyBlocks",
|
|
1002
1008
|
data: {
|
|
@@ -1007,9 +1013,9 @@ function BlocksWrapper(e) {
|
|
|
1007
1013
|
"*"
|
|
1008
1014
|
));
|
|
1009
1015
|
}
|
|
1010
|
-
function
|
|
1011
|
-
var
|
|
1012
|
-
isEditing() && !((
|
|
1016
|
+
function i() {
|
|
1017
|
+
var o, a;
|
|
1018
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
1013
1019
|
{
|
|
1014
1020
|
type: "builder.hoverEmptyBlocks",
|
|
1015
1021
|
data: {
|
|
@@ -1028,9 +1034,9 @@ function BlocksWrapper(e) {
|
|
|
1028
1034
|
"builder-path": e.path,
|
|
1029
1035
|
"builder-parent-id": e.parent,
|
|
1030
1036
|
style: e.styleProp,
|
|
1031
|
-
onClick: (
|
|
1032
|
-
onMouseEnter: (
|
|
1033
|
-
onKeyPress: (
|
|
1037
|
+
onClick: (o) => n(),
|
|
1038
|
+
onMouseEnter: (o) => i(),
|
|
1039
|
+
onKeyPress: (o) => n(),
|
|
1034
1040
|
...e.BlocksWrapperProps,
|
|
1035
1041
|
children: e.children
|
|
1036
1042
|
}
|
|
@@ -1043,7 +1049,7 @@ function BlocksWrapper(e) {
|
|
|
1043
1049
|
] });
|
|
1044
1050
|
}
|
|
1045
1051
|
function Blocks(e) {
|
|
1046
|
-
var
|
|
1052
|
+
var i, o, a;
|
|
1047
1053
|
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
1048
1054
|
return /* @__PURE__ */ jsx(
|
|
1049
1055
|
BlocksWrapper,
|
|
@@ -1052,8 +1058,8 @@ function Blocks(e) {
|
|
|
1052
1058
|
parent: e.parent,
|
|
1053
1059
|
path: e.path,
|
|
1054
1060
|
styleProp: e.styleProp,
|
|
1055
|
-
BlocksWrapper: ((
|
|
1056
|
-
BlocksWrapperProps: ((
|
|
1061
|
+
BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || t.BlocksWrapper,
|
|
1062
|
+
BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || t.BlocksWrapperProps,
|
|
1057
1063
|
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
|
|
1058
1064
|
Block,
|
|
1059
1065
|
{
|
|
@@ -1071,15 +1077,15 @@ function Columns(e) {
|
|
|
1071
1077
|
var T;
|
|
1072
1078
|
const [t, n] = useState(
|
|
1073
1079
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
1074
|
-
), [
|
|
1080
|
+
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
1075
1081
|
() => e.stackColumnsAt || "tablet"
|
|
1076
1082
|
);
|
|
1077
1083
|
function s(x) {
|
|
1078
1084
|
var C;
|
|
1079
|
-
return ((C =
|
|
1085
|
+
return ((C = i[x]) == null ? void 0 : C.width) || 100 / i.length;
|
|
1080
1086
|
}
|
|
1081
1087
|
function c(x) {
|
|
1082
|
-
const C = t * (
|
|
1088
|
+
const C = t * (i.length - 1) / i.length;
|
|
1083
1089
|
return `calc(${s(x)}% - ${C}px)`;
|
|
1084
1090
|
}
|
|
1085
1091
|
function l({
|
|
@@ -1171,10 +1177,10 @@ function Columns(e) {
|
|
|
1171
1177
|
/* @__PURE__ */ jsxs(
|
|
1172
1178
|
"div",
|
|
1173
1179
|
{
|
|
1174
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
1180
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,
|
|
1175
1181
|
style: b(),
|
|
1176
1182
|
children: [
|
|
1177
|
-
/* @__PURE__ */ jsx(InlinedStyles, { styles: k() }),
|
|
1183
|
+
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: k() }),
|
|
1178
1184
|
(T = e.columns) == null ? void 0 : T.map((x, C) => /* @__PURE__ */ jsx(
|
|
1179
1185
|
DynamicRenderer,
|
|
1180
1186
|
{
|
|
@@ -1207,7 +1213,7 @@ function Columns(e) {
|
|
|
1207
1213
|
]
|
|
1208
1214
|
}
|
|
1209
1215
|
),
|
|
1210
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
1216
|
+
/* @__PURE__ */ jsx("style", { children: `.div-003f4b1c {
|
|
1211
1217
|
display: flex;
|
|
1212
1218
|
line-height: normal;
|
|
1213
1219
|
}` })
|
|
@@ -1220,8 +1226,8 @@ function removeProtocol(e) {
|
|
|
1220
1226
|
return e.replace(/http(s)?:/, "");
|
|
1221
1227
|
}
|
|
1222
1228
|
function updateQueryParam(e = "", t, n) {
|
|
1223
|
-
const
|
|
1224
|
-
return e.match(
|
|
1229
|
+
const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
|
|
1230
|
+
return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
|
|
1225
1231
|
}
|
|
1226
1232
|
function getShopifyImageUrl(e, t) {
|
|
1227
1233
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
@@ -1230,8 +1236,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
1230
1236
|
return removeProtocol(e);
|
|
1231
1237
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1232
1238
|
if (n) {
|
|
1233
|
-
const
|
|
1234
|
-
return removeProtocol(`${
|
|
1239
|
+
const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
|
|
1240
|
+
return removeProtocol(`${i[0]}_${a}${o}`);
|
|
1235
1241
|
}
|
|
1236
1242
|
return null;
|
|
1237
1243
|
}
|
|
@@ -1241,13 +1247,13 @@ function getSrcSet(e) {
|
|
|
1241
1247
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
1242
1248
|
if (e.match(/builder\.io/)) {
|
|
1243
1249
|
let n = e;
|
|
1244
|
-
const
|
|
1245
|
-
return isNaN(
|
|
1250
|
+
const i = Number(e.split("?width=")[1]);
|
|
1251
|
+
return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
|
|
1246
1252
|
}
|
|
1247
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n,
|
|
1253
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
|
|
1248
1254
|
}
|
|
1249
1255
|
function Image(e) {
|
|
1250
|
-
var
|
|
1256
|
+
var o, a, r, s;
|
|
1251
1257
|
function t() {
|
|
1252
1258
|
var d;
|
|
1253
1259
|
const l = e.image || e.src;
|
|
@@ -1266,7 +1272,7 @@ function Image(e) {
|
|
|
1266
1272
|
var c;
|
|
1267
1273
|
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1268
1274
|
}
|
|
1269
|
-
function
|
|
1275
|
+
function i() {
|
|
1270
1276
|
const c = {
|
|
1271
1277
|
position: "absolute",
|
|
1272
1278
|
height: "100%",
|
|
@@ -1289,7 +1295,7 @@ function Image(e) {
|
|
|
1289
1295
|
style: {
|
|
1290
1296
|
objectPosition: e.backgroundPosition || "center",
|
|
1291
1297
|
objectFit: e.backgroundSize || "cover",
|
|
1292
|
-
...
|
|
1298
|
+
...i()
|
|
1293
1299
|
},
|
|
1294
1300
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
1295
1301
|
src: e.image,
|
|
@@ -1298,7 +1304,7 @@ function Image(e) {
|
|
|
1298
1304
|
}
|
|
1299
1305
|
)
|
|
1300
1306
|
] }),
|
|
1301
|
-
e.aspectRatio && !((a = (
|
|
1307
|
+
e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
|
|
1302
1308
|
"div",
|
|
1303
1309
|
{
|
|
1304
1310
|
className: "builder-image-sizer div-a0c95e8c",
|
|
@@ -1557,12 +1563,12 @@ const componentInfo$f = {
|
|
|
1557
1563
|
}],
|
|
1558
1564
|
onChange: (e) => {
|
|
1559
1565
|
function t() {
|
|
1560
|
-
n.forEach((
|
|
1561
|
-
|
|
1566
|
+
n.forEach((i) => {
|
|
1567
|
+
i.delete("width");
|
|
1562
1568
|
});
|
|
1563
1569
|
}
|
|
1564
1570
|
const n = e.get("columns");
|
|
1565
|
-
Array.isArray(n) && n.find((
|
|
1571
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1566
1572
|
}
|
|
1567
1573
|
}, {
|
|
1568
1574
|
name: "space",
|
|
@@ -1623,16 +1629,16 @@ const componentInfo$f = {
|
|
|
1623
1629
|
}, s);
|
|
1624
1630
|
});
|
|
1625
1631
|
}
|
|
1626
|
-
function
|
|
1632
|
+
function i(r) {
|
|
1627
1633
|
return Math.round(r * 1e3) / 1e3;
|
|
1628
1634
|
}
|
|
1629
|
-
const
|
|
1630
|
-
if (fetch(
|
|
1635
|
+
const o = e.get("image"), a = e.get("aspectRatio");
|
|
1636
|
+
if (fetch(o).then((r) => r.blob()).then((r) => {
|
|
1631
1637
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1632
|
-
}),
|
|
1633
|
-
return n(
|
|
1638
|
+
}), o && (!a || a === 0.7041))
|
|
1639
|
+
return n(o).then((r) => {
|
|
1634
1640
|
const s = e.get("aspectRatio");
|
|
1635
|
-
e.get("image") ===
|
|
1641
|
+
e.get("image") === o && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1636
1642
|
});
|
|
1637
1643
|
}
|
|
1638
1644
|
}, {
|
|
@@ -1744,7 +1750,7 @@ const componentInfo$f = {
|
|
|
1744
1750
|
}]
|
|
1745
1751
|
};
|
|
1746
1752
|
function Slot(e) {
|
|
1747
|
-
var t, n,
|
|
1753
|
+
var t, n, i;
|
|
1748
1754
|
return /* @__PURE__ */ jsx(
|
|
1749
1755
|
"div",
|
|
1750
1756
|
{
|
|
@@ -1760,7 +1766,7 @@ function Slot(e) {
|
|
|
1760
1766
|
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1761
1767
|
path: `symbol.data.${e.name}`,
|
|
1762
1768
|
context: e.builderContext,
|
|
1763
|
-
blocks: (
|
|
1769
|
+
blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
|
|
1764
1770
|
}
|
|
1765
1771
|
)
|
|
1766
1772
|
}
|
|
@@ -1855,7 +1861,7 @@ const componentInfo$7 = {
|
|
|
1855
1861
|
}]
|
|
1856
1862
|
};
|
|
1857
1863
|
function CustomCode(e) {
|
|
1858
|
-
const t = useRef(null), [n,
|
|
1864
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1859
1865
|
return useEffect(() => {
|
|
1860
1866
|
var s;
|
|
1861
1867
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
|
|
@@ -1874,10 +1880,10 @@ function CustomCode(e) {
|
|
|
1874
1880
|
"application/javascript",
|
|
1875
1881
|
"application/ecmascript"
|
|
1876
1882
|
].includes(l.type)) {
|
|
1877
|
-
if (
|
|
1883
|
+
if (o.includes(l.innerText))
|
|
1878
1884
|
continue;
|
|
1879
1885
|
try {
|
|
1880
|
-
|
|
1886
|
+
o.push(l.innerText), new Function(l.innerText)();
|
|
1881
1887
|
} catch (d) {
|
|
1882
1888
|
console.warn("`CustomCode`: Error running script:", d);
|
|
1883
1889
|
}
|
|
@@ -1904,9 +1910,9 @@ const componentInfo$6 = {
|
|
|
1904
1910
|
onChange: (e) => {
|
|
1905
1911
|
const t = e.get("url");
|
|
1906
1912
|
if (t)
|
|
1907
|
-
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((
|
|
1908
|
-
e.get("url") === t && (
|
|
1909
|
-
}).catch((
|
|
1913
|
+
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
|
|
1914
|
+
e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
|
|
1915
|
+
}).catch((i) => {
|
|
1910
1916
|
e.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
1911
1917
|
});
|
|
1912
1918
|
e.delete("content");
|
|
@@ -1919,7 +1925,7 @@ const componentInfo$6 = {
|
|
|
1919
1925
|
}]
|
|
1920
1926
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1921
1927
|
function Embed(e) {
|
|
1922
|
-
const t = useRef(null), [n,
|
|
1928
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
|
|
1923
1929
|
function c() {
|
|
1924
1930
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1925
1931
|
return;
|
|
@@ -1930,9 +1936,9 @@ function Embed(e) {
|
|
|
1930
1936
|
n.push(m.src);
|
|
1931
1937
|
const g = document.createElement("script");
|
|
1932
1938
|
g.async = !0, g.src = m.src, document.head.appendChild(g);
|
|
1933
|
-
} else if (isJsScript(m) && !
|
|
1939
|
+
} else if (isJsScript(m) && !o.includes(m.innerText))
|
|
1934
1940
|
try {
|
|
1935
|
-
|
|
1941
|
+
o.push(m.innerText), new Function(m.innerText)();
|
|
1936
1942
|
} catch (g) {
|
|
1937
1943
|
console.warn("`Embed`: Error running script:", g);
|
|
1938
1944
|
}
|
|
@@ -2184,12 +2190,12 @@ const componentInfo$5 = {
|
|
|
2184
2190
|
const e = process.env.NODE_ENV || "production";
|
|
2185
2191
|
return validEnvList.includes(e) ? e : "production";
|
|
2186
2192
|
}, get = (e, t, n) => {
|
|
2187
|
-
const
|
|
2188
|
-
return
|
|
2193
|
+
const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, a) => o != null ? o[a] : o, e);
|
|
2194
|
+
return i === void 0 || i === e ? n : i;
|
|
2189
2195
|
};
|
|
2190
2196
|
function FormComponent(e) {
|
|
2191
2197
|
var m, g;
|
|
2192
|
-
const t = useRef(null), [n,
|
|
2198
|
+
const t = useRef(null), [n, i] = useState(() => "unsubmitted"), [o, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2193
2199
|
function c(b) {
|
|
2194
2200
|
var S, k;
|
|
2195
2201
|
const y = {
|
|
@@ -2255,7 +2261,7 @@ function FormComponent(e) {
|
|
|
2255
2261
|
const P = new CustomEvent("presubmit", { detail: { body: x } });
|
|
2256
2262
|
if (t.current && (t.current.dispatchEvent(P), P.defaultPrevented))
|
|
2257
2263
|
return;
|
|
2258
|
-
|
|
2264
|
+
i("sending");
|
|
2259
2265
|
const B = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2260
2266
|
e.sendSubmissionsToEmail || ""
|
|
2261
2267
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
@@ -2270,7 +2276,7 @@ function FormComponent(e) {
|
|
|
2270
2276
|
let h = get(f, e.errorMessagePath);
|
|
2271
2277
|
h && (typeof h != "string" && (h = JSON.stringify(h)), s(h), c({ formErrorMessage: h }));
|
|
2272
2278
|
}
|
|
2273
|
-
if (a(f),
|
|
2279
|
+
if (a(f), i(u.ok ? "success" : "error"), u.ok) {
|
|
2274
2280
|
const h = new CustomEvent("submit:success", {
|
|
2275
2281
|
detail: { res: u, body: f }
|
|
2276
2282
|
});
|
|
@@ -2293,7 +2299,7 @@ function FormComponent(e) {
|
|
|
2293
2299
|
const f = new CustomEvent("submit:error", {
|
|
2294
2300
|
detail: { error: u }
|
|
2295
2301
|
});
|
|
2296
|
-
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(u),
|
|
2302
|
+
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(u), i("error"));
|
|
2297
2303
|
}
|
|
2298
2304
|
);
|
|
2299
2305
|
}
|
|
@@ -2337,7 +2343,7 @@ function FormComponent(e) {
|
|
|
2337
2343
|
context: e.builderContext
|
|
2338
2344
|
}
|
|
2339
2345
|
) : null,
|
|
2340
|
-
l() === "error" &&
|
|
2346
|
+
l() === "error" && o ? /* @__PURE__ */ jsx("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(o, null, 2) }) : null,
|
|
2341
2347
|
l() === "success" ? /* @__PURE__ */ jsx(
|
|
2342
2348
|
Blocks,
|
|
2343
2349
|
{
|
|
@@ -2620,7 +2626,7 @@ const componentInfo = {
|
|
|
2620
2626
|
}]
|
|
2621
2627
|
};
|
|
2622
2628
|
function Video(e) {
|
|
2623
|
-
var
|
|
2629
|
+
var i, o, a, r, s, c, l;
|
|
2624
2630
|
function t() {
|
|
2625
2631
|
return {
|
|
2626
2632
|
...e.autoPlay === !0 ? {
|
|
@@ -2661,7 +2667,7 @@ function Video(e) {
|
|
|
2661
2667
|
style: {
|
|
2662
2668
|
width: "100%",
|
|
2663
2669
|
height: "100%",
|
|
2664
|
-
...(
|
|
2670
|
+
...(i = e.attributes) == null ? void 0 : i.style,
|
|
2665
2671
|
objectFit: e.fit,
|
|
2666
2672
|
objectPosition: e.position,
|
|
2667
2673
|
// Hack to get object fit to work as expected and
|
|
@@ -2677,7 +2683,7 @@ function Video(e) {
|
|
|
2677
2683
|
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
2678
2684
|
}
|
|
2679
2685
|
),
|
|
2680
|
-
e.aspectRatio && !(e.fitContent && ((a = (
|
|
2686
|
+
e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(
|
|
2681
2687
|
"div",
|
|
2682
2688
|
{
|
|
2683
2689
|
style: {
|
|
@@ -2865,7 +2871,7 @@ const getExtraComponents = () => [{
|
|
|
2865
2871
|
})), checkShouldRenderVariants = ({
|
|
2866
2872
|
canTrack: e,
|
|
2867
2873
|
content: t
|
|
2868
|
-
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET),
|
|
2874
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getInitVariantsFnsScriptString = () => `
|
|
2869
2875
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2870
2876
|
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2871
2877
|
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
@@ -2882,7 +2888,7 @@ function InlinedScript(e) {
|
|
|
2882
2888
|
"script",
|
|
2883
2889
|
{
|
|
2884
2890
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
2885
|
-
id: e.id
|
|
2891
|
+
"data-id": e.id
|
|
2886
2892
|
}
|
|
2887
2893
|
);
|
|
2888
2894
|
}
|
|
@@ -2892,13 +2898,13 @@ function round(e) {
|
|
|
2892
2898
|
const findParentElement = (e, t, n = !0) => {
|
|
2893
2899
|
if (!(e instanceof HTMLElement))
|
|
2894
2900
|
return null;
|
|
2895
|
-
let
|
|
2901
|
+
let i = n ? e : e.parentElement;
|
|
2896
2902
|
do {
|
|
2897
|
-
if (!
|
|
2903
|
+
if (!i)
|
|
2898
2904
|
return null;
|
|
2899
|
-
if (t(
|
|
2900
|
-
return
|
|
2901
|
-
} while (
|
|
2905
|
+
if (t(i))
|
|
2906
|
+
return i;
|
|
2907
|
+
} while (i = i.parentElement);
|
|
2902
2908
|
return null;
|
|
2903
2909
|
}, findBuilderParent = (e) => findParentElement(e, (t) => {
|
|
2904
2910
|
const n = t.getAttribute("builder-id") || t.id;
|
|
@@ -2907,15 +2913,15 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2907
2913
|
event: e,
|
|
2908
2914
|
target: t
|
|
2909
2915
|
}) => {
|
|
2910
|
-
const n = t.getBoundingClientRect(),
|
|
2916
|
+
const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
|
|
2911
2917
|
return {
|
|
2912
2918
|
x: a,
|
|
2913
2919
|
y: r
|
|
2914
2920
|
};
|
|
2915
2921
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
2916
|
-
const t = e.target, n = t && findBuilderParent(t),
|
|
2922
|
+
const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2917
2923
|
return {
|
|
2918
|
-
targetBuilderElement:
|
|
2924
|
+
targetBuilderElement: i || void 0,
|
|
2919
2925
|
metadata: {
|
|
2920
2926
|
targetOffset: t ? computeOffset({
|
|
2921
2927
|
event: e,
|
|
@@ -2925,7 +2931,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2925
2931
|
event: e,
|
|
2926
2932
|
target: n
|
|
2927
2933
|
}) : void 0,
|
|
2928
|
-
builderElementIndex: n &&
|
|
2934
|
+
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2929
2935
|
}
|
|
2930
2936
|
};
|
|
2931
2937
|
};
|
|
@@ -2943,7 +2949,7 @@ function EnableEditor(e) {
|
|
|
2943
2949
|
rootState: f
|
|
2944
2950
|
}));
|
|
2945
2951
|
}
|
|
2946
|
-
function
|
|
2952
|
+
function i(u) {
|
|
2947
2953
|
var p, h, v, w, j;
|
|
2948
2954
|
const f = {
|
|
2949
2955
|
...e.builderContextSignal.content,
|
|
@@ -2963,7 +2969,7 @@ function EnableEditor(e) {
|
|
|
2963
2969
|
content: f
|
|
2964
2970
|
}));
|
|
2965
2971
|
}
|
|
2966
|
-
const [
|
|
2972
|
+
const [o, a] = useState(
|
|
2967
2973
|
() => e.contentWrapper || "div"
|
|
2968
2974
|
);
|
|
2969
2975
|
function r(u) {
|
|
@@ -2974,7 +2980,7 @@ function EnableEditor(e) {
|
|
|
2974
2980
|
configureSdk: (f) => {
|
|
2975
2981
|
var v;
|
|
2976
2982
|
const { breakpoints: p, contentId: h } = f;
|
|
2977
|
-
!h || h !== ((v = e.builderContextSignal.content) == null ? void 0 : v.id) || p &&
|
|
2983
|
+
!h || h !== ((v = e.builderContextSignal.content) == null ? void 0 : v.id) || p && i({
|
|
2978
2984
|
meta: {
|
|
2979
2985
|
breakpoints: p
|
|
2980
2986
|
}
|
|
@@ -2984,7 +2990,7 @@ function EnableEditor(e) {
|
|
|
2984
2990
|
triggerAnimation(f);
|
|
2985
2991
|
},
|
|
2986
2992
|
contentUpdate: (f) => {
|
|
2987
|
-
|
|
2993
|
+
i(f);
|
|
2988
2994
|
}
|
|
2989
2995
|
}
|
|
2990
2996
|
})(u);
|
|
@@ -3117,7 +3123,7 @@ function EnableEditor(e) {
|
|
|
3117
3123
|
apiKey: e.apiKey,
|
|
3118
3124
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3119
3125
|
}).then((A) => {
|
|
3120
|
-
A &&
|
|
3126
|
+
A && i(A);
|
|
3121
3127
|
});
|
|
3122
3128
|
}
|
|
3123
3129
|
}
|
|
@@ -3126,7 +3132,7 @@ function EnableEditor(e) {
|
|
|
3126
3132
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3127
3133
|
), s(), S(), k();
|
|
3128
3134
|
}, []), useEffect(() => {
|
|
3129
|
-
e.content &&
|
|
3135
|
+
e.content && i(e.content);
|
|
3130
3136
|
}, [e.content]), useEffect(() => {
|
|
3131
3137
|
s();
|
|
3132
3138
|
}, [(x = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : x.jsCode]), useEffect(() => {
|
|
@@ -3145,7 +3151,7 @@ function EnableEditor(e) {
|
|
|
3145
3151
|
k
|
|
3146
3152
|
));
|
|
3147
3153
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
|
|
3148
|
-
|
|
3154
|
+
o,
|
|
3149
3155
|
{
|
|
3150
3156
|
ref: t,
|
|
3151
3157
|
onClick: (u) => g(u),
|
|
@@ -3163,12 +3169,12 @@ function EnableEditor(e) {
|
|
|
3163
3169
|
}
|
|
3164
3170
|
const getCssFromFont = (e) => {
|
|
3165
3171
|
var a, r;
|
|
3166
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0],
|
|
3167
|
-
let
|
|
3168
|
-
if (
|
|
3172
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
|
|
3173
|
+
let o = "";
|
|
3174
|
+
if (i && t && n && (o += `
|
|
3169
3175
|
@font-face {
|
|
3170
3176
|
font-family: "${t}";
|
|
3171
|
-
src: local("${n}"), url('${
|
|
3177
|
+
src: local("${n}"), url('${i}') format('woff2');
|
|
3172
3178
|
font-display: fallback;
|
|
3173
3179
|
font-weight: 400;
|
|
3174
3180
|
}
|
|
@@ -3177,7 +3183,7 @@ font-weight: 400;
|
|
|
3177
3183
|
if (!(String(Number(s)) === s))
|
|
3178
3184
|
continue;
|
|
3179
3185
|
const l = e.files[s];
|
|
3180
|
-
l && l !==
|
|
3186
|
+
l && l !== i && (o += `
|
|
3181
3187
|
@font-face {
|
|
3182
3188
|
font-family: "${t}";
|
|
3183
3189
|
src: url('${l}') format('woff2');
|
|
@@ -3186,7 +3192,7 @@ font-weight: ${s};
|
|
|
3186
3192
|
}
|
|
3187
3193
|
`.trim());
|
|
3188
3194
|
}
|
|
3189
|
-
return
|
|
3195
|
+
return o;
|
|
3190
3196
|
}, getFontCss = ({
|
|
3191
3197
|
customFonts: e
|
|
3192
3198
|
}) => {
|
|
@@ -3226,7 +3232,7 @@ ${getFontCss({
|
|
|
3226
3232
|
${getDefaultStyles(e.isNestedRender)}
|
|
3227
3233
|
`.trim()
|
|
3228
3234
|
);
|
|
3229
|
-
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
3235
|
+
return /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-content", styles: t });
|
|
3230
3236
|
}
|
|
3231
3237
|
const getRootStateInitialValue = ({
|
|
3232
3238
|
content: e,
|
|
@@ -3234,12 +3240,12 @@ const getRootStateInitialValue = ({
|
|
|
3234
3240
|
locale: n
|
|
3235
3241
|
}) => {
|
|
3236
3242
|
var a, r, s;
|
|
3237
|
-
const
|
|
3243
|
+
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
3238
3244
|
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
|
|
3239
|
-
c.name && c.defaultValue !== void 0 && (
|
|
3245
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
3240
3246
|
}), {
|
|
3241
|
-
...o,
|
|
3242
3247
|
...i,
|
|
3248
|
+
...o,
|
|
3243
3249
|
...t,
|
|
3244
3250
|
...n ? {
|
|
3245
3251
|
locale: n
|
|
@@ -3269,13 +3275,13 @@ function ContentComponent(e) {
|
|
|
3269
3275
|
});
|
|
3270
3276
|
}
|
|
3271
3277
|
);
|
|
3272
|
-
function
|
|
3278
|
+
function i(S) {
|
|
3273
3279
|
s((k) => ({
|
|
3274
3280
|
...k,
|
|
3275
3281
|
rootState: S
|
|
3276
3282
|
}));
|
|
3277
3283
|
}
|
|
3278
|
-
const [
|
|
3284
|
+
const [o, a] = useState(
|
|
3279
3285
|
() => [
|
|
3280
3286
|
...getDefaultRegisteredComponents(),
|
|
3281
3287
|
...e.customComponents || []
|
|
@@ -3300,7 +3306,7 @@ function ContentComponent(e) {
|
|
|
3300
3306
|
data: e.data,
|
|
3301
3307
|
locale: e.locale
|
|
3302
3308
|
}),
|
|
3303
|
-
rootSetState:
|
|
3309
|
+
rootSetState: i,
|
|
3304
3310
|
context: e.context || {},
|
|
3305
3311
|
apiKey: e.apiKey,
|
|
3306
3312
|
apiVersion: e.apiVersion,
|
|
@@ -3322,7 +3328,7 @@ function ContentComponent(e) {
|
|
|
3322
3328
|
ComponentsContext.Provider,
|
|
3323
3329
|
{
|
|
3324
3330
|
value: {
|
|
3325
|
-
registeredComponents:
|
|
3331
|
+
registeredComponents: o
|
|
3326
3332
|
},
|
|
3327
3333
|
children: /* @__PURE__ */ jsxs(
|
|
3328
3334
|
EnableEditor,
|
|
@@ -3343,7 +3349,13 @@ function ContentComponent(e) {
|
|
|
3343
3349
|
trustedHosts: e.trustedHosts,
|
|
3344
3350
|
setBuilderContextSignal: s,
|
|
3345
3351
|
children: [
|
|
3346
|
-
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3352
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3353
|
+
InlinedScript,
|
|
3354
|
+
{
|
|
3355
|
+
id: "builderio-variant-visibility",
|
|
3356
|
+
scriptStr: t
|
|
3357
|
+
}
|
|
3358
|
+
) : null,
|
|
3347
3359
|
/* @__PURE__ */ jsx(
|
|
3348
3360
|
ContentStyles,
|
|
3349
3361
|
{
|
|
@@ -3358,7 +3370,7 @@ function ContentComponent(e) {
|
|
|
3358
3370
|
{
|
|
3359
3371
|
blocks: (y = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : y.blocks,
|
|
3360
3372
|
context: r,
|
|
3361
|
-
registeredComponents:
|
|
3373
|
+
registeredComponents: o,
|
|
3362
3374
|
linkComponent: e.linkComponent
|
|
3363
3375
|
}
|
|
3364
3376
|
)
|
|
@@ -3369,31 +3381,31 @@ function ContentComponent(e) {
|
|
|
3369
3381
|
);
|
|
3370
3382
|
}
|
|
3371
3383
|
function ContentVariants(e) {
|
|
3372
|
-
var r
|
|
3384
|
+
var r;
|
|
3373
3385
|
const [t, n] = useState(
|
|
3374
3386
|
() => checkShouldRenderVariants({
|
|
3375
3387
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3376
3388
|
content: e.content
|
|
3377
3389
|
})
|
|
3378
3390
|
);
|
|
3379
|
-
function
|
|
3380
|
-
var
|
|
3391
|
+
function i() {
|
|
3392
|
+
var s;
|
|
3381
3393
|
return getUpdateCookieAndStylesScript(
|
|
3382
|
-
getVariants(e.content).map((
|
|
3383
|
-
id:
|
|
3384
|
-
testRatio:
|
|
3394
|
+
getVariants(e.content).map((c) => ({
|
|
3395
|
+
id: c.testVariationId,
|
|
3396
|
+
testRatio: c.testRatio
|
|
3385
3397
|
})),
|
|
3386
|
-
((
|
|
3398
|
+
((s = e.content) == null ? void 0 : s.id) || ""
|
|
3387
3399
|
);
|
|
3388
3400
|
}
|
|
3389
|
-
function
|
|
3390
|
-
return getVariants(e.content).map((
|
|
3401
|
+
function o() {
|
|
3402
|
+
return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
|
|
3391
3403
|
}
|
|
3392
3404
|
function a() {
|
|
3393
|
-
var
|
|
3405
|
+
var s;
|
|
3394
3406
|
return t ? {
|
|
3395
3407
|
...e.content,
|
|
3396
|
-
testVariationId: (
|
|
3408
|
+
testVariationId: (s = e.content) == null ? void 0 : s.id
|
|
3397
3409
|
} : handleABTestingSync({
|
|
3398
3410
|
item: e.content,
|
|
3399
3411
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -3401,21 +3413,33 @@ function ContentVariants(e) {
|
|
|
3401
3413
|
}
|
|
3402
3414
|
return useEffect(() => {
|
|
3403
3415
|
}, []), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3404
|
-
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
|
|
3416
|
+
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
|
|
3417
|
+
InlinedScript,
|
|
3418
|
+
{
|
|
3419
|
+
id: "builderio-init-variants-fns",
|
|
3420
|
+
scriptStr: getInitVariantsFnsScriptString()
|
|
3421
|
+
}
|
|
3422
|
+
) : null,
|
|
3405
3423
|
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3406
3424
|
/* @__PURE__ */ jsx(
|
|
3407
3425
|
InlinedStyles,
|
|
3408
3426
|
{
|
|
3409
|
-
id:
|
|
3410
|
-
styles:
|
|
3427
|
+
id: "builderio-variants",
|
|
3428
|
+
styles: o()
|
|
3429
|
+
}
|
|
3430
|
+
),
|
|
3431
|
+
/* @__PURE__ */ jsx(
|
|
3432
|
+
InlinedScript,
|
|
3433
|
+
{
|
|
3434
|
+
id: "builderio-variants-visibility",
|
|
3435
|
+
scriptStr: i()
|
|
3411
3436
|
}
|
|
3412
3437
|
),
|
|
3413
|
-
|
|
3414
|
-
(s = getVariants(e.content)) == null ? void 0 : s.map((c) => /* @__PURE__ */ jsx(
|
|
3438
|
+
(r = getVariants(e.content)) == null ? void 0 : r.map((s) => /* @__PURE__ */ jsx(
|
|
3415
3439
|
ContentComponent,
|
|
3416
3440
|
{
|
|
3417
3441
|
isNestedRender: e.isNestedRender,
|
|
3418
|
-
content:
|
|
3442
|
+
content: s,
|
|
3419
3443
|
showContent: !1,
|
|
3420
3444
|
model: e.model,
|
|
3421
3445
|
data: e.data,
|
|
@@ -3434,7 +3458,7 @@ function ContentVariants(e) {
|
|
|
3434
3458
|
contentWrapperProps: e.contentWrapperProps,
|
|
3435
3459
|
trustedHosts: e.trustedHosts
|
|
3436
3460
|
},
|
|
3437
|
-
|
|
3461
|
+
s.testVariationId
|
|
3438
3462
|
))
|
|
3439
3463
|
] }) : null,
|
|
3440
3464
|
/* @__PURE__ */ jsx(
|
|
@@ -3493,21 +3517,21 @@ function Symbol$1(e) {
|
|
|
3493
3517
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3494
3518
|
].filter(Boolean).join(" ");
|
|
3495
3519
|
}
|
|
3496
|
-
const [n,
|
|
3520
|
+
const [n, i] = useState(() => {
|
|
3497
3521
|
var l;
|
|
3498
3522
|
return (l = e.symbol) == null ? void 0 : l.content;
|
|
3499
3523
|
});
|
|
3500
|
-
function
|
|
3524
|
+
function o() {
|
|
3501
3525
|
n || fetchSymbolContent({
|
|
3502
3526
|
symbol: e.symbol,
|
|
3503
3527
|
builderContextValue: e.builderContext
|
|
3504
3528
|
}).then((l) => {
|
|
3505
|
-
l &&
|
|
3529
|
+
l && i(l);
|
|
3506
3530
|
});
|
|
3507
3531
|
}
|
|
3508
3532
|
return useEffect(() => {
|
|
3509
3533
|
}, []), useEffect(() => {
|
|
3510
|
-
|
|
3534
|
+
o();
|
|
3511
3535
|
}, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
3512
3536
|
ContentVariants,
|
|
3513
3537
|
{
|