@one-million-lines/email-builder 0.6.1 → 0.6.2
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/CHANGELOG.md +25 -0
- package/dist/email-builder.cjs +1 -1
- package/dist/email-builder.cjs.map +1 -1
- package/dist/email-builder.js +540 -487
- package/dist/email-builder.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/email-builder.js
CHANGED
|
@@ -5949,99 +5949,129 @@ function Ja({ title: e, active: t, disabled: n, onMouseDown: r, children: i }) {
|
|
|
5949
5949
|
function Ya() {
|
|
5950
5950
|
return /* @__PURE__ */ j("div", { className: "w-px h-5 bg-gray-200 mx-0.5 shrink-0" });
|
|
5951
5951
|
}
|
|
5952
|
-
|
|
5953
|
-
|
|
5952
|
+
var Xa = {
|
|
5953
|
+
selectedText: "",
|
|
5954
|
+
href: "",
|
|
5955
|
+
linkType: "",
|
|
5956
|
+
isEditing: !1
|
|
5957
|
+
};
|
|
5958
|
+
function Za(e) {
|
|
5959
|
+
return Object.entries(bt).find(([, t]) => t === e)?.[0] ?? "";
|
|
5960
|
+
}
|
|
5961
|
+
function Qa({ savedRange: e, initial: t, onClose: n }) {
|
|
5962
|
+
let [r, i] = f(t.href), [a, o] = f(t.linkType), c = d(null);
|
|
5954
5963
|
s(() => {
|
|
5955
|
-
setTimeout(() =>
|
|
5964
|
+
setTimeout(() => c.current?.focus(), 20);
|
|
5956
5965
|
}, []);
|
|
5957
|
-
let
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
let
|
|
5963
|
-
if (!
|
|
5964
|
-
|
|
5966
|
+
let l = (e) => {
|
|
5967
|
+
i(e), o(Za(e));
|
|
5968
|
+
}, u = (e) => {
|
|
5969
|
+
o(e), i(e ? bt[e] : "");
|
|
5970
|
+
}, p = () => {
|
|
5971
|
+
let t = r.trim();
|
|
5972
|
+
if (!t) {
|
|
5973
|
+
n();
|
|
5965
5974
|
return;
|
|
5966
5975
|
}
|
|
5967
5976
|
if (e) {
|
|
5968
5977
|
let t = e.commonAncestorContainer, n = (t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement)?.closest("[data-email-text]");
|
|
5969
|
-
n && n.focus(), qa(e);
|
|
5978
|
+
n && (n.focus(), qa(e));
|
|
5970
5979
|
}
|
|
5971
|
-
let
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5980
|
+
let i = (() => {
|
|
5981
|
+
if (!e) return t;
|
|
5982
|
+
let n = document.createElement("div");
|
|
5983
|
+
return n.appendChild(e.cloneContents()), n.innerHTML || n.textContent || t;
|
|
5984
|
+
})();
|
|
5985
|
+
Wa(`<a href="${t}"${a ? ` data-link-type="${a}"` : ""} style="color:inherit;text-decoration:underline">${i}</a>`), n();
|
|
5986
|
+
}, m = a !== "", h = r.trim().length > 0;
|
|
5977
5987
|
return /* @__PURE__ */ M("div", {
|
|
5978
|
-
className: "absolute bottom-full left-0 mb-1 z-50 bg-white border border-gray-200 rounded-
|
|
5988
|
+
className: "absolute bottom-full left-0 mb-1 z-50 bg-white border border-gray-200 rounded-xl shadow-xl",
|
|
5989
|
+
style: { width: 320 },
|
|
5979
5990
|
onMouseDown: (e) => e.stopPropagation(),
|
|
5980
|
-
children: [
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
5991
|
+
children: [/* @__PURE__ */ M("div", {
|
|
5992
|
+
className: "flex items-center justify-between px-4 pt-4 pb-2",
|
|
5993
|
+
children: [/* @__PURE__ */ j("span", {
|
|
5994
|
+
className: "text-sm font-semibold text-gray-900",
|
|
5995
|
+
children: t.isEditing ? "Edit link" : "Insert link"
|
|
5996
|
+
}), /* @__PURE__ */ j("button", {
|
|
5997
|
+
onClick: n,
|
|
5998
|
+
className: "text-gray-400 hover:text-gray-600 rounded p-0.5",
|
|
5999
|
+
children: /* @__PURE__ */ j(Ie, { size: 14 })
|
|
6000
|
+
})]
|
|
6001
|
+
}), /* @__PURE__ */ M("div", {
|
|
6002
|
+
className: "px-4 pb-4 flex flex-col gap-3",
|
|
6003
|
+
children: [
|
|
6004
|
+
t.selectedText && /* @__PURE__ */ M("div", {
|
|
6005
|
+
className: "flex items-start gap-2 text-xs bg-gray-50 rounded-lg px-3 py-2",
|
|
6006
|
+
children: [/* @__PURE__ */ j("span", {
|
|
6007
|
+
className: "text-gray-500 shrink-0 mt-0.5",
|
|
6008
|
+
children: "Text:"
|
|
6009
|
+
}), /* @__PURE__ */ j("span", {
|
|
6010
|
+
className: "text-gray-700 font-medium truncate",
|
|
6011
|
+
children: t.selectedText
|
|
6012
|
+
})]
|
|
6013
|
+
}),
|
|
6014
|
+
/* @__PURE__ */ M("div", { children: [
|
|
6015
|
+
/* @__PURE__ */ j("label", {
|
|
6016
|
+
className: "block text-xs text-gray-500 mb-1",
|
|
6017
|
+
children: "URL"
|
|
6018
|
+
}),
|
|
6019
|
+
/* @__PURE__ */ j("input", {
|
|
6020
|
+
ref: c,
|
|
6021
|
+
type: "text",
|
|
6022
|
+
placeholder: "https://example.com",
|
|
6023
|
+
value: r,
|
|
6024
|
+
onChange: (e) => l(e.target.value),
|
|
6025
|
+
className: "w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",
|
|
6026
|
+
onKeyDown: (e) => {
|
|
6027
|
+
e.key === "Enter" && h && p(), e.key === "Escape" && n();
|
|
6028
|
+
}
|
|
6029
|
+
}),
|
|
6030
|
+
m && /* @__PURE__ */ j("p", {
|
|
6031
|
+
className: "text-[11px] text-blue-600 mt-1 flex items-center gap-1",
|
|
6032
|
+
children: /* @__PURE__ */ j("span", { children: "↳ This placeholder will be replaced with the real URL at send time." })
|
|
6033
|
+
})
|
|
6034
|
+
] }),
|
|
6035
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("label", {
|
|
6036
|
+
className: "block text-xs text-gray-500 mb-1",
|
|
6037
|
+
children: ["Link type ", /* @__PURE__ */ j("span", {
|
|
6038
|
+
className: "text-gray-400 font-normal",
|
|
6039
|
+
children: "(optional — for system links)"
|
|
6040
|
+
})]
|
|
6010
6041
|
}), /* @__PURE__ */ M("select", {
|
|
6011
|
-
value:
|
|
6012
|
-
onChange: (e) =>
|
|
6013
|
-
|
|
6014
|
-
},
|
|
6015
|
-
className: "w-full px-2 py-1.5 text-xs border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white",
|
|
6042
|
+
value: a,
|
|
6043
|
+
onChange: (e) => u(e.target.value),
|
|
6044
|
+
className: "w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:border-blue-500 focus:outline-none bg-white",
|
|
6016
6045
|
children: [/* @__PURE__ */ j("option", {
|
|
6017
6046
|
value: "",
|
|
6018
|
-
children: "—
|
|
6019
|
-
}), Object.keys(Va).map((e) => /* @__PURE__ */
|
|
6047
|
+
children: "— Custom URL (no special type) —"
|
|
6048
|
+
}), Object.keys(Va).map((e) => /* @__PURE__ */ M("option", {
|
|
6020
6049
|
value: e,
|
|
6021
|
-
children:
|
|
6050
|
+
children: [
|
|
6051
|
+
Va[e],
|
|
6052
|
+
" — ",
|
|
6053
|
+
bt[e]
|
|
6054
|
+
]
|
|
6022
6055
|
}, e))]
|
|
6023
|
-
})]
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
})]
|
|
6040
|
-
})
|
|
6041
|
-
]
|
|
6056
|
+
})] }),
|
|
6057
|
+
/* @__PURE__ */ M("div", {
|
|
6058
|
+
className: "flex gap-2 pt-1",
|
|
6059
|
+
children: [/* @__PURE__ */ j("button", {
|
|
6060
|
+
onClick: p,
|
|
6061
|
+
disabled: !h,
|
|
6062
|
+
className: "flex-1 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
|
|
6063
|
+
children: t.isEditing ? "Update link" : "Insert link"
|
|
6064
|
+
}), /* @__PURE__ */ j("button", {
|
|
6065
|
+
onClick: n,
|
|
6066
|
+
className: "px-4 py-2 text-sm text-gray-600 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",
|
|
6067
|
+
children: "Cancel"
|
|
6068
|
+
})]
|
|
6069
|
+
})
|
|
6070
|
+
]
|
|
6071
|
+
})]
|
|
6042
6072
|
});
|
|
6043
6073
|
}
|
|
6044
|
-
function
|
|
6074
|
+
function $a({ onClose: e }) {
|
|
6045
6075
|
let [t, n] = f(""), r = (t) => {
|
|
6046
6076
|
document.execCommand("styleWithCSS", !1, "true"), document.execCommand("foreColor", !1, t), e();
|
|
6047
6077
|
};
|
|
@@ -6076,7 +6106,7 @@ function Za({ onClose: e }) {
|
|
|
6076
6106
|
})]
|
|
6077
6107
|
});
|
|
6078
6108
|
}
|
|
6079
|
-
function
|
|
6109
|
+
function eo({ onClose: e }) {
|
|
6080
6110
|
let t = (t) => {
|
|
6081
6111
|
Wa(t), e();
|
|
6082
6112
|
};
|
|
@@ -6094,7 +6124,7 @@ function Qa({ onClose: e }) {
|
|
|
6094
6124
|
})
|
|
6095
6125
|
});
|
|
6096
6126
|
}
|
|
6097
|
-
function
|
|
6127
|
+
function to({ onClose: e }) {
|
|
6098
6128
|
let t = Fa((e) => e.mergeTags), n = (t) => {
|
|
6099
6129
|
Wa(`{${t}}`), e();
|
|
6100
6130
|
};
|
|
@@ -6112,7 +6142,7 @@ function $a({ onClose: e }) {
|
|
|
6112
6142
|
}, e.attribute))
|
|
6113
6143
|
});
|
|
6114
6144
|
}
|
|
6115
|
-
function
|
|
6145
|
+
function no() {
|
|
6116
6146
|
let e = Pa((e) => e.activeEl), t = Fa((e) => e.mergeTags), [n, r] = f(!1), [i, o] = f({
|
|
6117
6147
|
top: 0,
|
|
6118
6148
|
left: 0
|
|
@@ -6120,19 +6150,19 @@ function eo() {
|
|
|
6120
6150
|
bold: !1,
|
|
6121
6151
|
italic: !1,
|
|
6122
6152
|
underline: !1
|
|
6123
|
-
}), [u, p] = f(null), [m, h] = f(null), g = d(null),
|
|
6153
|
+
}), [u, p] = f(null), [m, h] = f(null), [g, _] = f(Xa), v = d(null), y = d(null), b = a(() => p(null), []), S = a(() => {
|
|
6124
6154
|
let t = window.getSelection();
|
|
6125
6155
|
if (!t) return;
|
|
6126
6156
|
let n = null;
|
|
6127
6157
|
if (!t.isCollapsed && t.rangeCount > 0 ? n = t.getRangeAt(0).getBoundingClientRect() : e && (n = e.getBoundingClientRect()), !n || n.width === 0 && n.height === 0) return;
|
|
6128
|
-
let r =
|
|
6158
|
+
let r = v.current?.offsetHeight ?? 40, i = v.current?.offsetWidth ?? 440, a = n.top - r - 6;
|
|
6129
6159
|
a < 8 && (a = n.bottom + 6), a = Math.min(a, window.innerHeight - r - 8), a = Math.max(a, 8);
|
|
6130
6160
|
let s = n.left + n.width / 2 - i / 2;
|
|
6131
6161
|
s = Math.max(8, Math.min(s, window.innerWidth - i - 8)), o({
|
|
6132
6162
|
top: a,
|
|
6133
6163
|
left: s
|
|
6134
6164
|
});
|
|
6135
|
-
}, [e]),
|
|
6165
|
+
}, [e]), C = a(() => {
|
|
6136
6166
|
l({
|
|
6137
6167
|
bold: document.queryCommandState("bold"),
|
|
6138
6168
|
italic: document.queryCommandState("italic"),
|
|
@@ -6141,39 +6171,61 @@ function eo() {
|
|
|
6141
6171
|
}, []);
|
|
6142
6172
|
if (s(() => {
|
|
6143
6173
|
if (!e) {
|
|
6144
|
-
|
|
6174
|
+
y.current && clearTimeout(y.current), y.current = setTimeout(() => r(!1), 150);
|
|
6145
6175
|
return;
|
|
6146
6176
|
}
|
|
6147
|
-
|
|
6177
|
+
y.current && clearTimeout(y.current), r(!0), S(), C();
|
|
6148
6178
|
}, [
|
|
6149
6179
|
e,
|
|
6150
|
-
|
|
6151
|
-
|
|
6180
|
+
S,
|
|
6181
|
+
C
|
|
6152
6182
|
]), s(() => {
|
|
6153
6183
|
let t = () => {
|
|
6154
|
-
e && (
|
|
6184
|
+
e && (S(), C());
|
|
6155
6185
|
};
|
|
6156
6186
|
return document.addEventListener("selectionchange", t), () => document.removeEventListener("selectionchange", t);
|
|
6157
6187
|
}, [
|
|
6158
6188
|
e,
|
|
6159
|
-
|
|
6160
|
-
|
|
6189
|
+
S,
|
|
6190
|
+
C
|
|
6161
6191
|
]), s(() => {
|
|
6162
6192
|
let e = (e) => {
|
|
6163
|
-
|
|
6193
|
+
v.current && !v.current.contains(e.target) && b();
|
|
6164
6194
|
};
|
|
6165
6195
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
6166
|
-
}, [
|
|
6167
|
-
let
|
|
6196
|
+
}, [b]), !n || !e) return null;
|
|
6197
|
+
let w = (e) => (t) => {
|
|
6168
6198
|
t.preventDefault(), e();
|
|
6169
|
-
},
|
|
6170
|
-
|
|
6171
|
-
|
|
6199
|
+
}, T = (e) => {
|
|
6200
|
+
if (e === "link") {
|
|
6201
|
+
let e = Ka();
|
|
6202
|
+
h(e);
|
|
6203
|
+
let t = "", n = "", r = "", i = !1;
|
|
6204
|
+
if (e) {
|
|
6205
|
+
let a = document.createElement("div");
|
|
6206
|
+
a.appendChild(e.cloneContents()), t = (a.textContent || "").trim();
|
|
6207
|
+
let o = window.getSelection()?.focusNode, s = o ? o.nodeType === Node.ELEMENT_NODE ? o.closest("a") : o.parentElement?.closest("a") : null;
|
|
6208
|
+
if (s) {
|
|
6209
|
+
i = !0, n = s.getAttribute("href") || "";
|
|
6210
|
+
let e = s.getAttribute("data-link-type") || "";
|
|
6211
|
+
r = Za(n) || e, r && (n = bt[r]);
|
|
6212
|
+
}
|
|
6213
|
+
}
|
|
6214
|
+
_({
|
|
6215
|
+
selectedText: t,
|
|
6216
|
+
href: n,
|
|
6217
|
+
linkType: r,
|
|
6218
|
+
isEditing: i
|
|
6219
|
+
}), p((e) => e === "link" ? null : "link");
|
|
6220
|
+
return;
|
|
6221
|
+
}
|
|
6222
|
+
p((t) => t === e ? null : e);
|
|
6223
|
+
}, ee = () => {
|
|
6172
6224
|
let e = window.getSelection();
|
|
6173
6225
|
return e && !e.isCollapsed;
|
|
6174
6226
|
};
|
|
6175
6227
|
return /* @__PURE__ */ M("div", {
|
|
6176
|
-
ref:
|
|
6228
|
+
ref: v,
|
|
6177
6229
|
"data-rich-toolbar": "true",
|
|
6178
6230
|
className: "fixed z-[9999] flex items-center gap-0.5 bg-white border border-gray-200 rounded-lg shadow-lg px-1.5 py-1 select-none",
|
|
6179
6231
|
style: {
|
|
@@ -6185,7 +6237,7 @@ function eo() {
|
|
|
6185
6237
|
/* @__PURE__ */ j(Ja, {
|
|
6186
6238
|
title: "Bold (Ctrl+B)",
|
|
6187
6239
|
active: c.bold,
|
|
6188
|
-
onMouseDown:
|
|
6240
|
+
onMouseDown: w(() => Ua("bold")),
|
|
6189
6241
|
children: /* @__PURE__ */ j("b", {
|
|
6190
6242
|
style: {
|
|
6191
6243
|
fontSize: 13,
|
|
@@ -6197,7 +6249,7 @@ function eo() {
|
|
|
6197
6249
|
/* @__PURE__ */ j(Ja, {
|
|
6198
6250
|
title: "Italic (Ctrl+I)",
|
|
6199
6251
|
active: c.italic,
|
|
6200
|
-
onMouseDown:
|
|
6252
|
+
onMouseDown: w(() => Ua("italic")),
|
|
6201
6253
|
children: /* @__PURE__ */ j("i", {
|
|
6202
6254
|
style: {
|
|
6203
6255
|
fontSize: 13,
|
|
@@ -6209,7 +6261,7 @@ function eo() {
|
|
|
6209
6261
|
/* @__PURE__ */ j(Ja, {
|
|
6210
6262
|
title: "Underline (Ctrl+U)",
|
|
6211
6263
|
active: c.underline,
|
|
6212
|
-
onMouseDown:
|
|
6264
|
+
onMouseDown: w(() => Ua("underline")),
|
|
6213
6265
|
children: /* @__PURE__ */ j("u", {
|
|
6214
6266
|
style: { fontSize: 13 },
|
|
6215
6267
|
children: "U"
|
|
@@ -6224,7 +6276,7 @@ function eo() {
|
|
|
6224
6276
|
onChange: (t) => {
|
|
6225
6277
|
let n = t.target.value;
|
|
6226
6278
|
if (n) {
|
|
6227
|
-
if (!
|
|
6279
|
+
if (!ee()) {
|
|
6228
6280
|
e?.focus();
|
|
6229
6281
|
return;
|
|
6230
6282
|
}
|
|
@@ -6244,7 +6296,7 @@ function eo() {
|
|
|
6244
6296
|
onChange: (t) => {
|
|
6245
6297
|
let n = t.target.value;
|
|
6246
6298
|
if (n) {
|
|
6247
|
-
if (!
|
|
6299
|
+
if (!ee()) {
|
|
6248
6300
|
e?.focus();
|
|
6249
6301
|
return;
|
|
6250
6302
|
}
|
|
@@ -6264,7 +6316,7 @@ function eo() {
|
|
|
6264
6316
|
className: "relative",
|
|
6265
6317
|
children: [/* @__PURE__ */ j(Ja, {
|
|
6266
6318
|
title: "Text color",
|
|
6267
|
-
onMouseDown:
|
|
6319
|
+
onMouseDown: w(() => T("color")),
|
|
6268
6320
|
children: /* @__PURE__ */ M("span", {
|
|
6269
6321
|
className: "flex flex-col items-center gap-0.5",
|
|
6270
6322
|
children: [/* @__PURE__ */ j("span", {
|
|
@@ -6273,18 +6325,19 @@ function eo() {
|
|
|
6273
6325
|
children: "A"
|
|
6274
6326
|
}), /* @__PURE__ */ j("span", { className: "w-4 h-1 rounded-sm bg-current" })]
|
|
6275
6327
|
})
|
|
6276
|
-
}), u === "color" && /* @__PURE__ */ j(
|
|
6328
|
+
}), u === "color" && /* @__PURE__ */ j($a, { onClose: b })]
|
|
6277
6329
|
}),
|
|
6278
6330
|
/* @__PURE__ */ j(Ya, {}),
|
|
6279
6331
|
/* @__PURE__ */ M("div", {
|
|
6280
6332
|
className: "relative",
|
|
6281
6333
|
children: [/* @__PURE__ */ j(Ja, {
|
|
6282
6334
|
title: "Insert link",
|
|
6283
|
-
onMouseDown:
|
|
6335
|
+
onMouseDown: w(() => T("link")),
|
|
6284
6336
|
children: /* @__PURE__ */ j(se, { size: 13 })
|
|
6285
|
-
}), u === "link" && /* @__PURE__ */ j(
|
|
6337
|
+
}), u === "link" && /* @__PURE__ */ j(Qa, {
|
|
6286
6338
|
savedRange: m,
|
|
6287
|
-
|
|
6339
|
+
initial: g,
|
|
6340
|
+
onClose: b
|
|
6288
6341
|
})]
|
|
6289
6342
|
}),
|
|
6290
6343
|
/* @__PURE__ */ j(Ya, {}),
|
|
@@ -6292,34 +6345,34 @@ function eo() {
|
|
|
6292
6345
|
className: "relative",
|
|
6293
6346
|
children: [/* @__PURE__ */ j(Ja, {
|
|
6294
6347
|
title: "Insert emoji",
|
|
6295
|
-
onMouseDown:
|
|
6348
|
+
onMouseDown: w(() => T("emoji")),
|
|
6296
6349
|
children: /* @__PURE__ */ j(Ee, { size: 13 })
|
|
6297
|
-
}), u === "emoji" && /* @__PURE__ */ j(
|
|
6350
|
+
}), u === "emoji" && /* @__PURE__ */ j(eo, { onClose: b })]
|
|
6298
6351
|
}),
|
|
6299
6352
|
t.length > 0 && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(Ya, {}), /* @__PURE__ */ M("div", {
|
|
6300
6353
|
className: "relative",
|
|
6301
6354
|
children: [/* @__PURE__ */ j(Ja, {
|
|
6302
6355
|
title: "Insert merge tag",
|
|
6303
|
-
onMouseDown:
|
|
6356
|
+
onMouseDown: w(() => T("mergeTag")),
|
|
6304
6357
|
children: /* @__PURE__ */ M("span", {
|
|
6305
6358
|
className: "flex items-center gap-0.5 text-[10px] font-mono",
|
|
6306
6359
|
children: [/* @__PURE__ */ j(Ae, { size: 11 }), /* @__PURE__ */ j(x, { size: 10 })]
|
|
6307
6360
|
})
|
|
6308
|
-
}), u === "mergeTag" && /* @__PURE__ */ j(
|
|
6361
|
+
}), u === "mergeTag" && /* @__PURE__ */ j(to, { onClose: b })]
|
|
6309
6362
|
})] })
|
|
6310
6363
|
]
|
|
6311
6364
|
});
|
|
6312
6365
|
}
|
|
6313
6366
|
//#endregion
|
|
6314
6367
|
//#region src/editor/Canvas.tsx
|
|
6315
|
-
var
|
|
6316
|
-
function
|
|
6368
|
+
var ro = 375;
|
|
6369
|
+
function io(e) {
|
|
6317
6370
|
let t = e.replace("#", "");
|
|
6318
6371
|
if (t.length !== 3 && t.length !== 6) return e === "white" || e === "#fff" || e === "#ffffff";
|
|
6319
6372
|
let n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255;
|
|
6320
6373
|
return .2126 * r + .7152 * i + .0722 * a > .82;
|
|
6321
6374
|
}
|
|
6322
|
-
function
|
|
6375
|
+
function ao(e, t) {
|
|
6323
6376
|
let n = e ?? {};
|
|
6324
6377
|
if (t !== "mobile") return n;
|
|
6325
6378
|
let r = n.mobile ?? {};
|
|
@@ -6328,7 +6381,7 @@ function ro(e, t) {
|
|
|
6328
6381
|
...r
|
|
6329
6382
|
};
|
|
6330
6383
|
}
|
|
6331
|
-
function
|
|
6384
|
+
function oo() {
|
|
6332
6385
|
let { doc: e, selection: t, setSelection: n, reorderModules: r, deleteModule: i, duplicateModule: a, deleteElement: o, moveElement: c, viewMode: l } = F(), u = rr(nr(ri, { activationConstraint: { distance: 5 } }), nr(Qr, { coordinateGetter: ja })), d = (t) => {
|
|
6333
6386
|
let { active: n, over: i } = t;
|
|
6334
6387
|
if (!i || n.id === i.id) return;
|
|
@@ -6347,8 +6400,8 @@ function io() {
|
|
|
6347
6400
|
i,
|
|
6348
6401
|
o
|
|
6349
6402
|
]);
|
|
6350
|
-
let f = Ge(e.settings.backgroundColor, e.theme), p = Ge(e.settings.contentBackgroundColor, e.theme), m = e.modules.map((e) => e.id), h = l === "mobile" ?
|
|
6351
|
-
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(
|
|
6403
|
+
let f = Ge(e.settings.backgroundColor, e.theme), p = Ge(e.settings.contentBackgroundColor, e.theme), m = e.modules.map((e) => e.id), h = l === "mobile" ? ro : e.settings.width;
|
|
6404
|
+
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(no, {}), /* @__PURE__ */ j("div", {
|
|
6352
6405
|
className: "flex-1 overflow-y-auto",
|
|
6353
6406
|
style: { background: f },
|
|
6354
6407
|
onClick: () => n({ kind: "email" }),
|
|
@@ -6372,7 +6425,7 @@ function io() {
|
|
|
6372
6425
|
children: /* @__PURE__ */ j(ya, {
|
|
6373
6426
|
items: m,
|
|
6374
6427
|
strategy: ha,
|
|
6375
|
-
children: e.modules.map((r, o) => /* @__PURE__ */ j(
|
|
6428
|
+
children: e.modules.map((r, o) => /* @__PURE__ */ j(so, {
|
|
6376
6429
|
mod: r,
|
|
6377
6430
|
index: o,
|
|
6378
6431
|
viewMode: l,
|
|
@@ -6397,7 +6450,7 @@ function io() {
|
|
|
6397
6450
|
})
|
|
6398
6451
|
})] });
|
|
6399
6452
|
}
|
|
6400
|
-
function
|
|
6453
|
+
function so(e) {
|
|
6401
6454
|
let { attributes: t, listeners: n, setNodeRef: r, transform: i, transition: a, isDragging: o } = Da({ id: e.mod.id });
|
|
6402
6455
|
return /* @__PURE__ */ j("div", {
|
|
6403
6456
|
ref: r,
|
|
@@ -6408,7 +6461,7 @@ function ao(e) {
|
|
|
6408
6461
|
position: "relative",
|
|
6409
6462
|
zIndex: e.selected ? 10 : "auto"
|
|
6410
6463
|
},
|
|
6411
|
-
children: /* @__PURE__ */ j(
|
|
6464
|
+
children: /* @__PURE__ */ j(co, {
|
|
6412
6465
|
mod: e.mod,
|
|
6413
6466
|
viewMode: e.viewMode,
|
|
6414
6467
|
selected: e.selected,
|
|
@@ -6429,10 +6482,10 @@ function ao(e) {
|
|
|
6429
6482
|
})
|
|
6430
6483
|
});
|
|
6431
6484
|
}
|
|
6432
|
-
function
|
|
6485
|
+
function co({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSelectModule: a, onSelectElement: o, onDuplicate: s, onDelete: c, dragHandle: l }) {
|
|
6433
6486
|
let u = e.style ?? {};
|
|
6434
6487
|
if (u.hideOn === t) return null;
|
|
6435
|
-
let d = Ke(
|
|
6488
|
+
let d = Ke(ao(u, t), i), [p, m] = f(!1);
|
|
6436
6489
|
return /* @__PURE__ */ M("div", {
|
|
6437
6490
|
style: {
|
|
6438
6491
|
backgroundColor: d.backgroundColor,
|
|
@@ -6483,7 +6536,7 @@ function oo({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSele
|
|
|
6483
6536
|
})
|
|
6484
6537
|
]
|
|
6485
6538
|
}),
|
|
6486
|
-
e.children.map((s, c) => /* @__PURE__ */ j(
|
|
6539
|
+
e.children.map((s, c) => /* @__PURE__ */ j(lo, {
|
|
6487
6540
|
el: s,
|
|
6488
6541
|
index: c,
|
|
6489
6542
|
totalElements: e.children.length,
|
|
@@ -6498,7 +6551,7 @@ function oo({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSele
|
|
|
6498
6551
|
]
|
|
6499
6552
|
});
|
|
6500
6553
|
}
|
|
6501
|
-
function
|
|
6554
|
+
function lo({ el: e, index: t, totalElements: n, viewMode: r, theme: i, moduleId: a, moduleSelected: o, selected: s, onSelect: c, onSelectModule: l }) {
|
|
6502
6555
|
let u = F((e) => e.moveElement), d = F((e) => e.deleteElement);
|
|
6503
6556
|
if (e.style?.hideOn === r) return null;
|
|
6504
6557
|
let f = {
|
|
@@ -6552,42 +6605,42 @@ function so({ el: e, index: t, totalElements: n, viewMode: r, theme: i, moduleId
|
|
|
6552
6605
|
children: [m, e]
|
|
6553
6606
|
});
|
|
6554
6607
|
switch (e.type) {
|
|
6555
|
-
case "text": return h(/* @__PURE__ */ j(
|
|
6608
|
+
case "text": return h(/* @__PURE__ */ j(uo, {
|
|
6556
6609
|
el: e,
|
|
6557
6610
|
viewMode: r,
|
|
6558
6611
|
theme: i,
|
|
6559
6612
|
moduleId: a
|
|
6560
6613
|
}));
|
|
6561
|
-
case "image": return h(/* @__PURE__ */ j(
|
|
6614
|
+
case "image": return h(/* @__PURE__ */ j(fo, {
|
|
6562
6615
|
el: e,
|
|
6563
6616
|
viewMode: r,
|
|
6564
6617
|
theme: i
|
|
6565
6618
|
}));
|
|
6566
|
-
case "button": return h(/* @__PURE__ */ j(
|
|
6619
|
+
case "button": return h(/* @__PURE__ */ j(po, {
|
|
6567
6620
|
el: e,
|
|
6568
6621
|
viewMode: r,
|
|
6569
6622
|
theme: i
|
|
6570
6623
|
}));
|
|
6571
|
-
case "spacer": return h(/* @__PURE__ */ j(
|
|
6572
|
-
case "divider": return h(/* @__PURE__ */ j(
|
|
6624
|
+
case "spacer": return h(/* @__PURE__ */ j(mo, { el: e }));
|
|
6625
|
+
case "divider": return h(/* @__PURE__ */ j(ho, {
|
|
6573
6626
|
el: e,
|
|
6574
6627
|
viewMode: r,
|
|
6575
6628
|
theme: i
|
|
6576
6629
|
}));
|
|
6577
|
-
case "productGrid": return h(/* @__PURE__ */ j(
|
|
6630
|
+
case "productGrid": return h(/* @__PURE__ */ j(go, {
|
|
6578
6631
|
el: e,
|
|
6579
6632
|
viewMode: r,
|
|
6580
6633
|
theme: i
|
|
6581
6634
|
}));
|
|
6582
6635
|
}
|
|
6583
6636
|
}
|
|
6584
|
-
function
|
|
6637
|
+
function uo({ el: e, viewMode: t, theme: n, moduleId: r }) {
|
|
6585
6638
|
let i = F((e) => e.updateElement), a = Pa((e) => e.setActiveEl), o = d(null), c = d(!1), l = d(!1), u = d(e.content);
|
|
6586
6639
|
u.current = e.content, s(() => {
|
|
6587
6640
|
let t = o.current;
|
|
6588
6641
|
!t || c.current || t.innerHTML !== e.content && (t.innerHTML = e.content);
|
|
6589
6642
|
});
|
|
6590
|
-
let f = Ke(
|
|
6643
|
+
let f = Ke(ao(e.style, t), n), p = f.color ?? "#000000", m = io(p);
|
|
6591
6644
|
return /* @__PURE__ */ j("div", {
|
|
6592
6645
|
ref: o,
|
|
6593
6646
|
"data-email-text": "true",
|
|
@@ -6623,8 +6676,8 @@ function co({ el: e, viewMode: t, theme: n, moduleId: r }) {
|
|
|
6623
6676
|
}
|
|
6624
6677
|
});
|
|
6625
6678
|
}
|
|
6626
|
-
function
|
|
6627
|
-
let r = Ke(
|
|
6679
|
+
function fo({ el: e, viewMode: t, theme: n }) {
|
|
6680
|
+
let r = Ke(ao(e.style, t), n), i = {
|
|
6628
6681
|
textAlign: r.align ?? "center",
|
|
6629
6682
|
paddingTop: r.paddingTop ?? 0,
|
|
6630
6683
|
paddingBottom: r.paddingBottom ?? 0,
|
|
@@ -6646,8 +6699,8 @@ function lo({ el: e, viewMode: t, theme: n }) {
|
|
|
6646
6699
|
})
|
|
6647
6700
|
});
|
|
6648
6701
|
}
|
|
6649
|
-
function
|
|
6650
|
-
let r = Ke(
|
|
6702
|
+
function po({ el: e, viewMode: t, theme: n }) {
|
|
6703
|
+
let r = Ke(ao(e.style, t), n);
|
|
6651
6704
|
return /* @__PURE__ */ j("div", {
|
|
6652
6705
|
style: {
|
|
6653
6706
|
textAlign: r.align ?? "center",
|
|
@@ -6672,14 +6725,14 @@ function uo({ el: e, viewMode: t, theme: n }) {
|
|
|
6672
6725
|
})
|
|
6673
6726
|
});
|
|
6674
6727
|
}
|
|
6675
|
-
function
|
|
6728
|
+
function mo({ el: e }) {
|
|
6676
6729
|
return /* @__PURE__ */ j("div", { style: {
|
|
6677
6730
|
height: e.height,
|
|
6678
6731
|
background: "rgba(0,0,0,0.02)"
|
|
6679
6732
|
} });
|
|
6680
6733
|
}
|
|
6681
|
-
function
|
|
6682
|
-
let r = Ke(
|
|
6734
|
+
function ho({ el: e, viewMode: t, theme: n }) {
|
|
6735
|
+
let r = Ke(ao(e.style, t), n);
|
|
6683
6736
|
return /* @__PURE__ */ j("div", {
|
|
6684
6737
|
style: {
|
|
6685
6738
|
paddingTop: r.paddingTop ?? 8,
|
|
@@ -6692,8 +6745,8 @@ function po({ el: e, viewMode: t, theme: n }) {
|
|
|
6692
6745
|
} })
|
|
6693
6746
|
});
|
|
6694
6747
|
}
|
|
6695
|
-
function
|
|
6696
|
-
let r = Ke(
|
|
6748
|
+
function go({ el: e, viewMode: t, theme: n }) {
|
|
6749
|
+
let r = Ke(ao(e.style, t), n), i = t === "mobile", a = e.columns, o = r.cardBackgroundColor ?? r.backgroundColor ?? "transparent", s = r.nameColor ?? "#111827", c = r.finalPriceColor ?? "#3A7D52", l = r.oldPriceColor ?? "#9CA3AF", u = r.buttonBackgroundColor ?? "#3A7D52", d = r.buttonColor ?? "#FFFFFF", f = r.borderRadius ?? 0;
|
|
6697
6750
|
return /* @__PURE__ */ j("div", {
|
|
6698
6751
|
style: {
|
|
6699
6752
|
paddingTop: r.paddingTop ?? 16,
|
|
@@ -6806,95 +6859,95 @@ function mo({ el: e, viewMode: t, theme: n }) {
|
|
|
6806
6859
|
}
|
|
6807
6860
|
//#endregion
|
|
6808
6861
|
//#region src/plugins/productSearch/state.ts
|
|
6809
|
-
var
|
|
6810
|
-
function
|
|
6811
|
-
|
|
6812
|
-
for (let e of
|
|
6862
|
+
var _o = null, vo = /* @__PURE__ */ new Set(), yo = 0;
|
|
6863
|
+
function bo() {
|
|
6864
|
+
yo += 1;
|
|
6865
|
+
for (let e of vo) e();
|
|
6813
6866
|
}
|
|
6814
|
-
function
|
|
6815
|
-
|
|
6867
|
+
function xo(e) {
|
|
6868
|
+
_o !== e && (_o = e, bo());
|
|
6816
6869
|
}
|
|
6817
|
-
function
|
|
6818
|
-
return
|
|
6870
|
+
function So() {
|
|
6871
|
+
return _o;
|
|
6819
6872
|
}
|
|
6820
|
-
var
|
|
6821
|
-
|
|
6822
|
-
}),
|
|
6873
|
+
var Co = (e) => (vo.add(e), () => {
|
|
6874
|
+
vo.delete(e);
|
|
6875
|
+
}), wo = () => yo, To = null, Eo = {
|
|
6823
6876
|
status: "idle",
|
|
6824
6877
|
vouchers: []
|
|
6825
|
-
},
|
|
6826
|
-
function
|
|
6827
|
-
|
|
6828
|
-
for (let e of
|
|
6878
|
+
}, Do = null, Oo = /* @__PURE__ */ new Set(), ko = 0;
|
|
6879
|
+
function Ao() {
|
|
6880
|
+
ko += 1;
|
|
6881
|
+
for (let e of Oo) e();
|
|
6829
6882
|
}
|
|
6830
|
-
function
|
|
6831
|
-
|
|
6883
|
+
function jo(e) {
|
|
6884
|
+
To !== e && (To = e, Eo = {
|
|
6832
6885
|
status: "idle",
|
|
6833
6886
|
vouchers: []
|
|
6834
|
-
},
|
|
6887
|
+
}, Do = null, Ao());
|
|
6835
6888
|
}
|
|
6836
|
-
function
|
|
6837
|
-
return
|
|
6889
|
+
function Mo() {
|
|
6890
|
+
return To;
|
|
6838
6891
|
}
|
|
6839
|
-
function
|
|
6840
|
-
return
|
|
6892
|
+
function No() {
|
|
6893
|
+
return Eo;
|
|
6841
6894
|
}
|
|
6842
|
-
function
|
|
6843
|
-
if (!
|
|
6844
|
-
if (!e &&
|
|
6845
|
-
if (
|
|
6846
|
-
|
|
6895
|
+
function Po(e = !1) {
|
|
6896
|
+
if (!To) return Promise.resolve([]);
|
|
6897
|
+
if (!e && Eo.status === "loaded") return Promise.resolve(Eo.vouchers);
|
|
6898
|
+
if (Do) return Do;
|
|
6899
|
+
Eo = {
|
|
6847
6900
|
status: "loading",
|
|
6848
|
-
vouchers:
|
|
6849
|
-
},
|
|
6850
|
-
let t =
|
|
6901
|
+
vouchers: Eo.vouchers
|
|
6902
|
+
}, Ao();
|
|
6903
|
+
let t = To.list().then((e) => (Eo = {
|
|
6851
6904
|
status: "loaded",
|
|
6852
6905
|
vouchers: Array.isArray(e) ? e : []
|
|
6853
|
-
},
|
|
6906
|
+
}, Do = null, Ao(), Eo.vouchers)).catch((e) => (Eo = {
|
|
6854
6907
|
status: "error",
|
|
6855
6908
|
vouchers: [],
|
|
6856
6909
|
error: e instanceof Error ? e.message : String(e)
|
|
6857
|
-
},
|
|
6858
|
-
return
|
|
6910
|
+
}, Do = null, Ao(), []));
|
|
6911
|
+
return Do = t, t;
|
|
6859
6912
|
}
|
|
6860
|
-
var
|
|
6861
|
-
|
|
6862
|
-
}),
|
|
6913
|
+
var Fo = (e) => (Oo.add(e), () => {
|
|
6914
|
+
Oo.delete(e);
|
|
6915
|
+
}), Io = () => ko, Lo = h((e) => ({
|
|
6863
6916
|
enabled: !1,
|
|
6864
6917
|
setEnabled: (t) => e({ enabled: t })
|
|
6865
6918
|
}));
|
|
6866
|
-
function
|
|
6867
|
-
|
|
6919
|
+
function Ro() {
|
|
6920
|
+
Lo.getState().setEnabled(!0);
|
|
6868
6921
|
}
|
|
6869
6922
|
//#endregion
|
|
6870
6923
|
//#region src/core/plugins.ts
|
|
6871
|
-
var
|
|
6924
|
+
var zo = [], Bo = null, Vo = {
|
|
6872
6925
|
registerModule: (e) => Wt.register(e),
|
|
6873
|
-
registerTheme: (e) =>
|
|
6926
|
+
registerTheme: (e) => zo.push(e),
|
|
6874
6927
|
registerAssetProvider: (e) => {
|
|
6875
|
-
|
|
6928
|
+
Bo = e;
|
|
6876
6929
|
},
|
|
6877
6930
|
registerProductProvider: (e) => {
|
|
6878
|
-
|
|
6931
|
+
xo(e);
|
|
6879
6932
|
},
|
|
6880
6933
|
registerVoucherProvider: (e) => {
|
|
6881
|
-
|
|
6934
|
+
jo(e);
|
|
6882
6935
|
},
|
|
6883
6936
|
setAIProvider: (e) => {
|
|
6884
6937
|
Xt(e);
|
|
6885
6938
|
},
|
|
6886
6939
|
registerMergeTags: (e) => Ia(e),
|
|
6887
|
-
registerRecommendationsPlugin: () =>
|
|
6940
|
+
registerRecommendationsPlugin: () => Ro()
|
|
6888
6941
|
};
|
|
6889
|
-
function
|
|
6890
|
-
e.setup(
|
|
6942
|
+
function Ho(e) {
|
|
6943
|
+
e.setup(Vo);
|
|
6891
6944
|
}
|
|
6892
|
-
function
|
|
6893
|
-
return
|
|
6945
|
+
function Uo() {
|
|
6946
|
+
return Bo;
|
|
6894
6947
|
}
|
|
6895
6948
|
//#endregion
|
|
6896
6949
|
//#region src/recommendations/logic.ts
|
|
6897
|
-
var
|
|
6950
|
+
var Wo = {
|
|
6898
6951
|
key: "days",
|
|
6899
6952
|
label: "Time window",
|
|
6900
6953
|
type: "select",
|
|
@@ -6913,7 +6966,7 @@ var Ho = {
|
|
|
6913
6966
|
label: "Last 30 days"
|
|
6914
6967
|
}
|
|
6915
6968
|
]
|
|
6916
|
-
},
|
|
6969
|
+
}, Go = [
|
|
6917
6970
|
{
|
|
6918
6971
|
id: "abandoned-cart",
|
|
6919
6972
|
label: "Abandoned basket products",
|
|
@@ -6923,19 +6976,19 @@ var Ho = {
|
|
|
6923
6976
|
id: "bestseller-conversion",
|
|
6924
6977
|
label: "Best seller by Conversion",
|
|
6925
6978
|
group: "catalog",
|
|
6926
|
-
params: [
|
|
6979
|
+
params: [Wo]
|
|
6927
6980
|
},
|
|
6928
6981
|
{
|
|
6929
6982
|
id: "bestseller-units",
|
|
6930
6983
|
label: "Best seller by Units",
|
|
6931
6984
|
group: "catalog",
|
|
6932
|
-
params: [
|
|
6985
|
+
params: [Wo]
|
|
6933
6986
|
},
|
|
6934
6987
|
{
|
|
6935
6988
|
id: "new-products",
|
|
6936
6989
|
label: "New items added",
|
|
6937
6990
|
group: "catalog",
|
|
6938
|
-
params: [
|
|
6991
|
+
params: [Wo]
|
|
6939
6992
|
},
|
|
6940
6993
|
{
|
|
6941
6994
|
id: "cross-sell",
|
|
@@ -6997,7 +7050,7 @@ var Ho = {
|
|
|
6997
7050
|
label: "Similar items",
|
|
6998
7051
|
group: "contextual"
|
|
6999
7052
|
}
|
|
7000
|
-
],
|
|
7053
|
+
], Ko = Object.fromEntries(Go.map((e) => [e.id, e])), qo = [
|
|
7001
7054
|
{
|
|
7002
7055
|
value: "smart-reccs",
|
|
7003
7056
|
label: "Smart Recommendations",
|
|
@@ -7019,7 +7072,7 @@ var Ho = {
|
|
|
7019
7072
|
description: "Don't render the email if the slot can't be filled."
|
|
7020
7073
|
}
|
|
7021
7074
|
];
|
|
7022
|
-
function
|
|
7075
|
+
function Jo(e = 2) {
|
|
7023
7076
|
return {
|
|
7024
7077
|
mode: "recommender",
|
|
7025
7078
|
noProducts: e,
|
|
@@ -7043,21 +7096,21 @@ function Ko(e = 2) {
|
|
|
7043
7096
|
}
|
|
7044
7097
|
};
|
|
7045
7098
|
}
|
|
7046
|
-
function
|
|
7099
|
+
function Yo(e) {
|
|
7047
7100
|
if (!e) return null;
|
|
7048
7101
|
let t = e.recommendations;
|
|
7049
7102
|
return !t || typeof t != "object" ? null : t;
|
|
7050
7103
|
}
|
|
7051
|
-
function
|
|
7104
|
+
function Xo(e) {
|
|
7052
7105
|
return e?.children ? e.children.some((e) => e.type === "productGrid") : !1;
|
|
7053
7106
|
}
|
|
7054
|
-
function
|
|
7107
|
+
function Zo(e) {
|
|
7055
7108
|
if (!e?.children) return 0;
|
|
7056
7109
|
let t = 0;
|
|
7057
7110
|
for (let n of e.children) n.type === "productGrid" && (t += n.products.length);
|
|
7058
7111
|
return t;
|
|
7059
7112
|
}
|
|
7060
|
-
function
|
|
7113
|
+
function Qo(e) {
|
|
7061
7114
|
return {
|
|
7062
7115
|
params: {
|
|
7063
7116
|
selection: e.mode === "manual" ? "manual" : "recommender",
|
|
@@ -7087,8 +7140,8 @@ function Xo(e) {
|
|
|
7087
7140
|
}
|
|
7088
7141
|
//#endregion
|
|
7089
7142
|
//#region src/editor/RecommendationsPanel.tsx
|
|
7090
|
-
function
|
|
7091
|
-
let t = F((e) => e.updateModule), n =
|
|
7143
|
+
function $o({ mod: e }) {
|
|
7144
|
+
let t = F((e) => e.updateModule), n = Zo(e) || 2, r = Yo(e.data) ?? Jo(n), i = (n) => {
|
|
7092
7145
|
let i = {
|
|
7093
7146
|
...r,
|
|
7094
7147
|
...n
|
|
@@ -7115,12 +7168,12 @@ function Zo({ mod: e }) {
|
|
|
7115
7168
|
className: "p-3 bg-white border-b border-blue-100",
|
|
7116
7169
|
children: /* @__PURE__ */ M("div", {
|
|
7117
7170
|
className: "grid grid-cols-2 gap-2",
|
|
7118
|
-
children: [/* @__PURE__ */ j(
|
|
7171
|
+
children: [/* @__PURE__ */ j(rs, {
|
|
7119
7172
|
active: r.mode === "manual",
|
|
7120
7173
|
title: "Select Items",
|
|
7121
7174
|
subtitle: "Hand-pick from a feed",
|
|
7122
7175
|
onClick: () => i({ mode: "manual" })
|
|
7123
|
-
}), /* @__PURE__ */ j(
|
|
7176
|
+
}), /* @__PURE__ */ j(rs, {
|
|
7124
7177
|
active: r.mode === "recommender",
|
|
7125
7178
|
title: "Recommender",
|
|
7126
7179
|
subtitle: "Algorithms + filters",
|
|
@@ -7131,7 +7184,7 @@ function Zo({ mod: e }) {
|
|
|
7131
7184
|
/* @__PURE__ */ M("div", {
|
|
7132
7185
|
className: "p-3 bg-white space-y-3",
|
|
7133
7186
|
children: [
|
|
7134
|
-
/* @__PURE__ */ M(
|
|
7187
|
+
/* @__PURE__ */ M(as, {
|
|
7135
7188
|
label: "Number of products",
|
|
7136
7189
|
children: [/* @__PURE__ */ j("input", {
|
|
7137
7190
|
type: "number",
|
|
@@ -7139,7 +7192,7 @@ function Zo({ mod: e }) {
|
|
|
7139
7192
|
max: 20,
|
|
7140
7193
|
value: r.noProducts,
|
|
7141
7194
|
onChange: (e) => i({ noProducts: Number(e.target.value) || 1 }),
|
|
7142
|
-
className:
|
|
7195
|
+
className: ns
|
|
7143
7196
|
}), /* @__PURE__ */ M("div", {
|
|
7144
7197
|
className: "text-[11px] text-gray-500 mt-1",
|
|
7145
7198
|
children: [
|
|
@@ -7151,10 +7204,10 @@ function Zo({ mod: e }) {
|
|
|
7151
7204
|
]
|
|
7152
7205
|
})]
|
|
7153
7206
|
}),
|
|
7154
|
-
r.mode === "manual" ? /* @__PURE__ */ j(
|
|
7207
|
+
r.mode === "manual" ? /* @__PURE__ */ j(es, {
|
|
7155
7208
|
logic: r,
|
|
7156
7209
|
update: i
|
|
7157
|
-
}) : /* @__PURE__ */ j(
|
|
7210
|
+
}) : /* @__PURE__ */ j(ts, {
|
|
7158
7211
|
logic: r,
|
|
7159
7212
|
update: i,
|
|
7160
7213
|
updateFilters: (e) => i({ filters: {
|
|
@@ -7177,21 +7230,21 @@ function Zo({ mod: e }) {
|
|
|
7177
7230
|
]
|
|
7178
7231
|
});
|
|
7179
7232
|
}
|
|
7180
|
-
function
|
|
7233
|
+
function es({ logic: e, update: t }) {
|
|
7181
7234
|
return /* @__PURE__ */ M(A, { children: [
|
|
7182
|
-
/* @__PURE__ */ j(
|
|
7235
|
+
/* @__PURE__ */ j(as, {
|
|
7183
7236
|
label: "Source feed",
|
|
7184
7237
|
children: /* @__PURE__ */ j("input", {
|
|
7185
7238
|
type: "text",
|
|
7186
7239
|
placeholder: "e.g. main-catalog",
|
|
7187
7240
|
value: e.sourceFeed ?? "",
|
|
7188
7241
|
onChange: (e) => t({ sourceFeed: e.target.value }),
|
|
7189
|
-
className:
|
|
7242
|
+
className: ns
|
|
7190
7243
|
})
|
|
7191
7244
|
}),
|
|
7192
|
-
/* @__PURE__ */ j(
|
|
7245
|
+
/* @__PURE__ */ j(as, {
|
|
7193
7246
|
label: "Items to include (product IDs / SKUs)",
|
|
7194
|
-
children: /* @__PURE__ */ j(
|
|
7247
|
+
children: /* @__PURE__ */ j(us, {
|
|
7195
7248
|
value: e.manualProducts,
|
|
7196
7249
|
onChange: (e) => t({ manualProducts: e }),
|
|
7197
7250
|
placeholder: "Add product id"
|
|
@@ -7203,7 +7256,7 @@ function Qo({ logic: e, update: t }) {
|
|
|
7203
7256
|
})
|
|
7204
7257
|
] });
|
|
7205
7258
|
}
|
|
7206
|
-
function
|
|
7259
|
+
function ts({ logic: e, update: t, updateFilters: n }) {
|
|
7207
7260
|
let [r, i] = f(!1);
|
|
7208
7261
|
return /* @__PURE__ */ M(A, { children: [
|
|
7209
7262
|
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("div", {
|
|
@@ -7215,72 +7268,72 @@ function $o({ logic: e, update: t, updateFilters: n }) {
|
|
|
7215
7268
|
3,
|
|
7216
7269
|
")"
|
|
7217
7270
|
]
|
|
7218
|
-
}), /* @__PURE__ */ j(
|
|
7271
|
+
}), /* @__PURE__ */ j(ls, {
|
|
7219
7272
|
disabled: e.stack.length >= 3,
|
|
7220
7273
|
existing: e.stack.map((e) => e.algorithm),
|
|
7221
7274
|
onPick: (n) => t({ stack: [...e.stack, { algorithm: n }] })
|
|
7222
7275
|
})]
|
|
7223
|
-
}), /* @__PURE__ */ j(
|
|
7276
|
+
}), /* @__PURE__ */ j(cs, {
|
|
7224
7277
|
stack: e.stack,
|
|
7225
7278
|
onChange: (e) => t({ stack: e })
|
|
7226
7279
|
})] }),
|
|
7227
|
-
/* @__PURE__ */ M(
|
|
7280
|
+
/* @__PURE__ */ M(as, {
|
|
7228
7281
|
label: "Fallback",
|
|
7229
7282
|
children: [/* @__PURE__ */ j("select", {
|
|
7230
7283
|
value: e.fallback,
|
|
7231
7284
|
onChange: (e) => t({ fallback: e.target.value }),
|
|
7232
|
-
className:
|
|
7233
|
-
children:
|
|
7285
|
+
className: ns,
|
|
7286
|
+
children: qo.map((e) => /* @__PURE__ */ j("option", {
|
|
7234
7287
|
value: e.value,
|
|
7235
7288
|
children: e.label
|
|
7236
7289
|
}, e.value))
|
|
7237
7290
|
}), /* @__PURE__ */ j("div", {
|
|
7238
7291
|
className: "text-[11px] text-gray-500 mt-1",
|
|
7239
|
-
children:
|
|
7292
|
+
children: qo.find((t) => t.value === e.fallback)?.description
|
|
7240
7293
|
})]
|
|
7241
7294
|
}),
|
|
7242
|
-
/* @__PURE__ */ j(
|
|
7295
|
+
/* @__PURE__ */ j(is, {
|
|
7243
7296
|
title: "Include & Exclude filters",
|
|
7244
7297
|
right: /* @__PURE__ */ M("div", {
|
|
7245
7298
|
className: "flex items-center gap-1",
|
|
7246
|
-
children: [/* @__PURE__ */ j(
|
|
7299
|
+
children: [/* @__PURE__ */ j(os, {
|
|
7247
7300
|
active: !r,
|
|
7248
7301
|
onClick: () => i(!1),
|
|
7249
7302
|
children: "Basic"
|
|
7250
|
-
}), /* @__PURE__ */ j(
|
|
7303
|
+
}), /* @__PURE__ */ j(os, {
|
|
7251
7304
|
active: r,
|
|
7252
7305
|
onClick: () => i(!0),
|
|
7253
7306
|
children: "Advanced"
|
|
7254
7307
|
})]
|
|
7255
7308
|
})
|
|
7256
7309
|
}),
|
|
7257
|
-
/* @__PURE__ */ j(
|
|
7310
|
+
/* @__PURE__ */ j(as, {
|
|
7258
7311
|
label: "Exclude products",
|
|
7259
|
-
children: /* @__PURE__ */ j(
|
|
7312
|
+
children: /* @__PURE__ */ j(us, {
|
|
7260
7313
|
value: e.filters.excludeProducts,
|
|
7261
7314
|
onChange: (e) => n({ excludeProducts: e }),
|
|
7262
7315
|
placeholder: "Add product id"
|
|
7263
7316
|
})
|
|
7264
7317
|
}),
|
|
7265
|
-
/* @__PURE__ */ j(
|
|
7318
|
+
/* @__PURE__ */ j(as, {
|
|
7266
7319
|
label: "Include products",
|
|
7267
|
-
children: /* @__PURE__ */ j(
|
|
7320
|
+
children: /* @__PURE__ */ j(us, {
|
|
7268
7321
|
value: e.filters.includeProducts,
|
|
7269
7322
|
onChange: (e) => n({ includeProducts: e }),
|
|
7270
7323
|
placeholder: "Add product id"
|
|
7271
7324
|
})
|
|
7272
7325
|
}),
|
|
7273
|
-
/* @__PURE__ */ j(
|
|
7326
|
+
/* @__PURE__ */ j(as, {
|
|
7274
7327
|
label: "Exclude categories",
|
|
7275
|
-
children: /* @__PURE__ */ j(
|
|
7328
|
+
children: /* @__PURE__ */ j(us, {
|
|
7276
7329
|
value: e.filters.excludeCategories,
|
|
7277
7330
|
onChange: (e) => n({ excludeCategories: e }),
|
|
7278
7331
|
placeholder: "Add category"
|
|
7279
7332
|
})
|
|
7280
7333
|
}),
|
|
7281
|
-
/* @__PURE__ */ j(
|
|
7334
|
+
/* @__PURE__ */ j(as, {
|
|
7282
7335
|
label: "Include categories",
|
|
7283
|
-
children: /* @__PURE__ */ j(
|
|
7336
|
+
children: /* @__PURE__ */ j(us, {
|
|
7284
7337
|
value: e.filters.includeCategories,
|
|
7285
7338
|
onChange: (e) => n({ includeCategories: e }),
|
|
7286
7339
|
placeholder: "Add category"
|
|
@@ -7288,72 +7341,72 @@ function $o({ logic: e, update: t, updateFilters: n }) {
|
|
|
7288
7341
|
}),
|
|
7289
7342
|
/* @__PURE__ */ M("div", {
|
|
7290
7343
|
className: "grid grid-cols-2 gap-2",
|
|
7291
|
-
children: [/* @__PURE__ */ j(
|
|
7344
|
+
children: [/* @__PURE__ */ j(as, {
|
|
7292
7345
|
label: "Minimum stock",
|
|
7293
7346
|
children: /* @__PURE__ */ j("input", {
|
|
7294
7347
|
type: "number",
|
|
7295
7348
|
min: 0,
|
|
7296
7349
|
value: e.filters.minStock ?? 0,
|
|
7297
7350
|
onChange: (e) => n({ minStock: Number(e.target.value) || 0 }),
|
|
7298
|
-
className:
|
|
7351
|
+
className: ns
|
|
7299
7352
|
})
|
|
7300
|
-
}), /* @__PURE__ */ j(
|
|
7353
|
+
}), /* @__PURE__ */ j(as, {
|
|
7301
7354
|
label: "Minimum price",
|
|
7302
7355
|
children: /* @__PURE__ */ j("input", {
|
|
7303
7356
|
type: "number",
|
|
7304
7357
|
min: 0,
|
|
7305
7358
|
value: e.filters.minPrice ?? 0,
|
|
7306
7359
|
onChange: (e) => n({ minPrice: Number(e.target.value) || 0 }),
|
|
7307
|
-
className:
|
|
7360
|
+
className: ns
|
|
7308
7361
|
})
|
|
7309
7362
|
})]
|
|
7310
7363
|
}),
|
|
7311
|
-
/* @__PURE__ */ j(
|
|
7364
|
+
/* @__PURE__ */ j(ss, {
|
|
7312
7365
|
label: "Only main items",
|
|
7313
7366
|
checked: !!e.filters.mainOnly,
|
|
7314
7367
|
onChange: (e) => n({ mainOnly: e })
|
|
7315
7368
|
}),
|
|
7316
|
-
/* @__PURE__ */ j(
|
|
7369
|
+
/* @__PURE__ */ j(ss, {
|
|
7317
7370
|
label: "Higher price than current item (upsell)",
|
|
7318
7371
|
checked: !!e.filters.higherPrice,
|
|
7319
7372
|
onChange: (e) => n({ higherPrice: e })
|
|
7320
7373
|
}),
|
|
7321
|
-
/* @__PURE__ */ j(
|
|
7374
|
+
/* @__PURE__ */ j(ss, {
|
|
7322
7375
|
label: "On sale only",
|
|
7323
7376
|
checked: !!e.filters.salesPrice,
|
|
7324
7377
|
onChange: (e) => n({ salesPrice: e })
|
|
7325
7378
|
}),
|
|
7326
|
-
/* @__PURE__ */ j(
|
|
7379
|
+
/* @__PURE__ */ j(ss, {
|
|
7327
7380
|
label: "Same category as current",
|
|
7328
7381
|
checked: !!e.filters.sameCategory,
|
|
7329
7382
|
onChange: (e) => n({ sameCategory: e })
|
|
7330
7383
|
}),
|
|
7331
|
-
/* @__PURE__ */ j(
|
|
7384
|
+
/* @__PURE__ */ j(ss, {
|
|
7332
7385
|
label: "Match title keywords",
|
|
7333
7386
|
checked: !!e.filters.matchTitle,
|
|
7334
7387
|
onChange: (e) => n({ matchTitle: e })
|
|
7335
7388
|
}),
|
|
7336
|
-
/* @__PURE__ */ j(
|
|
7389
|
+
/* @__PURE__ */ j(as, {
|
|
7337
7390
|
label: "Match same fields (comma-separated)",
|
|
7338
7391
|
children: /* @__PURE__ */ j("input", {
|
|
7339
7392
|
type: "text",
|
|
7340
7393
|
placeholder: "brand, color",
|
|
7341
7394
|
value: e.filters.sameField ?? "",
|
|
7342
7395
|
onChange: (e) => n({ sameField: e.target.value }),
|
|
7343
|
-
className:
|
|
7396
|
+
className: ns
|
|
7344
7397
|
})
|
|
7345
7398
|
}),
|
|
7346
|
-
r && /* @__PURE__ */ j(
|
|
7399
|
+
r && /* @__PURE__ */ j(as, {
|
|
7347
7400
|
label: "Advanced JSON overrides",
|
|
7348
|
-
children: /* @__PURE__ */ j(
|
|
7401
|
+
children: /* @__PURE__ */ j(ds, {
|
|
7349
7402
|
value: e.filters.advanced ?? {},
|
|
7350
7403
|
onChange: (e) => n({ advanced: e })
|
|
7351
7404
|
})
|
|
7352
7405
|
})
|
|
7353
7406
|
] });
|
|
7354
7407
|
}
|
|
7355
|
-
var
|
|
7356
|
-
function
|
|
7408
|
+
var ns = "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white";
|
|
7409
|
+
function rs({ active: e, icon: t, title: n, subtitle: r, onClick: i }) {
|
|
7357
7410
|
return /* @__PURE__ */ M("button", {
|
|
7358
7411
|
onClick: i,
|
|
7359
7412
|
className: "flex flex-col items-start gap-0.5 p-2.5 rounded border text-left transition " + (e ? "border-teal-600 bg-teal-50 ring-1 ring-teal-600" : "border-gray-200 bg-white hover:border-gray-300"),
|
|
@@ -7369,7 +7422,7 @@ function ts({ active: e, icon: t, title: n, subtitle: r, onClick: i }) {
|
|
|
7369
7422
|
})]
|
|
7370
7423
|
});
|
|
7371
7424
|
}
|
|
7372
|
-
function
|
|
7425
|
+
function is({ title: e, right: t }) {
|
|
7373
7426
|
return /* @__PURE__ */ M("div", {
|
|
7374
7427
|
className: "flex items-center justify-between border-t border-gray-200 pt-3 mt-3",
|
|
7375
7428
|
children: [/* @__PURE__ */ j("div", {
|
|
@@ -7378,20 +7431,20 @@ function ns({ title: e, right: t }) {
|
|
|
7378
7431
|
}), t]
|
|
7379
7432
|
});
|
|
7380
7433
|
}
|
|
7381
|
-
function
|
|
7434
|
+
function as({ label: e, children: t }) {
|
|
7382
7435
|
return /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("label", {
|
|
7383
7436
|
className: "block text-xs font-medium text-gray-700 mb-1",
|
|
7384
7437
|
children: e
|
|
7385
7438
|
}), t] });
|
|
7386
7439
|
}
|
|
7387
|
-
function
|
|
7440
|
+
function os({ active: e, onClick: t, children: n }) {
|
|
7388
7441
|
return /* @__PURE__ */ j("button", {
|
|
7389
7442
|
onClick: t,
|
|
7390
7443
|
className: "px-2 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide " + (e ? "bg-teal-600 text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"),
|
|
7391
7444
|
children: n
|
|
7392
7445
|
});
|
|
7393
7446
|
}
|
|
7394
|
-
function
|
|
7447
|
+
function ss({ label: e, checked: t, onChange: n }) {
|
|
7395
7448
|
return /* @__PURE__ */ M("label", {
|
|
7396
7449
|
className: "flex items-center justify-between gap-2 text-xs text-gray-700 py-1",
|
|
7397
7450
|
children: [/* @__PURE__ */ j("span", { children: e }), /* @__PURE__ */ j("input", {
|
|
@@ -7402,7 +7455,7 @@ function as({ label: e, checked: t, onChange: n }) {
|
|
|
7402
7455
|
})]
|
|
7403
7456
|
});
|
|
7404
7457
|
}
|
|
7405
|
-
function
|
|
7458
|
+
function cs({ stack: e, onChange: t }) {
|
|
7406
7459
|
if (e.length === 0) return /* @__PURE__ */ M("div", {
|
|
7407
7460
|
className: "text-[11px] text-gray-500 italic border border-dashed border-gray-300 rounded px-2 py-3 text-center",
|
|
7408
7461
|
children: [
|
|
@@ -7429,7 +7482,7 @@ function os({ stack: e, onChange: t }) {
|
|
|
7429
7482
|
return /* @__PURE__ */ j("div", {
|
|
7430
7483
|
className: "space-y-1.5",
|
|
7431
7484
|
children: e.map((t, a) => {
|
|
7432
|
-
let o =
|
|
7485
|
+
let o = Ko[t.algorithm];
|
|
7433
7486
|
return /* @__PURE__ */ M("div", {
|
|
7434
7487
|
className: "border border-gray-200 rounded px-2 py-1.5 bg-white flex flex-col gap-1",
|
|
7435
7488
|
children: [/* @__PURE__ */ M("div", {
|
|
@@ -7484,7 +7537,7 @@ function os({ stack: e, onChange: t }) {
|
|
|
7484
7537
|
})
|
|
7485
7538
|
});
|
|
7486
7539
|
}
|
|
7487
|
-
function
|
|
7540
|
+
function ls({ disabled: e, existing: t, onPick: n }) {
|
|
7488
7541
|
let [r, i] = f(!1);
|
|
7489
7542
|
return /* @__PURE__ */ M("div", {
|
|
7490
7543
|
className: "relative",
|
|
@@ -7498,7 +7551,7 @@ function ss({ disabled: e, existing: t, onPick: n }) {
|
|
|
7498
7551
|
onClick: () => i(!1)
|
|
7499
7552
|
}), /* @__PURE__ */ j("div", {
|
|
7500
7553
|
className: "absolute right-0 top-full mt-1 w-64 max-h-80 overflow-auto bg-white border border-gray-200 rounded shadow-lg z-20",
|
|
7501
|
-
children:
|
|
7554
|
+
children: Go.map((e) => {
|
|
7502
7555
|
let r = t.includes(e.id);
|
|
7503
7556
|
return /* @__PURE__ */ M("button", {
|
|
7504
7557
|
disabled: r,
|
|
@@ -7515,7 +7568,7 @@ function ss({ disabled: e, existing: t, onPick: n }) {
|
|
|
7515
7568
|
})] })]
|
|
7516
7569
|
});
|
|
7517
7570
|
}
|
|
7518
|
-
function
|
|
7571
|
+
function us({ value: e, onChange: t, placeholder: n }) {
|
|
7519
7572
|
let [r, i] = f(""), a = () => {
|
|
7520
7573
|
let n = r.trim();
|
|
7521
7574
|
n && (e.includes(n) || (t([...e, n]), i("")));
|
|
@@ -7541,7 +7594,7 @@ function cs({ value: e, onChange: t, placeholder: n }) {
|
|
|
7541
7594
|
})]
|
|
7542
7595
|
});
|
|
7543
7596
|
}
|
|
7544
|
-
function
|
|
7597
|
+
function ds({ value: e, onChange: t }) {
|
|
7545
7598
|
let [n, r] = f(() => JSON.stringify(e, null, 2)), [i, a] = f(null);
|
|
7546
7599
|
return /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("textarea", {
|
|
7547
7600
|
value: n,
|
|
@@ -7565,32 +7618,32 @@ function ls({ value: e, onChange: t }) {
|
|
|
7565
7618
|
}
|
|
7566
7619
|
//#endregion
|
|
7567
7620
|
//#region src/plugins/voucherSelect/useVouchers.ts
|
|
7568
|
-
function
|
|
7569
|
-
p(
|
|
7570
|
-
let e =
|
|
7621
|
+
function fs() {
|
|
7622
|
+
p(Fo, Io, Io);
|
|
7623
|
+
let e = Mo() !== null, t = No();
|
|
7571
7624
|
return s(() => {
|
|
7572
|
-
e && t.status === "idle" &&
|
|
7625
|
+
e && t.status === "idle" && Po();
|
|
7573
7626
|
}, [e, t.status]), {
|
|
7574
7627
|
available: e,
|
|
7575
7628
|
status: t.status,
|
|
7576
7629
|
vouchers: t.vouchers,
|
|
7577
7630
|
error: t.error,
|
|
7578
|
-
reload: () => void
|
|
7631
|
+
reload: () => void Po(!0)
|
|
7579
7632
|
};
|
|
7580
7633
|
}
|
|
7581
7634
|
//#endregion
|
|
7582
7635
|
//#region src/plugins/voucherSelect/logic.ts
|
|
7583
|
-
function
|
|
7636
|
+
function ps(e) {
|
|
7584
7637
|
return e?.children?.find((e) => e.type === "text" && e.role === "voucherCode");
|
|
7585
7638
|
}
|
|
7586
|
-
function
|
|
7587
|
-
return !!
|
|
7639
|
+
function ms(e) {
|
|
7640
|
+
return !!ps(e);
|
|
7588
7641
|
}
|
|
7589
|
-
function
|
|
7642
|
+
function hs(e) {
|
|
7590
7643
|
let t = e?.data?.voucher;
|
|
7591
7644
|
return t && typeof t == "object" && "code" in t ? t : null;
|
|
7592
7645
|
}
|
|
7593
|
-
function
|
|
7646
|
+
function gs(e) {
|
|
7594
7647
|
return {
|
|
7595
7648
|
id: e.id,
|
|
7596
7649
|
title: e.title,
|
|
@@ -7599,8 +7652,8 @@ function ms(e) {
|
|
|
7599
7652
|
}
|
|
7600
7653
|
//#endregion
|
|
7601
7654
|
//#region src/plugins/voucherSelect/VoucherPanel.tsx
|
|
7602
|
-
function
|
|
7603
|
-
let t = F((e) => e.updateElement), n = F((e) => e.updateModule), { available: r, status: i, vouchers: a, error: o, reload: s } =
|
|
7655
|
+
function _s({ mod: e }) {
|
|
7656
|
+
let t = F((e) => e.updateElement), n = F((e) => e.updateModule), { available: r, status: i, vouchers: a, error: o, reload: s } = fs(), c = ps(e), l = hs(e), u = l && a.some((e) => e.id === l.id) ? l.id : "", d = (r) => {
|
|
7604
7657
|
if (!r) {
|
|
7605
7658
|
n(e.id, { data: {
|
|
7606
7659
|
...e.data ?? {},
|
|
@@ -7610,7 +7663,7 @@ function hs({ mod: e }) {
|
|
|
7610
7663
|
}
|
|
7611
7664
|
c && t(e.id, c.id, { content: r.code }), n(e.id, { data: {
|
|
7612
7665
|
...e.data ?? {},
|
|
7613
|
-
voucher:
|
|
7666
|
+
voucher: gs(r)
|
|
7614
7667
|
} });
|
|
7615
7668
|
};
|
|
7616
7669
|
return /* @__PURE__ */ M("div", {
|
|
@@ -7687,7 +7740,7 @@ function hs({ mod: e }) {
|
|
|
7687
7740
|
}
|
|
7688
7741
|
//#endregion
|
|
7689
7742
|
//#region src/plugins/productSearch/ProductSearchModal.tsx
|
|
7690
|
-
function
|
|
7743
|
+
function vs({ open: e, onClose: t, onSave: n, initialQuery: r, title: i }) {
|
|
7691
7744
|
let [a, o] = f(r ?? ""), [c, l] = f(!1), [u, p] = f(null), [m, h] = f(null), [g, _] = f(!1), v = d(null);
|
|
7692
7745
|
if (s(() => {
|
|
7693
7746
|
if (!e) return;
|
|
@@ -7704,7 +7757,7 @@ function gs({ open: e, onClose: t, onSave: n, initialQuery: r, title: i }) {
|
|
|
7704
7757
|
t
|
|
7705
7758
|
]), !e) return null;
|
|
7706
7759
|
let y = async () => {
|
|
7707
|
-
let e =
|
|
7760
|
+
let e = So(), t = a.trim();
|
|
7708
7761
|
if (!(!e || !t || c)) {
|
|
7709
7762
|
l(!0), p(null), h(null), _(!0);
|
|
7710
7763
|
try {
|
|
@@ -7803,7 +7856,7 @@ function gs({ open: e, onClose: t, onSave: n, initialQuery: r, title: i }) {
|
|
|
7803
7856
|
className: "text-neutral-300"
|
|
7804
7857
|
}), "Search your catalog, then preview and save the product."]
|
|
7805
7858
|
}),
|
|
7806
|
-
!c && m && /* @__PURE__ */ j(
|
|
7859
|
+
!c && m && /* @__PURE__ */ j(ys, { result: m })
|
|
7807
7860
|
]
|
|
7808
7861
|
}),
|
|
7809
7862
|
/* @__PURE__ */ M("div", {
|
|
@@ -7825,7 +7878,7 @@ function gs({ open: e, onClose: t, onSave: n, initialQuery: r, title: i }) {
|
|
|
7825
7878
|
})
|
|
7826
7879
|
});
|
|
7827
7880
|
}
|
|
7828
|
-
function
|
|
7881
|
+
function ys({ result: e }) {
|
|
7829
7882
|
return /* @__PURE__ */ M("div", {
|
|
7830
7883
|
className: "overflow-hidden rounded-xl border border-neutral-200",
|
|
7831
7884
|
children: [/* @__PURE__ */ j("div", {
|
|
@@ -7883,12 +7936,12 @@ function _s({ result: e }) {
|
|
|
7883
7936
|
}
|
|
7884
7937
|
//#endregion
|
|
7885
7938
|
//#region src/plugins/productSearch/useProductSearch.ts
|
|
7886
|
-
function
|
|
7887
|
-
return p(
|
|
7939
|
+
function bs() {
|
|
7940
|
+
return p(Co, wo, wo), So() !== null;
|
|
7888
7941
|
}
|
|
7889
7942
|
//#endregion
|
|
7890
7943
|
//#region src/editor/RightSidebar.tsx
|
|
7891
|
-
function
|
|
7944
|
+
function xs() {
|
|
7892
7945
|
let { selection: e, doc: t, viewMode: n } = F(), [r, i] = f(!0), [a, o] = f(!1);
|
|
7893
7946
|
return r ? /* @__PURE__ */ M("div", {
|
|
7894
7947
|
className: `${a ? "w-[576px]" : "w-72"} bg-white border-l border-gray-200 shrink-0 overflow-y-auto flex flex-col transition-all duration-200`,
|
|
@@ -7919,15 +7972,15 @@ function ys() {
|
|
|
7919
7972
|
]
|
|
7920
7973
|
}), /* @__PURE__ */ j("div", {
|
|
7921
7974
|
className: "p-4 flex-1",
|
|
7922
|
-
children: !e || e.kind === "email" ? /* @__PURE__ */ j(
|
|
7975
|
+
children: !e || e.kind === "email" ? /* @__PURE__ */ j(Ns, {}) : e.kind === "module" ? (() => {
|
|
7923
7976
|
let n = t.modules.find((t) => t.id === e.moduleId);
|
|
7924
|
-
return n ? /* @__PURE__ */ j(
|
|
7977
|
+
return n ? /* @__PURE__ */ j(Is, { mod: n }) : /* @__PURE__ */ j(Ss, {});
|
|
7925
7978
|
})() : (() => {
|
|
7926
7979
|
let n = t.modules.find((t) => t.id === e.moduleId), r = n?.children.find((t) => t.id === e.elementId);
|
|
7927
|
-
return n && r ? /* @__PURE__ */ j(
|
|
7980
|
+
return n && r ? /* @__PURE__ */ j(Ls, {
|
|
7928
7981
|
mod: n,
|
|
7929
7982
|
el: r
|
|
7930
|
-
}) : /* @__PURE__ */ j(
|
|
7983
|
+
}) : /* @__PURE__ */ j(Ss, {});
|
|
7931
7984
|
})()
|
|
7932
7985
|
})]
|
|
7933
7986
|
}) : /* @__PURE__ */ j("div", {
|
|
@@ -7940,13 +7993,13 @@ function ys() {
|
|
|
7940
7993
|
})
|
|
7941
7994
|
});
|
|
7942
7995
|
}
|
|
7943
|
-
function
|
|
7996
|
+
function Ss() {
|
|
7944
7997
|
return /* @__PURE__ */ j("div", {
|
|
7945
7998
|
className: "text-xs text-gray-400",
|
|
7946
7999
|
children: "Nothing selected."
|
|
7947
8000
|
});
|
|
7948
8001
|
}
|
|
7949
|
-
function
|
|
8002
|
+
function Cs(e, t) {
|
|
7950
8003
|
if (t !== "mobile") return e;
|
|
7951
8004
|
let n = e.mobile ?? {};
|
|
7952
8005
|
return {
|
|
@@ -7954,7 +8007,7 @@ function xs(e, t) {
|
|
|
7954
8007
|
...n
|
|
7955
8008
|
};
|
|
7956
8009
|
}
|
|
7957
|
-
function
|
|
8010
|
+
function ws(e, t, n) {
|
|
7958
8011
|
if (n !== "mobile") return {
|
|
7959
8012
|
...e,
|
|
7960
8013
|
...t
|
|
@@ -7968,16 +8021,16 @@ function Ss(e, t, n) {
|
|
|
7968
8021
|
}
|
|
7969
8022
|
};
|
|
7970
8023
|
}
|
|
7971
|
-
function
|
|
8024
|
+
function Ts({ overridden: e }) {
|
|
7972
8025
|
return e ? /* @__PURE__ */ j("span", {
|
|
7973
8026
|
className: "ml-1 text-[9px] uppercase tracking-wide bg-amber-100 text-amber-800 px-1 rounded",
|
|
7974
8027
|
children: "mobile"
|
|
7975
8028
|
}) : null;
|
|
7976
8029
|
}
|
|
7977
|
-
function
|
|
8030
|
+
function Es({ hideOn: e, onChange: t }) {
|
|
7978
8031
|
return /* @__PURE__ */ j(Q, {
|
|
7979
8032
|
label: "Visibility",
|
|
7980
|
-
children: /* @__PURE__ */ M(
|
|
8033
|
+
children: /* @__PURE__ */ M(js, {
|
|
7981
8034
|
value: e ?? "",
|
|
7982
8035
|
onChange: (e) => {
|
|
7983
8036
|
let n = e.target.value;
|
|
@@ -8000,7 +8053,7 @@ function ws({ hideOn: e, onChange: t }) {
|
|
|
8000
8053
|
})
|
|
8001
8054
|
});
|
|
8002
8055
|
}
|
|
8003
|
-
function
|
|
8056
|
+
function Ds({ children: e }) {
|
|
8004
8057
|
return /* @__PURE__ */ j("h3", {
|
|
8005
8058
|
className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
|
|
8006
8059
|
children: e
|
|
@@ -8021,14 +8074,14 @@ function $(e) {
|
|
|
8021
8074
|
className: "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none"
|
|
8022
8075
|
});
|
|
8023
8076
|
}
|
|
8024
|
-
function
|
|
8077
|
+
function Os(e) {
|
|
8025
8078
|
return /* @__PURE__ */ j($, {
|
|
8026
8079
|
type: "number",
|
|
8027
8080
|
...e
|
|
8028
8081
|
});
|
|
8029
8082
|
}
|
|
8030
|
-
function
|
|
8031
|
-
let r =
|
|
8083
|
+
function ks({ value: e, onChange: t, onAlt: n }) {
|
|
8084
|
+
let r = Uo(), i = d(null), [a, o] = f(!1), [s, c] = f(null), l = async (e) => {
|
|
8032
8085
|
if (r) {
|
|
8033
8086
|
o(!0), c(null);
|
|
8034
8087
|
try {
|
|
@@ -8078,7 +8131,7 @@ function Ds({ value: e, onChange: t, onAlt: n }) {
|
|
|
8078
8131
|
})
|
|
8079
8132
|
] });
|
|
8080
8133
|
}
|
|
8081
|
-
function
|
|
8134
|
+
function As({ value: e, onChange: t, defaultValue: n }) {
|
|
8082
8135
|
let r = F((e) => e.doc.theme), i = typeof e == "string" && e.startsWith("{"), a = d(n && n.startsWith("{") ? n : i ? e : void 0);
|
|
8083
8136
|
s(() => {
|
|
8084
8137
|
i ? a.current = e : n && n.startsWith("{") && (a.current = n);
|
|
@@ -8136,16 +8189,16 @@ function Os({ value: e, onChange: t, defaultValue: n }) {
|
|
|
8136
8189
|
]
|
|
8137
8190
|
});
|
|
8138
8191
|
}
|
|
8139
|
-
function
|
|
8192
|
+
function js(e) {
|
|
8140
8193
|
return /* @__PURE__ */ j("select", {
|
|
8141
8194
|
...e,
|
|
8142
8195
|
className: "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white"
|
|
8143
8196
|
});
|
|
8144
8197
|
}
|
|
8145
|
-
function
|
|
8198
|
+
function Ms({ linkType: e, onChangeLinkType: t, onChangeLink: n }) {
|
|
8146
8199
|
return /* @__PURE__ */ M(Q, {
|
|
8147
8200
|
label: "Link role",
|
|
8148
|
-
children: [/* @__PURE__ */ M(
|
|
8201
|
+
children: [/* @__PURE__ */ M(js, {
|
|
8149
8202
|
value: e ?? "",
|
|
8150
8203
|
onChange: (e) => {
|
|
8151
8204
|
let r = e.target.value;
|
|
@@ -8186,10 +8239,10 @@ function As({ linkType: e, onChangeLinkType: t, onChangeLink: n }) {
|
|
|
8186
8239
|
})]
|
|
8187
8240
|
});
|
|
8188
8241
|
}
|
|
8189
|
-
function
|
|
8242
|
+
function Ns() {
|
|
8190
8243
|
let { doc: e, updateMeta: t, updateSettings: n } = F();
|
|
8191
8244
|
return /* @__PURE__ */ M(A, { children: [
|
|
8192
|
-
/* @__PURE__ */ j(
|
|
8245
|
+
/* @__PURE__ */ j(Ds, { children: "Email" }),
|
|
8193
8246
|
/* @__PURE__ */ j(Q, {
|
|
8194
8247
|
label: "Name",
|
|
8195
8248
|
children: /* @__PURE__ */ j($, {
|
|
@@ -8206,32 +8259,32 @@ function js() {
|
|
|
8206
8259
|
}),
|
|
8207
8260
|
/* @__PURE__ */ j(Q, {
|
|
8208
8261
|
label: "Width (px)",
|
|
8209
|
-
children: /* @__PURE__ */ j(
|
|
8262
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8210
8263
|
value: e.settings.width,
|
|
8211
8264
|
onChange: (e) => n({ width: Number(e.target.value) || 600 })
|
|
8212
8265
|
})
|
|
8213
8266
|
}),
|
|
8214
8267
|
/* @__PURE__ */ j(Q, {
|
|
8215
8268
|
label: "Background color",
|
|
8216
|
-
children: /* @__PURE__ */ j(
|
|
8269
|
+
children: /* @__PURE__ */ j(As, {
|
|
8217
8270
|
value: e.settings.backgroundColor,
|
|
8218
8271
|
onChange: (e) => n({ backgroundColor: e })
|
|
8219
8272
|
})
|
|
8220
8273
|
}),
|
|
8221
8274
|
/* @__PURE__ */ j(Q, {
|
|
8222
8275
|
label: "Content background color",
|
|
8223
|
-
children: /* @__PURE__ */ j(
|
|
8276
|
+
children: /* @__PURE__ */ j(As, {
|
|
8224
8277
|
value: e.settings.contentBackgroundColor,
|
|
8225
8278
|
onChange: (e) => n({ contentBackgroundColor: e })
|
|
8226
8279
|
})
|
|
8227
8280
|
}),
|
|
8228
8281
|
/* @__PURE__ */ j("div", {
|
|
8229
8282
|
className: "mt-6 pt-4 border-t border-gray-100",
|
|
8230
|
-
children: /* @__PURE__ */ j(
|
|
8283
|
+
children: /* @__PURE__ */ j(Ps, {})
|
|
8231
8284
|
})
|
|
8232
8285
|
] });
|
|
8233
8286
|
}
|
|
8234
|
-
function
|
|
8287
|
+
function Ps() {
|
|
8235
8288
|
let { doc: e, themes: t, applyTheme: n } = F(), r = e.theme, i = t.find((e) => e.id === r.id), a = i != null && Object.entries(r.tokens.colors).some(([e, t]) => i.tokens.colors[e] !== t), o = (e, t) => {
|
|
8236
8289
|
n({
|
|
8237
8290
|
...r,
|
|
@@ -8247,7 +8300,7 @@ function Ms() {
|
|
|
8247
8300
|
return /* @__PURE__ */ M(A, { children: [
|
|
8248
8301
|
/* @__PURE__ */ M("div", {
|
|
8249
8302
|
className: "flex items-center justify-between mb-2",
|
|
8250
|
-
children: [/* @__PURE__ */ j(
|
|
8303
|
+
children: [/* @__PURE__ */ j(Ds, { children: "Theme" }), a && /* @__PURE__ */ j("button", {
|
|
8251
8304
|
onClick: () => i && n(i),
|
|
8252
8305
|
className: "text-[10px] text-blue-600 hover:underline mb-3",
|
|
8253
8306
|
title: "Discard color changes and restore the preset",
|
|
@@ -8296,7 +8349,7 @@ function Ms() {
|
|
|
8296
8349
|
}),
|
|
8297
8350
|
/* @__PURE__ */ j("div", {
|
|
8298
8351
|
className: "flex flex-col gap-2",
|
|
8299
|
-
children: Object.entries(r.tokens.colors).map(([e, t]) => /* @__PURE__ */ j(
|
|
8352
|
+
children: Object.entries(r.tokens.colors).map(([e, t]) => /* @__PURE__ */ j(Fs, {
|
|
8300
8353
|
label: e,
|
|
8301
8354
|
value: t,
|
|
8302
8355
|
onChange: (t) => o(e, t)
|
|
@@ -8304,7 +8357,7 @@ function Ms() {
|
|
|
8304
8357
|
})
|
|
8305
8358
|
] });
|
|
8306
8359
|
}
|
|
8307
|
-
function
|
|
8360
|
+
function Fs({ label: e, value: t, onChange: n }) {
|
|
8308
8361
|
let [r, i] = f(t);
|
|
8309
8362
|
s(() => i(t), [t]);
|
|
8310
8363
|
let a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(t) ? t.length === 4 ? "#" + t.slice(1).split("").map((e) => e + e).join("") : t : "#000000", o = (e) => {
|
|
@@ -8343,69 +8396,69 @@ function Ns({ label: e, value: t, onChange: n }) {
|
|
|
8343
8396
|
]
|
|
8344
8397
|
});
|
|
8345
8398
|
}
|
|
8346
|
-
function
|
|
8347
|
-
let t = F((e) => e.updateModule), n = F((e) => e.viewMode), r =
|
|
8399
|
+
function Is({ mod: e }) {
|
|
8400
|
+
let t = F((e) => e.updateModule), n = F((e) => e.viewMode), r = Lo((e) => e.enabled), i = e.style ?? {}, a = Cs(i, n), o = new Set(Object.keys(i.mobile ?? {})), s = (r) => t(e.id, { style: ws(i, r, n) });
|
|
8348
8401
|
return /* @__PURE__ */ M(A, { children: [
|
|
8349
|
-
/* @__PURE__ */ j(
|
|
8402
|
+
/* @__PURE__ */ j(Ds, { children: e.name }),
|
|
8350
8403
|
/* @__PURE__ */ j(Q, {
|
|
8351
|
-
label: /* @__PURE__ */ M(A, { children: ["Background color", /* @__PURE__ */ j(
|
|
8352
|
-
children: /* @__PURE__ */ j(
|
|
8404
|
+
label: /* @__PURE__ */ M(A, { children: ["Background color", /* @__PURE__ */ j(Ts, { overridden: o.has("backgroundColor") })] }),
|
|
8405
|
+
children: /* @__PURE__ */ j(As, {
|
|
8353
8406
|
value: a.backgroundColor ?? "",
|
|
8354
8407
|
onChange: (e) => s({ backgroundColor: e })
|
|
8355
8408
|
})
|
|
8356
8409
|
}),
|
|
8357
|
-
/* @__PURE__ */ j(
|
|
8410
|
+
/* @__PURE__ */ j(Rs, {
|
|
8358
8411
|
style: a,
|
|
8359
8412
|
mobileKeys: o,
|
|
8360
8413
|
onSet: s
|
|
8361
8414
|
}),
|
|
8362
8415
|
/* @__PURE__ */ j(Q, {
|
|
8363
|
-
label: /* @__PURE__ */ M(A, { children: ["Border radius", /* @__PURE__ */ j(
|
|
8364
|
-
children: /* @__PURE__ */ j(
|
|
8416
|
+
label: /* @__PURE__ */ M(A, { children: ["Border radius", /* @__PURE__ */ j(Ts, { overridden: o.has("borderRadius") })] }),
|
|
8417
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8365
8418
|
value: a.borderRadius ?? 0,
|
|
8366
8419
|
onChange: (e) => s({ borderRadius: Number(e.target.value) })
|
|
8367
8420
|
})
|
|
8368
8421
|
}),
|
|
8369
|
-
/* @__PURE__ */ j(
|
|
8422
|
+
/* @__PURE__ */ j(Es, {
|
|
8370
8423
|
hideOn: i.hideOn,
|
|
8371
8424
|
onChange: (n) => t(e.id, { style: {
|
|
8372
8425
|
...i,
|
|
8373
8426
|
hideOn: n
|
|
8374
8427
|
} })
|
|
8375
8428
|
}),
|
|
8376
|
-
r &&
|
|
8377
|
-
|
|
8429
|
+
r && Xo(e) && /* @__PURE__ */ j($o, { mod: e }),
|
|
8430
|
+
ms(e) && /* @__PURE__ */ j(_s, { mod: e })
|
|
8378
8431
|
] });
|
|
8379
8432
|
}
|
|
8380
|
-
function
|
|
8433
|
+
function Ls({ mod: e, el: t }) {
|
|
8381
8434
|
switch (t.type) {
|
|
8382
|
-
case "text": return /* @__PURE__ */ j(
|
|
8435
|
+
case "text": return /* @__PURE__ */ j(Bs, {
|
|
8383
8436
|
mod: e,
|
|
8384
8437
|
el: t
|
|
8385
8438
|
});
|
|
8386
|
-
case "image": return /* @__PURE__ */ j(
|
|
8439
|
+
case "image": return /* @__PURE__ */ j(Vs, {
|
|
8387
8440
|
mod: e,
|
|
8388
8441
|
el: t
|
|
8389
8442
|
});
|
|
8390
|
-
case "button": return /* @__PURE__ */ j(
|
|
8443
|
+
case "button": return /* @__PURE__ */ j(Hs, {
|
|
8391
8444
|
mod: e,
|
|
8392
8445
|
el: t
|
|
8393
8446
|
});
|
|
8394
|
-
case "spacer": return /* @__PURE__ */ j(
|
|
8447
|
+
case "spacer": return /* @__PURE__ */ j(Us, {
|
|
8395
8448
|
mod: e,
|
|
8396
8449
|
el: t
|
|
8397
8450
|
});
|
|
8398
|
-
case "divider": return /* @__PURE__ */ j(
|
|
8451
|
+
case "divider": return /* @__PURE__ */ j(Ws, {
|
|
8399
8452
|
mod: e,
|
|
8400
8453
|
el: t
|
|
8401
8454
|
});
|
|
8402
|
-
case "productGrid": return /* @__PURE__ */ j(
|
|
8455
|
+
case "productGrid": return /* @__PURE__ */ j(Ks, {
|
|
8403
8456
|
mod: e,
|
|
8404
8457
|
el: t
|
|
8405
8458
|
});
|
|
8406
8459
|
}
|
|
8407
8460
|
}
|
|
8408
|
-
function
|
|
8461
|
+
function Rs({ style: e, mobileKeys: t, onSet: n }) {
|
|
8409
8462
|
return /* @__PURE__ */ j("div", {
|
|
8410
8463
|
className: "grid grid-cols-2 gap-2 mb-3",
|
|
8411
8464
|
children: [
|
|
@@ -8414,29 +8467,29 @@ function Is({ style: e, mobileKeys: t, onSet: n }) {
|
|
|
8414
8467
|
"paddingLeft",
|
|
8415
8468
|
"paddingRight"
|
|
8416
8469
|
].map((r) => /* @__PURE__ */ j(Q, {
|
|
8417
|
-
label: /* @__PURE__ */ M(A, { children: [r.replace("padding", "Pad "), /* @__PURE__ */ j(
|
|
8418
|
-
children: /* @__PURE__ */ j(
|
|
8470
|
+
label: /* @__PURE__ */ M(A, { children: [r.replace("padding", "Pad "), /* @__PURE__ */ j(Ts, { overridden: !!t?.has(r) })] }),
|
|
8471
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8419
8472
|
value: e[r] ?? 0,
|
|
8420
8473
|
onChange: (e) => n({ [r]: Number(e.target.value) })
|
|
8421
8474
|
})
|
|
8422
8475
|
}, r))
|
|
8423
8476
|
});
|
|
8424
8477
|
}
|
|
8425
|
-
function
|
|
8478
|
+
function zs(e, t) {
|
|
8426
8479
|
let n = F((e) => e.updateElement);
|
|
8427
8480
|
return (r) => n(e.id, t.id, r);
|
|
8428
8481
|
}
|
|
8429
|
-
function
|
|
8430
|
-
let n =
|
|
8482
|
+
function Bs({ mod: e, el: t }) {
|
|
8483
|
+
let n = zs(e, t), r = F((e) => e.viewMode), i = t.style ?? {}, a = Cs(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: ws(i, e, r) });
|
|
8431
8484
|
return /* @__PURE__ */ M(A, { children: [
|
|
8432
|
-
/* @__PURE__ */ j(
|
|
8485
|
+
/* @__PURE__ */ j(Ds, { children: "Text block" }),
|
|
8433
8486
|
/* @__PURE__ */ j("p", {
|
|
8434
8487
|
className: "text-[10px] text-gray-400 mb-3 leading-relaxed",
|
|
8435
8488
|
children: "Click the text in the canvas to edit it inline. Select words to apply bold, italic, colour, links and more using the floating toolbar."
|
|
8436
8489
|
}),
|
|
8437
8490
|
/* @__PURE__ */ j(Q, {
|
|
8438
8491
|
label: "Default align",
|
|
8439
|
-
children: /* @__PURE__ */ M(
|
|
8492
|
+
children: /* @__PURE__ */ M(js, {
|
|
8440
8493
|
value: a.align ?? "left",
|
|
8441
8494
|
onChange: (e) => s({ align: e.target.value }),
|
|
8442
8495
|
children: [
|
|
@@ -8459,25 +8512,25 @@ function Rs({ mod: e, el: t }) {
|
|
|
8459
8512
|
className: "grid grid-cols-2 gap-2",
|
|
8460
8513
|
children: [/* @__PURE__ */ j(Q, {
|
|
8461
8514
|
label: "Line height",
|
|
8462
|
-
children: /* @__PURE__ */ j(
|
|
8515
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8463
8516
|
step: .1,
|
|
8464
8517
|
value: a.lineHeight ?? 1.5,
|
|
8465
8518
|
onChange: (e) => s({ lineHeight: Number(e.target.value) })
|
|
8466
8519
|
})
|
|
8467
8520
|
}), /* @__PURE__ */ j(Q, {
|
|
8468
8521
|
label: "Letter spacing",
|
|
8469
|
-
children: /* @__PURE__ */ j(
|
|
8522
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8470
8523
|
value: a.letterSpacing ?? 0,
|
|
8471
8524
|
onChange: (e) => s({ letterSpacing: Number(e.target.value) })
|
|
8472
8525
|
})
|
|
8473
8526
|
})]
|
|
8474
8527
|
}),
|
|
8475
|
-
/* @__PURE__ */ j(
|
|
8528
|
+
/* @__PURE__ */ j(Rs, {
|
|
8476
8529
|
style: a,
|
|
8477
8530
|
mobileKeys: o,
|
|
8478
8531
|
onSet: s
|
|
8479
8532
|
}),
|
|
8480
|
-
/* @__PURE__ */ j(
|
|
8533
|
+
/* @__PURE__ */ j(Es, {
|
|
8481
8534
|
hideOn: i.hideOn,
|
|
8482
8535
|
onChange: (e) => n({ style: {
|
|
8483
8536
|
...i,
|
|
@@ -8486,13 +8539,13 @@ function Rs({ mod: e, el: t }) {
|
|
|
8486
8539
|
})
|
|
8487
8540
|
] });
|
|
8488
8541
|
}
|
|
8489
|
-
function
|
|
8490
|
-
let n =
|
|
8542
|
+
function Vs({ mod: e, el: t }) {
|
|
8543
|
+
let n = zs(e, t), r = F((e) => e.viewMode), i = t.style ?? {}, a = Cs(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: ws(i, e, r) });
|
|
8491
8544
|
return /* @__PURE__ */ M(A, { children: [
|
|
8492
|
-
/* @__PURE__ */ j(
|
|
8545
|
+
/* @__PURE__ */ j(Ds, { children: "Image" }),
|
|
8493
8546
|
/* @__PURE__ */ j(Q, {
|
|
8494
8547
|
label: "Image URL",
|
|
8495
|
-
children: /* @__PURE__ */ j(
|
|
8548
|
+
children: /* @__PURE__ */ j(ks, {
|
|
8496
8549
|
value: t.src,
|
|
8497
8550
|
onChange: (e) => n({ src: e }),
|
|
8498
8551
|
onAlt: (e) => n({ alt: e })
|
|
@@ -8512,7 +8565,7 @@ function zs({ mod: e, el: t }) {
|
|
|
8512
8565
|
onChange: (e) => n({ link: e.target.value })
|
|
8513
8566
|
})
|
|
8514
8567
|
}),
|
|
8515
|
-
/* @__PURE__ */ j(
|
|
8568
|
+
/* @__PURE__ */ j(Ms, {
|
|
8516
8569
|
linkType: t.linkType,
|
|
8517
8570
|
onChangeLinkType: (e) => n({ linkType: e }),
|
|
8518
8571
|
onChangeLink: (e) => n({ link: e })
|
|
@@ -8520,14 +8573,14 @@ function zs({ mod: e, el: t }) {
|
|
|
8520
8573
|
/* @__PURE__ */ M("div", {
|
|
8521
8574
|
className: "grid grid-cols-2 gap-2",
|
|
8522
8575
|
children: [/* @__PURE__ */ j(Q, {
|
|
8523
|
-
label: /* @__PURE__ */ M(A, { children: ["Width", /* @__PURE__ */ j(
|
|
8524
|
-
children: /* @__PURE__ */ j(
|
|
8576
|
+
label: /* @__PURE__ */ M(A, { children: ["Width", /* @__PURE__ */ j(Ts, { overridden: o.has("width") })] }),
|
|
8577
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8525
8578
|
value: a.width ?? 0,
|
|
8526
8579
|
onChange: (e) => s({ width: Number(e.target.value) })
|
|
8527
8580
|
})
|
|
8528
8581
|
}), /* @__PURE__ */ j(Q, {
|
|
8529
|
-
label: /* @__PURE__ */ M(A, { children: ["Height", /* @__PURE__ */ j(
|
|
8530
|
-
children: /* @__PURE__ */ j(
|
|
8582
|
+
label: /* @__PURE__ */ M(A, { children: ["Height", /* @__PURE__ */ j(Ts, { overridden: o.has("height") })] }),
|
|
8583
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8531
8584
|
value: a.height ?? 0,
|
|
8532
8585
|
onChange: (e) => s({ height: Number(e.target.value) || void 0 })
|
|
8533
8586
|
})
|
|
@@ -8535,14 +8588,14 @@ function zs({ mod: e, el: t }) {
|
|
|
8535
8588
|
}),
|
|
8536
8589
|
/* @__PURE__ */ j(Q, {
|
|
8537
8590
|
label: "Border radius",
|
|
8538
|
-
children: /* @__PURE__ */ j(
|
|
8591
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8539
8592
|
value: a.borderRadius ?? 0,
|
|
8540
8593
|
onChange: (e) => s({ borderRadius: Number(e.target.value) })
|
|
8541
8594
|
})
|
|
8542
8595
|
}),
|
|
8543
8596
|
/* @__PURE__ */ j(Q, {
|
|
8544
8597
|
label: "Align",
|
|
8545
|
-
children: /* @__PURE__ */ M(
|
|
8598
|
+
children: /* @__PURE__ */ M(js, {
|
|
8546
8599
|
value: a.align ?? "center",
|
|
8547
8600
|
onChange: (e) => s({ align: e.target.value }),
|
|
8548
8601
|
children: [
|
|
@@ -8561,12 +8614,12 @@ function zs({ mod: e, el: t }) {
|
|
|
8561
8614
|
]
|
|
8562
8615
|
})
|
|
8563
8616
|
}),
|
|
8564
|
-
/* @__PURE__ */ j(
|
|
8617
|
+
/* @__PURE__ */ j(Rs, {
|
|
8565
8618
|
style: a,
|
|
8566
8619
|
mobileKeys: o,
|
|
8567
8620
|
onSet: s
|
|
8568
8621
|
}),
|
|
8569
|
-
/* @__PURE__ */ j(
|
|
8622
|
+
/* @__PURE__ */ j(Es, {
|
|
8570
8623
|
hideOn: i.hideOn,
|
|
8571
8624
|
onChange: (e) => n({ style: {
|
|
8572
8625
|
...i,
|
|
@@ -8575,10 +8628,10 @@ function zs({ mod: e, el: t }) {
|
|
|
8575
8628
|
})
|
|
8576
8629
|
] });
|
|
8577
8630
|
}
|
|
8578
|
-
function
|
|
8579
|
-
let n =
|
|
8631
|
+
function Hs({ mod: e, el: t }) {
|
|
8632
|
+
let n = zs(e, t), r = F((e) => e.viewMode), i = t.style ?? {}, a = Cs(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: ws(i, e, r) });
|
|
8580
8633
|
return /* @__PURE__ */ M(A, { children: [
|
|
8581
|
-
/* @__PURE__ */ j(
|
|
8634
|
+
/* @__PURE__ */ j(Ds, { children: "Button" }),
|
|
8582
8635
|
/* @__PURE__ */ j(Q, {
|
|
8583
8636
|
label: "Label",
|
|
8584
8637
|
children: /* @__PURE__ */ j($, {
|
|
@@ -8593,21 +8646,21 @@ function Bs({ mod: e, el: t }) {
|
|
|
8593
8646
|
onChange: (e) => n({ link: e.target.value })
|
|
8594
8647
|
})
|
|
8595
8648
|
}),
|
|
8596
|
-
/* @__PURE__ */ j(
|
|
8649
|
+
/* @__PURE__ */ j(Ms, {
|
|
8597
8650
|
linkType: t.linkType,
|
|
8598
8651
|
onChangeLinkType: (e) => n({ linkType: e }),
|
|
8599
8652
|
onChangeLink: (e) => n({ link: e })
|
|
8600
8653
|
}),
|
|
8601
8654
|
/* @__PURE__ */ j(Q, {
|
|
8602
8655
|
label: "Background color",
|
|
8603
|
-
children: /* @__PURE__ */ j(
|
|
8656
|
+
children: /* @__PURE__ */ j(As, {
|
|
8604
8657
|
value: a.backgroundColor ?? "",
|
|
8605
8658
|
onChange: (e) => s({ backgroundColor: e })
|
|
8606
8659
|
})
|
|
8607
8660
|
}),
|
|
8608
8661
|
/* @__PURE__ */ j(Q, {
|
|
8609
8662
|
label: "Text color",
|
|
8610
|
-
children: /* @__PURE__ */ j(
|
|
8663
|
+
children: /* @__PURE__ */ j(As, {
|
|
8611
8664
|
value: a.color ?? "#FFFFFF",
|
|
8612
8665
|
onChange: (e) => s({ color: e })
|
|
8613
8666
|
})
|
|
@@ -8616,13 +8669,13 @@ function Bs({ mod: e, el: t }) {
|
|
|
8616
8669
|
className: "grid grid-cols-2 gap-2",
|
|
8617
8670
|
children: [/* @__PURE__ */ j(Q, {
|
|
8618
8671
|
label: "Font size",
|
|
8619
|
-
children: /* @__PURE__ */ j(
|
|
8672
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8620
8673
|
value: a.fontSize ?? 16,
|
|
8621
8674
|
onChange: (e) => s({ fontSize: Number(e.target.value) })
|
|
8622
8675
|
})
|
|
8623
8676
|
}), /* @__PURE__ */ j(Q, {
|
|
8624
8677
|
label: "Border radius",
|
|
8625
|
-
children: /* @__PURE__ */ j(
|
|
8678
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8626
8679
|
value: a.borderRadius ?? 6,
|
|
8627
8680
|
onChange: (e) => s({ borderRadius: Number(e.target.value) })
|
|
8628
8681
|
})
|
|
@@ -8630,7 +8683,7 @@ function Bs({ mod: e, el: t }) {
|
|
|
8630
8683
|
}),
|
|
8631
8684
|
/* @__PURE__ */ j(Q, {
|
|
8632
8685
|
label: "Align",
|
|
8633
|
-
children: /* @__PURE__ */ M(
|
|
8686
|
+
children: /* @__PURE__ */ M(js, {
|
|
8634
8687
|
value: a.align ?? "center",
|
|
8635
8688
|
onChange: (e) => s({ align: e.target.value }),
|
|
8636
8689
|
children: [
|
|
@@ -8649,12 +8702,12 @@ function Bs({ mod: e, el: t }) {
|
|
|
8649
8702
|
]
|
|
8650
8703
|
})
|
|
8651
8704
|
}),
|
|
8652
|
-
/* @__PURE__ */ j(
|
|
8705
|
+
/* @__PURE__ */ j(Rs, {
|
|
8653
8706
|
style: a,
|
|
8654
8707
|
mobileKeys: o,
|
|
8655
8708
|
onSet: s
|
|
8656
8709
|
}),
|
|
8657
|
-
/* @__PURE__ */ j(
|
|
8710
|
+
/* @__PURE__ */ j(Es, {
|
|
8658
8711
|
hideOn: i.hideOn,
|
|
8659
8712
|
onChange: (e) => n({ style: {
|
|
8660
8713
|
...i,
|
|
@@ -8663,40 +8716,40 @@ function Bs({ mod: e, el: t }) {
|
|
|
8663
8716
|
})
|
|
8664
8717
|
] });
|
|
8665
8718
|
}
|
|
8666
|
-
function
|
|
8667
|
-
let n =
|
|
8668
|
-
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(
|
|
8719
|
+
function Us({ mod: e, el: t }) {
|
|
8720
|
+
let n = zs(e, t);
|
|
8721
|
+
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(Ds, { children: "Spacer" }), /* @__PURE__ */ j(Q, {
|
|
8669
8722
|
label: "Height (px)",
|
|
8670
|
-
children: /* @__PURE__ */ j(
|
|
8723
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8671
8724
|
value: t.height,
|
|
8672
8725
|
onChange: (e) => n({ height: Number(e.target.value) || 0 })
|
|
8673
8726
|
})
|
|
8674
8727
|
})] });
|
|
8675
8728
|
}
|
|
8676
|
-
function
|
|
8677
|
-
let n =
|
|
8729
|
+
function Ws({ mod: e, el: t }) {
|
|
8730
|
+
let n = zs(e, t), r = F((e) => e.viewMode), i = t.style ?? {}, a = Cs(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: ws(i, e, r) });
|
|
8678
8731
|
return /* @__PURE__ */ M(A, { children: [
|
|
8679
|
-
/* @__PURE__ */ j(
|
|
8732
|
+
/* @__PURE__ */ j(Ds, { children: "Divider" }),
|
|
8680
8733
|
/* @__PURE__ */ j(Q, {
|
|
8681
8734
|
label: "Color",
|
|
8682
|
-
children: /* @__PURE__ */ j(
|
|
8735
|
+
children: /* @__PURE__ */ j(As, {
|
|
8683
8736
|
value: a.color ?? "#E5E7EB",
|
|
8684
8737
|
onChange: (e) => s({ color: e })
|
|
8685
8738
|
})
|
|
8686
8739
|
}),
|
|
8687
8740
|
/* @__PURE__ */ j(Q, {
|
|
8688
8741
|
label: "Thickness",
|
|
8689
|
-
children: /* @__PURE__ */ j(
|
|
8742
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8690
8743
|
value: a.thickness ?? 1,
|
|
8691
8744
|
onChange: (e) => s({ thickness: Number(e.target.value) })
|
|
8692
8745
|
})
|
|
8693
8746
|
}),
|
|
8694
|
-
/* @__PURE__ */ j(
|
|
8747
|
+
/* @__PURE__ */ j(Rs, {
|
|
8695
8748
|
style: a,
|
|
8696
8749
|
mobileKeys: o,
|
|
8697
8750
|
onSet: s
|
|
8698
8751
|
}),
|
|
8699
|
-
/* @__PURE__ */ j(
|
|
8752
|
+
/* @__PURE__ */ j(Es, {
|
|
8700
8753
|
hideOn: i.hideOn,
|
|
8701
8754
|
onChange: (e) => n({ style: {
|
|
8702
8755
|
...i,
|
|
@@ -8705,7 +8758,7 @@ function Hs({ mod: e, el: t }) {
|
|
|
8705
8758
|
})
|
|
8706
8759
|
] });
|
|
8707
8760
|
}
|
|
8708
|
-
function
|
|
8761
|
+
function Gs(e = 0) {
|
|
8709
8762
|
let t = e + 1;
|
|
8710
8763
|
return {
|
|
8711
8764
|
id: `p_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`,
|
|
@@ -8718,17 +8771,17 @@ function Us(e = 0) {
|
|
|
8718
8771
|
link: "#"
|
|
8719
8772
|
};
|
|
8720
8773
|
}
|
|
8721
|
-
function
|
|
8722
|
-
let n =
|
|
8774
|
+
function Ks({ mod: e, el: t }) {
|
|
8775
|
+
let n = zs(e, t), r = F((e) => e.viewMode), i = t.style ?? {}, a = Cs(i, r), o = (e) => n({ style: ws(i, e, r) }), s = (e) => n({ products: e }), c = (e) => {
|
|
8723
8776
|
let r = e, i = t.products.slice();
|
|
8724
|
-
if (i.length < r) for (; i.length < r;) i.push(
|
|
8777
|
+
if (i.length < r) for (; i.length < r;) i.push(Gs(i.length));
|
|
8725
8778
|
n({
|
|
8726
8779
|
columns: e,
|
|
8727
8780
|
products: i
|
|
8728
8781
|
});
|
|
8729
|
-
}, l =
|
|
8782
|
+
}, l = bs(), [u, d] = f(null);
|
|
8730
8783
|
return /* @__PURE__ */ M(A, { children: [
|
|
8731
|
-
/* @__PURE__ */ j(
|
|
8784
|
+
/* @__PURE__ */ j(Ds, { children: "Product Grid" }),
|
|
8732
8785
|
/* @__PURE__ */ M(Q, {
|
|
8733
8786
|
label: "Columns (desktop)",
|
|
8734
8787
|
children: [/* @__PURE__ */ j("div", {
|
|
@@ -8751,22 +8804,22 @@ function Ws({ mod: e, el: t }) {
|
|
|
8751
8804
|
children: "Always stacks to 1 column on mobile."
|
|
8752
8805
|
})]
|
|
8753
8806
|
}),
|
|
8754
|
-
/* @__PURE__ */ j(
|
|
8807
|
+
/* @__PURE__ */ j(Js, {
|
|
8755
8808
|
label: "Show old price",
|
|
8756
8809
|
checked: t.showOldPrice,
|
|
8757
8810
|
onChange: (e) => n({ showOldPrice: e })
|
|
8758
8811
|
}),
|
|
8759
|
-
/* @__PURE__ */ j(
|
|
8812
|
+
/* @__PURE__ */ j(Js, {
|
|
8760
8813
|
label: "Show description",
|
|
8761
8814
|
checked: t.showDescription,
|
|
8762
8815
|
onChange: (e) => n({ showDescription: e })
|
|
8763
8816
|
}),
|
|
8764
|
-
/* @__PURE__ */ j(
|
|
8817
|
+
/* @__PURE__ */ j(Js, {
|
|
8765
8818
|
label: "Show stars",
|
|
8766
8819
|
checked: t.showStars ?? !1,
|
|
8767
8820
|
onChange: (e) => n({ showStars: e })
|
|
8768
8821
|
}),
|
|
8769
|
-
/* @__PURE__ */ j(
|
|
8822
|
+
/* @__PURE__ */ j(Js, {
|
|
8770
8823
|
label: "Show button",
|
|
8771
8824
|
checked: t.showButton,
|
|
8772
8825
|
onChange: (e) => n({ showButton: e })
|
|
@@ -8783,7 +8836,7 @@ function Ws({ mod: e, el: t }) {
|
|
|
8783
8836
|
className: "mt-4 pt-3 border-t border-gray-100",
|
|
8784
8837
|
children: [/* @__PURE__ */ M("div", {
|
|
8785
8838
|
className: "flex items-center justify-between mb-2",
|
|
8786
|
-
children: [/* @__PURE__ */ M(
|
|
8839
|
+
children: [/* @__PURE__ */ M(Ds, { children: [
|
|
8787
8840
|
"Products (",
|
|
8788
8841
|
t.products.length,
|
|
8789
8842
|
")"
|
|
@@ -8798,13 +8851,13 @@ function Ws({ mod: e, el: t }) {
|
|
|
8798
8851
|
title: "Find a product from your catalog",
|
|
8799
8852
|
children: [/* @__PURE__ */ j(xe, { size: 12 }), " Find"]
|
|
8800
8853
|
}), /* @__PURE__ */ M("button", {
|
|
8801
|
-
onClick: () => s([...t.products,
|
|
8854
|
+
onClick: () => s([...t.products, Gs(t.products.length)]),
|
|
8802
8855
|
className: "flex items-center gap-1 px-1.5 py-0.5 text-[11px] text-blue-600 hover:bg-blue-50 rounded",
|
|
8803
8856
|
title: "Add product",
|
|
8804
8857
|
children: [/* @__PURE__ */ j(_e, { size: 12 }), " Add"]
|
|
8805
8858
|
})]
|
|
8806
8859
|
})]
|
|
8807
|
-
}), t.products.map((e, n) => /* @__PURE__ */ j(
|
|
8860
|
+
}), t.products.map((e, n) => /* @__PURE__ */ j(Ys, {
|
|
8808
8861
|
index: n,
|
|
8809
8862
|
product: e,
|
|
8810
8863
|
canSearch: l,
|
|
@@ -8819,7 +8872,7 @@ function Ws({ mod: e, el: t }) {
|
|
|
8819
8872
|
onDelete: () => s(t.products.filter((e, t) => t !== n))
|
|
8820
8873
|
}, e.id))]
|
|
8821
8874
|
}),
|
|
8822
|
-
/* @__PURE__ */ j(
|
|
8875
|
+
/* @__PURE__ */ j(vs, {
|
|
8823
8876
|
open: u !== null,
|
|
8824
8877
|
initialQuery: u?.query,
|
|
8825
8878
|
title: u?.index == null ? "Add product from search" : "Replace product",
|
|
@@ -8854,57 +8907,57 @@ function Ws({ mod: e, el: t }) {
|
|
|
8854
8907
|
/* @__PURE__ */ M("div", {
|
|
8855
8908
|
className: "mt-4 pt-3 border-t border-gray-100",
|
|
8856
8909
|
children: [
|
|
8857
|
-
/* @__PURE__ */ j(
|
|
8910
|
+
/* @__PURE__ */ j(Ds, { children: "Style" }),
|
|
8858
8911
|
/* @__PURE__ */ j(Q, {
|
|
8859
8912
|
label: "Card background",
|
|
8860
|
-
children: /* @__PURE__ */ j(
|
|
8913
|
+
children: /* @__PURE__ */ j(As, {
|
|
8861
8914
|
value: a.cardBackgroundColor ?? "",
|
|
8862
8915
|
onChange: (e) => o({ cardBackgroundColor: e })
|
|
8863
8916
|
})
|
|
8864
8917
|
}),
|
|
8865
8918
|
/* @__PURE__ */ j(Q, {
|
|
8866
8919
|
label: "Name color",
|
|
8867
|
-
children: /* @__PURE__ */ j(
|
|
8920
|
+
children: /* @__PURE__ */ j(As, {
|
|
8868
8921
|
value: a.nameColor ?? "",
|
|
8869
8922
|
onChange: (e) => o({ nameColor: e })
|
|
8870
8923
|
})
|
|
8871
8924
|
}),
|
|
8872
8925
|
/* @__PURE__ */ j(Q, {
|
|
8873
8926
|
label: "Final price color",
|
|
8874
|
-
children: /* @__PURE__ */ j(
|
|
8927
|
+
children: /* @__PURE__ */ j(As, {
|
|
8875
8928
|
value: a.finalPriceColor ?? "",
|
|
8876
8929
|
onChange: (e) => o({ finalPriceColor: e })
|
|
8877
8930
|
})
|
|
8878
8931
|
}),
|
|
8879
8932
|
/* @__PURE__ */ j(Q, {
|
|
8880
8933
|
label: "Old price color",
|
|
8881
|
-
children: /* @__PURE__ */ j(
|
|
8934
|
+
children: /* @__PURE__ */ j(As, {
|
|
8882
8935
|
value: a.oldPriceColor ?? "",
|
|
8883
8936
|
onChange: (e) => o({ oldPriceColor: e })
|
|
8884
8937
|
})
|
|
8885
8938
|
}),
|
|
8886
8939
|
/* @__PURE__ */ j(Q, {
|
|
8887
8940
|
label: "Button background",
|
|
8888
|
-
children: /* @__PURE__ */ j(
|
|
8941
|
+
children: /* @__PURE__ */ j(As, {
|
|
8889
8942
|
value: a.buttonBackgroundColor ?? "",
|
|
8890
8943
|
onChange: (e) => o({ buttonBackgroundColor: e })
|
|
8891
8944
|
})
|
|
8892
8945
|
}),
|
|
8893
8946
|
/* @__PURE__ */ j(Q, {
|
|
8894
8947
|
label: "Button text color",
|
|
8895
|
-
children: /* @__PURE__ */ j(
|
|
8948
|
+
children: /* @__PURE__ */ j(As, {
|
|
8896
8949
|
value: a.buttonColor ?? "",
|
|
8897
8950
|
onChange: (e) => o({ buttonColor: e })
|
|
8898
8951
|
})
|
|
8899
8952
|
}),
|
|
8900
8953
|
/* @__PURE__ */ j(Q, {
|
|
8901
8954
|
label: "Card radius",
|
|
8902
|
-
children: /* @__PURE__ */ j(
|
|
8955
|
+
children: /* @__PURE__ */ j(Os, {
|
|
8903
8956
|
value: a.borderRadius ?? 0,
|
|
8904
8957
|
onChange: (e) => o({ borderRadius: Number(e.target.value) })
|
|
8905
8958
|
})
|
|
8906
8959
|
}),
|
|
8907
|
-
/* @__PURE__ */ j(
|
|
8960
|
+
/* @__PURE__ */ j(Rs, {
|
|
8908
8961
|
style: a,
|
|
8909
8962
|
onSet: o
|
|
8910
8963
|
})
|
|
@@ -8912,7 +8965,7 @@ function Ws({ mod: e, el: t }) {
|
|
|
8912
8965
|
})
|
|
8913
8966
|
] });
|
|
8914
8967
|
}
|
|
8915
|
-
function
|
|
8968
|
+
function qs({ checked: e, onChange: t }) {
|
|
8916
8969
|
return /* @__PURE__ */ j("button", {
|
|
8917
8970
|
type: "button",
|
|
8918
8971
|
role: "switch",
|
|
@@ -8924,19 +8977,19 @@ function Gs({ checked: e, onChange: t }) {
|
|
|
8924
8977
|
children: /* @__PURE__ */ j("span", { className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e ? "translate-x-4" : "translate-x-0.5"}` })
|
|
8925
8978
|
});
|
|
8926
8979
|
}
|
|
8927
|
-
function
|
|
8980
|
+
function Js({ label: e, checked: t, onChange: n }) {
|
|
8928
8981
|
return /* @__PURE__ */ M("div", {
|
|
8929
8982
|
className: "mb-3 flex items-center justify-between gap-2",
|
|
8930
8983
|
children: [/* @__PURE__ */ j("span", {
|
|
8931
8984
|
className: "text-xs text-gray-600",
|
|
8932
8985
|
children: e
|
|
8933
|
-
}), /* @__PURE__ */ j(
|
|
8986
|
+
}), /* @__PURE__ */ j(qs, {
|
|
8934
8987
|
checked: t,
|
|
8935
8988
|
onChange: n
|
|
8936
8989
|
})]
|
|
8937
8990
|
});
|
|
8938
8991
|
}
|
|
8939
|
-
function
|
|
8992
|
+
function Ys({ index: e, product: t, canSearch: n, onSearch: r, onChange: i, onDelete: a }) {
|
|
8940
8993
|
let o = (e) => i({
|
|
8941
8994
|
...t,
|
|
8942
8995
|
...e
|
|
@@ -8975,7 +9028,7 @@ function qs({ index: e, product: t, canSearch: n, onSearch: r, onChange: i, onDe
|
|
|
8975
9028
|
}),
|
|
8976
9029
|
/* @__PURE__ */ j(Q, {
|
|
8977
9030
|
label: "Image URL",
|
|
8978
|
-
children: /* @__PURE__ */ j(
|
|
9031
|
+
children: /* @__PURE__ */ j(ks, {
|
|
8979
9032
|
value: t.image,
|
|
8980
9033
|
onChange: (e) => o({ image: e }),
|
|
8981
9034
|
onAlt: (e) => o({ imageAlt: e })
|
|
@@ -9014,7 +9067,7 @@ function qs({ index: e, product: t, canSearch: n, onSearch: r, onChange: i, onDe
|
|
|
9014
9067
|
}),
|
|
9015
9068
|
/* @__PURE__ */ j(Q, {
|
|
9016
9069
|
label: "Stars (0–5, optional)",
|
|
9017
|
-
children: /* @__PURE__ */ j(
|
|
9070
|
+
children: /* @__PURE__ */ j(Os, {
|
|
9018
9071
|
value: t.stars ?? "",
|
|
9019
9072
|
min: 0,
|
|
9020
9073
|
max: 5,
|
|
@@ -9036,7 +9089,7 @@ function qs({ index: e, product: t, canSearch: n, onSearch: r, onChange: i, onDe
|
|
|
9036
9089
|
}
|
|
9037
9090
|
//#endregion
|
|
9038
9091
|
//#region src/modules/basic.ts
|
|
9039
|
-
var
|
|
9092
|
+
var Xs = [
|
|
9040
9093
|
{
|
|
9041
9094
|
type: "basic.text",
|
|
9042
9095
|
category: "basic",
|
|
@@ -9123,7 +9176,7 @@ var Js = [
|
|
|
9123
9176
|
],
|
|
9124
9177
|
create: () => H("basic.divider", "Divider", [V()])
|
|
9125
9178
|
}
|
|
9126
|
-
],
|
|
9179
|
+
], Zs = [
|
|
9127
9180
|
{
|
|
9128
9181
|
type: "header.logo",
|
|
9129
9182
|
category: "header",
|
|
@@ -9397,7 +9450,7 @@ var Js = [
|
|
|
9397
9450
|
lineHeight: 1.2
|
|
9398
9451
|
})])
|
|
9399
9452
|
}
|
|
9400
|
-
],
|
|
9453
|
+
], Qs = [
|
|
9401
9454
|
{
|
|
9402
9455
|
type: "menu.horizontal",
|
|
9403
9456
|
category: "menu",
|
|
@@ -9521,7 +9574,7 @@ var Js = [
|
|
|
9521
9574
|
paddingBottom: 12
|
|
9522
9575
|
})])
|
|
9523
9576
|
}
|
|
9524
|
-
],
|
|
9577
|
+
], $s = [
|
|
9525
9578
|
{
|
|
9526
9579
|
type: "content.headline_body",
|
|
9527
9580
|
category: "content",
|
|
@@ -10131,7 +10184,7 @@ var Js = [
|
|
|
10131
10184
|
paddingRight: 16
|
|
10132
10185
|
})
|
|
10133
10186
|
}
|
|
10134
|
-
],
|
|
10187
|
+
], ec = [
|
|
10135
10188
|
{
|
|
10136
10189
|
type: "feature.list",
|
|
10137
10190
|
category: "feature",
|
|
@@ -10441,7 +10494,7 @@ var Js = [
|
|
|
10441
10494
|
})
|
|
10442
10495
|
])
|
|
10443
10496
|
}
|
|
10444
|
-
],
|
|
10497
|
+
], tc = [
|
|
10445
10498
|
{
|
|
10446
10499
|
type: "cta.simple",
|
|
10447
10500
|
category: "call_to_action",
|
|
@@ -10668,7 +10721,7 @@ var Js = [
|
|
|
10668
10721
|
lineHeight: 1.6
|
|
10669
10722
|
})])
|
|
10670
10723
|
}
|
|
10671
|
-
],
|
|
10724
|
+
], nc = [
|
|
10672
10725
|
{
|
|
10673
10726
|
type: "ecom.product_single",
|
|
10674
10727
|
category: "ecommerce",
|
|
@@ -10970,7 +11023,7 @@ var Js = [
|
|
|
10970
11023
|
showOldPrice: !0
|
|
10971
11024
|
})])
|
|
10972
11025
|
}
|
|
10973
|
-
],
|
|
11026
|
+
], rc = [
|
|
10974
11027
|
{
|
|
10975
11028
|
type: "tx.order_summary",
|
|
10976
11029
|
category: "transactional",
|
|
@@ -11173,7 +11226,7 @@ var Js = [
|
|
|
11173
11226
|
B(16)
|
|
11174
11227
|
])
|
|
11175
11228
|
}
|
|
11176
|
-
],
|
|
11229
|
+
], ic = [
|
|
11177
11230
|
{
|
|
11178
11231
|
type: "social.icons",
|
|
11179
11232
|
category: "social",
|
|
@@ -11291,11 +11344,11 @@ var Js = [
|
|
|
11291
11344
|
B(8)
|
|
11292
11345
|
])
|
|
11293
11346
|
}
|
|
11294
|
-
],
|
|
11347
|
+
], ac = {
|
|
11295
11348
|
backgroundColor: "{colors.background}",
|
|
11296
11349
|
paddingTop: 0,
|
|
11297
11350
|
paddingBottom: 0
|
|
11298
|
-
},
|
|
11351
|
+
}, oc = [
|
|
11299
11352
|
{
|
|
11300
11353
|
type: "footer.simple",
|
|
11301
11354
|
category: "footer",
|
|
@@ -11324,7 +11377,7 @@ var Js = [
|
|
|
11324
11377
|
type: "view_in_browser"
|
|
11325
11378
|
}])
|
|
11326
11379
|
], {
|
|
11327
|
-
...
|
|
11380
|
+
...ac,
|
|
11328
11381
|
paddingTop: 24
|
|
11329
11382
|
})
|
|
11330
11383
|
},
|
|
@@ -11357,7 +11410,7 @@ var Js = [
|
|
|
11357
11410
|
label: "Unsubscribe",
|
|
11358
11411
|
type: "unsubscribe"
|
|
11359
11412
|
}], { paddingBottom: 24 })
|
|
11360
|
-
],
|
|
11413
|
+
], ac)
|
|
11361
11414
|
},
|
|
11362
11415
|
{
|
|
11363
11416
|
type: "footer.legal",
|
|
@@ -11382,7 +11435,7 @@ var Js = [
|
|
|
11382
11435
|
}, {
|
|
11383
11436
|
label: "Unsubscribe",
|
|
11384
11437
|
type: "unsubscribe"
|
|
11385
|
-
}], { paddingBottom: 24 })],
|
|
11438
|
+
}], { paddingBottom: 24 })], ac)
|
|
11386
11439
|
},
|
|
11387
11440
|
{
|
|
11388
11441
|
type: "footer.publisher",
|
|
@@ -11429,7 +11482,7 @@ var Js = [
|
|
|
11429
11482
|
label: "Unsubscribe",
|
|
11430
11483
|
type: "unsubscribe"
|
|
11431
11484
|
}], { paddingBottom: 24 })
|
|
11432
|
-
],
|
|
11485
|
+
], ac)
|
|
11433
11486
|
},
|
|
11434
11487
|
{
|
|
11435
11488
|
type: "footer.app_links",
|
|
@@ -11471,7 +11524,7 @@ var Js = [
|
|
|
11471
11524
|
label: "Unsubscribe",
|
|
11472
11525
|
type: "unsubscribe"
|
|
11473
11526
|
}], { paddingBottom: 24 })
|
|
11474
|
-
],
|
|
11527
|
+
], ac)
|
|
11475
11528
|
},
|
|
11476
11529
|
{
|
|
11477
11530
|
type: "footer.address_only",
|
|
@@ -11491,7 +11544,7 @@ var Js = [
|
|
|
11491
11544
|
label: "Unsubscribe",
|
|
11492
11545
|
type: "unsubscribe"
|
|
11493
11546
|
}], { paddingBottom: 16 })], {
|
|
11494
|
-
...
|
|
11547
|
+
...ac,
|
|
11495
11548
|
paddingTop: 16
|
|
11496
11549
|
})
|
|
11497
11550
|
},
|
|
@@ -11533,7 +11586,7 @@ var Js = [
|
|
|
11533
11586
|
align: "center",
|
|
11534
11587
|
paddingBottom: 24
|
|
11535
11588
|
})
|
|
11536
|
-
],
|
|
11589
|
+
], ac)
|
|
11537
11590
|
},
|
|
11538
11591
|
{
|
|
11539
11592
|
type: "footer.signature",
|
|
@@ -11569,13 +11622,11 @@ var Js = [
|
|
|
11569
11622
|
separator: " · "
|
|
11570
11623
|
})
|
|
11571
11624
|
], {
|
|
11572
|
-
...
|
|
11625
|
+
...ac,
|
|
11573
11626
|
paddingTop: 0
|
|
11574
11627
|
})
|
|
11575
11628
|
}
|
|
11576
|
-
],
|
|
11577
|
-
...Js,
|
|
11578
|
-
...Ys,
|
|
11629
|
+
], sc = [
|
|
11579
11630
|
...Xs,
|
|
11580
11631
|
...Zs,
|
|
11581
11632
|
...Qs,
|
|
@@ -11583,18 +11634,20 @@ var Js = [
|
|
|
11583
11634
|
...ec,
|
|
11584
11635
|
...tc,
|
|
11585
11636
|
...nc,
|
|
11586
|
-
...
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11637
|
+
...rc,
|
|
11638
|
+
...ic,
|
|
11639
|
+
...oc
|
|
11640
|
+
], cc = !1;
|
|
11641
|
+
function lc() {
|
|
11642
|
+
if (!cc) {
|
|
11643
|
+
for (let e of sc) Wt.register(e);
|
|
11644
|
+
cc = !0;
|
|
11592
11645
|
}
|
|
11593
11646
|
}
|
|
11594
11647
|
//#endregion
|
|
11595
11648
|
//#region src/App.tsx
|
|
11596
|
-
|
|
11597
|
-
function
|
|
11649
|
+
lc();
|
|
11650
|
+
function uc() {
|
|
11598
11651
|
let { doc: e, addModule: t, loadFromLocalStorage: n } = F();
|
|
11599
11652
|
return s(() => {
|
|
11600
11653
|
if (n(), F.getState().doc.modules.length === 0) {
|
|
@@ -11622,20 +11675,20 @@ function cc() {
|
|
|
11622
11675
|
className: "flex flex-1 overflow-hidden",
|
|
11623
11676
|
children: [
|
|
11624
11677
|
/* @__PURE__ */ j(hn, {}),
|
|
11625
|
-
/* @__PURE__ */ j(
|
|
11626
|
-
/* @__PURE__ */ j(
|
|
11678
|
+
/* @__PURE__ */ j(oo, {}),
|
|
11679
|
+
/* @__PURE__ */ j(xs, {})
|
|
11627
11680
|
]
|
|
11628
11681
|
})]
|
|
11629
11682
|
});
|
|
11630
11683
|
}
|
|
11631
11684
|
//#endregion
|
|
11632
11685
|
//#region src/ai/provider.ts
|
|
11633
|
-
var
|
|
11686
|
+
var dc = (e) => {
|
|
11634
11687
|
if (e && typeof e == "object") return e;
|
|
11635
11688
|
throw Error("AI server returned a non-object response.");
|
|
11636
11689
|
};
|
|
11637
|
-
function
|
|
11638
|
-
let t = e.transformResponse ??
|
|
11690
|
+
function fc(e) {
|
|
11691
|
+
let t = e.transformResponse ?? dc, n = e.timeoutMs ?? 6e4;
|
|
11639
11692
|
return { async generate(r) {
|
|
11640
11693
|
let i = new AbortController(), a = setTimeout(() => i.abort(), n);
|
|
11641
11694
|
try {
|
|
@@ -11666,8 +11719,8 @@ function uc(e) {
|
|
|
11666
11719
|
}
|
|
11667
11720
|
//#endregion
|
|
11668
11721
|
//#region src/ai/index.ts
|
|
11669
|
-
function
|
|
11670
|
-
let t =
|
|
11722
|
+
function pc(e) {
|
|
11723
|
+
let t = fc(e);
|
|
11671
11724
|
return {
|
|
11672
11725
|
name: "ai-assistant",
|
|
11673
11726
|
type: "ai-provider",
|
|
@@ -11678,9 +11731,9 @@ function dc(e) {
|
|
|
11678
11731
|
}
|
|
11679
11732
|
//#endregion
|
|
11680
11733
|
//#region src/plugins/productSearch/index.ts
|
|
11681
|
-
function
|
|
11734
|
+
function mc(e) {
|
|
11682
11735
|
if (e == null) return null;
|
|
11683
|
-
if (Array.isArray(e)) return
|
|
11736
|
+
if (Array.isArray(e)) return mc(e[0]);
|
|
11684
11737
|
if (typeof e != "object") return null;
|
|
11685
11738
|
let t = e;
|
|
11686
11739
|
for (let e of [
|
|
@@ -11693,32 +11746,32 @@ function fc(e) {
|
|
|
11693
11746
|
"products",
|
|
11694
11747
|
"items",
|
|
11695
11748
|
"hits"
|
|
11696
|
-
]) if (Array.isArray(t[e])) return
|
|
11749
|
+
]) if (Array.isArray(t[e])) return mc(t[e]);
|
|
11697
11750
|
return t;
|
|
11698
11751
|
}
|
|
11699
|
-
function
|
|
11752
|
+
function hc(e, t) {
|
|
11700
11753
|
for (let n of t) {
|
|
11701
11754
|
let t = e[n];
|
|
11702
11755
|
if (typeof t == "string" && t.trim() !== "") return t;
|
|
11703
11756
|
if (typeof t == "number") return String(t);
|
|
11704
11757
|
}
|
|
11705
11758
|
}
|
|
11706
|
-
function
|
|
11759
|
+
function gc(e, t) {
|
|
11707
11760
|
for (let n of t) {
|
|
11708
11761
|
let t = e[n];
|
|
11709
11762
|
if (typeof t == "number" && Number.isFinite(t)) return t;
|
|
11710
11763
|
if (typeof t == "string" && t.trim() !== "" && !Number.isNaN(Number(t))) return Number(t);
|
|
11711
11764
|
}
|
|
11712
11765
|
}
|
|
11713
|
-
var
|
|
11714
|
-
let t =
|
|
11766
|
+
var _c = (e) => {
|
|
11767
|
+
let t = mc(e);
|
|
11715
11768
|
if (!t) return null;
|
|
11716
|
-
let n =
|
|
11769
|
+
let n = hc(t, [
|
|
11717
11770
|
"name",
|
|
11718
11771
|
"title",
|
|
11719
11772
|
"product_name",
|
|
11720
11773
|
"productName"
|
|
11721
|
-
]), r =
|
|
11774
|
+
]), r = hc(t, [
|
|
11722
11775
|
"finalPrice",
|
|
11723
11776
|
"final_price",
|
|
11724
11777
|
"price",
|
|
@@ -11728,7 +11781,7 @@ var hc = (e) => {
|
|
|
11728
11781
|
return !n || r == null ? null : {
|
|
11729
11782
|
name: n,
|
|
11730
11783
|
finalPrice: r,
|
|
11731
|
-
oldPrice:
|
|
11784
|
+
oldPrice: hc(t, [
|
|
11732
11785
|
"oldPrice",
|
|
11733
11786
|
"old_price",
|
|
11734
11787
|
"compare_at_price",
|
|
@@ -11736,38 +11789,38 @@ var hc = (e) => {
|
|
|
11736
11789
|
"list_price",
|
|
11737
11790
|
"listPrice"
|
|
11738
11791
|
]),
|
|
11739
|
-
description:
|
|
11792
|
+
description: hc(t, [
|
|
11740
11793
|
"description",
|
|
11741
11794
|
"desc",
|
|
11742
11795
|
"summary"
|
|
11743
11796
|
]),
|
|
11744
|
-
link:
|
|
11797
|
+
link: hc(t, [
|
|
11745
11798
|
"link",
|
|
11746
11799
|
"url",
|
|
11747
11800
|
"product_url",
|
|
11748
11801
|
"productUrl",
|
|
11749
11802
|
"permalink"
|
|
11750
11803
|
]),
|
|
11751
|
-
image:
|
|
11804
|
+
image: hc(t, [
|
|
11752
11805
|
"image",
|
|
11753
11806
|
"image_url",
|
|
11754
11807
|
"imageUrl",
|
|
11755
11808
|
"thumbnail",
|
|
11756
11809
|
"img"
|
|
11757
11810
|
]),
|
|
11758
|
-
imageAlt:
|
|
11811
|
+
imageAlt: hc(t, [
|
|
11759
11812
|
"imageAlt",
|
|
11760
11813
|
"image_alt",
|
|
11761
11814
|
"alt"
|
|
11762
11815
|
]),
|
|
11763
|
-
stars:
|
|
11816
|
+
stars: gc(t, [
|
|
11764
11817
|
"stars",
|
|
11765
11818
|
"rating",
|
|
11766
11819
|
"review_score",
|
|
11767
11820
|
"reviewScore",
|
|
11768
11821
|
"score"
|
|
11769
11822
|
]),
|
|
11770
|
-
sku:
|
|
11823
|
+
sku: hc(t, [
|
|
11771
11824
|
"sku",
|
|
11772
11825
|
"id",
|
|
11773
11826
|
"product_id",
|
|
@@ -11775,8 +11828,8 @@ var hc = (e) => {
|
|
|
11775
11828
|
])
|
|
11776
11829
|
};
|
|
11777
11830
|
};
|
|
11778
|
-
function
|
|
11779
|
-
let t = e.method ?? "GET", n = e.queryParam ?? "q", r = e.bodyParam ?? "query", i = e.timeoutMs ?? 15e3, a = e.transformResponse ??
|
|
11831
|
+
function vc(e) {
|
|
11832
|
+
let t = e.method ?? "GET", n = e.queryParam ?? "q", r = e.bodyParam ?? "query", i = e.timeoutMs ?? 15e3, a = e.transformResponse ?? _c;
|
|
11780
11833
|
return { async search(o) {
|
|
11781
11834
|
let s = o.trim();
|
|
11782
11835
|
if (!s) return null;
|
|
@@ -11808,8 +11861,8 @@ function gc(e) {
|
|
|
11808
11861
|
}
|
|
11809
11862
|
} };
|
|
11810
11863
|
}
|
|
11811
|
-
function
|
|
11812
|
-
let t =
|
|
11864
|
+
function yc(e) {
|
|
11865
|
+
let t = vc(e);
|
|
11813
11866
|
return {
|
|
11814
11867
|
name: "product-search",
|
|
11815
11868
|
type: "product-provider",
|
|
@@ -11820,7 +11873,7 @@ function _c(e) {
|
|
|
11820
11873
|
}
|
|
11821
11874
|
//#endregion
|
|
11822
11875
|
//#region src/plugins/voucherSelect/index.ts
|
|
11823
|
-
function
|
|
11876
|
+
function bc(e) {
|
|
11824
11877
|
if (Array.isArray(e)) return e;
|
|
11825
11878
|
if (e && typeof e == "object") {
|
|
11826
11879
|
let t = e;
|
|
@@ -11834,18 +11887,18 @@ function vc(e) {
|
|
|
11834
11887
|
}
|
|
11835
11888
|
return [];
|
|
11836
11889
|
}
|
|
11837
|
-
function
|
|
11890
|
+
function xc(e, t) {
|
|
11838
11891
|
for (let n of t) {
|
|
11839
11892
|
let t = e[n];
|
|
11840
11893
|
if (typeof t == "string" && t.trim() !== "") return t;
|
|
11841
11894
|
if (typeof t == "number") return String(t);
|
|
11842
11895
|
}
|
|
11843
11896
|
}
|
|
11844
|
-
var
|
|
11897
|
+
var Sc = (e) => {
|
|
11845
11898
|
let t = [];
|
|
11846
|
-
for (let n of
|
|
11899
|
+
for (let n of bc(e)) {
|
|
11847
11900
|
if (!n || typeof n != "object") continue;
|
|
11848
|
-
let e = n, r =
|
|
11901
|
+
let e = n, r = xc(e, [
|
|
11849
11902
|
"code",
|
|
11850
11903
|
"voucher_code",
|
|
11851
11904
|
"voucherCode",
|
|
@@ -11853,14 +11906,14 @@ var bc = (e) => {
|
|
|
11853
11906
|
"coupon_code",
|
|
11854
11907
|
"couponCode",
|
|
11855
11908
|
"value"
|
|
11856
|
-
]), i =
|
|
11909
|
+
]), i = xc(e, [
|
|
11857
11910
|
"id",
|
|
11858
11911
|
"voucher_id",
|
|
11859
11912
|
"voucherId",
|
|
11860
11913
|
"uid"
|
|
11861
11914
|
]) ?? r;
|
|
11862
11915
|
if (!i && !r) continue;
|
|
11863
|
-
let a =
|
|
11916
|
+
let a = xc(e, [
|
|
11864
11917
|
"title",
|
|
11865
11918
|
"name",
|
|
11866
11919
|
"label"
|
|
@@ -11869,7 +11922,7 @@ var bc = (e) => {
|
|
|
11869
11922
|
id: i ?? a,
|
|
11870
11923
|
title: a,
|
|
11871
11924
|
code: r ?? i ?? a,
|
|
11872
|
-
description:
|
|
11925
|
+
description: xc(e, [
|
|
11873
11926
|
"description",
|
|
11874
11927
|
"desc",
|
|
11875
11928
|
"summary"
|
|
@@ -11878,8 +11931,8 @@ var bc = (e) => {
|
|
|
11878
11931
|
}
|
|
11879
11932
|
return t;
|
|
11880
11933
|
};
|
|
11881
|
-
function
|
|
11882
|
-
let t = e.method ?? "GET", n = e.timeoutMs ?? 15e3, r = e.transformResponse ??
|
|
11934
|
+
function Cc(e) {
|
|
11935
|
+
let t = e.method ?? "GET", n = e.timeoutMs ?? 15e3, r = e.transformResponse ?? Sc;
|
|
11883
11936
|
return { async list() {
|
|
11884
11937
|
let i = new AbortController(), a = setTimeout(() => i.abort(), n);
|
|
11885
11938
|
try {
|
|
@@ -11904,19 +11957,19 @@ function xc(e) {
|
|
|
11904
11957
|
}
|
|
11905
11958
|
} };
|
|
11906
11959
|
}
|
|
11907
|
-
function
|
|
11908
|
-
let t =
|
|
11960
|
+
function wc(e) {
|
|
11961
|
+
let t = Cc(e);
|
|
11909
11962
|
return {
|
|
11910
11963
|
name: "voucher-select",
|
|
11911
11964
|
type: "voucher-provider",
|
|
11912
11965
|
setup(n) {
|
|
11913
|
-
n.registerVoucherProvider(t), e.preload &&
|
|
11966
|
+
n.registerVoucherProvider(t), e.preload && Po();
|
|
11914
11967
|
}
|
|
11915
11968
|
};
|
|
11916
11969
|
}
|
|
11917
11970
|
//#endregion
|
|
11918
11971
|
//#region src/plugins/imageUploader/index.ts
|
|
11919
|
-
var
|
|
11972
|
+
var Tc = (e) => {
|
|
11920
11973
|
if (e && typeof e == "object" && "url" in e && typeof e.url == "string") {
|
|
11921
11974
|
let t = e;
|
|
11922
11975
|
return {
|
|
@@ -11926,8 +11979,8 @@ var Cc = (e) => {
|
|
|
11926
11979
|
}
|
|
11927
11980
|
throw Error("Server response missing \"url\" string field.");
|
|
11928
11981
|
};
|
|
11929
|
-
function
|
|
11930
|
-
let t = e.fieldName ?? "file", n = (e.maxSizeMB ?? 10) * 1024 * 1024, r = e.transformResponse ??
|
|
11982
|
+
function Ec(e) {
|
|
11983
|
+
let t = e.fieldName ?? "file", n = (e.maxSizeMB ?? 10) * 1024 * 1024, r = e.transformResponse ?? Tc;
|
|
11931
11984
|
return { upload(i) {
|
|
11932
11985
|
return i.type.startsWith("image/") ? i.size > n ? Promise.reject(/* @__PURE__ */ Error(`File too large: ${(i.size / 1024 / 1024).toFixed(2)} MB > ${e.maxSizeMB ?? 10} MB`)) : new Promise((n, a) => {
|
|
11933
11986
|
let o = new XMLHttpRequest(), s = new FormData();
|
|
@@ -11952,36 +12005,36 @@ function wc(e) {
|
|
|
11952
12005
|
}) : Promise.reject(/* @__PURE__ */ Error(`Not an image: ${i.type || "unknown"}`));
|
|
11953
12006
|
} };
|
|
11954
12007
|
}
|
|
11955
|
-
function
|
|
12008
|
+
function Dc(e) {
|
|
11956
12009
|
return {
|
|
11957
12010
|
name: "image-uploader",
|
|
11958
12011
|
type: "asset-provider",
|
|
11959
12012
|
setup(t) {
|
|
11960
|
-
t.registerAssetProvider(
|
|
12013
|
+
t.registerAssetProvider(Ec(e));
|
|
11961
12014
|
}
|
|
11962
12015
|
};
|
|
11963
12016
|
}
|
|
11964
12017
|
//#endregion
|
|
11965
12018
|
//#region src/index.ts
|
|
11966
|
-
function
|
|
12019
|
+
function Oc(e) {
|
|
11967
12020
|
return s(() => {
|
|
11968
|
-
if (
|
|
11969
|
-
if (e.themes && F.setState({ themes: e.themes }), e.aiProvider)
|
|
12021
|
+
if (lc(), e.modules) for (let t of e.modules) Wt.register(t);
|
|
12022
|
+
if (e.themes && F.setState({ themes: e.themes }), e.aiProvider) Vo.setAIProvider(e.aiProvider);
|
|
11970
12023
|
else if (e.aiEndpoint) {
|
|
11971
12024
|
let t = typeof e.aiEndpoint == "string" ? { endpoint: e.aiEndpoint } : e.aiEndpoint;
|
|
11972
|
-
|
|
12025
|
+
Vo.setAIProvider(fc(t));
|
|
11973
12026
|
}
|
|
11974
|
-
if (e.productProvider)
|
|
12027
|
+
if (e.productProvider) Vo.registerProductProvider(e.productProvider);
|
|
11975
12028
|
else if (e.productEndpoint) {
|
|
11976
12029
|
let t = typeof e.productEndpoint == "string" ? { endpoint: e.productEndpoint } : e.productEndpoint;
|
|
11977
|
-
|
|
12030
|
+
Vo.registerProductProvider(vc(t));
|
|
11978
12031
|
}
|
|
11979
|
-
if (e.voucherProvider)
|
|
12032
|
+
if (e.voucherProvider) Vo.registerVoucherProvider(e.voucherProvider);
|
|
11980
12033
|
else if (e.voucherEndpoint) {
|
|
11981
12034
|
let t = typeof e.voucherEndpoint == "string" ? { endpoint: e.voucherEndpoint } : e.voucherEndpoint;
|
|
11982
|
-
|
|
12035
|
+
Vo.registerVoucherProvider(Cc(t)), typeof e.voucherEndpoint != "string" && e.voucherEndpoint.preload && Po();
|
|
11983
12036
|
}
|
|
11984
|
-
if (e.mergeTags &&
|
|
12037
|
+
if (e.mergeTags && Vo.registerMergeTags(e.mergeTags), e.enableRecommendations && Vo.registerRecommendationsPlugin(), e.initialDocument) {
|
|
11985
12038
|
let t = We.safeParse(e.initialDocument);
|
|
11986
12039
|
t.success && F.getState().applyDoc(t.data, !1);
|
|
11987
12040
|
}
|
|
@@ -11993,23 +12046,23 @@ function Ec(e) {
|
|
|
11993
12046
|
if (e.onExportHtml) return F.subscribe((t, n) => {
|
|
11994
12047
|
t.doc !== n.doc && e.onExportHtml?.(ut(t.doc));
|
|
11995
12048
|
});
|
|
11996
|
-
}, [e.onExportHtml]), r(
|
|
12049
|
+
}, [e.onExportHtml]), r(uc);
|
|
11997
12050
|
}
|
|
11998
|
-
function
|
|
12051
|
+
function kc(t) {
|
|
11999
12052
|
let n = e(t.container);
|
|
12000
|
-
return n.render(r(
|
|
12053
|
+
return n.render(r(Oc, t)), {
|
|
12001
12054
|
destroy: () => n.unmount(),
|
|
12002
12055
|
getDocument: () => F.getState().doc,
|
|
12003
12056
|
exportHtml: () => F.getState().exportHtml(),
|
|
12004
12057
|
exportJson: () => F.getState().exportJson()
|
|
12005
12058
|
};
|
|
12006
12059
|
}
|
|
12007
|
-
var
|
|
12060
|
+
var Ac = {
|
|
12008
12061
|
name: "recommendations",
|
|
12009
12062
|
type: "recommendations",
|
|
12010
12063
|
setup: (e) => e.registerRecommendationsPlugin()
|
|
12011
12064
|
};
|
|
12012
12065
|
//#endregion
|
|
12013
|
-
export {
|
|
12066
|
+
export { Go as ALGORITHMS, Ko as ALGORITHM_BY_ID, Oc as EmailBuilder, qo as FALLBACK_OPTIONS, yt as TEMPLATE_CATEGORY_LABELS, pc as aiAssistantPlugin, tn as applyAIActions, ln as applyAIResponse, en as buildCatalog, kc as createEmailBuilder, fc as createHttpAIProvider, vc as createProductSearchProvider, Cc as createVoucherProvider, Jo as defaultRecommendationsLogic, We as documentSchema, So as getActiveProductProvider, Mo as getActiveVoucherProvider, Dc as imageUploaderPlugin, ms as isVoucherAware, an as mockAIProvider, yc as productSearchPlugin, Yo as readRecommendationsLogic, Ac as recommendationsPlugin, Qo as recommendationsToLegacyShape, Ho as registerPlugin, ut as renderEmailHtml, xo as setActiveProductProvider, jo as setActiveVoucherProvider, I as templateRegistry, Lo as useRecommendationsStore, rn as validateAIDocument, wc as voucherPlugin };
|
|
12014
12067
|
|
|
12015
12068
|
//# sourceMappingURL=email-builder.js.map
|