@llmnative/react 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -141
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/I18n.d.ts +2 -0
- package/dist/types/src/components/ui/fields/CodeEditor.d.ts +12 -0
- package/dist/types/src/components/ui/fields/Upload.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2537,7 +2537,9 @@ var bn = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10
|
|
|
2537
2537
|
outputFile: "Output file",
|
|
2538
2538
|
active: "active",
|
|
2539
2539
|
removeVariant: "Remove {scale} variant",
|
|
2540
|
-
fileName: "File name"
|
|
2540
|
+
fileName: "File name",
|
|
2541
|
+
altText: "Alt text",
|
|
2542
|
+
altTextPlaceholder: "Describe this image…"
|
|
2541
2543
|
},
|
|
2542
2544
|
imageEditor: {
|
|
2543
2545
|
title: "Image Editor",
|
|
@@ -7371,19 +7373,19 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7371
7373
|
let a = r ?? mc, o = Fn("crop"), s = m(null), c = m(null), u = () => {
|
|
7372
7374
|
let t = Object.keys(e.variants ?? {}).filter((e) => e in a);
|
|
7373
7375
|
return t.length ? t : Object.keys(a);
|
|
7374
|
-
}, p = vc(), [g, _] = h(u), [v, y] = h(() => u()[0] ?? Object.keys(a)[0]), [b, x] = h(e.fileName), [S, C] = h(e.
|
|
7376
|
+
}, p = vc(), [g, _] = h(u), [v, y] = h(() => u()[0] ?? Object.keys(a)[0]), [b, x] = h(e.fileName), [S, C] = h(e.alt ?? ""), [w, T] = h(e.variants ?? {}), [E, D] = h(null), [O, k] = h(!1), [A, j] = h(!1), M = m(w), N = m(E), P = m(v), F = m(g), I = m(b);
|
|
7375
7377
|
l(() => {
|
|
7376
|
-
|
|
7377
|
-
}, [S]), l(() => {
|
|
7378
|
-
j.current = w;
|
|
7378
|
+
M.current = w;
|
|
7379
7379
|
}, [w]), l(() => {
|
|
7380
|
-
|
|
7380
|
+
N.current = E;
|
|
7381
|
+
}, [E]), l(() => {
|
|
7382
|
+
P.current = v;
|
|
7381
7383
|
}, [v]), l(() => {
|
|
7382
|
-
|
|
7384
|
+
F.current = g;
|
|
7383
7385
|
}, [g]), l(() => {
|
|
7384
|
-
|
|
7386
|
+
I.current = b;
|
|
7385
7387
|
}, [b]), l(() => {
|
|
7386
|
-
|
|
7388
|
+
T((e) => {
|
|
7387
7389
|
let t = {};
|
|
7388
7390
|
for (let [n, r] of Object.entries(e)) t[n] = {
|
|
7389
7391
|
...r,
|
|
@@ -7392,17 +7394,17 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7392
7394
|
return t;
|
|
7393
7395
|
});
|
|
7394
7396
|
}, [b]);
|
|
7395
|
-
let
|
|
7397
|
+
let L = m(null), R = m(null);
|
|
7396
7398
|
l(() => {
|
|
7397
7399
|
let e = (e) => {
|
|
7398
|
-
let t =
|
|
7400
|
+
let t = L.current, n = R.current;
|
|
7399
7401
|
if (!t && !n) return;
|
|
7400
|
-
let r =
|
|
7402
|
+
let r = P.current, i = N.current, o = M.current[r];
|
|
7401
7403
|
if (!i || !o) return;
|
|
7402
7404
|
let s = a[r] ?? 1;
|
|
7403
7405
|
if (t) {
|
|
7404
7406
|
let n = Math.max(0, Math.min(e.clientX - t.offsetX, i.width - o.width)), a = Math.max(0, Math.min(e.clientY - t.offsetY, i.height - o.height));
|
|
7405
|
-
|
|
7407
|
+
T((e) => ({
|
|
7406
7408
|
...e,
|
|
7407
7409
|
[r]: {
|
|
7408
7410
|
...e[r],
|
|
@@ -7429,7 +7431,7 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7429
7431
|
let e = Math.min(v / g, y / _);
|
|
7430
7432
|
g *= e, _ *= e;
|
|
7431
7433
|
}
|
|
7432
|
-
g < hc && (g = hc, _ = g / s), _ < hc && (_ = hc, g = _ * s),
|
|
7434
|
+
g < hc && (g = hc, _ = g / s), _ < hc && (_ = hc, g = _ * s), T((e) => ({
|
|
7433
7435
|
...e,
|
|
7434
7436
|
[r]: {
|
|
7435
7437
|
...e[r],
|
|
@@ -7441,25 +7443,25 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7441
7443
|
}));
|
|
7442
7444
|
}
|
|
7443
7445
|
}, t = () => {
|
|
7444
|
-
|
|
7446
|
+
L.current = null, R.current = null, j(!1);
|
|
7445
7447
|
};
|
|
7446
7448
|
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
|
|
7447
7449
|
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
|
|
7448
7450
|
};
|
|
7449
7451
|
}, []), f(() => {
|
|
7450
|
-
if (!
|
|
7452
|
+
if (!O) return;
|
|
7451
7453
|
let t = c.current;
|
|
7452
7454
|
if (!t) return;
|
|
7453
7455
|
let { width: n, height: r } = t.getBoundingClientRect();
|
|
7454
|
-
if (!(!n || !r) && (
|
|
7456
|
+
if (!(!n || !r) && (D((e) => e && e.width === n && e.height === r ? e : {
|
|
7455
7457
|
width: n,
|
|
7456
7458
|
height: r
|
|
7457
|
-
}), !
|
|
7459
|
+
}), !M.current[v])) {
|
|
7458
7460
|
let t = a[v] ?? 1, i = Math.min(n * .78, r * t * .78), o = i / t;
|
|
7459
|
-
|
|
7461
|
+
T((t) => ({
|
|
7460
7462
|
...t,
|
|
7461
7463
|
[v]: {
|
|
7462
|
-
fileName: gc(
|
|
7464
|
+
fileName: gc(I.current, v),
|
|
7463
7465
|
type: e.type,
|
|
7464
7466
|
scale: v,
|
|
7465
7467
|
left: (n - i) / 2,
|
|
@@ -7470,15 +7472,16 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7470
7472
|
}
|
|
7471
7473
|
}));
|
|
7472
7474
|
}
|
|
7473
|
-
}, [v,
|
|
7475
|
+
}, [v, O]), d(i, () => ({ handleSave: () => {
|
|
7474
7476
|
let e = s.current, t = e?.getContext("2d"), n = c.current;
|
|
7475
7477
|
if (!e || !t || !n) return {
|
|
7476
|
-
fileName:
|
|
7478
|
+
fileName: I.current,
|
|
7479
|
+
alt: S,
|
|
7477
7480
|
variants: {}
|
|
7478
7481
|
};
|
|
7479
|
-
let r =
|
|
7480
|
-
for (let a of
|
|
7481
|
-
let o =
|
|
7482
|
+
let r = N.current, i = {};
|
|
7483
|
+
for (let a of F.current) {
|
|
7484
|
+
let o = M.current[a];
|
|
7482
7485
|
if (!o || !r) continue;
|
|
7483
7486
|
let s = n.naturalWidth / r.width, c = n.naturalHeight / r.height, { top: l, left: u, width: d, height: f } = o;
|
|
7484
7487
|
e.width = Math.round(d * s), e.height = Math.round(f * c), t.clearRect(0, 0, e.width, e.height), t.drawImage(n, u * s, l * c, d * s, f * c, 0, 0, e.width, e.height), i[a] = {
|
|
@@ -7487,30 +7490,31 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7487
7490
|
};
|
|
7488
7491
|
}
|
|
7489
7492
|
return {
|
|
7490
|
-
fileName:
|
|
7493
|
+
fileName: I.current,
|
|
7494
|
+
alt: S,
|
|
7491
7495
|
variants: i
|
|
7492
7496
|
};
|
|
7493
7497
|
} }));
|
|
7494
|
-
let
|
|
7498
|
+
let z = (e) => {
|
|
7495
7499
|
g.includes(e) || _((t) => [...t, e]), y(e);
|
|
7496
|
-
},
|
|
7500
|
+
}, B = (e, t) => {
|
|
7497
7501
|
t.stopPropagation();
|
|
7498
7502
|
let n = g.filter((t) => t !== e);
|
|
7499
7503
|
if (_(n), e === v) {
|
|
7500
7504
|
let t = n.filter((e) => e in a);
|
|
7501
7505
|
y(t[0] ?? Object.keys(a).find((t) => t !== e) ?? Object.keys(a)[0]);
|
|
7502
7506
|
}
|
|
7503
|
-
},
|
|
7507
|
+
}, V = (e) => {
|
|
7504
7508
|
e.preventDefault(), e.stopPropagation();
|
|
7505
|
-
let t =
|
|
7506
|
-
t && (
|
|
7509
|
+
let t = M.current[v];
|
|
7510
|
+
t && (L.current = {
|
|
7507
7511
|
offsetX: e.clientX - t.left,
|
|
7508
7512
|
offsetY: e.clientY - t.top
|
|
7509
|
-
},
|
|
7510
|
-
},
|
|
7513
|
+
}, j(!0));
|
|
7514
|
+
}, H = (e, t) => {
|
|
7511
7515
|
e.preventDefault(), e.stopPropagation();
|
|
7512
|
-
let n =
|
|
7513
|
-
n && (
|
|
7516
|
+
let n = M.current[v];
|
|
7517
|
+
n && (R.current = {
|
|
7514
7518
|
handle: t,
|
|
7515
7519
|
sx: e.clientX,
|
|
7516
7520
|
sy: e.clientY,
|
|
@@ -7518,12 +7522,12 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7518
7522
|
st: n.top,
|
|
7519
7523
|
sw: n.width,
|
|
7520
7524
|
sh: n.height
|
|
7521
|
-
},
|
|
7522
|
-
},
|
|
7525
|
+
}, j(!0));
|
|
7526
|
+
}, U = g.includes(v), W = w[v];
|
|
7523
7527
|
return /* @__PURE__ */ t.createElement("div", { className: ["flex gap-4 h-full min-h-0", n ? "flex-col" : ""].join(" ") }, n && /* @__PURE__ */ t.createElement("h3", { className: "text-base font-semibold shrink-0" }, n), /* @__PURE__ */ t.createElement("div", { className: "flex gap-4 flex-1 min-h-0" }, /* @__PURE__ */ t.createElement("div", {
|
|
7524
7528
|
className: "flex-1 min-w-0 min-h-0 flex items-center justify-center rounded-xl overflow-hidden",
|
|
7525
7529
|
style: {
|
|
7526
|
-
cursor:
|
|
7530
|
+
cursor: A ? "grabbing" : void 0,
|
|
7527
7531
|
...p ? {
|
|
7528
7532
|
backgroundColor: "#1a1a1a",
|
|
7529
7533
|
backgroundImage: "linear-gradient(45deg,#272727 25%,transparent 25%),linear-gradient(-45deg,#272727 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#272727 75%),linear-gradient(-45deg,transparent 75%,#272727 75%)"
|
|
@@ -7534,7 +7538,7 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7534
7538
|
backgroundSize: "20px 20px",
|
|
7535
7539
|
backgroundPosition: "0 0,0 10px,10px -10px,-10px 0"
|
|
7536
7540
|
}
|
|
7537
|
-
},
|
|
7541
|
+
}, U ? /* @__PURE__ */ t.createElement("div", {
|
|
7538
7542
|
className: "relative select-none",
|
|
7539
7543
|
style: {
|
|
7540
7544
|
display: "inline-block",
|
|
@@ -7550,11 +7554,11 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7550
7554
|
display: "block"
|
|
7551
7555
|
},
|
|
7552
7556
|
draggable: !1,
|
|
7553
|
-
onLoad: () =>
|
|
7554
|
-
}),
|
|
7555
|
-
crop:
|
|
7556
|
-
onMoveStart:
|
|
7557
|
-
onResizeStart:
|
|
7557
|
+
onLoad: () => k(!0)
|
|
7558
|
+
}), W && E && /* @__PURE__ */ t.createElement(wc, {
|
|
7559
|
+
crop: W,
|
|
7560
|
+
onMoveStart: V,
|
|
7561
|
+
onResizeStart: H
|
|
7558
7562
|
})) : /* @__PURE__ */ t.createElement("div", { className: "flex flex-col items-center gap-3 text-zinc-500 select-none" }, /* @__PURE__ */ t.createElement("svg", {
|
|
7559
7563
|
className: "w-10 h-10 opacity-30",
|
|
7560
7564
|
fill: "none",
|
|
@@ -7569,21 +7573,27 @@ var sc = a(null), cc = ({ registry: e, defaultKey: n, children: r }) => {
|
|
|
7569
7573
|
value: b,
|
|
7570
7574
|
onChange: x,
|
|
7571
7575
|
label: o.fileName
|
|
7576
|
+
})), /* @__PURE__ */ t.createElement("div", { className: "flex flex-col gap-1 shrink-0" }, /* @__PURE__ */ t.createElement("label", { className: "text-xs font-medium text-muted-foreground" }, o.altText), /* @__PURE__ */ t.createElement("textarea", {
|
|
7577
|
+
defaultValue: S,
|
|
7578
|
+
onBlur: (e) => C(e.target.value),
|
|
7579
|
+
placeholder: o.altTextPlaceholder,
|
|
7580
|
+
rows: 2,
|
|
7581
|
+
className: "w-full min-w-0 resize-none rounded-md border border-input bg-background px-2.5 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring"
|
|
7572
7582
|
})), /* @__PURE__ */ t.createElement("div", { className: "flex-1 min-h-0 flex flex-col gap-2 overflow-y-auto" }, /* @__PURE__ */ t.createElement("p", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide shrink-0" }, o.variants), Object.keys(a).map((n) => /* @__PURE__ */ t.createElement(Cc, {
|
|
7573
7583
|
key: n,
|
|
7574
7584
|
scale: n,
|
|
7575
7585
|
ratio: a[n],
|
|
7576
7586
|
img: e,
|
|
7577
|
-
crop:
|
|
7578
|
-
bounds:
|
|
7587
|
+
crop: w[n],
|
|
7588
|
+
bounds: E,
|
|
7579
7589
|
enabled: g.includes(n),
|
|
7580
7590
|
active: n === v,
|
|
7581
|
-
onClick: () =>
|
|
7582
|
-
onRemove: (e) =>
|
|
7583
|
-
}))),
|
|
7591
|
+
onClick: () => z(n),
|
|
7592
|
+
onRemove: (e) => B(n, e)
|
|
7593
|
+
}))), U && W && /* @__PURE__ */ t.createElement("div", { className: "shrink-0 pt-3 border-t border-border" }, /* @__PURE__ */ t.createElement("p", { className: "text-xs font-medium text-muted-foreground mb-1" }, o.outputFile), /* @__PURE__ */ t.createElement("p", {
|
|
7584
7594
|
className: "text-xs text-foreground/70 truncate tabular-nums",
|
|
7585
|
-
title:
|
|
7586
|
-
},
|
|
7595
|
+
title: W.fileName
|
|
7596
|
+
}, W.fileName ?? gc(b, v))))), /* @__PURE__ */ t.createElement("canvas", {
|
|
7587
7597
|
ref: s,
|
|
7588
7598
|
className: "hidden"
|
|
7589
7599
|
}));
|
|
@@ -9603,46 +9613,44 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9603
9613
|
}), e.focus();
|
|
9604
9614
|
}
|
|
9605
9615
|
} : null;
|
|
9606
|
-
}, Mu = ({ name: e, onChange: n = void 0, defaultValue: r = void 0, className: i = void 0, label: a, language: o = "html", placeholder: c, minHeight: d, maxHeight: f, required: p, disabled: g, feedback: _, labelClassName: v, validateSyntax: y = !0,
|
|
9607
|
-
let
|
|
9616
|
+
}, Mu = ({ name: e, onChange: n = void 0, defaultValue: r = void 0, className: i = void 0, label: a, language: o = "html", placeholder: c, minHeight: d, maxHeight: f, required: p, disabled: g, feedback: _, labelClassName: v, validateSyntax: y = !0, validate: b, validator: x, extensions: S, commands: C, commandsTrigger: w, wrapperClassName: T, inheritWrapperClassName: E = !0, before: D, after: O }) => {
|
|
9617
|
+
let k = u(), A = Y("CodeEditor"), j = ts({
|
|
9608
9618
|
minHeight: d,
|
|
9609
9619
|
maxHeight: f
|
|
9610
|
-
}), { value:
|
|
9620
|
+
}), { value: M, handleChange: N, formWrapClass: P } = Dd({
|
|
9611
9621
|
name: e,
|
|
9612
9622
|
onChange: n,
|
|
9613
9623
|
defaultValue: r,
|
|
9614
|
-
wrapperClassName:
|
|
9615
|
-
inheritWrapperClassName:
|
|
9616
|
-
}),
|
|
9624
|
+
wrapperClassName: T,
|
|
9625
|
+
inheritWrapperClassName: E
|
|
9626
|
+
}), F = Ed(e, {
|
|
9617
9627
|
required: p,
|
|
9618
9628
|
label: a,
|
|
9619
9629
|
validator: async (e) => {
|
|
9620
9630
|
let t = typeof e == "string" ? e : `${e ?? ""}`;
|
|
9621
|
-
if (y)
|
|
9622
|
-
await
|
|
9623
|
-
|
|
9624
|
-
if (e instanceof pu) return e.message;
|
|
9625
|
-
throw e;
|
|
9631
|
+
if (y) {
|
|
9632
|
+
let e = b ? await b(t) : await Cu(t, o);
|
|
9633
|
+
if (!e.valid) return e.error?.message ?? `Invalid ${o} code.`;
|
|
9626
9634
|
}
|
|
9627
|
-
return await
|
|
9635
|
+
return await x?.(e);
|
|
9628
9636
|
}
|
|
9629
|
-
}),
|
|
9637
|
+
}), I = m(null), L = m(null), R = m(null), [z, B] = h(!0), [V, H] = h({
|
|
9630
9638
|
open: !1,
|
|
9631
9639
|
query: "",
|
|
9632
9640
|
anchorPosition: null,
|
|
9633
9641
|
editorContext: null
|
|
9634
|
-
}),
|
|
9635
|
-
|
|
9636
|
-
let
|
|
9642
|
+
}), U = m(M ?? ""), W = m(V);
|
|
9643
|
+
W.current = V;
|
|
9644
|
+
let ee = C?.length ? w ?? "/" : void 0, G = (C?.length ?? 0) >= 10, te = t.useMemo(() => new Map((C ?? []).map((e) => [e.name, e])), [C]), ne = t.useMemo(() => (C ?? []).map((e) => ({
|
|
9637
9645
|
key: e.name,
|
|
9638
|
-
label: `${
|
|
9646
|
+
label: `${ee ?? "/"}${e.name}`,
|
|
9639
9647
|
value: e.name,
|
|
9640
9648
|
icon: e.icon,
|
|
9641
9649
|
description: e.description,
|
|
9642
9650
|
group: e.group
|
|
9643
|
-
})), [
|
|
9651
|
+
})), [C, ee]), re = t.useMemo(() => {
|
|
9644
9652
|
let e = [], n;
|
|
9645
|
-
return
|
|
9653
|
+
return ne.forEach((r) => {
|
|
9646
9654
|
r.group !== n && (n = r.group, r.group && e.push(/* @__PURE__ */ t.createElement(Bl.Heading, { key: `group:${r.group}` }, r.group))), e.push(/* @__PURE__ */ t.createElement(Bl.Item, {
|
|
9647
9655
|
key: r.key,
|
|
9648
9656
|
label: r.label,
|
|
@@ -9651,26 +9659,26 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9651
9659
|
description: r.description
|
|
9652
9660
|
}));
|
|
9653
9661
|
}), e;
|
|
9654
|
-
}, [
|
|
9662
|
+
}, [ne]);
|
|
9655
9663
|
l(() => {
|
|
9656
|
-
|
|
9657
|
-
}, [
|
|
9658
|
-
let
|
|
9659
|
-
|
|
9664
|
+
L.current || (U.current = M ?? "");
|
|
9665
|
+
}, [M]);
|
|
9666
|
+
let K = s((t) => {
|
|
9667
|
+
U.current = t, N({ target: {
|
|
9660
9668
|
name: e,
|
|
9661
9669
|
value: t
|
|
9662
9670
|
} });
|
|
9663
|
-
}, [
|
|
9664
|
-
|
|
9665
|
-
let
|
|
9666
|
-
|
|
9671
|
+
}, [N, e]), ie = m(K);
|
|
9672
|
+
ie.current = K;
|
|
9673
|
+
let ae = s(() => {
|
|
9674
|
+
H({
|
|
9667
9675
|
open: !1,
|
|
9668
9676
|
query: "",
|
|
9669
9677
|
anchorPosition: null,
|
|
9670
9678
|
editorContext: null
|
|
9671
9679
|
});
|
|
9672
|
-
}, []),
|
|
9673
|
-
let n =
|
|
9680
|
+
}, []), oe = s(async (e, t) => {
|
|
9681
|
+
let n = te.get(e.value);
|
|
9674
9682
|
if (n) {
|
|
9675
9683
|
if (n.handler) {
|
|
9676
9684
|
let e = await n.handler(Ll(t)), r = n.consumeSuffix ? Pl(t.textAfterCaret, n.consumeSuffix) : 0;
|
|
@@ -9679,11 +9687,11 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9679
9687
|
}
|
|
9680
9688
|
t.replace(t.triggerRange.start, t.triggerRange.end, `${t.trigger}${n.name} `);
|
|
9681
9689
|
}
|
|
9682
|
-
}, [
|
|
9690
|
+
}, [te]);
|
|
9683
9691
|
l(() => {
|
|
9684
9692
|
let e = !1, t = null;
|
|
9685
9693
|
return Ou(o).then((n) => {
|
|
9686
|
-
if (e || !
|
|
9694
|
+
if (e || !I.current) return;
|
|
9687
9695
|
let r = n.EditorView.theme({
|
|
9688
9696
|
"&": {
|
|
9689
9697
|
backgroundColor: "hsl(var(--rf-background))",
|
|
@@ -9729,23 +9737,23 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9729
9737
|
n.language,
|
|
9730
9738
|
r,
|
|
9731
9739
|
n.EditorView.updateListener.of((e) => {
|
|
9732
|
-
e.docChanged &&
|
|
9740
|
+
e.docChanged && ie.current(e.state.doc.toString());
|
|
9733
9741
|
}),
|
|
9734
|
-
...
|
|
9742
|
+
...S ?? []
|
|
9735
9743
|
];
|
|
9736
|
-
|
|
9744
|
+
ee && i.push(n.EditorView.updateListener.of((e) => {
|
|
9737
9745
|
let t = e.state.selection.main;
|
|
9738
9746
|
if (t.from !== t.to) {
|
|
9739
|
-
|
|
9747
|
+
W.current.open && ae();
|
|
9740
9748
|
return;
|
|
9741
9749
|
}
|
|
9742
|
-
let n = Au(e.state.doc.toString(), t.from,
|
|
9750
|
+
let n = Au(e.state.doc.toString(), t.from, ee);
|
|
9743
9751
|
if (!n) {
|
|
9744
|
-
|
|
9752
|
+
W.current.open && ae();
|
|
9745
9753
|
return;
|
|
9746
9754
|
}
|
|
9747
|
-
let r = e.view.coordsAtPos(t.from), i = ju(e.view,
|
|
9748
|
-
!r || !i ||
|
|
9755
|
+
let r = e.view.coordsAtPos(t.from), i = ju(e.view, ee);
|
|
9756
|
+
!r || !i || H({
|
|
9749
9757
|
open: !0,
|
|
9750
9758
|
query: n.query,
|
|
9751
9759
|
anchorPosition: {
|
|
@@ -9757,102 +9765,102 @@ var nu = ({ mode: e, availability: n, renderAIUnavailable: r }) => {
|
|
|
9757
9765
|
}), n.Prec.highest(n.keymap.of([
|
|
9758
9766
|
{
|
|
9759
9767
|
key: "ArrowDown",
|
|
9760
|
-
run: () =>
|
|
9768
|
+
run: () => W.current.open ? (R.current?.moveNext(), !0) : !1
|
|
9761
9769
|
},
|
|
9762
9770
|
{
|
|
9763
9771
|
key: "ArrowUp",
|
|
9764
|
-
run: () =>
|
|
9772
|
+
run: () => W.current.open ? (R.current?.movePrev(), !0) : !1
|
|
9765
9773
|
},
|
|
9766
9774
|
{
|
|
9767
9775
|
key: "Enter",
|
|
9768
|
-
run: () =>
|
|
9776
|
+
run: () => W.current.open ? (R.current?.selectActive(), !0) : !1
|
|
9769
9777
|
},
|
|
9770
9778
|
{
|
|
9771
9779
|
key: "Tab",
|
|
9772
|
-
run: () =>
|
|
9780
|
+
run: () => W.current.open ? (R.current?.selectActive(), !0) : !1
|
|
9773
9781
|
},
|
|
9774
9782
|
{
|
|
9775
9783
|
key: "Escape",
|
|
9776
|
-
run: () =>
|
|
9784
|
+
run: () => W.current.open ? (R.current?.close(), !0) : !1
|
|
9777
9785
|
}
|
|
9778
9786
|
])), n.EditorView.domEventHandlers({ keydown: (e) => {
|
|
9779
|
-
if (!
|
|
9787
|
+
if (!W.current.open) return !1;
|
|
9780
9788
|
switch (e.key) {
|
|
9781
|
-
case "ArrowDown": return e.preventDefault(),
|
|
9782
|
-
case "ArrowUp": return e.preventDefault(),
|
|
9789
|
+
case "ArrowDown": return e.preventDefault(), R.current?.moveNext(), !0;
|
|
9790
|
+
case "ArrowUp": return e.preventDefault(), R.current?.movePrev(), !0;
|
|
9783
9791
|
case "Enter":
|
|
9784
|
-
case "Tab": return e.preventDefault(),
|
|
9785
|
-
case "Escape": return e.preventDefault(),
|
|
9792
|
+
case "Tab": return e.preventDefault(), R.current?.selectActive(), !0;
|
|
9793
|
+
case "Escape": return e.preventDefault(), R.current?.close(), !0;
|
|
9786
9794
|
default: return !1;
|
|
9787
9795
|
}
|
|
9788
9796
|
} })), g && i.push(n.EditorView.editable.of(!1));
|
|
9789
9797
|
let a = n.EditorState.create({
|
|
9790
|
-
doc:
|
|
9798
|
+
doc: U.current,
|
|
9791
9799
|
extensions: i
|
|
9792
9800
|
});
|
|
9793
9801
|
t = new n.EditorView({
|
|
9794
9802
|
state: a,
|
|
9795
|
-
parent:
|
|
9796
|
-
}), ku(t.scrollDOM,
|
|
9803
|
+
parent: I.current
|
|
9804
|
+
}), ku(t.scrollDOM, j), L.current = t, B(!1);
|
|
9797
9805
|
}).catch((t) => {
|
|
9798
|
-
e || (console.error("[CodeEditor] Failed to load CodeMirror:", t),
|
|
9806
|
+
e || (console.error("[CodeEditor] Failed to load CodeMirror:", t), B(!1));
|
|
9799
9807
|
}), () => {
|
|
9800
|
-
e = !0, t && (t.destroy(),
|
|
9808
|
+
e = !0, t && (t.destroy(), L.current = null);
|
|
9801
9809
|
};
|
|
9802
9810
|
}, [
|
|
9803
|
-
|
|
9804
|
-
|
|
9811
|
+
ae,
|
|
9812
|
+
S,
|
|
9805
9813
|
g,
|
|
9806
9814
|
o,
|
|
9807
9815
|
c,
|
|
9808
|
-
|
|
9816
|
+
ee
|
|
9809
9817
|
]), l(() => {
|
|
9810
|
-
let e =
|
|
9811
|
-
t && e !==
|
|
9818
|
+
let e = M ?? "", t = L.current;
|
|
9819
|
+
t && e !== U.current && (U.current = e, t.dispatch({ changes: {
|
|
9812
9820
|
from: 0,
|
|
9813
9821
|
to: t.state.doc.length,
|
|
9814
9822
|
insert: e
|
|
9815
9823
|
} }));
|
|
9816
|
-
}, [
|
|
9817
|
-
let e =
|
|
9818
|
-
e && ku(e.scrollDOM,
|
|
9824
|
+
}, [M]), l(() => {
|
|
9825
|
+
let e = L.current;
|
|
9826
|
+
e && ku(e.scrollDOM, j);
|
|
9819
9827
|
}, [
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9828
|
+
j.fill,
|
|
9829
|
+
j.resolvedMinHeight,
|
|
9830
|
+
j.resolvedMaxHeight
|
|
9823
9831
|
]);
|
|
9824
|
-
let
|
|
9825
|
-
style: { minHeight:
|
|
9832
|
+
let se = X("w-full overflow-hidden border border-input", A.CodeEditor?.className, i, z && "flex items-center justify-center bg-muted text-muted-foreground text-sm", F && "border-destructive", D ? "rounded-l-none" : "rounded-l-md", O ? "rounded-r-none" : "rounded-r-md"), ce = /* @__PURE__ */ t.createElement("div", { className: X("min-w-0 flex-1", j.fill && "h-full flex flex-col", se) }, z && /* @__PURE__ */ t.createElement("div", {
|
|
9833
|
+
style: { minHeight: j.fill ? void 0 : j.resolvedMinHeight },
|
|
9826
9834
|
className: "flex items-center justify-center"
|
|
9827
9835
|
}, /* @__PURE__ */ t.createElement(Q, {
|
|
9828
9836
|
name: "loader-circle",
|
|
9829
9837
|
size: 16,
|
|
9830
9838
|
className: "animate-spin text-muted-foreground"
|
|
9831
9839
|
})), /* @__PURE__ */ t.createElement("div", {
|
|
9832
|
-
ref:
|
|
9833
|
-
className: X(
|
|
9840
|
+
ref: I,
|
|
9841
|
+
className: X(z && "hidden", j.fill && "h-full min-h-0 flex-1")
|
|
9834
9842
|
}));
|
|
9835
|
-
return /* @__PURE__ */ t.createElement(Z, { className: X(
|
|
9843
|
+
return /* @__PURE__ */ t.createElement(Z, { className: X(P, j.fill && "h-full flex flex-col min-h-0", A.CodeEditor?.wrapperClassName) }, a && /* @__PURE__ */ t.createElement(Ns, {
|
|
9836
9844
|
label: a,
|
|
9837
9845
|
required: p,
|
|
9838
|
-
htmlFor:
|
|
9846
|
+
htmlFor: k,
|
|
9839
9847
|
className: v
|
|
9840
|
-
}), /* @__PURE__ */ t.createElement("div", { className: X(
|
|
9841
|
-
ref:
|
|
9842
|
-
className: X(
|
|
9843
|
-
trigger:
|
|
9844
|
-
searchable:
|
|
9845
|
-
controlled:
|
|
9846
|
-
open:
|
|
9847
|
-
anchorPosition:
|
|
9848
|
-
query:
|
|
9849
|
-
editorContext:
|
|
9850
|
-
onClose:
|
|
9848
|
+
}), /* @__PURE__ */ t.createElement("div", { className: X(D || O ? os : "", j.fill && "flex-1 min-h-0 flex flex-col") }, D && /* @__PURE__ */ t.createElement("span", { className: X("inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground", "rounded-l-md rounded-r-none border-r-0") }, D), ee && ne.length > 0 ? /* @__PURE__ */ t.createElement(Bl, {
|
|
9849
|
+
ref: R,
|
|
9850
|
+
className: X(j.fill && "flex-1 min-h-0 flex flex-col"),
|
|
9851
|
+
trigger: ee,
|
|
9852
|
+
searchable: G,
|
|
9853
|
+
controlled: V.editorContext ? {
|
|
9854
|
+
open: V.open,
|
|
9855
|
+
anchorPosition: V.anchorPosition,
|
|
9856
|
+
query: V.query,
|
|
9857
|
+
editorContext: V.editorContext,
|
|
9858
|
+
onClose: ae
|
|
9851
9859
|
} : void 0,
|
|
9852
9860
|
onSelect: (e, t) => {
|
|
9853
|
-
|
|
9861
|
+
oe(e, t);
|
|
9854
9862
|
}
|
|
9855
|
-
},
|
|
9863
|
+
}, re, ce) : ce, O && /* @__PURE__ */ t.createElement("span", { className: X("inline-flex shrink-0 items-center border border-input bg-muted px-3 py-1 text-sm text-muted-foreground", "rounded-l-none rounded-r-md border-l-0") }, O)), F && /* @__PURE__ */ t.createElement(hs, { message: F }), _ && /* @__PURE__ */ t.createElement("p", { className: "mt-1 text-xs text-muted-foreground" }, _));
|
|
9856
9864
|
}, Nu = () => Promise.all([
|
|
9857
9865
|
import("@tiptap/react"),
|
|
9858
9866
|
import("@tiptap/react/menus"),
|
|
@@ -17494,7 +17502,9 @@ var Hh = (e) => {
|
|
|
17494
17502
|
outputFile: "File di output",
|
|
17495
17503
|
active: "Attivo",
|
|
17496
17504
|
removeVariant: "Rimuovi variante {scale}",
|
|
17497
|
-
fileName: "Nome file"
|
|
17505
|
+
fileName: "Nome file",
|
|
17506
|
+
altText: "Testo alternativo",
|
|
17507
|
+
altTextPlaceholder: "Descrivi questa immagine…"
|
|
17498
17508
|
},
|
|
17499
17509
|
imageEditor: {
|
|
17500
17510
|
title: "Editor immagine",
|
|
@@ -17661,7 +17671,9 @@ var Hh = (e) => {
|
|
|
17661
17671
|
outputFile: "Ausgabedatei",
|
|
17662
17672
|
active: "Aktiv",
|
|
17663
17673
|
removeVariant: "Variante {scale} entfernen",
|
|
17664
|
-
fileName: "Dateiname"
|
|
17674
|
+
fileName: "Dateiname",
|
|
17675
|
+
altText: "Alt-Text",
|
|
17676
|
+
altTextPlaceholder: "Beschreiben Sie dieses Bild…"
|
|
17665
17677
|
},
|
|
17666
17678
|
imageEditor: {
|
|
17667
17679
|
title: "Bildeditor",
|
|
@@ -17828,7 +17840,9 @@ var Hh = (e) => {
|
|
|
17828
17840
|
outputFile: "Выходной файл",
|
|
17829
17841
|
active: "Активно",
|
|
17830
17842
|
removeVariant: "Удалить вариант {scale}",
|
|
17831
|
-
fileName: "Имя файла"
|
|
17843
|
+
fileName: "Имя файла",
|
|
17844
|
+
altText: "Альтернативный текст",
|
|
17845
|
+
altTextPlaceholder: "Опишите это изображение…"
|
|
17832
17846
|
},
|
|
17833
17847
|
imageEditor: {
|
|
17834
17848
|
title: "Редактор изображений",
|
|
@@ -17995,7 +18009,9 @@ var Hh = (e) => {
|
|
|
17995
18009
|
outputFile: "输出文件",
|
|
17996
18010
|
active: "活跃",
|
|
17997
18011
|
removeVariant: "删除变体{scale}",
|
|
17998
|
-
fileName: "文件名"
|
|
18012
|
+
fileName: "文件名",
|
|
18013
|
+
altText: "替代文本",
|
|
18014
|
+
altTextPlaceholder: "描述此图片…"
|
|
17999
18015
|
},
|
|
18000
18016
|
imageEditor: {
|
|
18001
18017
|
title: "图片编辑器",
|
|
@@ -18162,7 +18178,9 @@ var Hh = (e) => {
|
|
|
18162
18178
|
outputFile: "ملف الإخراج",
|
|
18163
18179
|
active: "نشط",
|
|
18164
18180
|
removeVariant: "إزالة المتغير {scale}",
|
|
18165
|
-
fileName: "اسم الملف"
|
|
18181
|
+
fileName: "اسم الملف",
|
|
18182
|
+
altText: "النص البديل",
|
|
18183
|
+
altTextPlaceholder: "صف هذه الصورة…"
|
|
18166
18184
|
},
|
|
18167
18185
|
imageEditor: {
|
|
18168
18186
|
title: "محرر الصور",
|