@charisol/plexo-sdk 2.0.17 → 2.0.18
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/v2.js
CHANGED
|
@@ -7174,14 +7174,14 @@ function hs(e, t) {
|
|
|
7174
7174
|
}
|
|
7175
7175
|
//#endregion
|
|
7176
7176
|
//#region src/v2/components/canvas/SectionToolbar.tsx
|
|
7177
|
-
var gs = ({ section: e }) => {
|
|
7178
|
-
let { moveNodeUp:
|
|
7179
|
-
if (!
|
|
7180
|
-
let
|
|
7177
|
+
var gs = ({ section: e, inside: t }) => {
|
|
7178
|
+
let { moveNodeUp: n, moveNodeDown: r, duplicateNode: i, deleteNode: a, detachSection: o, openSectionPicker: s } = X(), c = Jt(e);
|
|
7179
|
+
if (!c) return null;
|
|
7180
|
+
let l = Vn(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) => {
|
|
7181
7181
|
t.stopPropagation(), e();
|
|
7182
7182
|
};
|
|
7183
7183
|
return /* @__PURE__ */ J("div", {
|
|
7184
|
-
className:
|
|
7184
|
+
className: `absolute left-3 ${t ? "top-2" : "-top-11"} z-50 flex items-center gap-0.5 bg-px-surface border border-px-line2 rounded-xl shadow-xl px-1.5 py-1 pointer-events-auto`,
|
|
7185
7185
|
onClick: (e) => e.stopPropagation(),
|
|
7186
7186
|
onPointerDown: (e) => e.stopPropagation(),
|
|
7187
7187
|
children: [
|
|
@@ -7189,59 +7189,59 @@ var gs = ({ section: e }) => {
|
|
|
7189
7189
|
className: "px-2 text-[11px] text-px-text whitespace-nowrap",
|
|
7190
7190
|
children: [/* @__PURE__ */ q("span", {
|
|
7191
7191
|
className: "font-semibold",
|
|
7192
|
-
children:
|
|
7193
|
-
}),
|
|
7192
|
+
children: l.label
|
|
7193
|
+
}), u ? /* @__PURE__ */ J("span", {
|
|
7194
7194
|
className: "text-px-muted",
|
|
7195
|
-
children: [" · ",
|
|
7195
|
+
children: [" · ", u.label]
|
|
7196
7196
|
}) : null]
|
|
7197
7197
|
}),
|
|
7198
7198
|
/* @__PURE__ */ q("span", { className: "w-px h-4 bg-px-line2 mx-0.5" }),
|
|
7199
7199
|
/* @__PURE__ */ q("button", {
|
|
7200
7200
|
type: "button",
|
|
7201
|
-
className:
|
|
7201
|
+
className: d,
|
|
7202
7202
|
title: "Move up",
|
|
7203
7203
|
"aria-label": "Move section up",
|
|
7204
|
-
onClick:
|
|
7204
|
+
onClick: f(() => n(e.id)),
|
|
7205
7205
|
children: /* @__PURE__ */ q(R, { className: "w-3.5 h-3.5" })
|
|
7206
7206
|
}),
|
|
7207
7207
|
/* @__PURE__ */ q("button", {
|
|
7208
7208
|
type: "button",
|
|
7209
|
-
className:
|
|
7209
|
+
className: d,
|
|
7210
7210
|
title: "Move down",
|
|
7211
7211
|
"aria-label": "Move section down",
|
|
7212
|
-
onClick:
|
|
7212
|
+
onClick: f(() => r(e.id)),
|
|
7213
7213
|
children: /* @__PURE__ */ q(te, { className: "w-3.5 h-3.5" })
|
|
7214
7214
|
}),
|
|
7215
7215
|
/* @__PURE__ */ q("button", {
|
|
7216
7216
|
type: "button",
|
|
7217
|
-
className:
|
|
7217
|
+
className: d,
|
|
7218
7218
|
title: "Duplicate",
|
|
7219
7219
|
"aria-label": "Duplicate section",
|
|
7220
|
-
onClick:
|
|
7220
|
+
onClick: f(() => i(e.id)),
|
|
7221
7221
|
children: /* @__PURE__ */ q(Re, { className: "w-3.5 h-3.5" })
|
|
7222
7222
|
}),
|
|
7223
7223
|
/* @__PURE__ */ q("button", {
|
|
7224
7224
|
type: "button",
|
|
7225
|
-
className:
|
|
7225
|
+
className: d,
|
|
7226
7226
|
title: "Add a section below",
|
|
7227
7227
|
"aria-label": "Add a section below",
|
|
7228
|
-
onClick:
|
|
7228
|
+
onClick: f(() => s(e.id)),
|
|
7229
7229
|
children: /* @__PURE__ */ q(I, { className: "w-3.5 h-3.5" })
|
|
7230
7230
|
}),
|
|
7231
7231
|
/* @__PURE__ */ q("button", {
|
|
7232
7232
|
type: "button",
|
|
7233
|
-
className:
|
|
7233
|
+
className: d,
|
|
7234
7234
|
title: "Edit freely — turn this into separate elements you can place anywhere",
|
|
7235
7235
|
"aria-label": "Edit freely",
|
|
7236
|
-
onClick:
|
|
7236
|
+
onClick: f(() => o(e.id)),
|
|
7237
7237
|
children: /* @__PURE__ */ q(tt, { className: "w-3.5 h-3.5" })
|
|
7238
7238
|
}),
|
|
7239
7239
|
/* @__PURE__ */ q("button", {
|
|
7240
7240
|
type: "button",
|
|
7241
|
-
className: `${
|
|
7241
|
+
className: `${d} hover:!text-red-300`,
|
|
7242
7242
|
title: "Delete section",
|
|
7243
7243
|
"aria-label": "Delete section",
|
|
7244
|
-
onClick:
|
|
7244
|
+
onClick: f(() => a(e.id)),
|
|
7245
7245
|
children: /* @__PURE__ */ q(Ae, { className: "w-3.5 h-3.5" })
|
|
7246
7246
|
})
|
|
7247
7247
|
]
|
|
@@ -7313,26 +7313,26 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7313
7313
|
}, bs = Pi({
|
|
7314
7314
|
layoutMode: "free",
|
|
7315
7315
|
parentId: ""
|
|
7316
|
-
}), xs = () => Ii(bs), Ss = ({ node: e }) => {
|
|
7317
|
-
let
|
|
7316
|
+
}), xs = () => Ii(bs), Ss = ({ node: e, inside: t }) => {
|
|
7317
|
+
let n = Aa(), { startInlineEditing: r, duplicateNode: i, deleteNode: a, toggleNodeVisibility: o, toggleNodeLock: s, selectParentNode: c, toggleSidebarTab: l } = X(), [u, f] = G(!1), p = W(null);
|
|
7318
7318
|
H(() => {
|
|
7319
|
-
if (!
|
|
7319
|
+
if (!u) return;
|
|
7320
7320
|
let e = (e) => {
|
|
7321
|
-
|
|
7321
|
+
p.current && !p.current.contains(e.target) && f(!1);
|
|
7322
7322
|
}, t = (e) => {
|
|
7323
|
-
e.key === "Escape" &&
|
|
7323
|
+
e.key === "Escape" && f(!1);
|
|
7324
7324
|
};
|
|
7325
7325
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
7326
7326
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
7327
7327
|
};
|
|
7328
|
-
}, [
|
|
7329
|
-
let
|
|
7328
|
+
}, [u]);
|
|
7329
|
+
let m = e.type === "heading" || e.type === "paragraph" || e.type === "button" || e.type === "badge", h = e.type === "page";
|
|
7330
7330
|
return /* @__PURE__ */ J("div", {
|
|
7331
7331
|
onClick: (e) => e.stopPropagation(),
|
|
7332
7332
|
onPointerDown: (e) => e.stopPropagation(),
|
|
7333
7333
|
onMouseDown: (e) => e.stopPropagation(),
|
|
7334
7334
|
onDoubleClick: (e) => e.stopPropagation(),
|
|
7335
|
-
className:
|
|
7335
|
+
className: `absolute ${t ? "top-2 left-2" : "-top-9 left-0"} z-50 flex items-center bg-px-surface/95 backdrop-blur-md border border-px-line2 rounded-xl px-2 h-7.5 shadow-xl select-none text-[11px] text-px-muted font-sans gap-1 animate-in fade-in duration-100`,
|
|
7336
7336
|
children: [
|
|
7337
7337
|
/* @__PURE__ */ q("div", {
|
|
7338
7338
|
className: "flex items-center justify-center pl-0.5 pr-0.5",
|
|
@@ -7340,14 +7340,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7340
7340
|
children: /* @__PURE__ */ q(ee, { className: "w-3.5 h-3.5 fill-px-accent text-px-accent" })
|
|
7341
7341
|
}),
|
|
7342
7342
|
/* @__PURE__ */ q("div", { className: "w-[1px] h-3 bg-px-line2 mx-0.5" }),
|
|
7343
|
-
|
|
7344
|
-
onClick: () =>
|
|
7343
|
+
m && /* @__PURE__ */ J("button", {
|
|
7344
|
+
onClick: () => r(e.id),
|
|
7345
7345
|
title: "Edit Text (T or Enter)",
|
|
7346
7346
|
className: "flex items-center gap-1 px-1.5 h-5 rounded-md text-[10px] text-px-text hover:bg-px-line transition-colors cursor-pointer",
|
|
7347
7347
|
children: [/* @__PURE__ */ q(ce, { className: "w-3 h-3 text-px-accent" }), /* @__PURE__ */ q("span", { children: "Edit" })]
|
|
7348
7348
|
}),
|
|
7349
|
-
|
|
7350
|
-
onClick: () =>
|
|
7349
|
+
n.onAskSol && /* @__PURE__ */ J("button", {
|
|
7350
|
+
onClick: () => l("sol"),
|
|
7351
7351
|
title: "Open SOL AI Suggestions",
|
|
7352
7352
|
className: "flex items-center gap-1 px-1.5 h-5 rounded-md text-[10px] text-px-muted hover:text-px-accent hover:bg-px-line transition-colors cursor-pointer",
|
|
7353
7353
|
children: [/* @__PURE__ */ q(Na, {
|
|
@@ -7355,33 +7355,33 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7355
7355
|
className: "text-px-accent"
|
|
7356
7356
|
}), /* @__PURE__ */ q("span", { children: "SOL" })]
|
|
7357
7357
|
}),
|
|
7358
|
-
!
|
|
7359
|
-
onClick: () =>
|
|
7358
|
+
!h && /* @__PURE__ */ q("button", {
|
|
7359
|
+
onClick: () => i(e.id),
|
|
7360
7360
|
title: "Duplicate (⌘D)",
|
|
7361
7361
|
className: "w-5 h-5 rounded-md flex items-center justify-center hover:text-px-text hover:bg-px-line transition-colors cursor-pointer",
|
|
7362
7362
|
children: /* @__PURE__ */ q(Re, { className: "w-3 h-3" })
|
|
7363
7363
|
}),
|
|
7364
|
-
!
|
|
7365
|
-
onClick: () =>
|
|
7364
|
+
!h && /* @__PURE__ */ q("button", {
|
|
7365
|
+
onClick: () => a(e.id),
|
|
7366
7366
|
title: "Delete (⌫)",
|
|
7367
7367
|
className: "w-5 h-5 rounded-md flex items-center justify-center hover:text-red-400 hover:bg-px-line transition-colors cursor-pointer",
|
|
7368
7368
|
children: /* @__PURE__ */ q(Ae, { className: "w-3 h-3" })
|
|
7369
7369
|
}),
|
|
7370
7370
|
/* @__PURE__ */ J("div", {
|
|
7371
7371
|
className: "relative",
|
|
7372
|
-
ref:
|
|
7372
|
+
ref: p,
|
|
7373
7373
|
children: [/* @__PURE__ */ q("button", {
|
|
7374
|
-
onClick: () =>
|
|
7374
|
+
onClick: () => f(!u),
|
|
7375
7375
|
title: "More Actions",
|
|
7376
7376
|
className: "w-5 h-5 rounded-md flex items-center justify-center hover:text-px-text hover:bg-px-line2 transition-colors cursor-pointer",
|
|
7377
7377
|
children: /* @__PURE__ */ q(j, { className: "w-3 h-3" })
|
|
7378
|
-
}),
|
|
7378
|
+
}), u && /* @__PURE__ */ J("div", {
|
|
7379
7379
|
className: "absolute top-7 left-0 bg-px-raised border border-px-line2 rounded-xl shadow-2xl py-1 w-36 z-50 text-[11px] divide-y divide-px-line2",
|
|
7380
7380
|
children: [/* @__PURE__ */ q("div", {
|
|
7381
7381
|
className: "py-0.5",
|
|
7382
7382
|
children: /* @__PURE__ */ J("button", {
|
|
7383
7383
|
onClick: () => {
|
|
7384
|
-
|
|
7384
|
+
c(e.id), f(!1);
|
|
7385
7385
|
},
|
|
7386
7386
|
className: "w-full px-2.5 py-1 text-left text-px-muted hover:text-px-text hover:bg-px-line2 flex items-center gap-2 cursor-pointer",
|
|
7387
7387
|
children: [/* @__PURE__ */ q(R, { className: "w-3 h-3" }), /* @__PURE__ */ q("span", { children: "Select Parent" })]
|
|
@@ -7390,13 +7390,13 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7390
7390
|
className: "py-0.5",
|
|
7391
7391
|
children: [/* @__PURE__ */ J("button", {
|
|
7392
7392
|
onClick: () => {
|
|
7393
|
-
|
|
7393
|
+
o(e.id), f(!1);
|
|
7394
7394
|
},
|
|
7395
7395
|
className: "w-full px-2.5 py-1 text-left text-px-muted hover:text-px-text hover:bg-px-line2 flex items-center gap-2 cursor-pointer",
|
|
7396
7396
|
children: [/* @__PURE__ */ q(d, { className: "w-3 h-3" }), /* @__PURE__ */ q("span", { children: "Hide Element" })]
|
|
7397
7397
|
}), /* @__PURE__ */ J("button", {
|
|
7398
7398
|
onClick: () => {
|
|
7399
|
-
|
|
7399
|
+
s(e.id), f(!1);
|
|
7400
7400
|
},
|
|
7401
7401
|
className: "w-full px-2.5 py-1 text-left text-px-muted hover:text-px-text hover:bg-px-line2 flex items-center gap-2 cursor-pointer",
|
|
7402
7402
|
children: [/* @__PURE__ */ q(Je, { className: "w-3 h-3" }), /* @__PURE__ */ q("span", { children: "Lock Element" })]
|
|
@@ -7639,14 +7639,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7639
7639
|
})
|
|
7640
7640
|
}, `guide-y-${t}-${e.position}`))
|
|
7641
7641
|
}), Ds = ({ node: e }) => {
|
|
7642
|
-
let { documentTree: t, selectedNodeIds: n, selectNode: r, toggleNodeSelection: i, hoveredNodeId: a, setHoveredNodeId: o, isPreviewMode: s, editingNodeId: c, startInlineEditing: l, stopInlineEditing: u, 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 } = X(), k = Aa(), A = cs(e.id), j = os(), M = j || _, N = la(e, M), ee = xs(), te = Ii(ls), P = Jt(e), ne = Ii(us), re = e.type !== "page" && (e.type !== "section" || ne) && !te, ie = ee.layoutMode === "grid", F = W(null), ae = W(""), I = W(!1), L = W(null), oe = n.includes(e.id) && !s, se = a === e.id && !oe && !s, ce = c === e.id, le = e.type === "page", ue = M === "desktop" && e.responsiveVisibility?.hideOnDesktop || M === "tablet" && e.responsiveVisibility?.hideOnTablet || M === "mobile" && e.responsiveVisibility?.hideOnMobile,
|
|
7642
|
+
let { documentTree: t, selectedNodeIds: n, selectNode: r, toggleNodeSelection: i, hoveredNodeId: a, setHoveredNodeId: o, isPreviewMode: s, editingNodeId: c, startInlineEditing: l, stopInlineEditing: u, 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 } = X(), k = Aa(), A = cs(e.id), j = os(), M = j || _, N = la(e, M), ee = xs(), te = Ii(ls), P = Jt(e), ne = Ii(us), re = e.type !== "page" && (e.type !== "section" || ne) && !te, ie = ee.layoutMode === "grid", F = W(null), ae = W(""), I = W(!1), L = W(null), oe = n.includes(e.id) && !s, se = a === e.id && !oe && !s, ce = c === e.id, le = e.type === "page", ue = e.type === "section" && !ne && (sa(t, e.id)?.index ?? 0) > 0, de = M === "desktop" && e.responsiveVisibility?.hideOnDesktop || M === "tablet" && e.responsiveVisibility?.hideOnTablet || M === "mobile" && e.responsiveVisibility?.hideOnMobile, fe = p.draggingNodeId === e.id, R = p.dropTargetId === e.id;
|
|
7643
7643
|
H(() => {
|
|
7644
7644
|
if (ce && L.current && (L.current.focus({ preventScroll: !0 }), "contentEditable" in L.current)) {
|
|
7645
7645
|
let e = document.createRange(), t = window.getSelection();
|
|
7646
7646
|
e.selectNodeContents(L.current), e.collapse(!1), t?.removeAllRanges(), t?.addRange(e);
|
|
7647
7647
|
}
|
|
7648
7648
|
}, [ce]);
|
|
7649
|
-
let
|
|
7649
|
+
let pe = (t) => {
|
|
7650
7650
|
if (t.stopPropagation(), k.commentMode && !le) {
|
|
7651
7651
|
k.onRequestComment?.({
|
|
7652
7652
|
nodeId: e.id,
|
|
@@ -7657,15 +7657,15 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7657
7657
|
return;
|
|
7658
7658
|
}
|
|
7659
7659
|
j && j !== _ && v(j), ce || (t.shiftKey ? i(e.id) : r(e.id));
|
|
7660
|
-
}, pe = (t) => {
|
|
7661
|
-
t.preventDefault(), t.stopPropagation(), j && j !== _ && v(j), ce || (r(e.id), E(e.id, t.clientX, t.clientY));
|
|
7662
7660
|
}, me = (t) => {
|
|
7663
|
-
t.
|
|
7661
|
+
t.preventDefault(), t.stopPropagation(), j && j !== _ && v(j), ce || (r(e.id), E(e.id, t.clientX, t.clientY));
|
|
7664
7662
|
}, he = (t) => {
|
|
7663
|
+
t.stopPropagation(), (e.type === "heading" || e.type === "paragraph" || e.type === "button" || e.type === "badge") && l(e.id);
|
|
7664
|
+
}, ge = (t) => {
|
|
7665
7665
|
t.stopPropagation(), o(e.id);
|
|
7666
|
-
},
|
|
7666
|
+
}, _e = (e) => {
|
|
7667
7667
|
e.stopPropagation(), o(null);
|
|
7668
|
-
},
|
|
7668
|
+
}, ve = (n) => {
|
|
7669
7669
|
if (n.preventDefault(), n.stopPropagation(), !p.draggingNodeId) return;
|
|
7670
7670
|
if (ca(t, p.draggingNodeId, e.id)) {
|
|
7671
7671
|
n.dataTransfer.dropEffect = "none";
|
|
@@ -7678,22 +7678,22 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7678
7678
|
dropPosition: o,
|
|
7679
7679
|
isValidTarget: !0
|
|
7680
7680
|
});
|
|
7681
|
-
},
|
|
7681
|
+
}, ye = (t) => {
|
|
7682
7682
|
t.stopPropagation(), p.dropTargetId === e.id && m({
|
|
7683
7683
|
dropTargetId: null,
|
|
7684
7684
|
dropPosition: null,
|
|
7685
7685
|
isValidTarget: !1
|
|
7686
7686
|
});
|
|
7687
|
-
}, ye = (e) => {
|
|
7688
|
-
e.preventDefault(), e.stopPropagation(), g();
|
|
7689
7687
|
}, be = (e) => {
|
|
7688
|
+
e.preventDefault(), e.stopPropagation(), g();
|
|
7689
|
+
}, xe = (e) => {
|
|
7690
7690
|
e.stopPropagation(), h();
|
|
7691
|
-
},
|
|
7692
|
-
let a =
|
|
7693
|
-
if (
|
|
7691
|
+
}, Se = W(null), Ce = W(""), we = () => document.querySelector("[data-plx-canvas]"), Te = (n, r, i) => {
|
|
7692
|
+
let a = Se.current;
|
|
7693
|
+
if (Se.current = null, window.removeEventListener("pointermove", Ee), window.removeEventListener("pointerup", De), window.removeEventListener("pointercancel", Oe), window.removeEventListener("keydown", ke), !a) return;
|
|
7694
7694
|
let o = F.current, s = o?.getBoundingClientRect();
|
|
7695
|
-
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(),
|
|
7696
|
-
let c = ms(r, i, e.id, t,
|
|
7695
|
+
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(), Ce.current = "", h(), !a.active || !n) return;
|
|
7696
|
+
let c = ms(r, i, e.id, t, we());
|
|
7697
7697
|
if (c.kind === "node") O(e.id, c.targetId, c.position);
|
|
7698
7698
|
else if (c.kind === "canvas" && s) {
|
|
7699
7699
|
let t = hs(s.left, s.top), n = Math.max(.2, (y || 100) / 100);
|
|
@@ -7702,8 +7702,8 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7702
7702
|
height: s.height / n
|
|
7703
7703
|
});
|
|
7704
7704
|
}
|
|
7705
|
-
},
|
|
7706
|
-
let i =
|
|
7705
|
+
}, Ee = (n) => {
|
|
7706
|
+
let i = Se.current, a = F.current;
|
|
7707
7707
|
if (!i || !a) return;
|
|
7708
7708
|
let o = n.clientX - i.startX, s = n.clientY - i.startY;
|
|
7709
7709
|
if (!i.active) {
|
|
@@ -7734,10 +7734,10 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7734
7734
|
}
|
|
7735
7735
|
let c = Math.max(.2, (y || 100) / 100);
|
|
7736
7736
|
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)";
|
|
7737
|
-
let l = ms(n.clientX, n.clientY, e.id, t,
|
|
7737
|
+
let l = ms(n.clientX, n.clientY, e.id, t, we());
|
|
7738
7738
|
i.spot = l;
|
|
7739
7739
|
let u = l.kind === "node" ? `${l.targetId}:${l.position}` : l.kind;
|
|
7740
|
-
u !==
|
|
7740
|
+
u !== Ce.current && (Ce.current = u, l.kind === "node" ? m({
|
|
7741
7741
|
dropTargetId: l.targetId,
|
|
7742
7742
|
dropPosition: l.position,
|
|
7743
7743
|
isValidTarget: !0
|
|
@@ -7746,14 +7746,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7746
7746
|
dropPosition: null,
|
|
7747
7747
|
isValidTarget: !1
|
|
7748
7748
|
})), i.hint && (i.hint.style.display = l.kind === "canvas" ? "block" : "none", i.hint.textContent = "Let go to place it on the empty canvas", i.hint.style.left = `${n.clientX + 14}px`, i.hint.style.top = `${n.clientY + 16}px`);
|
|
7749
|
-
},
|
|
7750
|
-
e.key === "Escape" &&
|
|
7751
|
-
},
|
|
7749
|
+
}, De = (e) => Te(!0, e.clientX, e.clientY), Oe = (e) => Te(!1, e.clientX, e.clientY), ke = (e) => {
|
|
7750
|
+
e.key === "Escape" && Te(!1, 0, 0);
|
|
7751
|
+
}, Ae = (n) => {
|
|
7752
7752
|
if (n.button !== 0 || ce || le || te || re || e.type !== "section" || k.commentMode) return;
|
|
7753
7753
|
let r = n.target;
|
|
7754
7754
|
if (r.closest(".no-drag, input, textarea, select, button, a, [contenteditable=\"true\"], [data-plx-chrome]")) return;
|
|
7755
7755
|
let i = r.closest("[data-plx-node]");
|
|
7756
|
-
i && i.id !== e.id && !vn(t, i.id) || (
|
|
7756
|
+
i && i.id !== e.id && !vn(t, i.id) || (Se.current = {
|
|
7757
7757
|
startX: n.clientX,
|
|
7758
7758
|
startY: n.clientY,
|
|
7759
7759
|
active: !1,
|
|
@@ -7761,8 +7761,8 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7761
7761
|
spot: { kind: "none" },
|
|
7762
7762
|
cursorStyle: null,
|
|
7763
7763
|
hint: null
|
|
7764
|
-
}, window.addEventListener("pointermove",
|
|
7765
|
-
}, [
|
|
7764
|
+
}, window.addEventListener("pointermove", Ee), window.addEventListener("pointerup", De), window.addEventListener("pointercancel", Oe), window.addEventListener("keydown", ke));
|
|
7765
|
+
}, [je, Me] = G(!1), Ne = W(!1), Pe = W(null), Fe = W(null), Ie = W(null), Le = W({ kind: "none" }), Re = W(""), ze = ne && ee.parentId === "plx-workspace", Be = (i) => {
|
|
7766
7766
|
if (ce || !re) return;
|
|
7767
7767
|
let a = i.target;
|
|
7768
7768
|
if (a.closest(".no-drag") || a.tagName.toLowerCase() === "input" || a.tagName.toLowerCase() === "textarea") return;
|
|
@@ -7777,7 +7777,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7777
7777
|
startY: typeof e.styles.y == "number" ? e.styles.y : Math.round(c)
|
|
7778
7778
|
};
|
|
7779
7779
|
}), x = o.clientWidth || s.width / l, S = o.clientHeight || s.height / l, C = c.width / l, w = c.height / l;
|
|
7780
|
-
|
|
7780
|
+
Fe.current = {
|
|
7781
7781
|
pointerX: i.clientX,
|
|
7782
7782
|
pointerY: i.clientY,
|
|
7783
7783
|
startX: m,
|
|
@@ -7795,18 +7795,18 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7795
7795
|
startX: m,
|
|
7796
7796
|
startY: h
|
|
7797
7797
|
}]
|
|
7798
|
-
},
|
|
7798
|
+
}, Ie.current = {
|
|
7799
7799
|
targetX: m,
|
|
7800
7800
|
targetY: h,
|
|
7801
7801
|
parentW: x,
|
|
7802
7802
|
parentH: S,
|
|
7803
7803
|
nodeW: C,
|
|
7804
7804
|
nodeH: w
|
|
7805
|
-
},
|
|
7806
|
-
},
|
|
7807
|
-
if (!
|
|
7805
|
+
}, Ne.current = !0, Me(!0);
|
|
7806
|
+
}, Ve = (n) => {
|
|
7807
|
+
if (!Ne.current || !Fe.current) return;
|
|
7808
7808
|
n.stopPropagation(), n.preventDefault();
|
|
7809
|
-
let { pointerX: r, pointerY: i, startX: a, startY: o, parentW: s, parentH: c, nodeW: l, nodeH: u, siblings: d, nodeStarts: f } =
|
|
7809
|
+
let { pointerX: r, pointerY: i, startX: a, startY: o, parentW: s, parentH: c, nodeW: l, nodeH: u, siblings: d, nodeStarts: f } = Fe.current, p = Math.max(.2, (y || 100) / 100), g = (n.clientX - r) / p, _ = (n.clientY - i) / p, v = a + g, b = o + _, E = [];
|
|
7810
7810
|
if (!(n.altKey || !S) && S) {
|
|
7811
7811
|
let e = [
|
|
7812
7812
|
0,
|
|
@@ -7886,7 +7886,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7886
7886
|
}
|
|
7887
7887
|
!n && x && (v = Math.round(v / C) * C), !r && x && (b = Math.round(b / C) * C);
|
|
7888
7888
|
} else x && !n.altKey && (v = Math.round(v / C) * C, b = Math.round(b / C) * C);
|
|
7889
|
-
|
|
7889
|
+
Ie.current = {
|
|
7890
7890
|
targetX: v,
|
|
7891
7891
|
targetY: b,
|
|
7892
7892
|
parentW: s,
|
|
@@ -7896,7 +7896,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7896
7896
|
};
|
|
7897
7897
|
let D = Math.round(v - a), O = Math.round(b - o);
|
|
7898
7898
|
if (F.current) {
|
|
7899
|
-
let e =
|
|
7899
|
+
let e = We.filter((e) => !e.startsWith("translate3d")), t = [`translate3d(${D}px, ${O}px, 0px)`, ...e].join(" ");
|
|
7900
7900
|
F.current.style.transform = t;
|
|
7901
7901
|
}
|
|
7902
7902
|
f.forEach(({ id: t }) => {
|
|
@@ -7904,36 +7904,36 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7904
7904
|
let e = document.getElementById(t);
|
|
7905
7905
|
e && (e.style.transform = `translate3d(${D}px, ${O}px, 0px)`);
|
|
7906
7906
|
}
|
|
7907
|
-
}),
|
|
7907
|
+
}), Pe.current && (Pe.current.textContent = `X: ${Math.round(v)}px · Y: ${Math.round(b)}px`);
|
|
7908
7908
|
let k = ms(n.clientX, n.clientY, e.id, t, document.querySelector("[data-plx-canvas]"));
|
|
7909
|
-
|
|
7910
|
-
let A =
|
|
7911
|
-
A !==
|
|
7909
|
+
Le.current = k;
|
|
7910
|
+
let A = ze && k.kind === "node" ? `${k.targetId}:${k.position}` : "";
|
|
7911
|
+
A !== Re.current && (Re.current = A, A && k.kind === "node" ? m({
|
|
7912
7912
|
draggingNodeId: e.id,
|
|
7913
7913
|
dropTargetId: k.targetId,
|
|
7914
7914
|
dropPosition: k.position,
|
|
7915
7915
|
isValidTarget: !0
|
|
7916
7916
|
}) : h()), (E.length > 0 || w.length > 0) && T(E);
|
|
7917
|
-
},
|
|
7918
|
-
if (!
|
|
7919
|
-
|
|
7917
|
+
}, He = (r) => {
|
|
7918
|
+
if (!Ne.current) return;
|
|
7919
|
+
Ne.current = !1, r.stopPropagation(), r.preventDefault();
|
|
7920
7920
|
try {
|
|
7921
7921
|
r.currentTarget.releasePointerCapture(r.pointerId);
|
|
7922
7922
|
} catch {}
|
|
7923
|
-
let i =
|
|
7924
|
-
|
|
7923
|
+
let i = Le.current;
|
|
7924
|
+
Le.current = { kind: "none" }, Re.current = "";
|
|
7925
7925
|
let a = F.current?.getBoundingClientRect(), o = (() => {
|
|
7926
|
-
let e =
|
|
7926
|
+
let e = Fe.current, t = Ie.current;
|
|
7927
7927
|
return !!e && !!t && Math.hypot(t.targetX - e.startX, t.targetY - e.startY) > 2;
|
|
7928
7928
|
})();
|
|
7929
|
-
if (F.current && (F.current.style.transform =
|
|
7930
|
-
if (
|
|
7931
|
-
|
|
7929
|
+
if (F.current && (F.current.style.transform = We.length > 0 ? We.join(" ") : ""), o && n.length <= 1) {
|
|
7930
|
+
if (ze && i.kind === "node") {
|
|
7931
|
+
Fe.current = null, Ie.current = null, Ne.current = !1, Me(!1), T([]), h(), O(e.id, i.targetId, i.position);
|
|
7932
7932
|
return;
|
|
7933
7933
|
}
|
|
7934
7934
|
if (!ne && i.kind === "canvas" && a) {
|
|
7935
7935
|
let t = hs(a.left, a.top), n = Math.max(.2, (y || 100) / 100);
|
|
7936
|
-
if (
|
|
7936
|
+
if (Fe.current = null, Ie.current = null, Me(!1), T([]), h(), t) {
|
|
7937
7937
|
D(e.id, t, {
|
|
7938
7938
|
width: a.width / n,
|
|
7939
7939
|
height: a.height / n
|
|
@@ -7943,8 +7943,8 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
7943
7943
|
}
|
|
7944
7944
|
}
|
|
7945
7945
|
h();
|
|
7946
|
-
let s =
|
|
7947
|
-
if (
|
|
7946
|
+
let s = Fe.current, c = Ie.current;
|
|
7947
|
+
if (Fe.current = null, Ie.current = null, Me(!1), T([]), !s || !c) return;
|
|
7948
7948
|
s.nodeStarts.forEach(({ id: t }) => {
|
|
7949
7949
|
if (t !== e.id) {
|
|
7950
7950
|
let e = document.getElementById(t);
|
|
@@ -8041,26 +8041,26 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8041
8041
|
parentLock: L,
|
|
8042
8042
|
spacer: I
|
|
8043
8043
|
});
|
|
8044
|
-
}, { css:
|
|
8044
|
+
}, { css: Ue, transformParts: We, hConstraint: Ge, vConstraint: Ke, isFreeContainer: qe } = nr(e, N, {
|
|
8045
8045
|
viewport: M,
|
|
8046
8046
|
isGridChild: ie,
|
|
8047
8047
|
isRootPage: le
|
|
8048
|
-
}),
|
|
8049
|
-
...
|
|
8050
|
-
opacity:
|
|
8048
|
+
}), Je = A === "outside" && !s, Ye = {
|
|
8049
|
+
...Ue,
|
|
8050
|
+
opacity: fe ? .35 : de ? .45 : Je ? Math.min(.4, Number(Ue.opacity ?? 1)) : Ue.opacity,
|
|
8051
8051
|
...e.type === "section" ? { overflow: s ? "hidden" : "visible" } : {}
|
|
8052
|
-
},
|
|
8053
|
-
|
|
8052
|
+
}, z = () => s ? null : /* @__PURE__ */ J(K, { children: [
|
|
8053
|
+
de && /* @__PURE__ */ J("div", {
|
|
8054
8054
|
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",
|
|
8055
8055
|
children: [/* @__PURE__ */ q(d, { className: "w-2.5 h-2.5" }), /* @__PURE__ */ J("span", { children: ["Hidden on ", M] })]
|
|
8056
8056
|
}),
|
|
8057
|
-
|
|
8057
|
+
R && p.dropPosition && /* @__PURE__ */ q(Ts, { position: p.dropPosition }),
|
|
8058
8058
|
!le && se && !oe && /* @__PURE__ */ q("div", {
|
|
8059
8059
|
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",
|
|
8060
8060
|
children: e.name
|
|
8061
8061
|
}),
|
|
8062
|
-
|
|
8063
|
-
ref:
|
|
8062
|
+
je && /* @__PURE__ */ J("div", {
|
|
8063
|
+
ref: Pe,
|
|
8064
8064
|
className: "absolute -top-7 left-1/2 -translate-x-1/2 z-50 bg-[#161A24] text-px-accent font-mono text-[10px] px-2 py-0.5 rounded border border-px-accent/60 shadow-xl pointer-events-none whitespace-nowrap",
|
|
8065
8065
|
children: [
|
|
8066
8066
|
"X: ",
|
|
@@ -8071,7 +8071,13 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8071
8071
|
]
|
|
8072
8072
|
}),
|
|
8073
8073
|
!le && oe && /* @__PURE__ */ J(K, { children: [
|
|
8074
|
-
P ? /* @__PURE__ */ q(gs, {
|
|
8074
|
+
P ? /* @__PURE__ */ q(gs, {
|
|
8075
|
+
section: e,
|
|
8076
|
+
inside: ue
|
|
8077
|
+
}) : /* @__PURE__ */ q(Ss, {
|
|
8078
|
+
node: e,
|
|
8079
|
+
inside: ue
|
|
8080
|
+
}),
|
|
8075
8081
|
!P && /* @__PURE__ */ q(Cs, {
|
|
8076
8082
|
node: e,
|
|
8077
8083
|
elementRef: F
|
|
@@ -8080,7 +8086,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8080
8086
|
re && /* @__PURE__ */ J("div", {
|
|
8081
8087
|
className: "absolute inset-0 pointer-events-none z-20 overflow-visible",
|
|
8082
8088
|
children: [
|
|
8083
|
-
(
|
|
8089
|
+
(Ge === "left" || Ge === "stretch") && (N.x ?? 0) > 0 && /* @__PURE__ */ q("div", {
|
|
8084
8090
|
className: "absolute top-1/2 -translate-y-1/2 pointer-events-none",
|
|
8085
8091
|
style: {
|
|
8086
8092
|
left: `-${N.x || 0}px`,
|
|
@@ -8091,7 +8097,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8091
8097
|
children: /* @__PURE__ */ q("div", { className: "absolute -left-1 -top-1 w-2 h-2 rounded-full bg-px-accent ring-2 ring-px-canvas" })
|
|
8092
8098
|
})
|
|
8093
8099
|
}),
|
|
8094
|
-
(
|
|
8100
|
+
(Ge === "right" || Ge === "stretch") && (N.rightOffset ?? 0) > 0 && /* @__PURE__ */ q("div", {
|
|
8095
8101
|
className: "absolute top-1/2 -translate-y-1/2 left-full pointer-events-none",
|
|
8096
8102
|
style: { width: `${N.rightOffset || 0}px` },
|
|
8097
8103
|
children: /* @__PURE__ */ q("div", {
|
|
@@ -8099,7 +8105,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8099
8105
|
children: /* @__PURE__ */ q("div", { className: "absolute -right-1 -top-1 w-2 h-2 rounded-full bg-px-accent ring-2 ring-px-canvas" })
|
|
8100
8106
|
})
|
|
8101
8107
|
}),
|
|
8102
|
-
(
|
|
8108
|
+
(Ke === "top" || Ke === "stretch") && (N.y ?? 0) > 0 && /* @__PURE__ */ q("div", {
|
|
8103
8109
|
className: "absolute left-1/2 -translate-x-1/2 pointer-events-none",
|
|
8104
8110
|
style: {
|
|
8105
8111
|
top: `-${N.y || 0}px`,
|
|
@@ -8110,7 +8116,7 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8110
8116
|
children: /* @__PURE__ */ q("div", { className: "absolute -top-1 -left-1 w-2 h-2 rounded-full bg-px-accent ring-2 ring-px-canvas" })
|
|
8111
8117
|
})
|
|
8112
8118
|
}),
|
|
8113
|
-
(
|
|
8119
|
+
(Ke === "bottom" || Ke === "stretch") && (N.bottomOffset ?? 0) > 0 && /* @__PURE__ */ q("div", {
|
|
8114
8120
|
className: "absolute left-1/2 -translate-x-1/2 top-full pointer-events-none",
|
|
8115
8121
|
style: { height: `${N.bottomOffset || 0}px` },
|
|
8116
8122
|
children: /* @__PURE__ */ q("div", {
|
|
@@ -8118,14 +8124,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8118
8124
|
children: /* @__PURE__ */ q("div", { className: "absolute -bottom-1 -left-1 w-2 h-2 rounded-full bg-px-accent ring-2 ring-px-canvas" })
|
|
8119
8125
|
})
|
|
8120
8126
|
}),
|
|
8121
|
-
|
|
8127
|
+
Ge === "center" && /* @__PURE__ */ q("div", {
|
|
8122
8128
|
className: "absolute -top-3 left-1/2 -translate-x-1/2 pointer-events-none",
|
|
8123
8129
|
children: /* @__PURE__ */ q("span", {
|
|
8124
8130
|
className: "text-[8px] font-mono text-px-accent-soft bg-px-accent-deep/90 px-1 py-0.2 rounded border border-px-accent/50",
|
|
8125
8131
|
children: "Center H"
|
|
8126
8132
|
})
|
|
8127
8133
|
}),
|
|
8128
|
-
|
|
8134
|
+
Ke === "center" && /* @__PURE__ */ q("div", {
|
|
8129
8135
|
className: "absolute top-1/2 -left-3 -translate-y-1/2 -translate-x-full pointer-events-none",
|
|
8130
8136
|
children: /* @__PURE__ */ q("span", {
|
|
8131
8137
|
className: "text-[8px] font-mono text-px-accent-soft bg-px-accent-deep/90 px-1 py-0.2 rounded border border-px-accent/50",
|
|
@@ -8135,22 +8141,22 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8135
8141
|
]
|
|
8136
8142
|
})
|
|
8137
8143
|
] })
|
|
8138
|
-
] }),
|
|
8144
|
+
] }), Xe = le ? "relative cursor-default transition-shadow" : re ? oe ? "outline outline-1 outline-px-accent -outline-offset-1 cursor-move" : se ? "outline outline-1 outline-dashed outline-px-accent/50 cursor-move" : "cursor-pointer transition-shadow" : oe ? `relative outline outline-1 outline-px-accent -outline-offset-1 ${e.type === "section" && !te ? "cursor-move" : "cursor-pointer"}` : se ? "relative outline outline-1 outline-dashed outline-px-accent/50 cursor-pointer" : "relative cursor-pointer transition-shadow", Ze = de && !s ? "border border-dashed border-red-500/60 bg-[repeating-linear-gradient(45deg,transparent,transparent_10px,rgba(239,68,68,0.06)_10px,rgba(239,68,68,0.06)_20px)]" : "", Qe = re ? {
|
|
8139
8145
|
draggable: !1,
|
|
8140
|
-
onPointerDown:
|
|
8141
|
-
onPointerMove:
|
|
8142
|
-
onPointerUp:
|
|
8143
|
-
onPointerCancel:
|
|
8144
|
-
onContextMenu:
|
|
8146
|
+
onPointerDown: Be,
|
|
8147
|
+
onPointerMove: Ve,
|
|
8148
|
+
onPointerUp: He,
|
|
8149
|
+
onPointerCancel: He,
|
|
8150
|
+
onContextMenu: me
|
|
8145
8151
|
} : {
|
|
8146
8152
|
draggable: !1,
|
|
8147
|
-
onPointerDown:
|
|
8148
|
-
onDragOver:
|
|
8149
|
-
onDragLeave:
|
|
8150
|
-
onDrop:
|
|
8151
|
-
onDragEnd:
|
|
8152
|
-
onContextMenu:
|
|
8153
|
-
},
|
|
8153
|
+
onPointerDown: Ae,
|
|
8154
|
+
onDragOver: ve,
|
|
8155
|
+
onDragLeave: ye,
|
|
8156
|
+
onDrop: be,
|
|
8157
|
+
onDragEnd: xe,
|
|
8158
|
+
onContextMenu: me
|
|
8159
|
+
}, B = (t) => {
|
|
8154
8160
|
if (!ce) {
|
|
8155
8161
|
I.current = !1;
|
|
8156
8162
|
let n = e.props?.highlightText;
|
|
@@ -8190,19 +8196,19 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8190
8196
|
"data-plx-node": "",
|
|
8191
8197
|
ref: F,
|
|
8192
8198
|
style: {
|
|
8193
|
-
...
|
|
8199
|
+
...Ye,
|
|
8194
8200
|
maxWidth: N.maxWidth || void 0,
|
|
8195
8201
|
marginLeft: N.horizontalAlign === "left" ? "0px" : N.horizontalAlign === "right" ? "auto" : N.marginLeft || "auto",
|
|
8196
8202
|
marginRight: N.horizontalAlign === "left" ? "auto" : N.horizontalAlign === "right" ? "0px" : N.marginRight || "auto"
|
|
8197
8203
|
},
|
|
8198
|
-
onClick:
|
|
8199
|
-
onContextMenu:
|
|
8200
|
-
onDragOver:
|
|
8201
|
-
onDrop:
|
|
8202
|
-
className: `min-h-screen w-full relative ${
|
|
8204
|
+
onClick: pe,
|
|
8205
|
+
onContextMenu: me,
|
|
8206
|
+
onDragOver: ve,
|
|
8207
|
+
onDrop: be,
|
|
8208
|
+
className: `min-h-screen w-full relative ${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8203
8209
|
children: [
|
|
8204
|
-
|
|
8205
|
-
|
|
8210
|
+
z(),
|
|
8211
|
+
qe && /* @__PURE__ */ q(Es, { guides: w }),
|
|
8206
8212
|
/* @__PURE__ */ q(bs.Provider, {
|
|
8207
8213
|
value: {
|
|
8208
8214
|
layoutMode: N.layoutMode || "free",
|
|
@@ -8216,16 +8222,16 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8216
8222
|
id: e.id,
|
|
8217
8223
|
"data-plx-node": "",
|
|
8218
8224
|
ref: F,
|
|
8219
|
-
style:
|
|
8220
|
-
onClick:
|
|
8221
|
-
onDoubleClick:
|
|
8222
|
-
onMouseEnter:
|
|
8223
|
-
onMouseLeave:
|
|
8224
|
-
...
|
|
8225
|
-
className: `${
|
|
8225
|
+
style: Ye,
|
|
8226
|
+
onClick: pe,
|
|
8227
|
+
onDoubleClick: he,
|
|
8228
|
+
onMouseEnter: ge,
|
|
8229
|
+
onMouseLeave: _e,
|
|
8230
|
+
...Qe,
|
|
8231
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8226
8232
|
children: [
|
|
8227
|
-
|
|
8228
|
-
|
|
8233
|
+
z(),
|
|
8234
|
+
qe && /* @__PURE__ */ q(Es, { guides: w }),
|
|
8229
8235
|
/* @__PURE__ */ q(bs.Provider, {
|
|
8230
8236
|
value: {
|
|
8231
8237
|
layoutMode: N.layoutMode || "free",
|
|
@@ -8243,16 +8249,16 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8243
8249
|
id: e.id,
|
|
8244
8250
|
"data-plx-node": "",
|
|
8245
8251
|
ref: F,
|
|
8246
|
-
style:
|
|
8247
|
-
onClick:
|
|
8248
|
-
onDoubleClick:
|
|
8249
|
-
onMouseEnter:
|
|
8250
|
-
onMouseLeave:
|
|
8251
|
-
...
|
|
8252
|
-
className: `${
|
|
8252
|
+
style: Ye,
|
|
8253
|
+
onClick: pe,
|
|
8254
|
+
onDoubleClick: he,
|
|
8255
|
+
onMouseEnter: ge,
|
|
8256
|
+
onMouseLeave: _e,
|
|
8257
|
+
...Qe,
|
|
8258
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8253
8259
|
children: [
|
|
8254
|
-
|
|
8255
|
-
|
|
8260
|
+
z(),
|
|
8261
|
+
qe && /* @__PURE__ */ q(Es, { guides: w }),
|
|
8256
8262
|
/* @__PURE__ */ q(bs.Provider, {
|
|
8257
8263
|
value: {
|
|
8258
8264
|
layoutMode: N.layoutMode || "free",
|
|
@@ -8266,79 +8272,79 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8266
8272
|
id: e.id,
|
|
8267
8273
|
"data-plx-node": "",
|
|
8268
8274
|
ref: F,
|
|
8269
|
-
style:
|
|
8270
|
-
onClick:
|
|
8271
|
-
onDoubleClick:
|
|
8272
|
-
onMouseEnter:
|
|
8273
|
-
onMouseLeave:
|
|
8274
|
-
...
|
|
8275
|
-
className: `grid ${
|
|
8276
|
-
children: [
|
|
8275
|
+
style: Ye,
|
|
8276
|
+
onClick: pe,
|
|
8277
|
+
onDoubleClick: he,
|
|
8278
|
+
onMouseEnter: ge,
|
|
8279
|
+
onMouseLeave: _e,
|
|
8280
|
+
...Qe,
|
|
8281
|
+
className: `grid ${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8282
|
+
children: [z(), e.children?.map((e) => /* @__PURE__ */ q(Os, { node: e }, e.id))]
|
|
8277
8283
|
});
|
|
8278
8284
|
case "column": return /* @__PURE__ */ J("div", {
|
|
8279
8285
|
id: e.id,
|
|
8280
8286
|
"data-plx-node": "",
|
|
8281
8287
|
ref: F,
|
|
8282
|
-
style:
|
|
8283
|
-
onClick:
|
|
8284
|
-
onDoubleClick:
|
|
8285
|
-
onMouseEnter:
|
|
8286
|
-
onMouseLeave:
|
|
8287
|
-
...
|
|
8288
|
-
className: `${
|
|
8289
|
-
children: [
|
|
8288
|
+
style: Ye,
|
|
8289
|
+
onClick: pe,
|
|
8290
|
+
onDoubleClick: he,
|
|
8291
|
+
onMouseEnter: ge,
|
|
8292
|
+
onMouseLeave: _e,
|
|
8293
|
+
...Qe,
|
|
8294
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8295
|
+
children: [z(), e.children?.map((e) => /* @__PURE__ */ q(Os, { node: e }, e.id))]
|
|
8290
8296
|
});
|
|
8291
8297
|
case "heading": return /* @__PURE__ */ J(`h${e.props?.level || 2}`, {
|
|
8292
8298
|
id: e.id,
|
|
8293
8299
|
"data-plx-node": "",
|
|
8294
8300
|
ref: F,
|
|
8295
|
-
style:
|
|
8296
|
-
onClick:
|
|
8297
|
-
onDoubleClick:
|
|
8298
|
-
onMouseEnter:
|
|
8299
|
-
onMouseLeave:
|
|
8300
|
-
...
|
|
8301
|
-
className: `${
|
|
8302
|
-
children: [
|
|
8301
|
+
style: Ye,
|
|
8302
|
+
onClick: pe,
|
|
8303
|
+
onDoubleClick: he,
|
|
8304
|
+
onMouseEnter: ge,
|
|
8305
|
+
onMouseLeave: _e,
|
|
8306
|
+
...Qe,
|
|
8307
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8308
|
+
children: [z(), B(e.content || "")]
|
|
8303
8309
|
});
|
|
8304
8310
|
case "paragraph": return /* @__PURE__ */ J("p", {
|
|
8305
8311
|
id: e.id,
|
|
8306
8312
|
"data-plx-node": "",
|
|
8307
8313
|
ref: F,
|
|
8308
|
-
style:
|
|
8309
|
-
onClick:
|
|
8310
|
-
onDoubleClick:
|
|
8311
|
-
onMouseEnter:
|
|
8312
|
-
onMouseLeave:
|
|
8313
|
-
...
|
|
8314
|
-
className: `${
|
|
8315
|
-
children: [
|
|
8314
|
+
style: Ye,
|
|
8315
|
+
onClick: pe,
|
|
8316
|
+
onDoubleClick: he,
|
|
8317
|
+
onMouseEnter: ge,
|
|
8318
|
+
onMouseLeave: _e,
|
|
8319
|
+
...Qe,
|
|
8320
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8321
|
+
children: [z(), B(e.content || "")]
|
|
8316
8322
|
});
|
|
8317
8323
|
case "button": return /* @__PURE__ */ J("button", {
|
|
8318
8324
|
id: e.id,
|
|
8319
8325
|
"data-plx-node": "",
|
|
8320
8326
|
ref: F,
|
|
8321
|
-
style:
|
|
8322
|
-
onClick:
|
|
8323
|
-
onDoubleClick:
|
|
8324
|
-
onMouseEnter:
|
|
8325
|
-
onMouseLeave:
|
|
8326
|
-
...
|
|
8327
|
-
className: `cursor-pointer hover:opacity-90 active:scale-95 transition-transform ${
|
|
8328
|
-
children: [
|
|
8327
|
+
style: Ye,
|
|
8328
|
+
onClick: pe,
|
|
8329
|
+
onDoubleClick: he,
|
|
8330
|
+
onMouseEnter: ge,
|
|
8331
|
+
onMouseLeave: _e,
|
|
8332
|
+
...Qe,
|
|
8333
|
+
className: `cursor-pointer hover:opacity-90 active:scale-95 transition-transform ${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8334
|
+
children: [z(), B(e.content || "")]
|
|
8329
8335
|
});
|
|
8330
8336
|
case "image": return /* @__PURE__ */ J("div", {
|
|
8331
8337
|
id: e.id,
|
|
8332
8338
|
"data-plx-node": "",
|
|
8333
8339
|
ref: F,
|
|
8334
|
-
style:
|
|
8335
|
-
onClick:
|
|
8336
|
-
onDoubleClick:
|
|
8337
|
-
onMouseEnter:
|
|
8338
|
-
onMouseLeave:
|
|
8339
|
-
...
|
|
8340
|
-
className: `overflow-hidden ${
|
|
8341
|
-
children: [
|
|
8340
|
+
style: Ye,
|
|
8341
|
+
onClick: pe,
|
|
8342
|
+
onDoubleClick: he,
|
|
8343
|
+
onMouseEnter: ge,
|
|
8344
|
+
onMouseLeave: _e,
|
|
8345
|
+
...Qe,
|
|
8346
|
+
className: `overflow-hidden ${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8347
|
+
children: [z(), /* @__PURE__ */ q("img", {
|
|
8342
8348
|
src: e.props?.src || "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20800%20500'%3E%3Crect%20width%3D'800'%20height%3D'500'%20fill%3D'%23e5e7eb'%2F%3E%3Cg%20fill%3D'none'%20stroke%3D'%239ca3af'%20stroke-width%3D'14'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'300'%20y%3D'170'%20width%3D'200'%20height%3D'160'%20rx%3D'18'%2F%3E%3Ccircle%20cx%3D'360'%20cy%3D'225'%20r%3D'16'%2F%3E%3Cpath%20d%3D'M310%20310l60-60%2050%2050%2030-30%2040%2040'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",
|
|
8343
8349
|
alt: e.props?.alt ?? "",
|
|
8344
8350
|
className: `w-full h-full ${e.props?.fit === "contain" ? "object-contain" : "object-cover"} pointer-events-none`
|
|
@@ -8348,37 +8354,37 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8348
8354
|
id: e.id,
|
|
8349
8355
|
"data-plx-node": "",
|
|
8350
8356
|
ref: F,
|
|
8351
|
-
style:
|
|
8352
|
-
onClick:
|
|
8353
|
-
onDoubleClick:
|
|
8354
|
-
onMouseEnter:
|
|
8355
|
-
onMouseLeave:
|
|
8356
|
-
...
|
|
8357
|
-
className: `${
|
|
8358
|
-
children: [
|
|
8357
|
+
style: Ye,
|
|
8358
|
+
onClick: pe,
|
|
8359
|
+
onDoubleClick: he,
|
|
8360
|
+
onMouseEnter: ge,
|
|
8361
|
+
onMouseLeave: _e,
|
|
8362
|
+
...Qe,
|
|
8363
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8364
|
+
children: [z(), B(e.content || "")]
|
|
8359
8365
|
});
|
|
8360
8366
|
case "divider": return /* @__PURE__ */ q("hr", {
|
|
8361
8367
|
id: e.id,
|
|
8362
8368
|
"data-plx-node": "",
|
|
8363
8369
|
ref: F,
|
|
8364
|
-
style:
|
|
8365
|
-
onClick:
|
|
8366
|
-
onMouseEnter:
|
|
8367
|
-
onMouseLeave:
|
|
8368
|
-
...
|
|
8369
|
-
className: `${
|
|
8370
|
+
style: Ye,
|
|
8371
|
+
onClick: pe,
|
|
8372
|
+
onMouseEnter: ge,
|
|
8373
|
+
onMouseLeave: _e,
|
|
8374
|
+
...Qe,
|
|
8375
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`
|
|
8370
8376
|
});
|
|
8371
8377
|
case "spacer": return /* @__PURE__ */ J("div", {
|
|
8372
8378
|
id: e.id,
|
|
8373
8379
|
"data-plx-node": "",
|
|
8374
8380
|
ref: F,
|
|
8375
|
-
style:
|
|
8376
|
-
onClick:
|
|
8377
|
-
onMouseEnter:
|
|
8378
|
-
onMouseLeave:
|
|
8379
|
-
...
|
|
8380
|
-
className: `${
|
|
8381
|
-
children: [
|
|
8381
|
+
style: Ye,
|
|
8382
|
+
onClick: pe,
|
|
8383
|
+
onMouseEnter: ge,
|
|
8384
|
+
onMouseLeave: _e,
|
|
8385
|
+
...Qe,
|
|
8386
|
+
className: `${Xe} ${Ze} ${oe ? "bg-px-accent/10" : ""} ${N.customClasses || ""}`,
|
|
8387
|
+
children: [z(), oe && /* @__PURE__ */ J("div", {
|
|
8382
8388
|
className: "w-full h-full flex items-center justify-center text-[10px] text-px-accent font-mono",
|
|
8383
8389
|
children: [
|
|
8384
8390
|
"Spacer (",
|
|
@@ -8416,14 +8422,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8416
8422
|
id: e.id,
|
|
8417
8423
|
"data-plx-node": "",
|
|
8418
8424
|
ref: F,
|
|
8419
|
-
style:
|
|
8420
|
-
onClick:
|
|
8421
|
-
onDoubleClick:
|
|
8422
|
-
onMouseEnter:
|
|
8423
|
-
onMouseLeave:
|
|
8424
|
-
...
|
|
8425
|
-
className: `${
|
|
8426
|
-
children: [
|
|
8425
|
+
style: Ye,
|
|
8426
|
+
onClick: pe,
|
|
8427
|
+
onDoubleClick: he,
|
|
8428
|
+
onMouseEnter: ge,
|
|
8429
|
+
onMouseLeave: _e,
|
|
8430
|
+
...Qe,
|
|
8431
|
+
className: `${Xe} ${Ze} ${N.customClasses || ""}`,
|
|
8432
|
+
children: [z(), /* @__PURE__ */ q(ys, {
|
|
8427
8433
|
node: e,
|
|
8428
8434
|
preview: s
|
|
8429
8435
|
})]
|
|
@@ -8432,14 +8438,14 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8432
8438
|
id: e.id,
|
|
8433
8439
|
"data-plx-node": "",
|
|
8434
8440
|
ref: F,
|
|
8435
|
-
style:
|
|
8436
|
-
onClick:
|
|
8437
|
-
onMouseEnter:
|
|
8438
|
-
onMouseLeave:
|
|
8439
|
-
...
|
|
8440
|
-
className: `${
|
|
8441
|
+
style: Ye,
|
|
8442
|
+
onClick: pe,
|
|
8443
|
+
onMouseEnter: ge,
|
|
8444
|
+
onMouseLeave: _e,
|
|
8445
|
+
...Qe,
|
|
8446
|
+
className: `${Xe} ${Ze}`,
|
|
8441
8447
|
children: [
|
|
8442
|
-
|
|
8448
|
+
z(),
|
|
8443
8449
|
e.content || e.name,
|
|
8444
8450
|
e.children?.map((e) => /* @__PURE__ */ q(Os, { node: e }, e.id))
|
|
8445
8451
|
]
|
|
@@ -8709,17 +8715,16 @@ var ys = ({ node: e, preview: t }) => {
|
|
|
8709
8715
|
})
|
|
8710
8716
|
});
|
|
8711
8717
|
}, As = ({ y: e, always: t, top: n, onClick: r }) => /* @__PURE__ */ J("div", {
|
|
8712
|
-
className: `group/zone absolute left-0 right-0 h-8
|
|
8713
|
-
style: { top: e },
|
|
8718
|
+
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"}`,
|
|
8719
|
+
style: { top: n ? e - 32 : e },
|
|
8714
8720
|
"data-plx-add-zone": "",
|
|
8715
|
-
children: [/* @__PURE__ */ q("div", { className: `absolute left-0 right-0 h-px bg-px-accent transition-opacity ${t ? "opacity-30" : "opacity-0"} group-hover/zone:opacity-100 group-focus-within/zone:opacity-100` }), /* @__PURE__ */ J("button", {
|
|
8721
|
+
children: [/* @__PURE__ */ q("div", { className: `absolute left-0 right-0 ${n ? "bottom-0" : "top-0"} h-px bg-px-accent transition-opacity ${t ? "opacity-30" : "opacity-0"} group-hover/zone:opacity-100 group-focus-within/zone:opacity-100` }), /* @__PURE__ */ J("button", {
|
|
8716
8722
|
type: "button",
|
|
8717
8723
|
"aria-label": "Add a section here",
|
|
8718
8724
|
onClick: (e) => {
|
|
8719
8725
|
e.stopPropagation(), r();
|
|
8720
8726
|
},
|
|
8721
|
-
|
|
8722
|
-
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 ${t ? "opacity-70" : "opacity-0"} group-hover/zone:opacity-100 focus:opacity-100`,
|
|
8727
|
+
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`,
|
|
8723
8728
|
children: [/* @__PURE__ */ q(I, { className: "w-3 h-3 stroke-[2.6]" }), " Add section"]
|
|
8724
8729
|
})]
|
|
8725
8730
|
}), js = () => {
|