eddyter 1.3.61 → 1.3.62
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/babel-B9hn44Wo.js +7168 -0
- package/dist/estree-CocPn_Md.js +4251 -0
- package/dist/html-CxCicOef.js +2638 -0
- package/dist/{html2pdf.bundle-BP8K5ERw.js → html2pdf.bundle-DNyY_rJA.js} +1 -1
- package/dist/{html2pdf.bundle.min-BrDn1HSi.js → html2pdf.bundle.min-GfQzEXnM.js} +1 -1
- package/dist/{index-CnBHpreC.js → index-BoOSmKss.js} +1 -1
- package/dist/{index-CFq39nnT.js → index-CIBuU2Zv.js} +370 -373
- package/dist/{index-DnHnFalw.js → index-YHNm3bIK.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/markdown-BUjgWFLu.js +3150 -0
- package/dist/postcss-CGIcwj_g.js +4717 -0
- package/dist/standalone-C0qguT38.js +2211 -0
- package/dist/typescript-BM7wk6k-.js +12922 -0
- package/package.json +1 -1
- package/dist/babel-19rkKi7e.js +0 -7157
- package/dist/estree-DmlwiAu4.js +0 -4453
- package/dist/html-DtcgJGeD.js +0 -2760
- package/dist/markdown-C2JcxpgA.js +0 -3163
- package/dist/postcss-Banlrd6S.js +0 -4703
- package/dist/standalone-JqHlnZSs.js +0 -2429
- package/dist/typescript-D_phonMq.js +0 -12929
|
@@ -85,7 +85,7 @@ const cm = Aa(
|
|
|
85
85
|
throw new Error("Failed to verify API key");
|
|
86
86
|
}
|
|
87
87
|
}, mx = zf.create({
|
|
88
|
-
baseURL: "https://api.cteditor.com
|
|
88
|
+
baseURL: "https://api.cteditor.com",
|
|
89
89
|
headers: {
|
|
90
90
|
"Content-Type": "application/json"
|
|
91
91
|
}
|
|
@@ -605,11 +605,11 @@ const wx = (t) => ({
|
|
|
605
605
|
if (!(a || d)) {
|
|
606
606
|
console.log("verifyKey"), l(!0), u(null);
|
|
607
607
|
try {
|
|
608
|
-
const
|
|
609
|
-
console.log(
|
|
610
|
-
} catch (
|
|
611
|
-
console.log(
|
|
612
|
-
const z =
|
|
608
|
+
const D = await fx(M);
|
|
609
|
+
console.log(D, "response form verifyKey"), D.success ? (c(!0), f(wx(D.data)), b(D.data.name), v(D.data.paidPlan), _(M)) : (console.log(D.message, "response.message form verifyKey"), u(D.message));
|
|
610
|
+
} catch (D) {
|
|
611
|
+
console.log(D, "error form verifyKey");
|
|
612
|
+
const z = D.response?.data?.message || D.message || "Failed to verify API key";
|
|
613
613
|
u(z);
|
|
614
614
|
} finally {
|
|
615
615
|
l(!1);
|
|
@@ -1108,7 +1108,7 @@ function qx(t) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
const Gx = (t) => {
|
|
1110
1110
|
var e, r, o, n, s, a, c, d, l;
|
|
1111
|
-
const { invert: h, toast: u, unstyled: p, interacting: f, setHeights: m, visibleToasts: b, heights: g, index: v, toasts: x, expanded: _, removeToast: S, defaultRichColors: k, closeButton: w, style: N, cancelButtonStyle: E, actionButtonStyle: M, className:
|
|
1111
|
+
const { invert: h, toast: u, unstyled: p, interacting: f, setHeights: m, visibleToasts: b, heights: g, index: v, toasts: x, expanded: _, removeToast: S, defaultRichColors: k, closeButton: w, style: N, cancelButtonStyle: E, actionButtonStyle: M, className: D = "", descriptionClassName: z = "", duration: $, position: F, gap: I, expandByDefault: U, classNames: H, icons: j, closeButtonAriaLabel: W = "Close toast" } = t, [A, re] = ce.useState(null), [le, he] = ce.useState(null), [oe, se] = ce.useState(!1), [B, L] = ce.useState(!1), [R, O] = ce.useState(!1), [J, Q] = ce.useState(!1), [Y, de] = ce.useState(!1), [Me, Ne] = ce.useState(0), [xe, be] = ce.useState(0), we = ce.useRef(u.duration || $ || wh), K = ce.useRef(null), P = ce.useRef(null), G = v === 0, ie = v + 1 <= b, Z = u.type, X = u.dismissible !== !1, ee = u.className || "", te = u.descriptionClassName || "", ye = ce.useMemo(() => g.findIndex((Oe) => Oe.toastId === u.id) || 0, [
|
|
1112
1112
|
g,
|
|
1113
1113
|
u.id
|
|
1114
1114
|
]), Se = ce.useMemo(() => {
|
|
@@ -1229,7 +1229,7 @@ const Gx = (t) => {
|
|
|
1229
1229
|
return /* @__PURE__ */ ce.createElement("li", {
|
|
1230
1230
|
tabIndex: 0,
|
|
1231
1231
|
ref: P,
|
|
1232
|
-
className: jr(
|
|
1232
|
+
className: jr(D, ee, H?.toast, u == null || (e = u.classNames) == null ? void 0 : e.toast, H?.default, H?.[Z], u == null || (r = u.classNames) == null ? void 0 : r[Z]),
|
|
1233
1233
|
"data-sonner-toast": "",
|
|
1234
1234
|
"data-rich-colors": (_r = u.richColors) != null ? _r : k,
|
|
1235
1235
|
"data-styled": !(u.jsx || u.unstyled || p),
|
|
@@ -1260,10 +1260,10 @@ const Gx = (t) => {
|
|
|
1260
1260
|
...u.style
|
|
1261
1261
|
},
|
|
1262
1262
|
onDragEnd: () => {
|
|
1263
|
-
|
|
1263
|
+
O(!1), re(null), yt.current = null;
|
|
1264
1264
|
},
|
|
1265
1265
|
onPointerDown: (Oe) => {
|
|
1266
|
-
Oe.button !== 2 && (Bt || !X || (K.current = /* @__PURE__ */ new Date(), Ne(Xe.current), Oe.target.setPointerCapture(Oe.pointerId), Oe.target.tagName !== "BUTTON" && (
|
|
1266
|
+
Oe.button !== 2 && (Bt || !X || (K.current = /* @__PURE__ */ new Date(), Ne(Xe.current), Oe.target.setPointerCapture(Oe.pointerId), Oe.target.tagName !== "BUTTON" && (O(!0), yt.current = {
|
|
1267
1267
|
x: Oe.clientX,
|
|
1268
1268
|
y: Oe.clientY
|
|
1269
1269
|
})));
|
|
@@ -1280,7 +1280,7 @@ const Gx = (t) => {
|
|
|
1280
1280
|
var Tt, Qt;
|
|
1281
1281
|
(Tt = P.current) == null || Tt.style.setProperty("--swipe-amount-x", "0px"), (Qt = P.current) == null || Qt.style.setProperty("--swipe-amount-y", "0px");
|
|
1282
1282
|
}
|
|
1283
|
-
de(!1),
|
|
1283
|
+
de(!1), O(!1), re(null);
|
|
1284
1284
|
},
|
|
1285
1285
|
onPointerMove: (Oe) => {
|
|
1286
1286
|
var Be, St, Dt;
|
|
@@ -1394,7 +1394,7 @@ const Zx = /* @__PURE__ */ ce.forwardRef(function(e, r) {
|
|
|
1394
1394
|
].concat(E.filter((oe) => oe.position).map((oe) => oe.position)))), [
|
|
1395
1395
|
E,
|
|
1396
1396
|
s
|
|
1397
|
-
]), [
|
|
1397
|
+
]), [D, z] = ce.useState([]), [$, F] = ce.useState(!1), [I, U] = ce.useState(!1), [H, j] = ce.useState(p !== "system" ? p : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), W = ce.useRef(null), A = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), re = ce.useRef(null), le = ce.useRef(!1), he = ce.useCallback((oe) => {
|
|
1398
1398
|
N((se) => {
|
|
1399
1399
|
var B;
|
|
1400
1400
|
return (B = se.find((L) => L.id === oe.id)) != null && B.delete || er.dismiss(oe.id), se.filter(({ id: L }) => L !== oe.id);
|
|
@@ -1459,7 +1459,7 @@ const Zx = /* @__PURE__ */ ce.forwardRef(function(e, r) {
|
|
|
1459
1459
|
]), ce.useEffect(() => {
|
|
1460
1460
|
const oe = (se) => {
|
|
1461
1461
|
var B;
|
|
1462
|
-
if (a.every((
|
|
1462
|
+
if (a.every((O) => se[O] || se.code === O)) {
|
|
1463
1463
|
var R;
|
|
1464
1464
|
F(!0), (R = W.current) == null || R.focus();
|
|
1465
1465
|
}
|
|
@@ -1500,19 +1500,19 @@ const Zx = /* @__PURE__ */ ce.forwardRef(function(e, r) {
|
|
|
1500
1500
|
"data-y-position": L,
|
|
1501
1501
|
"data-x-position": R,
|
|
1502
1502
|
style: {
|
|
1503
|
-
"--front-toast-height": `${((B =
|
|
1503
|
+
"--front-toast-height": `${((B = D[0]) == null ? void 0 : B.height) || 0}px`,
|
|
1504
1504
|
"--width": `${jx}px`,
|
|
1505
1505
|
"--gap": `${_}px`,
|
|
1506
1506
|
...b,
|
|
1507
1507
|
...Kx(h, u)
|
|
1508
1508
|
},
|
|
1509
|
-
onBlur: (
|
|
1510
|
-
le.current && !
|
|
1509
|
+
onBlur: (O) => {
|
|
1510
|
+
le.current && !O.currentTarget.contains(O.relatedTarget) && (le.current = !1, re.current && (re.current.focus({
|
|
1511
1511
|
preventScroll: !0
|
|
1512
1512
|
}), re.current = null));
|
|
1513
1513
|
},
|
|
1514
|
-
onFocus: (
|
|
1515
|
-
|
|
1514
|
+
onFocus: (O) => {
|
|
1515
|
+
O.target instanceof HTMLElement && O.target.dataset.dismissible === "false" || le.current || (le.current = !0, re.current = O.relatedTarget);
|
|
1516
1516
|
},
|
|
1517
1517
|
onMouseEnter: () => F(!0),
|
|
1518
1518
|
onMouseMove: () => F(!0),
|
|
@@ -1520,17 +1520,17 @@ const Zx = /* @__PURE__ */ ce.forwardRef(function(e, r) {
|
|
|
1520
1520
|
I || F(!1);
|
|
1521
1521
|
},
|
|
1522
1522
|
onDragEnd: () => F(!1),
|
|
1523
|
-
onPointerDown: (
|
|
1524
|
-
|
|
1523
|
+
onPointerDown: (O) => {
|
|
1524
|
+
O.target instanceof HTMLElement && O.target.dataset.dismissible === "false" || U(!0);
|
|
1525
1525
|
},
|
|
1526
1526
|
onPointerUp: () => U(!1)
|
|
1527
|
-
}, E.filter((
|
|
1527
|
+
}, E.filter((O) => !O.position && se === 0 || O.position === oe).map((O, J) => {
|
|
1528
1528
|
var Q, Y;
|
|
1529
1529
|
return /* @__PURE__ */ ce.createElement(Gx, {
|
|
1530
|
-
key:
|
|
1530
|
+
key: O.id,
|
|
1531
1531
|
icons: S,
|
|
1532
1532
|
index: J,
|
|
1533
|
-
toast:
|
|
1533
|
+
toast: O,
|
|
1534
1534
|
defaultRichColors: f,
|
|
1535
1535
|
duration: (Q = v?.duration) != null ? Q : m,
|
|
1536
1536
|
className: v?.className,
|
|
@@ -1547,8 +1547,8 @@ const Zx = /* @__PURE__ */ ce.forwardRef(function(e, r) {
|
|
|
1547
1547
|
actionButtonStyle: v?.actionButtonStyle,
|
|
1548
1548
|
closeButtonAriaLabel: v?.closeButtonAriaLabel,
|
|
1549
1549
|
removeToast: he,
|
|
1550
|
-
toasts: E.filter((de) => de.position ==
|
|
1551
|
-
heights:
|
|
1550
|
+
toasts: E.filter((de) => de.position == O.position),
|
|
1551
|
+
heights: D.filter((de) => de.position == O.position),
|
|
1552
1552
|
setHeights: z,
|
|
1553
1553
|
expandByDefault: c,
|
|
1554
1554
|
gap: _,
|
|
@@ -1628,7 +1628,7 @@ const Xx = async ({ content: t, apiKey: e, userTextLength: r }) => {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
}, Nt = Rt(
|
|
1630
1630
|
"AI_ACTION_COMMAND"
|
|
1631
|
-
), ew = ce.lazy(() => import("./index-
|
|
1631
|
+
), ew = ce.lazy(() => import("./index-BoOSmKss.js"));
|
|
1632
1632
|
function tw(t) {
|
|
1633
1633
|
return t.parentElement != null && t.parentElement.tagName === "LI" && t.previousSibling === null && t.getAttribute("aria-roledescription") === "checkbox";
|
|
1634
1634
|
}
|
|
@@ -2329,7 +2329,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
2329
2329
|
"bottom-left",
|
|
2330
2330
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
2331
2331
|
"left-bottom"
|
|
2332
|
-
], k = () => [...S(), Re, Te], w = () => ["auto", "hidden", "clip", "visible", "scroll"], N = () => ["auto", "contain", "none"], E = () => [Re, Te, d], M = () => [hn, "full", "auto", ...E()],
|
|
2332
|
+
], k = () => [...S(), Re, Te], w = () => ["auto", "hidden", "clip", "visible", "scroll"], N = () => ["auto", "contain", "none"], E = () => [Re, Te, d], M = () => [hn, "full", "auto", ...E()], D = () => [bo, "none", "subgrid", Re, Te], z = () => ["auto", {
|
|
2333
2333
|
span: ["full", bo, Re, Te]
|
|
2334
2334
|
}, bo, Re, Te], $ = () => [bo, "auto", Re, Te], F = () => ["auto", "min", "max", "fr", Re, Te], I = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], U = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], H = () => ["auto", ...E()], j = () => [hn, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...E()], W = () => [t, Re, Te], A = () => [...S(), Ih, Rh, {
|
|
2335
2335
|
position: [Re, Te]
|
|
@@ -2345,7 +2345,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
2345
2345
|
l,
|
|
2346
2346
|
Re,
|
|
2347
2347
|
Te
|
|
2348
|
-
], se = () => ["", Ge, ni, Bo], B = () => ["solid", "dashed", "dotted", "double"], L = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], R = () => [Ge, zc, Ih, Rh],
|
|
2348
|
+
], se = () => ["", Ge, ni, Bo], B = () => ["solid", "dashed", "dotted", "double"], L = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], R = () => [Ge, zc, Ih, Rh], O = () => [
|
|
2349
2349
|
// Deprecated since Tailwind CSS v4.0.0
|
|
2350
2350
|
"",
|
|
2351
2351
|
"none",
|
|
@@ -2657,7 +2657,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
2657
2657
|
* @see https://tailwindcss.com/docs/grid-template-columns
|
|
2658
2658
|
*/
|
|
2659
2659
|
"grid-cols": [{
|
|
2660
|
-
"grid-cols":
|
|
2660
|
+
"grid-cols": D()
|
|
2661
2661
|
}],
|
|
2662
2662
|
/**
|
|
2663
2663
|
* Grid Column Start / End
|
|
@@ -2685,7 +2685,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
2685
2685
|
* @see https://tailwindcss.com/docs/grid-template-rows
|
|
2686
2686
|
*/
|
|
2687
2687
|
"grid-rows": [{
|
|
2688
|
-
"grid-rows":
|
|
2688
|
+
"grid-rows": D()
|
|
2689
2689
|
}],
|
|
2690
2690
|
/**
|
|
2691
2691
|
* Grid Row Start / End
|
|
@@ -4032,7 +4032,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
4032
4032
|
* @see https://tailwindcss.com/docs/blur
|
|
4033
4033
|
*/
|
|
4034
4034
|
blur: [{
|
|
4035
|
-
blur:
|
|
4035
|
+
blur: O()
|
|
4036
4036
|
}],
|
|
4037
4037
|
/**
|
|
4038
4038
|
* Brightness
|
|
@@ -4122,7 +4122,7 @@ const _h = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, Sh = mm, W
|
|
|
4122
4122
|
* @see https://tailwindcss.com/docs/backdrop-blur
|
|
4123
4123
|
*/
|
|
4124
4124
|
"backdrop-blur": [{
|
|
4125
|
-
"backdrop-blur":
|
|
4125
|
+
"backdrop-blur": O()
|
|
4126
4126
|
}],
|
|
4127
4127
|
/**
|
|
4128
4128
|
* Backdrop Brightness
|
|
@@ -5052,11 +5052,11 @@ var g2 = "DismissableLayer", Ol = "dismissableLayer.update", y2 = "dismissableLa
|
|
|
5052
5052
|
onDismiss: c,
|
|
5053
5053
|
...d
|
|
5054
5054
|
} = t, l = C.useContext(Im), [h, u] = C.useState(null), p = h?.ownerDocument ?? globalThis?.document, [, f] = C.useState({}), m = at(e, (N) => u(N)), b = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), v = b.indexOf(g), x = h ? b.indexOf(h) : -1, _ = l.layersWithOutsidePointerEventsDisabled.size > 0, S = x >= v, k = w2((N) => {
|
|
5055
|
-
const E = N.target, M = [...l.branches].some((
|
|
5055
|
+
const E = N.target, M = [...l.branches].some((D) => D.contains(E));
|
|
5056
5056
|
!S || M || (n?.(N), a?.(N), N.defaultPrevented || c?.());
|
|
5057
5057
|
}, p), w = C2((N) => {
|
|
5058
5058
|
const E = N.target;
|
|
5059
|
-
[...l.branches].some((
|
|
5059
|
+
[...l.branches].some((D) => D.contains(E)) || (s?.(N), a?.(N), N.defaultPrevented || c?.());
|
|
5060
5060
|
}, p);
|
|
5061
5061
|
return m2((N) => {
|
|
5062
5062
|
x === l.layers.size - 1 && (o?.(N), !N.defaultPrevented && c && (N.preventDefault(), c()));
|
|
@@ -5768,18 +5768,15 @@ function pC(t) {
|
|
|
5768
5768
|
var v = ks(b), x = r.current, _ = "deltaX" in b ? b.deltaX : x[0] - v[0], S = "deltaY" in b ? b.deltaY : x[1] - v[1], k, w = b.target, N = Math.abs(_) > Math.abs(S) ? "h" : "v";
|
|
5769
5769
|
if ("touches" in b && N === "h" && w.type === "range")
|
|
5770
5770
|
return !1;
|
|
5771
|
-
var E =
|
|
5772
|
-
if (
|
|
5773
|
-
return !1;
|
|
5774
|
-
var z = Hh(N, w);
|
|
5775
|
-
if (!z)
|
|
5771
|
+
var E = Hh(N, w);
|
|
5772
|
+
if (!E)
|
|
5776
5773
|
return !0;
|
|
5777
|
-
if (
|
|
5774
|
+
if (E ? k = N : (k = N === "v" ? "h" : "v", E = Hh(N, w)), !E)
|
|
5778
5775
|
return !1;
|
|
5779
5776
|
if (!o.current && "changedTouches" in b && (_ || S) && (o.current = k), !k)
|
|
5780
5777
|
return !0;
|
|
5781
|
-
var
|
|
5782
|
-
return lC(
|
|
5778
|
+
var M = o.current || k;
|
|
5779
|
+
return lC(M, g, b, M === "h" ? _ : S);
|
|
5783
5780
|
}, []), d = C.useCallback(function(b) {
|
|
5784
5781
|
var g = b;
|
|
5785
5782
|
if (!(!fn.length || fn[fn.length - 1] !== s)) {
|
|
@@ -8203,7 +8200,7 @@ async function Rg(t) {
|
|
|
8203
8200
|
api_key: n
|
|
8204
8201
|
};
|
|
8205
8202
|
c && (x.secondary_prompt = c);
|
|
8206
|
-
const S = await fetch("
|
|
8203
|
+
const S = await fetch("https://agent-api-dev.cteditor.com/agent/stream", {
|
|
8207
8204
|
method: "POST",
|
|
8208
8205
|
headers: {
|
|
8209
8206
|
"Content-Type": "application/json"
|
|
@@ -8246,8 +8243,8 @@ async function Rg(t) {
|
|
|
8246
8243
|
}
|
|
8247
8244
|
const N = await st.parse(m);
|
|
8248
8245
|
e.update(() => {
|
|
8249
|
-
const M = new DOMParser().parseFromString(N, "text/html"),
|
|
8250
|
-
z.clear(), z.append(...
|
|
8246
|
+
const M = new DOMParser().parseFromString(N, "text/html"), D = Eo(e, M), z = lt();
|
|
8247
|
+
z.clear(), z.append(...D);
|
|
8251
8248
|
}), u?.(), d?.("success"), l?.(!1), f?.(), e.focus();
|
|
8252
8249
|
} catch (x) {
|
|
8253
8250
|
console.error("AI request error:", x);
|
|
@@ -8324,7 +8321,7 @@ const Pi = Rt(
|
|
|
8324
8321
|
savedSelection: E,
|
|
8325
8322
|
onLoadingChange: (M) => {
|
|
8326
8323
|
if (M) {
|
|
8327
|
-
const
|
|
8324
|
+
const D = {
|
|
8328
8325
|
SPELLING_GRAMMAR: "Checking grammar and spelling...",
|
|
8329
8326
|
SIMPLIFY: "Simplifying your text...",
|
|
8330
8327
|
COMPLETE_SENTENCE: "Completing your sentence...",
|
|
@@ -8335,7 +8332,7 @@ const Pi = Rt(
|
|
|
8335
8332
|
};
|
|
8336
8333
|
if (f.current) return;
|
|
8337
8334
|
f.current = ve.loading(
|
|
8338
|
-
|
|
8335
|
+
D[k] || "Processing...",
|
|
8339
8336
|
{
|
|
8340
8337
|
description: "This may take a few seconds. Please wait.",
|
|
8341
8338
|
duration: 1 / 0
|
|
@@ -8721,16 +8718,16 @@ function A4({ editor: t, getCodeDOMNode: e }) {
|
|
|
8721
8718
|
);
|
|
8722
8719
|
}
|
|
8723
8720
|
const O4 = {
|
|
8724
|
-
css: [() => import("./postcss-
|
|
8725
|
-
html: [() => import("./html-
|
|
8721
|
+
css: [() => import("./postcss-CGIcwj_g.js")],
|
|
8722
|
+
html: [() => import("./html-CxCicOef.js")],
|
|
8726
8723
|
js: [
|
|
8727
|
-
() => import("./babel-
|
|
8728
|
-
() => import("./estree-
|
|
8724
|
+
() => import("./babel-B9hn44Wo.js"),
|
|
8725
|
+
() => import("./estree-CocPn_Md.js")
|
|
8729
8726
|
],
|
|
8730
|
-
markdown: [() => import("./markdown-
|
|
8727
|
+
markdown: [() => import("./markdown-BUjgWFLu.js")],
|
|
8731
8728
|
typescript: [
|
|
8732
|
-
() => import("./typescript-
|
|
8733
|
-
() => import("./estree-
|
|
8729
|
+
() => import("./typescript-BM7wk6k-.js"),
|
|
8730
|
+
() => import("./estree-CocPn_Md.js")
|
|
8734
8731
|
]
|
|
8735
8732
|
};
|
|
8736
8733
|
async function np(t) {
|
|
@@ -8740,7 +8737,7 @@ async function np(t) {
|
|
|
8740
8737
|
);
|
|
8741
8738
|
}
|
|
8742
8739
|
async function D4() {
|
|
8743
|
-
const { format: t } = await import("./standalone-
|
|
8740
|
+
const { format: t } = await import("./standalone-C0qguT38.js");
|
|
8744
8741
|
return t;
|
|
8745
8742
|
}
|
|
8746
8743
|
const Ag = {
|
|
@@ -9742,8 +9739,8 @@ var z5 = C.forwardRef((t, e) => {
|
|
|
9742
9739
|
onFocus: ke(t.onFocus, (E) => {
|
|
9743
9740
|
const M = !k.current;
|
|
9744
9741
|
if (E.target === E.currentTarget && M && !v) {
|
|
9745
|
-
const
|
|
9746
|
-
if (E.currentTarget.dispatchEvent(
|
|
9742
|
+
const D = new CustomEvent(Jc, A5);
|
|
9743
|
+
if (E.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
9747
9744
|
const z = S().filter((H) => H.focusable), $ = z.find((H) => H.active), F = z.find((H) => H.id === b), U = [$, F, ...z].filter(
|
|
9748
9745
|
Boolean
|
|
9749
9746
|
).map((H) => H.ref.current);
|
|
@@ -10063,7 +10060,7 @@ const Z5 = ({
|
|
|
10063
10060
|
});
|
|
10064
10061
|
},
|
|
10065
10062
|
[o, c]
|
|
10066
|
-
),
|
|
10063
|
+
), D = V(
|
|
10067
10064
|
(j, W) => {
|
|
10068
10065
|
a(j, { text: W }), o.update(() => {
|
|
10069
10066
|
const A = lt();
|
|
@@ -10235,7 +10232,7 @@ const Z5 = ({
|
|
|
10235
10232
|
ge,
|
|
10236
10233
|
{
|
|
10237
10234
|
size: "sm",
|
|
10238
|
-
onClick: () =>
|
|
10235
|
+
onClick: () => D(j.id, k),
|
|
10239
10236
|
disabled: !k.trim(),
|
|
10240
10237
|
className: "cteditor-px-2",
|
|
10241
10238
|
children: "Save"
|
|
@@ -10703,7 +10700,7 @@ const l6 = (t) => ({
|
|
|
10703
10700
|
}, f = pu(n), m = hu(f), b = await a.getDimensions(l), g = f === "y", v = g ? "top" : "left", x = g ? "bottom" : "right", _ = g ? "clientHeight" : "clientWidth", S = s.reference[m] + s.reference[f] - p[f] - s.floating[m], k = p[f] - s.reference[f], w = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(l));
|
|
10704
10701
|
let N = w ? w[_] : 0;
|
|
10705
10702
|
(!N || !await (a.isElement == null ? void 0 : a.isElement(w))) && (N = c.floating[_] || s.floating[m]);
|
|
10706
|
-
const E = S / 2 - k / 2, M = N / 2 - b[m] / 2 - 1,
|
|
10703
|
+
const E = S / 2 - k / 2, M = N / 2 - b[m] / 2 - 1, D = Io(u[v], M), z = Io(u[x], M), $ = D, F = N - b[m] - z, I = N / 2 - b[m] / 2 + E, U = Vl($, I, F), H = !d.arrow && Xn(n) != null && I !== U && s.reference[m] / 2 - (I < $ ? D : z) - b[m] / 2 < 0, j = H ? I < $ ? I - $ : I - F : 0;
|
|
10707
10704
|
return {
|
|
10708
10705
|
[f]: p[f] + j,
|
|
10709
10706
|
data: {
|
|
@@ -10743,12 +10740,12 @@ const l6 = (t) => ({
|
|
|
10743
10740
|
const v = po(n), x = Yr(c), _ = po(c) === c, S = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), k = p || (_ || !b ? [ha(c)] : r6(c)), w = m !== "none";
|
|
10744
10741
|
!p && w && k.push(...s6(c, b, m, S));
|
|
10745
10742
|
const N = [c, ...k], E = await Di(e, g), M = [];
|
|
10746
|
-
let
|
|
10743
|
+
let D = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
10747
10744
|
if (h && M.push(E[v]), u) {
|
|
10748
10745
|
const I = t6(n, a, S);
|
|
10749
10746
|
M.push(E[I[0]], E[I[1]]);
|
|
10750
10747
|
}
|
|
10751
|
-
if (
|
|
10748
|
+
if (D = [...D, {
|
|
10752
10749
|
placement: n,
|
|
10753
10750
|
overflows: M
|
|
10754
10751
|
}], !M.every((I) => I <= 0)) {
|
|
@@ -10756,22 +10753,22 @@ const l6 = (t) => ({
|
|
|
10756
10753
|
const I = (((z = s.flip) == null ? void 0 : z.index) || 0) + 1, U = N[I];
|
|
10757
10754
|
if (U && (!(u === "alignment" ? x !== Yr(U) : !1) || // We leave the current main axis only if every placement on that axis
|
|
10758
10755
|
// overflows the main axis.
|
|
10759
|
-
|
|
10756
|
+
D.every((W) => Yr(W.placement) === x ? W.overflows[0] > 0 : !0)))
|
|
10760
10757
|
return {
|
|
10761
10758
|
data: {
|
|
10762
10759
|
index: I,
|
|
10763
|
-
overflows:
|
|
10760
|
+
overflows: D
|
|
10764
10761
|
},
|
|
10765
10762
|
reset: {
|
|
10766
10763
|
placement: U
|
|
10767
10764
|
}
|
|
10768
10765
|
};
|
|
10769
|
-
let H = ($ =
|
|
10766
|
+
let H = ($ = D.filter((j) => j.overflows[0] <= 0).sort((j, W) => j.overflows[1] - W.overflows[1])[0]) == null ? void 0 : $.placement;
|
|
10770
10767
|
if (!H)
|
|
10771
10768
|
switch (f) {
|
|
10772
10769
|
case "bestFit": {
|
|
10773
10770
|
var F;
|
|
10774
|
-
const j = (F =
|
|
10771
|
+
const j = (F = D.filter((W) => {
|
|
10775
10772
|
if (w) {
|
|
10776
10773
|
const A = Yr(W.placement);
|
|
10777
10774
|
return A === x || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -11022,8 +11019,8 @@ const p6 = function(t) {
|
|
|
11022
11019
|
const x = b - h.top - h.bottom, _ = m - h.left - h.right, S = Io(b - h[g], x), k = Io(m - h[v], _), w = !e.middlewareData.shift;
|
|
11023
11020
|
let N = S, E = k;
|
|
11024
11021
|
if ((r = e.middlewareData.shift) != null && r.enabled.x && (E = _), (o = e.middlewareData.shift) != null && o.enabled.y && (N = x), w && !p) {
|
|
11025
|
-
const
|
|
11026
|
-
f ? E = m - 2 * (
|
|
11022
|
+
const D = ar(h.left, 0), z = ar(h.right, 0), $ = ar(h.top, 0), F = ar(h.bottom, 0);
|
|
11023
|
+
f ? E = m - 2 * (D !== 0 || z !== 0 ? D + z : ar(h.left, h.right)) : N = b - 2 * ($ !== 0 || F !== 0 ? $ + F : ar(h.top, h.bottom));
|
|
11027
11024
|
}
|
|
11028
11025
|
await d({
|
|
11029
11026
|
...e,
|
|
@@ -11611,7 +11608,7 @@ function J6(t) {
|
|
|
11611
11608
|
W !== w.current && (w.current = W, b(W));
|
|
11612
11609
|
}, []), _ = C.useCallback((W) => {
|
|
11613
11610
|
W !== N.current && (N.current = W, v(W));
|
|
11614
|
-
}, []), S = s || m, k = a || g, w = C.useRef(null), N = C.useRef(null), E = C.useRef(h), M = d != null,
|
|
11611
|
+
}, []), S = s || m, k = a || g, w = C.useRef(null), N = C.useRef(null), E = C.useRef(h), M = d != null, D = el(d), z = el(n), $ = el(l), F = C.useCallback(() => {
|
|
11615
11612
|
if (!w.current || !N.current)
|
|
11616
11613
|
return;
|
|
11617
11614
|
const W = {
|
|
@@ -11644,11 +11641,11 @@ function J6(t) {
|
|
|
11644
11641
|
I.current = !1;
|
|
11645
11642
|
}), []), Fs(() => {
|
|
11646
11643
|
if (S && (w.current = S), k && (N.current = k), S && k) {
|
|
11647
|
-
if (
|
|
11648
|
-
return
|
|
11644
|
+
if (D.current)
|
|
11645
|
+
return D.current(S, k, F);
|
|
11649
11646
|
F();
|
|
11650
11647
|
}
|
|
11651
|
-
}, [S, k, F,
|
|
11648
|
+
}, [S, k, F, D, M]);
|
|
11652
11649
|
const U = C.useMemo(() => ({
|
|
11653
11650
|
reference: w,
|
|
11654
11651
|
floating: N,
|
|
@@ -11800,8 +11797,8 @@ var bu = "PopperContent", [u_, h_] = D0(bu), B0 = C.forwardRef(
|
|
|
11800
11797
|
updatePositionStrategy: f = "optimized",
|
|
11801
11798
|
onPlaced: m,
|
|
11802
11799
|
...b
|
|
11803
|
-
} = t, g = $0(bu, r), [v, x] = C.useState(null), _ = at(e, (R) => x(R)), [S, k] = C.useState(null), w = l_(S), N = w?.width ?? 0, E = w?.height ?? 0, M = o + (s !== "center" ? "-" + s : ""),
|
|
11804
|
-
padding:
|
|
11800
|
+
} = t, g = $0(bu, r), [v, x] = C.useState(null), _ = at(e, (R) => x(R)), [S, k] = C.useState(null), w = l_(S), N = w?.width ?? 0, E = w?.height ?? 0, M = o + (s !== "center" ? "-" + s : ""), D = typeof h == "number" ? h : { top: 0, right: 0, bottom: 0, left: 0, ...h }, z = Array.isArray(l) ? l : [l], $ = z.length > 0, F = {
|
|
11801
|
+
padding: D,
|
|
11805
11802
|
boundary: z.filter(f_),
|
|
11806
11803
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
11807
11804
|
altBoundary: $
|
|
@@ -11826,8 +11823,8 @@ var bu = "PopperContent", [u_, h_] = D0(bu), B0 = C.forwardRef(
|
|
|
11826
11823
|
d && o_({ ...F }),
|
|
11827
11824
|
n_({
|
|
11828
11825
|
...F,
|
|
11829
|
-
apply: ({ elements: R, rects:
|
|
11830
|
-
const { width: Y, height: de } =
|
|
11826
|
+
apply: ({ elements: R, rects: O, availableWidth: J, availableHeight: Q }) => {
|
|
11827
|
+
const { width: Y, height: de } = O.reference, Me = R.floating.style;
|
|
11831
11828
|
Me.setProperty("--radix-popper-available-width", `${J}px`), Me.setProperty("--radix-popper-available-height", `${Q}px`), Me.setProperty("--radix-popper-anchor-width", `${Y}px`), Me.setProperty("--radix-popper-anchor-height", `${de}px`);
|
|
11832
11829
|
}
|
|
11833
11830
|
}),
|
|
@@ -14759,15 +14756,15 @@ const Ts = (t) => {
|
|
|
14759
14756
|
}, b = (S) => {
|
|
14760
14757
|
S.preventDefault();
|
|
14761
14758
|
const k = S.clientX, w = S.clientY, N = a.width, E = a.height;
|
|
14762
|
-
let M = N,
|
|
14759
|
+
let M = N, D = E;
|
|
14763
14760
|
const z = (F) => {
|
|
14764
14761
|
requestAnimationFrame(() => {
|
|
14765
|
-
M = Math.max(50, N + (F.clientX - k)),
|
|
14762
|
+
M = Math.max(50, N + (F.clientX - k)), D = Math.max(50, E + (F.clientY - w)), c({ width: M, height: D });
|
|
14766
14763
|
});
|
|
14767
14764
|
}, $ = () => {
|
|
14768
14765
|
document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", $), l.update(() => {
|
|
14769
14766
|
const F = ut(s);
|
|
14770
|
-
F && F instanceof dr && F.setDimensions(M,
|
|
14767
|
+
F && F instanceof dr && F.setDimensions(M, D);
|
|
14771
14768
|
});
|
|
14772
14769
|
};
|
|
14773
14770
|
document.addEventListener("mousemove", z), document.addEventListener("mouseup", $);
|
|
@@ -15230,7 +15227,7 @@ const Ts = (t) => {
|
|
|
15230
15227
|
)
|
|
15231
15228
|
}
|
|
15232
15229
|
);
|
|
15233
|
-
}, NS = C.lazy(() => import("./index-
|
|
15230
|
+
}, NS = C.lazy(() => import("./index-YHNm3bIK.js"));
|
|
15234
15231
|
function ES(t) {
|
|
15235
15232
|
if (t instanceof HTMLDivElement) {
|
|
15236
15233
|
const e = t.getAttribute("data-lexical-file-src"), r = t.getAttribute("data-lexical-file-name");
|
|
@@ -16144,7 +16141,7 @@ var DS = [" ", "Enter", "ArrowUp", "ArrowDown"], $S = [" ", "Enter"], Jo = "Sele
|
|
|
16144
16141
|
defaultProp: n ?? !1,
|
|
16145
16142
|
onChange: s,
|
|
16146
16143
|
caller: Jo
|
|
16147
|
-
}), [M,
|
|
16144
|
+
}), [M, D] = To({
|
|
16148
16145
|
prop: a,
|
|
16149
16146
|
defaultProp: c,
|
|
16150
16147
|
onChange: d,
|
|
@@ -16163,7 +16160,7 @@ var DS = [" ", "Enter", "ArrowUp", "ArrowDown"], $S = [" ", "Enter"], Jo = "Sele
|
|
|
16163
16160
|
onValueNodeHasChildrenChange: k,
|
|
16164
16161
|
contentId: br(),
|
|
16165
16162
|
value: M,
|
|
16166
|
-
onValueChange:
|
|
16163
|
+
onValueChange: D,
|
|
16167
16164
|
open: N,
|
|
16168
16165
|
onOpenChange: E,
|
|
16169
16166
|
dir: w,
|
|
@@ -16195,7 +16192,7 @@ var DS = [" ", "Enter", "ArrowUp", "ArrowDown"], $S = [" ", "Enter"], Jo = "Sele
|
|
|
16195
16192
|
name: h,
|
|
16196
16193
|
autoComplete: u,
|
|
16197
16194
|
value: M,
|
|
16198
|
-
onChange: (H) =>
|
|
16195
|
+
onChange: (H) => D(H.target.value),
|
|
16199
16196
|
disabled: p,
|
|
16200
16197
|
form: m,
|
|
16201
16198
|
children: [
|
|
@@ -16318,7 +16315,7 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16318
16315
|
avoidCollisions: g,
|
|
16319
16316
|
//
|
|
16320
16317
|
...v
|
|
16321
|
-
} = t, x = $o(Qo, r), [_, S] = C.useState(null), [k, w] = C.useState(null), N = at(e, (R) => S(R)), [E, M] = C.useState(null), [
|
|
16318
|
+
} = t, x = $o(Qo, r), [_, S] = C.useState(null), [k, w] = C.useState(null), N = at(e, (R) => S(R)), [E, M] = C.useState(null), [D, z] = C.useState(
|
|
16322
16319
|
null
|
|
16323
16320
|
), $ = vc(r), [F, I] = C.useState(!1), U = C.useRef(!1);
|
|
16324
16321
|
C.useEffect(() => {
|
|
@@ -16326,9 +16323,9 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16326
16323
|
}, [_]), Ua();
|
|
16327
16324
|
const H = C.useCallback(
|
|
16328
16325
|
(R) => {
|
|
16329
|
-
const [
|
|
16326
|
+
const [O, ...J] = $().map((de) => de.ref.current), [Q] = J.slice(-1), Y = document.activeElement;
|
|
16330
16327
|
for (const de of R)
|
|
16331
|
-
if (de === Y || (de?.scrollIntoView({ block: "nearest" }), de ===
|
|
16328
|
+
if (de === Y || (de?.scrollIntoView({ block: "nearest" }), de === O && k && (k.scrollTop = 0), de === Q && k && (k.scrollTop = k.scrollHeight), de?.focus(), document.activeElement !== Y)) return;
|
|
16332
16329
|
},
|
|
16333
16330
|
[$, k]
|
|
16334
16331
|
), j = C.useCallback(
|
|
@@ -16342,16 +16339,16 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16342
16339
|
C.useEffect(() => {
|
|
16343
16340
|
if (_) {
|
|
16344
16341
|
let R = { x: 0, y: 0 };
|
|
16345
|
-
const
|
|
16342
|
+
const O = (Q) => {
|
|
16346
16343
|
R = {
|
|
16347
16344
|
x: Math.abs(Math.round(Q.pageX) - (A.current?.x ?? 0)),
|
|
16348
16345
|
y: Math.abs(Math.round(Q.pageY) - (A.current?.y ?? 0))
|
|
16349
16346
|
};
|
|
16350
16347
|
}, J = (Q) => {
|
|
16351
|
-
R.x <= 10 && R.y <= 10 ? Q.preventDefault() : _.contains(Q.target) || W(!1), document.removeEventListener("pointermove",
|
|
16348
|
+
R.x <= 10 && R.y <= 10 ? Q.preventDefault() : _.contains(Q.target) || W(!1), document.removeEventListener("pointermove", O), A.current = null;
|
|
16352
16349
|
};
|
|
16353
|
-
return A.current !== null && (document.addEventListener("pointermove",
|
|
16354
|
-
document.removeEventListener("pointermove",
|
|
16350
|
+
return A.current !== null && (document.addEventListener("pointermove", O), document.addEventListener("pointerup", J, { capture: !0, once: !0 })), () => {
|
|
16351
|
+
document.removeEventListener("pointermove", O), document.removeEventListener("pointerup", J, { capture: !0 });
|
|
16355
16352
|
};
|
|
16356
16353
|
}
|
|
16357
16354
|
}, [_, W, A]), C.useEffect(() => {
|
|
@@ -16361,18 +16358,18 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16361
16358
|
};
|
|
16362
16359
|
}, [W]);
|
|
16363
16360
|
const [re, le] = J1((R) => {
|
|
16364
|
-
const
|
|
16361
|
+
const O = $().filter((Y) => !Y.disabled), J = O.find((Y) => Y.ref.current === document.activeElement), Q = Q1(O, R, J);
|
|
16365
16362
|
Q && setTimeout(() => Q.ref.current.focus());
|
|
16366
16363
|
}), he = C.useCallback(
|
|
16367
|
-
(R,
|
|
16364
|
+
(R, O, J) => {
|
|
16368
16365
|
const Q = !U.current && !J;
|
|
16369
|
-
(x.value !== void 0 && x.value ===
|
|
16366
|
+
(x.value !== void 0 && x.value === O || Q) && (M(R), Q && (U.current = !0));
|
|
16370
16367
|
},
|
|
16371
16368
|
[x.value]
|
|
16372
16369
|
), oe = C.useCallback(() => _?.focus(), [_]), se = C.useCallback(
|
|
16373
|
-
(R,
|
|
16370
|
+
(R, O, J) => {
|
|
16374
16371
|
const Q = !U.current && !J;
|
|
16375
|
-
(x.value !== void 0 && x.value ===
|
|
16372
|
+
(x.value !== void 0 && x.value === O || Q) && z(R);
|
|
16376
16373
|
},
|
|
16377
16374
|
[x.value]
|
|
16378
16375
|
), B = o === "popper" ? pd : D1, L = B === pd ? {
|
|
@@ -16399,7 +16396,7 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16399
16396
|
onItemLeave: oe,
|
|
16400
16397
|
itemTextRefCallback: se,
|
|
16401
16398
|
focusSelectedItem: j,
|
|
16402
|
-
selectedItemText:
|
|
16399
|
+
selectedItemText: D,
|
|
16403
16400
|
position: o,
|
|
16404
16401
|
isPositioned: F,
|
|
16405
16402
|
searchRef: re,
|
|
@@ -16444,8 +16441,8 @@ var Er = 10, [A1, Fo] = Qn(Qo), US = "SelectContentImpl", VS = /* @__PURE__ */ K
|
|
|
16444
16441
|
...v.style
|
|
16445
16442
|
},
|
|
16446
16443
|
onKeyDown: ke(v.onKeyDown, (R) => {
|
|
16447
|
-
const
|
|
16448
|
-
if (R.key === "Tab" && R.preventDefault(), !
|
|
16444
|
+
const O = R.ctrlKey || R.altKey || R.metaKey;
|
|
16445
|
+
if (R.key === "Tab" && R.preventDefault(), !O && R.key.length === 1 && le(R.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(R.key)) {
|
|
16449
16446
|
let Q = $().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
|
|
16450
16447
|
if (["ArrowUp", "End"].includes(R.key) && (Q = Q.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(R.key)) {
|
|
16451
16448
|
const Y = R.target, de = Q.indexOf(Y);
|
|
@@ -16468,9 +16465,9 @@ O1.displayName = US;
|
|
|
16468
16465
|
var qS = "SelectItemAlignedPosition", D1 = C.forwardRef((t, e) => {
|
|
16469
16466
|
const { __scopeSelect: r, onPlaced: o, ...n } = t, s = $o(Qo, r), a = Fo(Qo, r), [c, d] = C.useState(null), [l, h] = C.useState(null), u = at(e, (N) => h(N)), p = vc(r), f = C.useRef(!1), m = C.useRef(!0), { viewport: b, selectedItem: g, selectedItemText: v, focusSelectedItem: x } = a, _ = C.useCallback(() => {
|
|
16470
16467
|
if (s.trigger && s.valueNode && c && l && b && g && v) {
|
|
16471
|
-
const N = s.trigger.getBoundingClientRect(), E = l.getBoundingClientRect(), M = s.valueNode.getBoundingClientRect(),
|
|
16468
|
+
const N = s.trigger.getBoundingClientRect(), E = l.getBoundingClientRect(), M = s.valueNode.getBoundingClientRect(), D = v.getBoundingClientRect();
|
|
16472
16469
|
if (s.dir !== "rtl") {
|
|
16473
|
-
const Y =
|
|
16470
|
+
const Y = D.left - E.left, de = M.left - Y, Me = N.left - de, Ne = N.width + Me, xe = Math.max(Ne, E.width), be = window.innerWidth - Er, we = Lp(de, [
|
|
16474
16471
|
Er,
|
|
16475
16472
|
// Prevents the content from going off the starting edge of the
|
|
16476
16473
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -16481,21 +16478,21 @@ var qS = "SelectItemAlignedPosition", D1 = C.forwardRef((t, e) => {
|
|
|
16481
16478
|
]);
|
|
16482
16479
|
c.style.minWidth = Ne + "px", c.style.left = we + "px";
|
|
16483
16480
|
} else {
|
|
16484
|
-
const Y = E.right -
|
|
16481
|
+
const Y = E.right - D.right, de = window.innerWidth - M.right - Y, Me = window.innerWidth - N.right - de, Ne = N.width + Me, xe = Math.max(Ne, E.width), be = window.innerWidth - Er, we = Lp(de, [
|
|
16485
16482
|
Er,
|
|
16486
16483
|
Math.max(Er, be - xe)
|
|
16487
16484
|
]);
|
|
16488
16485
|
c.style.minWidth = Ne + "px", c.style.right = we + "px";
|
|
16489
16486
|
}
|
|
16490
|
-
const z = p(), $ = window.innerHeight - Er * 2, F = b.scrollHeight, I = window.getComputedStyle(l), U = parseInt(I.borderTopWidth, 10), H = parseInt(I.paddingTop, 10), j = parseInt(I.borderBottomWidth, 10), W = parseInt(I.paddingBottom, 10), A = U + H + F + W + j, re = Math.min(g.offsetHeight * 5, A), le = window.getComputedStyle(b), he = parseInt(le.paddingTop, 10), oe = parseInt(le.paddingBottom, 10), se = N.top + N.height / 2 - Er, B = $ - se, L = g.offsetHeight / 2, R = g.offsetTop + L,
|
|
16491
|
-
if (
|
|
16487
|
+
const z = p(), $ = window.innerHeight - Er * 2, F = b.scrollHeight, I = window.getComputedStyle(l), U = parseInt(I.borderTopWidth, 10), H = parseInt(I.paddingTop, 10), j = parseInt(I.borderBottomWidth, 10), W = parseInt(I.paddingBottom, 10), A = U + H + F + W + j, re = Math.min(g.offsetHeight * 5, A), le = window.getComputedStyle(b), he = parseInt(le.paddingTop, 10), oe = parseInt(le.paddingBottom, 10), se = N.top + N.height / 2 - Er, B = $ - se, L = g.offsetHeight / 2, R = g.offsetTop + L, O = U + H + R, J = A - O;
|
|
16488
|
+
if (O <= se) {
|
|
16492
16489
|
const Y = z.length > 0 && g === z[z.length - 1].ref.current;
|
|
16493
16490
|
c.style.bottom = "0px";
|
|
16494
16491
|
const de = l.clientHeight - b.offsetTop - b.offsetHeight, Me = Math.max(
|
|
16495
16492
|
B,
|
|
16496
16493
|
L + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
16497
16494
|
(Y ? oe : 0) + de + j
|
|
16498
|
-
), Ne =
|
|
16495
|
+
), Ne = O + Me;
|
|
16499
16496
|
c.style.height = Ne + "px";
|
|
16500
16497
|
} else {
|
|
16501
16498
|
const Y = z.length > 0 && g === z[0].ref.current;
|
|
@@ -16505,7 +16502,7 @@ var qS = "SelectItemAlignedPosition", D1 = C.forwardRef((t, e) => {
|
|
|
16505
16502
|
U + b.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
16506
16503
|
(Y ? he : 0) + L
|
|
16507
16504
|
) + J;
|
|
16508
|
-
c.style.height = Me + "px", b.scrollTop =
|
|
16505
|
+
c.style.height = Me + "px", b.scrollTop = O - se + b.offsetTop;
|
|
16509
16506
|
}
|
|
16510
16507
|
c.style.margin = `${Er}px 0`, c.style.minHeight = re + "px", c.style.maxHeight = $ + "px", o?.(), requestAnimationFrame(() => f.current = !0);
|
|
16511
16508
|
}
|
|
@@ -17316,7 +17313,7 @@ function fN({
|
|
|
17316
17313
|
f(!0);
|
|
17317
17314
|
const v = ve.loading("Updating chart...");
|
|
17318
17315
|
try {
|
|
17319
|
-
const x = "https://api.cteditor.com
|
|
17316
|
+
const x = "https://api.cteditor.com".replace(/\/$/, ""), _ = localStorage.getItem("apiKey") || "", S = await fetch(`${x}/api/chat/regenerate`, {
|
|
17320
17317
|
method: "POST",
|
|
17321
17318
|
headers: {
|
|
17322
17319
|
"Content-Type": "application/json",
|
|
@@ -18234,8 +18231,8 @@ const SN = [
|
|
|
18234
18231
|
if (pe(x)) {
|
|
18235
18232
|
const _ = x.anchor.getNode();
|
|
18236
18233
|
let S = _.getKey() === "root" ? _ : Lt(_, (M) => {
|
|
18237
|
-
const
|
|
18238
|
-
return
|
|
18234
|
+
const D = M.getParent();
|
|
18235
|
+
return D !== null && Fa(D);
|
|
18239
18236
|
});
|
|
18240
18237
|
S === null && (S = _.getTopLevelElementOrThrow());
|
|
18241
18238
|
const k = S.getKey(), w = t.getElementByKey(k);
|
|
@@ -18258,14 +18255,14 @@ const SN = [
|
|
|
18258
18255
|
const M = Vf(
|
|
18259
18256
|
_,
|
|
18260
18257
|
Bd
|
|
18261
|
-
),
|
|
18262
|
-
a(
|
|
18258
|
+
), D = M ? M.getListType() : S.getListType();
|
|
18259
|
+
a(D);
|
|
18263
18260
|
} else {
|
|
18264
18261
|
const M = rm(S) ? S.getTag() : S.getType();
|
|
18265
18262
|
if (M in uy && a(M), ur(S)) {
|
|
18266
|
-
const
|
|
18263
|
+
const D = S.getLanguage();
|
|
18267
18264
|
h(
|
|
18268
|
-
|
|
18265
|
+
D ? em[D] || D : ""
|
|
18269
18266
|
);
|
|
18270
18267
|
return;
|
|
18271
18268
|
}
|
|
@@ -18467,7 +18464,7 @@ const my = async (t, e) => {
|
|
|
18467
18464
|
};
|
|
18468
18465
|
s && (N.current && (clearInterval(N.current), N.current = null), M.current = f * 1e3);
|
|
18469
18466
|
}, [o, s, f]);
|
|
18470
|
-
const
|
|
18467
|
+
const D = V(async () => {
|
|
18471
18468
|
try {
|
|
18472
18469
|
h(null), d(!0), S.current = "", k.current = "", m(0), E.current = 0, M.current = 0, a(!1);
|
|
18473
18470
|
const H = await fy(r);
|
|
@@ -18551,14 +18548,14 @@ const my = async (t, e) => {
|
|
|
18551
18548
|
if (W.readyState === WebSocket.OPEN) {
|
|
18552
18549
|
const B = oe.inputBuffer.getChannelData(0), L = new Int16Array(B.length);
|
|
18553
18550
|
for (let R = 0; R < B.length; R++) {
|
|
18554
|
-
const
|
|
18555
|
-
L[R] =
|
|
18551
|
+
const O = Math.max(-1, Math.min(1, B[R]));
|
|
18552
|
+
L[R] = O < 0 ? O * 32768 : O * 32767;
|
|
18556
18553
|
}
|
|
18557
18554
|
if (re.push(L), le += L.length, le >= he) {
|
|
18558
18555
|
const R = new Int16Array(le);
|
|
18559
|
-
let
|
|
18556
|
+
let O = 0;
|
|
18560
18557
|
for (const J of re)
|
|
18561
|
-
R.set(J,
|
|
18558
|
+
R.set(J, O), O += J.length;
|
|
18562
18559
|
W.send(R.buffer), re = [], le = 0;
|
|
18563
18560
|
}
|
|
18564
18561
|
}
|
|
@@ -18584,8 +18581,8 @@ const my = async (t, e) => {
|
|
|
18584
18581
|
});
|
|
18585
18582
|
}
|
|
18586
18583
|
}, [f, e, r]), U = V(() => {
|
|
18587
|
-
o ? I() :
|
|
18588
|
-
}, [o,
|
|
18584
|
+
o ? I() : D();
|
|
18585
|
+
}, [o, D, I]);
|
|
18589
18586
|
return {
|
|
18590
18587
|
isRecording: o,
|
|
18591
18588
|
isPaused: s,
|
|
@@ -18608,7 +18605,7 @@ function $N({
|
|
|
18608
18605
|
selectedTextForInline: a,
|
|
18609
18606
|
savedSelection: c
|
|
18610
18607
|
}) {
|
|
18611
|
-
const [d, l] = T(""), [h, u] = T(""), [p, f] = T(!1), [m, b] = T(null), [g, v] = T("chatgpt"), [x, _] = T(1), [S, k] = T(0), [w, N] = T(0), [E, M] = T("idle"), [
|
|
18608
|
+
const [d, l] = T(""), [h, u] = T(""), [p, f] = T(!1), [m, b] = T(null), [g, v] = T("chatgpt"), [x, _] = T(1), [S, k] = T(0), [w, N] = T(0), [E, M] = T("idle"), [D, z] = T(!1), $ = ne(c ?? null);
|
|
18612
18609
|
q(() => {
|
|
18613
18610
|
$.current = c ?? null;
|
|
18614
18611
|
}, [c]), q(() => {
|
|
@@ -18629,8 +18626,8 @@ function $N({
|
|
|
18629
18626
|
},
|
|
18630
18627
|
apiKey: o
|
|
18631
18628
|
}), le = (R) => {
|
|
18632
|
-
const
|
|
18633
|
-
return `${
|
|
18629
|
+
const O = Math.floor(R / 60), J = R % 60;
|
|
18630
|
+
return `${O.toString().padStart(2, "0")}:${J.toString().padStart(2, "0")}`;
|
|
18634
18631
|
};
|
|
18635
18632
|
q(() => {
|
|
18636
18633
|
let R = !0;
|
|
@@ -18646,7 +18643,7 @@ function $N({
|
|
|
18646
18643
|
};
|
|
18647
18644
|
}, [o]);
|
|
18648
18645
|
const he = (R) => {
|
|
18649
|
-
const
|
|
18646
|
+
const O = R.toLowerCase();
|
|
18650
18647
|
return [
|
|
18651
18648
|
"generate image",
|
|
18652
18649
|
"generate an image",
|
|
@@ -18665,18 +18662,18 @@ function $N({
|
|
|
18665
18662
|
"render image",
|
|
18666
18663
|
"design image",
|
|
18667
18664
|
"produce image"
|
|
18668
|
-
].some((Q) =>
|
|
18665
|
+
].some((Q) => O.includes(Q));
|
|
18669
18666
|
}, oe = async () => {
|
|
18670
18667
|
if (!d.trim() || p) return;
|
|
18671
18668
|
const R = h && h.trim() !== "";
|
|
18672
|
-
let
|
|
18673
|
-
he(d) || h && he(h) ?
|
|
18669
|
+
let O;
|
|
18670
|
+
he(d) || h && he(h) ? O = R ? `${d}: ${h}` : d : R ? O = `${d}
|
|
18674
18671
|
IMPORTANT: Return ONLY the modified/transformed text. Do NOT include any labels, prefixes, explanations, or formatting like "Simplified:", "Result:", "Here is", etc. Just return the pure result text.
|
|
18675
18672
|
Text to transform:
|
|
18676
18673
|
"${h}"
|
|
18677
|
-
` :
|
|
18674
|
+
` : O = d, await Rg({
|
|
18678
18675
|
editor: r,
|
|
18679
|
-
query:
|
|
18676
|
+
query: O,
|
|
18680
18677
|
model: g,
|
|
18681
18678
|
apiKey: o || "",
|
|
18682
18679
|
savedSelection: $.current,
|
|
@@ -18844,8 +18841,8 @@ function $N({
|
|
|
18844
18841
|
rows: 1,
|
|
18845
18842
|
onInput: (R) => {
|
|
18846
18843
|
if (R.currentTarget.value === "") return;
|
|
18847
|
-
const
|
|
18848
|
-
|
|
18844
|
+
const O = R.currentTarget;
|
|
18845
|
+
O.style.height = "auto", O.style.height = `${O.scrollHeight}px`;
|
|
18849
18846
|
},
|
|
18850
18847
|
onKeyDown: (R) => {
|
|
18851
18848
|
R.key === "Enter" && !R.shiftKey && !p && d.trim() && (R.preventDefault(), oe());
|
|
@@ -19019,8 +19016,8 @@ function FN({
|
|
|
19019
19016
|
M && (v.current = M.clone());
|
|
19020
19017
|
});
|
|
19021
19018
|
}, [t]), q(() => {
|
|
19022
|
-
const M = t.registerUpdateListener(({ editorState:
|
|
19023
|
-
|
|
19019
|
+
const M = t.registerUpdateListener(({ editorState: D }) => {
|
|
19020
|
+
D.read(() => {
|
|
19024
19021
|
const z = ue();
|
|
19025
19022
|
if (z && z.getTextContent().trim()) {
|
|
19026
19023
|
const $ = z.getTextContent();
|
|
@@ -19035,7 +19032,7 @@ function FN({
|
|
|
19035
19032
|
g.current && g.current.focus();
|
|
19036
19033
|
}, []);
|
|
19037
19034
|
const S = (M) => {
|
|
19038
|
-
const
|
|
19035
|
+
const D = M.toLowerCase();
|
|
19039
19036
|
return [
|
|
19040
19037
|
"generate image",
|
|
19041
19038
|
"generate an image",
|
|
@@ -19054,14 +19051,14 @@ function FN({
|
|
|
19054
19051
|
"render image",
|
|
19055
19052
|
"design image",
|
|
19056
19053
|
"produce image"
|
|
19057
|
-
].some(($) =>
|
|
19054
|
+
].some(($) => D.includes($));
|
|
19058
19055
|
}, k = async () => {
|
|
19059
19056
|
if (!d.trim() || h) return;
|
|
19060
19057
|
u(!0);
|
|
19061
|
-
const M = S(d) || x && S(x),
|
|
19062
|
-
d.length + (
|
|
19058
|
+
const M = S(d) || x && S(x), D = x && x.trim() !== "";
|
|
19059
|
+
d.length + (D ? x.length : 0);
|
|
19063
19060
|
let z;
|
|
19064
|
-
M ?
|
|
19061
|
+
M ? D ? z = `${d}: ${x}` : z = d : D ? z = `${d}
|
|
19065
19062
|
|
|
19066
19063
|
IMPORTANT: Return ONLY the modified/transformed text. Do NOT include any labels, prefixes, explanations, or formatting like "Simplified:", "Result:", "Here is", etc. Just return the pure result text.
|
|
19067
19064
|
|
|
@@ -19104,7 +19101,7 @@ function FN({
|
|
|
19104
19101
|
`)) {
|
|
19105
19102
|
const L = j(U);
|
|
19106
19103
|
t.update(() => {
|
|
19107
|
-
const
|
|
19104
|
+
const O = new DOMParser().parseFromString(L, "text/html");
|
|
19108
19105
|
if (H === "")
|
|
19109
19106
|
if (v.current && pe(v.current))
|
|
19110
19107
|
try {
|
|
@@ -19134,7 +19131,7 @@ function FN({
|
|
|
19134
19131
|
Y.append(Me), Me.select();
|
|
19135
19132
|
}
|
|
19136
19133
|
}
|
|
19137
|
-
const J = Eo(t,
|
|
19134
|
+
const J = Eo(t, O), Q = ue();
|
|
19138
19135
|
if (Q)
|
|
19139
19136
|
Q.insertText(""), uo(J);
|
|
19140
19137
|
else {
|
|
@@ -19146,8 +19143,8 @@ function FN({
|
|
|
19146
19143
|
} else if (se.type === "done") {
|
|
19147
19144
|
const B = j(U);
|
|
19148
19145
|
t.update(() => {
|
|
19149
|
-
const R = new DOMParser().parseFromString(B, "text/html"),
|
|
19150
|
-
J.clear(), J.append(...
|
|
19146
|
+
const R = new DOMParser().parseFromString(B, "text/html"), O = Eo(t, R), J = lt();
|
|
19147
|
+
J.clear(), J.append(...O);
|
|
19151
19148
|
}), console.log("Stream completed");
|
|
19152
19149
|
} else if (se.type === "error")
|
|
19153
19150
|
throw new Error(se.error || "Stream error occurred");
|
|
@@ -19604,7 +19601,7 @@ const UN = Rt(), VN = () => {
|
|
|
19604
19601
|
}
|
|
19605
19602
|
);
|
|
19606
19603
|
}, GN = (t, e = "en") => {
|
|
19607
|
-
const [r, o] = T(!1), [n, s] = T(!1), [a, c] = T(!1), [d, l] = T(!1), [h, u] = T(""), [p, f] = T(null), [m, b] = T(!1), [g, v] = T(0), x = ll(e), _ = ne(null), S = ne(null), k = ne(null), w = ne(null), N = ne(-1), E = ne(null), M = ne(""),
|
|
19604
|
+
const [r, o] = T(!1), [n, s] = T(!1), [a, c] = T(!1), [d, l] = T(!1), [h, u] = T(""), [p, f] = T(null), [m, b] = T(!1), [g, v] = T(0), x = ll(e), _ = ne(null), S = ne(null), k = ne(null), w = ne(null), N = ne(-1), E = ne(null), M = ne(""), D = ne(""), z = ne(null), $ = ne(0), F = ne(0), I = ne(t), U = ne(e), H = ne(null), j = ne([]);
|
|
19608
19605
|
q(() => {
|
|
19609
19606
|
I.current = t;
|
|
19610
19607
|
}, [t]), q(() => {
|
|
@@ -19633,22 +19630,22 @@ const UN = Rt(), VN = () => {
|
|
|
19633
19630
|
f(null), c(!0), v(0), $.current = 0, F.current = 0, s(!1), E.current && E.current.focus();
|
|
19634
19631
|
const L = U.current;
|
|
19635
19632
|
if (ll(L)) {
|
|
19636
|
-
const
|
|
19633
|
+
const O = await navigator.mediaDevices.getUserMedia({
|
|
19637
19634
|
audio: {
|
|
19638
19635
|
echoCancellation: !0,
|
|
19639
19636
|
noiseSuppression: !0,
|
|
19640
19637
|
autoGainControl: !0
|
|
19641
19638
|
}
|
|
19642
19639
|
});
|
|
19643
|
-
_.current =
|
|
19644
|
-
const J = MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4", Q = new MediaRecorder(
|
|
19640
|
+
_.current = O, j.current = [];
|
|
19641
|
+
const J = MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4", Q = new MediaRecorder(O, { mimeType: J });
|
|
19645
19642
|
H.current = Q, Q.ondataavailable = (Y) => {
|
|
19646
19643
|
Y.data.size > 0 && j.current.push(Y.data);
|
|
19647
19644
|
}, Q.start(1e3), o(!0), c(!1), A(!0);
|
|
19648
19645
|
} else {
|
|
19649
|
-
const
|
|
19650
|
-
if (console.log(
|
|
19651
|
-
throw new Error(
|
|
19646
|
+
const O = await fy(t);
|
|
19647
|
+
if (console.log(O, "data", O.token), !O.token)
|
|
19648
|
+
throw new Error(O.error || "Failed to get token");
|
|
19652
19649
|
const J = await navigator.mediaDevices.getUserMedia({
|
|
19653
19650
|
audio: {
|
|
19654
19651
|
sampleRate: { ideal: 16e3 },
|
|
@@ -19659,7 +19656,7 @@ const UN = Rt(), VN = () => {
|
|
|
19659
19656
|
}
|
|
19660
19657
|
});
|
|
19661
19658
|
_.current = J;
|
|
19662
|
-
const Q = `wss://streaming.assemblyai.com/v3/ws?token=${
|
|
19659
|
+
const Q = `wss://streaming.assemblyai.com/v3/ws?token=${O.token}`, Y = new WebSocket(Q);
|
|
19663
19660
|
S.current = Y, Y.onopen = () => {
|
|
19664
19661
|
b(!0), c(!1);
|
|
19665
19662
|
}, Y.onmessage = (Ne) => {
|
|
@@ -19667,7 +19664,7 @@ const UN = Rt(), VN = () => {
|
|
|
19667
19664
|
const xe = JSON.parse(Ne.data);
|
|
19668
19665
|
if (xe.type === "Turn") {
|
|
19669
19666
|
if (xe.transcript !== void 0) {
|
|
19670
|
-
xe.turn_order !== N.current && (N.current = xe.turn_order, M.current = "",
|
|
19667
|
+
xe.turn_order !== N.current && (N.current = xe.turn_order, M.current = "", D.current = "");
|
|
19671
19668
|
const be = xe.transcript, we = M.current;
|
|
19672
19669
|
if (be.startsWith(we)) {
|
|
19673
19670
|
const K = be.substring(we.length);
|
|
@@ -19700,7 +19697,7 @@ const UN = Rt(), VN = () => {
|
|
|
19700
19697
|
const P = Qe(" ");
|
|
19701
19698
|
K.insertNodes([P]);
|
|
19702
19699
|
}
|
|
19703
|
-
}), M.current = "",
|
|
19700
|
+
}), M.current = "", D.current = "");
|
|
19704
19701
|
}
|
|
19705
19702
|
} else xe.type === "error" && f("Transcription error: " + (xe.message || ""));
|
|
19706
19703
|
} catch (xe) {
|
|
@@ -19746,13 +19743,13 @@ const UN = Rt(), VN = () => {
|
|
|
19746
19743
|
}
|
|
19747
19744
|
c(!1), o(!1), A(!1);
|
|
19748
19745
|
}
|
|
19749
|
-
}, [A, t]), le = (L, R,
|
|
19746
|
+
}, [A, t]), le = (L, R, O) => {
|
|
19750
19747
|
const J = L.createScriptProcessor(1024, 1, 1);
|
|
19751
19748
|
w.current = J;
|
|
19752
19749
|
let Q = [], Y = 0;
|
|
19753
19750
|
const de = 8e3;
|
|
19754
19751
|
J.onaudioprocess = (Me) => {
|
|
19755
|
-
if (
|
|
19752
|
+
if (O.readyState === WebSocket.OPEN) {
|
|
19756
19753
|
const xe = Me.inputBuffer.getChannelData(0), be = new Int16Array(xe.length);
|
|
19757
19754
|
for (let we = 0; we < xe.length; we++) {
|
|
19758
19755
|
const K = Math.max(-1, Math.min(1, xe[we]));
|
|
@@ -19763,7 +19760,7 @@ const UN = Rt(), VN = () => {
|
|
|
19763
19760
|
let K = 0;
|
|
19764
19761
|
for (const P of Q)
|
|
19765
19762
|
we.set(P, K), K += P.length;
|
|
19766
|
-
|
|
19763
|
+
O.send(we.buffer), Q = [], Y = 0;
|
|
19767
19764
|
}
|
|
19768
19765
|
}
|
|
19769
19766
|
}, R.connect(J), J.connect(L.destination);
|
|
@@ -19772,10 +19769,10 @@ const UN = Rt(), VN = () => {
|
|
|
19772
19769
|
}, [r, n]), oe = V(() => {
|
|
19773
19770
|
!r || !n || (s(!1), $.current = Date.now() - F.current, k.current && k.current.state === "suspended" && k.current.resume());
|
|
19774
19771
|
}, [r, n]), se = V(async () => {
|
|
19775
|
-
const L = $.current > 0 ? Math.floor((Date.now() - $.current) / 1e3) : 0, R = U.current,
|
|
19776
|
-
if (
|
|
19772
|
+
const L = $.current > 0 ? Math.floor((Date.now() - $.current) / 1e3) : 0, R = U.current, O = ll(R);
|
|
19773
|
+
if (O && H.current && H.current.state !== "inactive" && await new Promise((J) => {
|
|
19777
19774
|
H.current.onstop = () => J(), H.current.stop();
|
|
19778
|
-
}), o(!1), s(!1), v(0), $.current = 0, F.current = 0, A(!1), z.current && (clearInterval(z.current), z.current = null), w.current && (w.current.disconnect(), w.current = null), k.current && (k.current.close(), k.current = null), _.current && (_.current.getTracks().forEach((J) => J.stop()), _.current = null), S.current && (S.current.readyState === WebSocket.OPEN && S.current.close(1e3, "Recording stopped"), S.current = null), b(!1), H.current = null,
|
|
19775
|
+
}), o(!1), s(!1), v(0), $.current = 0, F.current = 0, A(!1), z.current && (clearInterval(z.current), z.current = null), w.current && (w.current.disconnect(), w.current = null), k.current && (k.current.close(), k.current = null), _.current && (_.current.getTracks().forEach((J) => J.stop()), _.current = null), S.current && (S.current.readyState === WebSocket.OPEN && S.current.close(1e3, "Recording stopped"), S.current = null), b(!1), H.current = null, O && j.current.length > 0) {
|
|
19779
19776
|
l(!0), u("Uploading audio...");
|
|
19780
19777
|
try {
|
|
19781
19778
|
const J = new Blob(j.current, { type: "audio/webm" });
|
|
@@ -19802,7 +19799,7 @@ const UN = Rt(), VN = () => {
|
|
|
19802
19799
|
} finally {
|
|
19803
19800
|
l(!1), u(""), j.current = [];
|
|
19804
19801
|
}
|
|
19805
|
-
} else if (!
|
|
19802
|
+
} else if (!O && L > 0)
|
|
19806
19803
|
try {
|
|
19807
19804
|
await my(L, I.current);
|
|
19808
19805
|
} catch (J) {
|
|
@@ -19927,10 +19924,10 @@ const UN = Rt(), VN = () => {
|
|
|
19927
19924
|
] }) }),
|
|
19928
19925
|
/* @__PURE__ */ i(qN, { isRecording: n && !s, editor: t })
|
|
19929
19926
|
] });
|
|
19930
|
-
}, KN = () => /* @__PURE__ */ i(VN, {}), ZN = "https://api.cteditor.com
|
|
19927
|
+
}, KN = () => /* @__PURE__ */ i(VN, {}), ZN = "https://api.cteditor.com";
|
|
19931
19928
|
async function YN(t, e) {
|
|
19932
19929
|
try {
|
|
19933
|
-
const r = await fetch(`${ZN}api/chat/regenerate`, {
|
|
19930
|
+
const r = await fetch(`${ZN}/api/chat/regenerate`, {
|
|
19934
19931
|
method: "POST",
|
|
19935
19932
|
headers: {
|
|
19936
19933
|
"Content-Type": "application/json",
|
|
@@ -19978,10 +19975,10 @@ const Ur = {
|
|
|
19978
19975
|
}
|
|
19979
19976
|
}, XN = async () => {
|
|
19980
19977
|
try {
|
|
19981
|
-
const t = await import("./html2pdf.bundle.min-
|
|
19978
|
+
const t = await import("./html2pdf.bundle.min-GfQzEXnM.js").then((e) => e.h);
|
|
19982
19979
|
return t?.default || t;
|
|
19983
19980
|
} catch {
|
|
19984
|
-
const t = await import("./html2pdf.bundle-
|
|
19981
|
+
const t = await import("./html2pdf.bundle-DNyY_rJA.js").then((e) => e.h);
|
|
19985
19982
|
return t?.default || t;
|
|
19986
19983
|
}
|
|
19987
19984
|
};
|
|
@@ -20243,8 +20240,8 @@ async function JN(t, e = "document.pdf", r) {
|
|
|
20243
20240
|
const w = k, N = w.getAttribute("style") || "";
|
|
20244
20241
|
if (N.includes("display: flex") || N.includes("display:flex")) {
|
|
20245
20242
|
w.style.visibility = "visible", w.style.opacity = "1", w.style.overflow = "visible";
|
|
20246
|
-
const M = w.querySelector(":scope > svg"),
|
|
20247
|
-
M &&
|
|
20243
|
+
const M = w.querySelector(":scope > svg"), D = w.querySelector(":scope > div");
|
|
20244
|
+
M && D && (w.style.setProperty("flex-direction", "column", "important"), w.style.setProperty("align-items", "center", "important"), w.style.setProperty("gap", "16px", "important"), console.log("Fixed main chart flex container (SVG+legend)"));
|
|
20248
20245
|
}
|
|
20249
20246
|
}), b.querySelectorAll('[style*="linear-gradient"]').forEach((k) => {
|
|
20250
20247
|
const w = k;
|
|
@@ -20528,16 +20525,16 @@ function Ou(t) {
|
|
|
20528
20525
|
});
|
|
20529
20526
|
const m = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), g = Array.from(c.querySelectorAll("tr")), v = g[0], _ = v && v.querySelectorAll("th").length > 0 ? g.slice(1) : g;
|
|
20530
20527
|
g.forEach((w, N) => {
|
|
20531
|
-
w.querySelectorAll("td, th").forEach((M,
|
|
20528
|
+
w.querySelectorAll("td, th").forEach((M, D) => {
|
|
20532
20529
|
const z = M, $ = z.style.textAlign || "", F = z.style.verticalAlign || "";
|
|
20533
|
-
($ || F) && b.set(`${N}-${
|
|
20530
|
+
($ || F) && b.set(`${N}-${D}`, { textAlign: $, verticalAlign: F });
|
|
20534
20531
|
});
|
|
20535
20532
|
}), _.forEach((w, N) => {
|
|
20536
|
-
w.querySelectorAll("td").forEach((M,
|
|
20533
|
+
w.querySelectorAll("td").forEach((M, D) => {
|
|
20537
20534
|
const z = M.style.backgroundColor;
|
|
20538
20535
|
if (z && z !== "rgba(0, 0, 0, 0)") {
|
|
20539
20536
|
const $ = dl(z), F = dl(h), I = dl(u);
|
|
20540
|
-
$ !== "" && $ !== F && $ !== I && m.set(`${N}-${
|
|
20537
|
+
$ !== "" && $ !== F && $ !== I && m.set(`${N}-${D}`, z);
|
|
20541
20538
|
}
|
|
20542
20539
|
});
|
|
20543
20540
|
});
|
|
@@ -21316,10 +21313,10 @@ var vr = "MenuContent", [EE, Fu] = ln(vr), Ny = C.forwardRef(
|
|
|
21316
21313
|
onDismiss: f,
|
|
21317
21314
|
disableOutsideScroll: m,
|
|
21318
21315
|
...b
|
|
21319
|
-
} = t, g = dn(vr, r), v = us(vr, r), x = _c(r), _ = Cy(r), S = wE(r), [k, w] = C.useState(null), N = C.useRef(null), E = at(e, N, g.onContentChange), M = C.useRef(0),
|
|
21320
|
-
const re =
|
|
21321
|
-
(function R(
|
|
21322
|
-
|
|
21316
|
+
} = t, g = dn(vr, r), v = us(vr, r), x = _c(r), _ = Cy(r), S = wE(r), [k, w] = C.useState(null), N = C.useRef(null), E = at(e, N, g.onContentChange), M = C.useRef(0), D = C.useRef(""), z = C.useRef(0), $ = C.useRef(null), F = C.useRef("right"), I = C.useRef(0), U = m ? Zi : C.Fragment, H = m ? { as: IE, allowPinchZoom: !0 } : void 0, j = (A) => {
|
|
21317
|
+
const re = D.current + A, le = S().filter((R) => !R.disabled), he = document.activeElement, oe = le.find((R) => R.ref.current === he)?.textValue, se = le.map((R) => R.textValue), B = jE(se, re, oe), L = le.find((R) => R.textValue === B)?.ref.current;
|
|
21318
|
+
(function R(O) {
|
|
21319
|
+
D.current = O, window.clearTimeout(M.current), O !== "" && (M.current = window.setTimeout(() => R(""), 1e3));
|
|
21323
21320
|
})(re), L && setTimeout(() => L.focus());
|
|
21324
21321
|
};
|
|
21325
21322
|
C.useEffect(() => () => window.clearTimeout(M.current), []), Ua();
|
|
@@ -21328,7 +21325,7 @@ var vr = "MenuContent", [EE, Fu] = ln(vr), Ny = C.forwardRef(
|
|
|
21328
21325
|
EE,
|
|
21329
21326
|
{
|
|
21330
21327
|
scope: r,
|
|
21331
|
-
searchRef:
|
|
21328
|
+
searchRef: D,
|
|
21332
21329
|
onItemEnter: C.useCallback(
|
|
21333
21330
|
(A) => {
|
|
21334
21331
|
W(A) && A.preventDefault();
|
|
@@ -21406,7 +21403,7 @@ var vr = "MenuContent", [EE, Fu] = ln(vr), Ny = C.forwardRef(
|
|
|
21406
21403
|
xy.includes(A.key) && L.reverse(), HE(L);
|
|
21407
21404
|
}),
|
|
21408
21405
|
onBlur: ke(t.onBlur, (A) => {
|
|
21409
|
-
A.currentTarget.contains(A.target) || (window.clearTimeout(M.current),
|
|
21406
|
+
A.currentTarget.contains(A.target) || (window.clearTimeout(M.current), D.current = "");
|
|
21410
21407
|
}),
|
|
21411
21408
|
onPointerMove: ke(
|
|
21412
21409
|
t.onPointerMove,
|
|
@@ -26014,7 +26011,7 @@ function V9({
|
|
|
26014
26011
|
} catch (H) {
|
|
26015
26012
|
throw console.error("Error uploading files:", H), new Error("Failed to upload attachments");
|
|
26016
26013
|
}
|
|
26017
|
-
},
|
|
26014
|
+
}, D = async (I) => {
|
|
26018
26015
|
if (I.preventDefault(), !!w()) {
|
|
26019
26016
|
p(!0);
|
|
26020
26017
|
try {
|
|
@@ -26051,7 +26048,7 @@ function V9({
|
|
|
26051
26048
|
] }),
|
|
26052
26049
|
/* @__PURE__ */ i(Br, { children: "Help us improve by reporting any issues you encounter" })
|
|
26053
26050
|
] }),
|
|
26054
|
-
/* @__PURE__ */ y("form", { onSubmit:
|
|
26051
|
+
/* @__PURE__ */ y("form", { onSubmit: D, children: [
|
|
26055
26052
|
/* @__PURE__ */ y("div", { className: "cteditor-grid cteditor-gap-4 cteditor-py-4", children: [
|
|
26056
26053
|
/* @__PURE__ */ y("div", { className: "cteditor-grid cteditor-gap-2", children: [
|
|
26057
26054
|
/* @__PURE__ */ i(gt, { htmlFor: "bug-title", children: "Bug Title *" }),
|
|
@@ -26172,31 +26169,31 @@ const fl = Ab({
|
|
|
26172
26169
|
comment: zs().max(500, "Comment must be less than 500 characters").optional()
|
|
26173
26170
|
}), q9 = ["", "Poor", "Fair", "Good", "Very Good", "Excellent"], ml = 500;
|
|
26174
26171
|
function G9({ open: t, onOpenChange: e, onFeedbackSubmitted: r }) {
|
|
26175
|
-
const { apiKey: o } = Cr(), [n, s] = T(0), [a, c] = T(0), [d, l] = T(""), [h, u] = T(!1), [p, f] = T({}), [m, b] = T({}), g = a || n, v = (
|
|
26172
|
+
const { apiKey: o } = Cr(), [n, s] = T(0), [a, c] = T(0), [d, l] = T(""), [h, u] = T(!1), [p, f] = T({}), [m, b] = T({}), g = a || n, v = (D, z) => {
|
|
26176
26173
|
try {
|
|
26177
|
-
|
|
26174
|
+
D === "rating" ? fl.shape.rating.parse(z) : D === "comment" && fl.shape.comment.parse(z);
|
|
26178
26175
|
return;
|
|
26179
26176
|
} catch ($) {
|
|
26180
26177
|
return $ instanceof $r ? $.errors[0]?.message : void 0;
|
|
26181
26178
|
}
|
|
26182
|
-
}, x = (
|
|
26183
|
-
s(
|
|
26184
|
-
const z = v("rating",
|
|
26179
|
+
}, x = (D) => {
|
|
26180
|
+
s(D), b(($) => ({ ...$, rating: !0 }));
|
|
26181
|
+
const z = v("rating", D);
|
|
26185
26182
|
f(($) => ({ ...$, rating: z }));
|
|
26186
|
-
}, _ = (
|
|
26187
|
-
if (!(
|
|
26188
|
-
const z = v("comment",
|
|
26183
|
+
}, _ = (D) => {
|
|
26184
|
+
if (!(D.length > ml) && (l(D), m.comment)) {
|
|
26185
|
+
const z = v("comment", D);
|
|
26189
26186
|
f(($) => ({ ...$, comment: z }));
|
|
26190
26187
|
}
|
|
26191
26188
|
}, S = () => {
|
|
26192
26189
|
b((z) => ({ ...z, comment: !0 }));
|
|
26193
|
-
const
|
|
26194
|
-
f((z) => ({ ...z, comment:
|
|
26190
|
+
const D = v("comment", d);
|
|
26191
|
+
f((z) => ({ ...z, comment: D }));
|
|
26195
26192
|
}, k = () => {
|
|
26196
|
-
const
|
|
26193
|
+
const D = {
|
|
26197
26194
|
rating: n,
|
|
26198
26195
|
comment: d.trim() || void 0
|
|
26199
|
-
}, z = fl.safeParse(
|
|
26196
|
+
}, z = fl.safeParse(D);
|
|
26200
26197
|
if (!z.success) {
|
|
26201
26198
|
const $ = {}, F = {};
|
|
26202
26199
|
return z.error.errors.forEach((I) => {
|
|
@@ -26205,8 +26202,8 @@ function G9({ open: t, onOpenChange: e, onFeedbackSubmitted: r }) {
|
|
|
26205
26202
|
}), f($), b((I) => ({ ...I, ...F })), !1;
|
|
26206
26203
|
}
|
|
26207
26204
|
return f({}), !0;
|
|
26208
|
-
}, w = (
|
|
26209
|
-
if (
|
|
26205
|
+
}, w = (D) => !!(m[D] && p[D]), N = async (D) => {
|
|
26206
|
+
if (D.preventDefault(), !!k()) {
|
|
26210
26207
|
u(!0);
|
|
26211
26208
|
try {
|
|
26212
26209
|
await by.createFeedback(
|
|
@@ -26243,12 +26240,12 @@ function G9({ open: t, onOpenChange: e, onFeedbackSubmitted: r }) {
|
|
|
26243
26240
|
/* @__PURE__ */ y("div", { className: "cteditor-grid cteditor-gap-6 cteditor-py-4", children: [
|
|
26244
26241
|
/* @__PURE__ */ y("div", { className: "cteditor-flex cteditor-flex-col cteditor-items-center cteditor-gap-3", children: [
|
|
26245
26242
|
/* @__PURE__ */ i(gt, { className: "cteditor-text-center", children: "How would you rate your experience?" }),
|
|
26246
|
-
/* @__PURE__ */ i("div", { className: "cteditor-flex cteditor-gap-1", children: [1, 2, 3, 4, 5].map((
|
|
26243
|
+
/* @__PURE__ */ i("div", { className: "cteditor-flex cteditor-gap-1", children: [1, 2, 3, 4, 5].map((D) => /* @__PURE__ */ i(
|
|
26247
26244
|
"button",
|
|
26248
26245
|
{
|
|
26249
26246
|
type: "button",
|
|
26250
|
-
onClick: () => x(
|
|
26251
|
-
onMouseEnter: () => c(
|
|
26247
|
+
onClick: () => x(D),
|
|
26248
|
+
onMouseEnter: () => c(D),
|
|
26252
26249
|
onMouseLeave: () => c(0),
|
|
26253
26250
|
className: "cteditor-p-1 cteditor-transition-transform hover:cteditor-scale-110 focus:cteditor-outline-none focus-visible:cteditor-ring-2 focus-visible:cteditor-ring-ring cteditor-rounded",
|
|
26254
26251
|
children: /* @__PURE__ */ i(
|
|
@@ -26256,12 +26253,12 @@ function G9({ open: t, onOpenChange: e, onFeedbackSubmitted: r }) {
|
|
|
26256
26253
|
{
|
|
26257
26254
|
className: fe(
|
|
26258
26255
|
"cteditor-h-8 cteditor-w-8 cteditor-transition-colors",
|
|
26259
|
-
|
|
26256
|
+
D <= g ? "cteditor-fill-yellow-400 cteditor-text-yellow-400" : "cteditor-text-muted-foreground/40 hover:cteditor-text-yellow-400/60"
|
|
26260
26257
|
)
|
|
26261
26258
|
}
|
|
26262
26259
|
)
|
|
26263
26260
|
},
|
|
26264
|
-
|
|
26261
|
+
D
|
|
26265
26262
|
)) }),
|
|
26266
26263
|
/* @__PURE__ */ i("div", { className: "cteditor-h-5", children: g > 0 && /* @__PURE__ */ i(
|
|
26267
26264
|
"span",
|
|
@@ -26290,8 +26287,8 @@ function G9({ open: t, onOpenChange: e, onFeedbackSubmitted: r }) {
|
|
|
26290
26287
|
id: "feedback-text",
|
|
26291
26288
|
placeholder: "Tell us what you liked or what we can improve...",
|
|
26292
26289
|
value: d,
|
|
26293
|
-
onChange: (
|
|
26294
|
-
_(
|
|
26290
|
+
onChange: (D) => {
|
|
26291
|
+
_(D.target.value);
|
|
26295
26292
|
},
|
|
26296
26293
|
onBlur: S,
|
|
26297
26294
|
maxLength: ml,
|
|
@@ -26999,8 +26996,8 @@ const Ic = (t) => {
|
|
|
26999
26996
|
return !0;
|
|
27000
26997
|
if (!["http:", "https:"].includes(N.protocol))
|
|
27001
26998
|
return !1;
|
|
27002
|
-
const E = N.pathname.toLowerCase(), M = /\.(jpg|jpeg|png|gif|bmp|webp|svg|avif|tiff|ico)$/i.test(E),
|
|
27003
|
-
return M ||
|
|
26999
|
+
const E = N.pathname.toLowerCase(), M = /\.(jpg|jpeg|png|gif|bmp|webp|svg|avif|tiff|ico)$/i.test(E), D = /\/(image|img|photo|picture)/i.test(E), z = /\.(jpg|jpeg|png|gif|bmp|webp|svg|avif|tiff|ico)/i.test(N.search);
|
|
27000
|
+
return M || D || z || E === "" || // Allow URLs without specific paths
|
|
27004
27001
|
N.hostname.includes("image") || N.hostname.includes("img") || N.hostname.includes("photo") || N.hostname.includes("cdn");
|
|
27005
27002
|
} catch {
|
|
27006
27003
|
return !1;
|
|
@@ -27050,10 +27047,10 @@ const Ic = (t) => {
|
|
|
27050
27047
|
"image/png": ".png",
|
|
27051
27048
|
"image/gif": ".gif",
|
|
27052
27049
|
"image/webp": ".webp"
|
|
27053
|
-
},
|
|
27050
|
+
}, D = N.type || "image/png", z = M[D] || ".png";
|
|
27054
27051
|
let F = new URL(e).pathname.split("/").pop() || "";
|
|
27055
27052
|
(!F || !F.match(/\.(jpg|jpeg|png|gif|webp)$/i)) && (F = `image-${Date.now()}${z}`);
|
|
27056
|
-
const I = new File([N], F, { type:
|
|
27053
|
+
const I = new File([N], F, { type: D }), U = await m(I);
|
|
27057
27054
|
console.log("URL image uploaded to S3:", U), t({
|
|
27058
27055
|
altText: o,
|
|
27059
27056
|
src: U,
|
|
@@ -28247,7 +28244,7 @@ const NT = [
|
|
|
28247
28244
|
enableBlockquote: N = !0,
|
|
28248
28245
|
enableImageUpload: E = !0,
|
|
28249
28246
|
enableWordCount: M = !0,
|
|
28250
|
-
enableCharts:
|
|
28247
|
+
enableCharts: D = !0,
|
|
28251
28248
|
enableHighlight: z = !0,
|
|
28252
28249
|
enableAutoCorrection: $ = !0,
|
|
28253
28250
|
enablePdfExport: F = !0,
|
|
@@ -28265,7 +28262,7 @@ const NT = [
|
|
|
28265
28262
|
fonts: B,
|
|
28266
28263
|
editor: L,
|
|
28267
28264
|
activeEditor: R,
|
|
28268
|
-
setActiveEditor:
|
|
28265
|
+
setActiveEditor: O
|
|
28269
28266
|
}) => {
|
|
28270
28267
|
const [J, Q] = T({
|
|
28271
28268
|
undo: !0,
|
|
@@ -28548,9 +28545,9 @@ const NT = [
|
|
|
28548
28545
|
}, [R, L, bt]);
|
|
28549
28546
|
q(() => L.registerCommand(
|
|
28550
28547
|
Wn,
|
|
28551
|
-
(ae, Ee) => (
|
|
28548
|
+
(ae, Ee) => (O(Ee), ms(), !1),
|
|
28552
28549
|
sn
|
|
28553
|
-
), [L, ms,
|
|
28550
|
+
), [L, ms, O]), q(() => {
|
|
28554
28551
|
R.getEditorState().read(() => {
|
|
28555
28552
|
ms();
|
|
28556
28553
|
});
|
|
@@ -28927,7 +28924,7 @@ const NT = [
|
|
|
28927
28924
|
) }),
|
|
28928
28925
|
/* @__PURE__ */ i(Ze, { children: /* @__PURE__ */ i("p", { children: "Add Table" }) })
|
|
28929
28926
|
] }) }),
|
|
28930
|
-
|
|
28927
|
+
D && R === L && /* @__PURE__ */ i(tt, { delayDuration: 200, children: /* @__PURE__ */ y(Ke, { children: [
|
|
28931
28928
|
/* @__PURE__ */ i(Je, { asChild: !0, children: /* @__PURE__ */ i(
|
|
28932
28929
|
ge,
|
|
28933
28930
|
{
|
|
@@ -30310,8 +30307,8 @@ class UT {
|
|
|
30310
30307
|
apiEndpoint;
|
|
30311
30308
|
requestTimeout = FT;
|
|
30312
30309
|
sentenceCache = /* @__PURE__ */ new Map();
|
|
30313
|
-
constructor(e = "api/ai/process") {
|
|
30314
|
-
this.apiEndpoint = "https://api.cteditor.com
|
|
30310
|
+
constructor(e = "/api/ai/process") {
|
|
30311
|
+
this.apiEndpoint = "https://api.cteditor.com" + e;
|
|
30315
30312
|
}
|
|
30316
30313
|
isSentenceCached(e) {
|
|
30317
30314
|
const r = Si(e), o = this.sentenceCache.get(r);
|
|
@@ -30407,12 +30404,12 @@ function VT({
|
|
|
30407
30404
|
onSelectOption: e,
|
|
30408
30405
|
minMatchLength: r = 2,
|
|
30409
30406
|
maxSuggestions: o = 10,
|
|
30410
|
-
apiEndpoint: n = "api/grammar/process",
|
|
30407
|
+
apiEndpoint: n = "/api/grammar/process",
|
|
30411
30408
|
enableAI: s = !0,
|
|
30412
30409
|
debounceDelay: a = 800
|
|
30413
30410
|
}) {
|
|
30414
30411
|
const [c] = Ie(), { toolbarState: d, updateToolbarState: l } = ri(), h = ne([]), u = ne(new UT(n)), p = ne(), f = ne(""), m = ne(null), b = ne(null), g = ne(null), v = ne(!1), x = ne(null), _ = ne(null), S = ne(() => {
|
|
30415
|
-
}), k = ne(0), w = ne(/* @__PURE__ */ new Set()), [N, E] = T(null), [M,
|
|
30412
|
+
}), k = ne(0), w = ne(/* @__PURE__ */ new Set()), [N, E] = T(null), [M, D] = T([]), [z, $] = T(0), [F, I] = T(
|
|
30416
30413
|
null
|
|
30417
30414
|
), [U, H] = T([]), [j, W] = T(/* @__PURE__ */ new Map()), [A, re] = T(
|
|
30418
30415
|
/* @__PURE__ */ new Set()
|
|
@@ -30430,7 +30427,7 @@ function VT({
|
|
|
30430
30427
|
Z.length >= r && P.add(Z);
|
|
30431
30428
|
});
|
|
30432
30429
|
}), Array.from(P);
|
|
30433
|
-
}, [c, r]),
|
|
30430
|
+
}, [c, r]), O = V(
|
|
30434
30431
|
(P) => !P || P.length < r ? [] : R().filter(
|
|
30435
30432
|
(G) => G.toLowerCase().startsWith(P.toLowerCase()) && G.toLowerCase() !== P.toLowerCase()
|
|
30436
30433
|
).slice(0, o).map((G) => ({
|
|
@@ -30494,7 +30491,7 @@ function VT({
|
|
|
30494
30491
|
}
|
|
30495
30492
|
}, [c, d, s, o, le]), Y = V(
|
|
30496
30493
|
(P) => {
|
|
30497
|
-
|
|
30494
|
+
D((G) => G.filter((ie) => ie.key !== P.key)), $(0), v.current = !0, c.update(() => {
|
|
30498
30495
|
const G = ue();
|
|
30499
30496
|
if (!pe(G)) return;
|
|
30500
30497
|
const ie = G.anchor, Z = ie.getNode(), X = Z.getTextContent(), ee = ie.offset;
|
|
@@ -30507,7 +30504,7 @@ function VT({
|
|
|
30507
30504
|
const Se = te + P.displayText.length;
|
|
30508
30505
|
G.anchor.set(Z.getKey(), Se, "text"), G.focus.set(Z.getKey(), Se, "text");
|
|
30509
30506
|
}
|
|
30510
|
-
}), f.current = "", E(null),
|
|
30507
|
+
}), f.current = "", E(null), D([]), e?.(P, null, () => E(null)), setTimeout(Q, 500);
|
|
30511
30508
|
},
|
|
30512
30509
|
[c, e, Q]
|
|
30513
30510
|
), de = V(
|
|
@@ -30610,12 +30607,12 @@ function VT({
|
|
|
30610
30607
|
q(() => {
|
|
30611
30608
|
f.current = "";
|
|
30612
30609
|
}, []), q(() => {
|
|
30613
|
-
d.isAutocompleteEnabled ? Q() : (E(null),
|
|
30610
|
+
d.isAutocompleteEnabled ? Q() : (E(null), D([]), H([]), W(/* @__PURE__ */ new Map()), re(/* @__PURE__ */ new Set()));
|
|
30614
30611
|
}, [d.isAutocompleteEnabled]), q(() => (g.current && clearTimeout(g.current), N && !v.current ? g.current = window.setTimeout(() => {
|
|
30615
|
-
O(
|
|
30616
|
-
}, a) : (
|
|
30612
|
+
D(O(N)), $(0), t?.(N);
|
|
30613
|
+
}, a) : (D([]), $(0), t?.(null)), () => {
|
|
30617
30614
|
g.current && clearTimeout(g.current);
|
|
30618
|
-
}), [N,
|
|
30615
|
+
}), [N, O, t, a]), q(() => {
|
|
30619
30616
|
if (!N || M.length === 0) return;
|
|
30620
30617
|
const P = c.registerCommand(
|
|
30621
30618
|
Bv,
|
|
@@ -30722,7 +30719,7 @@ function VT({
|
|
|
30722
30719
|
}, [U, c]), q(() => {
|
|
30723
30720
|
const P = (G) => {
|
|
30724
30721
|
const ie = G.target;
|
|
30725
|
-
m.current?.contains(ie) || document.querySelector(".grammar-tooltip-card")?.contains(ie) || (E(null),
|
|
30722
|
+
m.current?.contains(ie) || document.querySelector(".grammar-tooltip-card")?.contains(ie) || (E(null), D([]), L(null));
|
|
30726
30723
|
};
|
|
30727
30724
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
30728
30725
|
}, []);
|
|
@@ -31294,9 +31291,9 @@ function JT({
|
|
|
31294
31291
|
`[data-lexical-node-key="${r}"]`
|
|
31295
31292
|
);
|
|
31296
31293
|
if (E) {
|
|
31297
|
-
const M = E.getBoundingClientRect(),
|
|
31298
|
-
let I = M.top -
|
|
31299
|
-
U < 10 && (U = 10), U +
|
|
31294
|
+
const M = E.getBoundingClientRect(), D = w.getBoundingClientRect(), z = e.getBoundingClientRect(), $ = M.left + M.width / 2, F = D.width / 2;
|
|
31295
|
+
let I = M.top - D.height - 15, U = $ - F;
|
|
31296
|
+
U < 10 && (U = 10), U + D.width > window.innerWidth - 10 && (U = window.innerWidth - D.width - 10), I < 10 && (I = M.bottom + 15), I -= z.top, U -= z.left, w.style.opacity = "1", w.style.transform = `translate(${U}px, ${I}px)`, u || (w.style.display = "flex", w.style.visibility = "visible", w.style.zIndex = "9999", p(!0));
|
|
31300
31297
|
} else
|
|
31301
31298
|
w.style.opacity = "0", w.style.visibility = "hidden";
|
|
31302
31299
|
}, [t, r, e, u]), m = V(() => {
|
|
@@ -31741,11 +31738,11 @@ function i8({
|
|
|
31741
31738
|
const N = a.current, E = za(t._window), M = document.activeElement;
|
|
31742
31739
|
if (N === null)
|
|
31743
31740
|
return;
|
|
31744
|
-
const
|
|
31745
|
-
if (w !== null && E !== null &&
|
|
31741
|
+
const D = t.getRootElement(), z = n;
|
|
31742
|
+
if (w !== null && E !== null && D !== null && D.contains(E.anchorNode) && t.isEditable()) {
|
|
31746
31743
|
const $ = E.focusNode?.parentElement?.getBoundingClientRect();
|
|
31747
31744
|
$ && ($.y += 40, kf($, N, o)), v(w);
|
|
31748
|
-
} else (!M || M.className !== "link-input") && (z || (
|
|
31745
|
+
} else (!M || M.className !== "link-input") && (z || (D !== null && kf(null, N, o), v(null), s(!1), b(!1), l(""), u("")));
|
|
31749
31746
|
return !0;
|
|
31750
31747
|
}, [o, t, s, n, d]);
|
|
31751
31748
|
q(() => {
|
|
@@ -31804,9 +31801,9 @@ function i8({
|
|
|
31804
31801
|
});
|
|
31805
31802
|
M.replace(z, !0);
|
|
31806
31803
|
}
|
|
31807
|
-
const
|
|
31808
|
-
|
|
31809
|
-
|
|
31804
|
+
const D = t.getRootElement();
|
|
31805
|
+
D && (D.blur(), setTimeout(() => {
|
|
31806
|
+
D.focus();
|
|
31810
31807
|
}, 0));
|
|
31811
31808
|
}
|
|
31812
31809
|
}), f("https://"), s(!1), b(!1));
|
|
@@ -32475,7 +32472,7 @@ function g8({
|
|
|
32475
32472
|
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", M);
|
|
32476
32473
|
};
|
|
32477
32474
|
}, [x]);
|
|
32478
|
-
const
|
|
32475
|
+
const D = V(() => {
|
|
32479
32476
|
const F = ue(), I = x.current, U = za(t._window);
|
|
32480
32477
|
if (I === null)
|
|
32481
32478
|
return;
|
|
@@ -32493,26 +32490,26 @@ function g8({
|
|
|
32493
32490
|
q(() => {
|
|
32494
32491
|
const F = e.parentElement, I = () => {
|
|
32495
32492
|
t.getEditorState().read(() => {
|
|
32496
|
-
|
|
32493
|
+
D();
|
|
32497
32494
|
});
|
|
32498
32495
|
};
|
|
32499
32496
|
return window.addEventListener("resize", I), F && F.addEventListener("scroll", I), () => {
|
|
32500
32497
|
window.removeEventListener("resize", I), F && F.removeEventListener("scroll", I);
|
|
32501
32498
|
};
|
|
32502
|
-
}, [t,
|
|
32503
|
-
|
|
32499
|
+
}, [t, D, e]), q(() => (t.getEditorState().read(() => {
|
|
32500
|
+
D();
|
|
32504
32501
|
}), Fr(
|
|
32505
32502
|
t.registerUpdateListener(({ editorState: F }) => {
|
|
32506
32503
|
F.read(() => {
|
|
32507
|
-
|
|
32504
|
+
D();
|
|
32508
32505
|
});
|
|
32509
32506
|
}),
|
|
32510
32507
|
t.registerCommand(
|
|
32511
32508
|
Wn,
|
|
32512
|
-
() => (
|
|
32509
|
+
() => (D(), !1),
|
|
32513
32510
|
wt
|
|
32514
32511
|
)
|
|
32515
|
-
)), [t,
|
|
32512
|
+
)), [t, D]);
|
|
32516
32513
|
const z = "cteditor-border-0 hover:cteditor-bg-foreground/10 cteditor-size-6 cteditor-flex cteditor-bg-none cteditor-rounded-sm cteditor-p-[2px] cteditor-cursor-pointer cteditor-align-middle cteditor-flex cteditor-items-center cteditor-justify-center disabled:cursor-not-allowed hover:cteditor-bg-accent ", $ = ki.find((F) => F.payload === m) ?? ki[0];
|
|
32517
32514
|
return /* @__PURE__ */ i(tt, { delayDuration: 200, children: /* @__PURE__ */ i(
|
|
32518
32515
|
"div",
|
|
@@ -32862,7 +32859,7 @@ function g8({
|
|
|
32862
32859
|
) });
|
|
32863
32860
|
}
|
|
32864
32861
|
function y8(t, e, r, o) {
|
|
32865
|
-
const [n, s] = T(!1), [a, c] = T(!1), [d, l] = T(!1), [h, u] = T(!1), [p, f] = T(!1), [m, b] = T(!1), [g, v] = T(!1), [x, _] = T(!1), [S, k] = T(!1), [w, N] = T(!1), [E, M] = T(!1), [
|
|
32862
|
+
const [n, s] = T(!1), [a, c] = T(!1), [d, l] = T(!1), [h, u] = T(!1), [p, f] = T(!1), [m, b] = T(!1), [g, v] = T(!1), [x, _] = T(!1), [S, k] = T(!1), [w, N] = T(!1), [E, M] = T(!1), [D, z] = T(!1), [$, F] = T(!1), [I, U] = T(null), [H, j] = T("left"), W = V(() => {
|
|
32866
32863
|
t.getEditorState().read(() => {
|
|
32867
32864
|
if (t.isComposing())
|
|
32868
32865
|
return;
|
|
@@ -32886,7 +32883,7 @@ function y8(t, e, r, o) {
|
|
|
32886
32883
|
let B = null;
|
|
32887
32884
|
Ft(se) && (B = Lt(
|
|
32888
32885
|
he,
|
|
32889
|
-
(
|
|
32886
|
+
(O) => tr(O) && !O.isInline()
|
|
32890
32887
|
));
|
|
32891
32888
|
const L = B !== null && tr(B) ? B.getFormatType() : tr(he) ? he.getFormatType() : se !== null && tr(se) ? se.getFormatType() : "left";
|
|
32892
32889
|
j(L), !Jv(A.anchor.getNode()) && A.getTextContent() !== "" ? s(pt(he) || nn(he)) : s(!1);
|
|
@@ -32922,7 +32919,7 @@ function y8(t, e, r, o) {
|
|
|
32922
32919
|
isSubscript: w,
|
|
32923
32920
|
isSuperscript: E,
|
|
32924
32921
|
isUnderline: p,
|
|
32925
|
-
isCode:
|
|
32922
|
+
isCode: D,
|
|
32926
32923
|
isHighlight: $,
|
|
32927
32924
|
elementFormat: H,
|
|
32928
32925
|
setIsLinkEditMode: r,
|
|
@@ -34174,7 +34171,7 @@ function K8({
|
|
|
34174
34171
|
);
|
|
34175
34172
|
}
|
|
34176
34173
|
function Z8() {
|
|
34177
|
-
const [t] = Ie(), { toolbarState: e, updateToolbarState: r } = ri(), { isHtmlView: o, setIsHtmlView: n } = Un(), { apiKey: s } = Cr(), [a, c] = T(null), [d, l] = T(""), h = ne(null), u = ne(null), [p, f] = T({ top: 0, left: 0 }), [m, b] = T(!1), g = ne(null), [v, x] = T(!1), [_, S] = T(null), [k, w] = T(!1), [N, E] = T(!1), [M,
|
|
34174
|
+
const [t] = Ie(), { toolbarState: e, updateToolbarState: r } = ri(), { isHtmlView: o, setIsHtmlView: n } = Un(), { apiKey: s } = Cr(), [a, c] = T(null), [d, l] = T(""), h = ne(null), u = ne(null), [p, f] = T({ top: 0, left: 0 }), [m, b] = T(!1), g = ne(null), [v, x] = T(!1), [_, S] = T(null), [k, w] = T(!1), [N, E] = T(!1), [M, D] = T(!1), [z, $] = T(!1), [F, I] = T(!1), [U, H] = T(""), j = im("/", { minLength: 0 });
|
|
34178
34175
|
q(() => {
|
|
34179
34176
|
const Fe = t.getRootElement();
|
|
34180
34177
|
if (Fe) {
|
|
@@ -34222,7 +34219,7 @@ function Z8() {
|
|
|
34222
34219
|
const Fe = ue();
|
|
34223
34220
|
pe(Fe) && Fe.insertNodes([an()]);
|
|
34224
34221
|
});
|
|
34225
|
-
}, [W]),
|
|
34222
|
+
}, [W]), O = V(() => {
|
|
34226
34223
|
W(() => {
|
|
34227
34224
|
const Fe = ue();
|
|
34228
34225
|
if (pe(Fe)) {
|
|
@@ -34270,7 +34267,7 @@ function Z8() {
|
|
|
34270
34267
|
}, [t]), te = V(() => {
|
|
34271
34268
|
t.dispatchCommand(Mn, void 0);
|
|
34272
34269
|
}, [t]), ye = V(() => {
|
|
34273
|
-
|
|
34270
|
+
D(!0);
|
|
34274
34271
|
}, []), Se = V(() => {
|
|
34275
34272
|
$(!0);
|
|
34276
34273
|
}, []), $e = V(
|
|
@@ -34305,7 +34302,7 @@ function Z8() {
|
|
|
34305
34302
|
new De("Heading 5", () => re("h5")),
|
|
34306
34303
|
new De("Heading 6", () => re("h6")),
|
|
34307
34304
|
new De("Quote", R),
|
|
34308
|
-
new De("Code block",
|
|
34305
|
+
new De("Code block", O),
|
|
34309
34306
|
new De("Horizontal line", Q),
|
|
34310
34307
|
// Lists
|
|
34311
34308
|
new De("__label__LISTS", () => {
|
|
@@ -34364,7 +34361,7 @@ function Z8() {
|
|
|
34364
34361
|
A,
|
|
34365
34362
|
re,
|
|
34366
34363
|
R,
|
|
34367
|
-
|
|
34364
|
+
O,
|
|
34368
34365
|
Q,
|
|
34369
34366
|
le,
|
|
34370
34367
|
he,
|
|
@@ -34530,7 +34527,7 @@ function Z8() {
|
|
|
34530
34527
|
pb,
|
|
34531
34528
|
{
|
|
34532
34529
|
open: M,
|
|
34533
|
-
onOpenChange:
|
|
34530
|
+
onOpenChange: D,
|
|
34534
34531
|
onInsert: $e
|
|
34535
34532
|
}
|
|
34536
34533
|
),
|
|
@@ -34923,7 +34920,7 @@ function n7({
|
|
|
34923
34920
|
const [l] = Ie(), h = ne(null), [u, p] = T(e), [f, m] = T({
|
|
34924
34921
|
columns: 1,
|
|
34925
34922
|
rows: 1
|
|
34926
|
-
}), [b, g] = T(null), [v, x] = T(!1), [_, S] = T(!1), [k, w] = T(""), [N, E] = T(""), [M,
|
|
34923
|
+
}), [b, g] = T(null), [v, x] = T(!1), [_, S] = T(!1), [k, w] = T(""), [N, E] = T(""), [M, D] = T(""), [z, $] = T(!1), [F, I] = T(!0), [U, H] = T("#bbb"), [j, W] = T("thin");
|
|
34927
34924
|
q(() => {
|
|
34928
34925
|
p(e);
|
|
34929
34926
|
}, [e]), q(() => l.registerMutationListener(
|
|
@@ -35229,7 +35226,7 @@ function n7({
|
|
|
35229
35226
|
}
|
|
35230
35227
|
});
|
|
35231
35228
|
});
|
|
35232
|
-
}, [l, u, A, t]),
|
|
35229
|
+
}, [l, u, A, t]), O = V(() => {
|
|
35233
35230
|
const K = [];
|
|
35234
35231
|
l.update(() => {
|
|
35235
35232
|
const P = Ct(u), G = Nl(u), ie = P.getChildren(), Z = Math.max(
|
|
@@ -35635,7 +35632,7 @@ function n7({
|
|
|
35635
35632
|
{
|
|
35636
35633
|
color: M,
|
|
35637
35634
|
onApply: (G) => {
|
|
35638
|
-
|
|
35635
|
+
D(G), Y(G), P(), r(!1);
|
|
35639
35636
|
}
|
|
35640
35637
|
}
|
|
35641
35638
|
),
|
|
@@ -35791,7 +35788,7 @@ function n7({
|
|
|
35791
35788
|
{
|
|
35792
35789
|
type: "button",
|
|
35793
35790
|
className: be,
|
|
35794
|
-
onClick: () =>
|
|
35791
|
+
onClick: () => O(),
|
|
35795
35792
|
"data-test-id": "table-column-header",
|
|
35796
35793
|
children: /* @__PURE__ */ y("span", { className: "text", children: [
|
|
35797
35794
|
(u.__headerState & mt.COLUMN) === mt.COLUMN ? "Remove" : "Add",
|
|
@@ -35822,15 +35819,15 @@ function i7({
|
|
|
35822
35819
|
const w = r.getRootElement();
|
|
35823
35820
|
let N = null, E = null;
|
|
35824
35821
|
if (pe(x) && w !== null && _ !== null && w.contains(_.anchorNode)) {
|
|
35825
|
-
const
|
|
35822
|
+
const D = qs(
|
|
35826
35823
|
x.anchor.getNode()
|
|
35827
35824
|
);
|
|
35828
|
-
if (
|
|
35829
|
-
|
|
35830
|
-
), E == null || !
|
|
35825
|
+
if (D == null || (E = r.getElementByKey(
|
|
35826
|
+
D.getKey()
|
|
35827
|
+
), E == null || !D.isAttached()) || !w.contains(_.focusNode) || D.getTextContentSize() > 0 && !a)
|
|
35831
35828
|
return k();
|
|
35832
35829
|
const $ = Ct(
|
|
35833
|
-
|
|
35830
|
+
D
|
|
35834
35831
|
), F = Nn(
|
|
35835
35832
|
$,
|
|
35836
35833
|
r.getElementByKey($.getKey())
|
|
@@ -35838,23 +35835,23 @@ function i7({
|
|
|
35838
35835
|
Ni(
|
|
35839
35836
|
F !== null,
|
|
35840
35837
|
"TableActionMenu: Expected to find tableElement in DOM"
|
|
35841
|
-
), N = Gs(F), p(
|
|
35838
|
+
), N = Gs(F), p(D);
|
|
35842
35839
|
} else if (Tr(x)) {
|
|
35843
|
-
const
|
|
35840
|
+
const D = qs(
|
|
35844
35841
|
x.anchor.getNode()
|
|
35845
35842
|
);
|
|
35846
35843
|
Ni(
|
|
35847
|
-
We(
|
|
35844
|
+
We(D),
|
|
35848
35845
|
"TableSelection anchorNode must be a TableCellNode"
|
|
35849
35846
|
);
|
|
35850
|
-
const z = Ct(
|
|
35847
|
+
const z = Ct(D), $ = Nn(
|
|
35851
35848
|
z,
|
|
35852
35849
|
r.getElementByKey(z.getKey())
|
|
35853
35850
|
);
|
|
35854
35851
|
Ni(
|
|
35855
35852
|
$ !== null,
|
|
35856
35853
|
"TableActionMenu: Expected to find tableElement in DOM"
|
|
35857
|
-
), N = Gs($), E = r.getElementByKey(
|
|
35854
|
+
), N = Gs($), E = r.getElementByKey(D.getKey());
|
|
35858
35855
|
} else if (!S)
|
|
35859
35856
|
return k();
|
|
35860
35857
|
if (N === null || E === null)
|
|
@@ -35867,9 +35864,9 @@ function i7({
|
|
|
35867
35864
|
"table-cell-action-button-container--inactive",
|
|
35868
35865
|
!M
|
|
35869
35866
|
), M) {
|
|
35870
|
-
const
|
|
35867
|
+
const D = E.getBoundingClientRect(), z = t.getBoundingClientRect();
|
|
35871
35868
|
v.classList.add("table-cell-action-button-container--active"), v.classList.remove("table-cell-action-button-container--inactive");
|
|
35872
|
-
const $ = 4, F = 20, I =
|
|
35869
|
+
const $ = 4, F = 20, I = D.top - z.top + $, U = D.right - z.left - F - $;
|
|
35873
35870
|
v.style.top = `${I}px`, v.style.left = `${U}px`;
|
|
35874
35871
|
}
|
|
35875
35872
|
}, [r, t, a]);
|
|
@@ -35892,10 +35889,10 @@ function i7({
|
|
|
35892
35889
|
const M = E.target;
|
|
35893
35890
|
if (!M || M.classList.contains("TableNode__resizeHandle") || M.classList.contains("table-cell-action-button") || M.closest(".table-cell-action-button-container") || M.closest(".TableNode__resizeHandle"))
|
|
35894
35891
|
return;
|
|
35895
|
-
const
|
|
35896
|
-
if (!
|
|
35892
|
+
const D = M.closest("td, th");
|
|
35893
|
+
if (!D)
|
|
35897
35894
|
return;
|
|
35898
|
-
const z =
|
|
35895
|
+
const z = D.getBoundingClientRect(), $ = E.clientX, F = E.clientY, I = 3;
|
|
35899
35896
|
if ($ < z.left + I || $ > z.right - I || F < z.top + I || F > z.bottom - I)
|
|
35900
35897
|
return;
|
|
35901
35898
|
E.preventDefault(), E.stopPropagation();
|
|
@@ -35906,7 +35903,7 @@ function i7({
|
|
|
35906
35903
|
try {
|
|
35907
35904
|
const j = r._editorState._nodeMap;
|
|
35908
35905
|
for (const [W, A] of j)
|
|
35909
|
-
if (We(A) && r.getElementByKey(W) ===
|
|
35906
|
+
if (We(A) && r.getElementByKey(W) === D) {
|
|
35910
35907
|
U = A, H = U.isAttached();
|
|
35911
35908
|
break;
|
|
35912
35909
|
}
|
|
@@ -36029,9 +36026,9 @@ function c7({ editor: t }) {
|
|
|
36029
36026
|
y: oe.clientY
|
|
36030
36027
|
};
|
|
36031
36028
|
a(B);
|
|
36032
|
-
const L = El(oe.target), { x: R, y:
|
|
36029
|
+
const L = El(oe.target), { x: R, y: O } = n.current;
|
|
36033
36030
|
if (N(u)) {
|
|
36034
|
-
const J = (B.y -
|
|
36031
|
+
const J = (B.y - O) / L, Q = Math.max(v + J, Sl);
|
|
36035
36032
|
m(Q), S.current?.(Q);
|
|
36036
36033
|
} else {
|
|
36037
36034
|
const J = (B.x - R) / L, Q = Math.max(v + J, di);
|
|
@@ -36047,13 +36044,13 @@ function c7({ editor: t }) {
|
|
|
36047
36044
|
const L = qr(B.elem);
|
|
36048
36045
|
if (!L)
|
|
36049
36046
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
36050
|
-
const R = Ct(L),
|
|
36047
|
+
const R = Ct(L), O = Nn(
|
|
36051
36048
|
R,
|
|
36052
36049
|
t.getElementByKey(R.getKey())
|
|
36053
36050
|
);
|
|
36054
|
-
if (!
|
|
36051
|
+
if (!O)
|
|
36055
36052
|
throw new Error("TableCellResizer: Table element not found.");
|
|
36056
|
-
e.current = se, o.current =
|
|
36053
|
+
e.current = se, o.current = O.getBoundingClientRect(), d(B);
|
|
36057
36054
|
},
|
|
36058
36055
|
{ editor: t }
|
|
36059
36056
|
) : B == null && k();
|
|
@@ -36105,7 +36102,7 @@ function c7({ editor: t }) {
|
|
|
36105
36102
|
},
|
|
36106
36103
|
{ tag: "skip-scroll-into-view" }
|
|
36107
36104
|
);
|
|
36108
|
-
}, [c, t]),
|
|
36105
|
+
}, [c, t]), D = (A, re) => re.getElementByKey(A.getKey())?.clientHeight, z = (A, re) => {
|
|
36109
36106
|
for (let le = 0; le < re.length; le++)
|
|
36110
36107
|
for (let he = 0; he < re[le].length; he++)
|
|
36111
36108
|
if (re[le][he].cell === A)
|
|
@@ -36127,7 +36124,7 @@ function c7({ editor: t }) {
|
|
|
36127
36124
|
const se = le.getColWidths();
|
|
36128
36125
|
if (!se || !t.getElementByKey(le.getKey()))
|
|
36129
36126
|
return;
|
|
36130
|
-
const L = c.elem.getBoundingClientRect(), R = Math.max(A, di),
|
|
36127
|
+
const L = c.elem.getBoundingClientRect(), R = Math.max(A, di), O = L.width, J = se[oe], Q = R / O, Y = J * Q, de = [...se], Me = Y - J;
|
|
36131
36128
|
de[oe] = Y;
|
|
36132
36129
|
let Ne = oe + 1;
|
|
36133
36130
|
for (; Ne < se.length; ) {
|
|
@@ -36178,9 +36175,9 @@ function c7({ editor: t }) {
|
|
|
36178
36175
|
for (let L = 0; L < le.length; L++) {
|
|
36179
36176
|
const R = le[L][he];
|
|
36180
36177
|
if (R && R.cell) {
|
|
36181
|
-
const
|
|
36182
|
-
if (
|
|
36183
|
-
const J =
|
|
36178
|
+
const O = t.getElementByKey(R.cell.getKey());
|
|
36179
|
+
if (O) {
|
|
36180
|
+
const J = O.scrollWidth + 16;
|
|
36184
36181
|
se = Math.max(se, J);
|
|
36185
36182
|
}
|
|
36186
36183
|
}
|
|
@@ -36217,7 +36214,7 @@ function c7({ editor: t }) {
|
|
|
36217
36214
|
const R = B.getChildren();
|
|
36218
36215
|
L = Math.min(
|
|
36219
36216
|
...R.map(
|
|
36220
|
-
(
|
|
36217
|
+
(O) => D(O, t) ?? 1 / 0
|
|
36221
36218
|
)
|
|
36222
36219
|
);
|
|
36223
36220
|
}
|
|
@@ -36352,10 +36349,10 @@ const ui = 8, hi = 16, so = 12;
|
|
|
36352
36349
|
function u7({
|
|
36353
36350
|
anchorElem: t
|
|
36354
36351
|
}) {
|
|
36355
|
-
const [e] = Ie(), r = ja(), [o, n] = T(!1), [s, a] = T([]), [c, d] = T([]), [l, h] = T(null), [u, p] = T(null), [f, m] = T({ row: null, column: null }), [b, g] = T(null), [v, x] = T(null), [_, S] = T(null), [k, w] = T(null), [N, E] = T(null), [M,
|
|
36356
|
-
const L = B.getBoundingClientRect(), { left: R, top:
|
|
36352
|
+
const [e] = Ie(), r = ja(), [o, n] = T(!1), [s, a] = T([]), [c, d] = T([]), [l, h] = T(null), [u, p] = T(null), [f, m] = T({ row: null, column: null }), [b, g] = T(null), [v, x] = T(null), [_, S] = T(null), [k, w] = T(null), [N, E] = T(null), [M, D] = T(null), [z, $] = T(null), F = ne(/* @__PURE__ */ new Set()), I = ne(null), U = ne(null), H = V((B) => {
|
|
36353
|
+
const L = B.getBoundingClientRect(), { left: R, top: O, width: J } = t.getBoundingClientRect(), Q = B.querySelectorAll("tr"), Y = [], de = [];
|
|
36357
36354
|
Q.forEach((Ne, xe) => {
|
|
36358
|
-
const we = Ne.getBoundingClientRect().bottom -
|
|
36355
|
+
const we = Ne.getBoundingClientRect().bottom - O - ui / 2, K = L.left - R - 20;
|
|
36359
36356
|
K >= -30 && Y.push({
|
|
36360
36357
|
left: K,
|
|
36361
36358
|
top: we,
|
|
@@ -36369,7 +36366,7 @@ function u7({
|
|
|
36369
36366
|
const Ne = Me.getBoundingClientRect(), xe = L.left - R - 20;
|
|
36370
36367
|
xe >= -30 && Y.push({
|
|
36371
36368
|
left: xe,
|
|
36372
|
-
top: Ne.bottom -
|
|
36369
|
+
top: Ne.bottom - O - ui / 2,
|
|
36373
36370
|
type: "row",
|
|
36374
36371
|
index: Q.length,
|
|
36375
36372
|
isHovered: !1
|
|
@@ -36378,7 +36375,7 @@ function u7({
|
|
|
36378
36375
|
if (Q.length > 0) {
|
|
36379
36376
|
const xe = Q[0].querySelectorAll("td, th");
|
|
36380
36377
|
xe.forEach((we, K) => {
|
|
36381
|
-
const G = we.getBoundingClientRect().right - R - ui / 2, ie = L.top -
|
|
36378
|
+
const G = we.getBoundingClientRect().right - R - ui / 2, ie = L.top - O - 12;
|
|
36382
36379
|
G + hi + 16 <= J + 20 && Y.push({
|
|
36383
36380
|
left: G,
|
|
36384
36381
|
top: ie,
|
|
@@ -36392,7 +36389,7 @@ function u7({
|
|
|
36392
36389
|
const K = be.getBoundingClientRect().right - R - ui / 2;
|
|
36393
36390
|
K + hi + 16 <= J + 20 && Y.push({
|
|
36394
36391
|
left: K,
|
|
36395
|
-
top: L.top -
|
|
36392
|
+
top: L.top - O - 12,
|
|
36396
36393
|
type: "column",
|
|
36397
36394
|
index: xe.length,
|
|
36398
36395
|
isHovered: !1
|
|
@@ -36400,7 +36397,7 @@ function u7({
|
|
|
36400
36397
|
}
|
|
36401
36398
|
}
|
|
36402
36399
|
Q.forEach((Ne, xe) => {
|
|
36403
|
-
const be = Ne.getBoundingClientRect(), we = be.top -
|
|
36400
|
+
const be = Ne.getBoundingClientRect(), we = be.top - O + (be.height - so) / 2, K = L.left - R - so / 2;
|
|
36404
36401
|
K >= -22 && de.push({
|
|
36405
36402
|
left: K,
|
|
36406
36403
|
top: we,
|
|
@@ -36409,7 +36406,7 @@ function u7({
|
|
|
36409
36406
|
isHovered: !1
|
|
36410
36407
|
});
|
|
36411
36408
|
}), Q.length > 0 && Q[0].querySelectorAll("td, th").forEach((be, we) => {
|
|
36412
|
-
const K = be.getBoundingClientRect(), P = K.left - R + (K.width - so) / 2, G = L.top -
|
|
36409
|
+
const K = be.getBoundingClientRect(), P = K.left - R + (K.width - so) / 2, G = L.top - O - so / 2;
|
|
36413
36410
|
P + so + 10 <= J + 20 && de.push({
|
|
36414
36411
|
left: P,
|
|
36415
36412
|
top: G,
|
|
@@ -36448,16 +36445,16 @@ function u7({
|
|
|
36448
36445
|
), W = (B, L) => {
|
|
36449
36446
|
U.current && (e.update(() => {
|
|
36450
36447
|
const R = e.getEditorState().read(() => {
|
|
36451
|
-
const
|
|
36452
|
-
if (!
|
|
36453
|
-
const J = e.getEditorState()._nodeMap.get(
|
|
36448
|
+
const O = U.current;
|
|
36449
|
+
if (!O) return null;
|
|
36450
|
+
const J = e.getEditorState()._nodeMap.get(O);
|
|
36454
36451
|
return Gr(J) ? J : null;
|
|
36455
36452
|
});
|
|
36456
36453
|
if (R)
|
|
36457
36454
|
if (B === "row") {
|
|
36458
|
-
const
|
|
36459
|
-
if (J >= 0 && J <
|
|
36460
|
-
const Q =
|
|
36455
|
+
const O = R.getChildren(), J = L - 1;
|
|
36456
|
+
if (J >= 0 && J < O.length) {
|
|
36457
|
+
const Q = O[J];
|
|
36461
36458
|
if (Q) {
|
|
36462
36459
|
const Y = Q.getChildren();
|
|
36463
36460
|
if (Y.length > 0) {
|
|
@@ -36473,9 +36470,9 @@ function u7({
|
|
|
36473
36470
|
}
|
|
36474
36471
|
}
|
|
36475
36472
|
} else {
|
|
36476
|
-
const
|
|
36477
|
-
if (
|
|
36478
|
-
const Q =
|
|
36473
|
+
const O = R.getChildren();
|
|
36474
|
+
if (O.length > 0) {
|
|
36475
|
+
const Q = O[0].getChildren(), Y = L - 1;
|
|
36479
36476
|
if (Y >= 0 && Y < Q.length) {
|
|
36480
36477
|
const de = Q[Y];
|
|
36481
36478
|
if (de && (de.selectEnd(), Wf(!0), (Q[0].getHeaderStyles() & mt.COLUMN) === mt.COLUMN)) {
|
|
@@ -36514,9 +36511,9 @@ function u7({
|
|
|
36514
36511
|
const { tableNode: R } = Fc(U.current);
|
|
36515
36512
|
if (!(!R || !Gr(R)))
|
|
36516
36513
|
if (B === "row") {
|
|
36517
|
-
const
|
|
36518
|
-
if (L >= 0 && L <
|
|
36519
|
-
const Q =
|
|
36514
|
+
const O = R.getChildren();
|
|
36515
|
+
if (L >= 0 && L < O.length) {
|
|
36516
|
+
const Q = O[L].getChildren();
|
|
36520
36517
|
if (Q.length > 0) {
|
|
36521
36518
|
const Y = Q[0], de = Q[Q.length - 1];
|
|
36522
36519
|
Y.selectEnd();
|
|
@@ -36538,11 +36535,11 @@ function u7({
|
|
|
36538
36535
|
}
|
|
36539
36536
|
}
|
|
36540
36537
|
} else {
|
|
36541
|
-
const
|
|
36542
|
-
if (
|
|
36543
|
-
const Q =
|
|
36538
|
+
const O = R.getChildren();
|
|
36539
|
+
if (O.length > 0) {
|
|
36540
|
+
const Q = O[0].getChildren();
|
|
36544
36541
|
if (L >= 0 && L < Q.length) {
|
|
36545
|
-
const Y = Q[L], Ne =
|
|
36542
|
+
const Y = Q[L], Ne = O[O.length - 1].getChildren()[L];
|
|
36546
36543
|
if (Y && Ne) {
|
|
36547
36544
|
Y.selectEnd();
|
|
36548
36545
|
const xe = Y.select();
|
|
@@ -36571,28 +36568,28 @@ function u7({
|
|
|
36571
36568
|
}, 0), setTimeout(() => {
|
|
36572
36569
|
L === "row" ? w(R) : E(R);
|
|
36573
36570
|
}, 0), B.dataTransfer.effectAllowed = "move", B.dataTransfer.dropEffect = "move", B.dataTransfer.setData("application/x-table-dnd", JSON.stringify({ type: L, index: R })), I.current) {
|
|
36574
|
-
const
|
|
36575
|
-
|
|
36576
|
-
document.body.contains(
|
|
36571
|
+
const O = document.createElement("div");
|
|
36572
|
+
O.style.position = "absolute", O.style.top = "-1000px", O.style.padding = "8px 16px", O.style.backgroundColor = "#3b82f6", O.style.color = "white", O.style.borderRadius = "6px", O.style.fontSize = "14px", O.style.fontWeight = "400", O.style.boxShadow = "0 4px 12px rgba(0,0,0,0.3)", O.style.pointerEvents = "none", O.textContent = `${L === "row" ? "↕" : "↔"} Moving ${L} ${R + 1}`, document.body.appendChild(O), B.dataTransfer.setDragImage(O, O.offsetWidth / 2, O.offsetHeight / 2), setTimeout(() => {
|
|
36573
|
+
document.body.contains(O) && document.body.removeChild(O);
|
|
36577
36574
|
}, 0);
|
|
36578
36575
|
}
|
|
36579
36576
|
}, le = (B, L, R) => {
|
|
36580
|
-
if (B.preventDefault(), B.dataTransfer.dropEffect = "move", !(!v || v.type !== L) && (v.targetIndex !== R && x((
|
|
36581
|
-
const
|
|
36577
|
+
if (B.preventDefault(), B.dataTransfer.dropEffect = "move", !(!v || v.type !== L) && (v.targetIndex !== R && x((O) => O ? { ...O, targetIndex: R } : null), L === "row" ? (D(R), $(null)) : ($(R), D(null)), I.current)) {
|
|
36578
|
+
const O = I.current.getBoundingClientRect(), { left: J, top: Q } = t.getBoundingClientRect();
|
|
36582
36579
|
if (L === "row") {
|
|
36583
36580
|
const Y = I.current.querySelectorAll("tr");
|
|
36584
36581
|
if (R >= 0 && R < Y.length) {
|
|
36585
36582
|
const Me = Y[R].getBoundingClientRect();
|
|
36586
36583
|
v.sourceIndex < R ? S({
|
|
36587
36584
|
top: Me.bottom - Q,
|
|
36588
|
-
left:
|
|
36589
|
-
width:
|
|
36585
|
+
left: O.left - J,
|
|
36586
|
+
width: O.width,
|
|
36590
36587
|
height: 3,
|
|
36591
36588
|
isHorizontal: !0
|
|
36592
36589
|
}) : S({
|
|
36593
36590
|
top: Me.top - Q,
|
|
36594
|
-
left:
|
|
36595
|
-
width:
|
|
36591
|
+
left: O.left - J,
|
|
36592
|
+
width: O.width,
|
|
36596
36593
|
height: 3,
|
|
36597
36594
|
isHorizontal: !0
|
|
36598
36595
|
});
|
|
@@ -36604,16 +36601,16 @@ function u7({
|
|
|
36604
36601
|
if (R >= 0 && R < Me.length) {
|
|
36605
36602
|
const xe = Me[R].getBoundingClientRect();
|
|
36606
36603
|
v.sourceIndex < R ? S({
|
|
36607
|
-
top:
|
|
36604
|
+
top: O.top - Q,
|
|
36608
36605
|
left: xe.right - J,
|
|
36609
36606
|
width: 3,
|
|
36610
|
-
height:
|
|
36607
|
+
height: O.height,
|
|
36611
36608
|
isHorizontal: !1
|
|
36612
36609
|
}) : S({
|
|
36613
|
-
top:
|
|
36610
|
+
top: O.top - Q,
|
|
36614
36611
|
left: xe.left - J,
|
|
36615
36612
|
width: 3,
|
|
36616
|
-
height:
|
|
36613
|
+
height: O.height,
|
|
36617
36614
|
isHorizontal: !1
|
|
36618
36615
|
});
|
|
36619
36616
|
}
|
|
@@ -36622,19 +36619,19 @@ function u7({
|
|
|
36622
36619
|
}
|
|
36623
36620
|
}, he = (B) => {
|
|
36624
36621
|
if (B.preventDefault(), !v) {
|
|
36625
|
-
S(null), w(null), E(null),
|
|
36622
|
+
S(null), w(null), E(null), D(null), $(null);
|
|
36626
36623
|
return;
|
|
36627
36624
|
}
|
|
36628
36625
|
const L = v.targetIndex;
|
|
36629
36626
|
if (L === null) {
|
|
36630
|
-
x(null), S(null), w(null), E(null),
|
|
36627
|
+
x(null), S(null), w(null), E(null), D(null), $(null);
|
|
36631
36628
|
return;
|
|
36632
36629
|
}
|
|
36633
36630
|
if (v.sourceIndex === L) {
|
|
36634
|
-
x(null), S(null), w(null), E(null),
|
|
36631
|
+
x(null), S(null), w(null), E(null), D(null), $(null);
|
|
36635
36632
|
return;
|
|
36636
36633
|
}
|
|
36637
|
-
const { type: R, sourceIndex:
|
|
36634
|
+
const { type: R, sourceIndex: O } = v;
|
|
36638
36635
|
let J = [];
|
|
36639
36636
|
if (I.current) {
|
|
36640
36637
|
I.current.getBoundingClientRect().width;
|
|
@@ -36653,12 +36650,12 @@ function u7({
|
|
|
36653
36650
|
const de = Y.getColWidths();
|
|
36654
36651
|
if (R === "row") {
|
|
36655
36652
|
const Ne = Y.getChildren();
|
|
36656
|
-
if (
|
|
36657
|
-
const xe = Ne[
|
|
36653
|
+
if (O >= 0 && O < Ne.length && L >= 0 && L < Ne.length) {
|
|
36654
|
+
const xe = Ne[O];
|
|
36658
36655
|
xe.remove();
|
|
36659
36656
|
const be = Y.getChildren();
|
|
36660
36657
|
let we = null;
|
|
36661
|
-
if (
|
|
36658
|
+
if (O < L) {
|
|
36662
36659
|
const K = L - 1;
|
|
36663
36660
|
if (K >= 0 && K < be.length) {
|
|
36664
36661
|
const P = be[K];
|
|
@@ -36678,11 +36675,11 @@ function u7({
|
|
|
36678
36675
|
} else
|
|
36679
36676
|
Y.getChildren().forEach((xe) => {
|
|
36680
36677
|
const be = xe.getChildren();
|
|
36681
|
-
if (
|
|
36682
|
-
const we = be[
|
|
36678
|
+
if (O >= 0 && O < be.length && L >= 0 && L < be.length) {
|
|
36679
|
+
const we = be[O];
|
|
36683
36680
|
we.remove();
|
|
36684
36681
|
const K = xe.getChildren();
|
|
36685
|
-
if (
|
|
36682
|
+
if (O < L) {
|
|
36686
36683
|
const P = L - 1;
|
|
36687
36684
|
P >= 0 && P < K.length ? K[P].insertAfter(we) : xe.append(we);
|
|
36688
36685
|
} else
|
|
@@ -36694,12 +36691,12 @@ function u7({
|
|
|
36694
36691
|
} catch (Q) {
|
|
36695
36692
|
console.error("[TABLE-DND] ERROR during swap:", Q);
|
|
36696
36693
|
}
|
|
36697
|
-
}), x(null), S(null), w(null), E(null),
|
|
36694
|
+
}), x(null), S(null), w(null), E(null), D(null), $(null), setTimeout(() => {
|
|
36698
36695
|
I.current && H(I.current);
|
|
36699
36696
|
}, 50);
|
|
36700
36697
|
}, oe = (B) => {
|
|
36701
36698
|
setTimeout(() => {
|
|
36702
|
-
x(null), S(null), w(null), E(null),
|
|
36699
|
+
x(null), S(null), w(null), E(null), D(null), $(null);
|
|
36703
36700
|
}, 50);
|
|
36704
36701
|
}, se = Qr(() => new ResizeObserver(() => {
|
|
36705
36702
|
I.current && H(I.current);
|
|
@@ -36728,7 +36725,7 @@ function u7({
|
|
|
36728
36725
|
return;
|
|
36729
36726
|
}
|
|
36730
36727
|
const R = L.getNodes();
|
|
36731
|
-
let
|
|
36728
|
+
let O = !1;
|
|
36732
36729
|
for (const J of R) {
|
|
36733
36730
|
const Q = Lt(J, (Y) => We(Y));
|
|
36734
36731
|
if (Q && We(Q)) {
|
|
@@ -36738,12 +36735,12 @@ function u7({
|
|
|
36738
36735
|
Y,
|
|
36739
36736
|
e.getElementByKey(Y.getKey())
|
|
36740
36737
|
);
|
|
36741
|
-
de && (I.current = de, U.current = Y.getKey(), g(de), H(de),
|
|
36738
|
+
de && (I.current = de, U.current = Y.getKey(), g(de), H(de), O = !0);
|
|
36742
36739
|
return;
|
|
36743
36740
|
}
|
|
36744
36741
|
}
|
|
36745
36742
|
}
|
|
36746
|
-
|
|
36743
|
+
O || (a([]), d([]), h(null), I.current = null, U.current = null, g(null));
|
|
36747
36744
|
});
|
|
36748
36745
|
}),
|
|
36749
36746
|
e.registerMutationListener(
|
|
@@ -36752,8 +36749,8 @@ function u7({
|
|
|
36752
36749
|
e.getEditorState().read(
|
|
36753
36750
|
() => {
|
|
36754
36751
|
let L = !1;
|
|
36755
|
-
for (const [R,
|
|
36756
|
-
switch (
|
|
36752
|
+
for (const [R, O] of B)
|
|
36753
|
+
switch (O) {
|
|
36757
36754
|
case "created": {
|
|
36758
36755
|
F.current.add(R), L = !0;
|
|
36759
36756
|
break;
|
|
@@ -36766,8 +36763,8 @@ function u7({
|
|
|
36766
36763
|
if (L) {
|
|
36767
36764
|
se.disconnect();
|
|
36768
36765
|
for (const R of F.current) {
|
|
36769
|
-
const { tableElement:
|
|
36770
|
-
se.observe(
|
|
36766
|
+
const { tableElement: O } = Fc(R);
|
|
36767
|
+
se.observe(O);
|
|
36771
36768
|
}
|
|
36772
36769
|
n(F.current.size > 0);
|
|
36773
36770
|
}
|
|
@@ -36779,7 +36776,7 @@ function u7({
|
|
|
36779
36776
|
)
|
|
36780
36777
|
), [e, se, H]), r ? /* @__PURE__ */ y(_e, { children: [
|
|
36781
36778
|
s.map((B, L) => {
|
|
36782
|
-
const R = l?.type === B.type && l?.index === B.index,
|
|
36779
|
+
const R = l?.type === B.type && l?.index === B.index, O = R ? hi : ui;
|
|
36783
36780
|
return /* @__PURE__ */ i(
|
|
36784
36781
|
"div",
|
|
36785
36782
|
{
|
|
@@ -36801,8 +36798,8 @@ function u7({
|
|
|
36801
36798
|
{
|
|
36802
36799
|
className: `table-insert-dot ${R ? "hovered" : ""}`,
|
|
36803
36800
|
style: {
|
|
36804
|
-
width: `${
|
|
36805
|
-
height: `${
|
|
36801
|
+
width: `${O}px`,
|
|
36802
|
+
height: `${O}px`,
|
|
36806
36803
|
borderRadius: "50%",
|
|
36807
36804
|
backgroundColor: R ? "white" : "transparent",
|
|
36808
36805
|
border: `2px solid ${R ? "#4b5563" : "#9ca3af"}`,
|
|
@@ -36844,7 +36841,7 @@ function u7({
|
|
|
36844
36841
|
);
|
|
36845
36842
|
}),
|
|
36846
36843
|
c.map((B, L) => {
|
|
36847
|
-
const R = u?.type === B.type && u?.index === B.index,
|
|
36844
|
+
const R = u?.type === B.type && u?.index === B.index, O = B.type === "row" && f.row === B.index || B.type === "column" && f.column === B.index, J = R || O, Q = v?.type === B.type && v?.sourceIndex === B.index, Y = v?.type === B.type && v?.targetIndex === B.index;
|
|
36848
36845
|
return /* @__PURE__ */ i(
|
|
36849
36846
|
"div",
|
|
36850
36847
|
{
|
|
@@ -36880,7 +36877,7 @@ function u7({
|
|
|
36880
36877
|
width: "100%",
|
|
36881
36878
|
height: "100%",
|
|
36882
36879
|
borderRadius: "3px",
|
|
36883
|
-
backgroundColor: Y ? "#22c55e" : R ? "#3b82f6" :
|
|
36880
|
+
backgroundColor: Y ? "#22c55e" : R ? "#3b82f6" : O ? "#6b7280" : "transparent",
|
|
36884
36881
|
border: "none",
|
|
36885
36882
|
cursor: Q ? "grabbing" : R ? "grab" : "pointer",
|
|
36886
36883
|
display: "flex",
|
|
@@ -36938,39 +36935,39 @@ function u7({
|
|
|
36938
36935
|
if (B.preventDefault(), B.stopPropagation(), !!v && (B.dataTransfer.dropEffect = "move", !!I.current))
|
|
36939
36936
|
if (v.type === "row") {
|
|
36940
36937
|
const L = I.current.querySelectorAll("tr"), R = B.clientY;
|
|
36941
|
-
let
|
|
36938
|
+
let O = -1;
|
|
36942
36939
|
for (let J = 0; J < L.length; J++) {
|
|
36943
36940
|
const Y = L[J].getBoundingClientRect();
|
|
36944
36941
|
if (R >= Y.top && R <= Y.bottom) {
|
|
36945
|
-
|
|
36942
|
+
O = J;
|
|
36946
36943
|
break;
|
|
36947
36944
|
} else if (R < Y.top && J === 0) {
|
|
36948
|
-
|
|
36945
|
+
O = 0;
|
|
36949
36946
|
break;
|
|
36950
36947
|
} else if (J === L.length - 1 && R > Y.bottom) {
|
|
36951
|
-
|
|
36948
|
+
O = L.length - 1;
|
|
36952
36949
|
break;
|
|
36953
36950
|
}
|
|
36954
36951
|
}
|
|
36955
|
-
if (
|
|
36956
|
-
B.dataTransfer.dropEffect = "none", S(null),
|
|
36952
|
+
if (O === 0 && L[0]?.querySelector("th")) {
|
|
36953
|
+
B.dataTransfer.dropEffect = "none", S(null), D(null);
|
|
36957
36954
|
return;
|
|
36958
36955
|
}
|
|
36959
|
-
|
|
36956
|
+
O !== -1 && O !== v.sourceIndex ? le(B, "row", O) : O === v.sourceIndex && (S(null), D(v.sourceIndex));
|
|
36960
36957
|
} else {
|
|
36961
36958
|
const L = I.current.querySelectorAll("tr");
|
|
36962
36959
|
if (L.length > 0) {
|
|
36963
|
-
const R = L[0].querySelectorAll("td, th"),
|
|
36960
|
+
const R = L[0].querySelectorAll("td, th"), O = B.clientX;
|
|
36964
36961
|
let J = -1;
|
|
36965
36962
|
for (let Q = 0; Q < R.length; Q++) {
|
|
36966
36963
|
const de = R[Q].getBoundingClientRect();
|
|
36967
|
-
if (
|
|
36964
|
+
if (O >= de.left && O <= de.right) {
|
|
36968
36965
|
J = Q;
|
|
36969
36966
|
break;
|
|
36970
|
-
} else if (
|
|
36967
|
+
} else if (O < de.left && Q === 0) {
|
|
36971
36968
|
J = 0;
|
|
36972
36969
|
break;
|
|
36973
|
-
} else if (Q === R.length - 1 &&
|
|
36970
|
+
} else if (Q === R.length - 1 && O > de.right) {
|
|
36974
36971
|
J = R.length - 1;
|
|
36975
36972
|
break;
|
|
36976
36973
|
}
|
|
@@ -37001,9 +36998,9 @@ function u7({
|
|
|
37001
36998
|
}
|
|
37002
36999
|
),
|
|
37003
37000
|
k !== null && I.current && (() => {
|
|
37004
|
-
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(),
|
|
37005
|
-
if (k >= 0 && k <
|
|
37006
|
-
const Q =
|
|
37001
|
+
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(), O = I.current.querySelectorAll("tr");
|
|
37002
|
+
if (k >= 0 && k < O.length) {
|
|
37003
|
+
const Q = O[k].getBoundingClientRect();
|
|
37007
37004
|
return /* @__PURE__ */ i(
|
|
37008
37005
|
"div",
|
|
37009
37006
|
{
|
|
@@ -37026,9 +37023,9 @@ function u7({
|
|
|
37026
37023
|
return null;
|
|
37027
37024
|
})(),
|
|
37028
37025
|
M !== null && v && I.current && (() => {
|
|
37029
|
-
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(),
|
|
37030
|
-
if (M >= 0 && M <
|
|
37031
|
-
const Q =
|
|
37026
|
+
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(), O = I.current.querySelectorAll("tr");
|
|
37027
|
+
if (M >= 0 && M < O.length) {
|
|
37028
|
+
const Q = O[M].getBoundingClientRect();
|
|
37032
37029
|
return /* @__PURE__ */ i(
|
|
37033
37030
|
"div",
|
|
37034
37031
|
{
|
|
@@ -37051,9 +37048,9 @@ function u7({
|
|
|
37051
37048
|
return null;
|
|
37052
37049
|
})(),
|
|
37053
37050
|
N !== null && I.current && (() => {
|
|
37054
|
-
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(),
|
|
37055
|
-
if (
|
|
37056
|
-
const Q =
|
|
37051
|
+
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(), O = I.current.querySelectorAll("tr");
|
|
37052
|
+
if (O.length > 0) {
|
|
37053
|
+
const Q = O[0].querySelectorAll("td, th");
|
|
37057
37054
|
if (N >= 0 && N < Q.length) {
|
|
37058
37055
|
const de = Q[N].getBoundingClientRect();
|
|
37059
37056
|
return /* @__PURE__ */ i(
|
|
@@ -37079,9 +37076,9 @@ function u7({
|
|
|
37079
37076
|
return null;
|
|
37080
37077
|
})(),
|
|
37081
37078
|
z !== null && v && I.current && (() => {
|
|
37082
|
-
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(),
|
|
37083
|
-
if (
|
|
37084
|
-
const Q =
|
|
37079
|
+
const B = I.current.getBoundingClientRect(), { left: L, top: R } = t.getBoundingClientRect(), O = I.current.querySelectorAll("tr");
|
|
37080
|
+
if (O.length > 0) {
|
|
37081
|
+
const Q = O[0].querySelectorAll("td, th");
|
|
37085
37082
|
if (z >= 0 && z < Q.length) {
|
|
37086
37083
|
const de = Q[z].getBoundingClientRect();
|
|
37087
37084
|
return /* @__PURE__ */ i(
|
|
@@ -37177,8 +37174,8 @@ function f7() {
|
|
|
37177
37174
|
const M = E.getChildrenSize();
|
|
37178
37175
|
for (; N.length < M; )
|
|
37179
37176
|
N.push(0);
|
|
37180
|
-
const
|
|
37181
|
-
k >
|
|
37177
|
+
const D = N[h] || 0;
|
|
37178
|
+
k > D ? (N[h] = k, _.setColWidths(N), console.log(`[TableImageResize] ✓ Resized column ${h} from ${D}px to ${k}px (image: ${S}px)`)) : console.log(`[TableImageResize] Column ${h} already wide enough (${D}px >= ${k}px)`);
|
|
37182
37179
|
});
|
|
37183
37180
|
};
|
|
37184
37181
|
g.complete && g.naturalWidth > 0 ? (console.log(`[TableImageResize] Image already loaded (${g.naturalWidth}px), updating immediately`), v()) : (console.log("[TableImageResize] Waiting for image to load..."), g.addEventListener("load", () => {
|
|
@@ -37292,7 +37289,7 @@ const m7 = 120 * 1e3, g7 = ({
|
|
|
37292
37289
|
] }),
|
|
37293
37290
|
/* @__PURE__ */ y("span", { className: "cteditor-text-[10px] cteditor-text-gray-400", children: [
|
|
37294
37291
|
"v",
|
|
37295
|
-
"1.3.
|
|
37292
|
+
"1.3.62"
|
|
37296
37293
|
] })
|
|
37297
37294
|
] });
|
|
37298
37295
|
}, rv = "draggable-block-menu";
|
|
@@ -37600,8 +37597,8 @@ const I7 = ({
|
|
|
37600
37597
|
if (w.includes("rgb")) {
|
|
37601
37598
|
const N = w.match(/\d+/g);
|
|
37602
37599
|
if (N && N.length >= 3) {
|
|
37603
|
-
const E = parseInt(N[0]), M = parseInt(N[1]),
|
|
37604
|
-
return `#${E.toString(16).padStart(2, "0")}${M.toString(16).padStart(2, "0")}${
|
|
37600
|
+
const E = parseInt(N[0]), M = parseInt(N[1]), D = parseInt(N[2]);
|
|
37601
|
+
return `#${E.toString(16).padStart(2, "0")}${M.toString(16).padStart(2, "0")}${D.toString(16).padStart(2, "0")}`;
|
|
37605
37602
|
}
|
|
37606
37603
|
}
|
|
37607
37604
|
return w;
|
|
@@ -37610,10 +37607,10 @@ const I7 = ({
|
|
|
37610
37607
|
const w = Array.from(h.querySelectorAll("tr"));
|
|
37611
37608
|
(g ? w.slice(1) : w).forEach((E) => {
|
|
37612
37609
|
E.querySelectorAll("td").forEach((M) => {
|
|
37613
|
-
const
|
|
37614
|
-
$ === S || $ === k || !z ? (
|
|
37610
|
+
const D = M, z = D.style.backgroundColor, $ = _(z);
|
|
37611
|
+
$ === S || $ === k || !z ? (D.style.removeProperty("background-color"), D.style.removeProperty("color"), M.querySelectorAll("*").forEach((I) => {
|
|
37615
37612
|
I.style.removeProperty("color");
|
|
37616
|
-
})) :
|
|
37613
|
+
})) : D.style.setProperty(
|
|
37617
37614
|
"background-color",
|
|
37618
37615
|
z,
|
|
37619
37616
|
"important"
|
|
@@ -37697,16 +37694,16 @@ const I7 = ({
|
|
|
37697
37694
|
minHeight: 150,
|
|
37698
37695
|
maxHeight: 800,
|
|
37699
37696
|
transitionDuration: 200
|
|
37700
|
-
}), [p, f] = T(null), [m, b] = T(null), [g, v] = T(null), [x, _] = T(!1), [S, k] = T(!1), [w, N] = T(0), E = (
|
|
37701
|
-
|
|
37697
|
+
}), [p, f] = T(null), [m, b] = T(null), [g, v] = T(null), [x, _] = T(!1), [S, k] = T(!1), [w, N] = T(0), E = (D) => {
|
|
37698
|
+
D !== null && v(D);
|
|
37702
37699
|
};
|
|
37703
37700
|
q(() => {
|
|
37704
|
-
const
|
|
37701
|
+
const D = () => {
|
|
37705
37702
|
const z = Dv && window.matchMedia("(max-width: 1025px)").matches;
|
|
37706
37703
|
z !== x && _(z);
|
|
37707
37704
|
};
|
|
37708
|
-
return
|
|
37709
|
-
window.removeEventListener("resize",
|
|
37705
|
+
return D(), window.addEventListener("resize", D), () => {
|
|
37706
|
+
window.removeEventListener("resize", D);
|
|
37710
37707
|
};
|
|
37711
37708
|
}, [x]);
|
|
37712
37709
|
const M = {
|
|
@@ -37924,7 +37921,7 @@ const I7 = ({
|
|
|
37924
37921
|
previewStyle: b,
|
|
37925
37922
|
onPreviewClick: g
|
|
37926
37923
|
}) => {
|
|
37927
|
-
const { isAuthenticated: v, isLoading: x, error: _, editorConfig: S, currentUser: k, verifyKey: w } = Cr(), N = ne(s), E = ne(a), M = ne(!1),
|
|
37924
|
+
const { isAuthenticated: v, isLoading: x, error: _, editorConfig: S, currentUser: k, verifyKey: w } = Cr(), N = ne(s), E = ne(a), M = ne(!1), D = ne(!1), z = ne(!1), $ = Cx({
|
|
37928
37925
|
enabled: d,
|
|
37929
37926
|
onReady: l,
|
|
37930
37927
|
onFocus: h,
|
|
@@ -37949,7 +37946,7 @@ const I7 = ({
|
|
|
37949
37946
|
}, [t, c, w]), q(() => {
|
|
37950
37947
|
v && (N.current?.(), $.notifyAuthSuccess()), _ && (E.current?.(_), $.notifyAuthError(_));
|
|
37951
37948
|
}, [v, _, $]), q(() => {
|
|
37952
|
-
console.log("isAuthenticated:", v), v && !
|
|
37949
|
+
console.log("isAuthenticated:", v), v && !D.current && t && (D.current = !0, P7(t)), v && !z.current && (z.current = !0, setTimeout(() => {
|
|
37953
37950
|
$.notifyReady();
|
|
37954
37951
|
}, 100));
|
|
37955
37952
|
}, [v, t, $]);
|