@builder.io/sdk-react 4.0.9 → 4.1.0
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 +10 -10
- package/lib/browser/blocks-exports.mjs +480 -459
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-9ed7eace.cjs +2 -0
- package/lib/{edge/server-entry-8dc3478a.js → browser/server-entry-cddec22e.js} +272 -265
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-e3f81e74.cjs → accordion-59aed902.cjs} +1 -1
- package/lib/edge/{accordion-b551e135.js → accordion-88f5ca79.js} +1 -1
- package/lib/edge/{blocks-cd1feef2.js → blocks-1bfa0619.js} +2 -2
- package/lib/edge/{blocks-eb6fa21f.cjs → blocks-e5610e53.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-f390f723.js → button-cfcad5ee.js} +2 -2
- package/lib/edge/{button-5c6a9392.cjs → button-d4969c10.cjs} +1 -1
- package/lib/edge/{columns-ad17139e.cjs → columns-4c22f5f9.cjs} +1 -1
- package/lib/edge/{columns-7018a027.js → columns-840b77f4.js} +3 -3
- package/lib/edge/{content-variants-dc54ce4f.js → content-variants-5b95a71c.js} +13 -13
- package/lib/edge/{content-variants-c72ca81f.cjs → content-variants-9084d7cf.cjs} +3 -3
- package/lib/edge/{custom-code-0daf1c91.js → custom-code-c12691cc.js} +1 -1
- package/lib/edge/{custom-code-e87af7b1.cjs → custom-code-f0f3bef1.cjs} +1 -1
- package/lib/edge/{embed-1dfcba43.js → embed-46acac57.js} +1 -1
- package/lib/edge/{embed-c695c98e.cjs → embed-95c874d3.cjs} +1 -1
- package/lib/edge/form-49928227.js +178 -0
- package/lib/edge/form-e74d90ef.cjs +1 -0
- package/lib/edge/{get-class-prop-name-c479656a.cjs → get-class-prop-name-5d642918.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-5edacc3b.js → get-class-prop-name-de337a1b.js} +1 -1
- package/lib/edge/image-209835f4.js +94 -0
- package/lib/edge/image-87a4e006.cjs +17 -0
- package/lib/edge/image.helpers-3e926d47.js +33 -0
- package/lib/edge/image.helpers-dba8a869.cjs +1 -0
- package/lib/edge/img-0fe56811.cjs +1 -0
- package/lib/edge/img-a0115c68.js +27 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-3d4f956b.js → input-2a39a1a8.js} +1 -1
- package/lib/edge/{input-8c7008b5.cjs → input-4f2e451f.cjs} +1 -1
- package/lib/edge/personalization-container-9ddd7a55.cjs +1 -0
- package/lib/edge/{personalization-container-3a8dc18a.js → personalization-container-d477347e.js} +35 -32
- package/lib/edge/{select-2efc7503.cjs → select-b5449eba.cjs} +1 -1
- package/lib/edge/{select-153586f8.js → select-d1902b94.js} +1 -1
- package/lib/{node/server-entry-f03c1146.js → edge/server-entry-50618347.js} +306 -303
- package/lib/edge/server-entry-a24928b8.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-f1f7513c.cjs → slot-e2f8c494.cjs} +1 -1
- package/lib/edge/{slot-d268693c.js → slot-f37576fc.js} +3 -3
- package/lib/edge/{symbol-0344516c.cjs → symbol-8424cd54.cjs} +1 -1
- package/lib/edge/{symbol-378e19ee.js → symbol-a34eea2a.js} +2 -2
- package/lib/edge/{tabs-29ff78a0.js → tabs-b97f9798.js} +3 -3
- package/lib/edge/{tabs-4e931765.cjs → tabs-e686d11f.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +16 -16
- package/lib/node/blocks-exports.mjs +502 -481
- 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-231f8ecd.js → node/server-entry-1556528d.js} +205 -199
- package/lib/node/server-entry-ecee24b6.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-044ce9e7.js → setIvm-15c96eda.js} +1 -1
- package/lib/node/{setIvm-3761bb10.cjs → setIvm-432010ba.cjs} +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-e760d4f2.cjs → should-force-browser-runtime-in-node-4128d124.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-f620dcdc.js → should-force-browser-runtime-in-node-d0bca779.js} +1 -1
- package/package.json +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-bdbd3c0d.cjs +0 -2
- package/lib/edge/form-5a0c89d9.js +0 -166
- package/lib/edge/form-ba54942c.cjs +0 -1
- package/lib/edge/image-cce92f6c.cjs +0 -17
- package/lib/edge/image-d87761af.js +0 -123
- package/lib/edge/img-6982d6eb.cjs +0 -1
- package/lib/edge/img-882c7222.js +0 -20
- package/lib/edge/personalization-container-4557a50b.cjs +0 -1
- package/lib/edge/server-entry-9d269960.cjs +0 -2
- package/lib/node/server-entry-916c726c.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-a24928b8.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 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-50618347.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-a24928b8.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,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-1bfa0619.js";
|
|
4
|
+
import { isEditing as q, logFetch as $ } from "./server-entry-50618347.js";
|
|
5
|
+
import "./blocks-exports.mjs";
|
|
6
|
+
import "./get-class-prop-name-de337a1b.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
|
+
};
|
|
@@ -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-e5610e53.cjs"),q=require("./server-entry-a24928b8.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-5d642918.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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-a24928b8.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;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as v } from "react";
|
|
3
|
+
import { getSrcSet as d } from "./image.helpers-3e926d47.js";
|
|
4
|
+
function w(e) {
|
|
5
|
+
var r, u, s, g, m, h;
|
|
6
|
+
function c() {
|
|
7
|
+
var f;
|
|
8
|
+
const i = e.image || e.src;
|
|
9
|
+
if (!i || // We can auto add srcset for cdn.builder.io and shopify
|
|
10
|
+
// images, otherwise you can supply this prop manually
|
|
11
|
+
!(typeof i == "string" && (i.match(/builder\.io/) || i.match(/cdn\.shopify\.com/))))
|
|
12
|
+
return e.srcset;
|
|
13
|
+
if (!e.noWebp) {
|
|
14
|
+
if (e.srcset && ((f = e.image) != null && f.includes("builder.io/api/v1/image"))) {
|
|
15
|
+
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
16
|
+
return console.debug("Removed given srcset"), d(i);
|
|
17
|
+
} else if (e.image && !e.srcset)
|
|
18
|
+
return d(i);
|
|
19
|
+
return d(i);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function o() {
|
|
23
|
+
var n;
|
|
24
|
+
return (n = c == null ? void 0 : c()) != null && n.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
25
|
+
}
|
|
26
|
+
function b() {
|
|
27
|
+
const n = {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
height: "100%",
|
|
30
|
+
width: "100%",
|
|
31
|
+
left: "0px",
|
|
32
|
+
top: "0px"
|
|
33
|
+
};
|
|
34
|
+
return e.aspectRatio ? n : void 0;
|
|
35
|
+
}
|
|
36
|
+
return v(() => {
|
|
37
|
+
}, []), /* @__PURE__ */ l(a, { children: [
|
|
38
|
+
/* @__PURE__ */ t("style", { children: `.img-3cc22d08 {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
transition: opacity 0.2s ease-in-out;
|
|
41
|
+
}.div-3cc22d08 {
|
|
42
|
+
width: 100%;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
font-size: 0;
|
|
45
|
+
}.div-3cc22d08-2 {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: stretch;
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
}` }),
|
|
55
|
+
/* @__PURE__ */ l(a, { children: [
|
|
56
|
+
/* @__PURE__ */ l("picture", { children: [
|
|
57
|
+
o() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: o() }) : null,
|
|
58
|
+
/* @__PURE__ */ t(
|
|
59
|
+
"img",
|
|
60
|
+
{
|
|
61
|
+
loading: e.highPriority ? "eager" : "lazy",
|
|
62
|
+
fetchPriority: e.highPriority ? "high" : "auto",
|
|
63
|
+
alt: e.altText,
|
|
64
|
+
title: e.title,
|
|
65
|
+
role: e.altText ? void 0 : "presentation",
|
|
66
|
+
style: {
|
|
67
|
+
objectPosition: e.backgroundPosition || "center",
|
|
68
|
+
objectFit: e.backgroundSize || "cover",
|
|
69
|
+
...b()
|
|
70
|
+
},
|
|
71
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-3cc22d08",
|
|
72
|
+
src: e.image,
|
|
73
|
+
srcSet: c(),
|
|
74
|
+
sizes: e.sizes
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }),
|
|
78
|
+
e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "builder-image-sizer div-3cc22d08",
|
|
82
|
+
style: {
|
|
83
|
+
paddingTop: e.aspectRatio * 100 + "%"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
) : null,
|
|
87
|
+
(g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length && e.fitContent ? /* @__PURE__ */ t(a, { children: e.children }) : null,
|
|
88
|
+
!e.fitContent && ((h = (m = e.builderBlock) == null ? void 0 : m.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-3cc22d08-2", children: e.children }) : null
|
|
89
|
+
] })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
w as default
|
|
94
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),l=require("./image.helpers-dba8a869.cjs");function b(e){var s,r,d,u,o,g;function c(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.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"),l.getSrcSet(i)}else if(e.image&&!e.srcset)return l.getSrcSet(i);return l.getSrcSet(i)}}function a(){var n;return(n=c==null?void 0:c())!=null&&n.match(/builder\.io/)&&!e.noWebp?c().replace(/\?/g,"?format=webp&"):""}function m(){const n={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?n:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`.img-3cc22d08 {
|
|
2
|
+
opacity: 1;
|
|
3
|
+
transition: opacity 0.2s ease-in-out;
|
|
4
|
+
}.div-3cc22d08 {
|
|
5
|
+
width: 100%;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
font-size: 0;
|
|
8
|
+
}.div-3cc22d08-2 {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}`}),t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[a()?t.jsx("source",{type:"image/webp",srcSet:a()}):null,t.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",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-3cc22d08",src:e.image,srcSet:c(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-3cc22d08",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(u=(d=e.builderBlock)==null?void 0:d.children)!=null&&u.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(o=e.builderBlock)==null?void 0:o.children)!=null&&g.length)?t.jsx("div",{className:"div-3cc22d08-2",children:e.children}):null]})]})}exports.default=b;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
return t.replace(/http(s)?:/, "");
|
|
3
|
+
}
|
|
4
|
+
function p(t = "", e, n) {
|
|
5
|
+
const o = new RegExp("([?&])" + e + "=.*?(&|$)", "i"), i = t.indexOf("?") !== -1 ? "&" : "?";
|
|
6
|
+
return t.match(o) ? t.replace(o, "$1" + e + "=" + encodeURIComponent(n) + "$2") : t + i + e + "=" + encodeURIComponent(n);
|
|
7
|
+
}
|
|
8
|
+
function a(t, e) {
|
|
9
|
+
if (!t || !(t != null && t.match(/cdn\.shopify\.com/)) || !e)
|
|
10
|
+
return t;
|
|
11
|
+
if (e === "master")
|
|
12
|
+
return c(t);
|
|
13
|
+
const n = t.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
14
|
+
if (n) {
|
|
15
|
+
const o = t.split(n[0]), i = n[3], f = e.match("x") ? e : `${e}x`;
|
|
16
|
+
return c(`${o[0]}_${f}${i}`);
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function r(t) {
|
|
21
|
+
if (!t)
|
|
22
|
+
return t;
|
|
23
|
+
const e = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
24
|
+
if (t.match(/builder\.io/)) {
|
|
25
|
+
let n = t;
|
|
26
|
+
const o = Number(t.split("?width=")[1]);
|
|
27
|
+
return isNaN(o) || (n = `${n} ${o}w`), e.filter((i) => i !== o).map((i) => `${p(t, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
28
|
+
}
|
|
29
|
+
return t.match(/cdn\.shopify\.com/) ? e.map((n) => [a(t, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([t]).join(", ") : t;
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
r as getSrcSet
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function c(t){return t.replace(/http(s)?:/,"")}function r(t="",e,n){const o=new RegExp("([?&])"+e+"=.*?(&|$)","i"),i=t.indexOf("?")!==-1?"&":"?";return t.match(o)?t.replace(o,"$1"+e+"="+encodeURIComponent(n)+"$2"):t+i+e+"="+encodeURIComponent(n)}function a(t,e){if(!t||!(t!=null&&t.match(/cdn\.shopify\.com/))||!e)return t;if(e==="master")return c(t);const n=t.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=t.split(n[0]),i=n[3],f=e.match("x")?e:`${e}x`;return c(`${o[0]}_${f}${i}`)}return null}function p(t){if(!t)return t;const e=[100,200,400,800,1200,1600,2e3];if(t.match(/builder\.io/)){let n=t;const o=Number(t.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),e.filter(i=>i!==o).map(i=>`${r(t,"width",i)} ${i}w`).concat([n]).join(", ")}return t.match(/cdn\.shopify\.com/)?e.map(n=>[a(t,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([t]).join(", "):t}exports.getSrcSet=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("./server-entry-a24928b8.cjs"),c=require("./image.helpers-dba8a869.cjs");function u(e){function i(){const t=e.imgSrc||e.image;if(!(!t||typeof t!="string")&&t.match(/builder\.io/))return c.getSrcSet(t)}return r.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,srcSet:i(),...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}exports.default=u;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { isEditing as n } from "./server-entry-50618347.js";
|
|
3
|
+
import { getSrcSet as o } from "./image.helpers-3e926d47.js";
|
|
4
|
+
function g(t) {
|
|
5
|
+
function e() {
|
|
6
|
+
const i = t.imgSrc || t.image;
|
|
7
|
+
if (!(!i || typeof i != "string") && i.match(/builder\.io/))
|
|
8
|
+
return o(i);
|
|
9
|
+
}
|
|
10
|
+
return /* @__PURE__ */ r(
|
|
11
|
+
"img",
|
|
12
|
+
{
|
|
13
|
+
style: {
|
|
14
|
+
objectFit: t.backgroundSize || "cover",
|
|
15
|
+
objectPosition: t.backgroundPosition || "center"
|
|
16
|
+
},
|
|
17
|
+
alt: t.altText,
|
|
18
|
+
src: t.imgSrc || t.image,
|
|
19
|
+
srcSet: e(),
|
|
20
|
+
...t.attributes
|
|
21
|
+
},
|
|
22
|
+
n() && t.imgSrc || "default-key"
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
g as default
|
|
27
|
+
};
|
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-a24928b8.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-50618347.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-a24928b8.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-e5610e53.cjs"),r=require("./content-variants-9084d7cf.cjs"),s=require("./server-entry-a24928b8.cjs"),U=require("./get-class-prop-name-5d642918.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;
|
package/lib/edge/{personalization-container-3a8dc18a.js → personalization-container-d477347e.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as v, jsx as l, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as Q, useState as c, useEffect as z } from "react";
|
|
3
|
-
import { Blocks as
|
|
4
|
-
import { getPersonalizationScript as J, getUpdateVisibilityStylesScript as M, checkShouldRenderVariants as Y, DEFAULT_INDEX as C, SDKS_REQUIRING_RESET_APPROACH as f, InlinedScript as
|
|
5
|
-
import { userAttributesService as N, getDefaultCanTrack as tt,
|
|
6
|
-
import { getClassPropName as O } from "./get-class-prop-name-
|
|
3
|
+
import { Blocks as m, InlinedStyles as X } from "./blocks-1bfa0619.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-5b95a71c.js";
|
|
5
|
+
import { userAttributesService as N, getDefaultCanTrack as tt, TARGET as b, isEditing as et, isPreviewing as it } from "./server-entry-50618347.js";
|
|
6
|
+
import { getClassPropName as O } from "./get-class-prop-name-de337a1b.js";
|
|
7
7
|
import "./blocks-exports.mjs";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
|
-
function
|
|
10
|
-
var $, y, E, R, P, V,
|
|
11
|
-
const a = Q(null), [
|
|
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
12
|
() => N.getUserAttributes()
|
|
13
13
|
), [S, nt] = c(
|
|
14
14
|
() => {
|
|
@@ -19,7 +19,7 @@ function Ct(t) {
|
|
|
19
19
|
(i = (n = t.builderContext) == null ? void 0 : n.rootState) == null ? void 0 : i.locale
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
), [
|
|
22
|
+
), [G, rt] = c(
|
|
23
23
|
() => {
|
|
24
24
|
var e, n, i;
|
|
25
25
|
return M(
|
|
@@ -36,8 +36,8 @@ function Ct(t) {
|
|
|
36
36
|
tt((e = t.builderContext) == null ? void 0 : e.canTrack)
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
), [
|
|
40
|
-
function
|
|
39
|
+
), [k, H] = c(() => !1);
|
|
40
|
+
function L() {
|
|
41
41
|
return {
|
|
42
42
|
...t.attributes,
|
|
43
43
|
[O()]: `builder-personalization-container ${t.attributes[O()] || ""}`
|
|
@@ -51,7 +51,7 @@ function Ct(t) {
|
|
|
51
51
|
...(i = (n = t.builderContext) == null ? void 0 : n.rootState) != null && i.locale ? {
|
|
52
52
|
locale: (r = (d = t.builderContext) == null ? void 0 : d.rootState) == null ? void 0 : r.locale
|
|
53
53
|
} : {},
|
|
54
|
-
...
|
|
54
|
+
...q
|
|
55
55
|
},
|
|
56
56
|
e.query,
|
|
57
57
|
e.startDate,
|
|
@@ -64,7 +64,7 @@ function Ct(t) {
|
|
|
64
64
|
return p({
|
|
65
65
|
variants: t.variants,
|
|
66
66
|
fallbackBlocks: (e = t.builderBlock) == null ? void 0 : e.children,
|
|
67
|
-
isHydrated:
|
|
67
|
+
isHydrated: k,
|
|
68
68
|
filteredVariants: g(),
|
|
69
69
|
previewingIndex: t.previewingIndex
|
|
70
70
|
});
|
|
@@ -79,10 +79,13 @@ function Ct(t) {
|
|
|
79
79
|
}
|
|
80
80
|
return z(() => {
|
|
81
81
|
var n;
|
|
82
|
-
|
|
82
|
+
H(!0);
|
|
83
83
|
const e = N.subscribeOnUserAttributesChange(
|
|
84
84
|
(i) => {
|
|
85
|
-
|
|
85
|
+
F(i);
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
fireImmediately: b === "qwik"
|
|
86
89
|
}
|
|
87
90
|
);
|
|
88
91
|
if (!(et() || it())) {
|
|
@@ -113,9 +116,9 @@ function Ct(t) {
|
|
|
113
116
|
x.push(e);
|
|
114
117
|
}, []), z(() => () => {
|
|
115
118
|
x.forEach((e) => e());
|
|
116
|
-
}, []), /* @__PURE__ */
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
}, []), /* @__PURE__ */ v("div", { ref: a, ...L(), children: [
|
|
120
|
+
k && f.includes(b) ? /* @__PURE__ */ l(
|
|
121
|
+
m,
|
|
119
122
|
{
|
|
120
123
|
blocks: o().blocks,
|
|
121
124
|
parent: ($ = t.builderBlock) == null ? void 0 : $.id,
|
|
@@ -128,8 +131,8 @@ function Ct(t) {
|
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
) : null,
|
|
131
|
-
!
|
|
132
|
-
B ? /* @__PURE__ */
|
|
134
|
+
!k && f.includes(b) || !f.includes(b) ? /* @__PURE__ */ v(j, { children: [
|
|
135
|
+
B ? /* @__PURE__ */ v(j, { children: [
|
|
133
136
|
/* @__PURE__ */ l(
|
|
134
137
|
X,
|
|
135
138
|
{
|
|
@@ -139,17 +142,17 @@ function Ct(t) {
|
|
|
139
142
|
}
|
|
140
143
|
),
|
|
141
144
|
/* @__PURE__ */ l(
|
|
142
|
-
|
|
145
|
+
h,
|
|
143
146
|
{
|
|
144
147
|
nonce: ((V = t.builderContext) == null ? void 0 : V.nonce) || "",
|
|
145
|
-
scriptStr:
|
|
146
|
-
id: `variants-visibility-script-${(
|
|
148
|
+
scriptStr: G,
|
|
149
|
+
id: `variants-visibility-script-${(I = t.builderBlock) == null ? void 0 : I.id}`
|
|
147
150
|
}
|
|
148
151
|
),
|
|
149
|
-
(
|
|
152
|
+
(A = t.variants) == null ? void 0 : A.map((e, n) => {
|
|
150
153
|
var i, d, r, u, s, _;
|
|
151
154
|
return /* @__PURE__ */ l(
|
|
152
|
-
|
|
155
|
+
m,
|
|
153
156
|
{
|
|
154
157
|
BlocksWrapperProps: {
|
|
155
158
|
...(i = t.builderContext) == null ? void 0 : i.BlocksWrapperProps,
|
|
@@ -163,7 +166,7 @@ function Ct(t) {
|
|
|
163
166
|
context: t.builderContext,
|
|
164
167
|
registeredComponents: t.builderComponents,
|
|
165
168
|
children: /* @__PURE__ */ l(
|
|
166
|
-
|
|
169
|
+
h,
|
|
167
170
|
{
|
|
168
171
|
nonce: ((u = t.builderContext) == null ? void 0 : u.nonce) || "",
|
|
169
172
|
scriptStr: S,
|
|
@@ -176,7 +179,7 @@ function Ct(t) {
|
|
|
176
179
|
})
|
|
177
180
|
] }) : null,
|
|
178
181
|
/* @__PURE__ */ l(
|
|
179
|
-
|
|
182
|
+
m,
|
|
180
183
|
{
|
|
181
184
|
blocks: o().blocks,
|
|
182
185
|
parent: (T = t.builderBlock) == null ? void 0 : T.id,
|
|
@@ -185,14 +188,14 @@ function Ct(t) {
|
|
|
185
188
|
registeredComponents: t.builderComponents,
|
|
186
189
|
BlocksWrapperProps: {
|
|
187
190
|
...(U = t.builderContext) == null ? void 0 : U.BlocksWrapperProps,
|
|
188
|
-
"data-variant-id": `${(
|
|
191
|
+
"data-variant-id": `${(w = t.builderBlock) == null ? void 0 : w.id}-${o().index}`
|
|
189
192
|
},
|
|
190
193
|
children: B ? /* @__PURE__ */ l(
|
|
191
|
-
|
|
194
|
+
h,
|
|
192
195
|
{
|
|
193
|
-
nonce: ((
|
|
196
|
+
nonce: ((D = t.builderContext) == null ? void 0 : D.nonce) || "",
|
|
194
197
|
scriptStr: S,
|
|
195
|
-
id: `variants-script-${(
|
|
198
|
+
id: `variants-script-${(W = t.builderBlock) == null ? void 0 : W.id}-${C}`
|
|
196
199
|
}
|
|
197
200
|
) : null
|
|
198
201
|
}
|
|
@@ -201,5 +204,5 @@ function Ct(t) {
|
|
|
201
204
|
] });
|
|
202
205
|
}
|
|
203
206
|
export {
|
|
204
|
-
|
|
207
|
+
mt as default
|
|
205
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-a24928b8.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-50618347.js";
|
|
4
4
|
function r(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ m(
|