@builder.io/sdk-react 4.0.8 → 4.0.10
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 +92 -64
- package/lib/browser/blocks-exports.mjs +1765 -1650
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-6a0d3985.cjs +2 -0
- package/lib/{edge/server-entry-e9974799.js → browser/server-entry-a97b474c.js} +272 -265
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-8ef468e5.js → accordion-39aaa10f.js} +1 -1
- package/lib/edge/{accordion-94839d7d.cjs → accordion-f19408f1.cjs} +1 -1
- package/lib/edge/{blocks-548ec8c2.js → blocks-204bcb03.js} +179 -176
- package/lib/edge/{blocks-7e8837dc.cjs → blocks-bd4d19a4.cjs} +3 -3
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-66c37b9c.cjs → button-39adadab.cjs} +1 -1
- package/lib/edge/{button-09f38c2e.js → button-eb4a1fce.js} +2 -2
- package/lib/edge/{columns-67ded4b4.cjs → columns-3954e4e2.cjs} +3 -3
- package/lib/edge/{columns-42cbe467.js → columns-d3cef236.js} +9 -9
- package/lib/edge/content-variants-0c41aa3b.cjs +302 -0
- package/lib/edge/{content-variants-5a4eecaf.js → content-variants-68bbb30c.js} +650 -367
- package/lib/edge/{custom-code-ea534e98.cjs → custom-code-eded3b35.cjs} +1 -1
- package/lib/edge/{custom-code-cf216b27.js → custom-code-f8374f7b.js} +1 -1
- package/lib/edge/{embed-12b85639.js → embed-2b4ce9d5.js} +1 -1
- package/lib/edge/{embed-7ca4af6e.cjs → embed-44dee332.cjs} +1 -1
- package/lib/edge/form-1493caf1.cjs +1 -0
- package/lib/edge/form-9faf63c9.js +178 -0
- package/lib/edge/{get-class-prop-name-316a93c9.cjs → get-class-prop-name-a9265175.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-90df5962.js → get-class-prop-name-cc48fc17.js} +1 -1
- package/lib/edge/{image-e38bd9e0.cjs → image-cce92f6c.cjs} +2 -2
- package/lib/edge/{image-acc1c00c.js → image-d87761af.js} +18 -18
- package/lib/edge/{img-ee2838af.js → img-58c08dd4.js} +1 -1
- package/lib/edge/{img-81a7f4d7.cjs → img-b8d85bad.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-b8907c7d.js → input-a7c01b3a.js} +1 -1
- package/lib/edge/{input-231ec63f.cjs → input-d988f887.cjs} +1 -1
- package/lib/edge/personalization-container-2f2bfa1b.cjs +1 -0
- package/lib/edge/personalization-container-9ae00624.js +208 -0
- package/lib/edge/{select-b1650a75.cjs → select-03b307f2.cjs} +1 -1
- package/lib/edge/{select-ffee7a69.js → select-4f03decc.js} +1 -1
- package/lib/{node/server-entry-2b91f2d9.js → edge/server-entry-0fe1fd76.js} +306 -303
- package/lib/edge/server-entry-e13b9b35.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-ddddba8d.cjs → slot-125b0593.cjs} +1 -1
- package/lib/edge/{slot-fe93ec42.js → slot-ff90c844.js} +3 -3
- package/lib/edge/{symbol-c266ba83.js → symbol-7558aa24.js} +2 -2
- package/lib/edge/{symbol-d9175a66.cjs → symbol-da3ec542.cjs} +1 -1
- package/lib/edge/{tabs-f76f757a.cjs → tabs-3cf7cfd3.cjs} +1 -1
- package/lib/edge/{tabs-3481a6f6.js → tabs-a9e56d82.js} +3 -3
- package/lib/node/blocks-exports.cjs +92 -64
- package/lib/node/blocks-exports.mjs +1675 -1560
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/{browser/server-entry-d0b98fb0.js → node/server-entry-23f9b44b.js} +205 -199
- package/lib/node/server-entry-ceef853b.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-26e766c5.cjs → setIvm-71bce8c3.cjs} +1 -1
- package/lib/node/{setIvm-419a94e0.js → setIvm-b29cbc40.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-67506521.js → should-force-browser-runtime-in-node-5a2ea9eb.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-fe3d9cb0.cjs → should-force-browser-runtime-in-node-e0147364.cjs} +1 -1
- package/package.json +2 -2
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
- package/types/blocks/personalization-container/helpers.d.ts +24 -4
- package/types/blocks/personalization-container/personalization-container.types.d.ts +2 -2
- package/types/components/blocks/blocks-wrapper.d.ts +13 -1
- package/types/components/blocks/blocks.types.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/no-serialize-wrapper.d.ts +1 -0
- package/types/helpers/user-attributes.d.ts +6 -2
- package/lib/browser/server-entry-8ea5d047.cjs +0 -2
- package/lib/edge/content-variants-cf107f82.cjs +0 -137
- package/lib/edge/form-85ea06df.cjs +0 -1
- package/lib/edge/form-f1188ad2.js +0 -166
- package/lib/edge/personalization-container-896a298a.js +0 -384
- package/lib/edge/personalization-container-95cba946.cjs +0 -138
- package/lib/edge/server-entry-1b560ddb.cjs +0 -2
- package/lib/node/server-entry-03fc1c6d.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),n=require("react"),l=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),n=require("react"),l=require("./server-entry-e13b9b35.cjs");function f(c){const r=n.useRef(null),[i,m]=n.useState(()=>[]),[u,g]=n.useState(()=>[]);function o(){var d;if(!r.current||!((d=r.current)!=null&&d.getElementsByTagName)||typeof window=="undefined")return;const a=r.current.getElementsByTagName("script");for(let s=0;s<a.length;s++){const e=a[s];if(e.src){if(i.includes(e.src))continue;i.push(e.src);const t=document.createElement("script");t.async=!0,t.src=e.src,document.head.appendChild(t)}else if(!e.type||["text/javascript","application/javascript","application/ecmascript"].includes(e.type)){if(u.includes(e.innerText))continue;try{u.push(e.innerText),new Function(e.innerText)()}catch(t){l.logger.warn("[BUILDER.IO] `CustomCode`: Error running script:",t)}}}}return n.useEffect(()=>{o()},[]),n.useEffect(()=>{l.isEditing()&&o()},[c.code]),p.jsx("div",{ref:r,className:"builder-custom-code"+(c.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:c.code}})}exports.default=f;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as f, useState as p, useEffect as d } from "react";
|
|
3
|
-
import { isEditing as m, logger as g } from "./server-entry-
|
|
3
|
+
import { isEditing as m, logger as g } from "./server-entry-0fe1fd76.js";
|
|
4
4
|
function T(r) {
|
|
5
5
|
const n = f(null), [s, y] = p(() => []), [i, h] = p(() => []);
|
|
6
6
|
function o() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as d, useState as c, useEffect as f } from "react";
|
|
3
|
-
import { logger as E } from "./server-entry-
|
|
3
|
+
import { logger as E } from "./server-entry-0fe1fd76.js";
|
|
4
4
|
const g = ["text/javascript", "application/javascript", "application/ecmascript"], I = (r) => g.includes(r.type);
|
|
5
5
|
function y(r) {
|
|
6
6
|
const e = d(null), [i, S] = c(() => []), [u, T] = c(() => []), [o, p] = c(() => !1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),r=require("react"),m=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),r=require("react"),m=require("./server-entry-e13b9b35.cjs"),f=["text/javascript","application/javascript","application/ecmascript"],S=s=>f.includes(s.type);function g(s){const t=r.useRef(null),[i,E]=r.useState(()=>[]),[u,y]=r.useState(()=>[]),[a,l]=r.useState(()=>!1);function p(){if(!t.current||!t.current.getElementsByTagName)return;const o=t.current.getElementsByTagName("script");for(let c=0;c<o.length;c++){const e=o[c];if(e.src&&!i.includes(e.src)){i.push(e.src);const n=document.createElement("script");n.async=!0,n.src=e.src,document.head.appendChild(n)}else if(S(e)&&!u.includes(e.innerText))try{u.push(e.innerText),new Function(e.innerText)()}catch(n){m.logger.warn("[BUILDER.IO] `Embed`: Error running script:",n)}}}return r.useEffect(()=>{t.current&&!a&&(l(!0),p())},[t.current,a]),d.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:s.content}})}exports.default=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),S=require("react"),h=require("./blocks-bd4d19a4.cjs"),q=require("./server-entry-e13b9b35.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-a9265175.cjs");require("./dynamic-renderer-b29b45ca.cjs");const A=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],O=()=>{const e=process.env.NODE_ENV||"production";return A.includes(e)?e:"production"};function R(e){const r=S.useRef(null),[w,u]=S.useState(()=>"unsubmitted"),[y,E]=S.useState(()=>null),[J,F]=S.useState(()=>"");function x(s){var m,d;const l={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(d=(m=e.builderContext).rootSetState)==null||d.call(m,l):e.builderContext.rootState=l}function g(){return q.isEditing()&&e.previewState||w}function N(s){var m;const l=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(l){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const d=s.currentTarget||s.target,T=e.customHeaders||{};let v;const P=new FormData(d),C=Array.from(d.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const a=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:a,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const f=t.valueAsNumber;isNaN(f)||(n=f)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:a,value:n}});let c=e.contentType;if(e.sendSubmissionsTo==="email"&&(c="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(c="multipart/form-data")}),c!=="application/json")v=P;else{const t={};Array.from(C).forEach(({value:n,key:a})=>{h.set(t,a,n)}),v=JSON.stringify(t)}c&&c!=="multipart/form-data"&&(l&&((m=e.action)!=null&&m.includes("zapier.com"))||(T["content-type"]=c));const k=new CustomEvent("presubmit",{detail:{body:v}});if(r.current&&(r.current.dispatchEvent(k),k.defaultPrevented))return;if(u("sending"),e.sendSubmissionsTo==="email"&&(e.sendSubmissionsToEmail==="your@email.com"||!e.sendSubmissionsToEmail)){const t="SubmissionsToEmail is required when sendSubmissionsTo is set to email";console.error(t),u("error"),x({formErrorMessage:t});return}const D=`${O()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,M=e.sendSubmissionsTo==="email"?D:e.action;q.logFetch(M),fetch(M,{body:v,headers:T,method:e.method||"post"}).then(async t=>{var f,j;let n;const a=t.headers.get("content-type");if(a&&a.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok){const b=new CustomEvent("submit:error",{detail:{error:n,status:t.status}});if((f=r.current)!=null&&f.nativeElement&&((j=r.current)==null||j.nativeElement.dispatchEvent(b),b.defaultPrevented))return;E(n),u("error");let i=e.errorMessagePath?h.get(n,e.errorMessagePath):n.message||n.error||n;typeof i!="string"&&(i=JSON.stringify(i)),F(i),x({formErrorMessage:i});return}if(E(n),u(t.ok?"success":"error"),t.ok){const b=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(r.current){if(r.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&r.current.reset()}if(e.successUrl)if(r.current){const i=new CustomEvent("route",{detail:{url:e.successUrl}});r.current.dispatchEvent(i),i.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});r.current&&(r.current.dispatchEvent(n),n.defaultPrevented)||(E(t),u("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsx("style",{children:".pre-7c90c93e { padding: 10px; color: red; text-align: center; }"})," ",o.jsxs("form",{validate:e.validate,ref:r,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>N(s),...e.attributes,children:[e.children,g()==="error"?o.jsx(h.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(h.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&y?o.jsx("pre",{className:"builder-form-error-text pre-7c90c93e",children:JSON.stringify(y,null,2)}):null,g()==="success"?o.jsx(h.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," "]})}exports.default=R;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsxs as F, Fragment as J, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as O, useState as E } from "react";
|
|
3
|
+
import { Blocks as S, set as U, get as R } from "./blocks-204bcb03.js";
|
|
4
|
+
import { isEditing as q, logFetch as $ } from "./server-entry-0fe1fd76.js";
|
|
5
|
+
import "./blocks-exports.mjs";
|
|
6
|
+
import "./get-class-prop-name-cc48fc17.js";
|
|
7
|
+
import "./dynamic-renderer-8b343325.js";
|
|
8
|
+
const L = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], W = () => {
|
|
9
|
+
const e = process.env.NODE_ENV || "production";
|
|
10
|
+
return L.includes(e) ? e : "production";
|
|
11
|
+
};
|
|
12
|
+
function Q(e) {
|
|
13
|
+
const r = O(null), [N, c] = E(() => "unsubmitted"), [y, v] = E(() => null), [z, P] = E(() => "");
|
|
14
|
+
function x(i) {
|
|
15
|
+
var m, l;
|
|
16
|
+
const u = {
|
|
17
|
+
...e.builderContext.rootState,
|
|
18
|
+
...i
|
|
19
|
+
};
|
|
20
|
+
e.builderContext.rootSetState ? (l = (m = e.builderContext).rootSetState) == null || l.call(m, u) : e.builderContext.rootState = u;
|
|
21
|
+
}
|
|
22
|
+
function h() {
|
|
23
|
+
return q() && e.previewState || N;
|
|
24
|
+
}
|
|
25
|
+
function D(i) {
|
|
26
|
+
var m;
|
|
27
|
+
const u = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
28
|
+
if (e.sendSubmissionsTo === "zapier")
|
|
29
|
+
i.preventDefault();
|
|
30
|
+
else if (u) {
|
|
31
|
+
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
32
|
+
i.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
i.preventDefault();
|
|
36
|
+
const l = i.currentTarget || i.target, C = e.customHeaders || {};
|
|
37
|
+
let g;
|
|
38
|
+
const A = new FormData(l), T = Array.from(l.querySelectorAll("input,select,textarea")).filter((t) => !!t.name).map((t) => {
|
|
39
|
+
let n;
|
|
40
|
+
const o = t.name;
|
|
41
|
+
if (t instanceof HTMLInputElement)
|
|
42
|
+
if (t.type === "radio") {
|
|
43
|
+
if (t.checked)
|
|
44
|
+
return n = t.name, {
|
|
45
|
+
key: o,
|
|
46
|
+
value: n
|
|
47
|
+
};
|
|
48
|
+
} else if (t.type === "checkbox")
|
|
49
|
+
n = t.checked;
|
|
50
|
+
else if (t.type === "number" || t.type === "range") {
|
|
51
|
+
const d = t.valueAsNumber;
|
|
52
|
+
isNaN(d) || (n = d);
|
|
53
|
+
} else
|
|
54
|
+
t.type === "file" ? n = t.files : n = t.value;
|
|
55
|
+
else
|
|
56
|
+
n = t.value;
|
|
57
|
+
return {
|
|
58
|
+
key: o,
|
|
59
|
+
value: n
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
let a = e.contentType;
|
|
63
|
+
if (e.sendSubmissionsTo === "email" && (a = "multipart/form-data"), Array.from(T).forEach(({ value: t }) => {
|
|
64
|
+
(t instanceof File || Array.isArray(t) && t[0] instanceof File || t instanceof FileList) && (a = "multipart/form-data");
|
|
65
|
+
}), a !== "application/json")
|
|
66
|
+
g = A;
|
|
67
|
+
else {
|
|
68
|
+
const t = {};
|
|
69
|
+
Array.from(T).forEach(({ value: n, key: o }) => {
|
|
70
|
+
U(t, o, n);
|
|
71
|
+
}), g = JSON.stringify(t);
|
|
72
|
+
}
|
|
73
|
+
a && a !== "multipart/form-data" && (u && ((m = e.action) != null && m.includes("zapier.com")) || (C["content-type"] = a));
|
|
74
|
+
const M = new CustomEvent("presubmit", { detail: { body: g } });
|
|
75
|
+
if (r.current && (r.current.dispatchEvent(M), M.defaultPrevented))
|
|
76
|
+
return;
|
|
77
|
+
if (c("sending"), e.sendSubmissionsTo === "email" && (e.sendSubmissionsToEmail === "your@email.com" || !e.sendSubmissionsToEmail)) {
|
|
78
|
+
const t = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
79
|
+
console.error(t), c("error"), x({ formErrorMessage: t });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const j = `${W() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
83
|
+
e.sendSubmissionsToEmail || ""
|
|
84
|
+
)}&name=${encodeURIComponent(e.name || "")}`, k = e.sendSubmissionsTo === "email" ? j : e.action;
|
|
85
|
+
$(k), fetch(k, { body: g, headers: C, method: e.method || "post" }).then(
|
|
86
|
+
async (t) => {
|
|
87
|
+
var d, w;
|
|
88
|
+
let n;
|
|
89
|
+
const o = t.headers.get("content-type");
|
|
90
|
+
if (o && o.indexOf("application/json") !== -1 ? n = await t.json() : n = await t.text(), !t.ok) {
|
|
91
|
+
const f = new CustomEvent("submit:error", {
|
|
92
|
+
detail: { error: n, status: t.status }
|
|
93
|
+
});
|
|
94
|
+
if ((d = r.current) != null && d.nativeElement && ((w = r.current) == null || w.nativeElement.dispatchEvent(f), f.defaultPrevented))
|
|
95
|
+
return;
|
|
96
|
+
v(n), c("error");
|
|
97
|
+
let s = e.errorMessagePath ? R(n, e.errorMessagePath) : n.message || n.error || n;
|
|
98
|
+
typeof s != "string" && (s = JSON.stringify(s)), P(s), x({ formErrorMessage: s });
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (v(n), c(t.ok ? "success" : "error"), t.ok) {
|
|
102
|
+
const f = new CustomEvent("submit:success", {
|
|
103
|
+
detail: { res: t, body: n }
|
|
104
|
+
});
|
|
105
|
+
if (r.current) {
|
|
106
|
+
if (r.current.dispatchEvent(f), f.defaultPrevented)
|
|
107
|
+
return;
|
|
108
|
+
e.resetFormOnSubmit !== !1 && r.current.reset();
|
|
109
|
+
}
|
|
110
|
+
if (e.successUrl)
|
|
111
|
+
if (r.current) {
|
|
112
|
+
const s = new CustomEvent("route", {
|
|
113
|
+
detail: { url: e.successUrl }
|
|
114
|
+
});
|
|
115
|
+
r.current.dispatchEvent(s), s.defaultPrevented || (location.href = e.successUrl);
|
|
116
|
+
} else
|
|
117
|
+
location.href = e.successUrl;
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
(t) => {
|
|
121
|
+
const n = new CustomEvent("submit:error", {
|
|
122
|
+
detail: { error: t }
|
|
123
|
+
});
|
|
124
|
+
r.current && (r.current.dispatchEvent(n), n.defaultPrevented) || (v(t), c("error"));
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ F(J, { children: [
|
|
130
|
+
" ",
|
|
131
|
+
/* @__PURE__ */ b("style", { children: ".pre-7c90c93e { padding: 10px; color: red; text-align: center; }" }),
|
|
132
|
+
" ",
|
|
133
|
+
/* @__PURE__ */ F(
|
|
134
|
+
"form",
|
|
135
|
+
{
|
|
136
|
+
validate: e.validate,
|
|
137
|
+
ref: r,
|
|
138
|
+
action: !e.sendWithJs && e.action,
|
|
139
|
+
method: e.method,
|
|
140
|
+
name: e.name,
|
|
141
|
+
onSubmit: (i) => D(i),
|
|
142
|
+
...e.attributes,
|
|
143
|
+
children: [
|
|
144
|
+
e.children,
|
|
145
|
+
h() === "error" ? /* @__PURE__ */ b(
|
|
146
|
+
S,
|
|
147
|
+
{
|
|
148
|
+
path: "errorMessage",
|
|
149
|
+
blocks: e.errorMessage,
|
|
150
|
+
context: e.builderContext
|
|
151
|
+
}
|
|
152
|
+
) : null,
|
|
153
|
+
h() === "sending" ? /* @__PURE__ */ b(
|
|
154
|
+
S,
|
|
155
|
+
{
|
|
156
|
+
path: "sendingMessage",
|
|
157
|
+
blocks: e.sendingMessage,
|
|
158
|
+
context: e.builderContext
|
|
159
|
+
}
|
|
160
|
+
) : null,
|
|
161
|
+
h() === "error" && y ? /* @__PURE__ */ b("pre", { className: "builder-form-error-text pre-7c90c93e", children: JSON.stringify(y, null, 2) }) : null,
|
|
162
|
+
h() === "success" ? /* @__PURE__ */ b(
|
|
163
|
+
S,
|
|
164
|
+
{
|
|
165
|
+
path: "successMessage",
|
|
166
|
+
blocks: e.successMessage,
|
|
167
|
+
context: e.builderContext
|
|
168
|
+
}
|
|
169
|
+
) : null
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
" "
|
|
174
|
+
] });
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
Q as default
|
|
178
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-e13b9b35.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};exports.getClassPropName=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),b=require("react");function g(e){return e.replace(/http(s)?:/,"")}function x(e="",i,t){const n=new RegExp("([?&])"+i+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(n)?e.replace(n,"$1"+i+"="+encodeURIComponent(t)+"$2"):e+a+i+"="+encodeURIComponent(t)}function y(e,i){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!i)return e;if(i==="master")return g(e);const t=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(t){const n=e.split(t[0]),a=t[3],r=i.match("x")?i:`${i}x`;return g(`${n[0]}_${r}${a}`)}return null}function d(e){if(!e)return e;const i=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let t=e;const n=Number(e.split("?width=")[1]);return isNaN(n)||(t=`${t} ${n}w`),i.filter(a=>a!==n).map(a=>`${x(e,"width",a)} ${a}w`).concat([t]).join(", ")}return e.match(/cdn\.shopify\.com/)?i.map(t=>[y(e,`${t}x${t}`),t]).filter(([t])=>!!t).map(([t,n])=>`${t} ${n}w`).concat([e]).join(", "):e}function j(e){var a,r,s,u,m,f;function i(){var h;const o=e.image||e.src;if(!o||!(typeof o=="string"&&(o.match(/builder\.io/)||o.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),d(o)}else if(e.image&&!e.srcset)return d(o);return d(o)}}function t(){var l;return(l=i==null?void 0:i())!=null&&l.match(/builder\.io/)&&!e.noWebp?i().replace(/\?/g,"?format=webp&"):""}function n(){const l={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?l:void 0}return b.useEffect(()=>{},[]),c.jsxs(c.Fragment,{children:[c.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),b=require("react");function g(e){return e.replace(/http(s)?:/,"")}function x(e="",i,t){const n=new RegExp("([?&])"+i+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(n)?e.replace(n,"$1"+i+"="+encodeURIComponent(t)+"$2"):e+a+i+"="+encodeURIComponent(t)}function y(e,i){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!i)return e;if(i==="master")return g(e);const t=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(t){const n=e.split(t[0]),a=t[3],r=i.match("x")?i:`${i}x`;return g(`${n[0]}_${r}${a}`)}return null}function d(e){if(!e)return e;const i=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let t=e;const n=Number(e.split("?width=")[1]);return isNaN(n)||(t=`${t} ${n}w`),i.filter(a=>a!==n).map(a=>`${x(e,"width",a)} ${a}w`).concat([t]).join(", ")}return e.match(/cdn\.shopify\.com/)?i.map(t=>[y(e,`${t}x${t}`),t]).filter(([t])=>!!t).map(([t,n])=>`${t} ${n}w`).concat([e]).join(", "):e}function j(e){var a,r,s,u,m,f;function i(){var h;const o=e.image||e.src;if(!o||!(typeof o=="string"&&(o.match(/builder\.io/)||o.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),d(o)}else if(e.image&&!e.srcset)return d(o);return d(o)}}function t(){var l;return(l=i==null?void 0:i())!=null&&l.match(/builder\.io/)&&!e.noWebp?i().replace(/\?/g,"?format=webp&"):""}function n(){const l={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?l:void 0}return b.useEffect(()=>{},[]),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`.img-3cc22d08 {
|
|
2
2
|
opacity: 1;
|
|
3
3
|
transition: opacity 0.2s ease-in-out;
|
|
4
4
|
}.div-3cc22d08 {
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
left: 0;
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 100%;
|
|
17
|
-
}`})]})}exports.default=j;
|
|
17
|
+
}`}),c.jsxs(c.Fragment,{children:[c.jsxs("picture",{children:[t()?c.jsx("source",{type:"image/webp",srcSet:t()}):null,c.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...n()},className:"builder-image"+(e.className?" "+e.className:"")+" img-3cc22d08",src:e.image,srcSet:i(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length&&e.fitContent)?c.jsx("div",{className:"builder-image-sizer div-3cc22d08",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(u=(s=e.builderBlock)==null?void 0:s.children)!=null&&u.length&&e.fitContent?c.jsx(c.Fragment,{children:e.children}):null,!e.fitContent&&((f=(m=e.builderBlock)==null?void 0:m.children)!=null&&f.length)?c.jsx("div",{className:"div-3cc22d08-2",children:e.children}):null]})]})}exports.default=j;
|
|
@@ -64,6 +64,23 @@ function R(e) {
|
|
|
64
64
|
}
|
|
65
65
|
return y(() => {
|
|
66
66
|
}, []), /* @__PURE__ */ d(m, { children: [
|
|
67
|
+
/* @__PURE__ */ o("style", { children: `.img-3cc22d08 {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
transition: opacity 0.2s ease-in-out;
|
|
70
|
+
}.div-3cc22d08 {
|
|
71
|
+
width: 100%;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
font-size: 0;
|
|
74
|
+
}.div-3cc22d08-2 {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
align-items: stretch;
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: 0;
|
|
80
|
+
left: 0;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
}` }),
|
|
67
84
|
/* @__PURE__ */ d(m, { children: [
|
|
68
85
|
/* @__PURE__ */ d("picture", { children: [
|
|
69
86
|
t() ? /* @__PURE__ */ o("source", { type: "image/webp", srcSet: t() }) : null,
|
|
@@ -98,24 +115,7 @@ function R(e) {
|
|
|
98
115
|
) : null,
|
|
99
116
|
(h = (u = e.builderBlock) == null ? void 0 : u.children) != null && h.length && e.fitContent ? /* @__PURE__ */ o(m, { children: e.children }) : null,
|
|
100
117
|
!e.fitContent && ((g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length) ? /* @__PURE__ */ o("div", { className: "div-3cc22d08-2", children: e.children }) : null
|
|
101
|
-
] })
|
|
102
|
-
/* @__PURE__ */ o("style", { children: `.img-3cc22d08 {
|
|
103
|
-
opacity: 1;
|
|
104
|
-
transition: opacity 0.2s ease-in-out;
|
|
105
|
-
}.div-3cc22d08 {
|
|
106
|
-
width: 100%;
|
|
107
|
-
pointer-events: none;
|
|
108
|
-
font-size: 0;
|
|
109
|
-
}.div-3cc22d08-2 {
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: column;
|
|
112
|
-
align-items: stretch;
|
|
113
|
-
position: absolute;
|
|
114
|
-
top: 0;
|
|
115
|
-
left: 0;
|
|
116
|
-
width: 100%;
|
|
117
|
-
height: 100%;
|
|
118
|
-
}` })
|
|
118
|
+
] })
|
|
119
119
|
] });
|
|
120
120
|
}
|
|
121
121
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-e13b9b35.cjs");function n(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},i.isEditing()&&e.imgSrc||"default-key")}exports.default=n;
|
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-e13b9b35.cjs");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as i, BuilderContext as o, Button as s, Columns as n, Content as c, Fragment as g, Image as m, Section as a, Symbol as l, Text as u, Video as d } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as C, createRegisterComponentMessage as f, fetchBuilderProps as B, fetchEntries as E, fetchOneEntry as b, getBuilderSearchParams as h, isEditing as x, isPreviewing as S, register as P, setClientUserAttributes as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-
|
|
2
|
+
import { _processContentResult as C, createRegisterComponentMessage as f, fetchBuilderProps as B, fetchEntries as E, fetchOneEntry as b, getBuilderSearchParams as h, isEditing as x, isPreviewing as S, register as P, setClientUserAttributes as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-0fe1fd76.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
i as Blocks,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-e13b9b35.cjs");function a(e){return t.createElement("input",{...e.attributes,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),k=require("./blocks-bd4d19a4.cjs"),r=require("./content-variants-0c41aa3b.cjs"),s=require("./server-entry-e13b9b35.cjs"),U=require("./get-class-prop-name-a9265175.cjs");require("./blocks-exports.cjs");require("./dynamic-renderer-b29b45ca.cjs");function O(e){var h,R,B,g,m,T,y,A,P,I,$,j,D;const u=l.useRef(null),[V,q]=l.useState(()=>s.userAttributesService.getUserAttributes()),[C,F]=l.useState(()=>{var t,n,i;return r.getPersonalizationScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[N,H]=l.useState(()=>{var t,n,i;return r.getUpdateVisibilityStylesScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[x,L]=l.useState(()=>[]),[E,z]=l.useState(()=>{var t;return r.checkShouldRenderVariants(e.variants,s.getDefaultCanTrack((t=e.builderContext)==null?void 0:t.canTrack))}),[v,w]=l.useState(()=>!1);function G(){return{...e.attributes,[U.getClassPropName()]:`builder-personalization-container ${e.attributes[U.getClassPropName()]||""}`}}function f(){return(e.variants||[]).filter(t=>{var n,i,o,c;return r.filterWithCustomTargeting({...(i=(n=e.builderContext)==null?void 0:n.rootState)!=null&&i.locale?{locale:(c=(o=e.builderContext)==null?void 0:o.rootState)==null?void 0:c.locale}:{},...V},t.query,t.startDate,t.endDate)})}function d(){var t;return r.getBlocksToRender({variants:e.variants,fallbackBlocks:(t=e.builderBlock)==null?void 0:t.children,isHydrated:v,filteredVariants:f(),previewingIndex:e.previewingIndex})}function W(){return(e.variants||[]).map((t,n)=>{var i;return`div[data-variant-id="${(i=e.builderBlock)==null?void 0:i.id}-${n}"] { display: none !important; } `}).join("")}return l.useEffect(()=>{var n;w(!0);const t=s.userAttributesService.subscribeOnUserAttributesChange(i=>{q(i)},{fireImmediately:s.TARGET==="qwik"});if(!(s.isEditing()||s.isPreviewing())){const i=f()[0];u.current&&(u.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:i||r.DEFAULT_INDEX,content:(n=e.builderContext)==null?void 0:n.content},bubbles:!0})),new IntersectionObserver(c=>{c.forEach(S=>{var b;S.isIntersecting&&u.current&&u.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:i||r.DEFAULT_INDEX,content:(b=e.builderContext)==null?void 0:b.content},bubbles:!0}))})}).observe(u.current))}x.push(t)},[]),l.useEffect(()=>()=>{x.forEach(t=>t())},[]),a.jsxs("div",{ref:u,...G(),children:[v&&r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)?a.jsx(k.Blocks,{blocks:d().blocks,parent:(h=e.builderBlock)==null?void 0:h.id,path:d().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(R=e.builderContext)==null?void 0:R.BlocksWrapperProps,"data-variant-id":`${(B=e.builderBlock)==null?void 0:B.id}-${d().index}`}}):null,!v&&r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)||!r.SDKS_REQUIRING_RESET_APPROACH.includes(s.TARGET)?a.jsxs(a.Fragment,{children:[E?a.jsxs(a.Fragment,{children:[a.jsx(k.InlinedStyles,{nonce:((g=e.builderContext)==null?void 0:g.nonce)||"",styles:W(),id:`variants-styles-${(m=e.builderBlock)==null?void 0:m.id}`}),a.jsx(r.InlinedScript,{nonce:((T=e.builderContext)==null?void 0:T.nonce)||"",scriptStr:N,id:`variants-visibility-script-${(y=e.builderBlock)==null?void 0:y.id}`}),(A=e.variants)==null?void 0:A.map((t,n)=>{var i,o,c,S,b,_;return a.jsx(k.Blocks,{BlocksWrapperProps:{...(i=e.builderContext)==null?void 0:i.BlocksWrapperProps,"aria-hidden":!0,hidden:!0,"data-variant-id":`${(o=e.builderBlock)==null?void 0:o.id}-${n}`},blocks:t.blocks,parent:(c=e.builderBlock)==null?void 0:c.id,path:`component.options.variants.${n}.blocks`,context:e.builderContext,registeredComponents:e.builderComponents,children:a.jsx(r.InlinedScript,{nonce:((S=e.builderContext)==null?void 0:S.nonce)||"",scriptStr:C,id:`variants-script-${(b=e.builderBlock)==null?void 0:b.id}-${n}`})},`${(_=e.builderBlock)==null?void 0:_.id}-${n}`)})]}):null,a.jsx(k.Blocks,{blocks:d().blocks,parent:(P=e.builderBlock)==null?void 0:P.id,path:d().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(I=e.builderContext)==null?void 0:I.BlocksWrapperProps,"data-variant-id":`${($=e.builderBlock)==null?void 0:$.id}-${d().index}`},children:E?a.jsx(r.InlinedScript,{nonce:((j=e.builderContext)==null?void 0:j.nonce)||"",scriptStr:C,id:`variants-script-${(D=e.builderBlock)==null?void 0:D.id}-${r.DEFAULT_INDEX}`}):null})]}):null]})}exports.default=O;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsxs as v, jsx as l, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as Q, useState as c, useEffect as z } from "react";
|
|
3
|
+
import { Blocks as m, InlinedStyles as X } from "./blocks-204bcb03.js";
|
|
4
|
+
import { getPersonalizationScript as J, getUpdateVisibilityStylesScript as M, checkShouldRenderVariants as Y, DEFAULT_INDEX as C, SDKS_REQUIRING_RESET_APPROACH as f, InlinedScript as h, filterWithCustomTargeting as Z, getBlocksToRender as p } from "./content-variants-68bbb30c.js";
|
|
5
|
+
import { userAttributesService as N, getDefaultCanTrack as tt, TARGET as b, isEditing as et, isPreviewing as it } from "./server-entry-0fe1fd76.js";
|
|
6
|
+
import { getClassPropName as O } from "./get-class-prop-name-cc48fc17.js";
|
|
7
|
+
import "./blocks-exports.mjs";
|
|
8
|
+
import "./dynamic-renderer-8b343325.js";
|
|
9
|
+
function mt(t) {
|
|
10
|
+
var $, y, E, R, P, V, I, A, T, U, w, D, W;
|
|
11
|
+
const a = Q(null), [q, F] = c(
|
|
12
|
+
() => N.getUserAttributes()
|
|
13
|
+
), [S, nt] = c(
|
|
14
|
+
() => {
|
|
15
|
+
var e, n, i;
|
|
16
|
+
return J(
|
|
17
|
+
t.variants,
|
|
18
|
+
((e = t.builderBlock) == null ? void 0 : e.id) || "none",
|
|
19
|
+
(i = (n = t.builderContext) == null ? void 0 : n.rootState) == null ? void 0 : i.locale
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
), [G, rt] = c(
|
|
23
|
+
() => {
|
|
24
|
+
var e, n, i;
|
|
25
|
+
return M(
|
|
26
|
+
t.variants,
|
|
27
|
+
((e = t.builderBlock) == null ? void 0 : e.id) || "none",
|
|
28
|
+
(i = (n = t.builderContext) == null ? void 0 : n.rootState) == null ? void 0 : i.locale
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
), [x, lt] = c(() => []), [B, at] = c(
|
|
32
|
+
() => {
|
|
33
|
+
var e;
|
|
34
|
+
return Y(
|
|
35
|
+
t.variants,
|
|
36
|
+
tt((e = t.builderContext) == null ? void 0 : e.canTrack)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
), [k, H] = c(() => !1);
|
|
40
|
+
function L() {
|
|
41
|
+
return {
|
|
42
|
+
...t.attributes,
|
|
43
|
+
[O()]: `builder-personalization-container ${t.attributes[O()] || ""}`
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function g() {
|
|
47
|
+
return (t.variants || []).filter((e) => {
|
|
48
|
+
var n, i, d, r;
|
|
49
|
+
return Z(
|
|
50
|
+
{
|
|
51
|
+
...(i = (n = t.builderContext) == null ? void 0 : n.rootState) != null && i.locale ? {
|
|
52
|
+
locale: (r = (d = t.builderContext) == null ? void 0 : d.rootState) == null ? void 0 : r.locale
|
|
53
|
+
} : {},
|
|
54
|
+
...q
|
|
55
|
+
},
|
|
56
|
+
e.query,
|
|
57
|
+
e.startDate,
|
|
58
|
+
e.endDate
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function o() {
|
|
63
|
+
var e;
|
|
64
|
+
return p({
|
|
65
|
+
variants: t.variants,
|
|
66
|
+
fallbackBlocks: (e = t.builderBlock) == null ? void 0 : e.children,
|
|
67
|
+
isHydrated: k,
|
|
68
|
+
filteredVariants: g(),
|
|
69
|
+
previewingIndex: t.previewingIndex
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function K() {
|
|
73
|
+
return (t.variants || []).map(
|
|
74
|
+
(e, n) => {
|
|
75
|
+
var i;
|
|
76
|
+
return `div[data-variant-id="${(i = t.builderBlock) == null ? void 0 : i.id}-${n}"] { display: none !important; } `;
|
|
77
|
+
}
|
|
78
|
+
).join("");
|
|
79
|
+
}
|
|
80
|
+
return z(() => {
|
|
81
|
+
var n;
|
|
82
|
+
H(!0);
|
|
83
|
+
const e = N.subscribeOnUserAttributesChange(
|
|
84
|
+
(i) => {
|
|
85
|
+
F(i);
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
fireImmediately: b === "qwik"
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
if (!(et() || it())) {
|
|
92
|
+
const i = g()[0];
|
|
93
|
+
a.current && (a.current.dispatchEvent(
|
|
94
|
+
new CustomEvent("builder.variantLoaded", {
|
|
95
|
+
detail: {
|
|
96
|
+
variant: i || C,
|
|
97
|
+
content: (n = t.builderContext) == null ? void 0 : n.content
|
|
98
|
+
},
|
|
99
|
+
bubbles: !0
|
|
100
|
+
})
|
|
101
|
+
), new IntersectionObserver((r) => {
|
|
102
|
+
r.forEach((u) => {
|
|
103
|
+
var s;
|
|
104
|
+
u.isIntersecting && a.current && a.current.dispatchEvent(
|
|
105
|
+
new CustomEvent("builder.variantDisplayed", {
|
|
106
|
+
detail: {
|
|
107
|
+
variant: i || C,
|
|
108
|
+
content: (s = t.builderContext) == null ? void 0 : s.content
|
|
109
|
+
},
|
|
110
|
+
bubbles: !0
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
}).observe(a.current));
|
|
115
|
+
}
|
|
116
|
+
x.push(e);
|
|
117
|
+
}, []), z(() => () => {
|
|
118
|
+
x.forEach((e) => e());
|
|
119
|
+
}, []), /* @__PURE__ */ v("div", { ref: a, ...L(), children: [
|
|
120
|
+
k && f.includes(b) ? /* @__PURE__ */ l(
|
|
121
|
+
m,
|
|
122
|
+
{
|
|
123
|
+
blocks: o().blocks,
|
|
124
|
+
parent: ($ = t.builderBlock) == null ? void 0 : $.id,
|
|
125
|
+
path: o().path,
|
|
126
|
+
context: t.builderContext,
|
|
127
|
+
registeredComponents: t.builderComponents,
|
|
128
|
+
BlocksWrapperProps: {
|
|
129
|
+
...(y = t.builderContext) == null ? void 0 : y.BlocksWrapperProps,
|
|
130
|
+
"data-variant-id": `${(E = t.builderBlock) == null ? void 0 : E.id}-${o().index}`
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
) : null,
|
|
134
|
+
!k && f.includes(b) || !f.includes(b) ? /* @__PURE__ */ v(j, { children: [
|
|
135
|
+
B ? /* @__PURE__ */ v(j, { children: [
|
|
136
|
+
/* @__PURE__ */ l(
|
|
137
|
+
X,
|
|
138
|
+
{
|
|
139
|
+
nonce: ((R = t.builderContext) == null ? void 0 : R.nonce) || "",
|
|
140
|
+
styles: K(),
|
|
141
|
+
id: `variants-styles-${(P = t.builderBlock) == null ? void 0 : P.id}`
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ l(
|
|
145
|
+
h,
|
|
146
|
+
{
|
|
147
|
+
nonce: ((V = t.builderContext) == null ? void 0 : V.nonce) || "",
|
|
148
|
+
scriptStr: G,
|
|
149
|
+
id: `variants-visibility-script-${(I = t.builderBlock) == null ? void 0 : I.id}`
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
(A = t.variants) == null ? void 0 : A.map((e, n) => {
|
|
153
|
+
var i, d, r, u, s, _;
|
|
154
|
+
return /* @__PURE__ */ l(
|
|
155
|
+
m,
|
|
156
|
+
{
|
|
157
|
+
BlocksWrapperProps: {
|
|
158
|
+
...(i = t.builderContext) == null ? void 0 : i.BlocksWrapperProps,
|
|
159
|
+
"aria-hidden": !0,
|
|
160
|
+
hidden: !0,
|
|
161
|
+
"data-variant-id": `${(d = t.builderBlock) == null ? void 0 : d.id}-${n}`
|
|
162
|
+
},
|
|
163
|
+
blocks: e.blocks,
|
|
164
|
+
parent: (r = t.builderBlock) == null ? void 0 : r.id,
|
|
165
|
+
path: `component.options.variants.${n}.blocks`,
|
|
166
|
+
context: t.builderContext,
|
|
167
|
+
registeredComponents: t.builderComponents,
|
|
168
|
+
children: /* @__PURE__ */ l(
|
|
169
|
+
h,
|
|
170
|
+
{
|
|
171
|
+
nonce: ((u = t.builderContext) == null ? void 0 : u.nonce) || "",
|
|
172
|
+
scriptStr: S,
|
|
173
|
+
id: `variants-script-${(s = t.builderBlock) == null ? void 0 : s.id}-${n}`
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
},
|
|
177
|
+
`${(_ = t.builderBlock) == null ? void 0 : _.id}-${n}`
|
|
178
|
+
);
|
|
179
|
+
})
|
|
180
|
+
] }) : null,
|
|
181
|
+
/* @__PURE__ */ l(
|
|
182
|
+
m,
|
|
183
|
+
{
|
|
184
|
+
blocks: o().blocks,
|
|
185
|
+
parent: (T = t.builderBlock) == null ? void 0 : T.id,
|
|
186
|
+
path: o().path,
|
|
187
|
+
context: t.builderContext,
|
|
188
|
+
registeredComponents: t.builderComponents,
|
|
189
|
+
BlocksWrapperProps: {
|
|
190
|
+
...(U = t.builderContext) == null ? void 0 : U.BlocksWrapperProps,
|
|
191
|
+
"data-variant-id": `${(w = t.builderBlock) == null ? void 0 : w.id}-${o().index}`
|
|
192
|
+
},
|
|
193
|
+
children: B ? /* @__PURE__ */ l(
|
|
194
|
+
h,
|
|
195
|
+
{
|
|
196
|
+
nonce: ((D = t.builderContext) == null ? void 0 : D.nonce) || "",
|
|
197
|
+
scriptStr: S,
|
|
198
|
+
id: `variants-script-${(W = t.builderBlock) == null ? void 0 : W.id}-${C}`
|
|
199
|
+
}
|
|
200
|
+
) : null
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }) : null
|
|
204
|
+
] });
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
mt as default
|
|
208
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),r=require("./server-entry-e13b9b35.cjs");function i(e){var u;return n.createElement("select",{...e.attributes,value:e.value,key:r.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(u=e.options)==null?void 0:u.map((t,a)=>l.jsx("option",{value:t.value,children:t.name||t.value},`${t.name}-${a}`)))}exports.default=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as m } from "react";
|
|
3
|
-
import { isEditing as n } from "./server-entry-
|
|
3
|
+
import { isEditing as n } from "./server-entry-0fe1fd76.js";
|
|
4
4
|
function r(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ m(
|