@charisol/plexo-sdk 2.0.31 → 2.0.32
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/dist/plexo-sdk.css +1 -1
- package/dist/v2/components/simple/SimpleCoach.d.ts +4 -1
- package/dist/v2/host/HostContext.d.ts +2 -0
- package/dist/v2.js +789 -670
- package/package.json +1 -1
package/dist/v2.js
CHANGED
|
@@ -1865,7 +1865,7 @@ var is = 100, as = (e) => e.length > is ? e.slice(e.length - is) : e, os = ({ ch
|
|
|
1865
1865
|
}, [R, z]), Nt = V((e) => {
|
|
1866
1866
|
let t = Jo(R, e);
|
|
1867
1867
|
if (!t || !t.parent.children || t.index >= t.parent.children.length - 1) return;
|
|
1868
|
-
let n = rs(R, e, t.parent.id, t.index +
|
|
1868
|
+
let n = rs(R, e, t.parent.id, t.index + 1);
|
|
1869
1869
|
z(n);
|
|
1870
1870
|
}, [R, z]), Pt = V((e) => Xo(e, P), [P]), Ft = V((e, t) => Zo(e, P, t), [P]), It = V((e, t) => Qo(e, P, t), [P]), Lt = V((e, t) => {
|
|
1871
1871
|
let n = kn(R, e, P === "desktop" ? { styles: t } : { responsive: { [P]: t } });
|
|
@@ -8032,28 +8032,33 @@ var sl = {
|
|
|
8032
8032
|
]
|
|
8033
8033
|
});
|
|
8034
8034
|
}, gl = [
|
|
8035
|
+
"Make the top of my page more welcoming",
|
|
8036
|
+
"Write better words for this part",
|
|
8037
|
+
"Make my page look good on a phone",
|
|
8038
|
+
"Add a part about my prices"
|
|
8039
|
+
], _l = [
|
|
8035
8040
|
"Refine typography hierarchy for mobile",
|
|
8036
8041
|
"Write stronger copy for this section",
|
|
8037
8042
|
"Improve spacing and padding harmony",
|
|
8038
8043
|
"Make this layout stack on smaller screens"
|
|
8039
|
-
],
|
|
8040
|
-
let e = Z(), { selectedNode: t, currentPageId: n, getPages: r, designSystem: a, applySolCommands: o, canUndoDesignTidy: s, undoDesignTidy: c } = e, l = U(() => ca(), []), { onAskSol: u, solAutoApply: d } = Y(), [
|
|
8041
|
-
|
|
8042
|
-
let
|
|
8043
|
-
|
|
8044
|
-
let
|
|
8044
|
+
], vl = () => {
|
|
8045
|
+
let e = Z(), { selectedNode: t, currentPageId: n, getPages: r, designSystem: a, applySolCommands: o, canUndoDesignTidy: s, undoDesignTidy: c } = e, l = U(() => ca(), []), { onAskSol: u, solAutoApply: d, projectName: f, experience: p } = Y(), m = p === "beginner", [h, g] = G(""), [_, v] = G(!1), [y, b] = G([]), x = W(null), S = W(null), C = W(1), w = W(e);
|
|
8046
|
+
w.current = e;
|
|
8047
|
+
let T = W(y);
|
|
8048
|
+
T.current = y;
|
|
8049
|
+
let E = () => setTimeout(() => x.current?.scrollIntoView({ block: "end" }), 0), D = () => S.current?.abort(), O = async (e) => {
|
|
8045
8050
|
let i = e.trim();
|
|
8046
|
-
if (!i ||
|
|
8047
|
-
let o =
|
|
8051
|
+
if (!i || _ || !u) return;
|
|
8052
|
+
let o = T.current.filter((e) => !e.failed && e.text).slice(-8).map((e) => ({
|
|
8048
8053
|
role: e.role,
|
|
8049
8054
|
text: e.text
|
|
8050
|
-
})), s =
|
|
8051
|
-
|
|
8052
|
-
let
|
|
8055
|
+
})), s = C.current++, c = C.current++, f = new AbortController();
|
|
8056
|
+
S.current = f;
|
|
8057
|
+
let p = (e) => b((t) => t.map((t) => t.id === c ? {
|
|
8053
8058
|
...t,
|
|
8054
8059
|
...e
|
|
8055
8060
|
} : t));
|
|
8056
|
-
|
|
8061
|
+
v(!0), g(""), b((e) => [
|
|
8057
8062
|
...e,
|
|
8058
8063
|
{
|
|
8059
8064
|
id: s,
|
|
@@ -8066,24 +8071,24 @@ var sl = {
|
|
|
8066
8071
|
text: ""
|
|
8067
8072
|
}
|
|
8068
8073
|
]);
|
|
8069
|
-
let
|
|
8074
|
+
let m = !!d, h = null, y = 0, x = 0, D = {
|
|
8070
8075
|
commands: [],
|
|
8071
8076
|
lines: [],
|
|
8072
8077
|
results: []
|
|
8073
8078
|
}, O = (e, t) => {
|
|
8074
8079
|
let n = Pi(e);
|
|
8075
|
-
if (
|
|
8076
|
-
let r = n.commands.slice(
|
|
8077
|
-
|
|
8080
|
+
if (m) {
|
|
8081
|
+
let r = n.commands.slice(y);
|
|
8082
|
+
y = n.commands.length;
|
|
8078
8083
|
let i = r.filter((e) => !!e);
|
|
8079
|
-
if (
|
|
8080
|
-
let e =
|
|
8081
|
-
|
|
8082
|
-
let t = i.map((t) => wa(t, e.getPages())), n =
|
|
8084
|
+
if (x += r.length - i.length, i.length) {
|
|
8085
|
+
let e = w.current;
|
|
8086
|
+
h ??= e.beginSolRun();
|
|
8087
|
+
let t = i.map((t) => wa(t, e.getPages())), n = h.apply(i);
|
|
8083
8088
|
D.commands.push(...i), D.lines.push(...t), D.results.push(...n);
|
|
8084
8089
|
}
|
|
8085
|
-
let a = t && n.writing, o =
|
|
8086
|
-
|
|
8090
|
+
let a = t && n.writing, o = x ? `${x} of the changes couldn't be understood and were left out.` : a ? "SOL stopped partway through, so the last change may be missing." : void 0;
|
|
8091
|
+
p({
|
|
8087
8092
|
text: n.text || (t ? D.commands.length ? "Done. Here is what I changed." : e.trim() : ""),
|
|
8088
8093
|
note: o,
|
|
8089
8094
|
suggestion: D.commands.length ? {
|
|
@@ -8094,8 +8099,8 @@ var sl = {
|
|
|
8094
8099
|
live: !t && n.writing
|
|
8095
8100
|
} : void 0
|
|
8096
8101
|
});
|
|
8097
|
-
} else t ||
|
|
8098
|
-
|
|
8102
|
+
} else t || p({ text: n.text });
|
|
8103
|
+
E();
|
|
8099
8104
|
};
|
|
8100
8105
|
try {
|
|
8101
8106
|
let e = await u(i, {
|
|
@@ -8112,8 +8117,8 @@ var sl = {
|
|
|
8112
8117
|
},
|
|
8113
8118
|
signal: f.signal
|
|
8114
8119
|
});
|
|
8115
|
-
if (f.signal.aborted)
|
|
8116
|
-
else if (
|
|
8120
|
+
if (f.signal.aborted) p({ note: "Stopped." });
|
|
8121
|
+
else if (m) O(e, !0);
|
|
8117
8122
|
else {
|
|
8118
8123
|
let t = hi(e), n = {
|
|
8119
8124
|
text: t.text || (t.commands ? "Here is what I suggest." : e),
|
|
@@ -8127,10 +8132,10 @@ var sl = {
|
|
|
8127
8132
|
status: "pending"
|
|
8128
8133
|
};
|
|
8129
8134
|
}
|
|
8130
|
-
|
|
8135
|
+
p(n);
|
|
8131
8136
|
}
|
|
8132
8137
|
} catch {
|
|
8133
|
-
f.signal.aborted ?
|
|
8138
|
+
f.signal.aborted ? p({ note: "Stopped." }) : p({
|
|
8134
8139
|
text: "I couldn't get an answer just now. Please try again in a moment.",
|
|
8135
8140
|
failed: !0,
|
|
8136
8141
|
suggestion: D.commands.length ? {
|
|
@@ -8141,13 +8146,13 @@ var sl = {
|
|
|
8141
8146
|
} : void 0
|
|
8142
8147
|
});
|
|
8143
8148
|
} finally {
|
|
8144
|
-
|
|
8149
|
+
h?.end(), S.current = null, v(!1), E();
|
|
8145
8150
|
}
|
|
8146
|
-
},
|
|
8147
|
-
let n =
|
|
8151
|
+
}, k = (e, t) => {
|
|
8152
|
+
let n = y[e]?.suggestion;
|
|
8148
8153
|
if (!n || n.status !== "pending") return;
|
|
8149
8154
|
let r = t ? o(n.commands) : void 0;
|
|
8150
|
-
|
|
8155
|
+
b((n) => n.map((n, i) => i === e && n.suggestion ? {
|
|
8151
8156
|
...n,
|
|
8152
8157
|
suggestion: {
|
|
8153
8158
|
...n.suggestion,
|
|
@@ -8155,31 +8160,37 @@ var sl = {
|
|
|
8155
8160
|
results: r
|
|
8156
8161
|
}
|
|
8157
8162
|
} : n));
|
|
8158
|
-
},
|
|
8159
|
-
|
|
8160
|
-
e.suggestion?.status === "applied" && (
|
|
8163
|
+
}, A = -1;
|
|
8164
|
+
y.forEach((e, t) => {
|
|
8165
|
+
e.suggestion?.status === "applied" && (A = t);
|
|
8161
8166
|
});
|
|
8162
|
-
let
|
|
8167
|
+
let j = t && t.type !== "page";
|
|
8163
8168
|
return /* @__PURE__ */ J("div", {
|
|
8164
8169
|
className: "flex flex-col h-full overflow-hidden select-none font-sans text-xs text-px-text",
|
|
8165
8170
|
children: [
|
|
8166
8171
|
/* @__PURE__ */ J("div", {
|
|
8167
|
-
className: "px-3 py-2 bg-px-surface border-b border-px-line flex items-center justify-between text-[11px] text-px-muted",
|
|
8168
|
-
children: [
|
|
8169
|
-
className: "
|
|
8170
|
-
children:
|
|
8172
|
+
className: "px-3 py-2 bg-px-surface border-b border-px-line flex flex-wrap items-center justify-between gap-x-2 text-[11px] text-px-muted",
|
|
8173
|
+
children: [f ? /* @__PURE__ */ J("span", {
|
|
8174
|
+
className: "min-w-0 basis-full break-words",
|
|
8175
|
+
children: ["SOL only changes ", /* @__PURE__ */ q("b", {
|
|
8176
|
+
className: "font-semibold text-px-text",
|
|
8177
|
+
children: f
|
|
8178
|
+
})]
|
|
8179
|
+
}) : /* @__PURE__ */ q("span", { children: "Asking about:" }), /* @__PURE__ */ q("span", {
|
|
8180
|
+
className: "font-medium text-px-accent truncate max-w-[140px] shrink-0",
|
|
8181
|
+
children: j ? t.name : "This page"
|
|
8171
8182
|
})]
|
|
8172
8183
|
}),
|
|
8173
8184
|
/* @__PURE__ */ J("div", {
|
|
8174
8185
|
className: "flex-1 overflow-y-auto p-3 space-y-3",
|
|
8175
8186
|
children: [
|
|
8176
|
-
|
|
8187
|
+
y.length === 0 && /* @__PURE__ */ J("div", {
|
|
8177
8188
|
className: "space-y-1.5",
|
|
8178
8189
|
children: [/* @__PURE__ */ q("span", {
|
|
8179
8190
|
className: "text-[10px] uppercase font-semibold text-px-faint",
|
|
8180
8191
|
children: "Try asking"
|
|
8181
|
-
}), gl.map((e) => /* @__PURE__ */ J("button", {
|
|
8182
|
-
onClick: () =>
|
|
8192
|
+
}), (m ? gl : _l).map((e) => /* @__PURE__ */ J("button", {
|
|
8193
|
+
onClick: () => O(e),
|
|
8183
8194
|
className: "w-full text-left p-2.5 bg-px-raised hover:bg-px-line rounded-xl border border-px-line2 hover:border-px-accent/40 text-[11px] text-px-text flex items-center justify-between group transition-all cursor-pointer",
|
|
8184
8195
|
children: [/* @__PURE__ */ J("div", {
|
|
8185
8196
|
className: "flex items-center gap-2",
|
|
@@ -8190,7 +8201,7 @@ var sl = {
|
|
|
8190
8201
|
}), /* @__PURE__ */ q(xe, { className: "w-3 h-3 text-px-faint group-hover:text-px-accent transition-all shrink-0 ml-1" })]
|
|
8191
8202
|
}, e))]
|
|
8192
8203
|
}),
|
|
8193
|
-
|
|
8204
|
+
y.map((e, t) => e.role === "sol" && !e.text && !e.suggestion && !e.note ? null : /* @__PURE__ */ J("div", {
|
|
8194
8205
|
className: e.role === "you" ? "flex justify-end" : "flex gap-1.5",
|
|
8195
8206
|
children: [e.role === "sol" && /* @__PURE__ */ q(xs, {
|
|
8196
8207
|
size: 16,
|
|
@@ -8206,20 +8217,20 @@ var sl = {
|
|
|
8206
8217
|
className: "mt-1 text-[10px] text-px-muted",
|
|
8207
8218
|
children: e.note
|
|
8208
8219
|
}),
|
|
8209
|
-
e.suggestion && /* @__PURE__ */ q(
|
|
8220
|
+
e.suggestion && /* @__PURE__ */ q(yl, {
|
|
8210
8221
|
s: e.suggestion,
|
|
8211
|
-
onApply: () =>
|
|
8212
|
-
onDismiss: () =>
|
|
8213
|
-
onUndo: s &&
|
|
8222
|
+
onApply: () => k(t, !0),
|
|
8223
|
+
onDismiss: () => k(t, !1),
|
|
8224
|
+
onUndo: s && A === t ? c : void 0
|
|
8214
8225
|
})
|
|
8215
8226
|
]
|
|
8216
8227
|
})]
|
|
8217
8228
|
}, e.id)),
|
|
8218
|
-
|
|
8229
|
+
_ && !y[y.length - 1]?.text && !y[y.length - 1]?.suggestion && /* @__PURE__ */ J("div", {
|
|
8219
8230
|
className: "flex items-center gap-1.5 text-[11px] text-px-muted",
|
|
8220
8231
|
children: [/* @__PURE__ */ q(fe, { className: "w-3 h-3 animate-spin" }), " SOL is working…"]
|
|
8221
8232
|
}),
|
|
8222
|
-
/* @__PURE__ */ q("div", { ref:
|
|
8233
|
+
/* @__PURE__ */ q("div", { ref: x })
|
|
8223
8234
|
]
|
|
8224
8235
|
}),
|
|
8225
8236
|
/* @__PURE__ */ q("div", {
|
|
@@ -8227,23 +8238,23 @@ var sl = {
|
|
|
8227
8238
|
children: /* @__PURE__ */ J("div", {
|
|
8228
8239
|
className: "relative",
|
|
8229
8240
|
children: [/* @__PURE__ */ q("textarea", {
|
|
8230
|
-
value:
|
|
8231
|
-
onChange: (e) =>
|
|
8241
|
+
value: h,
|
|
8242
|
+
onChange: (e) => g(e.target.value),
|
|
8232
8243
|
onKeyDown: (e) => {
|
|
8233
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
8244
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), O(h));
|
|
8234
8245
|
},
|
|
8235
|
-
placeholder:
|
|
8246
|
+
placeholder: j ? `Ask SOL about "${t.name}"…` : "Ask SOL to improve this page…",
|
|
8236
8247
|
rows: 3,
|
|
8237
8248
|
className: "w-full bg-px-raised border border-px-line2 rounded-xl p-2.5 pr-14 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent resize-none leading-relaxed transition-colors select-text"
|
|
8238
|
-
}),
|
|
8239
|
-
onClick:
|
|
8249
|
+
}), _ ? /* @__PURE__ */ q("button", {
|
|
8250
|
+
onClick: D,
|
|
8240
8251
|
"aria-label": "Stop",
|
|
8241
8252
|
title: "Stop",
|
|
8242
8253
|
className: "absolute bottom-2.5 right-2.5 w-7 h-7 rounded-lg bg-px-line hover:bg-px-line2 text-px-text flex items-center justify-center transition-all cursor-pointer",
|
|
8243
8254
|
children: /* @__PURE__ */ q(M, { className: "w-3 h-3 fill-current" })
|
|
8244
8255
|
}) : /* @__PURE__ */ q("button", {
|
|
8245
|
-
onClick: () =>
|
|
8246
|
-
disabled: !
|
|
8256
|
+
onClick: () => O(h),
|
|
8257
|
+
disabled: !h.trim(),
|
|
8247
8258
|
"aria-label": "Send",
|
|
8248
8259
|
className: "absolute bottom-2.5 right-2.5 w-7 h-7 rounded-lg bg-px-accent hover:bg-px-accent-hover disabled:opacity-40 text-px-onaccent flex items-center justify-center transition-all cursor-pointer",
|
|
8249
8260
|
children: /* @__PURE__ */ q(i, { className: "w-3 h-3 stroke-[2.5]" })
|
|
@@ -8252,7 +8263,7 @@ var sl = {
|
|
|
8252
8263
|
})
|
|
8253
8264
|
]
|
|
8254
8265
|
});
|
|
8255
|
-
},
|
|
8266
|
+
}, yl = ({ s: e, onApply: t, onDismiss: n, onUndo: r }) => {
|
|
8256
8267
|
let i = e.commands.length, a = e.results?.filter((e) => e.ok).length ?? 0;
|
|
8257
8268
|
return /* @__PURE__ */ J("div", {
|
|
8258
8269
|
"data-sol-suggestion": !0,
|
|
@@ -8297,7 +8308,7 @@ var sl = {
|
|
|
8297
8308
|
}))
|
|
8298
8309
|
]
|
|
8299
8310
|
});
|
|
8300
|
-
},
|
|
8311
|
+
}, bl = () => {
|
|
8301
8312
|
let { activeSidebarTab: e, setActiveSidebarTab: t } = Z(), n = Y();
|
|
8302
8313
|
if (!e) return null;
|
|
8303
8314
|
let { label: r, icon: i } = (() => {
|
|
@@ -8371,7 +8382,7 @@ var sl = {
|
|
|
8371
8382
|
e === "pages" && /* @__PURE__ */ q(Xs, {}),
|
|
8372
8383
|
e === "strata" && /* @__PURE__ */ q($c, {}),
|
|
8373
8384
|
e === "library" && /* @__PURE__ */ q(pl, {}),
|
|
8374
|
-
e === "sol" && /* @__PURE__ */ q(
|
|
8385
|
+
e === "sol" && /* @__PURE__ */ q(vl, {}),
|
|
8375
8386
|
e === "pageSettings" && /* @__PURE__ */ q("div", {
|
|
8376
8387
|
className: "h-full overflow-y-auto p-3.5",
|
|
8377
8388
|
children: n.pageSettings
|
|
@@ -8379,24 +8390,24 @@ var sl = {
|
|
|
8379
8390
|
]
|
|
8380
8391
|
})]
|
|
8381
8392
|
});
|
|
8382
|
-
},
|
|
8393
|
+
}, xl = vo(null), Sl = () => bo(xl), Cl = vo(/* @__PURE__ */ new Map()), wl = (e) => bo(Cl).get(e), Tl = vo(null), El = vo(!1), Dl = /* @__PURE__ */ new Set([
|
|
8383
8394
|
"section",
|
|
8384
8395
|
"container",
|
|
8385
8396
|
"card",
|
|
8386
8397
|
"columns",
|
|
8387
8398
|
"page"
|
|
8388
|
-
]),
|
|
8399
|
+
]), Ol = (e, t) => {
|
|
8389
8400
|
if (e.id === t) return e;
|
|
8390
8401
|
for (let n of e.children ?? []) {
|
|
8391
|
-
let e =
|
|
8402
|
+
let e = Ol(n, t);
|
|
8392
8403
|
if (e) return e;
|
|
8393
8404
|
}
|
|
8394
8405
|
return null;
|
|
8395
|
-
},
|
|
8396
|
-
let r =
|
|
8397
|
-
return !!r && !!
|
|
8406
|
+
}, kl = (e, t, n) => {
|
|
8407
|
+
let r = Ol(e, t);
|
|
8408
|
+
return !!r && !!Ol(r, n);
|
|
8398
8409
|
};
|
|
8399
|
-
function
|
|
8410
|
+
function Al(e, t, n, r, i) {
|
|
8400
8411
|
if (!i) return { kind: "none" };
|
|
8401
8412
|
let a = i.getBoundingClientRect();
|
|
8402
8413
|
if (e < a.left || e > a.right || t < a.top || t > a.bottom) return { kind: "none" };
|
|
@@ -8407,10 +8418,10 @@ function kl(e, t, n, r, i) {
|
|
|
8407
8418
|
for (let e of o) {
|
|
8408
8419
|
if (!s.contains(e) || !e.hasAttribute("data-plx-node") || !e.id) continue;
|
|
8409
8420
|
let i = e.id;
|
|
8410
|
-
if (i === n ||
|
|
8411
|
-
let a =
|
|
8421
|
+
if (i === n || kl(r, n, i) || an(r, i) || Xn(r, i)) continue;
|
|
8422
|
+
let a = Ol(r, i);
|
|
8412
8423
|
if (!a) continue;
|
|
8413
|
-
let o = e.getBoundingClientRect(), c = t - o.top, l =
|
|
8424
|
+
let o = e.getBoundingClientRect(), c = t - o.top, l = Dl.has(a.type) && !gn(a), u;
|
|
8414
8425
|
return u = a.type === "page" || l && c > o.height * .25 && c < o.height * .75 ? "inside" : c < o.height * .5 ? "before" : "after", {
|
|
8415
8426
|
kind: "node",
|
|
8416
8427
|
targetId: i,
|
|
@@ -8424,7 +8435,7 @@ function kl(e, t, n, r, i) {
|
|
|
8424
8435
|
position: "inside"
|
|
8425
8436
|
} : { kind: "canvas" };
|
|
8426
8437
|
}
|
|
8427
|
-
function
|
|
8438
|
+
function jl(e, t) {
|
|
8428
8439
|
let n = document.querySelector("[data-plx-canvas-plane]");
|
|
8429
8440
|
if (!n) return null;
|
|
8430
8441
|
let r = n.getBoundingClientRect(), i = n instanceof HTMLElement && n.offsetWidth ? r.width / n.offsetWidth : 1;
|
|
@@ -8435,7 +8446,7 @@ function Al(e, t) {
|
|
|
8435
8446
|
}
|
|
8436
8447
|
//#endregion
|
|
8437
8448
|
//#region src/v2/components/canvas/SectionToolbar.tsx
|
|
8438
|
-
var
|
|
8449
|
+
var Ml = ({ section: e, inside: t }) => {
|
|
8439
8450
|
let { moveNodeUp: n, moveNodeDown: r, duplicateNode: i, deleteNode: a, detachSection: o, openSectionPicker: s } = Z(), c = gn(e);
|
|
8440
8451
|
if (!c) return null;
|
|
8441
8452
|
let l = Dr(c.kind), u = l.variants.find((e) => e.id === c.variant), d = "w-7 h-7 rounded-md flex items-center justify-center text-px-text2 hover:text-white hover:bg-px-line2 cursor-pointer transition-colors", f = (e) => (t) => {
|
|
@@ -8507,17 +8518,17 @@ var jl = ({ section: e, inside: t }) => {
|
|
|
8507
8518
|
})
|
|
8508
8519
|
]
|
|
8509
8520
|
});
|
|
8510
|
-
},
|
|
8521
|
+
}, Nl = () => /* @__PURE__ */ q("style", {
|
|
8511
8522
|
"data-plexo-elements": !0,
|
|
8512
8523
|
children: Jt
|
|
8513
8524
|
});
|
|
8514
|
-
function
|
|
8525
|
+
function Pl(e, t) {
|
|
8515
8526
|
if (typeof e == "string") return e;
|
|
8516
8527
|
let n = { key: t };
|
|
8517
8528
|
for (let [t, r] of Object.entries(e.attrs ?? {})) r === void 0 || r === !1 || (n[Zt(t)] = r);
|
|
8518
|
-
return e.style && (n.style = Object.fromEntries(Object.entries(e.style).map(([e, t]) => [e.startsWith("--") ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), t]))), _o.createElement(e.tag, n, ...(e.children ?? []).map((e, t) =>
|
|
8529
|
+
return e.style && (n.style = Object.fromEntries(Object.entries(e.style).map(([e, t]) => [e.startsWith("--") ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), t]))), _o.createElement(e.tag, n, ...(e.children ?? []).map((e, t) => Pl(e, t)));
|
|
8519
8530
|
}
|
|
8520
|
-
var
|
|
8531
|
+
var Fl = ({ node: e, preview: t }) => {
|
|
8521
8532
|
let n = Y(), r = W(null), [i, a] = G(!1), o = U(() => Kt(e, {
|
|
8522
8533
|
uid: dn(e.id),
|
|
8523
8534
|
editing: !t,
|
|
@@ -8555,7 +8566,7 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8555
8566
|
display: "contents",
|
|
8556
8567
|
pointerEvents: t ? "auto" : "none"
|
|
8557
8568
|
},
|
|
8558
|
-
children:
|
|
8569
|
+
children: Pl(o)
|
|
8559
8570
|
}), t && i && /* @__PURE__ */ q("div", {
|
|
8560
8571
|
style: {
|
|
8561
8572
|
position: "absolute",
|
|
@@ -8571,10 +8582,10 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8571
8582
|
children: "Preview — nothing was sent"
|
|
8572
8583
|
})]
|
|
8573
8584
|
}) : null;
|
|
8574
|
-
},
|
|
8585
|
+
}, Il = vo({
|
|
8575
8586
|
layoutMode: "free",
|
|
8576
8587
|
parentId: ""
|
|
8577
|
-
}),
|
|
8588
|
+
}), Ll = () => bo(Il), Rl = ({ node: e, inside: t }) => {
|
|
8578
8589
|
let n = Y(), { startInlineEditing: r, duplicateNode: i, deleteNode: a, toggleNodeVisibility: o, toggleNodeLock: s, selectParentNode: c, toggleSidebarTab: l } = Z(), [u, d] = G(!1), f = W(null);
|
|
8579
8590
|
H(() => {
|
|
8580
8591
|
if (!u) return;
|
|
@@ -8667,7 +8678,7 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8667
8678
|
})
|
|
8668
8679
|
]
|
|
8669
8680
|
});
|
|
8670
|
-
},
|
|
8681
|
+
}, zl = ({ node: e, elementRef: t }) => {
|
|
8671
8682
|
let { updateNodeStyles: n, canvasZoom: r, resolveStyles: i } = Z(), [a, o] = G(!1), [s, c] = G(null), l = W(null), u = W(null), d = (n, r) => {
|
|
8672
8683
|
if (n.stopPropagation(), n.preventDefault(), n.target.setPointerCapture(n.pointerId), !t.current) return;
|
|
8673
8684
|
let a = t.current.getBoundingClientRect(), s = t.current.parentElement?.getBoundingClientRect(), u = i(e);
|
|
@@ -8793,7 +8804,7 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8793
8804
|
className: "absolute -top-1 left-1/2 -translate-x-1/2 h-1.5 w-4 bg-white border-[1.5px] border-px-accent rounded-[1px] cursor-ns-resize z-40"
|
|
8794
8805
|
})
|
|
8795
8806
|
] });
|
|
8796
|
-
},
|
|
8807
|
+
}, Bl = ({ node: e }) => {
|
|
8797
8808
|
let { updateNodeStyles: t } = Z();
|
|
8798
8809
|
if (!(e.type === "container" || e.type === "section" || e.type === "card" || e.type === "columns")) return null;
|
|
8799
8810
|
let n = e.styles.paddingTop || e.styles.padding || "0px", r = e.styles.gap || "0px", i = (n, i) => {
|
|
@@ -8856,7 +8867,7 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8856
8867
|
})
|
|
8857
8868
|
]
|
|
8858
8869
|
});
|
|
8859
|
-
},
|
|
8870
|
+
}, Vl = ({ position: e }) => e === "inside" ? /* @__PURE__ */ q("div", {
|
|
8860
8871
|
className: "absolute inset-0 pointer-events-none border-2 border-dashed border-px-accent bg-px-accent/10 rounded-lg z-50 flex items-center justify-center animate-pulse",
|
|
8861
8872
|
children: /* @__PURE__ */ J("div", {
|
|
8862
8873
|
className: "bg-px-accent text-px-onaccent text-[11px] font-bold px-3 py-1 rounded-full shadow-md flex items-center gap-1.5 border border-px-accent-hover",
|
|
@@ -8874,7 +8885,7 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8874
8885
|
/* @__PURE__ */ q("div", { className: "flex-1 h-0.5 bg-px-accent" }),
|
|
8875
8886
|
/* @__PURE__ */ q("div", { className: "w-2.5 h-2.5 rounded-full bg-px-accent border-2 border-black shrink-0" })
|
|
8876
8887
|
]
|
|
8877
|
-
}),
|
|
8888
|
+
}), Hl = ({ guides: e }) => !e || e.length === 0 ? null : /* @__PURE__ */ q("div", {
|
|
8878
8889
|
className: "absolute inset-0 pointer-events-none z-50 overflow-visible",
|
|
8879
8890
|
children: e.map((e, t) => e.type === "x" ? /* @__PURE__ */ q("div", {
|
|
8880
8891
|
style: {
|
|
@@ -8899,13 +8910,13 @@ var Pl = ({ node: e, preview: t }) => {
|
|
|
8899
8910
|
children: [Math.round(e.position), "px"]
|
|
8900
8911
|
})
|
|
8901
8912
|
}, `guide-y-${t}-${e.position}`))
|
|
8902
|
-
}),
|
|
8913
|
+
}), Ul = /* @__PURE__ */ new Set([
|
|
8903
8914
|
"heading",
|
|
8904
8915
|
"paragraph",
|
|
8905
8916
|
"button",
|
|
8906
8917
|
"badge"
|
|
8907
|
-
]),
|
|
8908
|
-
function
|
|
8918
|
+
]), Wl = "Type something…", Gl = 0;
|
|
8919
|
+
function Kl(e, t) {
|
|
8909
8920
|
let n = document;
|
|
8910
8921
|
if (typeof n.caretPositionFromPoint == "function") {
|
|
8911
8922
|
let r = n.caretPositionFromPoint(e, t);
|
|
@@ -8923,8 +8934,8 @@ function Gl(e, t) {
|
|
|
8923
8934
|
}
|
|
8924
8935
|
return null;
|
|
8925
8936
|
}
|
|
8926
|
-
function
|
|
8927
|
-
let r =
|
|
8937
|
+
function ql(e, t, n) {
|
|
8938
|
+
let r = Kl(t, n);
|
|
8928
8939
|
if (!r || r.node.nodeType !== Node.TEXT_NODE) return null;
|
|
8929
8940
|
let i = (t) => t.parentNode === e || t.parentElement?.hasAttribute("data-plx-highlight") && t.parentElement.parentNode === e;
|
|
8930
8941
|
if (!i(r.node)) return null;
|
|
@@ -8935,8 +8946,8 @@ function Kl(e, t, n) {
|
|
|
8935
8946
|
}
|
|
8936
8947
|
return null;
|
|
8937
8948
|
}
|
|
8938
|
-
var
|
|
8939
|
-
let { documentTree: t, selectedNodeIds: n, selectNode: r, toggleNodeSelection: i, hoveredNodeId: a, setHoveredNodeId: o, isPreviewMode: s, editingNodeId: c, startInlineEditing: l, takeEditCaret: u, stopInlineEditing: d, updateNodeContent: f, dragState: p, setDragState: m, clearDragState: h, handleDrop: g, viewportMode: _, setViewportMode: v, canvasZoom: y, commitFreeMovement: b, snapToGrid: x, snapToElements: S, gridSnapSize: C, activeAlignmentGuides: w, setActiveAlignmentGuides: T, openContextMenu: E, moveNodeToWorkspace: D, moveNodeFromWorkspace: O } = Z(), k = Y(), A =
|
|
8949
|
+
var Jl = ({ node: e }) => {
|
|
8950
|
+
let { documentTree: t, selectedNodeIds: n, selectNode: r, toggleNodeSelection: i, hoveredNodeId: a, setHoveredNodeId: o, isPreviewMode: s, editingNodeId: c, startInlineEditing: l, takeEditCaret: u, stopInlineEditing: d, updateNodeContent: f, dragState: p, setDragState: m, clearDragState: h, handleDrop: g, viewportMode: _, setViewportMode: v, canvasZoom: y, commitFreeMovement: b, snapToGrid: x, snapToElements: S, gridSnapSize: C, activeAlignmentGuides: w, setActiveAlignmentGuides: T, openContextMenu: E, moveNodeToWorkspace: D, moveNodeFromWorkspace: O } = Z(), k = Y(), A = wl(e.id), j = Sl(), M = j || _, N = Xo(e, M), P = Ll(), ee = bo(Tl), F = gn(e), te = k.experience === "beginner", ne = bo(El), re = e.type !== "page" && (e.type !== "section" || ne) && !ee, ie = P.layoutMode === "grid", I = W(null), ae = W(""), oe = W(!1), se = W(null), L = n.includes(e.id) && !s, ce = a === e.id && !L && !s, ue = c === e.id, de = e.type === "page", fe = e.type === "section" && !ne && (Jo(t, e.id)?.index ?? 0) > 0, pe = M === "desktop" && e.responsiveVisibility?.hideOnDesktop || M === "tablet" && e.responsiveVisibility?.hideOnTablet || M === "mobile" && e.responsiveVisibility?.hideOnMobile, me = p.draggingNodeId === e.id, he = p.dropTargetId === e.id;
|
|
8940
8951
|
H(() => {
|
|
8941
8952
|
if (!ue || !se.current) return;
|
|
8942
8953
|
let t = se.current;
|
|
@@ -8953,7 +8964,7 @@ var ql = ({ node: e }) => {
|
|
|
8953
8964
|
i?.removeAllRanges(), i?.addRange(r);
|
|
8954
8965
|
}, [ue]);
|
|
8955
8966
|
let ge = W(void 0), _e = (t) => {
|
|
8956
|
-
ge.current =
|
|
8967
|
+
ge.current = Ul.has(e.type) && !ue && I.current ? ql(I.current, t.clientX, t.clientY) : void 0;
|
|
8957
8968
|
}, ve = (t) => {
|
|
8958
8969
|
if (t.stopPropagation(), k.commentMode && !de) {
|
|
8959
8970
|
k.onRequestComment?.({
|
|
@@ -8965,10 +8976,10 @@ var ql = ({ node: e }) => {
|
|
|
8965
8976
|
return;
|
|
8966
8977
|
}
|
|
8967
8978
|
if (j && j !== _ && v(j), !ue) if (t.shiftKey) i(e.id);
|
|
8968
|
-
else if (
|
|
8979
|
+
else if (Ul.has(e.type) && !k.readOnly && Date.now() - Gl > 250) {
|
|
8969
8980
|
let n = ge.current;
|
|
8970
8981
|
ge.current = void 0;
|
|
8971
|
-
let r = n === void 0 ? I.current ?
|
|
8982
|
+
let r = n === void 0 ? I.current ? ql(I.current, t.clientX, t.clientY) : null : n;
|
|
8972
8983
|
l(e.id, r === null ? "end" : { offset: r });
|
|
8973
8984
|
} else r(e.id);
|
|
8974
8985
|
}, ye = (t) => {
|
|
@@ -9006,11 +9017,11 @@ var ql = ({ node: e }) => {
|
|
|
9006
9017
|
let a = De.current;
|
|
9007
9018
|
if (De.current = null, window.removeEventListener("pointermove", je), window.removeEventListener("pointerup", Me), window.removeEventListener("pointercancel", Ne), window.removeEventListener("keydown", Pe), !a) return;
|
|
9008
9019
|
let o = I.current, s = o?.getBoundingClientRect();
|
|
9009
|
-
if (o && (o.style.transform = a.saved.transform ?? "", o.style.opacity = a.saved.opacity ?? "", o.style.pointerEvents = a.saved.pointerEvents ?? "", o.style.zIndex = a.saved.zIndex ?? "", o.style.boxShadow = a.saved.boxShadow ?? ""), a.cursorStyle?.remove(), a.hint?.remove(), Oe.current = "", h(), a.active && (
|
|
9010
|
-
let c =
|
|
9020
|
+
if (o && (o.style.transform = a.saved.transform ?? "", o.style.opacity = a.saved.opacity ?? "", o.style.pointerEvents = a.saved.pointerEvents ?? "", o.style.zIndex = a.saved.zIndex ?? "", o.style.boxShadow = a.saved.boxShadow ?? ""), a.cursorStyle?.remove(), a.hint?.remove(), Oe.current = "", h(), a.active && (Gl = Date.now()), !a.active || !n) return;
|
|
9021
|
+
let c = Al(r, i, e.id, t, ke());
|
|
9011
9022
|
if (c.kind === "node") O(e.id, c.targetId, c.position);
|
|
9012
9023
|
else if (c.kind === "canvas" && s) {
|
|
9013
|
-
let t =
|
|
9024
|
+
let t = jl(s.left, s.top), n = Math.max(.2, (y || 100) / 100);
|
|
9014
9025
|
t && D(e.id, t, {
|
|
9015
9026
|
width: s.width / n,
|
|
9016
9027
|
height: s.height / n
|
|
@@ -9048,7 +9059,7 @@ var ql = ({ node: e }) => {
|
|
|
9048
9059
|
}
|
|
9049
9060
|
let c = Math.max(.2, (y || 100) / 100);
|
|
9050
9061
|
a.style.transform = `translate3d(${o / c}px, ${s / c}px, 0)`, a.style.opacity = "0.88", a.style.pointerEvents = "none", a.style.zIndex = "60", a.style.boxShadow = "0 18px 50px rgba(0,0,0,0.45)";
|
|
9051
|
-
let l =
|
|
9062
|
+
let l = Al(n.clientX, n.clientY, e.id, t, ke());
|
|
9052
9063
|
i.spot = l;
|
|
9053
9064
|
let u = l.kind === "node" ? `${l.targetId}:${l.position}` : l.kind;
|
|
9054
9065
|
u !== Oe.current && (Oe.current = u, l.kind === "node" ? m({
|
|
@@ -9219,7 +9230,7 @@ var ql = ({ node: e }) => {
|
|
|
9219
9230
|
e && (e.style.transform = `translate3d(${D}px, ${O}px, 0px)`);
|
|
9220
9231
|
}
|
|
9221
9232
|
}), ze.current && (ze.current.textContent = `X: ${Math.round(v)}px · Y: ${Math.round(b)}px`);
|
|
9222
|
-
let k =
|
|
9233
|
+
let k = Al(n.clientX, n.clientY, e.id, t, document.querySelector("[data-plx-canvas]"));
|
|
9223
9234
|
He.current = k;
|
|
9224
9235
|
let A = We && k.kind === "node" ? `${k.targetId}:${k.position}` : "";
|
|
9225
9236
|
A !== Ue.current && (Ue.current = A, A && k.kind === "node" ? m({
|
|
@@ -9240,13 +9251,13 @@ var ql = ({ node: e }) => {
|
|
|
9240
9251
|
let e = Be.current, t = Ve.current;
|
|
9241
9252
|
return !!e && !!t && Math.hypot(t.targetX - e.startX, t.targetY - e.startY) > 2;
|
|
9242
9253
|
})();
|
|
9243
|
-
if (o && (
|
|
9254
|
+
if (o && (Gl = Date.now()), I.current && (I.current.style.transform = Ye.length > 0 ? Ye.join(" ") : ""), o && n.length <= 1) {
|
|
9244
9255
|
if (We && i.kind === "node") {
|
|
9245
9256
|
Be.current = null, Ve.current = null, Re.current = !1, Le(!1), T([]), h(), O(e.id, i.targetId, i.position);
|
|
9246
9257
|
return;
|
|
9247
9258
|
}
|
|
9248
9259
|
if (!ne && i.kind === "canvas" && a) {
|
|
9249
|
-
let t =
|
|
9260
|
+
let t = jl(a.left, a.top), n = Math.max(.2, (y || 100) / 100);
|
|
9250
9261
|
if (Be.current = null, Ve.current = null, Le(!1), T([]), h(), t) {
|
|
9251
9262
|
D(e.id, t, {
|
|
9252
9263
|
width: a.width / n,
|
|
@@ -9368,7 +9379,7 @@ var ql = ({ node: e }) => {
|
|
|
9368
9379
|
className: "absolute top-1 right-1 z-40 bg-red-950/90 text-red-300 text-[9px] font-bold px-1.5 py-0.5 rounded border border-red-700/50 flex items-center gap-1 shadow pointer-events-none",
|
|
9369
9380
|
children: [/* @__PURE__ */ q(le, { className: "w-2.5 h-2.5" }), /* @__PURE__ */ J("span", { children: ["Hidden on ", M] })]
|
|
9370
9381
|
}),
|
|
9371
|
-
he && p.dropPosition && /* @__PURE__ */ q(
|
|
9382
|
+
he && p.dropPosition && /* @__PURE__ */ q(Vl, { position: p.dropPosition }),
|
|
9372
9383
|
!de && ce && !L && /* @__PURE__ */ q("div", {
|
|
9373
9384
|
className: "absolute -top-5 left-0 z-30 bg-px-raised text-px-text text-[9px] font-mono px-1 py-0.5 rounded shadow pointer-events-none border border-px-line2",
|
|
9374
9385
|
children: e.name
|
|
@@ -9385,18 +9396,18 @@ var ql = ({ node: e }) => {
|
|
|
9385
9396
|
]
|
|
9386
9397
|
}),
|
|
9387
9398
|
!de && L && /* @__PURE__ */ J(K, { children: [
|
|
9388
|
-
F ? /* @__PURE__ */ q(
|
|
9399
|
+
F ? /* @__PURE__ */ q(Ml, {
|
|
9389
9400
|
section: e,
|
|
9390
9401
|
inside: fe
|
|
9391
|
-
}) : /* @__PURE__ */ q(
|
|
9402
|
+
}) : /* @__PURE__ */ q(Rl, {
|
|
9392
9403
|
node: e,
|
|
9393
9404
|
inside: fe
|
|
9394
9405
|
}),
|
|
9395
|
-
!F && !te && /* @__PURE__ */ q(
|
|
9406
|
+
!F && !te && /* @__PURE__ */ q(zl, {
|
|
9396
9407
|
node: e,
|
|
9397
9408
|
elementRef: I
|
|
9398
9409
|
}),
|
|
9399
|
-
!F && !te && /* @__PURE__ */ q(
|
|
9410
|
+
!F && !te && /* @__PURE__ */ q(Bl, { node: e }),
|
|
9400
9411
|
re && !te && /* @__PURE__ */ J("div", {
|
|
9401
9412
|
className: "absolute inset-0 pointer-events-none z-20 overflow-visible",
|
|
9402
9413
|
children: [
|
|
@@ -9494,7 +9505,7 @@ var ql = ({ node: e }) => {
|
|
|
9494
9505
|
"data-plx-empty-text": "",
|
|
9495
9506
|
"aria-hidden": "true",
|
|
9496
9507
|
className: "opacity-45 italic pointer-events-none select-none",
|
|
9497
|
-
children:
|
|
9508
|
+
children: Wl
|
|
9498
9509
|
});
|
|
9499
9510
|
}
|
|
9500
9511
|
return oe.current || (ae.current = t), oe.current = !0, /* @__PURE__ */ q("span", {
|
|
@@ -9512,7 +9523,7 @@ var ql = ({ node: e }) => {
|
|
|
9512
9523
|
t.key === "Escape" ? (t.stopPropagation(), d()) : t.key === "Enter" && e.type !== "paragraph" && (t.preventDefault(), d());
|
|
9513
9524
|
},
|
|
9514
9525
|
"data-empty": ae.current ? "false" : "true",
|
|
9515
|
-
"data-placeholder":
|
|
9526
|
+
"data-placeholder": Wl,
|
|
9516
9527
|
className: "outline-none bg-px-accent-deep/40 text-px-onaccent border-b-2 border-px-accent px-1 rounded-sm selection:bg-px-accent-hover inline-block min-w-[20px] data-[empty=true]:before:content-[attr(data-placeholder)] data-[empty=true]:before:opacity-50 data-[empty=true]:before:italic data-[empty=true]:before:pointer-events-none",
|
|
9517
9528
|
children: ae.current
|
|
9518
9529
|
});
|
|
@@ -9535,13 +9546,13 @@ var ql = ({ node: e }) => {
|
|
|
9535
9546
|
className: `min-h-screen w-full relative ${tt} ${nt} ${N.customClasses || ""}`,
|
|
9536
9547
|
children: [
|
|
9537
9548
|
et(),
|
|
9538
|
-
Qe && /* @__PURE__ */ q(
|
|
9539
|
-
/* @__PURE__ */ q(
|
|
9549
|
+
Qe && /* @__PURE__ */ q(Hl, { guides: w }),
|
|
9550
|
+
/* @__PURE__ */ q(Il.Provider, {
|
|
9540
9551
|
value: {
|
|
9541
9552
|
layoutMode: N.layoutMode || "free",
|
|
9542
9553
|
parentId: e.id
|
|
9543
9554
|
},
|
|
9544
|
-
children: e.children?.filter((e) => !Mn(e)).map((e) => /* @__PURE__ */ q(
|
|
9555
|
+
children: e.children?.filter((e) => !Mn(e)).map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))
|
|
9545
9556
|
})
|
|
9546
9557
|
]
|
|
9547
9558
|
});
|
|
@@ -9558,15 +9569,15 @@ var ql = ({ node: e }) => {
|
|
|
9558
9569
|
className: `${tt} ${nt} ${N.customClasses || ""}`,
|
|
9559
9570
|
children: [
|
|
9560
9571
|
et(),
|
|
9561
|
-
Qe && /* @__PURE__ */ q(
|
|
9562
|
-
/* @__PURE__ */ q(
|
|
9572
|
+
Qe && /* @__PURE__ */ q(Hl, { guides: w }),
|
|
9573
|
+
/* @__PURE__ */ q(Il.Provider, {
|
|
9563
9574
|
value: {
|
|
9564
9575
|
layoutMode: N.layoutMode || "free",
|
|
9565
9576
|
parentId: e.id
|
|
9566
9577
|
},
|
|
9567
|
-
children: /* @__PURE__ */ q(
|
|
9578
|
+
children: /* @__PURE__ */ q(Tl.Provider, {
|
|
9568
9579
|
value: F ? { sectionId: e.id } : null,
|
|
9569
|
-
children: e.children?.map((e) => /* @__PURE__ */ q(
|
|
9580
|
+
children: e.children?.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))
|
|
9570
9581
|
})
|
|
9571
9582
|
})
|
|
9572
9583
|
]
|
|
@@ -9585,13 +9596,13 @@ var ql = ({ node: e }) => {
|
|
|
9585
9596
|
className: `${tt} ${nt} ${N.customClasses || ""}`,
|
|
9586
9597
|
children: [
|
|
9587
9598
|
et(),
|
|
9588
|
-
Qe && /* @__PURE__ */ q(
|
|
9589
|
-
/* @__PURE__ */ q(
|
|
9599
|
+
Qe && /* @__PURE__ */ q(Hl, { guides: w }),
|
|
9600
|
+
/* @__PURE__ */ q(Il.Provider, {
|
|
9590
9601
|
value: {
|
|
9591
9602
|
layoutMode: N.layoutMode || "free",
|
|
9592
9603
|
parentId: e.id
|
|
9593
9604
|
},
|
|
9594
|
-
children: e.children?.map((e) => /* @__PURE__ */ q(
|
|
9605
|
+
children: e.children?.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))
|
|
9595
9606
|
})
|
|
9596
9607
|
]
|
|
9597
9608
|
});
|
|
@@ -9606,7 +9617,7 @@ var ql = ({ node: e }) => {
|
|
|
9606
9617
|
onMouseLeave: Se,
|
|
9607
9618
|
...z,
|
|
9608
9619
|
className: `grid ${tt} ${nt} ${N.customClasses || ""}`,
|
|
9609
|
-
children: [et(), e.children?.map((e) => /* @__PURE__ */ q(
|
|
9620
|
+
children: [et(), e.children?.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))]
|
|
9610
9621
|
});
|
|
9611
9622
|
case "column": return /* @__PURE__ */ J("div", {
|
|
9612
9623
|
id: e.id,
|
|
@@ -9619,7 +9630,7 @@ var ql = ({ node: e }) => {
|
|
|
9619
9630
|
onMouseLeave: Se,
|
|
9620
9631
|
...z,
|
|
9621
9632
|
className: `${tt} ${nt} ${N.customClasses || ""}`,
|
|
9622
|
-
children: [et(), e.children?.map((e) => /* @__PURE__ */ q(
|
|
9633
|
+
children: [et(), e.children?.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))]
|
|
9623
9634
|
});
|
|
9624
9635
|
case "heading": return /* @__PURE__ */ J(`h${e.props?.level || 2}`, {
|
|
9625
9636
|
id: e.id,
|
|
@@ -9757,7 +9768,7 @@ var ql = ({ node: e }) => {
|
|
|
9757
9768
|
onMouseLeave: Se,
|
|
9758
9769
|
...z,
|
|
9759
9770
|
className: `${tt} ${nt} ${N.customClasses || ""}`,
|
|
9760
|
-
children: [et(), /* @__PURE__ */ q(
|
|
9771
|
+
children: [et(), /* @__PURE__ */ q(Fl, {
|
|
9761
9772
|
node: e,
|
|
9762
9773
|
preview: s
|
|
9763
9774
|
})]
|
|
@@ -9775,12 +9786,12 @@ var ql = ({ node: e }) => {
|
|
|
9775
9786
|
children: [
|
|
9776
9787
|
et(),
|
|
9777
9788
|
e.content || e.name,
|
|
9778
|
-
e.children?.map((e) => /* @__PURE__ */ q(
|
|
9789
|
+
e.children?.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))
|
|
9779
9790
|
]
|
|
9780
9791
|
});
|
|
9781
9792
|
}
|
|
9782
|
-
},
|
|
9783
|
-
let { isPreviewMode: t, viewportMode: n } = Z(), r =
|
|
9793
|
+
}, Yl = ({ node: e }) => {
|
|
9794
|
+
let { isPreviewMode: t, viewportMode: n } = Z(), r = Sl(), i = wl(e.id), a = r || n, o = Xo(e, a);
|
|
9784
9795
|
if (e.props?.isFlowSpacer) return /* @__PURE__ */ q("div", {
|
|
9785
9796
|
id: e.id,
|
|
9786
9797
|
"data-plx-node": "",
|
|
@@ -9802,8 +9813,8 @@ var ql = ({ node: e }) => {
|
|
|
9802
9813
|
}
|
|
9803
9814
|
});
|
|
9804
9815
|
let s = a === "desktop" && e.responsiveVisibility?.hideOnDesktop || a === "tablet" && e.responsiveVisibility?.hideOnTablet || a === "mobile" && e.responsiveVisibility?.hideOnMobile;
|
|
9805
|
-
return e.hidden || (s || i === "outside") && t ? null : /* @__PURE__ */ q(
|
|
9806
|
-
},
|
|
9816
|
+
return e.hidden || (s || i === "outside") && t ? null : /* @__PURE__ */ q(Jl, { node: e });
|
|
9817
|
+
}, Xl = ({ breakpoint: e, width: t, isFocusedMode: n = !1 }) => {
|
|
9807
9818
|
let { documentTree: r, viewportMode: i, setViewportMode: a, selectedNodeId: o, selectNode: s, isPreviewMode: c, canvasCustomWidth: l, setCanvasCustomWidth: u, openSectionPicker: d, applyTemplateToPage: f, bringNodesIntoView: p, adaptToScreen: m, designSystem: h } = Z(), g = U(() => JSON.stringify(r), [r]), _ = U(() => Gn(h, e, g), [
|
|
9808
9819
|
h,
|
|
9809
9820
|
e,
|
|
@@ -9878,9 +9889,9 @@ var ql = ({ node: e }) => {
|
|
|
9878
9889
|
let e = (t) => t.id === o || (t.children?.some(e) ?? !1);
|
|
9879
9890
|
return (r.children ?? []).find((t) => t.type === "section" && e(t))?.id ?? null;
|
|
9880
9891
|
}, [r, o]), L = n && M && !c;
|
|
9881
|
-
return /* @__PURE__ */ q(
|
|
9892
|
+
return /* @__PURE__ */ q(xl.Provider, {
|
|
9882
9893
|
value: e,
|
|
9883
|
-
children: /* @__PURE__ */ q(
|
|
9894
|
+
children: /* @__PURE__ */ q(Cl.Provider, {
|
|
9884
9895
|
value: y,
|
|
9885
9896
|
children: /* @__PURE__ */ J("div", {
|
|
9886
9897
|
className: "relative flex flex-col items-center select-none group",
|
|
@@ -9960,7 +9971,7 @@ var ql = ({ node: e }) => {
|
|
|
9960
9971
|
"data-plx-frame": "",
|
|
9961
9972
|
className: `relative bg-px-surface rounded-xl shadow-2xl border ${c ? "overflow-hidden" : "overflow-visible"} transition-colors ${P ? "border-px-accent ring-1 ring-px-accent/30" : "border-px-line hover:border-px-line3"}`,
|
|
9962
9973
|
children: [
|
|
9963
|
-
/* @__PURE__ */ q(
|
|
9974
|
+
/* @__PURE__ */ q(Yl, { node: r }),
|
|
9964
9975
|
I && D && /* @__PURE__ */ q("div", {
|
|
9965
9976
|
className: "absolute inset-0 z-10 flex items-center justify-center p-6 pointer-events-none",
|
|
9966
9977
|
style: { minHeight: 360 },
|
|
@@ -10000,7 +10011,7 @@ var ql = ({ node: e }) => {
|
|
|
10000
10011
|
"data-plx-add-zones": "",
|
|
10001
10012
|
children: S.map((e, t) => {
|
|
10002
10013
|
let n = S[t + 1]?.afterId ?? null, r = !!se && (e.afterId === se || n === se);
|
|
10003
|
-
return /* @__PURE__ */ q(
|
|
10014
|
+
return /* @__PURE__ */ q(Zl, {
|
|
10004
10015
|
y: e.y,
|
|
10005
10016
|
top: e.afterId === null,
|
|
10006
10017
|
always: ae || r,
|
|
@@ -10042,7 +10053,7 @@ var ql = ({ node: e }) => {
|
|
|
10042
10053
|
})
|
|
10043
10054
|
})
|
|
10044
10055
|
});
|
|
10045
|
-
},
|
|
10056
|
+
}, Zl = ({ y: e, always: t, top: n, onClick: r }) => /* @__PURE__ */ J("div", {
|
|
10046
10057
|
className: `group/zone absolute left-0 right-0 h-8 flex pointer-events-auto ${n ? "items-end justify-end pr-5" : "items-start justify-center"}`,
|
|
10047
10058
|
style: { top: n ? e - 32 : e },
|
|
10048
10059
|
"data-plx-add-zone": "",
|
|
@@ -10055,7 +10066,7 @@ var ql = ({ node: e }) => {
|
|
|
10055
10066
|
className: `relative flex items-center gap-1 h-6 px-2.5 rounded-full bg-px-accent text-px-onaccent text-[11px] font-semibold shadow-lg cursor-pointer transition-opacity ${n ? "mb-1" : "mt-1"} ${t ? "opacity-70" : "opacity-0"} group-hover/zone:opacity-100 focus:opacity-100`,
|
|
10056
10067
|
children: [/* @__PURE__ */ q(B, { className: "w-3 h-3 stroke-[2.6]" }), " Add section"]
|
|
10057
10068
|
})]
|
|
10058
|
-
}),
|
|
10069
|
+
}), Ql = () => {
|
|
10059
10070
|
let { canvasTool: e, setCanvasTool: t, canvasZoom: n, isFitMode: r, canvasViewMode: i, setCanvasViewMode: a, zoomIn: o, zoomOut: s, setZoomCentered: c, resetZoom100: l, fitToPage: u, snapToGrid: d, setSnapToGrid: f, snapToElements: p, setSnapToElements: m } = Z(), [g, _] = G(!1), y = W(null);
|
|
10060
10071
|
return H(() => {
|
|
10061
10072
|
let e = (e) => {
|
|
@@ -10171,15 +10182,15 @@ var ql = ({ node: e }) => {
|
|
|
10171
10182
|
})
|
|
10172
10183
|
]
|
|
10173
10184
|
});
|
|
10174
|
-
},
|
|
10185
|
+
}, $l = /* @__PURE__ */ new Map(), eu = () => {
|
|
10175
10186
|
let { documentTree: e, designSystem: t, isPreviewMode: n } = Z(), r = _n(e), i = U(() => r ? JSON.stringify(r) : "", [r]), a = U(() => Gn(t, "desktop", i), [t, i]);
|
|
10176
|
-
return !r || n || !r.children?.length ? null : /* @__PURE__ */ q(
|
|
10187
|
+
return !r || n || !r.children?.length ? null : /* @__PURE__ */ q(xl.Provider, {
|
|
10177
10188
|
value: "desktop",
|
|
10178
|
-
children: /* @__PURE__ */ q(
|
|
10179
|
-
value:
|
|
10180
|
-
children: /* @__PURE__ */ q(
|
|
10189
|
+
children: /* @__PURE__ */ q(Cl.Provider, {
|
|
10190
|
+
value: $l,
|
|
10191
|
+
children: /* @__PURE__ */ q(El.Provider, {
|
|
10181
10192
|
value: !0,
|
|
10182
|
-
children: /* @__PURE__ */ q(
|
|
10193
|
+
children: /* @__PURE__ */ q(Il.Provider, {
|
|
10183
10194
|
value: {
|
|
10184
10195
|
layoutMode: "free",
|
|
10185
10196
|
parentId: sn
|
|
@@ -10198,7 +10209,7 @@ var ql = ({ node: e }) => {
|
|
|
10198
10209
|
fontFamily: "var(--font-family-body)",
|
|
10199
10210
|
...a
|
|
10200
10211
|
},
|
|
10201
|
-
children: r.children.map((e) => /* @__PURE__ */ q(
|
|
10212
|
+
children: r.children.map((e) => /* @__PURE__ */ q(Yl, { node: e }, e.id))
|
|
10202
10213
|
})
|
|
10203
10214
|
})
|
|
10204
10215
|
})
|
|
@@ -10207,14 +10218,14 @@ var ql = ({ node: e }) => {
|
|
|
10207
10218
|
};
|
|
10208
10219
|
//#endregion
|
|
10209
10220
|
//#region src/v2/components/canvas/CanvasArea.tsx
|
|
10210
|
-
function
|
|
10221
|
+
function tu(e, t = 0) {
|
|
10211
10222
|
let n = " ".repeat(t), r = e.type === "heading" ? `h${e.props?.level || 2}` : e.type === "paragraph" ? "p" : e.type === "button" ? "button" : "div", i = e.styles.customClasses ? ` class="${e.styles.customClasses}"` : "";
|
|
10212
10223
|
if (!e.children || e.children.length === 0) return `${n}<${r} id="${e.id}"${i}>${e.content || ""}</${r}>\n`;
|
|
10213
10224
|
let a = `${n}<${r} id="${e.id}" data-type="${e.type}"${i}>\n`;
|
|
10214
|
-
for (let n of e.children) a +=
|
|
10225
|
+
for (let n of e.children) a += tu(n, t + 1);
|
|
10215
10226
|
return a += `${n}</${r}>\n`, a;
|
|
10216
10227
|
}
|
|
10217
|
-
var
|
|
10228
|
+
var nu = () => {
|
|
10218
10229
|
let e = Y(), { viewMode: t, setViewMode: n, documentTree: r, viewportMode: i, canvasCustomWidth: a, canvasZoom: o, setCanvasZoom: s, canvasPan: c, setCanvasPan: l, canvasTool: u, setCanvasTool: d, canvasViewMode: f, isFitMode: p, setIsFitMode: m, setContainerSize: h, fitToPage: g, fitAllFrames: _, zoomIn: v, zoomOut: y, resetZoom100: b, selectNode: x, selectNodes: S, marquee: C, setMarquee: w, openContextMenu: T } = Z(), E = W(null), [D, O] = G(!1), [k, A] = G(!1), j = W(null), M = W(0), N = W(!1), P = W(null), ee = W(!1), F = W(null), [te, ne] = G(!1), [re, ie] = G("html"), I = (e) => {
|
|
10219
10230
|
navigator.clipboard.writeText(e), ne(!0), setTimeout(() => ne(!1), 2e3);
|
|
10220
10231
|
};
|
|
@@ -10384,25 +10395,25 @@ var tu = () => {
|
|
|
10384
10395
|
},
|
|
10385
10396
|
"data-plx-canvas-plane": "",
|
|
10386
10397
|
className: "absolute top-0 left-0 will-change-transform",
|
|
10387
|
-
children: [/* @__PURE__ */ q(
|
|
10398
|
+
children: [/* @__PURE__ */ q(eu, {}), f === "all" ? /* @__PURE__ */ J("div", {
|
|
10388
10399
|
className: "flex items-start gap-16 p-12",
|
|
10389
10400
|
children: [
|
|
10390
|
-
/* @__PURE__ */ q(
|
|
10401
|
+
/* @__PURE__ */ q(Xl, {
|
|
10391
10402
|
breakpoint: "desktop",
|
|
10392
10403
|
width: 1200
|
|
10393
10404
|
}),
|
|
10394
|
-
/* @__PURE__ */ q(
|
|
10405
|
+
/* @__PURE__ */ q(Xl, {
|
|
10395
10406
|
breakpoint: "tablet",
|
|
10396
10407
|
width: 768
|
|
10397
10408
|
}),
|
|
10398
|
-
/* @__PURE__ */ q(
|
|
10409
|
+
/* @__PURE__ */ q(Xl, {
|
|
10399
10410
|
breakpoint: "mobile",
|
|
10400
10411
|
width: 375
|
|
10401
10412
|
})
|
|
10402
10413
|
]
|
|
10403
10414
|
}) : /* @__PURE__ */ q("div", {
|
|
10404
10415
|
className: "flex justify-center items-start p-12",
|
|
10405
|
-
children: /* @__PURE__ */ q(
|
|
10416
|
+
children: /* @__PURE__ */ q(Xl, {
|
|
10406
10417
|
breakpoint: i,
|
|
10407
10418
|
width: i === "mobile" ? 375 : i === "tablet" ? 768 : a || 1200,
|
|
10408
10419
|
isFocusedMode: !0
|
|
@@ -10430,7 +10441,7 @@ var tu = () => {
|
|
|
10430
10441
|
}), /* @__PURE__ */ J("div", {
|
|
10431
10442
|
className: "flex items-center gap-2",
|
|
10432
10443
|
children: [/* @__PURE__ */ J("button", {
|
|
10433
|
-
onClick: () => I(re === "html" ?
|
|
10444
|
+
onClick: () => I(re === "html" ? tu(r) : JSON.stringify(r, null, 2)),
|
|
10434
10445
|
className: "flex items-center gap-1 text-xs text-px-muted hover:text-white bg-px-raised px-2.5 py-1 rounded-lg border border-px-line2 transition-colors cursor-pointer",
|
|
10435
10446
|
children: [te ? /* @__PURE__ */ q(xt, { className: "w-3.5 h-3.5 text-green-400" }) : /* @__PURE__ */ q(he, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ q("span", { children: te ? "Copied" : "Copy" })]
|
|
10436
10447
|
}), /* @__PURE__ */ J("button", {
|
|
@@ -10442,7 +10453,7 @@ var tu = () => {
|
|
|
10442
10453
|
})]
|
|
10443
10454
|
}), /* @__PURE__ */ q("pre", {
|
|
10444
10455
|
className: "text-px-text overflow-x-auto max-h-[72vh] p-2 leading-relaxed font-mono",
|
|
10445
|
-
children: re === "html" ?
|
|
10456
|
+
children: re === "html" ? tu(r) : JSON.stringify(r, null, 2)
|
|
10446
10457
|
})]
|
|
10447
10458
|
})
|
|
10448
10459
|
}),
|
|
@@ -10458,10 +10469,10 @@ var tu = () => {
|
|
|
10458
10469
|
},
|
|
10459
10470
|
className: "bg-px-accent-hover/15 border border-px-accent/80 rounded-[2px]"
|
|
10460
10471
|
}),
|
|
10461
|
-
t === "design" && e.experience !== "beginner" && /* @__PURE__ */ q(
|
|
10472
|
+
t === "design" && e.experience !== "beginner" && /* @__PURE__ */ q(Ql, {})
|
|
10462
10473
|
]
|
|
10463
10474
|
});
|
|
10464
|
-
},
|
|
10475
|
+
}, ru = [
|
|
10465
10476
|
["Primary", "--color-brand-primary-500"],
|
|
10466
10477
|
["Primary (light)", "--color-brand-primary-300"],
|
|
10467
10478
|
["Primary (dark)", "--color-brand-primary-700"],
|
|
@@ -10477,9 +10488,9 @@ var tu = () => {
|
|
|
10477
10488
|
["Warning", "--color-state-warning"],
|
|
10478
10489
|
["Error", "--color-state-error"],
|
|
10479
10490
|
["Info", "--color-state-info"]
|
|
10480
|
-
],
|
|
10491
|
+
], iu = ({ value: e, onChange: t, label: n, className: r }) => {
|
|
10481
10492
|
let { colors: i, theme: a } = Y(), o = rc(a), { designSystem: s } = Z(), c = U(() => {
|
|
10482
|
-
let e = new Map(
|
|
10493
|
+
let e = new Map(ru.map(([e, t]) => [t, e])), t = ru.map(([, e]) => e), n = s.tokens.filter((t) => t.type === "color" && t.layer !== "component" && !e.has(t.key)).map((e) => e.key);
|
|
10483
10494
|
return [...t, ...n].flatMap((t) => {
|
|
10484
10495
|
let n = ei(s, t);
|
|
10485
10496
|
return n ? [{
|
|
@@ -10505,7 +10516,7 @@ var tu = () => {
|
|
|
10505
10516
|
resolve: l
|
|
10506
10517
|
})
|
|
10507
10518
|
});
|
|
10508
|
-
},
|
|
10519
|
+
}, au = [
|
|
10509
10520
|
{
|
|
10510
10521
|
label: "Light",
|
|
10511
10522
|
value: "300"
|
|
@@ -10526,24 +10537,24 @@ var tu = () => {
|
|
|
10526
10537
|
label: "Bold",
|
|
10527
10538
|
value: "700"
|
|
10528
10539
|
}
|
|
10529
|
-
],
|
|
10540
|
+
], ou = (e) => `data:image/svg+xml;utf8,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800'>${e}</svg>`)}`, su = [
|
|
10530
10541
|
{
|
|
10531
10542
|
name: "None",
|
|
10532
10543
|
url: ""
|
|
10533
10544
|
},
|
|
10534
10545
|
{
|
|
10535
10546
|
name: "Subtle Grid",
|
|
10536
|
-
url:
|
|
10547
|
+
url: ou("<defs><pattern id='g' width='40' height='40' patternUnits='userSpaceOnUse'><path d='M40 0H0V40' fill='none' stroke='rgba(128,128,128,0.18)' stroke-width='1'/></pattern></defs><rect width='800' height='800' fill='url(#g)'/>")
|
|
10537
10548
|
},
|
|
10538
10549
|
{
|
|
10539
10550
|
name: "Soft Dots",
|
|
10540
|
-
url:
|
|
10551
|
+
url: ou("<defs><pattern id='d' width='24' height='24' patternUnits='userSpaceOnUse'><circle cx='2' cy='2' r='1.4' fill='rgba(128,128,128,0.3)'/></pattern></defs><rect width='800' height='800' fill='url(#d)'/>")
|
|
10541
10552
|
},
|
|
10542
10553
|
{
|
|
10543
10554
|
name: "Radial Glow",
|
|
10544
|
-
url:
|
|
10555
|
+
url: ou("<defs><radialGradient id='r' cx='50%' cy='40%' r='60%'><stop offset='0' stop-color='rgba(150,240,46,0.35)'/><stop offset='1' stop-color='rgba(150,240,46,0)'/></radialGradient></defs><rect width='800' height='800' fill='url(#r)'/>")
|
|
10545
10556
|
}
|
|
10546
|
-
],
|
|
10557
|
+
], cu = () => {
|
|
10547
10558
|
let { documentTree: e, resolveStyles: t, updateNodeStyles: n, currentPage: r, viewportMode: i } = Z(), a = t(e), [o, s] = G(!0), [c, l] = G(!0), [u, d] = G(!0), [f, p] = G(!0), [m, h] = G(!1), [g, _] = G(!1), [v, y] = G("design"), b = a.maxWidth || "1200px", S = parseInt(b, 10) || 1200, C = a.horizontalAlign || "center", w = parseInt(a.padding || "24px", 10) || 24, T = parseInt(a.margin || "0px", 10) || 0, E = (t) => {
|
|
10548
10559
|
n(e.id, t);
|
|
10549
10560
|
};
|
|
@@ -10751,7 +10762,7 @@ var tu = () => {
|
|
|
10751
10762
|
children: [/* @__PURE__ */ q("label", {
|
|
10752
10763
|
className: "text-[11px] text-px-muted block",
|
|
10753
10764
|
children: "Background"
|
|
10754
|
-
}), /* @__PURE__ */ q(
|
|
10765
|
+
}), /* @__PURE__ */ q(iu, {
|
|
10755
10766
|
value: a.backgroundColor || "#141414",
|
|
10756
10767
|
onChange: (e) => E({ backgroundColor: e })
|
|
10757
10768
|
})]
|
|
@@ -10761,7 +10772,7 @@ var tu = () => {
|
|
|
10761
10772
|
children: [/* @__PURE__ */ q("label", {
|
|
10762
10773
|
className: "text-[11px] text-px-muted block",
|
|
10763
10774
|
children: "Dark Mode Background"
|
|
10764
|
-
}), /* @__PURE__ */ q(
|
|
10775
|
+
}), /* @__PURE__ */ q(iu, {
|
|
10765
10776
|
value: a.darkModeBackgroundColor || "#0D0D0D",
|
|
10766
10777
|
onChange: (e) => E({ darkModeBackgroundColor: e })
|
|
10767
10778
|
})]
|
|
@@ -10782,7 +10793,7 @@ var tu = () => {
|
|
|
10782
10793
|
}),
|
|
10783
10794
|
g && /* @__PURE__ */ q("div", {
|
|
10784
10795
|
className: "grid grid-cols-2 gap-1.5 p-2 bg-px-surface rounded-lg border border-px-line2 mb-2",
|
|
10785
|
-
children:
|
|
10796
|
+
children: su.map((e) => /* @__PURE__ */ q("button", {
|
|
10786
10797
|
onClick: () => {
|
|
10787
10798
|
E({
|
|
10788
10799
|
backgroundImage: e.url || void 0,
|
|
@@ -10846,7 +10857,7 @@ var tu = () => {
|
|
|
10846
10857
|
value: a.fontWeight || "400",
|
|
10847
10858
|
onChange: (e) => E({ fontWeight: e.target.value }),
|
|
10848
10859
|
className: "w-full appearance-none bg-px-raised border border-px-line2 rounded-lg px-2.5 py-1.5 text-xs text-px-text font-medium pr-7 cursor-pointer focus:outline-none focus:border-px-accent/60",
|
|
10849
|
-
children:
|
|
10860
|
+
children: au.map((e) => /* @__PURE__ */ J("option", {
|
|
10850
10861
|
value: e.value,
|
|
10851
10862
|
className: "bg-px-surface text-px-text",
|
|
10852
10863
|
children: [
|
|
@@ -10864,7 +10875,7 @@ var tu = () => {
|
|
|
10864
10875
|
children: [/* @__PURE__ */ q("label", {
|
|
10865
10876
|
className: "text-[11px] text-px-muted block",
|
|
10866
10877
|
children: "Text Color"
|
|
10867
|
-
}), /* @__PURE__ */ q(
|
|
10878
|
+
}), /* @__PURE__ */ q(iu, {
|
|
10868
10879
|
value: a.textColor || "#F3F4F6",
|
|
10869
10880
|
onChange: (e) => E({ textColor: e })
|
|
10870
10881
|
})]
|
|
@@ -10883,7 +10894,7 @@ var tu = () => {
|
|
|
10883
10894
|
children: [/* @__PURE__ */ q("label", {
|
|
10884
10895
|
className: "text-[11px] text-px-muted block",
|
|
10885
10896
|
children: "Link Color"
|
|
10886
|
-
}), /* @__PURE__ */ q(
|
|
10897
|
+
}), /* @__PURE__ */ q(iu, {
|
|
10887
10898
|
value: a.linkColor || "#2563EB",
|
|
10888
10899
|
onChange: (e) => E({ linkColor: e })
|
|
10889
10900
|
})]
|
|
@@ -10893,7 +10904,7 @@ var tu = () => {
|
|
|
10893
10904
|
children: [/* @__PURE__ */ q("label", {
|
|
10894
10905
|
className: "text-[11px] text-px-muted block",
|
|
10895
10906
|
children: "Hover Color"
|
|
10896
|
-
}), /* @__PURE__ */ q(
|
|
10907
|
+
}), /* @__PURE__ */ q(iu, {
|
|
10897
10908
|
value: a.linkHoverColor || "#1D4ED8",
|
|
10898
10909
|
onChange: (e) => E({ linkHoverColor: e })
|
|
10899
10910
|
})]
|
|
@@ -10987,13 +10998,13 @@ var tu = () => {
|
|
|
10987
10998
|
})
|
|
10988
10999
|
]
|
|
10989
11000
|
});
|
|
10990
|
-
},
|
|
10991
|
-
function
|
|
11001
|
+
}, lu = "w-full bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent";
|
|
11002
|
+
function uu(e) {
|
|
10992
11003
|
let t = (e ?? "").trim();
|
|
10993
11004
|
return !t || t === "#" ? "none" : t.startsWith("#") ? "section" : /^mailto:/i.test(t) ? "email" : /^tel:/i.test(t) ? "phone" : /^(https?:)?\/\//i.test(t) ? "web" : "page";
|
|
10994
11005
|
}
|
|
10995
|
-
var
|
|
10996
|
-
function
|
|
11006
|
+
var du = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11007
|
+
function fu() {
|
|
10997
11008
|
let e = Y(), { pages: t } = Z();
|
|
10998
11009
|
return U(() => {
|
|
10999
11010
|
let n = [], r = /* @__PURE__ */ new Set(), i = (e, t) => {
|
|
@@ -11002,14 +11013,14 @@ function du() {
|
|
|
11002
11013
|
href: t
|
|
11003
11014
|
}));
|
|
11004
11015
|
};
|
|
11005
|
-
return e.pageSource && e.pageSource.pages.forEach((e) => i(e.name, e.route ?? `/${
|
|
11016
|
+
return e.pageSource && e.pageSource.pages.forEach((e) => i(e.name, e.route ?? `/${du(e.name)}`)), e.linkTargets?.forEach((e) => i(e.label, e.href)), e.pageSource || t.forEach((e, t) => i(e.name, t === 0 ? "/" : `/${du(e.name)}`)), n;
|
|
11006
11017
|
}, [
|
|
11007
11018
|
e.pageSource,
|
|
11008
11019
|
e.linkTargets,
|
|
11009
11020
|
t
|
|
11010
11021
|
]);
|
|
11011
11022
|
}
|
|
11012
|
-
function
|
|
11023
|
+
function pu() {
|
|
11013
11024
|
let { documentTree: e } = Z();
|
|
11014
11025
|
return U(() => {
|
|
11015
11026
|
let t = Bn(e), n = [], r = (e) => {
|
|
@@ -11021,15 +11032,15 @@ function fu() {
|
|
|
11021
11032
|
return r(e), n;
|
|
11022
11033
|
}, [e]);
|
|
11023
11034
|
}
|
|
11024
|
-
var
|
|
11035
|
+
var mu = [
|
|
11025
11036
|
["none", "Nowhere (not a link)"],
|
|
11026
11037
|
["page", "A page on my site"],
|
|
11027
11038
|
["section", "A section on this page"],
|
|
11028
11039
|
["web", "Another website"],
|
|
11029
11040
|
["email", "An email address"],
|
|
11030
11041
|
["phone", "A phone number"]
|
|
11031
|
-
],
|
|
11032
|
-
let i =
|
|
11042
|
+
], hu = ({ value: e, onChange: t, label: n = "Goes to", compact: r }) => {
|
|
11043
|
+
let i = fu(), a = pu(), o = (e ?? "").trim(), s = uu(o), c = i.some((e) => e.href === o), l = (e) => {
|
|
11033
11044
|
e !== s && t(e === "none" ? "" : e === "page" ? i[0]?.href ?? "/" : e === "section" ? a[0]?.href ?? "#" : e === "web" ? "https://" : e === "email" ? "mailto:" : "tel:");
|
|
11034
11045
|
};
|
|
11035
11046
|
return /* @__PURE__ */ J("div", {
|
|
@@ -11042,11 +11053,11 @@ var pu = [
|
|
|
11042
11053
|
className: "w-16 text-[11px] text-px-muted shrink-0",
|
|
11043
11054
|
children: n
|
|
11044
11055
|
}), /* @__PURE__ */ q("select", {
|
|
11045
|
-
className:
|
|
11056
|
+
className: lu,
|
|
11046
11057
|
"aria-label": n,
|
|
11047
11058
|
value: s,
|
|
11048
11059
|
onChange: (e) => l(e.target.value),
|
|
11049
|
-
children:
|
|
11060
|
+
children: mu.map(([e, t]) => /* @__PURE__ */ q("option", {
|
|
11050
11061
|
value: e,
|
|
11051
11062
|
children: t
|
|
11052
11063
|
}, e))
|
|
@@ -11055,7 +11066,7 @@ var pu = [
|
|
|
11055
11066
|
s === "page" && /* @__PURE__ */ J("div", {
|
|
11056
11067
|
className: r ? "" : "pl-[72px]",
|
|
11057
11068
|
children: [/* @__PURE__ */ J("select", {
|
|
11058
|
-
className:
|
|
11069
|
+
className: lu,
|
|
11059
11070
|
"aria-label": "Page",
|
|
11060
11071
|
value: c ? o : "__other",
|
|
11061
11072
|
onChange: (e) => t(e.target.value === "__other" ? o || "/" : e.target.value),
|
|
@@ -11072,7 +11083,7 @@ var pu = [
|
|
|
11072
11083
|
children: "A different address on my site…"
|
|
11073
11084
|
})]
|
|
11074
11085
|
}), !c && /* @__PURE__ */ q("input", {
|
|
11075
|
-
className: `${
|
|
11086
|
+
className: `${lu} mt-1.5`,
|
|
11076
11087
|
value: o,
|
|
11077
11088
|
onChange: (e) => t(e.target.value),
|
|
11078
11089
|
placeholder: "/pricing",
|
|
@@ -11082,7 +11093,7 @@ var pu = [
|
|
|
11082
11093
|
s === "section" && /* @__PURE__ */ q("div", {
|
|
11083
11094
|
className: r ? "" : "pl-[72px]",
|
|
11084
11095
|
children: a.length ? /* @__PURE__ */ J("select", {
|
|
11085
|
-
className:
|
|
11096
|
+
className: lu,
|
|
11086
11097
|
"aria-label": "Section",
|
|
11087
11098
|
value: a.some((e) => e.href === o) ? o : "",
|
|
11088
11099
|
onChange: (e) => t(e.target.value),
|
|
@@ -11101,7 +11112,7 @@ var pu = [
|
|
|
11101
11112
|
s === "web" && /* @__PURE__ */ q("div", {
|
|
11102
11113
|
className: r ? "" : "pl-[72px]",
|
|
11103
11114
|
children: /* @__PURE__ */ q("input", {
|
|
11104
|
-
className:
|
|
11115
|
+
className: lu,
|
|
11105
11116
|
value: o,
|
|
11106
11117
|
onChange: (e) => t(e.target.value),
|
|
11107
11118
|
placeholder: "https://example.com",
|
|
@@ -11111,7 +11122,7 @@ var pu = [
|
|
|
11111
11122
|
s === "email" && /* @__PURE__ */ q("div", {
|
|
11112
11123
|
className: r ? "" : "pl-[72px]",
|
|
11113
11124
|
children: /* @__PURE__ */ q("input", {
|
|
11114
|
-
className:
|
|
11125
|
+
className: lu,
|
|
11115
11126
|
value: o.replace(/^mailto:/i, ""),
|
|
11116
11127
|
onChange: (e) => t(`mailto:${e.target.value.trim()}`),
|
|
11117
11128
|
placeholder: "hello@example.com",
|
|
@@ -11121,7 +11132,7 @@ var pu = [
|
|
|
11121
11132
|
s === "phone" && /* @__PURE__ */ q("div", {
|
|
11122
11133
|
className: r ? "" : "pl-[72px]",
|
|
11123
11134
|
children: /* @__PURE__ */ q("input", {
|
|
11124
|
-
className:
|
|
11135
|
+
className: lu,
|
|
11125
11136
|
value: o.replace(/^tel:/i, ""),
|
|
11126
11137
|
onChange: (e) => t(`tel:${e.target.value.replace(/[^\d+()\-.\s]/g, "").trim()}`),
|
|
11127
11138
|
placeholder: "+1 555 010 2030",
|
|
@@ -11130,16 +11141,16 @@ var pu = [
|
|
|
11130
11141
|
})
|
|
11131
11142
|
]
|
|
11132
11143
|
});
|
|
11133
|
-
},
|
|
11144
|
+
}, gu = "w-full bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent", _u = ({ src: e }) => e ? /* @__PURE__ */ q("img", {
|
|
11134
11145
|
src: e,
|
|
11135
11146
|
alt: "",
|
|
11136
11147
|
className: "w-8 h-8 rounded object-cover shrink-0 bg-px-line2"
|
|
11137
11148
|
}) : /* @__PURE__ */ q("span", {
|
|
11138
11149
|
className: "w-8 h-8 rounded shrink-0 bg-px-line2",
|
|
11139
11150
|
"aria-hidden": "true"
|
|
11140
|
-
}),
|
|
11151
|
+
}), vu = ({ p: e }) => /* @__PURE__ */ J("span", {
|
|
11141
11152
|
className: "flex items-center gap-2 min-w-0 text-left",
|
|
11142
|
-
children: [/* @__PURE__ */ q(
|
|
11153
|
+
children: [/* @__PURE__ */ q(_u, { src: e.imageUrl }), /* @__PURE__ */ J("span", {
|
|
11143
11154
|
className: "min-w-0",
|
|
11144
11155
|
children: [/* @__PURE__ */ q("span", {
|
|
11145
11156
|
className: "block text-[11px] text-px-text truncate",
|
|
@@ -11149,7 +11160,7 @@ var pu = [
|
|
|
11149
11160
|
children: e.priceLabel
|
|
11150
11161
|
})]
|
|
11151
11162
|
})]
|
|
11152
|
-
}),
|
|
11163
|
+
}), yu = ({ value: e, onChange: t }) => {
|
|
11153
11164
|
let { products: n } = Y(), [r, i] = G(!1), [a, o] = G(""), [s, c] = G(null), [l, u] = G(!1), d = n?.list, f = V(() => {
|
|
11154
11165
|
if (!d) return;
|
|
11155
11166
|
u(!1), c(null);
|
|
@@ -11165,7 +11176,7 @@ var pu = [
|
|
|
11165
11176
|
H(() => f(), [f]);
|
|
11166
11177
|
let p = U(() => (s ?? []).filter((e) => !a.trim() || e.name.toLowerCase().includes(a.trim().toLowerCase())), [s, a]);
|
|
11167
11178
|
if (!d) return /* @__PURE__ */ q("input", {
|
|
11168
|
-
className:
|
|
11179
|
+
className: gu,
|
|
11169
11180
|
value: e,
|
|
11170
11181
|
onChange: (e) => t(e.target.value),
|
|
11171
11182
|
placeholder: "Paste the product's code",
|
|
@@ -11204,7 +11215,7 @@ var pu = [
|
|
|
11204
11215
|
className: "space-y-2",
|
|
11205
11216
|
children: [
|
|
11206
11217
|
/* @__PURE__ */ q("input", {
|
|
11207
|
-
className:
|
|
11218
|
+
className: gu,
|
|
11208
11219
|
value: a,
|
|
11209
11220
|
onChange: (e) => o(e.target.value),
|
|
11210
11221
|
placeholder: "Search your products",
|
|
@@ -11222,7 +11233,7 @@ var pu = [
|
|
|
11222
11233
|
t(n.id), i(!1), o("");
|
|
11223
11234
|
},
|
|
11224
11235
|
className: `w-full flex items-center px-1.5 py-1 rounded cursor-pointer ${n.id === e ? "bg-px-line2" : "hover:bg-px-line2"}`,
|
|
11225
|
-
children: /* @__PURE__ */ q(
|
|
11236
|
+
children: /* @__PURE__ */ q(vu, { p: n })
|
|
11226
11237
|
}, n.id)), p.length === 0 && /* @__PURE__ */ q("p", {
|
|
11227
11238
|
className: "text-[11px] text-px-faint px-1.5 py-1",
|
|
11228
11239
|
children: "No product matches that."
|
|
@@ -11237,7 +11248,7 @@ var pu = [
|
|
|
11237
11248
|
onClick: () => i(!r),
|
|
11238
11249
|
"aria-expanded": r,
|
|
11239
11250
|
className: "flex items-center justify-between gap-2 w-full min-h-10 px-2 py-1 rounded border border-px-line2 bg-px-raised hover:border-px-accent/60 cursor-pointer",
|
|
11240
|
-
children: [m ? /* @__PURE__ */ q(
|
|
11251
|
+
children: [m ? /* @__PURE__ */ q(vu, { p: m }) : /* @__PURE__ */ q("span", {
|
|
11241
11252
|
className: "text-[11px] text-px-muted",
|
|
11242
11253
|
children: e && s ? "That product is no longer available. Choose another" : "Choose a product"
|
|
11243
11254
|
}), /* @__PURE__ */ q($e, {
|
|
@@ -11250,7 +11261,7 @@ var pu = [
|
|
|
11250
11261
|
children: g
|
|
11251
11262
|
})]
|
|
11252
11263
|
});
|
|
11253
|
-
},
|
|
11264
|
+
}, bu = "w-full bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent", xu = "w-6 h-6 rounded flex items-center justify-center text-px-muted hover:text-white hover:bg-px-line2 disabled:opacity-30 disabled:hover:bg-transparent cursor-pointer", Su = ({ title: e, children: t }) => /* @__PURE__ */ J("div", {
|
|
11254
11265
|
className: "space-y-2",
|
|
11255
11266
|
children: [/* @__PURE__ */ q("div", {
|
|
11256
11267
|
className: "text-[10px] uppercase tracking-wider font-semibold text-px-faint",
|
|
@@ -11265,7 +11276,7 @@ var pu = [
|
|
|
11265
11276
|
className: "flex-1 min-w-0",
|
|
11266
11277
|
children: t
|
|
11267
11278
|
})]
|
|
11268
|
-
}),
|
|
11279
|
+
}), Cu = ({ label: e, checked: t, onChange: n, hint: r }) => /* @__PURE__ */ J("label", {
|
|
11269
11280
|
className: "flex items-start gap-2 cursor-pointer",
|
|
11270
11281
|
children: [/* @__PURE__ */ q("input", {
|
|
11271
11282
|
type: "checkbox",
|
|
@@ -11280,7 +11291,7 @@ var pu = [
|
|
|
11280
11291
|
})]
|
|
11281
11292
|
})]
|
|
11282
11293
|
});
|
|
11283
|
-
function
|
|
11294
|
+
function wu({ items: e, onChange: t, render: n, blank: r, addLabel: i, min: a = 0 }) {
|
|
11284
11295
|
let o = (n, r) => {
|
|
11285
11296
|
let i = e.slice(), [a] = i.splice(n, 1);
|
|
11286
11297
|
i.splice(n + r, 0, a), t(i);
|
|
@@ -11293,21 +11304,21 @@ function Cu({ items: e, onChange: t, render: n, blank: r, addLabel: i, min: a =
|
|
|
11293
11304
|
className: "flex items-center justify-end gap-0.5",
|
|
11294
11305
|
children: [
|
|
11295
11306
|
/* @__PURE__ */ q("button", {
|
|
11296
|
-
className:
|
|
11307
|
+
className: xu,
|
|
11297
11308
|
disabled: i === 0,
|
|
11298
11309
|
onClick: () => o(i, -1),
|
|
11299
11310
|
"aria-label": "Move up",
|
|
11300
11311
|
children: /* @__PURE__ */ q(Be, { className: "w-3 h-3" })
|
|
11301
11312
|
}),
|
|
11302
11313
|
/* @__PURE__ */ q("button", {
|
|
11303
|
-
className:
|
|
11314
|
+
className: xu,
|
|
11304
11315
|
disabled: i === e.length - 1,
|
|
11305
11316
|
onClick: () => o(i, 1),
|
|
11306
11317
|
"aria-label": "Move down",
|
|
11307
11318
|
children: /* @__PURE__ */ q(Nt, { className: "w-3 h-3" })
|
|
11308
11319
|
}),
|
|
11309
11320
|
/* @__PURE__ */ q("button", {
|
|
11310
|
-
className:
|
|
11321
|
+
className: xu,
|
|
11311
11322
|
disabled: e.length <= a,
|
|
11312
11323
|
onClick: () => t(e.filter((e, t) => t !== i)),
|
|
11313
11324
|
"aria-label": "Remove",
|
|
@@ -11329,7 +11340,7 @@ function Cu({ items: e, onChange: t, render: n, blank: r, addLabel: i, min: a =
|
|
|
11329
11340
|
})]
|
|
11330
11341
|
});
|
|
11331
11342
|
}
|
|
11332
|
-
var
|
|
11343
|
+
var Tu = ({ value: e, onChange: t }) => {
|
|
11333
11344
|
let n = Y(), r = W(null), [i, a] = G(null), [o, s] = G(!1), c = async (e) => {
|
|
11334
11345
|
if (e) {
|
|
11335
11346
|
s(!0), a(null);
|
|
@@ -11366,7 +11377,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11366
11377
|
]
|
|
11367
11378
|
}),
|
|
11368
11379
|
/* @__PURE__ */ q("input", {
|
|
11369
|
-
className:
|
|
11380
|
+
className: bu,
|
|
11370
11381
|
value: e.startsWith("data:") ? "" : e,
|
|
11371
11382
|
onChange: (e) => t(e.target.value),
|
|
11372
11383
|
placeholder: "…or paste an image link"
|
|
@@ -11377,7 +11388,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11377
11388
|
children: i
|
|
11378
11389
|
})]
|
|
11379
11390
|
});
|
|
11380
|
-
},
|
|
11391
|
+
}, Eu = ({ name: e, size: t = 20 }) => /* @__PURE__ */ q("svg", {
|
|
11381
11392
|
width: t,
|
|
11382
11393
|
height: t,
|
|
11383
11394
|
viewBox: "0 0 24 24",
|
|
@@ -11391,12 +11402,12 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11391
11402
|
key: n,
|
|
11392
11403
|
...t
|
|
11393
11404
|
}))
|
|
11394
|
-
}),
|
|
11395
|
-
let { updateNodeStyles: r } = Z(), [i, a] = G(""), o = i.trim().toLowerCase(), s = Object.entries(Ht).map(([e, t]) => [e, o ? t.filter((t) =>
|
|
11396
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(
|
|
11405
|
+
}), Du = (e) => e.replace(/-/g, " "), Ou = ({ node: e, p: t, set: n }) => {
|
|
11406
|
+
let { updateNodeStyles: r } = Z(), [i, a] = G(""), o = i.trim().toLowerCase(), s = Object.entries(Ht).map(([e, t]) => [e, o ? t.filter((t) => Du(t).includes(o) || e.toLowerCase().includes(o)) : t]).filter(([, e]) => e.length), c = parseInt(String(e.styles.fontSize ?? "40"), 10) || 40;
|
|
11407
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(Su, {
|
|
11397
11408
|
title: "Icon",
|
|
11398
11409
|
children: [/* @__PURE__ */ q("input", {
|
|
11399
|
-
className:
|
|
11410
|
+
className: bu,
|
|
11400
11411
|
value: i,
|
|
11401
11412
|
onChange: (e) => a(e.target.value),
|
|
11402
11413
|
placeholder: "Search icons (try “mail” or “heart”)",
|
|
@@ -11417,21 +11428,21 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11417
11428
|
className: "grid grid-cols-6 gap-1",
|
|
11418
11429
|
children: r.map((e) => /* @__PURE__ */ q("button", {
|
|
11419
11430
|
type: "button",
|
|
11420
|
-
title:
|
|
11421
|
-
"aria-label":
|
|
11431
|
+
title: Du(e),
|
|
11432
|
+
"aria-label": Du(e),
|
|
11422
11433
|
"aria-pressed": t.iconName === e,
|
|
11423
11434
|
onClick: () => n({ iconName: e }),
|
|
11424
11435
|
className: `h-8 rounded-md flex items-center justify-center cursor-pointer transition-colors ${t.iconName === e ? "bg-px-accent text-px-onaccent" : "bg-px-raised text-px-text hover:bg-px-line2"}`,
|
|
11425
|
-
children: /* @__PURE__ */ q(
|
|
11436
|
+
children: /* @__PURE__ */ q(Eu, { name: e })
|
|
11426
11437
|
}, e))
|
|
11427
11438
|
})] }, e))]
|
|
11428
11439
|
})]
|
|
11429
|
-
}), /* @__PURE__ */ J(
|
|
11440
|
+
}), /* @__PURE__ */ J(Su, {
|
|
11430
11441
|
title: "Look",
|
|
11431
11442
|
children: [
|
|
11432
11443
|
/* @__PURE__ */ q(Q, {
|
|
11433
11444
|
label: "Colour",
|
|
11434
|
-
children: /* @__PURE__ */ q(
|
|
11445
|
+
children: /* @__PURE__ */ q(iu, {
|
|
11435
11446
|
value: e.styles.textColor || "currentColor",
|
|
11436
11447
|
onChange: (t) => r(e.id, { textColor: t })
|
|
11437
11448
|
})
|
|
@@ -11450,7 +11461,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11450
11461
|
/* @__PURE__ */ q(Q, {
|
|
11451
11462
|
label: "Line",
|
|
11452
11463
|
children: /* @__PURE__ */ J("select", {
|
|
11453
|
-
className:
|
|
11464
|
+
className: bu,
|
|
11454
11465
|
value: t.strokeWidth ?? 2,
|
|
11455
11466
|
onChange: (e) => n({ strokeWidth: Number(e.target.value) }),
|
|
11456
11467
|
children: [
|
|
@@ -11472,7 +11483,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11472
11483
|
/* @__PURE__ */ q(Q, {
|
|
11473
11484
|
label: "Describe",
|
|
11474
11485
|
children: /* @__PURE__ */ q("input", {
|
|
11475
|
-
className:
|
|
11486
|
+
className: bu,
|
|
11476
11487
|
value: t.label ?? "",
|
|
11477
11488
|
onChange: (e) => n({ label: e.target.value }),
|
|
11478
11489
|
placeholder: "For screen readers (optional)"
|
|
@@ -11480,9 +11491,9 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11480
11491
|
})
|
|
11481
11492
|
]
|
|
11482
11493
|
})] });
|
|
11483
|
-
},
|
|
11494
|
+
}, ku = ({ p: e, set: t }) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Su, {
|
|
11484
11495
|
title: "Slides",
|
|
11485
|
-
children: /* @__PURE__ */ q(
|
|
11496
|
+
children: /* @__PURE__ */ q(wu, {
|
|
11486
11497
|
items: e.slides ?? [],
|
|
11487
11498
|
onChange: (e) => t({ slides: e }),
|
|
11488
11499
|
blank: () => ({
|
|
@@ -11492,43 +11503,43 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11492
11503
|
}),
|
|
11493
11504
|
addLabel: "Add slide",
|
|
11494
11505
|
render: (e, t) => /* @__PURE__ */ J(K, { children: [
|
|
11495
|
-
/* @__PURE__ */ q(
|
|
11506
|
+
/* @__PURE__ */ q(Tu, {
|
|
11496
11507
|
value: e.src,
|
|
11497
11508
|
onChange: (e) => t({ src: e })
|
|
11498
11509
|
}),
|
|
11499
11510
|
/* @__PURE__ */ q("input", {
|
|
11500
|
-
className:
|
|
11511
|
+
className: bu,
|
|
11501
11512
|
value: e.caption ?? "",
|
|
11502
11513
|
onChange: (e) => t({ caption: e.target.value }),
|
|
11503
11514
|
placeholder: "Caption (optional)"
|
|
11504
11515
|
}),
|
|
11505
11516
|
/* @__PURE__ */ q("input", {
|
|
11506
|
-
className:
|
|
11517
|
+
className: bu,
|
|
11507
11518
|
value: e.alt ?? "",
|
|
11508
11519
|
onChange: (e) => t({ alt: e.target.value }),
|
|
11509
11520
|
placeholder: "Describe the image (for accessibility)"
|
|
11510
11521
|
}),
|
|
11511
|
-
/* @__PURE__ */ q(
|
|
11522
|
+
/* @__PURE__ */ q(hu, {
|
|
11512
11523
|
label: "When clicked",
|
|
11513
11524
|
value: e.href,
|
|
11514
11525
|
onChange: (e) => t({ href: e })
|
|
11515
11526
|
})
|
|
11516
11527
|
] })
|
|
11517
11528
|
})
|
|
11518
|
-
}), /* @__PURE__ */ J(
|
|
11529
|
+
}), /* @__PURE__ */ J(Su, {
|
|
11519
11530
|
title: "Behaviour",
|
|
11520
11531
|
children: [
|
|
11521
|
-
/* @__PURE__ */ q(
|
|
11532
|
+
/* @__PURE__ */ q(Cu, {
|
|
11522
11533
|
label: "Show arrows",
|
|
11523
11534
|
checked: e.showArrows !== !1,
|
|
11524
11535
|
onChange: (e) => t({ showArrows: e })
|
|
11525
11536
|
}),
|
|
11526
|
-
/* @__PURE__ */ q(
|
|
11537
|
+
/* @__PURE__ */ q(Cu, {
|
|
11527
11538
|
label: "Show dots",
|
|
11528
11539
|
checked: e.showDots !== !1,
|
|
11529
11540
|
onChange: (e) => t({ showDots: e })
|
|
11530
11541
|
}),
|
|
11531
|
-
/* @__PURE__ */ q(
|
|
11542
|
+
/* @__PURE__ */ q(Cu, {
|
|
11532
11543
|
label: "Slide automatically",
|
|
11533
11544
|
checked: !!e.autoplay,
|
|
11534
11545
|
onChange: (e) => t({ autoplay: e }),
|
|
@@ -11552,15 +11563,15 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11552
11563
|
})
|
|
11553
11564
|
})
|
|
11554
11565
|
]
|
|
11555
|
-
})] }),
|
|
11566
|
+
})] }), Au = ({ p: e, set: t }) => {
|
|
11556
11567
|
let n = e.url ?? "", r = n ? pn(n) : null;
|
|
11557
|
-
return /* @__PURE__ */ J(
|
|
11568
|
+
return /* @__PURE__ */ J(Su, {
|
|
11558
11569
|
title: "Video",
|
|
11559
11570
|
children: [
|
|
11560
11571
|
/* @__PURE__ */ q(Q, {
|
|
11561
11572
|
label: "Link",
|
|
11562
11573
|
children: /* @__PURE__ */ q("input", {
|
|
11563
|
-
className:
|
|
11574
|
+
className: bu,
|
|
11564
11575
|
value: n,
|
|
11565
11576
|
onChange: (e) => t({ url: e.target.value }),
|
|
11566
11577
|
placeholder: "YouTube, Vimeo or .mp4 link"
|
|
@@ -11572,7 +11583,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11572
11583
|
}),
|
|
11573
11584
|
r?.kind === "file" && /* @__PURE__ */ q(Q, {
|
|
11574
11585
|
label: "Cover",
|
|
11575
|
-
children: /* @__PURE__ */ q(
|
|
11586
|
+
children: /* @__PURE__ */ q(Tu, {
|
|
11576
11587
|
value: e.poster ?? "",
|
|
11577
11588
|
onChange: (e) => t({ poster: e })
|
|
11578
11589
|
})
|
|
@@ -11580,7 +11591,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11580
11591
|
/* @__PURE__ */ q(Q, {
|
|
11581
11592
|
label: "Shape",
|
|
11582
11593
|
children: /* @__PURE__ */ J("select", {
|
|
11583
|
-
className:
|
|
11594
|
+
className: bu,
|
|
11584
11595
|
value: e.ratio ?? "16:9",
|
|
11585
11596
|
onChange: (e) => t({ ratio: e.target.value }),
|
|
11586
11597
|
children: [
|
|
@@ -11603,20 +11614,20 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11603
11614
|
]
|
|
11604
11615
|
})
|
|
11605
11616
|
}),
|
|
11606
|
-
r?.kind === "file" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
11617
|
+
r?.kind === "file" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Cu, {
|
|
11607
11618
|
label: "Play on load (muted)",
|
|
11608
11619
|
checked: !!e.autoplay,
|
|
11609
11620
|
onChange: (e) => t({ autoplay: e })
|
|
11610
|
-
}), /* @__PURE__ */ q(
|
|
11621
|
+
}), /* @__PURE__ */ q(Cu, {
|
|
11611
11622
|
label: "Loop",
|
|
11612
11623
|
checked: !!e.loop,
|
|
11613
11624
|
onChange: (e) => t({ loop: e })
|
|
11614
11625
|
})] })
|
|
11615
11626
|
]
|
|
11616
11627
|
});
|
|
11617
|
-
},
|
|
11628
|
+
}, ju = ({ p: e, set: t }) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Su, {
|
|
11618
11629
|
title: "Links",
|
|
11619
|
-
children: /* @__PURE__ */ q(
|
|
11630
|
+
children: /* @__PURE__ */ q(wu, {
|
|
11620
11631
|
items: e.links ?? [],
|
|
11621
11632
|
onChange: (e) => t({ links: e }),
|
|
11622
11633
|
blank: () => ({
|
|
@@ -11625,7 +11636,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11625
11636
|
}),
|
|
11626
11637
|
addLabel: "Add link",
|
|
11627
11638
|
render: (e, t) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("select", {
|
|
11628
|
-
className:
|
|
11639
|
+
className: bu,
|
|
11629
11640
|
value: e.network,
|
|
11630
11641
|
onChange: (e) => t({ network: e.target.value }),
|
|
11631
11642
|
children: Object.entries(xn).map(([e, t]) => /* @__PURE__ */ q("option", {
|
|
@@ -11633,19 +11644,19 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11633
11644
|
children: t.label
|
|
11634
11645
|
}, e))
|
|
11635
11646
|
}), /* @__PURE__ */ q("input", {
|
|
11636
|
-
className:
|
|
11647
|
+
className: bu,
|
|
11637
11648
|
value: e.url,
|
|
11638
11649
|
onChange: (e) => t({ url: e.target.value }),
|
|
11639
11650
|
placeholder: e.network === "email" ? "mailto:you@example.com" : "https://…"
|
|
11640
11651
|
})] })
|
|
11641
11652
|
})
|
|
11642
|
-
}), /* @__PURE__ */ J(
|
|
11653
|
+
}), /* @__PURE__ */ J(Su, {
|
|
11643
11654
|
title: "Look",
|
|
11644
11655
|
children: [
|
|
11645
11656
|
/* @__PURE__ */ q(Q, {
|
|
11646
11657
|
label: "Style",
|
|
11647
11658
|
children: /* @__PURE__ */ J("select", {
|
|
11648
|
-
className:
|
|
11659
|
+
className: bu,
|
|
11649
11660
|
value: e.shape ?? "circle",
|
|
11650
11661
|
onChange: (e) => t({ shape: e.target.value }),
|
|
11651
11662
|
children: [
|
|
@@ -11667,7 +11678,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11667
11678
|
/* @__PURE__ */ q(Q, {
|
|
11668
11679
|
label: "Colours",
|
|
11669
11680
|
children: /* @__PURE__ */ J("select", {
|
|
11670
|
-
className:
|
|
11681
|
+
className: bu,
|
|
11671
11682
|
value: e.colorMode ?? "brand",
|
|
11672
11683
|
onChange: (e) => t({ colorMode: e.target.value }),
|
|
11673
11684
|
children: [/* @__PURE__ */ q("option", {
|
|
@@ -11691,9 +11702,9 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11691
11702
|
})
|
|
11692
11703
|
})
|
|
11693
11704
|
]
|
|
11694
|
-
})] }),
|
|
11705
|
+
})] }), Mu = ({ p: e, set: t }) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Su, {
|
|
11695
11706
|
title: "Menu items",
|
|
11696
|
-
children: /* @__PURE__ */ q(
|
|
11707
|
+
children: /* @__PURE__ */ q(wu, {
|
|
11697
11708
|
items: e.links ?? [],
|
|
11698
11709
|
onChange: (e) => t({ links: e }),
|
|
11699
11710
|
blank: () => ({
|
|
@@ -11702,22 +11713,22 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11702
11713
|
}),
|
|
11703
11714
|
addLabel: "Add menu item",
|
|
11704
11715
|
render: (e, t) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("input", {
|
|
11705
|
-
className:
|
|
11716
|
+
className: bu,
|
|
11706
11717
|
value: e.label,
|
|
11707
11718
|
onChange: (e) => t({ label: e.target.value }),
|
|
11708
11719
|
placeholder: "What it says",
|
|
11709
11720
|
"aria-label": "Menu item text"
|
|
11710
|
-
}), /* @__PURE__ */ q(
|
|
11721
|
+
}), /* @__PURE__ */ q(hu, {
|
|
11711
11722
|
value: e.href,
|
|
11712
11723
|
onChange: (e) => t({ href: e })
|
|
11713
11724
|
})] })
|
|
11714
11725
|
})
|
|
11715
|
-
}), /* @__PURE__ */ J(
|
|
11726
|
+
}), /* @__PURE__ */ J(Su, {
|
|
11716
11727
|
title: "Layout",
|
|
11717
11728
|
children: [/* @__PURE__ */ q(Q, {
|
|
11718
11729
|
label: "Direction",
|
|
11719
11730
|
children: /* @__PURE__ */ J("select", {
|
|
11720
|
-
className:
|
|
11731
|
+
className: bu,
|
|
11721
11732
|
value: e.layout ?? "horizontal",
|
|
11722
11733
|
onChange: (e) => t({ layout: e.target.value }),
|
|
11723
11734
|
children: [/* @__PURE__ */ q("option", {
|
|
@@ -11731,7 +11742,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11731
11742
|
}), /* @__PURE__ */ q(Q, {
|
|
11732
11743
|
label: "On phones",
|
|
11733
11744
|
children: /* @__PURE__ */ J("select", {
|
|
11734
|
-
className:
|
|
11745
|
+
className: bu,
|
|
11735
11746
|
value: e.mobile ?? "hamburger",
|
|
11736
11747
|
onChange: (e) => t({ mobile: e.target.value }),
|
|
11737
11748
|
children: [/* @__PURE__ */ q("option", {
|
|
@@ -11743,11 +11754,11 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11743
11754
|
})]
|
|
11744
11755
|
})
|
|
11745
11756
|
})]
|
|
11746
|
-
})] }),
|
|
11757
|
+
})] }), Nu = ({ p: e, set: t }) => /* @__PURE__ */ J(Su, {
|
|
11747
11758
|
title: "Embed code",
|
|
11748
11759
|
children: [
|
|
11749
11760
|
/* @__PURE__ */ q("textarea", {
|
|
11750
|
-
className: `${
|
|
11761
|
+
className: `${bu} font-mono min-h-[140px] select-text`,
|
|
11751
11762
|
value: e.code ?? "",
|
|
11752
11763
|
onChange: (e) => t({ code: e.target.value }),
|
|
11753
11764
|
placeholder: "Paste the embed code from your booking, map, form or video tool",
|
|
@@ -11760,27 +11771,27 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11760
11771
|
/* @__PURE__ */ q(Q, {
|
|
11761
11772
|
label: "Title",
|
|
11762
11773
|
children: /* @__PURE__ */ q("input", {
|
|
11763
|
-
className:
|
|
11774
|
+
className: bu,
|
|
11764
11775
|
value: e.title ?? "",
|
|
11765
11776
|
onChange: (e) => t({ title: e.target.value }),
|
|
11766
11777
|
placeholder: "Describes it for screen readers"
|
|
11767
11778
|
})
|
|
11768
11779
|
})
|
|
11769
11780
|
]
|
|
11770
|
-
}),
|
|
11781
|
+
}), Pu = ({ p: e, set: t }) => {
|
|
11771
11782
|
let n = e.rows?.length ? e.rows : [[""]], r = Math.max(...n.map((e) => e.length)), i = (e, i, a) => t({ rows: n.map((t, n) => n === e ? Array.from({ length: r }, (e, n) => n === i ? a : t[n] ?? "") : t) });
|
|
11772
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(
|
|
11783
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(Su, {
|
|
11773
11784
|
title: "Cells",
|
|
11774
11785
|
children: [/* @__PURE__ */ q("div", {
|
|
11775
11786
|
className: "overflow-x-auto",
|
|
11776
11787
|
children: /* @__PURE__ */ q("table", {
|
|
11777
11788
|
className: "border-separate border-spacing-1",
|
|
11778
11789
|
children: /* @__PURE__ */ q("tbody", { children: n.map((a, o) => /* @__PURE__ */ J("tr", { children: [Array.from({ length: r }, (t, n) => /* @__PURE__ */ q("td", { children: /* @__PURE__ */ q("input", {
|
|
11779
|
-
className: `${
|
|
11790
|
+
className: `${bu} min-w-[72px] ${o === 0 && e.headerRow !== !1 ? "font-semibold" : ""}`,
|
|
11780
11791
|
value: a[n] ?? "",
|
|
11781
11792
|
onChange: (e) => i(o, n, e.target.value)
|
|
11782
11793
|
}) }, n)), /* @__PURE__ */ q("td", { children: /* @__PURE__ */ q("button", {
|
|
11783
|
-
className:
|
|
11794
|
+
className: xu,
|
|
11784
11795
|
disabled: n.length <= 1,
|
|
11785
11796
|
onClick: () => t({ rows: n.filter((e, t) => t !== o) }),
|
|
11786
11797
|
"aria-label": "Remove row",
|
|
@@ -11808,32 +11819,32 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11808
11819
|
})
|
|
11809
11820
|
]
|
|
11810
11821
|
})]
|
|
11811
|
-
}), /* @__PURE__ */ J(
|
|
11822
|
+
}), /* @__PURE__ */ J(Su, {
|
|
11812
11823
|
title: "Look",
|
|
11813
|
-
children: [/* @__PURE__ */ q(
|
|
11824
|
+
children: [/* @__PURE__ */ q(Cu, {
|
|
11814
11825
|
label: "First row is a heading",
|
|
11815
11826
|
checked: e.headerRow !== !1,
|
|
11816
11827
|
onChange: (e) => t({ headerRow: e })
|
|
11817
|
-
}), /* @__PURE__ */ q(
|
|
11828
|
+
}), /* @__PURE__ */ q(Cu, {
|
|
11818
11829
|
label: "Shade every other row",
|
|
11819
11830
|
checked: e.striped !== !1,
|
|
11820
11831
|
onChange: (e) => t({ striped: e })
|
|
11821
11832
|
})]
|
|
11822
11833
|
})] });
|
|
11823
|
-
},
|
|
11834
|
+
}, Fu = (e) => {
|
|
11824
11835
|
let t = new Date(e ?? "");
|
|
11825
11836
|
if (Number.isNaN(t.getTime())) return "";
|
|
11826
11837
|
let n = (e) => String(e).padStart(2, "0");
|
|
11827
11838
|
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`;
|
|
11828
|
-
},
|
|
11839
|
+
}, Iu = ({ p: e, set: t }) => /* @__PURE__ */ J(Su, {
|
|
11829
11840
|
title: "Countdown",
|
|
11830
11841
|
children: [
|
|
11831
11842
|
/* @__PURE__ */ q(Q, {
|
|
11832
11843
|
label: "Ends at",
|
|
11833
11844
|
children: /* @__PURE__ */ q("input", {
|
|
11834
11845
|
type: "datetime-local",
|
|
11835
|
-
className:
|
|
11836
|
-
value:
|
|
11846
|
+
className: bu,
|
|
11847
|
+
value: Fu(e.target),
|
|
11837
11848
|
onChange: (e) => e.target.value && t({ target: new Date(e.target.value).toISOString() })
|
|
11838
11849
|
})
|
|
11839
11850
|
}),
|
|
@@ -11844,26 +11855,26 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11844
11855
|
/* @__PURE__ */ q(Q, {
|
|
11845
11856
|
label: "When over",
|
|
11846
11857
|
children: /* @__PURE__ */ q("input", {
|
|
11847
|
-
className:
|
|
11858
|
+
className: bu,
|
|
11848
11859
|
value: e.expiredMessage ?? "",
|
|
11849
11860
|
onChange: (e) => t({ expiredMessage: e.target.value }),
|
|
11850
11861
|
placeholder: "This offer has ended"
|
|
11851
11862
|
})
|
|
11852
11863
|
}),
|
|
11853
|
-
/* @__PURE__ */ q(
|
|
11864
|
+
/* @__PURE__ */ q(Cu, {
|
|
11854
11865
|
label: "Show Days / Hours / Minutes labels",
|
|
11855
11866
|
checked: e.showLabels !== !1,
|
|
11856
11867
|
onChange: (e) => t({ showLabels: e })
|
|
11857
11868
|
})
|
|
11858
11869
|
]
|
|
11859
|
-
}),
|
|
11870
|
+
}), Lu = [
|
|
11860
11871
|
["text", "Short answer"],
|
|
11861
11872
|
["email", "Email"],
|
|
11862
11873
|
["tel", "Phone"],
|
|
11863
11874
|
["textarea", "Long answer"],
|
|
11864
11875
|
["select", "Dropdown"],
|
|
11865
11876
|
["checkbox", "Checkbox"]
|
|
11866
|
-
],
|
|
11877
|
+
], Ru = ({ node: e, p: t, set: n }) => {
|
|
11867
11878
|
let r = Y(), i = Sn(t.action, e.id, {
|
|
11868
11879
|
apiKey: r.apiKey,
|
|
11869
11880
|
templateId: r.templateId,
|
|
@@ -11882,9 +11893,9 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11882
11893
|
text: "This form has nowhere to send messages yet. Add an address below."
|
|
11883
11894
|
};
|
|
11884
11895
|
return /* @__PURE__ */ J(K, { children: [
|
|
11885
|
-
/* @__PURE__ */ q(
|
|
11896
|
+
/* @__PURE__ */ q(Su, {
|
|
11886
11897
|
title: "Fields",
|
|
11887
|
-
children: /* @__PURE__ */ q(
|
|
11898
|
+
children: /* @__PURE__ */ q(wu, {
|
|
11888
11899
|
items: t.fields ?? [],
|
|
11889
11900
|
min: 1,
|
|
11890
11901
|
onChange: (e) => n({ fields: e }),
|
|
@@ -11896,16 +11907,16 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11896
11907
|
addLabel: "Add field",
|
|
11897
11908
|
render: (e, t) => /* @__PURE__ */ J(K, { children: [
|
|
11898
11909
|
/* @__PURE__ */ q("input", {
|
|
11899
|
-
className:
|
|
11910
|
+
className: bu,
|
|
11900
11911
|
value: e.label,
|
|
11901
11912
|
onChange: (e) => t({ label: e.target.value }),
|
|
11902
11913
|
placeholder: "Question"
|
|
11903
11914
|
}),
|
|
11904
11915
|
/* @__PURE__ */ q("select", {
|
|
11905
|
-
className:
|
|
11916
|
+
className: bu,
|
|
11906
11917
|
value: e.type,
|
|
11907
11918
|
onChange: (e) => t({ type: e.target.value }),
|
|
11908
|
-
children:
|
|
11919
|
+
children: Lu.map(([e, t]) => /* @__PURE__ */ q("option", {
|
|
11909
11920
|
value: e,
|
|
11910
11921
|
children: t
|
|
11911
11922
|
}, e))
|
|
@@ -11923,7 +11934,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11923
11934
|
onChange: (e) => t({ placeholder: e.target.value }),
|
|
11924
11935
|
placeholder: "Hint text (optional)"
|
|
11925
11936
|
}),
|
|
11926
|
-
/* @__PURE__ */ q(
|
|
11937
|
+
/* @__PURE__ */ q(Cu, {
|
|
11927
11938
|
label: "Required",
|
|
11928
11939
|
checked: !!e.required,
|
|
11929
11940
|
onChange: (e) => t({ required: e })
|
|
@@ -11931,12 +11942,12 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11931
11942
|
] })
|
|
11932
11943
|
})
|
|
11933
11944
|
}),
|
|
11934
|
-
/* @__PURE__ */ J(
|
|
11945
|
+
/* @__PURE__ */ J(Su, {
|
|
11935
11946
|
title: "After sending",
|
|
11936
11947
|
children: [/* @__PURE__ */ q(Q, {
|
|
11937
11948
|
label: "Button",
|
|
11938
11949
|
children: /* @__PURE__ */ q("input", {
|
|
11939
|
-
className:
|
|
11950
|
+
className: bu,
|
|
11940
11951
|
value: t.submitLabel ?? "",
|
|
11941
11952
|
onChange: (e) => n({ submitLabel: e.target.value }),
|
|
11942
11953
|
placeholder: "Send message"
|
|
@@ -11944,14 +11955,14 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11944
11955
|
}), /* @__PURE__ */ q(Q, {
|
|
11945
11956
|
label: "Thank-you",
|
|
11946
11957
|
children: /* @__PURE__ */ q("input", {
|
|
11947
|
-
className:
|
|
11958
|
+
className: bu,
|
|
11948
11959
|
value: t.successMessage ?? "",
|
|
11949
11960
|
onChange: (e) => n({ successMessage: e.target.value }),
|
|
11950
11961
|
placeholder: "Thanks! We got your message."
|
|
11951
11962
|
})
|
|
11952
11963
|
})]
|
|
11953
11964
|
}),
|
|
11954
|
-
/* @__PURE__ */ J(
|
|
11965
|
+
/* @__PURE__ */ J(Su, {
|
|
11955
11966
|
title: "Send button look",
|
|
11956
11967
|
children: [
|
|
11957
11968
|
/* @__PURE__ */ q(Q, {
|
|
@@ -11985,7 +11996,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
11985
11996
|
/* @__PURE__ */ q(Q, {
|
|
11986
11997
|
label: "Corners",
|
|
11987
11998
|
children: /* @__PURE__ */ J("select", {
|
|
11988
|
-
className:
|
|
11999
|
+
className: bu,
|
|
11989
12000
|
value: t.buttonRadius ?? "",
|
|
11990
12001
|
onChange: (e) => n({ buttonRadius: e.target.value || void 0 }),
|
|
11991
12002
|
children: [
|
|
@@ -12014,22 +12025,22 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12014
12025
|
})
|
|
12015
12026
|
]
|
|
12016
12027
|
}),
|
|
12017
|
-
/* @__PURE__ */ J(
|
|
12028
|
+
/* @__PURE__ */ J(Su, {
|
|
12018
12029
|
title: "Where messages go",
|
|
12019
12030
|
children: [/* @__PURE__ */ q("p", {
|
|
12020
12031
|
className: `text-[11px] leading-snug ${a.ok ? "text-px-muted" : "text-amber-300"}`,
|
|
12021
12032
|
children: a.text
|
|
12022
12033
|
}), /* @__PURE__ */ q("input", {
|
|
12023
|
-
className:
|
|
12034
|
+
className: bu,
|
|
12024
12035
|
value: t.action ?? "",
|
|
12025
12036
|
onChange: (e) => n({ action: e.target.value }),
|
|
12026
12037
|
placeholder: i.kind === "custom" ? "" : "Use a different address (optional)"
|
|
12027
12038
|
})]
|
|
12028
12039
|
})
|
|
12029
12040
|
] });
|
|
12030
|
-
},
|
|
12041
|
+
}, zu = ({ p: e, set: t }) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Su, {
|
|
12031
12042
|
title: "Questions",
|
|
12032
|
-
children: /* @__PURE__ */ q(
|
|
12043
|
+
children: /* @__PURE__ */ q(wu, {
|
|
12033
12044
|
items: e.items ?? [],
|
|
12034
12045
|
onChange: (e) => t({ items: e }),
|
|
12035
12046
|
blank: () => ({
|
|
@@ -12038,37 +12049,37 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12038
12049
|
}),
|
|
12039
12050
|
addLabel: "Add question",
|
|
12040
12051
|
render: (e, t) => /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("input", {
|
|
12041
|
-
className:
|
|
12052
|
+
className: bu,
|
|
12042
12053
|
value: e.title,
|
|
12043
12054
|
onChange: (e) => t({ title: e.target.value }),
|
|
12044
12055
|
placeholder: "Question"
|
|
12045
12056
|
}), /* @__PURE__ */ q("textarea", {
|
|
12046
|
-
className: `${
|
|
12057
|
+
className: `${bu} select-text`,
|
|
12047
12058
|
rows: 3,
|
|
12048
12059
|
value: e.content,
|
|
12049
12060
|
onChange: (e) => t({ content: e.target.value }),
|
|
12050
12061
|
placeholder: "Answer"
|
|
12051
12062
|
})] })
|
|
12052
12063
|
})
|
|
12053
|
-
}), /* @__PURE__ */ J(
|
|
12064
|
+
}), /* @__PURE__ */ J(Su, {
|
|
12054
12065
|
title: "Behaviour",
|
|
12055
|
-
children: [/* @__PURE__ */ q(
|
|
12066
|
+
children: [/* @__PURE__ */ q(Cu, {
|
|
12056
12067
|
label: "Open the first one",
|
|
12057
12068
|
checked: e.openFirst !== !1,
|
|
12058
12069
|
onChange: (e) => t({ openFirst: e })
|
|
12059
|
-
}), /* @__PURE__ */ q(
|
|
12070
|
+
}), /* @__PURE__ */ q(Cu, {
|
|
12060
12071
|
label: "Allow several open at once",
|
|
12061
12072
|
checked: !!e.allowMultiple,
|
|
12062
12073
|
onChange: (e) => t({ allowMultiple: e })
|
|
12063
12074
|
})]
|
|
12064
|
-
})] }),
|
|
12075
|
+
})] }), Bu = (e) => e.trim() && Number.isFinite(Number(e)) ? Math.max(1, Math.round(Number(e))) : void 0, Vu = [
|
|
12065
12076
|
"",
|
|
12066
12077
|
"best_seller",
|
|
12067
12078
|
"most_recent"
|
|
12068
|
-
],
|
|
12069
|
-
let r = (t) => mn(e, t), i = t.category ?? "", a =
|
|
12079
|
+
], Hu = ({ type: e, p: t, set: n }) => {
|
|
12080
|
+
let r = (t) => mn(e, t), i = t.category ?? "", a = Vu.includes(i) ? i : "category", o = e === "shopGrid" && t.storeMode === !1;
|
|
12070
12081
|
return /* @__PURE__ */ J(K, { children: [
|
|
12071
|
-
/* @__PURE__ */ J(
|
|
12082
|
+
/* @__PURE__ */ J(Su, {
|
|
12072
12083
|
title: qt(e),
|
|
12073
12084
|
children: [
|
|
12074
12085
|
/* @__PURE__ */ q("p", {
|
|
@@ -12112,9 +12123,9 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12112
12123
|
]
|
|
12113
12124
|
})
|
|
12114
12125
|
}),
|
|
12115
|
-
t.mode !== "detail" && /* @__PURE__ */ q(
|
|
12126
|
+
t.mode !== "detail" && /* @__PURE__ */ q(Su, {
|
|
12116
12127
|
title: "Product to sell",
|
|
12117
|
-
children: /* @__PURE__ */ q(
|
|
12128
|
+
children: /* @__PURE__ */ q(yu, {
|
|
12118
12129
|
value: t.productId ?? "",
|
|
12119
12130
|
onChange: (e) => n({ productId: e })
|
|
12120
12131
|
})
|
|
@@ -12135,10 +12146,10 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12135
12146
|
})
|
|
12136
12147
|
]
|
|
12137
12148
|
}),
|
|
12138
|
-
e === "shopGrid" && /* @__PURE__ */ J(
|
|
12149
|
+
e === "shopGrid" && /* @__PURE__ */ J(Su, {
|
|
12139
12150
|
title: "Layout",
|
|
12140
12151
|
children: [
|
|
12141
|
-
/* @__PURE__ */ q(
|
|
12152
|
+
/* @__PURE__ */ q(Cu, {
|
|
12142
12153
|
label: "Full shop with search and filters",
|
|
12143
12154
|
checked: t.storeMode !== !1,
|
|
12144
12155
|
onChange: (e) => n({ storeMode: e }),
|
|
@@ -12149,7 +12160,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12149
12160
|
children: /* @__PURE__ */ q("select", {
|
|
12150
12161
|
className: "w-full bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent",
|
|
12151
12162
|
value: String(t.itemsPerRow ?? 3),
|
|
12152
|
-
onChange: (e) => n({ itemsPerRow:
|
|
12163
|
+
onChange: (e) => n({ itemsPerRow: Bu(e.target.value) }),
|
|
12153
12164
|
children: [
|
|
12154
12165
|
1,
|
|
12155
12166
|
2,
|
|
@@ -12163,7 +12174,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12163
12174
|
}, e))
|
|
12164
12175
|
})
|
|
12165
12176
|
}),
|
|
12166
|
-
/* @__PURE__ */ q(
|
|
12177
|
+
/* @__PURE__ */ q(Cu, {
|
|
12167
12178
|
label: "Dark cards",
|
|
12168
12179
|
checked: t.mode === "dark",
|
|
12169
12180
|
onChange: (e) => n({ mode: e ? "dark" : "" })
|
|
@@ -12212,11 +12223,11 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12212
12223
|
min: 1,
|
|
12213
12224
|
max: 96,
|
|
12214
12225
|
value: t.limit ?? "",
|
|
12215
|
-
onChange: (e) => n({ limit:
|
|
12226
|
+
onChange: (e) => n({ limit: Bu(e.target.value) }),
|
|
12216
12227
|
placeholder: "6"
|
|
12217
12228
|
})
|
|
12218
12229
|
}),
|
|
12219
|
-
/* @__PURE__ */ q(
|
|
12230
|
+
/* @__PURE__ */ q(Cu, {
|
|
12220
12231
|
label: "Split into pages",
|
|
12221
12232
|
checked: !!t.paginated,
|
|
12222
12233
|
onChange: (e) => n({ paginated: e })
|
|
@@ -12229,14 +12240,14 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12229
12240
|
min: 1,
|
|
12230
12241
|
max: 96,
|
|
12231
12242
|
value: t.itemsPerPage ?? "",
|
|
12232
|
-
onChange: (e) => n({ itemsPerPage:
|
|
12243
|
+
onChange: (e) => n({ itemsPerPage: Bu(e.target.value) }),
|
|
12233
12244
|
placeholder: "12"
|
|
12234
12245
|
})
|
|
12235
12246
|
})
|
|
12236
12247
|
] })
|
|
12237
12248
|
]
|
|
12238
12249
|
}),
|
|
12239
|
-
e === "contentList" && /* @__PURE__ */ J(
|
|
12250
|
+
e === "contentList" && /* @__PURE__ */ J(Su, {
|
|
12240
12251
|
title: "What to show",
|
|
12241
12252
|
children: [
|
|
12242
12253
|
/* @__PURE__ */ q(Q, {
|
|
@@ -12288,7 +12299,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12288
12299
|
children: /* @__PURE__ */ q("select", {
|
|
12289
12300
|
className: "w-full bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent",
|
|
12290
12301
|
value: String(t.itemsPerRow ?? 3),
|
|
12291
|
-
onChange: (e) => n({ itemsPerRow:
|
|
12302
|
+
onChange: (e) => n({ itemsPerRow: Bu(e.target.value) }),
|
|
12292
12303
|
children: [
|
|
12293
12304
|
1,
|
|
12294
12305
|
2,
|
|
@@ -12308,13 +12319,13 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12308
12319
|
min: 1,
|
|
12309
12320
|
max: 96,
|
|
12310
12321
|
value: t.limit ?? "",
|
|
12311
|
-
onChange: (e) => n({ limit:
|
|
12322
|
+
onChange: (e) => n({ limit: Bu(e.target.value) }),
|
|
12312
12323
|
placeholder: "All"
|
|
12313
12324
|
})
|
|
12314
12325
|
})
|
|
12315
12326
|
]
|
|
12316
12327
|
}),
|
|
12317
|
-
e === "signupForm" && /* @__PURE__ */ J(
|
|
12328
|
+
e === "signupForm" && /* @__PURE__ */ J(Su, {
|
|
12318
12329
|
title: "Connection",
|
|
12319
12330
|
children: [/* @__PURE__ */ q("p", {
|
|
12320
12331
|
className: "text-[11px] text-px-muted leading-snug",
|
|
@@ -12330,64 +12341,64 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12330
12341
|
})]
|
|
12331
12342
|
})
|
|
12332
12343
|
] });
|
|
12333
|
-
},
|
|
12344
|
+
}, Uu = ({ node: e }) => {
|
|
12334
12345
|
let { updateNodeProps: t } = Z();
|
|
12335
12346
|
if (!Cr(e.type)) return null;
|
|
12336
12347
|
let n = e.props ?? {}, r = (n) => t(e.id, n);
|
|
12337
12348
|
return /* @__PURE__ */ J("div", {
|
|
12338
12349
|
className: "p-3 space-y-4 border-b border-px-line",
|
|
12339
12350
|
children: [
|
|
12340
|
-
e.type === "icon" && /* @__PURE__ */ q(
|
|
12351
|
+
e.type === "icon" && /* @__PURE__ */ q(Ou, {
|
|
12341
12352
|
node: e,
|
|
12342
12353
|
p: n,
|
|
12343
12354
|
set: r
|
|
12344
12355
|
}),
|
|
12345
|
-
e.type === "carousel" && /* @__PURE__ */ q(
|
|
12356
|
+
e.type === "carousel" && /* @__PURE__ */ q(ku, {
|
|
12346
12357
|
p: n,
|
|
12347
12358
|
set: r
|
|
12348
12359
|
}),
|
|
12349
|
-
e.type === "video" && /* @__PURE__ */ q(
|
|
12360
|
+
e.type === "video" && /* @__PURE__ */ q(Au, {
|
|
12350
12361
|
p: n,
|
|
12351
12362
|
set: r
|
|
12352
12363
|
}),
|
|
12353
|
-
e.type === "social" && /* @__PURE__ */ q(
|
|
12364
|
+
e.type === "social" && /* @__PURE__ */ q(ju, {
|
|
12354
12365
|
p: n,
|
|
12355
12366
|
set: r
|
|
12356
12367
|
}),
|
|
12357
|
-
e.type === "menu" && /* @__PURE__ */ q(
|
|
12368
|
+
e.type === "menu" && /* @__PURE__ */ q(Mu, {
|
|
12358
12369
|
p: n,
|
|
12359
12370
|
set: r
|
|
12360
12371
|
}),
|
|
12361
|
-
e.type === "html" && /* @__PURE__ */ q(
|
|
12372
|
+
e.type === "html" && /* @__PURE__ */ q(Nu, {
|
|
12362
12373
|
p: n,
|
|
12363
12374
|
set: r
|
|
12364
12375
|
}),
|
|
12365
|
-
e.type === "table" && /* @__PURE__ */ q(
|
|
12376
|
+
e.type === "table" && /* @__PURE__ */ q(Pu, {
|
|
12366
12377
|
p: n,
|
|
12367
12378
|
set: r
|
|
12368
12379
|
}),
|
|
12369
|
-
e.type === "timer" && /* @__PURE__ */ q(
|
|
12380
|
+
e.type === "timer" && /* @__PURE__ */ q(Iu, {
|
|
12370
12381
|
p: n,
|
|
12371
12382
|
set: r
|
|
12372
12383
|
}),
|
|
12373
|
-
e.type === "form" && /* @__PURE__ */ q(
|
|
12384
|
+
e.type === "form" && /* @__PURE__ */ q(Ru, {
|
|
12374
12385
|
node: e,
|
|
12375
12386
|
p: n,
|
|
12376
12387
|
set: r
|
|
12377
12388
|
}),
|
|
12378
|
-
e.type === "accordion" && /* @__PURE__ */ q(
|
|
12389
|
+
e.type === "accordion" && /* @__PURE__ */ q(zu, {
|
|
12379
12390
|
p: n,
|
|
12380
12391
|
set: r
|
|
12381
12392
|
}),
|
|
12382
|
-
$n(e.type) && /* @__PURE__ */ q(
|
|
12393
|
+
$n(e.type) && /* @__PURE__ */ q(Hu, {
|
|
12383
12394
|
type: e.type,
|
|
12384
12395
|
p: n,
|
|
12385
12396
|
set: r
|
|
12386
12397
|
})
|
|
12387
12398
|
]
|
|
12388
12399
|
});
|
|
12389
|
-
},
|
|
12390
|
-
let [n, r] = G(!1), [i, a] = G(""), o = Object.values(Ht).flat().filter((e, t, n) => n.indexOf(e) === t && (!i ||
|
|
12400
|
+
}, Wu = (e) => e.replace(/-/g, " "), Gu = ({ value: e, onChange: t }) => {
|
|
12401
|
+
let [n, r] = G(!1), [i, a] = G(""), o = Object.values(Ht).flat().filter((e, t, n) => n.indexOf(e) === t && (!i || Wu(e).includes(i.toLowerCase()))), s = (e) => /* @__PURE__ */ q("svg", {
|
|
12391
12402
|
width: 18,
|
|
12392
12403
|
height: 18,
|
|
12393
12404
|
viewBox: "0 0 24 24",
|
|
@@ -12413,7 +12424,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12413
12424
|
s(e),
|
|
12414
12425
|
/* @__PURE__ */ q("span", {
|
|
12415
12426
|
className: "capitalize",
|
|
12416
|
-
children:
|
|
12427
|
+
children: Wu(e || "star")
|
|
12417
12428
|
}),
|
|
12418
12429
|
/* @__PURE__ */ q("span", {
|
|
12419
12430
|
className: "text-px-faint",
|
|
@@ -12432,8 +12443,8 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12432
12443
|
className: "grid grid-cols-7 gap-1 max-h-36 overflow-y-auto",
|
|
12433
12444
|
children: o.map((n) => /* @__PURE__ */ q("button", {
|
|
12434
12445
|
type: "button",
|
|
12435
|
-
title:
|
|
12436
|
-
"aria-label":
|
|
12446
|
+
title: Wu(n),
|
|
12447
|
+
"aria-label": Wu(n),
|
|
12437
12448
|
"aria-pressed": n === e,
|
|
12438
12449
|
onClick: () => {
|
|
12439
12450
|
t(n), r(!1);
|
|
@@ -12444,7 +12455,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12444
12455
|
})]
|
|
12445
12456
|
})]
|
|
12446
12457
|
});
|
|
12447
|
-
},
|
|
12458
|
+
}, Ku = ({ fields: e, get: t, put: n }) => /* @__PURE__ */ q("div", {
|
|
12448
12459
|
className: "space-y-3",
|
|
12449
12460
|
children: e.map((e) => {
|
|
12450
12461
|
let r = t(e.key);
|
|
@@ -12475,7 +12486,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12475
12486
|
onChange: (t) => n(e.key, t.target.value),
|
|
12476
12487
|
"aria-label": e.label
|
|
12477
12488
|
}),
|
|
12478
|
-
e.type === "link" && /* @__PURE__ */ q(
|
|
12489
|
+
e.type === "link" && /* @__PURE__ */ q(hu, {
|
|
12479
12490
|
compact: !0,
|
|
12480
12491
|
value: typeof r == "string" ? r : "",
|
|
12481
12492
|
onChange: (t) => n(e.key, t)
|
|
@@ -12491,7 +12502,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12491
12502
|
}),
|
|
12492
12503
|
placeholder: "Button text (empty hides it)",
|
|
12493
12504
|
"aria-label": `${e.label} text`
|
|
12494
|
-
}), /* @__PURE__ */ q(
|
|
12505
|
+
}), /* @__PURE__ */ q(hu, {
|
|
12495
12506
|
compact: !0,
|
|
12496
12507
|
value: r?.href ?? "",
|
|
12497
12508
|
onChange: (t) => n(e.key, {
|
|
@@ -12502,7 +12513,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12502
12513
|
}),
|
|
12503
12514
|
e.type === "image" && /* @__PURE__ */ J("div", {
|
|
12504
12515
|
className: "space-y-1.5",
|
|
12505
|
-
children: [/* @__PURE__ */ q(
|
|
12516
|
+
children: [/* @__PURE__ */ q(Tu, {
|
|
12506
12517
|
value: typeof r == "string" ? r : "",
|
|
12507
12518
|
onChange: (t) => n(e.key, t)
|
|
12508
12519
|
}), r ? /* @__PURE__ */ q("input", {
|
|
@@ -12513,15 +12524,15 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12513
12524
|
"aria-label": `${e.label} description`
|
|
12514
12525
|
}) : null]
|
|
12515
12526
|
}),
|
|
12516
|
-
e.type === "icon" && /* @__PURE__ */ q(
|
|
12527
|
+
e.type === "icon" && /* @__PURE__ */ q(Gu, {
|
|
12517
12528
|
value: typeof r == "string" ? r : "",
|
|
12518
12529
|
onChange: (t) => n(e.key, t)
|
|
12519
12530
|
}),
|
|
12520
|
-
e.type === "product" && /* @__PURE__ */ q(
|
|
12531
|
+
e.type === "product" && /* @__PURE__ */ q(yu, {
|
|
12521
12532
|
value: typeof r == "string" ? r : "",
|
|
12522
12533
|
onChange: (t) => n(e.key, t)
|
|
12523
12534
|
}),
|
|
12524
|
-
e.type === "toggle" && /* @__PURE__ */ q(
|
|
12535
|
+
e.type === "toggle" && /* @__PURE__ */ q(Cu, {
|
|
12525
12536
|
label: e.label,
|
|
12526
12537
|
checked: !!r,
|
|
12527
12538
|
onChange: (t) => n(e.key, t)
|
|
@@ -12536,7 +12547,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12536
12547
|
children: t
|
|
12537
12548
|
}, e))
|
|
12538
12549
|
}),
|
|
12539
|
-
e.type === "list" && /* @__PURE__ */ q(
|
|
12550
|
+
e.type === "list" && /* @__PURE__ */ q(wu, {
|
|
12540
12551
|
items: Array.isArray(r) ? r : [],
|
|
12541
12552
|
min: e.min ?? 0,
|
|
12542
12553
|
onChange: (t) => n(e.key, e.limit ? t.slice(0, e.limit) : t),
|
|
@@ -12545,7 +12556,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12545
12556
|
href: ""
|
|
12546
12557
|
} : e.type === "toggle" ? !1 : e.type === "icon" ? "star" : ""])),
|
|
12547
12558
|
addLabel: `Add ${e.itemName ?? "item"}`,
|
|
12548
|
-
render: (t, n) => /* @__PURE__ */ q(
|
|
12559
|
+
render: (t, n) => /* @__PURE__ */ q(Ku, {
|
|
12549
12560
|
fields: e.item ?? [],
|
|
12550
12561
|
get: (e) => t[e],
|
|
12551
12562
|
put: (e, t) => n({ [e]: t })
|
|
@@ -12558,7 +12569,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12558
12569
|
]
|
|
12559
12570
|
}, e.key);
|
|
12560
12571
|
})
|
|
12561
|
-
}),
|
|
12572
|
+
}), qu = [
|
|
12562
12573
|
["canvas", "Page"],
|
|
12563
12574
|
["surface", "Card"],
|
|
12564
12575
|
["sunken", "Soft"],
|
|
@@ -12566,7 +12577,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12566
12577
|
["inverted", "Dark"],
|
|
12567
12578
|
["gradient", "Gradient"],
|
|
12568
12579
|
["image", "Picture"]
|
|
12569
|
-
],
|
|
12580
|
+
], Ju = ({ label: e, children: t }) => /* @__PURE__ */ J("div", {
|
|
12570
12581
|
role: "group",
|
|
12571
12582
|
"aria-label": e,
|
|
12572
12583
|
className: "flex items-center gap-2",
|
|
@@ -12578,7 +12589,7 @@ var wu = ({ value: e, onChange: t }) => {
|
|
|
12578
12589
|
children: t
|
|
12579
12590
|
})]
|
|
12580
12591
|
});
|
|
12581
|
-
function
|
|
12592
|
+
function Yu({ value: e, options: t, onChange: n, label: r }) {
|
|
12582
12593
|
return /* @__PURE__ */ q("div", {
|
|
12583
12594
|
role: "radiogroup",
|
|
12584
12595
|
"aria-label": r,
|
|
@@ -12593,7 +12604,7 @@ function Ju({ value: e, options: t, onChange: n, label: r }) {
|
|
|
12593
12604
|
}, t))
|
|
12594
12605
|
});
|
|
12595
12606
|
}
|
|
12596
|
-
var
|
|
12607
|
+
var Xu = ({ node: e }) => {
|
|
12597
12608
|
let { setSectionVariant: t, setSectionContent: n, setSectionStyle: r, detachSection: i, resetSectionTweaks: a, moveNodeUp: o, moveNodeDown: s, duplicateNode: c, deleteNode: l } = Z(), u = gn(e);
|
|
12598
12609
|
if (!u) return null;
|
|
12599
12610
|
let d = Dr(u.kind), f = d.variants.find((e) => e.id === u.variant) ?? d.variants[0], p = d.fields.filter((e) => !f.uses || f.uses.includes(e.key)), m = u.style ?? {}, h = Hn(e), g = (t, r) => n(e.id, t, r), _ = "flex items-center justify-center w-7 h-7 rounded-md text-px-text2 hover:text-white hover:bg-px-line2 cursor-pointer transition-colors";
|
|
@@ -12650,7 +12661,7 @@ var Yu = ({ node: e }) => {
|
|
|
12650
12661
|
]
|
|
12651
12662
|
})]
|
|
12652
12663
|
}),
|
|
12653
|
-
d.variants.length > 1 && /* @__PURE__ */ q(
|
|
12664
|
+
d.variants.length > 1 && /* @__PURE__ */ q(Su, {
|
|
12654
12665
|
title: "Layout",
|
|
12655
12666
|
children: /* @__PURE__ */ q("div", {
|
|
12656
12667
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -12681,45 +12692,45 @@ var Yu = ({ node: e }) => {
|
|
|
12681
12692
|
}, n.id))
|
|
12682
12693
|
})
|
|
12683
12694
|
}),
|
|
12684
|
-
/* @__PURE__ */ q(
|
|
12695
|
+
/* @__PURE__ */ q(Su, {
|
|
12685
12696
|
title: "Words and pictures",
|
|
12686
|
-
children: /* @__PURE__ */ q(
|
|
12697
|
+
children: /* @__PURE__ */ q(Ku, {
|
|
12687
12698
|
fields: p,
|
|
12688
12699
|
get: (e) => u.content[e],
|
|
12689
12700
|
put: g
|
|
12690
12701
|
})
|
|
12691
12702
|
}),
|
|
12692
|
-
/* @__PURE__ */ J(
|
|
12703
|
+
/* @__PURE__ */ J(Su, {
|
|
12693
12704
|
title: "Look",
|
|
12694
12705
|
children: [
|
|
12695
|
-
/* @__PURE__ */ q(
|
|
12706
|
+
/* @__PURE__ */ q(Ju, {
|
|
12696
12707
|
label: "Background",
|
|
12697
|
-
children: /* @__PURE__ */ q(
|
|
12708
|
+
children: /* @__PURE__ */ q(Yu, {
|
|
12698
12709
|
label: "Background",
|
|
12699
12710
|
value: m.background ?? f.backgrounds?.[0] ?? "canvas",
|
|
12700
|
-
options:
|
|
12711
|
+
options: qu,
|
|
12701
12712
|
onChange: (t) => r(e.id, { background: t })
|
|
12702
12713
|
})
|
|
12703
12714
|
}),
|
|
12704
|
-
(m.background ?? f.backgrounds?.[0]) === "image" && /* @__PURE__ */ q(
|
|
12715
|
+
(m.background ?? f.backgrounds?.[0]) === "image" && /* @__PURE__ */ q(Ju, {
|
|
12705
12716
|
label: "Picture",
|
|
12706
|
-
children: /* @__PURE__ */ q(
|
|
12717
|
+
children: /* @__PURE__ */ q(Tu, {
|
|
12707
12718
|
value: m.image ?? "",
|
|
12708
12719
|
onChange: (t) => r(e.id, { image: t })
|
|
12709
12720
|
})
|
|
12710
12721
|
}),
|
|
12711
|
-
/* @__PURE__ */ q(
|
|
12722
|
+
/* @__PURE__ */ q(Ju, {
|
|
12712
12723
|
label: "Align",
|
|
12713
|
-
children: /* @__PURE__ */ q(
|
|
12724
|
+
children: /* @__PURE__ */ q(Yu, {
|
|
12714
12725
|
label: "Alignment",
|
|
12715
12726
|
value: m.align ?? "left",
|
|
12716
12727
|
options: [["left", "Left"], ["center", "Centre"]],
|
|
12717
12728
|
onChange: (t) => r(e.id, { align: t })
|
|
12718
12729
|
})
|
|
12719
12730
|
}),
|
|
12720
|
-
/* @__PURE__ */ q(
|
|
12731
|
+
/* @__PURE__ */ q(Ju, {
|
|
12721
12732
|
label: "Spacing",
|
|
12722
|
-
children: /* @__PURE__ */ q(
|
|
12733
|
+
children: /* @__PURE__ */ q(Yu, {
|
|
12723
12734
|
label: "Spacing",
|
|
12724
12735
|
value: m.spacing ?? "normal",
|
|
12725
12736
|
options: [
|
|
@@ -12730,14 +12741,14 @@ var Yu = ({ node: e }) => {
|
|
|
12730
12741
|
onChange: (t) => r(e.id, { spacing: t })
|
|
12731
12742
|
})
|
|
12732
12743
|
}),
|
|
12733
|
-
u.kind === "header" && /* @__PURE__ */ q(
|
|
12744
|
+
u.kind === "header" && /* @__PURE__ */ q(Cu, {
|
|
12734
12745
|
label: "Keep at the top while scrolling",
|
|
12735
12746
|
checked: !!m.pinned,
|
|
12736
12747
|
onChange: (t) => r(e.id, { pinned: t })
|
|
12737
12748
|
})
|
|
12738
12749
|
]
|
|
12739
12750
|
}),
|
|
12740
|
-
/* @__PURE__ */ J(
|
|
12751
|
+
/* @__PURE__ */ J(Su, {
|
|
12741
12752
|
title: "Make it your own",
|
|
12742
12753
|
children: [
|
|
12743
12754
|
/* @__PURE__ */ q("p", {
|
|
@@ -12775,7 +12786,7 @@ var Yu = ({ node: e }) => {
|
|
|
12775
12786
|
})
|
|
12776
12787
|
]
|
|
12777
12788
|
});
|
|
12778
|
-
},
|
|
12789
|
+
}, Zu = ({ section: e, nodeId: t }) => {
|
|
12779
12790
|
let { selectNode: n, resetSectionTweaks: r } = Z(), i = W(null), a = gn(e);
|
|
12780
12791
|
if (!a) return null;
|
|
12781
12792
|
let o = !!a.overrides?.[Ln(e, t)];
|
|
@@ -12824,7 +12835,7 @@ var Yu = ({ node: e }) => {
|
|
|
12824
12835
|
]
|
|
12825
12836
|
})]
|
|
12826
12837
|
});
|
|
12827
|
-
},
|
|
12838
|
+
}, Qu = ({ node: e }) => {
|
|
12828
12839
|
let { resolveStyles: t, updateNodeStyles: n, isOverridden: r, resetResponsiveStyle: i, viewportMode: a } = Z(), o = t(e), s = o.horizontalConstraint || "left", c = o.verticalConstraint || "top", l = r(e, "horizontalConstraint"), u = r(e, "verticalConstraint"), d = (t) => {
|
|
12829
12840
|
n(e.id, { horizontalConstraint: t });
|
|
12830
12841
|
}, f = (t) => {
|
|
@@ -12992,7 +13003,7 @@ var Yu = ({ node: e }) => {
|
|
|
12992
13003
|
})]
|
|
12993
13004
|
})]
|
|
12994
13005
|
});
|
|
12995
|
-
},
|
|
13006
|
+
}, $u = ({ node: e }) => {
|
|
12996
13007
|
let { resolveStyles: t, viewportMode: n, canvasCustomWidth: r, selectNode: i, documentTree: a } = Z(), [o, s] = G(null), c = an(a, e.id), l = t(e), u = r || (n === "mobile" ? 375 : n === "tablet" ? 768 : 1240), d = [];
|
|
12997
13008
|
if (l.width && l.width.endsWith("px")) {
|
|
12998
13009
|
let t = parseInt(l.width, 10);
|
|
@@ -13074,7 +13085,7 @@ var Yu = ({ node: e }) => {
|
|
|
13074
13085
|
}, t.id);
|
|
13075
13086
|
})
|
|
13076
13087
|
});
|
|
13077
|
-
},
|
|
13088
|
+
}, ed = ({ node: e }) => {
|
|
13078
13089
|
let { updateNodeStyles: t } = Z();
|
|
13079
13090
|
return e.type === "section" ? /* @__PURE__ */ J("div", {
|
|
13080
13091
|
className: "p-3 space-y-2 border-b border-px-line",
|
|
@@ -13097,7 +13108,7 @@ var Yu = ({ node: e }) => {
|
|
|
13097
13108
|
})]
|
|
13098
13109
|
})]
|
|
13099
13110
|
}) : null;
|
|
13100
|
-
},
|
|
13111
|
+
}, td = "bg-px-raised border border-px-line2 rounded px-2 py-1 text-xs text-px-text focus:outline-none focus:border-px-accent/60 font-mono", nd = (e, t = 1) => String(Math.round(e * 10 ** t) / 10 ** t), rd = ({ value: e, min: t, max: n, step: r, places: i = 1, width: a, label: o, onCommit: s }) => {
|
|
13101
13112
|
let [c, l] = G(null);
|
|
13102
13113
|
H(() => l(null), [e]);
|
|
13103
13114
|
let u = (e, r) => {
|
|
@@ -13114,7 +13125,7 @@ var Yu = ({ node: e }) => {
|
|
|
13114
13125
|
step: r,
|
|
13115
13126
|
min: t,
|
|
13116
13127
|
max: n,
|
|
13117
|
-
value: c ??
|
|
13128
|
+
value: c ?? nd(e, i),
|
|
13118
13129
|
onChange: (e) => {
|
|
13119
13130
|
l(e.target.value), u(e.target.value, !1);
|
|
13120
13131
|
},
|
|
@@ -13122,9 +13133,9 @@ var Yu = ({ node: e }) => {
|
|
|
13122
13133
|
onKeyDown: (e) => {
|
|
13123
13134
|
e.key === "Enter" && u(e.target.value, !0);
|
|
13124
13135
|
},
|
|
13125
|
-
className: `${a} ${
|
|
13136
|
+
className: `${a} ${td}`
|
|
13126
13137
|
});
|
|
13127
|
-
},
|
|
13138
|
+
}, id = ({ node: e }) => {
|
|
13128
13139
|
let { designSystem: t, viewportMode: n, resolveStyles: r, updateNodeStyles: i } = Z(), a = r(e), o = U(() => fn(e, a, t, n), [
|
|
13129
13140
|
e,
|
|
13130
13141
|
a,
|
|
@@ -13207,7 +13218,7 @@ var Yu = ({ node: e }) => {
|
|
|
13207
13218
|
onClick: () => i(e.id, { fontSize: `${Math.max(6, Math.round(o.fontSize) - 1)}px` }),
|
|
13208
13219
|
children: /* @__PURE__ */ q(qe, { className: "w-3 h-3" })
|
|
13209
13220
|
}),
|
|
13210
|
-
/* @__PURE__ */ q(
|
|
13221
|
+
/* @__PURE__ */ q(rd, {
|
|
13211
13222
|
label: "Size",
|
|
13212
13223
|
value: o.fontSize,
|
|
13213
13224
|
min: 6,
|
|
@@ -13237,7 +13248,7 @@ var Yu = ({ node: e }) => {
|
|
|
13237
13248
|
children: "Line"
|
|
13238
13249
|
}), /* @__PURE__ */ J("div", {
|
|
13239
13250
|
className: "flex items-center gap-1.5 flex-1 min-w-0",
|
|
13240
|
-
children: [/* @__PURE__ */ q(
|
|
13251
|
+
children: [/* @__PURE__ */ q(rd, {
|
|
13241
13252
|
label: "Line height",
|
|
13242
13253
|
value: o.lineHeight,
|
|
13243
13254
|
min: .8,
|
|
@@ -13278,7 +13289,7 @@ var Yu = ({ node: e }) => {
|
|
|
13278
13289
|
})]
|
|
13279
13290
|
})
|
|
13280
13291
|
] });
|
|
13281
|
-
},
|
|
13292
|
+
}, ad = "w-full min-w-0 bg-px-raised border border-px-line2 rounded-lg px-2 py-1 text-xs text-px-text placeholder:text-px-faint focus:outline-none focus:border-px-accent/60", od = ({ title: e, defaultOpen: t = !0, hint: n, hide: r, children: i }) => {
|
|
13282
13293
|
let [a, o] = G(t);
|
|
13283
13294
|
return r ? null : /* @__PURE__ */ J("section", {
|
|
13284
13295
|
className: "border-b border-px-line",
|
|
@@ -13306,7 +13317,7 @@ var Yu = ({ node: e }) => {
|
|
|
13306
13317
|
children: t
|
|
13307
13318
|
})]
|
|
13308
13319
|
});
|
|
13309
|
-
function
|
|
13320
|
+
function sd({ options: e, value: t, onChange: n, label: r }) {
|
|
13310
13321
|
return /* @__PURE__ */ q("div", {
|
|
13311
13322
|
role: "group",
|
|
13312
13323
|
"aria-label": r,
|
|
@@ -13321,7 +13332,7 @@ function od({ options: e, value: t, onChange: n, label: r }) {
|
|
|
13321
13332
|
}, e.id))
|
|
13322
13333
|
});
|
|
13323
13334
|
}
|
|
13324
|
-
var
|
|
13335
|
+
var cd = ({ value: e, onChange: t, label: n, placeholder: r, min: i = 0, max: a = 4e3 }) => {
|
|
13325
13336
|
let o = parseInt(e ?? "", 10);
|
|
13326
13337
|
return /* @__PURE__ */ J("div", {
|
|
13327
13338
|
className: "flex items-center gap-1 bg-px-raised border border-px-line2 rounded-lg px-2 py-1 min-w-0 focus-within:border-px-accent/60",
|
|
@@ -13339,10 +13350,10 @@ var sd = ({ value: e, onChange: t, label: n, placeholder: r, min: i = 0, max: a
|
|
|
13339
13350
|
children: "px"
|
|
13340
13351
|
})]
|
|
13341
13352
|
});
|
|
13342
|
-
},
|
|
13353
|
+
}, ld = ({ children: e }) => /* @__PURE__ */ q("p", {
|
|
13343
13354
|
className: "text-[10.5px] leading-snug text-px-faint",
|
|
13344
13355
|
children: e
|
|
13345
|
-
}),
|
|
13356
|
+
}), ud = [
|
|
13346
13357
|
{
|
|
13347
13358
|
id: "design",
|
|
13348
13359
|
label: "Design"
|
|
@@ -13355,7 +13366,7 @@ var sd = ({ value: e, onChange: t, label: n, placeholder: r, min: i = 0, max: a
|
|
|
13355
13366
|
id: "advanced",
|
|
13356
13367
|
label: "Advanced"
|
|
13357
13368
|
}
|
|
13358
|
-
],
|
|
13369
|
+
], dd = [
|
|
13359
13370
|
{
|
|
13360
13371
|
id: "none",
|
|
13361
13372
|
label: "None",
|
|
@@ -13377,16 +13388,16 @@ var sd = ({ value: e, onChange: t, label: n, placeholder: r, min: i = 0, max: a
|
|
|
13377
13388
|
value: "0 20px 48px rgba(0,0,0,0.28)"
|
|
13378
13389
|
}
|
|
13379
13390
|
];
|
|
13380
|
-
function
|
|
13391
|
+
function fd(e, t) {
|
|
13381
13392
|
if (e.id === t) return [e];
|
|
13382
13393
|
for (let n of e.children ?? []) {
|
|
13383
|
-
let r =
|
|
13394
|
+
let r = fd(n, t);
|
|
13384
13395
|
if (r.length) return [e, ...r];
|
|
13385
13396
|
}
|
|
13386
13397
|
return [];
|
|
13387
13398
|
}
|
|
13388
|
-
var
|
|
13389
|
-
let { selectNode: t, deleteNode: n, duplicateNode: r, documentTree: i, viewportMode: a, resolveStyles: o, updateNodeStyles: l, updateNodeContent: u, updateNodeProps: d, resetResponsiveStyle: p, resetAllResponsiveOverrides: m, isOverridden: h, updateNodeResponsiveVisibility: g, setContainerLayoutMode: _, alignNodeInParent: y, bringForward: b, sendBackward: x, bringToFront: S, sendToBack: C, canvasZoom: w } = Z(), T = Y(), E = T.mode === "email", [D, O] = G("design"), k = U(() =>
|
|
13399
|
+
var pd = ({ node: e }) => {
|
|
13400
|
+
let { selectNode: t, deleteNode: n, duplicateNode: r, documentTree: i, viewportMode: a, resolveStyles: o, updateNodeStyles: l, updateNodeContent: u, updateNodeProps: d, resetResponsiveStyle: p, resetAllResponsiveOverrides: m, isOverridden: h, updateNodeResponsiveVisibility: g, setContainerLayoutMode: _, alignNodeInParent: y, bringForward: b, sendBackward: x, bringToFront: S, sendToBack: C, canvasZoom: w } = Z(), T = Y(), E = T.mode === "email", [D, O] = G("design"), k = U(() => fd(i, e.id), [i, e.id]), A = o(e), j = (t) => l(e.id, t), M = W(null), [N, P] = G(!1), [ee, F] = G(null), te = async (t) => {
|
|
13390
13401
|
if (t) {
|
|
13391
13402
|
P(!0), F(null);
|
|
13392
13403
|
try {
|
|
@@ -13464,10 +13475,10 @@ var fd = ({ node: e }) => {
|
|
|
13464
13475
|
children: /* @__PURE__ */ q(n, { className: "w-3.5 h-3.5" })
|
|
13465
13476
|
}, e);
|
|
13466
13477
|
}, Ae = /* @__PURE__ */ J(K, { children: [
|
|
13467
|
-
gn(e) && /* @__PURE__ */ q(
|
|
13478
|
+
gn(e) && /* @__PURE__ */ q(Xu, { node: e }),
|
|
13468
13479
|
(() => {
|
|
13469
13480
|
let t = mr(i, e.id);
|
|
13470
|
-
return t ? /* @__PURE__ */ q(
|
|
13481
|
+
return t ? /* @__PURE__ */ q(Zu, {
|
|
13471
13482
|
section: t,
|
|
13472
13483
|
nodeId: e.id
|
|
13473
13484
|
}) : null;
|
|
@@ -13476,7 +13487,7 @@ var fd = ({ node: e }) => {
|
|
|
13476
13487
|
className: "px-3.5 pt-3 pb-1 text-[10px] uppercase tracking-wider font-semibold text-px-faint",
|
|
13477
13488
|
children: "Fine-tune this section"
|
|
13478
13489
|
}),
|
|
13479
|
-
("content" in e || ie || e.type === "image") && /* @__PURE__ */ J(
|
|
13490
|
+
("content" in e || ie || e.type === "image") && /* @__PURE__ */ J(od, {
|
|
13480
13491
|
title: "Content",
|
|
13481
13492
|
children: [
|
|
13482
13493
|
"content" in e && /* @__PURE__ */ q($, {
|
|
@@ -13495,7 +13506,7 @@ var fd = ({ node: e }) => {
|
|
|
13495
13506
|
}),
|
|
13496
13507
|
e.type === "heading" && /* @__PURE__ */ q($, {
|
|
13497
13508
|
label: "Level",
|
|
13498
|
-
children: /* @__PURE__ */ q(
|
|
13509
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13499
13510
|
label: "Heading level",
|
|
13500
13511
|
value: String(e.props?.level || 2),
|
|
13501
13512
|
onChange: (e) => ge(Number(e)),
|
|
@@ -13512,7 +13523,7 @@ var fd = ({ node: e }) => {
|
|
|
13512
13523
|
}))
|
|
13513
13524
|
})
|
|
13514
13525
|
}),
|
|
13515
|
-
e.type === "button" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
13526
|
+
e.type === "button" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(hu, {
|
|
13516
13527
|
label: "Goes to",
|
|
13517
13528
|
value: e.props?.href === "#" ? "" : e.props?.href,
|
|
13518
13529
|
onChange: (t) => d(e.id, { href: t })
|
|
@@ -13601,15 +13612,15 @@ var fd = ({ node: e }) => {
|
|
|
13601
13612
|
] })
|
|
13602
13613
|
]
|
|
13603
13614
|
}),
|
|
13604
|
-
!gn(e) && /* @__PURE__ */ q(
|
|
13605
|
-
/* @__PURE__ */ q(
|
|
13606
|
-
ie && /* @__PURE__ */ J(
|
|
13615
|
+
!gn(e) && /* @__PURE__ */ q(ed, { node: e }),
|
|
13616
|
+
/* @__PURE__ */ q(Uu, { node: e }),
|
|
13617
|
+
ie && /* @__PURE__ */ J(od, {
|
|
13607
13618
|
title: "Typography",
|
|
13608
13619
|
children: [
|
|
13609
|
-
/* @__PURE__ */ q(
|
|
13620
|
+
/* @__PURE__ */ q(id, { node: e }),
|
|
13610
13621
|
/* @__PURE__ */ q($, {
|
|
13611
13622
|
label: "Colour",
|
|
13612
|
-
children: /* @__PURE__ */ q(
|
|
13623
|
+
children: /* @__PURE__ */ q(iu, {
|
|
13613
13624
|
value: A.textColor || "#FFFFFF",
|
|
13614
13625
|
onChange: (e) => j({ textColor: e })
|
|
13615
13626
|
})
|
|
@@ -13618,7 +13629,7 @@ var fd = ({ node: e }) => {
|
|
|
13618
13629
|
label: "Align",
|
|
13619
13630
|
children: /* @__PURE__ */ J("div", {
|
|
13620
13631
|
className: "flex items-center gap-2",
|
|
13621
|
-
children: [/* @__PURE__ */ q(
|
|
13632
|
+
children: [/* @__PURE__ */ q(sd, {
|
|
13622
13633
|
label: "Text alignment",
|
|
13623
13634
|
value: A.textAlign || "left",
|
|
13624
13635
|
onChange: (e) => j({ textAlign: e }),
|
|
@@ -13671,19 +13682,19 @@ var fd = ({ node: e }) => {
|
|
|
13671
13682
|
})
|
|
13672
13683
|
]
|
|
13673
13684
|
}),
|
|
13674
|
-
/* @__PURE__ */ J(
|
|
13685
|
+
/* @__PURE__ */ J(od, {
|
|
13675
13686
|
title: "Appearance",
|
|
13676
13687
|
children: [
|
|
13677
13688
|
/* @__PURE__ */ q($, {
|
|
13678
13689
|
label: "Background",
|
|
13679
|
-
children: /* @__PURE__ */ q(
|
|
13690
|
+
children: /* @__PURE__ */ q(iu, {
|
|
13680
13691
|
value: A.backgroundColor || "transparent",
|
|
13681
13692
|
onChange: (e) => j({ backgroundColor: e })
|
|
13682
13693
|
})
|
|
13683
13694
|
}),
|
|
13684
13695
|
/* @__PURE__ */ q($, {
|
|
13685
13696
|
label: "Corners",
|
|
13686
|
-
children: /* @__PURE__ */ q(
|
|
13697
|
+
children: /* @__PURE__ */ q(cd, {
|
|
13687
13698
|
label: "Corner radius",
|
|
13688
13699
|
value: A.borderRadius,
|
|
13689
13700
|
onChange: (e) => j({ borderRadius: e ?? "0px" })
|
|
@@ -13710,17 +13721,17 @@ var fd = ({ node: e }) => {
|
|
|
13710
13721
|
})
|
|
13711
13722
|
]
|
|
13712
13723
|
}),
|
|
13713
|
-
/* @__PURE__ */ J(
|
|
13724
|
+
/* @__PURE__ */ J(od, {
|
|
13714
13725
|
hide: E,
|
|
13715
13726
|
title: "Shadows & effects",
|
|
13716
13727
|
children: [
|
|
13717
13728
|
/* @__PURE__ */ q($, {
|
|
13718
13729
|
label: "Shadow",
|
|
13719
|
-
children: /* @__PURE__ */ q(
|
|
13730
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13720
13731
|
label: "Shadow",
|
|
13721
|
-
value:
|
|
13722
|
-
onChange: (e) => j({ boxShadow:
|
|
13723
|
-
options:
|
|
13732
|
+
value: dd.find((e) => e.value === A.boxShadow)?.id ?? (A.boxShadow ? "custom" : "none"),
|
|
13733
|
+
onChange: (e) => j({ boxShadow: dd.find((t) => t.id === e)?.value }),
|
|
13734
|
+
options: dd.map((e) => ({
|
|
13724
13735
|
id: e.id,
|
|
13725
13736
|
label: e.label
|
|
13726
13737
|
}))
|
|
@@ -13745,14 +13756,14 @@ var fd = ({ node: e }) => {
|
|
|
13745
13756
|
})]
|
|
13746
13757
|
})
|
|
13747
13758
|
}),
|
|
13748
|
-
/* @__PURE__ */ q(
|
|
13759
|
+
/* @__PURE__ */ q(ld, { children: "Blur behind frosts whatever is under this box, like a see-through header." })
|
|
13749
13760
|
]
|
|
13750
13761
|
}),
|
|
13751
|
-
/* @__PURE__ */ J(
|
|
13762
|
+
/* @__PURE__ */ J(od, {
|
|
13752
13763
|
title: "Borders",
|
|
13753
13764
|
children: [/* @__PURE__ */ q($, {
|
|
13754
13765
|
label: "Line",
|
|
13755
|
-
children: /* @__PURE__ */ q(
|
|
13766
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13756
13767
|
label: "Border style",
|
|
13757
13768
|
value: A.borderStyle ?? "none",
|
|
13758
13769
|
onChange: (e) => j({
|
|
@@ -13780,7 +13791,7 @@ var fd = ({ node: e }) => {
|
|
|
13780
13791
|
})
|
|
13781
13792
|
}), A.borderStyle && A.borderStyle !== "none" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q($, {
|
|
13782
13793
|
label: "Thickness",
|
|
13783
|
-
children: /* @__PURE__ */ q(
|
|
13794
|
+
children: /* @__PURE__ */ q(cd, {
|
|
13784
13795
|
label: "Border thickness",
|
|
13785
13796
|
min: 0,
|
|
13786
13797
|
max: 40,
|
|
@@ -13789,13 +13800,13 @@ var fd = ({ node: e }) => {
|
|
|
13789
13800
|
})
|
|
13790
13801
|
}), /* @__PURE__ */ q($, {
|
|
13791
13802
|
label: "Colour",
|
|
13792
|
-
children: /* @__PURE__ */ q(
|
|
13803
|
+
children: /* @__PURE__ */ q(iu, {
|
|
13793
13804
|
value: A.borderColor || "#283044",
|
|
13794
13805
|
onChange: (e) => j({ borderColor: e })
|
|
13795
13806
|
})
|
|
13796
13807
|
})] })]
|
|
13797
13808
|
}),
|
|
13798
|
-
/* @__PURE__ */ J(
|
|
13809
|
+
/* @__PURE__ */ J(od, {
|
|
13799
13810
|
hide: E,
|
|
13800
13811
|
title: "Animation",
|
|
13801
13812
|
hint: "Make the page feel alive. These show on your published site, not while you edit (use Preview to see them).",
|
|
@@ -13806,7 +13817,7 @@ var fd = ({ node: e }) => {
|
|
|
13806
13817
|
"aria-label": "Hover effect",
|
|
13807
13818
|
value: A.hoverEffect ?? "none",
|
|
13808
13819
|
onChange: (e) => j({ hoverEffect: e.target.value }),
|
|
13809
|
-
className:
|
|
13820
|
+
className: ad,
|
|
13810
13821
|
children: [
|
|
13811
13822
|
/* @__PURE__ */ q("option", {
|
|
13812
13823
|
value: "none",
|
|
@@ -13837,7 +13848,7 @@ var fd = ({ node: e }) => {
|
|
|
13837
13848
|
"aria-label": "Entrance",
|
|
13838
13849
|
value: A.entrance ?? "none",
|
|
13839
13850
|
onChange: (e) => j({ entrance: e.target.value }),
|
|
13840
|
-
className:
|
|
13851
|
+
className: ad,
|
|
13841
13852
|
children: [
|
|
13842
13853
|
/* @__PURE__ */ q("option", {
|
|
13843
13854
|
value: "none",
|
|
@@ -13885,11 +13896,11 @@ var fd = ({ node: e }) => {
|
|
|
13885
13896
|
})]
|
|
13886
13897
|
})
|
|
13887
13898
|
}),
|
|
13888
|
-
A.entrance && A.entrance !== "none" && /* @__PURE__ */ q(
|
|
13899
|
+
A.entrance && A.entrance !== "none" && /* @__PURE__ */ q(ld, { children: "Tip: give a row of cards a little more wait each (0, 100, 200…) so they arrive one after another." })
|
|
13889
13900
|
]
|
|
13890
13901
|
})
|
|
13891
13902
|
] }), je = /* @__PURE__ */ J(K, { children: [
|
|
13892
|
-
/* @__PURE__ */ J(
|
|
13903
|
+
/* @__PURE__ */ J(od, {
|
|
13893
13904
|
title: "Display & flow",
|
|
13894
13905
|
children: [
|
|
13895
13906
|
I && !E && /* @__PURE__ */ q($, {
|
|
@@ -13898,7 +13909,7 @@ var fd = ({ node: e }) => {
|
|
|
13898
13909
|
className: "flex items-center gap-1",
|
|
13899
13910
|
children: [/* @__PURE__ */ q("div", {
|
|
13900
13911
|
className: "flex-1 min-w-0",
|
|
13901
|
-
children: /* @__PURE__ */ q(
|
|
13912
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13902
13913
|
label: "Layout mode",
|
|
13903
13914
|
value: A.layoutMode || "free",
|
|
13904
13915
|
onChange: (t) => _(e.id, t),
|
|
@@ -13925,7 +13936,7 @@ var fd = ({ node: e }) => {
|
|
|
13925
13936
|
}),
|
|
13926
13937
|
I && A.layoutMode === "grid" && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q($, {
|
|
13927
13938
|
label: "Columns",
|
|
13928
|
-
children: /* @__PURE__ */ q(
|
|
13939
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13929
13940
|
label: "Grid columns",
|
|
13930
13941
|
value: String(A.gridColumns || 3),
|
|
13931
13942
|
onChange: (e) => j({ gridColumns: Number(e) }),
|
|
@@ -13942,7 +13953,7 @@ var fd = ({ node: e }) => {
|
|
|
13942
13953
|
})
|
|
13943
13954
|
}), /* @__PURE__ */ q($, {
|
|
13944
13955
|
label: "Gap",
|
|
13945
|
-
children: /* @__PURE__ */ q(
|
|
13956
|
+
children: /* @__PURE__ */ q(cd, {
|
|
13946
13957
|
label: "Grid gap",
|
|
13947
13958
|
value: A.gap || A.gridGap || "20px",
|
|
13948
13959
|
onChange: (e) => j({
|
|
@@ -13954,7 +13965,7 @@ var fd = ({ node: e }) => {
|
|
|
13954
13965
|
I && (E || A.layoutMode === "flow" || !A.layoutMode) && /* @__PURE__ */ J(K, { children: [
|
|
13955
13966
|
/* @__PURE__ */ q($, {
|
|
13956
13967
|
label: "Direction",
|
|
13957
|
-
children: /* @__PURE__ */ q(
|
|
13968
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13958
13969
|
label: "Direction",
|
|
13959
13970
|
value: A.flexDirection === "column" ? "column" : "row",
|
|
13960
13971
|
onChange: (e) => j({ flexDirection: e }),
|
|
@@ -13969,7 +13980,7 @@ var fd = ({ node: e }) => {
|
|
|
13969
13980
|
}),
|
|
13970
13981
|
!E && /* @__PURE__ */ q($, {
|
|
13971
13982
|
label: "Wrap",
|
|
13972
|
-
children: /* @__PURE__ */ q(
|
|
13983
|
+
children: /* @__PURE__ */ q(sd, {
|
|
13973
13984
|
label: "Wrap",
|
|
13974
13985
|
value: A.flexWrap === "wrap" ? "wrap" : "nowrap",
|
|
13975
13986
|
onChange: (e) => j({ flexWrap: e }),
|
|
@@ -14042,7 +14053,7 @@ var fd = ({ node: e }) => {
|
|
|
14042
14053
|
}),
|
|
14043
14054
|
/* @__PURE__ */ q($, {
|
|
14044
14055
|
label: "Gap",
|
|
14045
|
-
children: /* @__PURE__ */ q(
|
|
14056
|
+
children: /* @__PURE__ */ q(cd, {
|
|
14046
14057
|
label: "Gap",
|
|
14047
14058
|
value: A.gap || "16px",
|
|
14048
14059
|
onChange: (e) => j({ gap: e })
|
|
@@ -14051,7 +14062,7 @@ var fd = ({ node: e }) => {
|
|
|
14051
14062
|
] }),
|
|
14052
14063
|
re && /* @__PURE__ */ q($, {
|
|
14053
14064
|
label: "Col span",
|
|
14054
|
-
children: /* @__PURE__ */ q(
|
|
14065
|
+
children: /* @__PURE__ */ q(sd, {
|
|
14055
14066
|
label: "Column span",
|
|
14056
14067
|
value: String(A.gridColumnSpan || 1),
|
|
14057
14068
|
onChange: (e) => j({ gridColumnSpan: Number(e) }),
|
|
@@ -14066,10 +14077,10 @@ var fd = ({ node: e }) => {
|
|
|
14066
14077
|
}))
|
|
14067
14078
|
})
|
|
14068
14079
|
}),
|
|
14069
|
-
!I && !re && /* @__PURE__ */ q(
|
|
14080
|
+
!I && !re && /* @__PURE__ */ q(ld, { children: "This element sits inside its parent. Select the box around it to change how things are arranged." })
|
|
14070
14081
|
]
|
|
14071
14082
|
}),
|
|
14072
|
-
/* @__PURE__ */ J(
|
|
14083
|
+
/* @__PURE__ */ J(od, {
|
|
14073
14084
|
title: "Align & distribute",
|
|
14074
14085
|
hint: "These line this element up inside the box it sits in.",
|
|
14075
14086
|
children: [/* @__PURE__ */ J("div", {
|
|
@@ -14083,14 +14094,14 @@ var fd = ({ node: e }) => {
|
|
|
14083
14094
|
ke("middle", "Align middle", f),
|
|
14084
14095
|
ke("bottom", "Align bottom", se)
|
|
14085
14096
|
]
|
|
14086
|
-
}), /* @__PURE__ */ q(
|
|
14097
|
+
}), /* @__PURE__ */ q(ld, { children: "To line up or evenly space several elements: hold Shift and click each one on the page (or in Layers). Options to align them with each other and spread them out appear here." })]
|
|
14087
14098
|
}),
|
|
14088
|
-
/* @__PURE__ */ J(
|
|
14099
|
+
/* @__PURE__ */ J(od, {
|
|
14089
14100
|
title: "Dimensions",
|
|
14090
14101
|
children: [
|
|
14091
14102
|
/* @__PURE__ */ q($, {
|
|
14092
14103
|
label: "Width",
|
|
14093
|
-
children: /* @__PURE__ */ q(
|
|
14104
|
+
children: /* @__PURE__ */ q(sd, {
|
|
14094
14105
|
label: "Width",
|
|
14095
14106
|
value: oe,
|
|
14096
14107
|
onChange: ce,
|
|
@@ -14125,7 +14136,7 @@ var fd = ({ node: e }) => {
|
|
|
14125
14136
|
}),
|
|
14126
14137
|
!E && /* @__PURE__ */ q($, {
|
|
14127
14138
|
label: "Height",
|
|
14128
|
-
children: /* @__PURE__ */ q(
|
|
14139
|
+
children: /* @__PURE__ */ q(sd, {
|
|
14129
14140
|
label: "Height",
|
|
14130
14141
|
value: L === "fill" ? "hug" : L,
|
|
14131
14142
|
onChange: le,
|
|
@@ -14141,7 +14152,7 @@ var fd = ({ node: e }) => {
|
|
|
14141
14152
|
}),
|
|
14142
14153
|
!E && L === "fixed" && /* @__PURE__ */ q($, {
|
|
14143
14154
|
label: "",
|
|
14144
|
-
children: /* @__PURE__ */ q(
|
|
14155
|
+
children: /* @__PURE__ */ q(cd, {
|
|
14145
14156
|
label: "Minimum height",
|
|
14146
14157
|
value: A.minHeight,
|
|
14147
14158
|
onChange: (e) => j({ minHeight: e ?? "auto" })
|
|
@@ -14171,12 +14182,12 @@ var fd = ({ node: e }) => {
|
|
|
14171
14182
|
})
|
|
14172
14183
|
]
|
|
14173
14184
|
}),
|
|
14174
|
-
/* @__PURE__ */ J(
|
|
14185
|
+
/* @__PURE__ */ J(od, {
|
|
14175
14186
|
title: "Spacing",
|
|
14176
14187
|
children: [
|
|
14177
14188
|
/* @__PURE__ */ q($, {
|
|
14178
14189
|
label: "Padding",
|
|
14179
|
-
children: /* @__PURE__ */ q(
|
|
14190
|
+
children: /* @__PURE__ */ q(cd, {
|
|
14180
14191
|
label: "Padding",
|
|
14181
14192
|
value: A.padding,
|
|
14182
14193
|
onChange: me
|
|
@@ -14200,7 +14211,7 @@ var fd = ({ node: e }) => {
|
|
|
14200
14211
|
children: [/* @__PURE__ */ q("span", {
|
|
14201
14212
|
className: "block text-[10px] text-px-muted",
|
|
14202
14213
|
children: t
|
|
14203
|
-
}), /* @__PURE__ */ q(
|
|
14214
|
+
}), /* @__PURE__ */ q(cd, {
|
|
14204
14215
|
label: `Padding ${t.toLowerCase()}`,
|
|
14205
14216
|
value: A[e] ?? A.padding,
|
|
14206
14217
|
onChange: (t) => j({ [e]: t ?? "0px" })
|
|
@@ -14209,7 +14220,7 @@ var fd = ({ node: e }) => {
|
|
|
14209
14220
|
})
|
|
14210
14221
|
]
|
|
14211
14222
|
}),
|
|
14212
|
-
/* @__PURE__ */ q(
|
|
14223
|
+
/* @__PURE__ */ q(od, {
|
|
14213
14224
|
hide: E,
|
|
14214
14225
|
title: "Positioning",
|
|
14215
14226
|
children: /* @__PURE__ */ q($, {
|
|
@@ -14248,8 +14259,8 @@ var fd = ({ node: e }) => {
|
|
|
14248
14259
|
})
|
|
14249
14260
|
})
|
|
14250
14261
|
}),
|
|
14251
|
-
!E && /* @__PURE__ */ q(
|
|
14252
|
-
/* @__PURE__ */ q(
|
|
14262
|
+
!E && /* @__PURE__ */ q(Qu, { node: e }),
|
|
14263
|
+
/* @__PURE__ */ q(od, {
|
|
14253
14264
|
hide: E,
|
|
14254
14265
|
title: "Stacking (z-index)",
|
|
14255
14266
|
children: /* @__PURE__ */ q($, {
|
|
@@ -14308,7 +14319,7 @@ var fd = ({ node: e }) => {
|
|
|
14308
14319
|
})
|
|
14309
14320
|
})
|
|
14310
14321
|
}),
|
|
14311
|
-
/* @__PURE__ */ J(
|
|
14322
|
+
/* @__PURE__ */ J(od, {
|
|
14312
14323
|
hide: E,
|
|
14313
14324
|
title: "Screens",
|
|
14314
14325
|
defaultOpen: ue,
|
|
@@ -14346,7 +14357,7 @@ var fd = ({ node: e }) => {
|
|
|
14346
14357
|
]
|
|
14347
14358
|
})
|
|
14348
14359
|
] }), Me = typeof e.props?.htmlTag == "string" && ae?.includes(e.props.htmlTag) ? e.props.htmlTag : yr[e.type], Ne = /* @__PURE__ */ J(K, { children: [
|
|
14349
|
-
/* @__PURE__ */ J(
|
|
14360
|
+
/* @__PURE__ */ J(od, {
|
|
14350
14361
|
hide: E,
|
|
14351
14362
|
title: "Identity",
|
|
14352
14363
|
children: [
|
|
@@ -14363,7 +14374,7 @@ var fd = ({ node: e }) => {
|
|
|
14363
14374
|
}, e))
|
|
14364
14375
|
})
|
|
14365
14376
|
}),
|
|
14366
|
-
ae && /* @__PURE__ */ q(
|
|
14377
|
+
ae && /* @__PURE__ */ q(ld, { children: "Pick what this box is, like a header, navigation or footer. It helps search engines and screen readers understand your page." }),
|
|
14367
14378
|
e.type !== "section" && /* @__PURE__ */ q($, {
|
|
14368
14379
|
label: "ID",
|
|
14369
14380
|
children: /* @__PURE__ */ q("input", {
|
|
@@ -14375,7 +14386,7 @@ var fd = ({ node: e }) => {
|
|
|
14375
14386
|
className: "w-full min-w-0 bg-px-raised border border-px-line2 rounded-lg px-2 py-1 text-xs text-px-text placeholder:text-px-faint focus:outline-none focus:border-px-accent/60"
|
|
14376
14387
|
})
|
|
14377
14388
|
}),
|
|
14378
|
-
e.type !== "section" && /* @__PURE__ */ q(
|
|
14389
|
+
e.type !== "section" && /* @__PURE__ */ q(ld, { children: "A name a link or button can scroll straight to, like #pricing. Letters, numbers and dashes." }),
|
|
14379
14390
|
/* @__PURE__ */ q($, {
|
|
14380
14391
|
label: "Classes",
|
|
14381
14392
|
children: /* @__PURE__ */ q("input", {
|
|
@@ -14384,17 +14395,17 @@ var fd = ({ node: e }) => {
|
|
|
14384
14395
|
value: A.customClasses || "",
|
|
14385
14396
|
onChange: (e) => j({ customClasses: e.target.value }),
|
|
14386
14397
|
placeholder: "e.g. shadow-xl hover:scale-105",
|
|
14387
|
-
className: `${
|
|
14398
|
+
className: `${ad} font-mono`
|
|
14388
14399
|
})
|
|
14389
14400
|
})
|
|
14390
14401
|
]
|
|
14391
14402
|
}),
|
|
14392
|
-
/* @__PURE__ */ J(
|
|
14403
|
+
/* @__PURE__ */ J(od, {
|
|
14393
14404
|
hide: E,
|
|
14394
14405
|
title: "Behaviour",
|
|
14395
14406
|
children: [/* @__PURE__ */ q($, {
|
|
14396
14407
|
label: "Overflow",
|
|
14397
|
-
children: /* @__PURE__ */ q(
|
|
14408
|
+
children: /* @__PURE__ */ q(sd, {
|
|
14398
14409
|
label: "Overflow",
|
|
14399
14410
|
value: A.overflow === "hidden" || A.overflow === "clip" ? "hidden" : A.overflow === "auto" ? "auto" : "visible",
|
|
14400
14411
|
onChange: (e) => j({ overflow: e }),
|
|
@@ -14422,7 +14433,7 @@ var fd = ({ node: e }) => {
|
|
|
14422
14433
|
"aria-label": "Cursor",
|
|
14423
14434
|
value: A.cursor ?? "auto",
|
|
14424
14435
|
onChange: (e) => j({ cursor: e.target.value }),
|
|
14425
|
-
className:
|
|
14436
|
+
className: ad,
|
|
14426
14437
|
children: [
|
|
14427
14438
|
/* @__PURE__ */ q("option", {
|
|
14428
14439
|
value: "auto",
|
|
@@ -14452,7 +14463,7 @@ var fd = ({ node: e }) => {
|
|
|
14452
14463
|
})
|
|
14453
14464
|
})]
|
|
14454
14465
|
}),
|
|
14455
|
-
/* @__PURE__ */ J(
|
|
14466
|
+
/* @__PURE__ */ J(od, {
|
|
14456
14467
|
title: "Accessibility",
|
|
14457
14468
|
children: [
|
|
14458
14469
|
/* @__PURE__ */ q($, {
|
|
@@ -14463,7 +14474,7 @@ var fd = ({ node: e }) => {
|
|
|
14463
14474
|
value: typeof e.props?.ariaLabel == "string" ? e.props.ariaLabel : "",
|
|
14464
14475
|
onChange: (t) => d(e.id, { ariaLabel: t.target.value.slice(0, 200) || void 0 }),
|
|
14465
14476
|
placeholder: "Read aloud by screen readers",
|
|
14466
|
-
className:
|
|
14477
|
+
className: ad
|
|
14467
14478
|
})
|
|
14468
14479
|
}),
|
|
14469
14480
|
/* @__PURE__ */ J("label", {
|
|
@@ -14475,10 +14486,10 @@ var fd = ({ node: e }) => {
|
|
|
14475
14486
|
className: "accent-px-accent"
|
|
14476
14487
|
})]
|
|
14477
14488
|
}),
|
|
14478
|
-
/* @__PURE__ */ q(
|
|
14489
|
+
/* @__PURE__ */ q(ld, { children: "Use this for purely decorative things, like a background shape." })
|
|
14479
14490
|
]
|
|
14480
14491
|
}),
|
|
14481
|
-
/* @__PURE__ */ J(
|
|
14492
|
+
/* @__PURE__ */ J(od, {
|
|
14482
14493
|
hide: E,
|
|
14483
14494
|
title: "Transitions",
|
|
14484
14495
|
hint: "For your own effects: how long a change takes (a hover colour, a size change), instead of snapping.",
|
|
@@ -14491,7 +14502,7 @@ var fd = ({ node: e }) => {
|
|
|
14491
14502
|
transitionProperty: e.target.value,
|
|
14492
14503
|
...e.target.value !== "none" && A.transitionDuration === void 0 ? { transitionDuration: 200 } : {}
|
|
14493
14504
|
}),
|
|
14494
|
-
className:
|
|
14505
|
+
className: ad,
|
|
14495
14506
|
children: [
|
|
14496
14507
|
/* @__PURE__ */ q("option", {
|
|
14497
14508
|
value: "none",
|
|
@@ -14624,7 +14635,7 @@ var fd = ({ node: e }) => {
|
|
|
14624
14635
|
role: "tablist",
|
|
14625
14636
|
"aria-label": "Properties",
|
|
14626
14637
|
className: "flex items-stretch px-2 border-b border-px-line shrink-0",
|
|
14627
|
-
children:
|
|
14638
|
+
children: ud.filter((e) => !E || e.id !== "advanced").map((e) => /* @__PURE__ */ q("button", {
|
|
14628
14639
|
role: "tab",
|
|
14629
14640
|
type: "button",
|
|
14630
14641
|
"aria-selected": D === e.id,
|
|
@@ -14635,7 +14646,7 @@ var fd = ({ node: e }) => {
|
|
|
14635
14646
|
}),
|
|
14636
14647
|
/* @__PURE__ */ q("div", {
|
|
14637
14648
|
className: "px-3.5 pt-3 empty:hidden shrink-0",
|
|
14638
|
-
children: /* @__PURE__ */ q(
|
|
14649
|
+
children: /* @__PURE__ */ q($u, { node: e })
|
|
14639
14650
|
}),
|
|
14640
14651
|
/* @__PURE__ */ J("div", {
|
|
14641
14652
|
role: "tabpanel",
|
|
@@ -14648,7 +14659,7 @@ var fd = ({ node: e }) => {
|
|
|
14648
14659
|
})
|
|
14649
14660
|
]
|
|
14650
14661
|
});
|
|
14651
|
-
},
|
|
14662
|
+
}, md = () => {
|
|
14652
14663
|
let { selectedNode: e, selectedNodeIds: t, selectNodes: n, deleteNodes: r, documentTree: i, detachElementToFreePosition: a, returnElementToStructuredLayout: o, alignSelectedNodes: c, distributeSelectedNodes: l, canvasZoom: u } = Z();
|
|
14653
14664
|
return t && t.length > 1 ? /* @__PURE__ */ J("div", {
|
|
14654
14665
|
className: "flex flex-col h-full w-[300px] shrink-0 border-l border-px-line bg-px-surface text-px-text select-none text-xs",
|
|
@@ -14808,14 +14819,14 @@ var fd = ({ node: e }) => {
|
|
|
14808
14819
|
})]
|
|
14809
14820
|
})]
|
|
14810
14821
|
})]
|
|
14811
|
-
}) : !e || e.type === "page" || e.id === i.id ? /* @__PURE__ */ q(
|
|
14812
|
-
},
|
|
14822
|
+
}) : !e || e.type === "page" || e.id === i.id ? /* @__PURE__ */ q(cu, {}) : /* @__PURE__ */ q(pd, { node: e });
|
|
14823
|
+
}, hd = () => /* @__PURE__ */ J("div", {
|
|
14813
14824
|
className: "flex flex-col h-full w-[300px] shrink-0 min-h-0",
|
|
14814
14825
|
children: [/* @__PURE__ */ q("div", {
|
|
14815
14826
|
className: "flex-1 min-h-0 flex",
|
|
14816
|
-
children: /* @__PURE__ */ q(
|
|
14827
|
+
children: /* @__PURE__ */ q(md, {})
|
|
14817
14828
|
}), /* @__PURE__ */ q(Ds, {})]
|
|
14818
|
-
}),
|
|
14829
|
+
}), gd = () => {
|
|
14819
14830
|
let { contextMenu: e, closeContextMenu: t, documentTree: n, selectedNodeIds: r, groupSelectedNodes: i, ungroupNode: a, duplicateNode: o, deleteNode: s, toggleNodeLock: c, toggleNodeVisibility: l, bringForward: u, sendBackward: d, bringToFront: f, sendToBack: p, zoomIn: m, zoomOut: h, resetZoom100: g, fitToPage: _, fitAllFrames: b, detachElementToFreePosition: x, returnElementToStructuredLayout: S, canvasZoom: C } = Z(), w = W(null), [T, E] = G({
|
|
14820
14831
|
x: 0,
|
|
14821
14832
|
y: 0
|
|
@@ -15083,7 +15094,7 @@ var fd = ({ node: e }) => {
|
|
|
15083
15094
|
})
|
|
15084
15095
|
] })
|
|
15085
15096
|
});
|
|
15086
|
-
},
|
|
15097
|
+
}, _d = [
|
|
15087
15098
|
{
|
|
15088
15099
|
id: "desktop",
|
|
15089
15100
|
label: "Desktop",
|
|
@@ -15104,8 +15115,8 @@ var fd = ({ node: e }) => {
|
|
|
15104
15115
|
label: "Phone",
|
|
15105
15116
|
icon: /* @__PURE__ */ q(O, { className: "w-3.5 h-3.5" })
|
|
15106
15117
|
}
|
|
15107
|
-
],
|
|
15108
|
-
let { getPages: e, currentPageId: t, getDesignSystem: n, setIsPreviewMode: r, viewportMode: i } = Z(), a = Y(), o = a.mode === "email" ?
|
|
15118
|
+
], vd = () => {
|
|
15119
|
+
let { getPages: e, currentPageId: t, getDesignSystem: n, setIsPreviewMode: r, viewportMode: i } = Z(), a = Y(), o = a.mode === "email" ? _d.filter((e) => e.id === "desktop" || e.id === "mobile") : _d, [s, c] = G(a.mode === "email" && i !== "mobile" ? "desktop" : i), l = U(() => {
|
|
15109
15120
|
let r = e(), i = r.find((e) => e.id === t) ?? r[0];
|
|
15110
15121
|
if (a.mode === "email") {
|
|
15111
15122
|
let e = pr(i, {
|
|
@@ -15187,7 +15198,7 @@ var fd = ({ node: e }) => {
|
|
|
15187
15198
|
})
|
|
15188
15199
|
]
|
|
15189
15200
|
});
|
|
15190
|
-
},
|
|
15201
|
+
}, yd = "whitespace-nowrap shrink-0 inline-flex items-center gap-1.5 h-9 px-3 rounded-lg text-xs font-medium text-px-text hover:bg-px-raised2 cursor-pointer disabled:opacity-30 disabled:cursor-default transition-colors", bd = ({ onHelp: e }) => {
|
|
15191
15202
|
let t = Y(), { pages: n, currentPageId: r, setCurrentPageId: i, undo: a, redo: o, canUndo: s, canRedo: c, setIsPreviewMode: l, viewportMode: u, setViewportMode: d, getPages: f } = Z(), [p, m] = G("saved"), h = W(!0), _ = W({
|
|
15192
15203
|
getPages: f,
|
|
15193
15204
|
onSave: t.onSave
|
|
@@ -15227,7 +15238,7 @@ var fd = ({ node: e }) => {
|
|
|
15227
15238
|
t.shell?.onExit && /* @__PURE__ */ J("button", {
|
|
15228
15239
|
type: "button",
|
|
15229
15240
|
onClick: t.shell.onExit,
|
|
15230
|
-
className:
|
|
15241
|
+
className: yd,
|
|
15231
15242
|
children: [/* @__PURE__ */ q(wt, { className: "w-4 h-4" }), t.shell.exitLabel ?? "Back"]
|
|
15232
15243
|
}),
|
|
15233
15244
|
x.length > 1 && t.features?.pageSwitcher !== !1 && /* @__PURE__ */ q("select", {
|
|
@@ -15307,7 +15318,8 @@ var fd = ({ node: e }) => {
|
|
|
15307
15318
|
}),
|
|
15308
15319
|
/* @__PURE__ */ J("button", {
|
|
15309
15320
|
type: "button",
|
|
15310
|
-
|
|
15321
|
+
"data-coach": "preview",
|
|
15322
|
+
className: `${yd} border border-px-line2`,
|
|
15311
15323
|
onClick: () => l(!0),
|
|
15312
15324
|
children: [/* @__PURE__ */ q(y, { className: "w-4 h-4" }), "Preview"]
|
|
15313
15325
|
}),
|
|
@@ -15323,6 +15335,7 @@ var fd = ({ node: e }) => {
|
|
|
15323
15335
|
}),
|
|
15324
15336
|
t.onPublish && /* @__PURE__ */ q("button", {
|
|
15325
15337
|
type: "button",
|
|
15338
|
+
"data-coach": "publish",
|
|
15326
15339
|
className: "whitespace-nowrap shrink-0 inline-flex items-center h-9 px-4 rounded-lg bg-px-accent text-px-onaccent text-xs font-semibold cursor-pointer hover:bg-px-accent-hover disabled:opacity-60",
|
|
15327
15340
|
onClick: () => {
|
|
15328
15341
|
(async () => {
|
|
@@ -15335,7 +15348,7 @@ var fd = ({ node: e }) => {
|
|
|
15335
15348
|
})
|
|
15336
15349
|
]
|
|
15337
15350
|
});
|
|
15338
|
-
},
|
|
15351
|
+
}, xd = "min-w-0 inline-flex items-center justify-center gap-1.5 h-8 px-2 rounded-lg border border-px-line2 text-[11px] whitespace-nowrap text-px-text2 hover:text-px-text hover:bg-px-raised2 hover:border-px-line3 cursor-pointer disabled:opacity-30 disabled:cursor-default", Sd = ({ label: e = "Add something new", onClick: t, big: n }) => /* @__PURE__ */ q("button", {
|
|
15339
15352
|
type: "button",
|
|
15340
15353
|
onClick: t,
|
|
15341
15354
|
className: n ? "w-full h-11 rounded-xl border-2 border-dashed border-px-line3 text-xs font-semibold text-px-text2 hover:border-px-accent hover:text-px-accent inline-flex items-center justify-center gap-1.5 cursor-pointer transition-colors" : "group w-full h-4 flex items-center justify-center text-[10px] text-transparent hover:text-px-accent cursor-pointer",
|
|
@@ -15343,7 +15356,7 @@ var fd = ({ node: e }) => {
|
|
|
15343
15356
|
className: "inline-flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
|
|
15344
15357
|
children: [/* @__PURE__ */ q(B, { className: "w-3 h-3" }), e]
|
|
15345
15358
|
})
|
|
15346
|
-
}),
|
|
15359
|
+
}), Cd = ({ onAdd: e }) => {
|
|
15347
15360
|
let { documentTree: t, selectedNodeId: n, selectNode: r, revealNode: i, moveNodeUp: a, moveNodeDown: o, duplicateNode: s, deleteNode: c, undo: l } = Z(), u = An(t), d = ol(t, n), [f, p] = G(null);
|
|
15348
15361
|
return H(() => {
|
|
15349
15362
|
if (!f) return;
|
|
@@ -15360,7 +15373,7 @@ var fd = ({ node: e }) => {
|
|
|
15360
15373
|
className: "px-1 py-6 text-center text-xs text-px-muted",
|
|
15361
15374
|
children: "Nothing here yet. Add your first part."
|
|
15362
15375
|
}),
|
|
15363
|
-
/* @__PURE__ */ q(
|
|
15376
|
+
/* @__PURE__ */ q(Sd, {
|
|
15364
15377
|
onClick: () => e(null),
|
|
15365
15378
|
label: "Add something at the top"
|
|
15366
15379
|
}),
|
|
@@ -15395,7 +15408,7 @@ var fd = ({ node: e }) => {
|
|
|
15395
15408
|
children: [
|
|
15396
15409
|
/* @__PURE__ */ J("button", {
|
|
15397
15410
|
type: "button",
|
|
15398
|
-
className:
|
|
15411
|
+
className: xd,
|
|
15399
15412
|
disabled: n === 0,
|
|
15400
15413
|
onClick: () => a(t.id),
|
|
15401
15414
|
"aria-label": "Move this part up",
|
|
@@ -15403,7 +15416,7 @@ var fd = ({ node: e }) => {
|
|
|
15403
15416
|
}),
|
|
15404
15417
|
/* @__PURE__ */ J("button", {
|
|
15405
15418
|
type: "button",
|
|
15406
|
-
className:
|
|
15419
|
+
className: xd,
|
|
15407
15420
|
disabled: n === u.length - 1,
|
|
15408
15421
|
onClick: () => o(t.id),
|
|
15409
15422
|
"aria-label": "Move this part down",
|
|
@@ -15411,14 +15424,14 @@ var fd = ({ node: e }) => {
|
|
|
15411
15424
|
}),
|
|
15412
15425
|
/* @__PURE__ */ J("button", {
|
|
15413
15426
|
type: "button",
|
|
15414
|
-
className:
|
|
15427
|
+
className: xd,
|
|
15415
15428
|
onClick: () => s(t.id),
|
|
15416
15429
|
"aria-label": "Copy this part",
|
|
15417
15430
|
children: [/* @__PURE__ */ q(he, { className: "w-3.5 h-3.5 shrink-0" }), "Copy"]
|
|
15418
15431
|
}),
|
|
15419
15432
|
/* @__PURE__ */ J("button", {
|
|
15420
15433
|
type: "button",
|
|
15421
|
-
className: `${
|
|
15434
|
+
className: `${xd} hover:!text-red-300`,
|
|
15422
15435
|
onClick: () => {
|
|
15423
15436
|
p(il(t)), c(t.id);
|
|
15424
15437
|
},
|
|
@@ -15427,14 +15440,14 @@ var fd = ({ node: e }) => {
|
|
|
15427
15440
|
})
|
|
15428
15441
|
]
|
|
15429
15442
|
})]
|
|
15430
|
-
}), /* @__PURE__ */ q(
|
|
15443
|
+
}), /* @__PURE__ */ q(Sd, {
|
|
15431
15444
|
onClick: () => e(t.id),
|
|
15432
15445
|
label: "Add something here"
|
|
15433
15446
|
})] }, t.id);
|
|
15434
15447
|
}),
|
|
15435
15448
|
/* @__PURE__ */ q("div", {
|
|
15436
15449
|
className: "pt-1",
|
|
15437
|
-
children: /* @__PURE__ */ q(
|
|
15450
|
+
children: /* @__PURE__ */ q(Sd, {
|
|
15438
15451
|
big: !0,
|
|
15439
15452
|
onClick: () => e(u.length ? u[u.length - 1].id : null)
|
|
15440
15453
|
})
|
|
@@ -15457,9 +15470,11 @@ var fd = ({ node: e }) => {
|
|
|
15457
15470
|
})
|
|
15458
15471
|
]
|
|
15459
15472
|
});
|
|
15460
|
-
},
|
|
15461
|
-
let e = Y(), { activeSidebarTab: t, setActiveSidebarTab: n, openSectionPicker: r } = Z(), [i, a] = G("page"), o = t === "sections";
|
|
15473
|
+
}, wd = () => {
|
|
15474
|
+
let e = Y(), { activeSidebarTab: t, setActiveSidebarTab: n, openSectionPicker: r } = Z(), [i, a] = G(e.onAskSol ? "ask" : "page"), o = t === "sections", s = W(t);
|
|
15462
15475
|
H(() => {
|
|
15476
|
+
if (t === s.current) return;
|
|
15477
|
+
s.current = void 0;
|
|
15463
15478
|
let e = {
|
|
15464
15479
|
pages: "pages",
|
|
15465
15480
|
library: "pictures",
|
|
@@ -15470,7 +15485,15 @@ var fd = ({ node: e }) => {
|
|
|
15470
15485
|
};
|
|
15471
15486
|
t && t !== "sections" && e[t] && (a(e[t]), n(null));
|
|
15472
15487
|
}, [t, n]);
|
|
15473
|
-
let
|
|
15488
|
+
let c = [
|
|
15489
|
+
...e.onAskSol ? [{
|
|
15490
|
+
id: "ask",
|
|
15491
|
+
label: "Ask SOL",
|
|
15492
|
+
icon: /* @__PURE__ */ q(xs, {
|
|
15493
|
+
size: 16,
|
|
15494
|
+
className: "text-px-accent"
|
|
15495
|
+
})
|
|
15496
|
+
}] : [],
|
|
15474
15497
|
{
|
|
15475
15498
|
id: "page",
|
|
15476
15499
|
label: "Page",
|
|
@@ -15486,14 +15509,6 @@ var fd = ({ node: e }) => {
|
|
|
15486
15509
|
label: "Pages",
|
|
15487
15510
|
icon: /* @__PURE__ */ q(re, { className: "w-4 h-4" })
|
|
15488
15511
|
}] : [],
|
|
15489
|
-
...e.onAskSol ? [{
|
|
15490
|
-
id: "ask",
|
|
15491
|
-
label: "Ask SOL",
|
|
15492
|
-
icon: /* @__PURE__ */ q(xs, {
|
|
15493
|
-
size: 16,
|
|
15494
|
-
className: "text-px-accent"
|
|
15495
|
-
})
|
|
15496
|
-
}] : [],
|
|
15497
15512
|
...e.pageSettings ? [{
|
|
15498
15513
|
id: "settings",
|
|
15499
15514
|
label: "Settings",
|
|
@@ -15517,7 +15532,7 @@ var fd = ({ node: e }) => {
|
|
|
15517
15532
|
})] }) : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("nav", {
|
|
15518
15533
|
"aria-label": "Tools",
|
|
15519
15534
|
className: "flex border-b border-px-line shrink-0",
|
|
15520
|
-
children:
|
|
15535
|
+
children: c.map((e) => /* @__PURE__ */ J("button", {
|
|
15521
15536
|
type: "button",
|
|
15522
15537
|
"aria-pressed": i === e.id,
|
|
15523
15538
|
onClick: () => a(e.id),
|
|
@@ -15530,7 +15545,7 @@ var fd = ({ node: e }) => {
|
|
|
15530
15545
|
}), /* @__PURE__ */ J("div", {
|
|
15531
15546
|
className: "flex-1 min-h-0 flex flex-col",
|
|
15532
15547
|
children: [
|
|
15533
|
-
i === "page" && /* @__PURE__ */ q(
|
|
15548
|
+
i === "page" && /* @__PURE__ */ q(Cd, { onAdd: (e) => {
|
|
15534
15549
|
n("sections"), r(e);
|
|
15535
15550
|
} }),
|
|
15536
15551
|
i === "pictures" && /* @__PURE__ */ q("div", {
|
|
@@ -15543,7 +15558,7 @@ var fd = ({ node: e }) => {
|
|
|
15543
15558
|
}),
|
|
15544
15559
|
i === "ask" && /* @__PURE__ */ q("div", {
|
|
15545
15560
|
className: "flex-1 min-h-0",
|
|
15546
|
-
children: /* @__PURE__ */ q(
|
|
15561
|
+
children: /* @__PURE__ */ q(vl, {})
|
|
15547
15562
|
}),
|
|
15548
15563
|
i === "settings" && /* @__PURE__ */ q("div", {
|
|
15549
15564
|
className: "flex-1 min-h-0 overflow-y-auto",
|
|
@@ -15552,7 +15567,7 @@ var fd = ({ node: e }) => {
|
|
|
15552
15567
|
]
|
|
15553
15568
|
})] })
|
|
15554
15569
|
});
|
|
15555
|
-
},
|
|
15570
|
+
}, Td = [
|
|
15556
15571
|
["canvas", "Plain"],
|
|
15557
15572
|
["surface", "Light box"],
|
|
15558
15573
|
["sunken", "Soft grey"],
|
|
@@ -15561,7 +15576,7 @@ var fd = ({ node: e }) => {
|
|
|
15561
15576
|
["gradient", "Fade"],
|
|
15562
15577
|
["image", "Photo"]
|
|
15563
15578
|
];
|
|
15564
|
-
function
|
|
15579
|
+
function Ed({ value: e, options: t, onChange: n, label: r }) {
|
|
15565
15580
|
return /* @__PURE__ */ q("div", {
|
|
15566
15581
|
role: "radiogroup",
|
|
15567
15582
|
"aria-label": r,
|
|
@@ -15576,7 +15591,7 @@ function Td({ value: e, options: t, onChange: n, label: r }) {
|
|
|
15576
15591
|
}, t))
|
|
15577
15592
|
});
|
|
15578
15593
|
}
|
|
15579
|
-
var
|
|
15594
|
+
var Dd = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
15580
15595
|
className: "space-y-2",
|
|
15581
15596
|
children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("h3", {
|
|
15582
15597
|
className: "text-xs font-semibold text-px-text",
|
|
@@ -15585,33 +15600,33 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15585
15600
|
className: "text-[11px] leading-snug text-px-muted",
|
|
15586
15601
|
children: t
|
|
15587
15602
|
})] }), n]
|
|
15588
|
-
}),
|
|
15603
|
+
}), Od = "inline-flex items-center justify-center gap-1.5 h-9 px-3 rounded-lg border border-px-line2 bg-px-raised text-xs text-px-text hover:border-px-accent/60 cursor-pointer disabled:opacity-30 disabled:cursor-default", kd = ({ section: e, index: t, count: n }) => {
|
|
15589
15604
|
let { setSectionVariant: r, setSectionContent: i, setSectionStyle: a, moveNodeUp: o, moveNodeDown: s, duplicateNode: c, deleteNode: l } = Z(), u = gn(e), d = /* @__PURE__ */ J("div", {
|
|
15590
15605
|
className: "grid grid-cols-2 gap-2",
|
|
15591
15606
|
children: [
|
|
15592
15607
|
/* @__PURE__ */ J("button", {
|
|
15593
15608
|
type: "button",
|
|
15594
|
-
className:
|
|
15609
|
+
className: Od,
|
|
15595
15610
|
disabled: t === 0,
|
|
15596
15611
|
onClick: () => o(e.id),
|
|
15597
15612
|
children: [/* @__PURE__ */ q(Be, { className: "w-3.5 h-3.5" }), "Move up"]
|
|
15598
15613
|
}),
|
|
15599
15614
|
/* @__PURE__ */ J("button", {
|
|
15600
15615
|
type: "button",
|
|
15601
|
-
className:
|
|
15616
|
+
className: Od,
|
|
15602
15617
|
disabled: t === n - 1,
|
|
15603
15618
|
onClick: () => s(e.id),
|
|
15604
15619
|
children: [/* @__PURE__ */ q(Nt, { className: "w-3.5 h-3.5" }), "Move down"]
|
|
15605
15620
|
}),
|
|
15606
15621
|
/* @__PURE__ */ J("button", {
|
|
15607
15622
|
type: "button",
|
|
15608
|
-
className:
|
|
15623
|
+
className: Od,
|
|
15609
15624
|
onClick: () => c(e.id),
|
|
15610
15625
|
children: [/* @__PURE__ */ q(he, { className: "w-3.5 h-3.5" }), "Copy"]
|
|
15611
15626
|
}),
|
|
15612
15627
|
/* @__PURE__ */ J("button", {
|
|
15613
15628
|
type: "button",
|
|
15614
|
-
className: `${
|
|
15629
|
+
className: `${Od} hover:!text-red-300`,
|
|
15615
15630
|
onClick: () => l(e.id),
|
|
15616
15631
|
children: [/* @__PURE__ */ q(Ct, { className: "w-3.5 h-3.5" }), "Delete"]
|
|
15617
15632
|
})
|
|
@@ -15619,7 +15634,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15619
15634
|
});
|
|
15620
15635
|
if (!u) return /* @__PURE__ */ J("div", {
|
|
15621
15636
|
className: "p-4 space-y-5",
|
|
15622
|
-
children: [/* @__PURE__ */ q(
|
|
15637
|
+
children: [/* @__PURE__ */ q(Ad, {
|
|
15623
15638
|
title: il(e),
|
|
15624
15639
|
sub: "Click any words or picture inside it on your page to change them."
|
|
15625
15640
|
}), d]
|
|
@@ -15628,20 +15643,20 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15628
15643
|
return /* @__PURE__ */ J("div", {
|
|
15629
15644
|
className: "p-4 space-y-6",
|
|
15630
15645
|
children: [
|
|
15631
|
-
/* @__PURE__ */ q(
|
|
15646
|
+
/* @__PURE__ */ q(Ad, {
|
|
15632
15647
|
title: rl(u.kind, f.label),
|
|
15633
15648
|
sub: f.description
|
|
15634
15649
|
}),
|
|
15635
|
-
/* @__PURE__ */ q(
|
|
15650
|
+
/* @__PURE__ */ q(Dd, {
|
|
15636
15651
|
title: "1. Change the words",
|
|
15637
15652
|
hint: "Type in the boxes. Your page changes as you type.",
|
|
15638
|
-
children: /* @__PURE__ */ q(
|
|
15653
|
+
children: /* @__PURE__ */ q(Ku, {
|
|
15639
15654
|
fields: m,
|
|
15640
15655
|
get: (e) => u.content[e],
|
|
15641
15656
|
put: (t, n) => i(e.id, t, n)
|
|
15642
15657
|
})
|
|
15643
15658
|
}),
|
|
15644
|
-
f.variants.length > 1 && /* @__PURE__ */ q(
|
|
15659
|
+
f.variants.length > 1 && /* @__PURE__ */ q(Dd, {
|
|
15645
15660
|
title: "2. Pick a style",
|
|
15646
15661
|
hint: "Same words, set out in a different way.",
|
|
15647
15662
|
children: /* @__PURE__ */ q("div", {
|
|
@@ -15672,7 +15687,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15672
15687
|
}, t.id))
|
|
15673
15688
|
})
|
|
15674
15689
|
}),
|
|
15675
|
-
/* @__PURE__ */ q(
|
|
15690
|
+
/* @__PURE__ */ q(Dd, {
|
|
15676
15691
|
title: f.variants.length > 1 ? "3. Choose how it looks" : "2. Choose how it looks",
|
|
15677
15692
|
children: /* @__PURE__ */ J("div", {
|
|
15678
15693
|
className: "space-y-3",
|
|
@@ -15680,23 +15695,23 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15680
15695
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", {
|
|
15681
15696
|
className: "mb-1 text-[11px] text-px-muted",
|
|
15682
15697
|
children: "Colour behind it"
|
|
15683
|
-
}), /* @__PURE__ */ q(
|
|
15698
|
+
}), /* @__PURE__ */ q(Ed, {
|
|
15684
15699
|
label: "Background",
|
|
15685
15700
|
value: h.background ?? p.backgrounds?.[0] ?? "canvas",
|
|
15686
|
-
options:
|
|
15701
|
+
options: Td,
|
|
15687
15702
|
onChange: (t) => a(e.id, { background: t })
|
|
15688
15703
|
})] }),
|
|
15689
15704
|
(h.background ?? p.backgrounds?.[0]) === "image" && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", {
|
|
15690
15705
|
className: "mb-1 text-[11px] text-px-muted",
|
|
15691
15706
|
children: "Photo behind it"
|
|
15692
|
-
}), /* @__PURE__ */ q(
|
|
15707
|
+
}), /* @__PURE__ */ q(Tu, {
|
|
15693
15708
|
value: h.image ?? "",
|
|
15694
15709
|
onChange: (t) => a(e.id, { image: t })
|
|
15695
15710
|
})] }),
|
|
15696
15711
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", {
|
|
15697
15712
|
className: "mb-1 text-[11px] text-px-muted",
|
|
15698
15713
|
children: "Where the words sit"
|
|
15699
|
-
}), /* @__PURE__ */ q(
|
|
15714
|
+
}), /* @__PURE__ */ q(Ed, {
|
|
15700
15715
|
label: "Alignment",
|
|
15701
15716
|
value: h.align ?? "left",
|
|
15702
15717
|
options: [["left", "Left"], ["center", "Middle"]],
|
|
@@ -15705,7 +15720,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15705
15720
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", {
|
|
15706
15721
|
className: "mb-1 text-[11px] text-px-muted",
|
|
15707
15722
|
children: "Space around it"
|
|
15708
|
-
}), /* @__PURE__ */ q(
|
|
15723
|
+
}), /* @__PURE__ */ q(Ed, {
|
|
15709
15724
|
label: "Spacing",
|
|
15710
15725
|
value: h.spacing ?? "normal",
|
|
15711
15726
|
options: [
|
|
@@ -15718,24 +15733,24 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15718
15733
|
]
|
|
15719
15734
|
})
|
|
15720
15735
|
}),
|
|
15721
|
-
/* @__PURE__ */ q(
|
|
15736
|
+
/* @__PURE__ */ q(Dd, {
|
|
15722
15737
|
title: "Move, copy or remove",
|
|
15723
15738
|
children: d
|
|
15724
15739
|
})
|
|
15725
15740
|
]
|
|
15726
15741
|
});
|
|
15727
|
-
},
|
|
15742
|
+
}, Ad = ({ title: e, sub: t }) => /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("h2", {
|
|
15728
15743
|
className: "text-sm font-semibold text-px-text",
|
|
15729
15744
|
children: e
|
|
15730
15745
|
}), t && /* @__PURE__ */ q("p", {
|
|
15731
15746
|
className: "mt-0.5 text-[11px] leading-snug text-px-muted",
|
|
15732
15747
|
children: t
|
|
15733
|
-
})] }),
|
|
15748
|
+
})] }), jd = ({ node: e, section: t }) => {
|
|
15734
15749
|
let { startInlineEditing: n, updateNodeStyles: r, updateNodeProps: i, resolveStyles: a, designSystem: o, viewportMode: s, selectNode: c, deleteNode: l, duplicateNode: u } = Z(), d = a(e), f = e.type === "heading" || e.type === "paragraph" || e.type === "button" || e.type === "badge", p = f ? fn(e, d, o, s) : null, m = (t) => p && r(e.id, { fontSize: `${Math.max(8, Math.round(p.fontSize * (1 + t)))}px` }), h = t && gn(t) ? t : null;
|
|
15735
15750
|
return /* @__PURE__ */ J("div", {
|
|
15736
15751
|
className: "p-4 space-y-6",
|
|
15737
15752
|
children: [
|
|
15738
|
-
/* @__PURE__ */ q(
|
|
15753
|
+
/* @__PURE__ */ q(Ad, {
|
|
15739
15754
|
title: il(e),
|
|
15740
15755
|
sub: sl[e.type] ?? "Choose what to change below."
|
|
15741
15756
|
}),
|
|
@@ -15756,26 +15771,26 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15756
15771
|
})
|
|
15757
15772
|
]
|
|
15758
15773
|
}),
|
|
15759
|
-
f && /* @__PURE__ */ q(
|
|
15774
|
+
f && /* @__PURE__ */ q(Dd, {
|
|
15760
15775
|
title: "Change the words",
|
|
15761
15776
|
children: /* @__PURE__ */ J("button", {
|
|
15762
15777
|
type: "button",
|
|
15763
15778
|
onClick: () => n(e.id),
|
|
15764
|
-
className: `${
|
|
15779
|
+
className: `${Od} w-full`,
|
|
15765
15780
|
children: [/* @__PURE__ */ q(S, { className: "w-3.5 h-3.5" }), "Type new words"]
|
|
15766
15781
|
})
|
|
15767
15782
|
}),
|
|
15768
|
-
e.type === "button" && /* @__PURE__ */ q(
|
|
15783
|
+
e.type === "button" && /* @__PURE__ */ q(Dd, {
|
|
15769
15784
|
title: "Where does it take people?",
|
|
15770
|
-
children: /* @__PURE__ */ q(
|
|
15785
|
+
children: /* @__PURE__ */ q(hu, {
|
|
15771
15786
|
value: e.props?.href,
|
|
15772
15787
|
onChange: (t) => i(e.id, { href: t }),
|
|
15773
15788
|
label: "Takes people to"
|
|
15774
15789
|
})
|
|
15775
15790
|
}),
|
|
15776
|
-
e.type === "image" && /* @__PURE__ */ J(
|
|
15791
|
+
e.type === "image" && /* @__PURE__ */ J(Dd, {
|
|
15777
15792
|
title: "Picture",
|
|
15778
|
-
children: [/* @__PURE__ */ q(
|
|
15793
|
+
children: [/* @__PURE__ */ q(Tu, {
|
|
15779
15794
|
value: String(e.props?.src ?? ""),
|
|
15780
15795
|
onChange: (t) => i(e.id, { src: t })
|
|
15781
15796
|
}), /* @__PURE__ */ q("input", {
|
|
@@ -15787,7 +15802,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15787
15802
|
className: "w-full bg-px-raised border border-px-line2 rounded-lg px-2.5 h-8 text-xs text-px-text placeholder-px-faint focus:outline-none focus:border-px-accent"
|
|
15788
15803
|
})]
|
|
15789
15804
|
}),
|
|
15790
|
-
f && /* @__PURE__ */ q(
|
|
15805
|
+
f && /* @__PURE__ */ q(Dd, {
|
|
15791
15806
|
title: "Make it look right",
|
|
15792
15807
|
children: /* @__PURE__ */ J("div", {
|
|
15793
15808
|
className: "space-y-3",
|
|
@@ -15803,14 +15818,14 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15803
15818
|
type: "button",
|
|
15804
15819
|
"aria-label": "Smaller",
|
|
15805
15820
|
onClick: () => m(-.12),
|
|
15806
|
-
className: `${
|
|
15821
|
+
className: `${Od} !px-2.5`,
|
|
15807
15822
|
children: /* @__PURE__ */ q(qe, { className: "w-3.5 h-3.5" })
|
|
15808
15823
|
}),
|
|
15809
15824
|
/* @__PURE__ */ q("button", {
|
|
15810
15825
|
type: "button",
|
|
15811
15826
|
"aria-label": "Bigger",
|
|
15812
15827
|
onClick: () => m(.12),
|
|
15813
|
-
className: `${
|
|
15828
|
+
className: `${Od} !px-2.5`,
|
|
15814
15829
|
children: /* @__PURE__ */ q(B, { className: "w-3.5 h-3.5" })
|
|
15815
15830
|
})
|
|
15816
15831
|
]
|
|
@@ -15820,7 +15835,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15820
15835
|
children: [/* @__PURE__ */ q("span", {
|
|
15821
15836
|
className: "w-16 text-[11px] text-px-muted",
|
|
15822
15837
|
children: "Sits on"
|
|
15823
|
-
}), /* @__PURE__ */ q(
|
|
15838
|
+
}), /* @__PURE__ */ q(Ed, {
|
|
15824
15839
|
label: "Alignment",
|
|
15825
15840
|
value: d.textAlign === "center" || d.textAlign === "right" ? d.textAlign : "left",
|
|
15826
15841
|
options: [
|
|
@@ -15838,7 +15853,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15838
15853
|
children: "Colour"
|
|
15839
15854
|
}), /* @__PURE__ */ q("div", {
|
|
15840
15855
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
15841
|
-
children: /* @__PURE__ */ q(
|
|
15856
|
+
children: /* @__PURE__ */ q(iu, {
|
|
15842
15857
|
className: "flex-1 min-w-0 w-full",
|
|
15843
15858
|
value: d.textColor || "#111827",
|
|
15844
15859
|
onChange: (t) => r(e.id, { textColor: t })
|
|
@@ -15848,18 +15863,18 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15848
15863
|
]
|
|
15849
15864
|
})
|
|
15850
15865
|
}),
|
|
15851
|
-
/* @__PURE__ */ q(
|
|
15866
|
+
/* @__PURE__ */ q(Dd, {
|
|
15852
15867
|
title: "Copy or remove",
|
|
15853
15868
|
children: /* @__PURE__ */ J("div", {
|
|
15854
15869
|
className: "grid grid-cols-2 gap-2",
|
|
15855
15870
|
children: [/* @__PURE__ */ J("button", {
|
|
15856
15871
|
type: "button",
|
|
15857
|
-
className:
|
|
15872
|
+
className: Od,
|
|
15858
15873
|
onClick: () => u(e.id),
|
|
15859
15874
|
children: [/* @__PURE__ */ q(he, { className: "w-3.5 h-3.5" }), "Copy"]
|
|
15860
15875
|
}), /* @__PURE__ */ J("button", {
|
|
15861
15876
|
type: "button",
|
|
15862
|
-
className: `${
|
|
15877
|
+
className: `${Od} hover:!text-red-300`,
|
|
15863
15878
|
onClick: () => l(e.id),
|
|
15864
15879
|
children: [/* @__PURE__ */ q(Ct, { className: "w-3.5 h-3.5" }), "Delete"]
|
|
15865
15880
|
})]
|
|
@@ -15867,9 +15882,9 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15867
15882
|
})
|
|
15868
15883
|
]
|
|
15869
15884
|
});
|
|
15870
|
-
},
|
|
15885
|
+
}, Md = () => /* @__PURE__ */ J("div", {
|
|
15871
15886
|
className: "p-5 space-y-4",
|
|
15872
|
-
children: [/* @__PURE__ */ q(
|
|
15887
|
+
children: [/* @__PURE__ */ q(Ad, {
|
|
15873
15888
|
title: "What would you like to change?",
|
|
15874
15889
|
sub: "Click a part in the list on the left, or click any words or picture on your page. What you can change will show up here."
|
|
15875
15890
|
}), /* @__PURE__ */ q("div", {
|
|
@@ -15890,122 +15905,225 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
15890
15905
|
})]
|
|
15891
15906
|
}, e))
|
|
15892
15907
|
})]
|
|
15893
|
-
}),
|
|
15908
|
+
}), Nd = () => {
|
|
15894
15909
|
let { documentTree: e, selectedNode: t, selectedNodeId: n } = Z(), r = e.children ?? [], i = ol(e, n), a = !!t && !!i && t.id === i.id, o = t && !a ? mr(e, t.id) ?? i : i;
|
|
15895
15910
|
return /* @__PURE__ */ q("aside", {
|
|
15896
15911
|
"aria-label": "Change this",
|
|
15897
15912
|
className: "w-[272px] shrink-0 bg-px-surface border-l border-px-line h-full overflow-y-auto z-20",
|
|
15898
|
-
children: !t || t.id === e.id || !i ? /* @__PURE__ */ q(
|
|
15913
|
+
children: !t || t.id === e.id || !i ? /* @__PURE__ */ q(Md, {}) : a ? /* @__PURE__ */ q(kd, {
|
|
15899
15914
|
section: i,
|
|
15900
15915
|
index: r.findIndex((e) => e.id === i.id),
|
|
15901
15916
|
count: r.length
|
|
15902
|
-
}, i.id) : /* @__PURE__ */ q(
|
|
15917
|
+
}, i.id) : /* @__PURE__ */ q(jd, {
|
|
15903
15918
|
node: t,
|
|
15904
15919
|
section: o
|
|
15905
15920
|
}, t.id)
|
|
15906
15921
|
});
|
|
15907
|
-
},
|
|
15922
|
+
}, Pd = "plexo-simple-guide-done", Fd = () => {
|
|
15908
15923
|
try {
|
|
15909
|
-
return localStorage.getItem(
|
|
15924
|
+
return localStorage.getItem(Pd) === "1";
|
|
15910
15925
|
} catch {
|
|
15911
15926
|
return !1;
|
|
15912
15927
|
}
|
|
15913
|
-
},
|
|
15928
|
+
}, Id = () => {
|
|
15914
15929
|
try {
|
|
15915
|
-
localStorage.setItem(
|
|
15930
|
+
localStorage.setItem(Pd, "1");
|
|
15916
15931
|
} catch {}
|
|
15917
|
-
},
|
|
15932
|
+
}, Ld = [
|
|
15933
|
+
{
|
|
15934
|
+
title: "Tell SOL what to change",
|
|
15935
|
+
body: "The easiest way: type what you want, like “make the top more welcoming”, and SOL does it for you. You can undo anything.",
|
|
15936
|
+
target: "aside[aria-label=\"Your page\"]",
|
|
15937
|
+
tab: "Ask SOL",
|
|
15938
|
+
needsSol: !0
|
|
15939
|
+
},
|
|
15918
15940
|
{
|
|
15919
15941
|
title: "Your page is built in parts",
|
|
15920
|
-
body: "
|
|
15942
|
+
body: "This list is your page, from top to bottom. Each box is one part of it. Click a box to find it on your page.",
|
|
15943
|
+
target: "aside[aria-label=\"Your page\"]",
|
|
15944
|
+
tab: "Page"
|
|
15921
15945
|
},
|
|
15922
15946
|
{
|
|
15923
|
-
title: "
|
|
15924
|
-
body: "Click
|
|
15947
|
+
title: "This is your page",
|
|
15948
|
+
body: "Click any words or picture to pick it. Double-click words to type your own. Nothing here can break.",
|
|
15949
|
+
target: "[data-coach=\"page\"]"
|
|
15925
15950
|
},
|
|
15926
15951
|
{
|
|
15927
|
-
title: "
|
|
15928
|
-
body: "
|
|
15952
|
+
title: "Change it here",
|
|
15953
|
+
body: "When you pick something, the boxes on this side let you change the words, the style and the picture.",
|
|
15954
|
+
target: "aside[aria-label=\"Change this\"]"
|
|
15929
15955
|
},
|
|
15930
15956
|
{
|
|
15931
15957
|
title: "Add something new",
|
|
15932
|
-
body: "Press
|
|
15958
|
+
body: "Press this to choose a ready-made part, like prices, a contact form or photos. They already have words in: just change them.",
|
|
15959
|
+
target: "__add__",
|
|
15960
|
+
tab: "Page"
|
|
15933
15961
|
},
|
|
15934
15962
|
{
|
|
15935
15963
|
title: "Look, then share",
|
|
15936
|
-
body: "
|
|
15964
|
+
body: "Preview shows your page the way visitors will see it. When you are happy, press “Make it live” so everyone can see it. Your changes are kept safe automatically.",
|
|
15965
|
+
target: "[data-coach=\"publish\"], [data-coach=\"preview\"]"
|
|
15937
15966
|
}
|
|
15938
|
-
],
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
let
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15967
|
+
], Rd = 320, zd = 14, Bd = 6;
|
|
15968
|
+
function Vd(e, t) {
|
|
15969
|
+
return t === "__add__" ? [...e.querySelectorAll("aside[aria-label=\"Your page\"] button")].find((e) => (e.textContent ?? "").trim().startsWith("Add something new")) ?? null : e.querySelector(t);
|
|
15970
|
+
}
|
|
15971
|
+
function Hd(e, t) {
|
|
15972
|
+
let n = [...e.querySelectorAll("aside[aria-label=\"Your page\"] button[aria-pressed]")].find((e) => (e.textContent ?? "").trim() === t);
|
|
15973
|
+
n && n.getAttribute("aria-pressed") !== "true" && n.click();
|
|
15974
|
+
}
|
|
15975
|
+
var Ud = ({ open: e, onClose: t }) => {
|
|
15976
|
+
let n = Y(), r = Ld.filter((e) => !e.needsSol || n.onAskSol), [i, a] = G(0), [o, s] = G(null), [c, l] = G(170), u = W(null), d = W(null), f = W(null);
|
|
15977
|
+
H(() => {
|
|
15978
|
+
e && a(0);
|
|
15979
|
+
}, [e]);
|
|
15980
|
+
let p = r[Math.min(i, r.length - 1)], m = () => u.current?.parentElement, h = V(() => {
|
|
15981
|
+
let e = m(), t = u.current;
|
|
15982
|
+
if (!e || !t) return;
|
|
15983
|
+
let n = Vd(e, p.target);
|
|
15984
|
+
if (!n) {
|
|
15985
|
+
s(null);
|
|
15986
|
+
return;
|
|
15987
|
+
}
|
|
15988
|
+
let r = t.getBoundingClientRect(), i = n.getBoundingClientRect();
|
|
15989
|
+
s({
|
|
15990
|
+
x: i.left - r.left,
|
|
15991
|
+
y: i.top - r.top,
|
|
15992
|
+
w: i.width,
|
|
15993
|
+
h: i.height
|
|
15994
|
+
}), d.current && l(d.current.offsetHeight);
|
|
15995
|
+
}, [p.target]);
|
|
15996
|
+
if (Co(() => {
|
|
15997
|
+
if (!e) return;
|
|
15998
|
+
let t = m();
|
|
15999
|
+
t && p.tab && Hd(t, p.tab), h();
|
|
16000
|
+
let n = setTimeout(h, 60), r = setTimeout(h, 300);
|
|
16001
|
+
return () => {
|
|
16002
|
+
clearTimeout(n), clearTimeout(r);
|
|
16003
|
+
};
|
|
16004
|
+
}, [
|
|
16005
|
+
e,
|
|
16006
|
+
i,
|
|
16007
|
+
p.tab,
|
|
16008
|
+
h
|
|
16009
|
+
]), H(() => {
|
|
16010
|
+
if (!e) return;
|
|
16011
|
+
let t = m();
|
|
16012
|
+
window.addEventListener("resize", h);
|
|
16013
|
+
let n = typeof ResizeObserver < "u" && t ? new ResizeObserver(h) : null;
|
|
16014
|
+
return t && n?.observe(t), () => {
|
|
16015
|
+
window.removeEventListener("resize", h), n?.disconnect();
|
|
16016
|
+
};
|
|
16017
|
+
}, [e, h]), H(() => {
|
|
16018
|
+
e && f.current?.focus();
|
|
16019
|
+
}, [e, i]), !e) return null;
|
|
16020
|
+
let g = i >= r.length - 1, _ = () => {
|
|
16021
|
+
Id(), t();
|
|
16022
|
+
}, v = u.current?.getBoundingClientRect(), y = v?.width ?? 1e3, b = v?.height ?? 700, x = (y - Rd) / 2, S = b - c - 24;
|
|
16023
|
+
if (o) {
|
|
16024
|
+
let e = o.x + o.w / 2;
|
|
16025
|
+
o.w < y * .45 && e < y * .4 ? (x = o.x + o.w + zd, S = o.y + 16) : o.w < y * .45 && e > y * .6 ? (x = o.x - Rd - zd, S = o.y + 16) : o.y < b * .25 ? (x = e - Rd / 2, S = o.y + o.h + zd) : (x = e - Rd / 2, S = o.y + 24);
|
|
16026
|
+
}
|
|
16027
|
+
return x = Math.max(12, Math.min(x, y - Rd - 12)), S = Math.max(12, Math.min(S, b - c - 12)), /* @__PURE__ */ J("div", {
|
|
16028
|
+
ref: u,
|
|
16029
|
+
className: "absolute inset-0 z-[80] pointer-events-none",
|
|
16030
|
+
onKeyDown: (e) => {
|
|
16031
|
+
e.key === "Escape" && _();
|
|
16032
|
+
},
|
|
15950
16033
|
children: [
|
|
15951
|
-
/* @__PURE__ */
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15957
|
-
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
}), /* @__PURE__ */ q("button", {
|
|
15962
|
-
type: "button",
|
|
15963
|
-
onClick: a,
|
|
15964
|
-
"aria-label": "Close guide",
|
|
15965
|
-
className: "text-px-muted hover:text-px-text cursor-pointer",
|
|
15966
|
-
children: /* @__PURE__ */ q(Ce, { className: "w-4 h-4" })
|
|
15967
|
-
})]
|
|
15968
|
-
}),
|
|
15969
|
-
/* @__PURE__ */ q("h2", {
|
|
15970
|
-
className: "mt-1 text-sm font-semibold text-px-text",
|
|
15971
|
-
children: o.title
|
|
16034
|
+
o && /* @__PURE__ */ q("div", {
|
|
16035
|
+
"aria-hidden": "true",
|
|
16036
|
+
className: "plexo-coach-spot absolute rounded-xl ring-2 ring-px-accent",
|
|
16037
|
+
style: {
|
|
16038
|
+
left: o.x - Bd,
|
|
16039
|
+
top: o.y - Bd,
|
|
16040
|
+
width: o.w + Bd * 2,
|
|
16041
|
+
height: o.h + Bd * 2,
|
|
16042
|
+
boxShadow: "0 0 0 9999px rgba(0,0,0,0.55)"
|
|
16043
|
+
}
|
|
15972
16044
|
}),
|
|
15973
|
-
/* @__PURE__ */ q("
|
|
15974
|
-
|
|
15975
|
-
|
|
16045
|
+
!o && /* @__PURE__ */ q("div", {
|
|
16046
|
+
"aria-hidden": "true",
|
|
16047
|
+
className: "absolute inset-0 bg-black/55"
|
|
15976
16048
|
}),
|
|
15977
16049
|
/* @__PURE__ */ J("div", {
|
|
15978
|
-
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
16050
|
+
ref: d,
|
|
16051
|
+
role: "dialog",
|
|
16052
|
+
"aria-label": "Quick guide",
|
|
16053
|
+
className: "plexo-coach-card absolute pointer-events-auto rounded-2xl border border-px-line2 bg-px-surface shadow-2xl p-4",
|
|
16054
|
+
style: {
|
|
16055
|
+
left: x,
|
|
16056
|
+
top: S,
|
|
16057
|
+
width: Rd
|
|
16058
|
+
},
|
|
16059
|
+
children: [
|
|
16060
|
+
/* @__PURE__ */ J("div", {
|
|
16061
|
+
className: "flex items-start justify-between gap-3",
|
|
16062
|
+
children: [/* @__PURE__ */ J("div", {
|
|
16063
|
+
className: "text-[10px] font-semibold uppercase tracking-wider text-px-accent-soft",
|
|
16064
|
+
children: [
|
|
16065
|
+
"Step ",
|
|
16066
|
+
i + 1,
|
|
16067
|
+
" of ",
|
|
16068
|
+
r.length
|
|
16069
|
+
]
|
|
16070
|
+
}), /* @__PURE__ */ q("button", {
|
|
16071
|
+
type: "button",
|
|
16072
|
+
onClick: _,
|
|
16073
|
+
"aria-label": "Close guide",
|
|
16074
|
+
className: "text-px-muted hover:text-px-text cursor-pointer",
|
|
16075
|
+
children: /* @__PURE__ */ q(Ce, { className: "w-4 h-4" })
|
|
16076
|
+
})]
|
|
16077
|
+
}),
|
|
16078
|
+
/* @__PURE__ */ q("h2", {
|
|
16079
|
+
className: "mt-1 text-sm font-semibold text-px-text",
|
|
16080
|
+
children: p.title
|
|
16081
|
+
}),
|
|
16082
|
+
/* @__PURE__ */ q("p", {
|
|
16083
|
+
className: "mt-1 text-xs leading-relaxed text-px-text2",
|
|
16084
|
+
children: p.body
|
|
16085
|
+
}),
|
|
16086
|
+
/* @__PURE__ */ J("div", {
|
|
16087
|
+
className: "mt-3 flex items-center justify-between",
|
|
16088
|
+
children: [/* @__PURE__ */ q("div", {
|
|
16089
|
+
className: "flex gap-1",
|
|
16090
|
+
"aria-hidden": "true",
|
|
16091
|
+
children: r.map((e, t) => /* @__PURE__ */ q("span", { className: `h-1.5 rounded-full transition-all ${t === i ? "w-4 bg-px-accent" : "w-1.5 bg-px-line3"}` }, t))
|
|
16092
|
+
}), /* @__PURE__ */ J("div", {
|
|
16093
|
+
className: "flex items-center gap-2",
|
|
16094
|
+
children: [i > 0 && /* @__PURE__ */ q("button", {
|
|
16095
|
+
type: "button",
|
|
16096
|
+
onClick: () => a(i - 1),
|
|
16097
|
+
className: "h-8 px-3 rounded-lg text-xs text-px-muted hover:text-px-text cursor-pointer",
|
|
16098
|
+
children: "Back"
|
|
16099
|
+
}), /* @__PURE__ */ J("button", {
|
|
16100
|
+
ref: f,
|
|
16101
|
+
type: "button",
|
|
16102
|
+
onClick: () => g ? _() : a(i + 1),
|
|
16103
|
+
className: "h-8 px-4 rounded-lg bg-px-accent text-px-onaccent text-xs font-semibold inline-flex items-center gap-1 cursor-pointer hover:bg-px-accent-hover",
|
|
16104
|
+
children: [g ? "Got it" : "Next", !g && /* @__PURE__ */ q(ke, { className: "w-3.5 h-3.5" })]
|
|
16105
|
+
})]
|
|
16106
|
+
})]
|
|
16107
|
+
}),
|
|
16108
|
+
i === 0 && /* @__PURE__ */ q("button", {
|
|
15991
16109
|
type: "button",
|
|
15992
|
-
onClick:
|
|
15993
|
-
className: "
|
|
15994
|
-
children:
|
|
15995
|
-
})
|
|
15996
|
-
|
|
16110
|
+
onClick: _,
|
|
16111
|
+
className: "mt-2 text-[11px] text-px-muted hover:text-px-text underline cursor-pointer",
|
|
16112
|
+
children: "Skip the tour"
|
|
16113
|
+
})
|
|
16114
|
+
]
|
|
15997
16115
|
})
|
|
15998
16116
|
]
|
|
15999
16117
|
});
|
|
16000
|
-
},
|
|
16118
|
+
}, Wd = () => !Fd(), Gd = () => {
|
|
16001
16119
|
let { selectedNode: e, editingNodeId: t, documentTree: n } = Z();
|
|
16002
16120
|
return /* @__PURE__ */ q("div", {
|
|
16003
16121
|
role: "note",
|
|
16004
16122
|
className: "pointer-events-none absolute top-3 left-1/2 -translate-x-1/2 z-30 rounded-full border border-px-line2 bg-px-surface/95 px-4 py-1.5 text-[11px] text-px-text2 shadow-lg",
|
|
16005
16123
|
children: t ? "Type your words. Click anywhere else when you are finished." : !e || e.id === n.id ? "Tip: click any part of your page to change it." : e.type === "section" ? "Type in the boxes on the right to change the words." : e.type === "image" ? "Choose a new picture on the right." : "Tip: double-click the words to type your own."
|
|
16006
16124
|
});
|
|
16007
|
-
},
|
|
16008
|
-
let e = Z(), { activeSidebarTab: t, setIsPreviewMode: n, isPreviewMode: r, undo: i } = e, a = Y(), o = a.experience === "beginner", [s, c] = G(() => o &&
|
|
16125
|
+
}, Kd = () => {
|
|
16126
|
+
let e = Z(), { activeSidebarTab: t, setIsPreviewMode: n, isPreviewMode: r, undo: i } = e, a = Y(), o = a.experience === "beginner", [s, c] = G(() => o && Wd()), l = W(null), u = W(!1);
|
|
16009
16127
|
H(() => {
|
|
16010
16128
|
let e = (e) => {
|
|
16011
16129
|
u.current = !!l.current && e.target instanceof Node && l.current.contains(e.target);
|
|
@@ -16112,27 +16230,28 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
16112
16230
|
className: "flex flex-col h-full w-full overflow-hidden bg-px-canvas text-px-text font-sans antialiased",
|
|
16113
16231
|
children: /* @__PURE__ */ q("div", {
|
|
16114
16232
|
className: "flex-1 flex overflow-hidden relative",
|
|
16115
|
-
children: /* @__PURE__ */ q(
|
|
16233
|
+
children: /* @__PURE__ */ q(nu, {})
|
|
16116
16234
|
})
|
|
16117
16235
|
}) : o ? /* @__PURE__ */ J("div", {
|
|
16118
16236
|
ref: l,
|
|
16119
16237
|
"data-experience": "beginner",
|
|
16120
16238
|
className: "relative flex flex-col h-full w-full overflow-hidden bg-px-canvas text-px-text font-sans antialiased",
|
|
16121
16239
|
children: [
|
|
16122
|
-
/* @__PURE__ */ q(
|
|
16240
|
+
/* @__PURE__ */ q(bd, { onHelp: () => c(!0) }),
|
|
16123
16241
|
/* @__PURE__ */ J("div", {
|
|
16124
16242
|
className: "flex-1 flex overflow-hidden relative",
|
|
16125
16243
|
children: [
|
|
16126
|
-
/* @__PURE__ */ q(
|
|
16244
|
+
/* @__PURE__ */ q(wd, {}),
|
|
16127
16245
|
/* @__PURE__ */ J("div", {
|
|
16246
|
+
"data-coach": "page",
|
|
16128
16247
|
className: "flex-1 min-w-0 relative flex",
|
|
16129
|
-
children: [/* @__PURE__ */ q(
|
|
16248
|
+
children: [/* @__PURE__ */ q(nu, {}), /* @__PURE__ */ q(Gd, {})]
|
|
16130
16249
|
}),
|
|
16131
|
-
/* @__PURE__ */ q(
|
|
16250
|
+
/* @__PURE__ */ q(Nd, {})
|
|
16132
16251
|
]
|
|
16133
16252
|
}),
|
|
16134
|
-
r && /* @__PURE__ */ q(
|
|
16135
|
-
/* @__PURE__ */ q(
|
|
16253
|
+
r && /* @__PURE__ */ q(vd, {}),
|
|
16254
|
+
/* @__PURE__ */ q(Ud, {
|
|
16136
16255
|
open: s,
|
|
16137
16256
|
onClose: () => c(!1)
|
|
16138
16257
|
}),
|
|
@@ -16154,7 +16273,7 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
16154
16273
|
children: "Undo"
|
|
16155
16274
|
})]
|
|
16156
16275
|
}, f.key),
|
|
16157
|
-
/* @__PURE__ */ q(
|
|
16276
|
+
/* @__PURE__ */ q(gd, {})
|
|
16158
16277
|
]
|
|
16159
16278
|
}) : /* @__PURE__ */ J("div", {
|
|
16160
16279
|
ref: l,
|
|
@@ -16165,12 +16284,12 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
16165
16284
|
className: "flex-1 flex overflow-hidden relative",
|
|
16166
16285
|
children: [
|
|
16167
16286
|
/* @__PURE__ */ q(Hs, {}),
|
|
16168
|
-
t && /* @__PURE__ */ q(
|
|
16169
|
-
/* @__PURE__ */ q(
|
|
16170
|
-
/* @__PURE__ */ q(
|
|
16287
|
+
t && /* @__PURE__ */ q(bl, {}),
|
|
16288
|
+
/* @__PURE__ */ q(nu, {}),
|
|
16289
|
+
/* @__PURE__ */ q(hd, {})
|
|
16171
16290
|
]
|
|
16172
16291
|
}),
|
|
16173
|
-
r && /* @__PURE__ */ q(
|
|
16292
|
+
r && /* @__PURE__ */ q(vd, {}),
|
|
16174
16293
|
f && /* @__PURE__ */ J("div", {
|
|
16175
16294
|
role: "status",
|
|
16176
16295
|
className: "absolute bottom-5 left-1/2 -translate-x-1/2 z-[90] flex items-center gap-3 rounded-xl border border-px-line2 bg-px-surface px-4 py-2.5 text-xs text-px-text shadow-2xl",
|
|
@@ -16189,10 +16308,10 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
16189
16308
|
children: "Undo"
|
|
16190
16309
|
})]
|
|
16191
16310
|
}, f.key),
|
|
16192
|
-
/* @__PURE__ */ q(
|
|
16311
|
+
/* @__PURE__ */ q(gd, {})
|
|
16193
16312
|
]
|
|
16194
16313
|
});
|
|
16195
|
-
},
|
|
16314
|
+
}, qd = _o.forwardRef(({ rootRef: e, host: t }, n) => {
|
|
16196
16315
|
let { getPages: r, pages: i, getDesignSystem: a } = Z(), o = W(r);
|
|
16197
16316
|
o.current = r, So(n, () => ({
|
|
16198
16317
|
getPages: () => o.current(),
|
|
@@ -16216,8 +16335,8 @@ var Ed = ({ title: e, hint: t, children: n }) => /* @__PURE__ */ J("section", {
|
|
|
16216
16335
|
t.autoSaveDuration
|
|
16217
16336
|
]), null;
|
|
16218
16337
|
});
|
|
16219
|
-
|
|
16220
|
-
var
|
|
16338
|
+
qd.displayName = "V2EditorBridge";
|
|
16339
|
+
var Jd = yo(function(e, t) {
|
|
16221
16340
|
let { className: n, pages: r, initialPageId: i, onChange: a, designSystem: o, onDesignSystemChange: s, ...c } = e, l = W(null), u = U(() => r && r.length ? r : c.mode === "email" ? c.experience === "beginner" ? ir() : gr() : c.experience === "beginner" ? wn() : $t(), []);
|
|
16222
16341
|
return /* @__PURE__ */ q("div", {
|
|
16223
16342
|
ref: l,
|
|
@@ -16238,20 +16357,20 @@ var Hd = yo(function(e, t) {
|
|
|
16238
16357
|
designSystem: o,
|
|
16239
16358
|
onDesignSystemChange: s,
|
|
16240
16359
|
children: [
|
|
16241
|
-
/* @__PURE__ */ q(
|
|
16360
|
+
/* @__PURE__ */ q(qd, {
|
|
16242
16361
|
ref: t,
|
|
16243
16362
|
rootRef: l,
|
|
16244
16363
|
host: c
|
|
16245
16364
|
}),
|
|
16246
|
-
/* @__PURE__ */ q(
|
|
16365
|
+
/* @__PURE__ */ q(Nl, {}),
|
|
16247
16366
|
/* @__PURE__ */ q(ms, {}),
|
|
16248
|
-
/* @__PURE__ */ q(
|
|
16367
|
+
/* @__PURE__ */ q(Kd, {}),
|
|
16249
16368
|
/* @__PURE__ */ q(hs, {})
|
|
16250
16369
|
]
|
|
16251
16370
|
})
|
|
16252
16371
|
})
|
|
16253
16372
|
});
|
|
16254
|
-
}),
|
|
16373
|
+
}), Yd = "w-7 h-7 rounded-lg flex items-center justify-center text-px-muted hover:text-px-text hover:bg-px-raised2 cursor-pointer shrink-0", Xd = ({ value: e, onChange: t, readOnly: n }) => {
|
|
16255
16374
|
let r = e.trim() ? e.trim().split(/\s+/).length : 0;
|
|
16256
16375
|
return /* @__PURE__ */ J("div", {
|
|
16257
16376
|
className: "h-full flex flex-col bg-px-canvas",
|
|
@@ -16272,7 +16391,7 @@ var Hd = yo(function(e, t) {
|
|
|
16272
16391
|
] }), /* @__PURE__ */ J("span", { children: [e.length.toLocaleString(), " characters"] })]
|
|
16273
16392
|
})]
|
|
16274
16393
|
});
|
|
16275
|
-
},
|
|
16394
|
+
}, Zd = ({ markdown: e }) => {
|
|
16276
16395
|
let t = U(() => eo(e), [e]);
|
|
16277
16396
|
return /* @__PURE__ */ J("div", {
|
|
16278
16397
|
className: "h-full overflow-auto bg-white",
|
|
@@ -16281,7 +16400,7 @@ var Hd = yo(function(e, t) {
|
|
|
16281
16400
|
dangerouslySetInnerHTML: { __html: t }
|
|
16282
16401
|
})]
|
|
16283
16402
|
});
|
|
16284
|
-
},
|
|
16403
|
+
}, Qd = ({ value: e, onChange: t }) => {
|
|
16285
16404
|
let n = W(null), i = (r, i = r, a = "text") => {
|
|
16286
16405
|
let o = n.current;
|
|
16287
16406
|
if (!o) return;
|
|
@@ -16304,7 +16423,7 @@ var Hd = yo(function(e, t) {
|
|
|
16304
16423
|
type: "button",
|
|
16305
16424
|
title: "Big heading",
|
|
16306
16425
|
"aria-label": "Big heading",
|
|
16307
|
-
className:
|
|
16426
|
+
className: Yd,
|
|
16308
16427
|
onClick: () => a("# "),
|
|
16309
16428
|
children: /* @__PURE__ */ q(r, { className: "w-4 h-4" })
|
|
16310
16429
|
}),
|
|
@@ -16312,7 +16431,7 @@ var Hd = yo(function(e, t) {
|
|
|
16312
16431
|
type: "button",
|
|
16313
16432
|
title: "Heading",
|
|
16314
16433
|
"aria-label": "Heading",
|
|
16315
|
-
className:
|
|
16434
|
+
className: Yd,
|
|
16316
16435
|
onClick: () => a("## "),
|
|
16317
16436
|
children: /* @__PURE__ */ q(Ze, { className: "w-4 h-4" })
|
|
16318
16437
|
}),
|
|
@@ -16320,7 +16439,7 @@ var Hd = yo(function(e, t) {
|
|
|
16320
16439
|
type: "button",
|
|
16321
16440
|
title: "Bold",
|
|
16322
16441
|
"aria-label": "Bold",
|
|
16323
|
-
className:
|
|
16442
|
+
className: Yd,
|
|
16324
16443
|
onClick: () => i("**"),
|
|
16325
16444
|
children: /* @__PURE__ */ q(Ue, { className: "w-4 h-4" })
|
|
16326
16445
|
}),
|
|
@@ -16328,7 +16447,7 @@ var Hd = yo(function(e, t) {
|
|
|
16328
16447
|
type: "button",
|
|
16329
16448
|
title: "Italic",
|
|
16330
16449
|
"aria-label": "Italic",
|
|
16331
|
-
className:
|
|
16450
|
+
className: Yd,
|
|
16332
16451
|
onClick: () => i("*"),
|
|
16333
16452
|
children: /* @__PURE__ */ q(c, { className: "w-4 h-4" })
|
|
16334
16453
|
}),
|
|
@@ -16336,7 +16455,7 @@ var Hd = yo(function(e, t) {
|
|
|
16336
16455
|
type: "button",
|
|
16337
16456
|
title: "Bulleted list",
|
|
16338
16457
|
"aria-label": "Bulleted list",
|
|
16339
|
-
className:
|
|
16458
|
+
className: Yd,
|
|
16340
16459
|
onClick: () => a("- "),
|
|
16341
16460
|
children: /* @__PURE__ */ q(nt, { className: "w-4 h-4" })
|
|
16342
16461
|
}),
|
|
@@ -16344,7 +16463,7 @@ var Hd = yo(function(e, t) {
|
|
|
16344
16463
|
type: "button",
|
|
16345
16464
|
title: "Numbered list",
|
|
16346
16465
|
"aria-label": "Numbered list",
|
|
16347
|
-
className:
|
|
16466
|
+
className: Yd,
|
|
16348
16467
|
onClick: () => a("1. "),
|
|
16349
16468
|
children: /* @__PURE__ */ q(We, { className: "w-4 h-4" })
|
|
16350
16469
|
}),
|
|
@@ -16352,7 +16471,7 @@ var Hd = yo(function(e, t) {
|
|
|
16352
16471
|
type: "button",
|
|
16353
16472
|
title: "Quote",
|
|
16354
16473
|
"aria-label": "Quote",
|
|
16355
|
-
className:
|
|
16474
|
+
className: Yd,
|
|
16356
16475
|
onClick: () => a("> "),
|
|
16357
16476
|
children: /* @__PURE__ */ q(w, { className: "w-4 h-4" })
|
|
16358
16477
|
}),
|
|
@@ -16360,7 +16479,7 @@ var Hd = yo(function(e, t) {
|
|
|
16360
16479
|
type: "button",
|
|
16361
16480
|
title: "Code",
|
|
16362
16481
|
"aria-label": "Code",
|
|
16363
|
-
className:
|
|
16482
|
+
className: Yd,
|
|
16364
16483
|
onClick: () => i("`"),
|
|
16365
16484
|
children: /* @__PURE__ */ q(Pe, { className: "w-4 h-4" })
|
|
16366
16485
|
}),
|
|
@@ -16368,7 +16487,7 @@ var Hd = yo(function(e, t) {
|
|
|
16368
16487
|
type: "button",
|
|
16369
16488
|
title: "Link",
|
|
16370
16489
|
"aria-label": "Link",
|
|
16371
|
-
className:
|
|
16490
|
+
className: Yd,
|
|
16372
16491
|
onClick: () => i("[", "](https://)", "link text"),
|
|
16373
16492
|
children: /* @__PURE__ */ q(Ve, { className: "w-4 h-4" })
|
|
16374
16493
|
})
|
|
@@ -16385,12 +16504,12 @@ var Hd = yo(function(e, t) {
|
|
|
16385
16504
|
className: "resize-none bg-px-canvas text-px-text p-6 font-mono text-sm leading-7 focus:outline-none border-r border-px-line placeholder:text-px-faint min-h-0"
|
|
16386
16505
|
}), /* @__PURE__ */ q("div", {
|
|
16387
16506
|
className: "min-h-0 hidden md:block",
|
|
16388
|
-
children: /* @__PURE__ */ q(
|
|
16507
|
+
children: /* @__PURE__ */ q(Zd, { markdown: e })
|
|
16389
16508
|
})]
|
|
16390
16509
|
})]
|
|
16391
16510
|
});
|
|
16392
16511
|
};
|
|
16393
|
-
function
|
|
16512
|
+
function $d(e) {
|
|
16394
16513
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
16395
16514
|
return t.querySelectorAll("script,style,iframe,object,embed,form,link,meta,base").forEach((e) => e.remove()), t.body.querySelectorAll("*").forEach((e) => {
|
|
16396
16515
|
for (let t of Array.from(e.attributes)) {
|
|
@@ -16399,14 +16518,14 @@ function qd(e) {
|
|
|
16399
16518
|
}
|
|
16400
16519
|
}), t.body.innerHTML;
|
|
16401
16520
|
}
|
|
16402
|
-
var
|
|
16521
|
+
var ef = ({ value: e, onChange: t, onUpload: n }) => {
|
|
16403
16522
|
let i = W(null), a = W(null), o = W(null);
|
|
16404
16523
|
H(() => {
|
|
16405
|
-
i.current && e !== a.current && (i.current.innerHTML =
|
|
16524
|
+
i.current && e !== a.current && (i.current.innerHTML = $d(e), a.current = e);
|
|
16406
16525
|
}, [e]);
|
|
16407
16526
|
let s = () => {
|
|
16408
16527
|
if (!i.current) return;
|
|
16409
|
-
let e =
|
|
16528
|
+
let e = $d(i.current.innerHTML);
|
|
16410
16529
|
a.current = e, t(e);
|
|
16411
16530
|
}, l = (e, t) => {
|
|
16412
16531
|
i.current?.focus(), document.execCommand(e, !1, t), s();
|
|
@@ -16429,7 +16548,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16429
16548
|
type: "button",
|
|
16430
16549
|
title: "Big heading",
|
|
16431
16550
|
"aria-label": "Big heading",
|
|
16432
|
-
className:
|
|
16551
|
+
className: Yd,
|
|
16433
16552
|
onMouseDown: (e) => e.preventDefault(),
|
|
16434
16553
|
onClick: () => l("formatBlock", "h1"),
|
|
16435
16554
|
children: /* @__PURE__ */ q(r, { className: "w-4 h-4" })
|
|
@@ -16438,7 +16557,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16438
16557
|
type: "button",
|
|
16439
16558
|
title: "Heading",
|
|
16440
16559
|
"aria-label": "Heading",
|
|
16441
|
-
className:
|
|
16560
|
+
className: Yd,
|
|
16442
16561
|
onMouseDown: (e) => e.preventDefault(),
|
|
16443
16562
|
onClick: () => l("formatBlock", "h2"),
|
|
16444
16563
|
children: /* @__PURE__ */ q(Ze, { className: "w-4 h-4" })
|
|
@@ -16447,7 +16566,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16447
16566
|
type: "button",
|
|
16448
16567
|
title: "Normal text",
|
|
16449
16568
|
"aria-label": "Normal text",
|
|
16450
|
-
className: `${
|
|
16569
|
+
className: `${Yd} text-[11px] font-semibold w-auto px-2`,
|
|
16451
16570
|
onMouseDown: (e) => e.preventDefault(),
|
|
16452
16571
|
onClick: () => l("formatBlock", "p"),
|
|
16453
16572
|
children: "Text"
|
|
@@ -16457,7 +16576,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16457
16576
|
type: "button",
|
|
16458
16577
|
title: "Bold (⌘B)",
|
|
16459
16578
|
"aria-label": "Bold",
|
|
16460
|
-
className:
|
|
16579
|
+
className: Yd,
|
|
16461
16580
|
onMouseDown: (e) => e.preventDefault(),
|
|
16462
16581
|
onClick: () => l("bold"),
|
|
16463
16582
|
children: /* @__PURE__ */ q(Ue, { className: "w-4 h-4" })
|
|
@@ -16466,7 +16585,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16466
16585
|
type: "button",
|
|
16467
16586
|
title: "Italic (⌘I)",
|
|
16468
16587
|
"aria-label": "Italic",
|
|
16469
|
-
className:
|
|
16588
|
+
className: Yd,
|
|
16470
16589
|
onMouseDown: (e) => e.preventDefault(),
|
|
16471
16590
|
onClick: () => l("italic"),
|
|
16472
16591
|
children: /* @__PURE__ */ q(c, { className: "w-4 h-4" })
|
|
@@ -16475,7 +16594,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16475
16594
|
type: "button",
|
|
16476
16595
|
title: "Underline (⌘U)",
|
|
16477
16596
|
"aria-label": "Underline",
|
|
16478
|
-
className:
|
|
16597
|
+
className: Yd,
|
|
16479
16598
|
onMouseDown: (e) => e.preventDefault(),
|
|
16480
16599
|
onClick: () => l("underline"),
|
|
16481
16600
|
children: /* @__PURE__ */ q(et, { className: "w-4 h-4" })
|
|
@@ -16485,7 +16604,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16485
16604
|
type: "button",
|
|
16486
16605
|
title: "Bulleted list",
|
|
16487
16606
|
"aria-label": "Bulleted list",
|
|
16488
|
-
className:
|
|
16607
|
+
className: Yd,
|
|
16489
16608
|
onMouseDown: (e) => e.preventDefault(),
|
|
16490
16609
|
onClick: () => l("insertUnorderedList"),
|
|
16491
16610
|
children: /* @__PURE__ */ q(nt, { className: "w-4 h-4" })
|
|
@@ -16494,7 +16613,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16494
16613
|
type: "button",
|
|
16495
16614
|
title: "Numbered list",
|
|
16496
16615
|
"aria-label": "Numbered list",
|
|
16497
|
-
className:
|
|
16616
|
+
className: Yd,
|
|
16498
16617
|
onMouseDown: (e) => e.preventDefault(),
|
|
16499
16618
|
onClick: () => l("insertOrderedList"),
|
|
16500
16619
|
children: /* @__PURE__ */ q(We, { className: "w-4 h-4" })
|
|
@@ -16503,7 +16622,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16503
16622
|
type: "button",
|
|
16504
16623
|
title: "Link",
|
|
16505
16624
|
"aria-label": "Link",
|
|
16506
|
-
className:
|
|
16625
|
+
className: Yd,
|
|
16507
16626
|
onMouseDown: (e) => e.preventDefault(),
|
|
16508
16627
|
onClick: u,
|
|
16509
16628
|
children: /* @__PURE__ */ q(Ve, { className: "w-4 h-4" })
|
|
@@ -16512,7 +16631,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16512
16631
|
type: "button",
|
|
16513
16632
|
title: "Add a picture",
|
|
16514
16633
|
"aria-label": "Add a picture",
|
|
16515
|
-
className:
|
|
16634
|
+
className: Yd,
|
|
16516
16635
|
onClick: () => o.current?.click(),
|
|
16517
16636
|
children: /* @__PURE__ */ q(p, { className: "w-4 h-4" })
|
|
16518
16637
|
}),
|
|
@@ -16520,7 +16639,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16520
16639
|
type: "button",
|
|
16521
16640
|
title: "Clear formatting",
|
|
16522
16641
|
"aria-label": "Clear formatting",
|
|
16523
|
-
className:
|
|
16642
|
+
className: Yd,
|
|
16524
16643
|
onMouseDown: (e) => e.preventDefault(),
|
|
16525
16644
|
onClick: () => l("removeFormat"),
|
|
16526
16645
|
children: /* @__PURE__ */ q(_, { className: "w-4 h-4" })
|
|
@@ -16553,8 +16672,8 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16553
16672
|
})]
|
|
16554
16673
|
})]
|
|
16555
16674
|
});
|
|
16556
|
-
},
|
|
16557
|
-
let [n, r] = G(null), i = Math.max(
|
|
16675
|
+
}, tf = 30, nf = 12, rf = ({ value: e, onChange: t }) => {
|
|
16676
|
+
let [n, r] = G(null), i = Math.max(tf, e.length + 1), a = Math.max(nf, ...e.map((e) => e.length), 0), o = U(() => Ra(e), [e]), s = (n, r, i) => {
|
|
16558
16677
|
let a = e.map((e) => e.slice());
|
|
16559
16678
|
for (; a.length <= n;) a.push([]);
|
|
16560
16679
|
for (; a[n].length <= r;) a[n].push("");
|
|
@@ -16634,7 +16753,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16634
16753
|
})
|
|
16635
16754
|
})]
|
|
16636
16755
|
});
|
|
16637
|
-
},
|
|
16756
|
+
}, af = ({ value: e, onChange: t, readOnly: n, placeholder: r }) => {
|
|
16638
16757
|
let i = W(null), a = W(null), o = W({
|
|
16639
16758
|
value: e,
|
|
16640
16759
|
onChange: t
|
|
@@ -16673,7 +16792,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16673
16792
|
children: [/* @__PURE__ */ q(lt, { className: "w-3.5 h-3.5 animate-spin mr-2" }), "Loading the editor…"]
|
|
16674
16793
|
})
|
|
16675
16794
|
});
|
|
16676
|
-
},
|
|
16795
|
+
}, of = [
|
|
16677
16796
|
{
|
|
16678
16797
|
id: 1200,
|
|
16679
16798
|
label: "Computer",
|
|
@@ -16689,7 +16808,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16689
16808
|
label: "Phone",
|
|
16690
16809
|
Icon: O
|
|
16691
16810
|
}
|
|
16692
|
-
],
|
|
16811
|
+
], sf = ({ value: e, onChange: t, width: n, onWidth: r }) => {
|
|
16693
16812
|
let [i, a] = G(e);
|
|
16694
16813
|
H(() => {
|
|
16695
16814
|
let t = setTimeout(() => a(e), 300);
|
|
@@ -16731,7 +16850,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16731
16850
|
role: "group",
|
|
16732
16851
|
"aria-label": "Page width",
|
|
16733
16852
|
className: "flex items-center bg-px-raised p-0.5 rounded-xl border border-px-line2 shrink-0",
|
|
16734
|
-
children:
|
|
16853
|
+
children: of.map(({ id: e, label: t, Icon: i }) => /* @__PURE__ */ q("button", {
|
|
16735
16854
|
type: "button",
|
|
16736
16855
|
title: `${t} (${e}px wide)`,
|
|
16737
16856
|
"aria-label": t,
|
|
@@ -16752,7 +16871,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16752
16871
|
className: "flex-1 min-h-0 grid grid-cols-1 md:grid-cols-2",
|
|
16753
16872
|
children: [/* @__PURE__ */ q("div", {
|
|
16754
16873
|
className: "min-h-0 border-r border-px-line",
|
|
16755
|
-
children: /* @__PURE__ */ q(
|
|
16874
|
+
children: /* @__PURE__ */ q(af, {
|
|
16756
16875
|
value: e,
|
|
16757
16876
|
onChange: t,
|
|
16758
16877
|
placeholder: "Paste or write HTML here…"
|
|
@@ -16794,7 +16913,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16794
16913
|
})
|
|
16795
16914
|
]
|
|
16796
16915
|
});
|
|
16797
|
-
},
|
|
16916
|
+
}, cf = {
|
|
16798
16917
|
design: /* @__PURE__ */ q(x, { className: "w-3.5 h-3.5" }),
|
|
16799
16918
|
email: /* @__PURE__ */ q(R, { className: "w-3.5 h-3.5" }),
|
|
16800
16919
|
html: /* @__PURE__ */ q(a, { className: "w-3.5 h-3.5" }),
|
|
@@ -16802,7 +16921,7 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16802
16921
|
text: /* @__PURE__ */ q(He, { className: "w-3.5 h-3.5" }),
|
|
16803
16922
|
markdown: /* @__PURE__ */ q(Ye, { className: "w-3.5 h-3.5" }),
|
|
16804
16923
|
sheet: /* @__PURE__ */ q(E, { className: "w-3.5 h-3.5" })
|
|
16805
|
-
},
|
|
16924
|
+
}, lf = {
|
|
16806
16925
|
design: [
|
|
16807
16926
|
"html",
|
|
16808
16927
|
"png",
|
|
@@ -16874,11 +16993,11 @@ var Jd = ({ value: e, onChange: t, onUpload: n }) => {
|
|
|
16874
16993
|
"md",
|
|
16875
16994
|
"txt"
|
|
16876
16995
|
]
|
|
16877
|
-
},
|
|
16996
|
+
}, uf = (e) => new Promise((t, n) => {
|
|
16878
16997
|
let r = new FileReader();
|
|
16879
16998
|
r.onload = () => t(String(r.result)), r.onerror = () => n(/* @__PURE__ */ Error("That file could not be read.")), r.readAsDataURL(e);
|
|
16880
|
-
}),
|
|
16881
|
-
function
|
|
16999
|
+
}), df = (e) => !!e && typeof e == "object" && !(e instanceof Blob) && "kind" in e && "content" in e, ff = (e) => Ha.find((t) => t.id === e), pf = (e) => `px-2.5 h-6 rounded-lg flex items-center gap-1.5 text-[11px] whitespace-nowrap shrink-0 transition-all cursor-pointer ${e ? "bg-px-line2 text-px-text font-semibold" : "text-px-muted hover:text-px-text"}`;
|
|
17000
|
+
function mf(e, t) {
|
|
16882
17001
|
let n = W(null);
|
|
16883
17002
|
return H(() => {
|
|
16884
17003
|
if (!e) return;
|
|
@@ -16892,7 +17011,7 @@ function cf(e, t) {
|
|
|
16892
17011
|
};
|
|
16893
17012
|
}, [e, t]), n;
|
|
16894
17013
|
}
|
|
16895
|
-
var
|
|
17014
|
+
var hf = yo(function(e, t) {
|
|
16896
17015
|
let { className: n, designSystem: r, onDesignSystemChange: i, ...a } = e, o = a.files ?? {}, s = a.mode === "hybrid", c = U(() => o.kinds ?? (s ? [
|
|
16897
17016
|
"design",
|
|
16898
17017
|
"email",
|
|
@@ -16909,7 +17028,7 @@ var lf = yo(function(e, t) {
|
|
|
16909
17028
|
"markdown",
|
|
16910
17029
|
"sheet"
|
|
16911
17030
|
]), [o.kinds, s]), [l, u] = G(() => {
|
|
16912
|
-
if (
|
|
17031
|
+
if (df(o.file)) return {
|
|
16913
17032
|
kind: o.file.kind,
|
|
16914
17033
|
name: o.file.name || "Untitled",
|
|
16915
17034
|
content: o.file.content,
|
|
@@ -16931,7 +17050,7 @@ var lf = yo(function(e, t) {
|
|
|
16931
17050
|
};
|
|
16932
17051
|
}
|
|
16933
17052
|
return null;
|
|
16934
|
-
}), [d, f] = G("edit"), [p, m] = G(o.file && !
|
|
17053
|
+
}), [d, f] = G("edit"), [p, m] = G(o.file && !df(o.file) ? "Opening your file…" : null), [h, g] = G(null), [_, v] = G(null), [y, b] = G(1200), x = W(null), S = W(null), C = V((e = l) => e ? Ja(e.kind) ? x.current?.getPages() ?? S.current ?? e.content : e.content : "", [l]), w = o.imageAi ?? (a.apiKey === "workspace-internal" ? Qa : void 0), T = o.aiConversion !== !1 && !!(o.onConvertImage || w), E = V(async (e) => a.onUpload ? await a.onUpload(e) : await uf(e), [a.onUpload]), D = W(null), [O, k] = G(!1), A = V(async (e) => {
|
|
16935
17054
|
if (!T) return { pages: null };
|
|
16936
17055
|
let t = new AbortController();
|
|
16937
17056
|
D.current = t, k(!0);
|
|
@@ -16994,7 +17113,7 @@ var lf = yo(function(e, t) {
|
|
|
16994
17113
|
let s;
|
|
16995
17114
|
if (o.texts.length === 0 && T && i < 10 && !a) {
|
|
16996
17115
|
m(`Reading page ${t + 1} of ${e.pages.length} with AI…`);
|
|
16997
|
-
let r = await
|
|
17116
|
+
let r = await uf(o.image), c = await A({
|
|
16998
17117
|
dataUrl: r,
|
|
16999
17118
|
name: `${n} page ${t + 1}`,
|
|
17000
17119
|
width: o.width * 2,
|
|
@@ -17042,7 +17161,7 @@ var lf = yo(function(e, t) {
|
|
|
17042
17161
|
rev: (l?.rev ?? 0) + 1
|
|
17043
17162
|
}), f("edit"), g(null), v(null);
|
|
17044
17163
|
}, N = V(async (e) => {
|
|
17045
|
-
v(null),
|
|
17164
|
+
v(null), df(e) ? (u((t) => ({
|
|
17046
17165
|
kind: e.kind,
|
|
17047
17166
|
name: e.name || "Untitled",
|
|
17048
17167
|
content: e.content,
|
|
@@ -17056,7 +17175,7 @@ var lf = yo(function(e, t) {
|
|
|
17056
17175
|
H(() => {
|
|
17057
17176
|
let e = P.current;
|
|
17058
17177
|
if (e.first) {
|
|
17059
|
-
e.first = !1, o.file && !
|
|
17178
|
+
e.first = !1, o.file && !df(o.file) && j(o.file);
|
|
17060
17179
|
return;
|
|
17061
17180
|
}
|
|
17062
17181
|
if (o.file !== e.file) {
|
|
@@ -17130,7 +17249,7 @@ var lf = yo(function(e, t) {
|
|
|
17130
17249
|
C,
|
|
17131
17250
|
r,
|
|
17132
17251
|
y
|
|
17133
|
-
]), [te, ne] = G({ phase: "idle" }), [re, ie] = G(o.defaultSaveFormat ?? null), I = U(() => l ?
|
|
17252
|
+
]), [te, ne] = G({ phase: "idle" }), [re, ie] = G(o.defaultSaveFormat ?? null), I = U(() => l ? lf[l.kind].filter((e) => !o.saveFormats || o.saveFormats.includes(e)) : [], [l, o.saveFormats]), ae = async (e) => {
|
|
17134
17253
|
if (!(!l || !o.onSaveFile)) {
|
|
17135
17254
|
ne({ phase: "working" }), ie(e);
|
|
17136
17255
|
try {
|
|
@@ -17192,7 +17311,7 @@ var lf = yo(function(e, t) {
|
|
|
17192
17311
|
className: ce,
|
|
17193
17312
|
style: L,
|
|
17194
17313
|
"data-plexo-file-editor": !0,
|
|
17195
|
-
children: /* @__PURE__ */ q(
|
|
17314
|
+
children: /* @__PURE__ */ q(gf, {
|
|
17196
17315
|
kinds: c,
|
|
17197
17316
|
busy: p,
|
|
17198
17317
|
problem: h,
|
|
@@ -17283,8 +17402,8 @@ var lf = yo(function(e, t) {
|
|
|
17283
17402
|
"aria-selected": l.kind === e,
|
|
17284
17403
|
title: io[e],
|
|
17285
17404
|
onClick: () => ee(e),
|
|
17286
|
-
className:
|
|
17287
|
-
children: [
|
|
17405
|
+
className: pf(l.kind === e),
|
|
17406
|
+
children: [cf[e], /* @__PURE__ */ q("span", {
|
|
17288
17407
|
className: "hidden lg:inline",
|
|
17289
17408
|
children: so[e]
|
|
17290
17409
|
})]
|
|
@@ -17299,13 +17418,13 @@ var lf = yo(function(e, t) {
|
|
|
17299
17418
|
role: "tab",
|
|
17300
17419
|
"aria-selected": d === e.id,
|
|
17301
17420
|
onClick: () => f(e.id),
|
|
17302
|
-
className:
|
|
17421
|
+
className: pf(d === e.id),
|
|
17303
17422
|
children: e.label
|
|
17304
17423
|
}, e.id))
|
|
17305
17424
|
}),
|
|
17306
17425
|
/* @__PURE__ */ q("div", { className: "flex-1 min-w-0" }),
|
|
17307
17426
|
a.headerRight,
|
|
17308
|
-
!(le && d === "edit") && /* @__PURE__ */ q(
|
|
17427
|
+
!(le && d === "edit") && /* @__PURE__ */ q(_f, {
|
|
17309
17428
|
name: l.name || "Untitled",
|
|
17310
17429
|
formats: l.kind === "html" ? [
|
|
17311
17430
|
"png",
|
|
@@ -17316,10 +17435,10 @@ var lf = yo(function(e, t) {
|
|
|
17316
17435
|
"docx",
|
|
17317
17436
|
"md",
|
|
17318
17437
|
"txt"
|
|
17319
|
-
] :
|
|
17438
|
+
] : lf[l.kind],
|
|
17320
17439
|
getSource: F
|
|
17321
17440
|
}),
|
|
17322
|
-
o.onSaveFile && /* @__PURE__ */ q(
|
|
17441
|
+
o.onSaveFile && /* @__PURE__ */ q(vf, {
|
|
17323
17442
|
formats: I,
|
|
17324
17443
|
preferred: re,
|
|
17325
17444
|
state: te,
|
|
@@ -17358,7 +17477,7 @@ var lf = yo(function(e, t) {
|
|
|
17358
17477
|
le && /* @__PURE__ */ q("div", {
|
|
17359
17478
|
className: "absolute inset-0",
|
|
17360
17479
|
style: { display: d === "edit" ? "block" : "none" },
|
|
17361
|
-
children: /* @__PURE__ */ q(
|
|
17480
|
+
children: /* @__PURE__ */ q(Jd, {
|
|
17362
17481
|
ref: x,
|
|
17363
17482
|
...ue,
|
|
17364
17483
|
pages: l.content,
|
|
@@ -17367,7 +17486,7 @@ var lf = yo(function(e, t) {
|
|
|
17367
17486
|
}
|
|
17368
17487
|
}, `${l.kind}-${l.rev}`)
|
|
17369
17488
|
}),
|
|
17370
|
-
d === "edit" && l.kind === "html" && /* @__PURE__ */ q(
|
|
17489
|
+
d === "edit" && l.kind === "html" && /* @__PURE__ */ q(sf, {
|
|
17371
17490
|
value: l.content,
|
|
17372
17491
|
onChange: (e) => u((t) => t && {
|
|
17373
17492
|
...t,
|
|
@@ -17379,21 +17498,21 @@ var lf = yo(function(e, t) {
|
|
|
17379
17498
|
d === "edit" && !le && l.kind !== "html" && /* @__PURE__ */ J("div", {
|
|
17380
17499
|
className: "absolute inset-0",
|
|
17381
17500
|
children: [
|
|
17382
|
-
l.kind === "text" && /* @__PURE__ */ q(
|
|
17501
|
+
l.kind === "text" && /* @__PURE__ */ q(Xd, {
|
|
17383
17502
|
value: l.content,
|
|
17384
17503
|
onChange: (e) => u((t) => t && {
|
|
17385
17504
|
...t,
|
|
17386
17505
|
content: e
|
|
17387
17506
|
})
|
|
17388
17507
|
}),
|
|
17389
|
-
l.kind === "markdown" && /* @__PURE__ */ q(
|
|
17508
|
+
l.kind === "markdown" && /* @__PURE__ */ q(Qd, {
|
|
17390
17509
|
value: l.content,
|
|
17391
17510
|
onChange: (e) => u((t) => t && {
|
|
17392
17511
|
...t,
|
|
17393
17512
|
content: e
|
|
17394
17513
|
})
|
|
17395
17514
|
}),
|
|
17396
|
-
l.kind === "document" && /* @__PURE__ */ q(
|
|
17515
|
+
l.kind === "document" && /* @__PURE__ */ q(ef, {
|
|
17397
17516
|
value: l.content,
|
|
17398
17517
|
onChange: (e) => u((t) => t && {
|
|
17399
17518
|
...t,
|
|
@@ -17401,7 +17520,7 @@ var lf = yo(function(e, t) {
|
|
|
17401
17520
|
}),
|
|
17402
17521
|
onUpload: a.onUpload
|
|
17403
17522
|
}),
|
|
17404
|
-
l.kind === "sheet" && /* @__PURE__ */ q(
|
|
17523
|
+
l.kind === "sheet" && /* @__PURE__ */ q(rf, {
|
|
17405
17524
|
value: l.content,
|
|
17406
17525
|
onChange: (e) => u((t) => t && {
|
|
17407
17526
|
...t,
|
|
@@ -17410,7 +17529,7 @@ var lf = yo(function(e, t) {
|
|
|
17410
17529
|
})
|
|
17411
17530
|
]
|
|
17412
17531
|
}),
|
|
17413
|
-
d === "html" && /* @__PURE__ */ q(
|
|
17532
|
+
d === "html" && /* @__PURE__ */ q(yf, {
|
|
17414
17533
|
doc: l,
|
|
17415
17534
|
content: C(),
|
|
17416
17535
|
designSystem: x.current?.getDesignSystem() ?? r,
|
|
@@ -17420,13 +17539,13 @@ var lf = yo(function(e, t) {
|
|
|
17420
17539
|
}),
|
|
17421
17540
|
onEditAsHtml: () => ee("html")
|
|
17422
17541
|
}),
|
|
17423
|
-
d === "preview" && /* @__PURE__ */ q(
|
|
17542
|
+
d === "preview" && /* @__PURE__ */ q(bf, { source: F })
|
|
17424
17543
|
]
|
|
17425
17544
|
})
|
|
17426
17545
|
]
|
|
17427
17546
|
})
|
|
17428
17547
|
});
|
|
17429
|
-
}),
|
|
17548
|
+
}), gf = ({ kinds: e, busy: t, problem: n, onSkip: r, onCreate: i, onOpen: a, onClose: o }) => {
|
|
17430
17549
|
let s = W(null), [c, l] = G(!1);
|
|
17431
17550
|
return /* @__PURE__ */ q("div", {
|
|
17432
17551
|
className: "h-full w-full overflow-auto bg-px-canvas text-px-text font-sans antialiased",
|
|
@@ -17466,7 +17585,7 @@ var lf = yo(function(e, t) {
|
|
|
17466
17585
|
children: [
|
|
17467
17586
|
/* @__PURE__ */ q("span", {
|
|
17468
17587
|
className: "w-8 h-8 rounded-lg bg-px-raised flex items-center justify-center text-px-accent",
|
|
17469
|
-
children:
|
|
17588
|
+
children: cf[e]
|
|
17470
17589
|
}),
|
|
17471
17590
|
/* @__PURE__ */ J("span", {
|
|
17472
17591
|
className: "text-sm font-semibold",
|
|
@@ -17540,10 +17659,10 @@ var lf = yo(function(e, t) {
|
|
|
17540
17659
|
]
|
|
17541
17660
|
})
|
|
17542
17661
|
});
|
|
17543
|
-
},
|
|
17662
|
+
}, _f = ({ name: e, formats: t, getSource: n }) => {
|
|
17544
17663
|
let [r, i] = G(!1);
|
|
17545
17664
|
return /* @__PURE__ */ J("div", {
|
|
17546
|
-
ref:
|
|
17665
|
+
ref: mf(r, V(() => i(!1), [])),
|
|
17547
17666
|
className: "relative shrink-0",
|
|
17548
17667
|
children: [/* @__PURE__ */ J("button", {
|
|
17549
17668
|
type: "button",
|
|
@@ -17567,8 +17686,8 @@ var lf = yo(function(e, t) {
|
|
|
17567
17686
|
})
|
|
17568
17687
|
})]
|
|
17569
17688
|
});
|
|
17570
|
-
},
|
|
17571
|
-
let [i, a] = G(!1), o =
|
|
17689
|
+
}, vf = ({ formats: e, preferred: t, state: n, onSave: r }) => {
|
|
17690
|
+
let [i, a] = G(!1), o = mf(i, V(() => a(!1), [])), s = n.phase === "working", c = t && e.includes(t) ? t : e[0];
|
|
17572
17691
|
return c ? /* @__PURE__ */ J("div", {
|
|
17573
17692
|
ref: o,
|
|
17574
17693
|
className: "relative shrink-0 flex",
|
|
@@ -17577,7 +17696,7 @@ var lf = yo(function(e, t) {
|
|
|
17577
17696
|
type: "button",
|
|
17578
17697
|
disabled: s,
|
|
17579
17698
|
onClick: () => r(c),
|
|
17580
|
-
title: `Save as ${
|
|
17699
|
+
title: `Save as ${ff(c).label} (⌘S)`,
|
|
17581
17700
|
className: "h-7 pl-3 pr-2.5 rounded-l-lg bg-px-accent hover:bg-px-accent-hover text-px-onaccent text-xs font-semibold flex items-center gap-1.5 cursor-pointer disabled:opacity-60 whitespace-nowrap",
|
|
17582
17701
|
children: [n.phase === "done" ? /* @__PURE__ */ q(xt, { className: "w-3.5 h-3.5 stroke-[2.5]" }) : s ? /* @__PURE__ */ q(lt, { className: "w-3.5 h-3.5 animate-spin" }) : null, s ? "Saving…" : n.phase === "done" ? "Saved" : "Save"]
|
|
17583
17702
|
}),
|
|
@@ -17605,16 +17724,16 @@ var lf = yo(function(e, t) {
|
|
|
17605
17724
|
className: "w-full text-left px-3 py-2 rounded-lg hover:bg-px-raised2 cursor-pointer",
|
|
17606
17725
|
children: [/* @__PURE__ */ q("span", {
|
|
17607
17726
|
className: "block text-xs font-semibold text-px-text",
|
|
17608
|
-
children:
|
|
17727
|
+
children: ff(e).label
|
|
17609
17728
|
}), /* @__PURE__ */ q("span", {
|
|
17610
17729
|
className: "block text-[11px] text-px-muted",
|
|
17611
|
-
children:
|
|
17730
|
+
children: ff(e).hint
|
|
17612
17731
|
})]
|
|
17613
17732
|
}, e))]
|
|
17614
17733
|
})
|
|
17615
17734
|
]
|
|
17616
17735
|
}) : null;
|
|
17617
|
-
},
|
|
17736
|
+
}, yf = ({ doc: e, content: t, designSystem: n, onChange: r, onEditAsHtml: i }) => {
|
|
17618
17737
|
let a = e.kind === "document", o = U(() => {
|
|
17619
17738
|
if (Ja(e.kind)) {
|
|
17620
17739
|
let r = t[0];
|
|
@@ -17661,14 +17780,14 @@ var lf = yo(function(e, t) {
|
|
|
17661
17780
|
]
|
|
17662
17781
|
}), /* @__PURE__ */ q("div", {
|
|
17663
17782
|
className: "flex-1 min-h-0",
|
|
17664
|
-
children: /* @__PURE__ */ q(
|
|
17783
|
+
children: /* @__PURE__ */ q(af, {
|
|
17665
17784
|
value: o,
|
|
17666
17785
|
readOnly: !a,
|
|
17667
|
-
onChange: (e) => r(
|
|
17786
|
+
onChange: (e) => r($d(e))
|
|
17668
17787
|
})
|
|
17669
17788
|
})]
|
|
17670
17789
|
});
|
|
17671
|
-
},
|
|
17790
|
+
}, bf = ({ source: e }) => {
|
|
17672
17791
|
let [t, n] = G({});
|
|
17673
17792
|
return H(() => {
|
|
17674
17793
|
let t = !0, r;
|
|
@@ -17707,18 +17826,18 @@ var lf = yo(function(e, t) {
|
|
|
17707
17826
|
}, e))
|
|
17708
17827
|
]
|
|
17709
17828
|
});
|
|
17710
|
-
},
|
|
17829
|
+
}, xf = yo(function(e, t) {
|
|
17711
17830
|
if (e.mode === "file" || e.mode === "hybrid") {
|
|
17712
17831
|
let { pages: n, initialPageId: r, onChange: i, ...a } = e;
|
|
17713
|
-
return /* @__PURE__ */ q(
|
|
17832
|
+
return /* @__PURE__ */ q(hf, {
|
|
17714
17833
|
ref: t,
|
|
17715
17834
|
...a
|
|
17716
17835
|
});
|
|
17717
17836
|
}
|
|
17718
|
-
return /* @__PURE__ */ q(
|
|
17837
|
+
return /* @__PURE__ */ q(Jd, {
|
|
17719
17838
|
ref: t,
|
|
17720
17839
|
...e
|
|
17721
17840
|
});
|
|
17722
17841
|
});
|
|
17723
17842
|
//#endregion
|
|
17724
|
-
export { Di as AUDIT_KINDS, ta as AUDIT_KIND_LABELS, Yn as EMAIL_WIDTH, Ha as EXPORT_FORMATS, Ts as ExportPanel, zr as FONT_CHOICES, Xr as FONT_FILE_ACCEPT,
|
|
17843
|
+
export { Di as AUDIT_KINDS, ta as AUDIT_KIND_LABELS, Yn as EMAIL_WIDTH, Ha as EXPORT_FORMATS, Ts as ExportPanel, zr as FONT_CHOICES, Xr as FONT_FILE_ACCEPT, hf as FileEditor, co as IMAGE_TO_DESIGN_PROMPT, so as KIND_LABEL, Yr as MAX_CUSTOM_FONTS, tn as MAX_CUSTOM_JS, Ur as MAX_FONT_FILE_BYTES, li as MAX_FONT_VARIANTS, Xi as PAGE_RECIPES, ha as PAGE_TEMPLATES, na as PAGE_TYPE_DEFAULTS, Pa as PICTURE_FORMATS, $r as POPULAR_FONTS, un as ROOT_FONT_PX, Ui as SITE_ONLY_TEMPLATE_IDS, va as SITE_PAGE_TYPES, Ai as SOL_SYSTEM_PROMPT, nn as TEXT_STYLES, ln as TEXT_STYLE_IDS, da as THEME_PRESETS, ga as V1_DYNAMIC_EQUIVALENTS, xf as V2Editor, oa as V2_DYNAMIC_READY, fi as WEIGHT_LABELS, sn as WORKSPACE_ID, Gr as addCustomFont, mi as applyAuditFixes, xi as applyCommands, Ci as applyTheme, ea as auditDesign, qa as blankContent, gr as blankEmailPages, $t as blankPages, Wi as brandChoicesFromBrief, br as brandComponentCss, Er as brandDerivedVars, Rn as brandFontFamilies, wr as brandStylesheet, qi as briefHash, ra as buildPageFromTemplate, la as buildSitePage, ya as buildTemplateSections, ca as catalogSchema, ia as chromeContentFor, Ti as colorDistance, pr as compilePageToEmail, cc as componentStyle, sc as componentVariants, lo as convertContent, vi as convertLegacyDesign, ro as convertPictureWithAi, fa as convertV1Design, ar as createDefaultDesignSystem, di as customFontFaceCss, Vr as customFontsOf, on as deriveShades, Ei as describeAudit, wa as describeCommand, bi as describeDesign, Un as designSystemCss, Zi as designSystemFromBrief, lr as designSystemVars, Yi as detectIndustry, zi as detectStyle, no as docxToHtml, fo as downloadResult, fn as effectiveTypeMetrics, In as emailIssues, fr as ensureWorkspace, hn as evalCssLength, Ra as evaluateGrid, Ua as exportSource, jr as findCustomFont, Ar as findFont, ba as fitText, nr as fontsNeeded, qn as frameVars, Gn as frameVarsFor, Oi as friendlyTokenName, Ca as getPageRecipe, Gi as getPageTemplate, ai as getToken, Zr as getValue, Qr as googleFontPreviewHref, Lr as googleFontsHrefs, ui as guessFontFromFile, Za as htmlToDesign, Fa as htmlToMarkdown, Ba as htmlToText, Xa as imageToDesign, Hr as isFontUrl, yn as isHeadingTextStyle, _i as isLegacyDesign, Rr as isLoadableFamily, Ji as isPageEmpty, ua as isPageTemplateId, Br as isSystemFont, kr as isTextStyle, Mn as isWorkspaceNode, Ut as levelTextStyle, yi as linkAccentsToBrand, Si as linkExactValues, si as lintDesignSystem, Vi as listPageRecipes, aa as listPageTemplates, Wa as markdownToDesign, eo as markdownToHtml, Wr as nameFromKey, Li as neutralScaleOf, bn as onAccentColor, uo as openFile, An as pageChildren, Sa as parseBriefColor, za as parseCsv, oo as parseImageSpec, hi as parseSolReply, ho as pdfToPages, ji as pickRecipe, Qa as plexoImageAi, Fn as plexoVars, cn as prepareCustomJs, Ii as previewSurfaces, Pr as primaryFamily, go as readPdf, Pi as readStreamingSolReply, dr as readableOn, gi as recipesFor, ri as ref, oi as refKey, Nr as removeCustomFont, Kr as removeToken, ni as repairDesignSystem, ei as resolveKey, ci as resolveValue, Ri as roundnessOf, Wt as safeBrandValue, ma as sanitizeCss, Mr as sanitizeCustomFonts, Hi as sanitizeV2Html, ki as setBrandSurfaces, pi as setDensity, Ki as setFonts, _a as setNeutralScale, Ni as setPageTemplateResolver, sa as setPrimaryColor, pa as setRoundness, $i as setSecondaryColor, Bi as setStatusColor, qr as setToken, Jr as setTokens, xa as siteNavLinks, Fi as solCommandSchema, Ga as specToPage, Fr as stackFor, ir as starterEmailPages, wn as starterPages, Pn as stripWorkspace, Mi as suggestSitePages, wi as suggestedDecisions, Qi as templateSeed, Dn as textStyleCss, en as textStyleDef, Xt as textStyleOf, Tn as textStyleVars, mo as textToDesign, Na as textToHtml, rn as tint, Va as toCsv, ii as tokenCssValue, ti as tokenMap, Or as validHtmlId, Ir as weightsToLoad, _n as workspaceOf, Ia as wrapHtmlDocument, Ka as xlsxToGrid };
|