@nxgt/material 3.41.0 → 3.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/{components-BUFDh6nQ.js → components-g8mWYJE8.js} +12143 -12202
- package/dist/components.js +6 -6
- package/dist/editor.js +529 -529
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-form-field.d.ts +5 -2
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-text-rules.d.ts +20 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete.d.ts +1 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +13 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chips.d.ts +7 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +15 -0
- package/dist/lib/components/ui/selection/autocomplete/types.d.ts +15 -0
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-handlers.d.ts +10 -3
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +6 -1
- package/dist/lib/components/ui/selection/combobox/combobox-input.d.ts +3 -1
- package/dist/main.js +6 -6
- package/dist/{use-chat-composer-DrFgIE3T.js → use-chat-composer-D_hfO99B.js} +2635 -2462
- package/docs/components/selection-and-choice.md +47 -1
- package/package.json +1 -1
package/dist/editor.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
-
import {
|
|
4
|
-
import { f as
|
|
5
|
-
import { c as
|
|
6
|
-
import { c as
|
|
7
|
-
import { t as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { r as
|
|
11
|
-
import { a as
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import { t as
|
|
15
|
-
import { Ft as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { Z as
|
|
19
|
-
import { a as
|
|
20
|
-
import { d as
|
|
21
|
-
import { t as
|
|
22
|
-
import { n as
|
|
23
|
-
import { ArrowDown as
|
|
24
|
-
import { Suspense as
|
|
3
|
+
import { A as n, B as r, C as i, Cn as a, D as o, Dn as s, E as c, En as l, Er as u, F as d, Fn as f, G as p, H as m, In as h, J as g, K as _, Ln as v, M as y, N as b, O as x, On as S, P as C, Qi as ee, Qn as te, Rn as w, S as T, T as E, Tn as ne, Tr as re, U as D, V as ie, Vn as O, W as ae, X as oe, Xi as se, Y as ce, Yi as le, _n as ue, a as de, an as fe, bn as pe, c as me, d as he, g as ge, hr as _e, i as ve, in as ye, j as be, k as xe, l as Se, m as Ce, mn as we, p as Te, pn as Ee, q as De, rn as Oe, s as ke, t as Ae, vn as je, vr as Me, w as Ne, wn as Pe, x as Fe, xn as Ie, yn as Le, z as Re, zn as ze } from "./use-chat-composer-D_hfO99B.js";
|
|
4
|
+
import { f as Be } from "./dialog-uQld1gKm.js";
|
|
5
|
+
import { c as Ve, i as He, n as Ue, o as We, r as Ge, s as Ke, t as qe, u as k } from "./dropdown-menu-BA70o7HC.js";
|
|
6
|
+
import { c as Je, o as Ye, s as Xe } from "./toolbar-items-BLjrk8uU.js";
|
|
7
|
+
import { t as A } from "./use-material-translation-CFF73jk5.js";
|
|
8
|
+
import { n as Ze, t as j } from "./button-CTsT_LqL.js";
|
|
9
|
+
import { t as M } from "./icon-button-CN9r5TNE.js";
|
|
10
|
+
import { r as Qe, t as $e } from "./field-blur-CJHzVSh9.js";
|
|
11
|
+
import { a as et, s as N } from "./dist-C3GR7kJd.js";
|
|
12
|
+
import { n as tt, t as nt } from "./toggle-group-BMJNcFAC.js";
|
|
13
|
+
import { n as rt } from "./icon-badge-D_z5BGbc.js";
|
|
14
|
+
import { t as it } from "./use-mobile-BDro060N.js";
|
|
15
|
+
import { Ft as at, Ht as ot, Nt as st, Ot as ct, St as lt, bt as P, ht as F, mt as I, n as L, wt as R, xt as ut, yt as dt } from "./dist-moutbfbd.js";
|
|
16
|
+
import { t as ft } from "./markdown-Dw_uH7j7.js";
|
|
17
|
+
import { n as pt, r as z, t as mt } from "./create-store-Dqp-PLLn.js";
|
|
18
|
+
import { Z as ht, w as gt } from "./youtube-node-OWSNlYCc.js";
|
|
19
|
+
import { a as _t, i as vt, n as yt, r as bt } from "./convert-XAkWyO8-.js";
|
|
20
|
+
import { d as xt, n as St, r as Ct, u as wt } from "./headless-extensions-CvmdhANJ.js";
|
|
21
|
+
import { t as Tt } from "./render-json-BOhvPnSv.js";
|
|
22
|
+
import { n as Et, r as Dt } from "./collab-colors-CDkjUVoQ.js";
|
|
23
|
+
import { ArrowDown as Ot, ArrowUp as kt, AtSign as At, CaseSensitive as jt, Check as Mt, ChevronDown as Nt, ChevronLeft as Pt, ChevronRight as Ft, ChevronUp as It, Code as Lt, Copy as Rt, CornerDownLeft as zt, File as Bt, Focus as Vt, GripVertical as Ht, Heading1 as Ut, Heading2 as Wt, Heading3 as Gt, Languages as Kt, List as qt, ListOrdered as Jt, Maximize2 as Yt, MessageSquare as Xt, MessageSquarePlus as Zt, Minimize2 as Qt, PenLine as $t, Pilcrow as en, Plus as tn, Quote as nn, Replace as rn, RotateCcw as an, Search as on, Smile as sn, Sparkles as cn, SpellCheck as ln, Square as un, TableOfContents as dn, TextCursorInput as fn, TextQuote as pn, Trash2 as mn, WandSparkles as hn, WholeWord as gn, X as _n } from "lucide-react";
|
|
24
|
+
import { Suspense as vn, lazy as yn, useCallback as B, useEffect as V, useId as bn, useLayoutEffect as xn, useMemo as H, useRef as U, useState as W, useSyncExternalStore as G } from "react";
|
|
25
25
|
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
26
26
|
import { createPortal as Sn } from "react-dom";
|
|
27
27
|
//#region lib/components/ui/widgets/editor/extensions/assistant/editor-extensions.ts
|
|
@@ -93,7 +93,7 @@ function On(e, t) {
|
|
|
93
93
|
}
|
|
94
94
|
async function kn(e, t, n = "drop") {
|
|
95
95
|
let r = Cn(e);
|
|
96
|
-
return On(
|
|
96
|
+
return On(Ct(await yt(t, { extensions: r }), r), n);
|
|
97
97
|
}
|
|
98
98
|
async function An(e, t, n, r, i = {}) {
|
|
99
99
|
let a = await kn(e, t, i.allowMedia ? "keep" : "drop");
|
|
@@ -131,35 +131,35 @@ function Fn(e) {
|
|
|
131
131
|
{
|
|
132
132
|
id: "improve",
|
|
133
133
|
label: t("improve", "Improve writing"),
|
|
134
|
-
icon:
|
|
134
|
+
icon: hn,
|
|
135
135
|
prompt: "Improve the writing: clearer, smoother, same meaning and language.",
|
|
136
136
|
needsSelection: !0
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
id: "fix",
|
|
140
140
|
label: t("fix", "Fix spelling & grammar"),
|
|
141
|
-
icon:
|
|
141
|
+
icon: ln,
|
|
142
142
|
prompt: "Fix the spelling and grammar. Change nothing else.",
|
|
143
143
|
needsSelection: !0
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
id: "shorter",
|
|
147
147
|
label: t("shorter", "Make shorter"),
|
|
148
|
-
icon:
|
|
148
|
+
icon: Qt,
|
|
149
149
|
prompt: "Make it shorter and keep the meaning.",
|
|
150
150
|
needsSelection: !0
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
id: "longer",
|
|
154
154
|
label: t("longer", "Make longer"),
|
|
155
|
-
icon:
|
|
155
|
+
icon: Yt,
|
|
156
156
|
prompt: "Make it longer: develop the ideas and keep the meaning.",
|
|
157
157
|
needsSelection: !0
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
id: "tone",
|
|
161
161
|
label: t("tone", "Change tone"),
|
|
162
|
-
icon:
|
|
162
|
+
icon: sn,
|
|
163
163
|
needsSelection: !0,
|
|
164
164
|
actions: jn.map((t) => ({
|
|
165
165
|
id: `tone:${t}`,
|
|
@@ -171,21 +171,21 @@ function Fn(e) {
|
|
|
171
171
|
{
|
|
172
172
|
id: "summarise",
|
|
173
173
|
label: t("summarise", "Summarise"),
|
|
174
|
-
icon:
|
|
174
|
+
icon: pn,
|
|
175
175
|
prompt: "Summarise it in a few sentences.",
|
|
176
176
|
needsSelection: !0
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
id: "continue",
|
|
180
180
|
label: t("continue", "Continue writing"),
|
|
181
|
-
icon:
|
|
181
|
+
icon: $t,
|
|
182
182
|
prompt: "Continue the text from where it stops, in the same style.",
|
|
183
183
|
needsSelection: !1
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
id: "translate",
|
|
187
187
|
label: t("translate", "Translate"),
|
|
188
|
-
icon:
|
|
188
|
+
icon: Kt,
|
|
189
189
|
needsSelection: !0,
|
|
190
190
|
actions: Mn.map((t) => ({
|
|
191
191
|
id: `translate:${t}`,
|
|
@@ -216,7 +216,7 @@ function Ln(e, t) {
|
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-shell.tsx
|
|
218
218
|
function Rn(e, t) {
|
|
219
|
-
return
|
|
219
|
+
return H(() => ({ current: { getBoundingClientRect: () => {
|
|
220
220
|
let { from: n, to: r } = t.getState().range;
|
|
221
221
|
try {
|
|
222
222
|
let t = e.view.coordsAtPos(n), i = e.view.coordsAtPos(r), a = i.bottom - t.top > window.innerHeight / 2, o = a ? i.top : t.top, s = a ? i.left : Math.min(t.left, i.left), c = Math.max(t.right, i.right, s + 1);
|
|
@@ -227,7 +227,7 @@ function Rn(e, t) {
|
|
|
227
227
|
} } }), [e, t]);
|
|
228
228
|
}
|
|
229
229
|
function zn({ editor: e, controller: t, label: n, slot: r = "editor-assistant", locked: i, onDismiss: a, children: o }) {
|
|
230
|
-
let s =
|
|
230
|
+
let s = it(), c = Rn(e, t);
|
|
231
231
|
return s ? Sn(/* @__PURE__ */ q("section", {
|
|
232
232
|
role: "dialog",
|
|
233
233
|
"aria-label": n,
|
|
@@ -235,10 +235,10 @@ function zn({ editor: e, controller: t, label: n, slot: r = "editor-assistant",
|
|
|
235
235
|
"data-layout": "sheet",
|
|
236
236
|
className: "fixed inset-x-2 bottom-[max(0.5rem,env(safe-area-inset-bottom))] z-50 max-h-[75svh] overflow-y-auto overscroll-contain rounded-2xl border bg-popover p-3 text-popover-foreground shadow-lg",
|
|
237
237
|
children: o
|
|
238
|
-
}), document.body) : /* @__PURE__ */ J(
|
|
238
|
+
}), document.body) : /* @__PURE__ */ J(Ye, {
|
|
239
239
|
open: !0,
|
|
240
240
|
onOpenChange: (e) => !e && a("outside"),
|
|
241
|
-
children: [/* @__PURE__ */ q(
|
|
241
|
+
children: [/* @__PURE__ */ q(Xe, { virtualRef: c }), /* @__PURE__ */ q(Je, {
|
|
242
242
|
role: "dialog",
|
|
243
243
|
"aria-label": n,
|
|
244
244
|
"data-slot": r,
|
|
@@ -268,7 +268,7 @@ function Bn(e) {
|
|
|
268
268
|
e.preventDefault(), t[i]?.focus();
|
|
269
269
|
}
|
|
270
270
|
function Vn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
271
|
-
let { t: r } =
|
|
271
|
+
let { t: r } = A(), [i, a] = W(null), o = H(() => Ln(i?.actions ?? e, t), [
|
|
272
272
|
i,
|
|
273
273
|
e,
|
|
274
274
|
t
|
|
@@ -291,7 +291,7 @@ function Vn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
291
291
|
"aria-label": i?.label ?? r("material.editor.assistant.actions", "Actions"),
|
|
292
292
|
className: "grid gap-0.5",
|
|
293
293
|
children: [i && /* @__PURE__ */ q(Un, {
|
|
294
|
-
icon: /* @__PURE__ */ q(
|
|
294
|
+
icon: /* @__PURE__ */ q(Pt, { className: "size-4" }),
|
|
295
295
|
label: r("material.editor.assistant.back", "Back"),
|
|
296
296
|
onClick: () => a(null)
|
|
297
297
|
}), o.map((e) => /* @__PURE__ */ q(Un, {
|
|
@@ -304,15 +304,15 @@ function Vn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
function Hn({ onAsk: e }) {
|
|
307
|
-
let { t } =
|
|
308
|
-
|
|
307
|
+
let { t } = A(), [n, r] = W(""), i = U(null);
|
|
308
|
+
V(() => i.current?.focus({ preventScroll: !0 }), []);
|
|
309
309
|
let a = () => {
|
|
310
310
|
let t = n.trim();
|
|
311
311
|
t && e(t);
|
|
312
312
|
};
|
|
313
313
|
return /* @__PURE__ */ J("div", {
|
|
314
314
|
className: "flex items-center gap-1.5",
|
|
315
|
-
children: [/* @__PURE__ */ q(
|
|
315
|
+
children: [/* @__PURE__ */ q(Be, {
|
|
316
316
|
ref: i,
|
|
317
317
|
value: n,
|
|
318
318
|
"aria-label": t("material.editor.assistant.ask-label", "Ask the assistant"),
|
|
@@ -322,13 +322,13 @@ function Hn({ onAsk: e }) {
|
|
|
322
322
|
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), a());
|
|
323
323
|
},
|
|
324
324
|
className: "h-9 min-w-0 flex-1"
|
|
325
|
-
}), /* @__PURE__ */ q(
|
|
325
|
+
}), /* @__PURE__ */ q(M, {
|
|
326
326
|
variant: "filled",
|
|
327
327
|
"aria-label": t("material.editor.assistant.send", "Send"),
|
|
328
328
|
disabled: !n.trim(),
|
|
329
329
|
onClick: a,
|
|
330
330
|
className: "size-9",
|
|
331
|
-
children: /* @__PURE__ */ q(
|
|
331
|
+
children: /* @__PURE__ */ q(kt, {})
|
|
332
332
|
})]
|
|
333
333
|
});
|
|
334
334
|
}
|
|
@@ -348,7 +348,7 @@ function Un({ icon: e, label: n, submenu: r, onClick: i }) {
|
|
|
348
348
|
className: "min-w-0 flex-1 truncate",
|
|
349
349
|
children: n
|
|
350
350
|
}),
|
|
351
|
-
r && /* @__PURE__ */ q(
|
|
351
|
+
r && /* @__PURE__ */ q(Ft, { className: "size-4 text-muted-foreground rtl:rotate-180" })
|
|
352
352
|
]
|
|
353
353
|
});
|
|
354
354
|
}
|
|
@@ -356,11 +356,11 @@ function Un({ icon: e, label: n, submenu: r, onClick: i }) {
|
|
|
356
356
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-preview.tsx
|
|
357
357
|
var Wn = 90;
|
|
358
358
|
function Gn({ editor: e, markdown: t }) {
|
|
359
|
-
let [n, r] =
|
|
360
|
-
return
|
|
359
|
+
let [n, r] = W(null);
|
|
360
|
+
return V(() => {
|
|
361
361
|
let n = !0, i = setTimeout(() => {
|
|
362
362
|
kn(e, t, "inert").then((t) => {
|
|
363
|
-
n && r(
|
|
363
|
+
n && r(Tt(t, void 0, Cn(e)));
|
|
364
364
|
}).catch(() => {
|
|
365
365
|
n && r(/* @__PURE__ */ q("p", { children: t }));
|
|
366
366
|
});
|
|
@@ -387,58 +387,58 @@ async function Kn(e) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
function qn({ text: e }) {
|
|
390
|
-
let { t } =
|
|
391
|
-
return
|
|
390
|
+
let { t } = A(), [n, r] = W(!1);
|
|
391
|
+
return V(() => {
|
|
392
392
|
if (!n) return;
|
|
393
393
|
let e = setTimeout(() => r(!1), 1600);
|
|
394
394
|
return () => clearTimeout(e);
|
|
395
|
-
}, [n]), /* @__PURE__ */ J(
|
|
395
|
+
}, [n]), /* @__PURE__ */ J(j, {
|
|
396
396
|
variant: "ghost",
|
|
397
397
|
size: "sm",
|
|
398
398
|
onClick: async () => r(await Kn(e)),
|
|
399
|
-
children: [q(n ?
|
|
399
|
+
children: [q(n ? Mt : Rt, {}), n ? t("material.editor.assistant.copied", "Copied") : t("material.editor.assistant.copy", "Copy")]
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
function Jn({ state: e, on: t }) {
|
|
403
|
-
let { t: n } =
|
|
404
|
-
return
|
|
403
|
+
let { t: n } = A(), r = U(null);
|
|
404
|
+
return V(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ J("div", {
|
|
405
405
|
className: "flex flex-wrap items-center gap-1.5",
|
|
406
406
|
children: [
|
|
407
|
-
e.hasSelection && /* @__PURE__ */ J(
|
|
407
|
+
e.hasSelection && /* @__PURE__ */ J(j, {
|
|
408
408
|
ref: r,
|
|
409
409
|
size: "sm",
|
|
410
410
|
disabled: e.applying,
|
|
411
411
|
onClick: () => t.onApply("replace"),
|
|
412
|
-
children: [/* @__PURE__ */ q(
|
|
412
|
+
children: [/* @__PURE__ */ q(rn, {}), n("material.editor.assistant.replace", "Replace selection")]
|
|
413
413
|
}),
|
|
414
|
-
/* @__PURE__ */ J(
|
|
414
|
+
/* @__PURE__ */ J(j, {
|
|
415
415
|
ref: e.hasSelection ? void 0 : r,
|
|
416
416
|
variant: e.hasSelection ? "outlined" : "filled",
|
|
417
417
|
size: "sm",
|
|
418
418
|
disabled: e.applying,
|
|
419
419
|
onClick: () => t.onApply("below"),
|
|
420
|
-
children: [/* @__PURE__ */ q(
|
|
420
|
+
children: [/* @__PURE__ */ q(zt, {}), n("material.editor.assistant.insert-below", "Insert below")]
|
|
421
421
|
}),
|
|
422
422
|
/* @__PURE__ */ q(qn, { text: e.text }),
|
|
423
|
-
/* @__PURE__ */ J(
|
|
423
|
+
/* @__PURE__ */ J(j, {
|
|
424
424
|
variant: "ghost",
|
|
425
425
|
size: "sm",
|
|
426
426
|
disabled: e.applying,
|
|
427
427
|
onClick: t.onRetry,
|
|
428
|
-
children: [/* @__PURE__ */ q(
|
|
428
|
+
children: [/* @__PURE__ */ q(an, {}), n("material.editor.assistant.retry", "Retry")]
|
|
429
429
|
}),
|
|
430
|
-
/* @__PURE__ */ J(
|
|
430
|
+
/* @__PURE__ */ J(j, {
|
|
431
431
|
variant: "ghost",
|
|
432
432
|
size: "sm",
|
|
433
433
|
onClick: t.onDiscard,
|
|
434
|
-
children: [/* @__PURE__ */ q(
|
|
434
|
+
children: [/* @__PURE__ */ q(_n, {}), n("material.editor.assistant.discard", "Discard")]
|
|
435
435
|
})
|
|
436
436
|
]
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
function Yn({ state: e, on: t }) {
|
|
440
|
-
let { t: n } =
|
|
441
|
-
return
|
|
440
|
+
let { t: n } = A(), r = U(null);
|
|
441
|
+
return V(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ J("div", {
|
|
442
442
|
className: "grid gap-2",
|
|
443
443
|
children: [/* @__PURE__ */ q("p", {
|
|
444
444
|
role: "alert",
|
|
@@ -448,19 +448,19 @@ function Yn({ state: e, on: t }) {
|
|
|
448
448
|
}), /* @__PURE__ */ J("div", {
|
|
449
449
|
className: "flex flex-wrap items-center gap-1.5",
|
|
450
450
|
children: [
|
|
451
|
-
/* @__PURE__ */ J(
|
|
451
|
+
/* @__PURE__ */ J(j, {
|
|
452
452
|
ref: r,
|
|
453
453
|
size: "sm",
|
|
454
454
|
onClick: t.onRetry,
|
|
455
|
-
children: [/* @__PURE__ */ q(
|
|
455
|
+
children: [/* @__PURE__ */ q(an, {}), n("material.editor.assistant.retry", "Retry")]
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */ q(
|
|
457
|
+
/* @__PURE__ */ q(j, {
|
|
458
458
|
variant: "ghost",
|
|
459
459
|
size: "sm",
|
|
460
460
|
onClick: t.onBack,
|
|
461
461
|
children: n("material.editor.assistant.back", "Back")
|
|
462
462
|
}),
|
|
463
|
-
/* @__PURE__ */ q(
|
|
463
|
+
/* @__PURE__ */ q(j, {
|
|
464
464
|
variant: "ghost",
|
|
465
465
|
size: "sm",
|
|
466
466
|
onClick: t.onDiscard,
|
|
@@ -471,8 +471,8 @@ function Yn({ state: e, on: t }) {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
function Xn({ editor: e, state: t, on: n, status: r }) {
|
|
474
|
-
let { t: i } =
|
|
475
|
-
return
|
|
474
|
+
let { t: i } = A(), a = U(null), o = t.phase === "streaming";
|
|
475
|
+
return V(() => {
|
|
476
476
|
o && a.current?.focus({ preventScroll: !0 });
|
|
477
477
|
}, [o]), /* @__PURE__ */ J("div", {
|
|
478
478
|
className: "grid gap-2",
|
|
@@ -482,12 +482,12 @@ function Xn({ editor: e, state: t, on: n, status: r }) {
|
|
|
482
482
|
editor: e,
|
|
483
483
|
markdown: t.text
|
|
484
484
|
}),
|
|
485
|
-
o ? /* @__PURE__ */ q("div", { children: /* @__PURE__ */ J(
|
|
485
|
+
o ? /* @__PURE__ */ q("div", { children: /* @__PURE__ */ J(j, {
|
|
486
486
|
ref: a,
|
|
487
487
|
variant: "tonal",
|
|
488
488
|
size: "sm",
|
|
489
489
|
onClick: n.onStop,
|
|
490
|
-
children: [/* @__PURE__ */ q(
|
|
490
|
+
children: [/* @__PURE__ */ q(un, {}), i("material.editor.assistant.stop", "Stop")]
|
|
491
491
|
}) }) : /* @__PURE__ */ q(Jn, {
|
|
492
492
|
state: t,
|
|
493
493
|
on: n
|
|
@@ -498,11 +498,11 @@ function Xn({ editor: e, state: t, on: n, status: r }) {
|
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-stage.tsx
|
|
500
500
|
function Zn({ label: e, onDiscard: t }) {
|
|
501
|
-
let { t: n } =
|
|
501
|
+
let { t: n } = A();
|
|
502
502
|
return /* @__PURE__ */ J("div", {
|
|
503
503
|
className: "flex items-center gap-2",
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ q(
|
|
505
|
+
/* @__PURE__ */ q(cn, {
|
|
506
506
|
className: "size-4 text-primary-text",
|
|
507
507
|
"aria-hidden": !0
|
|
508
508
|
}),
|
|
@@ -510,12 +510,12 @@ function Zn({ label: e, onDiscard: t }) {
|
|
|
510
510
|
className: "min-w-0 flex-1 truncate font-medium text-sm",
|
|
511
511
|
children: e
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */ q(
|
|
513
|
+
/* @__PURE__ */ q(M, {
|
|
514
514
|
variant: "ghost",
|
|
515
515
|
"aria-label": n("material.editor.assistant.discard", "Discard"),
|
|
516
516
|
onClick: t,
|
|
517
517
|
className: "size-7",
|
|
518
|
-
children: /* @__PURE__ */ q(
|
|
518
|
+
children: /* @__PURE__ */ q(_n, {})
|
|
519
519
|
})
|
|
520
520
|
]
|
|
521
521
|
});
|
|
@@ -539,7 +539,7 @@ function Qn({ editor: e, state: t, actions: n, onChoose: r, on: i }) {
|
|
|
539
539
|
}) : null;
|
|
540
540
|
}
|
|
541
541
|
function $n({ note: e }) {
|
|
542
|
-
let { t } =
|
|
542
|
+
let { t } = A();
|
|
543
543
|
return e ? /* @__PURE__ */ q("p", {
|
|
544
544
|
role: "status",
|
|
545
545
|
"data-slot": "editor-assistant-note",
|
|
@@ -548,12 +548,12 @@ function $n({ note: e }) {
|
|
|
548
548
|
}) : null;
|
|
549
549
|
}
|
|
550
550
|
function er({ phase: e, stopped: t }) {
|
|
551
|
-
let { t: n } =
|
|
551
|
+
let { t: n } = A(), r = n("material.editor.assistant.writing", "Writing…");
|
|
552
552
|
return /* @__PURE__ */ q("div", {
|
|
553
553
|
role: "status",
|
|
554
554
|
"data-slot": "editor-assistant-status",
|
|
555
555
|
className: "flex min-h-6 items-center gap-2 text-muted-foreground text-xs",
|
|
556
|
-
children: e === "streaming" ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
556
|
+
children: e === "streaming" ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Te, {
|
|
557
557
|
label: r,
|
|
558
558
|
className: "size-6"
|
|
559
559
|
}), r] }) : t ? n("material.editor.assistant.stopped", "Stopped") : n("material.editor.assistant.ready", "Answer ready")
|
|
@@ -597,17 +597,17 @@ var rr = {
|
|
|
597
597
|
}, ir = () => () => {}, ar = (e) => e ? tr(e)?.controller : void 0;
|
|
598
598
|
function or(e) {
|
|
599
599
|
let t = ar(e);
|
|
600
|
-
return
|
|
600
|
+
return G(t?.subscribe ?? ir, t?.getState ?? (() => rr), () => rr);
|
|
601
601
|
}
|
|
602
602
|
//#endregion
|
|
603
603
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-panel.tsx
|
|
604
604
|
function sr(e) {
|
|
605
|
-
let { handle: t, chrome: n } =
|
|
605
|
+
let { handle: t, chrome: n } = O(), r = t.features.some((e) => e.key === "assistant");
|
|
606
606
|
return !t.editor || !r || n.state.panel !== "assistant" ? null : /* @__PURE__ */ q(cr, {});
|
|
607
607
|
}
|
|
608
608
|
function cr() {
|
|
609
|
-
let { t: e, language: t } =
|
|
610
|
-
if (
|
|
609
|
+
let { t: e, language: t } = A(), { handle: n } = O(), r = n.editor, i = tr(r), a = or(r), o = i?.controller, s = H(() => In(i?.actions, e), [i?.actions, e]);
|
|
610
|
+
if (V(() => (o?.getState().phase === "idle" && o.begin(), () => o?.reset()), [o]), !o || a.phase === "idle") return null;
|
|
611
611
|
let c = (e) => {
|
|
612
612
|
o.close(), e !== "outside" && r.commands.focus();
|
|
613
613
|
}, l = () => c("discard"), u = (e) => void o.run({
|
|
@@ -649,12 +649,12 @@ function cr() {
|
|
|
649
649
|
//#region lib/components/ui/widgets/editor/extensions/collab/use-presence.ts
|
|
650
650
|
var lr = [], ur = () => () => {};
|
|
651
651
|
function dr() {
|
|
652
|
-
let { editor: e } =
|
|
652
|
+
let { editor: e } = O().handle;
|
|
653
653
|
return fr(e);
|
|
654
654
|
}
|
|
655
655
|
function fr(e) {
|
|
656
656
|
let t = e?.storage.nxgtPresence?.store ?? null;
|
|
657
|
-
return
|
|
657
|
+
return G(t ? t.subscribe : ur, t ? t.getSnapshot : () => lr, () => lr);
|
|
658
658
|
}
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region lib/components/ui/widgets/editor/extensions/collab/editor-presence.tsx
|
|
@@ -681,30 +681,30 @@ function mr({ user: e }) {
|
|
|
681
681
|
"aria-label": e.name,
|
|
682
682
|
title: e.name,
|
|
683
683
|
className: "flex",
|
|
684
|
-
children: /* @__PURE__ */ q(
|
|
684
|
+
children: /* @__PURE__ */ q(ge, { fallback: /* @__PURE__ */ q("span", {
|
|
685
685
|
ref: (t) => {
|
|
686
|
-
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg",
|
|
686
|
+
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg", Dt(e.color));
|
|
687
687
|
},
|
|
688
688
|
className: "grid size-full place-items-center rounded-full bg-[var(--nxgt-collab-color)] text-[var(--nxgt-collab-fg)]",
|
|
689
|
-
children:
|
|
689
|
+
children: Et(e.name)
|
|
690
690
|
}) })
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
693
|
function hr({ status: e, max: n = 4, className: r }) {
|
|
694
|
-
let { t: i } =
|
|
694
|
+
let { t: i } = A(), a = dr();
|
|
695
695
|
if (!e && a.length === 0) return null;
|
|
696
696
|
let [o, s, c] = e ? pr[e] : [];
|
|
697
697
|
return /* @__PURE__ */ J("div", {
|
|
698
698
|
"data-slot": "editor-presence",
|
|
699
699
|
"data-status": e,
|
|
700
700
|
className: t("flex items-center gap-3", r),
|
|
701
|
-
children: [s && o && /* @__PURE__ */ q(
|
|
701
|
+
children: [s && o && /* @__PURE__ */ q(Fe, {
|
|
702
702
|
tone: o,
|
|
703
703
|
pulse: e === "connecting",
|
|
704
704
|
role: "status",
|
|
705
705
|
className: "text-muted-foreground text-xs",
|
|
706
706
|
children: i(s, c)
|
|
707
|
-
}), a.length > 0 && /* @__PURE__ */ q(
|
|
707
|
+
}), a.length > 0 && /* @__PURE__ */ q(Ce, {
|
|
708
708
|
size: "sm",
|
|
709
709
|
max: n,
|
|
710
710
|
role: "group",
|
|
@@ -719,7 +719,7 @@ var gr = "[&_textarea]:min-w-0", _r = (e) => e.key === "Enter" && (e.metaKey ||
|
|
|
719
719
|
//#endregion
|
|
720
720
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer-form.tsx
|
|
721
721
|
function vr({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
722
|
-
let { t: a } =
|
|
722
|
+
let { t: a } = A(), o = e.error === "invalid-id" ? a("material.editor.comments.invalid-id", "The adapter answered a thread id that is not allowed.") : e.error;
|
|
723
723
|
return /* @__PURE__ */ J("form", {
|
|
724
724
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2.5",
|
|
725
725
|
onSubmit: (e) => {
|
|
@@ -733,7 +733,7 @@ function vr({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
733
733
|
className: "line-clamp-2 border-s-2 ps-2 text-muted-foreground text-xs italic",
|
|
734
734
|
children: e.quote
|
|
735
735
|
}),
|
|
736
|
-
/* @__PURE__ */ q(
|
|
736
|
+
/* @__PURE__ */ q(S, {
|
|
737
737
|
className: gr,
|
|
738
738
|
"aria-label": a("material.editor.comments.body-label", "Comment"),
|
|
739
739
|
placeholder: a("material.editor.comments.placeholder", "Write a comment…"),
|
|
@@ -760,17 +760,17 @@ function vr({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
function yr({ pending: e, empty: t, onDismiss: n }) {
|
|
763
|
-
let { t: r } =
|
|
763
|
+
let { t: r } = A();
|
|
764
764
|
return /* @__PURE__ */ J("div", {
|
|
765
765
|
className: "flex justify-end gap-2",
|
|
766
|
-
children: [/* @__PURE__ */ q(
|
|
766
|
+
children: [/* @__PURE__ */ q(j, {
|
|
767
767
|
type: "button",
|
|
768
768
|
size: "sm",
|
|
769
|
-
variant:
|
|
769
|
+
variant: Ze,
|
|
770
770
|
disabled: e,
|
|
771
771
|
onClick: n,
|
|
772
772
|
children: r("material.editor.comments.cancel", "Cancel")
|
|
773
|
-
}), /* @__PURE__ */ q(
|
|
773
|
+
}), /* @__PURE__ */ q(j, {
|
|
774
774
|
type: "submit",
|
|
775
775
|
size: "sm",
|
|
776
776
|
loading: e,
|
|
@@ -797,7 +797,7 @@ var br = (e = !1) => ({
|
|
|
797
797
|
}, xr = () => () => {}, Sr = br(), Cr = (e) => e ? Y(e)?.controller : void 0;
|
|
798
798
|
function wr(e) {
|
|
799
799
|
let t = Cr(e);
|
|
800
|
-
return
|
|
800
|
+
return G(t?.subscribe ?? xr, t?.getState ?? (() => Sr), () => Sr);
|
|
801
801
|
}
|
|
802
802
|
//#endregion
|
|
803
803
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-live.tsx
|
|
@@ -809,7 +809,7 @@ var Tr = {
|
|
|
809
809
|
deleted: ["deleted-notice", "Thread deleted"]
|
|
810
810
|
};
|
|
811
811
|
function Er({ editor: e }) {
|
|
812
|
-
let { t } =
|
|
812
|
+
let { t } = A(), { notice: n } = wr(e), r = n ? Tr[n.kind] : null;
|
|
813
813
|
return /* @__PURE__ */ q("div", {
|
|
814
814
|
role: "status",
|
|
815
815
|
"aria-live": "polite",
|
|
@@ -821,7 +821,7 @@ function Er({ editor: e }) {
|
|
|
821
821
|
//#endregion
|
|
822
822
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer.tsx
|
|
823
823
|
function Dr(e) {
|
|
824
|
-
let { handle: t } =
|
|
824
|
+
let { handle: t } = O(), { editor: n } = t;
|
|
825
825
|
return !n || !Y(n) ? null : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Or, { editor: n }), /* @__PURE__ */ q(Er, { editor: n })] });
|
|
826
826
|
}
|
|
827
827
|
function Or({ editor: e }) {
|
|
@@ -832,11 +832,11 @@ function Or({ editor: e }) {
|
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
function kr({ editor: e, controller: t }) {
|
|
835
|
-
let { t: n } =
|
|
836
|
-
|
|
835
|
+
let { t: n } = A(), { chrome: r } = O(), i = wr(e).composer, { actions: a } = r;
|
|
836
|
+
V(() => (a.setBubbleSuppressed(!0), () => {
|
|
837
837
|
a.setBubbleSuppressed(!1);
|
|
838
838
|
}), [a]);
|
|
839
|
-
let [o, s] =
|
|
839
|
+
let [o, s] = W(""), c = H(() => ({ getState: () => ({ range: t.getState().composer?.range ?? {
|
|
840
840
|
from: 0,
|
|
841
841
|
to: 0
|
|
842
842
|
} }) }), [t]);
|
|
@@ -867,14 +867,14 @@ function Ar(e, t) {
|
|
|
867
867
|
return !n || !(t instanceof Element) ? !1 : n.contains(t) ? !0 : n.getAttribute("aria-expanded") === "true" && !!t.closest("[role=\"menu\"]");
|
|
868
868
|
}
|
|
869
869
|
function jr({ id: e, children: t, ...n }) {
|
|
870
|
-
let { chrome: r, toolbarRef: i } =
|
|
871
|
-
return
|
|
870
|
+
let { chrome: r, toolbarRef: i } = O(), a = r.state.panel === e, [o, s] = W();
|
|
871
|
+
return xn(() => {
|
|
872
872
|
let e = i.current, t = e?.getAttribute("aria-orientation") === "vertical" ? getComputedStyle(e).direction === "rtl" ? "left" : "right" : void 0;
|
|
873
873
|
t !== o && s(t);
|
|
874
|
-
}), /* @__PURE__ */ J(
|
|
874
|
+
}), /* @__PURE__ */ J(Ye, {
|
|
875
875
|
open: a,
|
|
876
876
|
onOpenChange: (t) => t ? r.actions.openPanel(e) : r.actions.closePanel(),
|
|
877
|
-
children: [/* @__PURE__ */ q(
|
|
877
|
+
children: [/* @__PURE__ */ q(Xe, { virtualRef: i }), /* @__PURE__ */ q(Je, {
|
|
878
878
|
"data-panel": e,
|
|
879
879
|
side: o,
|
|
880
880
|
align: "start",
|
|
@@ -895,15 +895,15 @@ function jr({ id: e, children: t, ...n }) {
|
|
|
895
895
|
//#endregion
|
|
896
896
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-status.tsx
|
|
897
897
|
function Mr({ state: e, controller: t, count: n }) {
|
|
898
|
-
let { t: r } =
|
|
899
|
-
return n === 0 && !e.showResolved ? null : /* @__PURE__ */ q(
|
|
898
|
+
let { t: r } = A();
|
|
899
|
+
return n === 0 && !e.showResolved ? null : /* @__PURE__ */ q(u, {
|
|
900
900
|
label: r("material.editor.comments.show-resolved", "Show resolved"),
|
|
901
901
|
checked: e.showResolved,
|
|
902
902
|
onCheckedChange: t.setShowResolved
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
905
|
function Nr({ state: e, empty: t }) {
|
|
906
|
-
let { t: n } =
|
|
906
|
+
let { t: n } = A(), r = null;
|
|
907
907
|
return e.phase === "loading" ? r = n("material.editor.comments.loading", "Loading comments…") : e.phase === "failed" ? r = n("material.editor.comments.load-failed", "Comments could not be loaded: {message}", { message: e.loadError ?? "" }) : t && (r = n("material.editor.comments.empty", "No comments yet")), r ? /* @__PURE__ */ q("p", {
|
|
908
908
|
role: e.phase === "failed" ? "alert" : void 0,
|
|
909
909
|
className: "px-1 text-muted-foreground text-sm",
|
|
@@ -913,10 +913,10 @@ function Nr({ state: e, empty: t }) {
|
|
|
913
913
|
//#endregion
|
|
914
914
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-edit-form.tsx
|
|
915
915
|
function Pr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
916
|
-
let { t: i } =
|
|
916
|
+
let { t: i } = A();
|
|
917
917
|
return /* @__PURE__ */ J("div", {
|
|
918
918
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2",
|
|
919
|
-
children: [/* @__PURE__ */ q(
|
|
919
|
+
children: [/* @__PURE__ */ q(S, {
|
|
920
920
|
className: gr,
|
|
921
921
|
"aria-label": i("material.editor.comments.body-label", "Comment"),
|
|
922
922
|
value: e,
|
|
@@ -928,14 +928,14 @@ function Pr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
|
928
928
|
}
|
|
929
929
|
}), /* @__PURE__ */ J("div", {
|
|
930
930
|
className: "flex gap-2",
|
|
931
|
-
children: [/* @__PURE__ */ q(
|
|
931
|
+
children: [/* @__PURE__ */ q(j, {
|
|
932
932
|
size: "sm",
|
|
933
933
|
disabled: !e.trim(),
|
|
934
934
|
onClick: n,
|
|
935
935
|
children: i("material.editor.comments.save", "Save")
|
|
936
|
-
}), /* @__PURE__ */ q(
|
|
936
|
+
}), /* @__PURE__ */ q(j, {
|
|
937
937
|
size: "sm",
|
|
938
|
-
variant:
|
|
938
|
+
variant: Ze,
|
|
939
939
|
onClick: r,
|
|
940
940
|
children: i("material.editor.comments.cancel", "Cancel")
|
|
941
941
|
})]
|
|
@@ -976,7 +976,7 @@ var Fr = "pending:", Ir = (e) => e.id.startsWith(Fr), Lr = (e, t, n) => e.map((e
|
|
|
976
976
|
if (!Gr(e) || !Gr(e.author)) return null;
|
|
977
977
|
let { id: t, body: n, author: r } = e;
|
|
978
978
|
return typeof t != "string" || !t || typeof n != "string" || typeof r.name != "string" ? null : e;
|
|
979
|
-
}, qr = (e) => !Gr(e) || !
|
|
979
|
+
}, qr = (e) => !Gr(e) || !wt(e.id) || !Array.isArray(e.comments) ? null : {
|
|
980
980
|
...e,
|
|
981
981
|
quote: typeof e.quote == "string" ? e.quote : "",
|
|
982
982
|
resolved: e.resolved === !0,
|
|
@@ -1006,12 +1006,12 @@ function Xr(e, t, n) {
|
|
|
1006
1006
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-entry.tsx
|
|
1007
1007
|
var Zr = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase()).join("");
|
|
1008
1008
|
function Qr({ comment: e, pending: t, onEdit: n }) {
|
|
1009
|
-
let { t: r, language: i } =
|
|
1009
|
+
let { t: r, language: i } = A();
|
|
1010
1010
|
return /* @__PURE__ */ J("div", {
|
|
1011
1011
|
className: "flex items-center gap-2",
|
|
1012
1012
|
children: [
|
|
1013
|
-
/* @__PURE__ */ q(
|
|
1014
|
-
src:
|
|
1013
|
+
/* @__PURE__ */ q(ge, {
|
|
1014
|
+
src: ht(e.author.avatarUrl),
|
|
1015
1015
|
alt: "",
|
|
1016
1016
|
fallback: Zr(e.author.name),
|
|
1017
1017
|
className: "size-6 text-[0.625rem]"
|
|
@@ -1025,7 +1025,7 @@ function Qr({ comment: e, pending: t, onEdit: n }) {
|
|
|
1025
1025
|
className: "shrink-0 text-muted-foreground text-xs",
|
|
1026
1026
|
children: t ? r("material.editor.comments.sending", "Sending…") : Xr(e.createdAt, Date.now(), i)
|
|
1027
1027
|
}),
|
|
1028
|
-
n && !t && /* @__PURE__ */ q(
|
|
1028
|
+
n && !t && /* @__PURE__ */ q(j, {
|
|
1029
1029
|
variant: "ghost",
|
|
1030
1030
|
size: "xs",
|
|
1031
1031
|
className: "ms-auto",
|
|
@@ -1036,7 +1036,7 @@ function Qr({ comment: e, pending: t, onEdit: n }) {
|
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
1038
|
function $r({ comment: e, editable: n, onEdit: r }) {
|
|
1039
|
-
let [i, a] =
|
|
1039
|
+
let [i, a] = W(null), o = Ir(e), s = async () => {
|
|
1040
1040
|
let t = i;
|
|
1041
1041
|
a(null), t !== null && t.trim() !== e.body && await r(t);
|
|
1042
1042
|
};
|
|
@@ -1062,11 +1062,11 @@ function $r({ comment: e, editable: n, onEdit: r }) {
|
|
|
1062
1062
|
//#endregion
|
|
1063
1063
|
//#region lib/components/ui/widgets/editor/extensions/comments/thread-reply.tsx
|
|
1064
1064
|
function ei({ thread: e, controller: t, canRemove: n }) {
|
|
1065
|
-
let { t: r } =
|
|
1065
|
+
let { t: r } = A(), [i, a] = W(""), o = async () => {
|
|
1066
1066
|
let n = i;
|
|
1067
1067
|
n.trim() && (a(""), await t.reply(e.id, n) || a(n));
|
|
1068
1068
|
};
|
|
1069
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
1069
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(S, {
|
|
1070
1070
|
className: gr,
|
|
1071
1071
|
"aria-label": r("material.editor.comments.reply-label", "Reply to this thread"),
|
|
1072
1072
|
placeholder: r("material.editor.comments.reply-placeholder", "Reply…"),
|
|
@@ -1079,7 +1079,7 @@ function ei({ thread: e, controller: t, canRemove: n }) {
|
|
|
1079
1079
|
}), /* @__PURE__ */ J("div", {
|
|
1080
1080
|
className: "flex flex-wrap gap-2",
|
|
1081
1081
|
children: [
|
|
1082
|
-
/* @__PURE__ */ q(
|
|
1082
|
+
/* @__PURE__ */ q(j, {
|
|
1083
1083
|
size: "sm",
|
|
1084
1084
|
variant: "outlined",
|
|
1085
1085
|
color: "default",
|
|
@@ -1087,13 +1087,13 @@ function ei({ thread: e, controller: t, canRemove: n }) {
|
|
|
1087
1087
|
onClick: () => void o(),
|
|
1088
1088
|
children: r("material.editor.comments.reply", "Reply")
|
|
1089
1089
|
}),
|
|
1090
|
-
/* @__PURE__ */ q(
|
|
1090
|
+
/* @__PURE__ */ q(j, {
|
|
1091
1091
|
size: "sm",
|
|
1092
1092
|
variant: "tonal",
|
|
1093
1093
|
onClick: () => void t.resolve(e.id, !e.resolved),
|
|
1094
1094
|
children: e.resolved ? r("material.editor.comments.reopen", "Reopen") : r("material.editor.comments.resolve", "Resolve")
|
|
1095
1095
|
}),
|
|
1096
|
-
n && /* @__PURE__ */ q(
|
|
1096
|
+
n && /* @__PURE__ */ q(j, {
|
|
1097
1097
|
size: "sm",
|
|
1098
1098
|
variant: "ghost",
|
|
1099
1099
|
color: "error",
|
|
@@ -1107,7 +1107,7 @@ function ei({ thread: e, controller: t, canRemove: n }) {
|
|
|
1107
1107
|
//#endregion
|
|
1108
1108
|
//#region lib/components/ui/widgets/editor/extensions/comments/thread-card.tsx
|
|
1109
1109
|
function ti(e) {
|
|
1110
|
-
let { thread: n, controller: r, active: i, detached: a, error: o, user: s } = e, { t: c } =
|
|
1110
|
+
let { thread: n, controller: r, active: i, detached: a, error: o, user: s } = e, { t: c } = A(), l = n.comments[0]?.author.id === s?.id && !!s;
|
|
1111
1111
|
return /* @__PURE__ */ J("section", {
|
|
1112
1112
|
ref: e.cardRef,
|
|
1113
1113
|
"data-slot": "comment-thread",
|
|
@@ -1151,7 +1151,7 @@ function ti(e) {
|
|
|
1151
1151
|
//#endregion
|
|
1152
1152
|
//#region lib/components/ui/widgets/editor/extensions/comments/detached-threads.tsx
|
|
1153
1153
|
function ni({ views: e }) {
|
|
1154
|
-
let { t } =
|
|
1154
|
+
let { t } = A(), { controller: n, state: r, detached: i } = e;
|
|
1155
1155
|
return !n || i.length === 0 ? null : /* @__PURE__ */ J("section", {
|
|
1156
1156
|
"data-slot": "comment-detached",
|
|
1157
1157
|
className: "grid gap-2",
|
|
@@ -1327,7 +1327,7 @@ var _i = class {
|
|
|
1327
1327
|
current;
|
|
1328
1328
|
core;
|
|
1329
1329
|
constructor(e, t = !1) {
|
|
1330
|
-
this.host = e, this.store =
|
|
1330
|
+
this.host = e, this.store = pt(br(t)), this.core = {
|
|
1331
1331
|
host: e,
|
|
1332
1332
|
get: () => this.state,
|
|
1333
1333
|
set: (e) => this.set(e),
|
|
@@ -1446,7 +1446,7 @@ var _i = class {
|
|
|
1446
1446
|
//#endregion
|
|
1447
1447
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-thread-views.ts
|
|
1448
1448
|
function vi(e) {
|
|
1449
|
-
let t = wr(e), n = Y(e), r = hi(t), { anchors: i } = t, a =
|
|
1449
|
+
let t = wr(e), n = Y(e), r = hi(t), { anchors: i } = t, a = H(() => {
|
|
1450
1450
|
let e = new Map(r.map((e) => [e.id, e]));
|
|
1451
1451
|
return {
|
|
1452
1452
|
anchored: oi(i).flatMap((t) => e.get(t) ?? []),
|
|
@@ -1466,7 +1466,7 @@ function vi(e) {
|
|
|
1466
1466
|
//#endregion
|
|
1467
1467
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-panel.tsx
|
|
1468
1468
|
function yi(e) {
|
|
1469
|
-
let { handle: t, chrome: n } =
|
|
1469
|
+
let { handle: t, chrome: n } = O(), { editor: r } = t;
|
|
1470
1470
|
return !r || !Y(r) ? null : /* @__PURE__ */ q(jr, {
|
|
1471
1471
|
id: "comments",
|
|
1472
1472
|
className: "max-h-[min(36rem,80svh)] w-96 max-w-[92vw] overflow-y-auto p-3",
|
|
@@ -1475,16 +1475,16 @@ function yi(e) {
|
|
|
1475
1475
|
});
|
|
1476
1476
|
}
|
|
1477
1477
|
function bi({ editor: e }) {
|
|
1478
|
-
let { t } =
|
|
1479
|
-
if (
|
|
1478
|
+
let { t } = A(), n = vi(e), { controller: r, state: i, anchored: a } = n, o = U(null);
|
|
1479
|
+
if (V(() => {
|
|
1480
1480
|
o.current?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" });
|
|
1481
1481
|
}, [i.activeId]), !r) return null;
|
|
1482
|
-
let s = (e, t) => /* @__PURE__ */ q(
|
|
1482
|
+
let s = (e, t) => /* @__PURE__ */ q(M, {
|
|
1483
1483
|
variant: "ghost",
|
|
1484
1484
|
"aria-label": t,
|
|
1485
1485
|
tooltip: t,
|
|
1486
1486
|
onClick: () => r.step(e),
|
|
1487
|
-
children: q(e > 0 ?
|
|
1487
|
+
children: q(e > 0 ? Nt : It, {})
|
|
1488
1488
|
});
|
|
1489
1489
|
return /* @__PURE__ */ J("div", {
|
|
1490
1490
|
ref: o,
|
|
@@ -1561,8 +1561,8 @@ function Ti(e) {
|
|
|
1561
1561
|
//#endregion
|
|
1562
1562
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-rail-observer.ts
|
|
1563
1563
|
function Ei(e, t, n) {
|
|
1564
|
-
let r =
|
|
1565
|
-
return
|
|
1564
|
+
let r = U(null);
|
|
1565
|
+
return V(() => {
|
|
1566
1566
|
if (typeof ResizeObserver > "u") return;
|
|
1567
1567
|
let i = new ResizeObserver(n);
|
|
1568
1568
|
r.current = i, i.observe(e.view.dom);
|
|
@@ -1582,11 +1582,11 @@ function Ei(e, t, n) {
|
|
|
1582
1582
|
//#endregion
|
|
1583
1583
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-rail-layout.ts
|
|
1584
1584
|
function Di(e, t, n, r) {
|
|
1585
|
-
let i =
|
|
1585
|
+
let i = U(/* @__PURE__ */ new Map()), a = U(/* @__PURE__ */ new Map()), o = U(0), [s, c] = W({
|
|
1586
1586
|
tops: {},
|
|
1587
1587
|
height: 0,
|
|
1588
1588
|
measured: !1
|
|
1589
|
-
}), l =
|
|
1589
|
+
}), l = U({
|
|
1590
1590
|
items: n,
|
|
1591
1591
|
activeId: r
|
|
1592
1592
|
});
|
|
@@ -1594,7 +1594,7 @@ function Di(e, t, n, r) {
|
|
|
1594
1594
|
items: n,
|
|
1595
1595
|
activeId: r
|
|
1596
1596
|
};
|
|
1597
|
-
let u = n.map((e) => e.id).join(","), d = n.map((e) => e.from).join(","), f =
|
|
1597
|
+
let u = n.map((e) => e.id).join(","), d = n.map((e) => e.from).join(","), f = B(() => {
|
|
1598
1598
|
let { items: n, activeId: r } = l.current, a = Ti({
|
|
1599
1599
|
editor: e,
|
|
1600
1600
|
box: t.current,
|
|
@@ -1603,18 +1603,18 @@ function Di(e, t, n, r) {
|
|
|
1603
1603
|
activeId: r
|
|
1604
1604
|
});
|
|
1605
1605
|
a && c((e) => wi(e, a) ? e : a);
|
|
1606
|
-
}, [t, e]), p =
|
|
1606
|
+
}, [t, e]), p = B(() => {
|
|
1607
1607
|
o.current ||= requestAnimationFrame(() => {
|
|
1608
1608
|
o.current = 0, f();
|
|
1609
1609
|
});
|
|
1610
1610
|
}, [f]);
|
|
1611
|
-
|
|
1611
|
+
xn(f, [
|
|
1612
1612
|
u,
|
|
1613
1613
|
r,
|
|
1614
1614
|
f
|
|
1615
|
-
]),
|
|
1615
|
+
]), V(p, [d, p]);
|
|
1616
1616
|
let { observe: m, unobserve: h } = Ei(e, i, p);
|
|
1617
|
-
return
|
|
1617
|
+
return V(() => () => {
|
|
1618
1618
|
cancelAnimationFrame(o.current), o.current = 0;
|
|
1619
1619
|
}, []), {
|
|
1620
1620
|
layout: s,
|
|
@@ -1630,15 +1630,15 @@ function Di(e, t, n, r) {
|
|
|
1630
1630
|
//#endregion
|
|
1631
1631
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-rail.tsx
|
|
1632
1632
|
function Oi(e) {
|
|
1633
|
-
let { handle: t } =
|
|
1633
|
+
let { handle: t } = O(), { editor: n } = t;
|
|
1634
1634
|
return !n || !Y(n) ? null : /* @__PURE__ */ q(ki, { editor: n });
|
|
1635
1635
|
}
|
|
1636
1636
|
function ki({ editor: e }) {
|
|
1637
|
-
let { t } =
|
|
1637
|
+
let { t } = A(), n = vi(e), { controller: r, state: i, anchored: a } = n, o = U(null), { layout: s, cardRef: c } = Di(e, o, a.map((e) => ({
|
|
1638
1638
|
id: e.id,
|
|
1639
1639
|
from: i.anchors[e.id]?.from ?? 0
|
|
1640
1640
|
})), i.activeId);
|
|
1641
|
-
return
|
|
1641
|
+
return V(() => (r?.setRail(!0), () => r?.setRail(!1)), [r]), r ? /* @__PURE__ */ J("section", {
|
|
1642
1642
|
"data-slot": "editor-comments-rail",
|
|
1643
1643
|
"aria-label": t("material.editor.comments.threads", "Comment threads"),
|
|
1644
1644
|
className: "grid gap-3",
|
|
@@ -1686,7 +1686,7 @@ function Ai(e, t) {
|
|
|
1686
1686
|
//#endregion
|
|
1687
1687
|
//#region lib/components/ui/widgets/editor/extensions/block/block-drag.ts
|
|
1688
1688
|
function ji(e, t, n) {
|
|
1689
|
-
let { view: r } = e, i =
|
|
1689
|
+
let { view: r } = e, i = dt.create(r.state.doc, t.pos);
|
|
1690
1690
|
r.dispatch(r.state.tr.setSelection(i)), r.dragging = {
|
|
1691
1691
|
slice: i.content(),
|
|
1692
1692
|
move: !0
|
|
@@ -1704,7 +1704,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1704
1704
|
id: "paragraph",
|
|
1705
1705
|
label: "Paragraph",
|
|
1706
1706
|
key: "material.editor.block.paragraph",
|
|
1707
|
-
icon:
|
|
1707
|
+
icon: en,
|
|
1708
1708
|
node: "paragraph",
|
|
1709
1709
|
run: (e) => e.chain().focus().setParagraph().run()
|
|
1710
1710
|
},
|
|
@@ -1712,7 +1712,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1712
1712
|
id: "h1",
|
|
1713
1713
|
label: "Heading 1",
|
|
1714
1714
|
key: "material.editor.block.heading-1",
|
|
1715
|
-
icon:
|
|
1715
|
+
icon: Ut,
|
|
1716
1716
|
node: "heading",
|
|
1717
1717
|
run: Mi(1)
|
|
1718
1718
|
},
|
|
@@ -1720,7 +1720,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1720
1720
|
id: "h2",
|
|
1721
1721
|
label: "Heading 2",
|
|
1722
1722
|
key: "material.editor.block.heading-2",
|
|
1723
|
-
icon:
|
|
1723
|
+
icon: Wt,
|
|
1724
1724
|
node: "heading",
|
|
1725
1725
|
run: Mi(2)
|
|
1726
1726
|
},
|
|
@@ -1728,7 +1728,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1728
1728
|
id: "h3",
|
|
1729
1729
|
label: "Heading 3",
|
|
1730
1730
|
key: "material.editor.block.heading-3",
|
|
1731
|
-
icon:
|
|
1731
|
+
icon: Gt,
|
|
1732
1732
|
node: "heading",
|
|
1733
1733
|
run: Mi(3)
|
|
1734
1734
|
},
|
|
@@ -1736,7 +1736,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1736
1736
|
id: "bullet",
|
|
1737
1737
|
label: "Bulleted list",
|
|
1738
1738
|
key: "material.editor.block.bullet-list",
|
|
1739
|
-
icon:
|
|
1739
|
+
icon: qt,
|
|
1740
1740
|
node: "bulletList",
|
|
1741
1741
|
run: (e) => e.chain().focus().toggleBulletList().run()
|
|
1742
1742
|
},
|
|
@@ -1744,7 +1744,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1744
1744
|
id: "ordered",
|
|
1745
1745
|
label: "Numbered list",
|
|
1746
1746
|
key: "material.editor.block.ordered-list",
|
|
1747
|
-
icon:
|
|
1747
|
+
icon: Jt,
|
|
1748
1748
|
node: "orderedList",
|
|
1749
1749
|
run: (e) => e.chain().focus().toggleOrderedList().run()
|
|
1750
1750
|
},
|
|
@@ -1752,7 +1752,7 @@ var Mi = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Ni = [
|
|
|
1752
1752
|
id: "quote",
|
|
1753
1753
|
label: "Quote",
|
|
1754
1754
|
key: "material.editor.block.quote",
|
|
1755
|
-
icon:
|
|
1755
|
+
icon: nn,
|
|
1756
1756
|
node: "blockquote",
|
|
1757
1757
|
run: (e) => e.chain().focus().toggleBlockquote().run()
|
|
1758
1758
|
}
|
|
@@ -1778,7 +1778,7 @@ function Fi(e, t) {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
var Ii = (e) => Fi(e.doc, e.selection.head);
|
|
1780
1780
|
function Li(e, t) {
|
|
1781
|
-
let n = t.node.isAtom ?
|
|
1781
|
+
let n = t.node.isAtom ? dt.create(e.doc, t.pos) : R.near(e.doc.resolve(t.pos + 1));
|
|
1782
1782
|
return e.setSelection(n);
|
|
1783
1783
|
}
|
|
1784
1784
|
function Ri(e, t, n = Ii(e)) {
|
|
@@ -1788,7 +1788,7 @@ function Ri(e, t, n = Ii(e)) {
|
|
|
1788
1788
|
let { tr: i } = e, a = e.selection.head, o = e.selection.anchor, s = t === 1 ? n.pos : n.pos - r.nodeSize, c = t === 1 ? n.pos + n.node.nodeSize + r.nodeSize : n.pos + n.node.nodeSize, l = t === 1 ? [r, n.node] : [n.node, r];
|
|
1789
1789
|
i.replaceWith(s, c, l);
|
|
1790
1790
|
let u = t === 1 ? r.nodeSize : -r.nodeSize;
|
|
1791
|
-
return a >= n.pos && a <= n.pos + n.node.nodeSize && e.selection instanceof
|
|
1791
|
+
return a >= n.pos && a <= n.pos + n.node.nodeSize && e.selection instanceof R ? i.setSelection(R.create(i.doc, o + u, a + u)) : e.selection instanceof dt && i.setSelection(dt.create(i.doc, n.pos + u)), i.scrollIntoView();
|
|
1792
1792
|
}
|
|
1793
1793
|
function zi(e, t = Ii(e)) {
|
|
1794
1794
|
if (!t) return null;
|
|
@@ -1808,7 +1808,7 @@ function Bi(e, t = Ii(e)) {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
n.delete(t.pos, r);
|
|
1810
1810
|
let i = Math.min(t.pos, n.doc.content.size);
|
|
1811
|
-
return n.setSelection(
|
|
1811
|
+
return n.setSelection(R.near(n.doc.resolve(i), -1)).scrollIntoView();
|
|
1812
1812
|
}
|
|
1813
1813
|
//#endregion
|
|
1814
1814
|
//#region lib/components/ui/widgets/editor/extensions/block/block-menu.tsx
|
|
@@ -1817,52 +1817,52 @@ function Vi(e, t) {
|
|
|
1817
1817
|
n && e.view.dispatch(n), e.isDestroyed || e.commands.focus();
|
|
1818
1818
|
}
|
|
1819
1819
|
function Hi({ editor: e, block: t }) {
|
|
1820
|
-
let { t: n } =
|
|
1820
|
+
let { t: n } = A(), { doc: r } = e.state, i = () => ({
|
|
1821
1821
|
...t,
|
|
1822
1822
|
node: r.child(t.index)
|
|
1823
1823
|
});
|
|
1824
1824
|
return /* @__PURE__ */ J(K, { children: [
|
|
1825
|
-
/* @__PURE__ */ J(
|
|
1825
|
+
/* @__PURE__ */ J(Ge, { children: [/* @__PURE__ */ q(He, { children: n("material.editor.block.turn-into", "Turn into") }), Pi(e).map((t) => /* @__PURE__ */ J(k, {
|
|
1826
1826
|
onSelect: () => t.run(e),
|
|
1827
1827
|
children: [/* @__PURE__ */ q(t.icon, {}), n(t.key, t.label)]
|
|
1828
1828
|
}, t.id))] }),
|
|
1829
|
-
/* @__PURE__ */ q(
|
|
1830
|
-
/* @__PURE__ */ J(
|
|
1831
|
-
/* @__PURE__ */ J(
|
|
1829
|
+
/* @__PURE__ */ q(We, {}),
|
|
1830
|
+
/* @__PURE__ */ J(Ge, { children: [
|
|
1831
|
+
/* @__PURE__ */ J(k, {
|
|
1832
1832
|
onSelect: () => Vi(e, () => zi(e.state, i())),
|
|
1833
|
-
children: [/* @__PURE__ */ q(
|
|
1833
|
+
children: [/* @__PURE__ */ q(Rt, {}), n("material.editor.block.duplicate", "Duplicate")]
|
|
1834
1834
|
}),
|
|
1835
|
-
/* @__PURE__ */ J(
|
|
1835
|
+
/* @__PURE__ */ J(k, {
|
|
1836
1836
|
disabled: t.index === 0,
|
|
1837
1837
|
onSelect: () => Vi(e, () => Ri(e.state, -1, i())),
|
|
1838
1838
|
children: [
|
|
1839
|
-
/* @__PURE__ */ q(
|
|
1839
|
+
/* @__PURE__ */ q(kt, {}),
|
|
1840
1840
|
n("material.editor.block.move-up", "Move up"),
|
|
1841
|
-
/* @__PURE__ */ q(
|
|
1841
|
+
/* @__PURE__ */ q(Ke, { children: "⌥⇧↑" })
|
|
1842
1842
|
]
|
|
1843
1843
|
}),
|
|
1844
|
-
/* @__PURE__ */ J(
|
|
1844
|
+
/* @__PURE__ */ J(k, {
|
|
1845
1845
|
disabled: t.index >= r.childCount - 1,
|
|
1846
1846
|
onSelect: () => Vi(e, () => Ri(e.state, 1, i())),
|
|
1847
1847
|
children: [
|
|
1848
|
-
/* @__PURE__ */ q(
|
|
1848
|
+
/* @__PURE__ */ q(Ot, {}),
|
|
1849
1849
|
n("material.editor.block.move-down", "Move down"),
|
|
1850
|
-
/* @__PURE__ */ q(
|
|
1850
|
+
/* @__PURE__ */ q(Ke, { children: "⌥⇧↓" })
|
|
1851
1851
|
]
|
|
1852
1852
|
})
|
|
1853
1853
|
] }),
|
|
1854
|
-
/* @__PURE__ */ q(
|
|
1855
|
-
/* @__PURE__ */ J(
|
|
1854
|
+
/* @__PURE__ */ q(We, {}),
|
|
1855
|
+
/* @__PURE__ */ J(k, {
|
|
1856
1856
|
variant: "error",
|
|
1857
1857
|
onSelect: () => Vi(e, () => Bi(e.state, i())),
|
|
1858
|
-
children: [/* @__PURE__ */ q(
|
|
1858
|
+
children: [/* @__PURE__ */ q(mn, {}), n("material.editor.block.delete", "Delete")]
|
|
1859
1859
|
})
|
|
1860
1860
|
] });
|
|
1861
1861
|
}
|
|
1862
1862
|
//#endregion
|
|
1863
1863
|
//#region lib/components/ui/widgets/editor/extensions/block/use-active-block.ts
|
|
1864
1864
|
function Ui(e, t, n) {
|
|
1865
|
-
let [r, i] =
|
|
1865
|
+
let [r, i] = W(null), [a, o] = W(null), s = B(() => {
|
|
1866
1866
|
let n = t.current;
|
|
1867
1867
|
if (!n) return;
|
|
1868
1868
|
let { doc: i } = e.state, a = r === null ? Ii(e.state) : Fi(i, Math.min(r, i.content.size)), s = a ? e.view.nodeDOM(a.pos) : null;
|
|
@@ -1877,7 +1877,7 @@ function Ui(e, t, n) {
|
|
|
1877
1877
|
t,
|
|
1878
1878
|
r
|
|
1879
1879
|
]);
|
|
1880
|
-
return
|
|
1880
|
+
return V(() => {
|
|
1881
1881
|
if (n) return;
|
|
1882
1882
|
let t = 0, r = () => {
|
|
1883
1883
|
t ||= requestAnimationFrame(() => {
|
|
@@ -1893,7 +1893,7 @@ function Ui(e, t, n) {
|
|
|
1893
1893
|
n
|
|
1894
1894
|
]), {
|
|
1895
1895
|
active: a,
|
|
1896
|
-
hover:
|
|
1896
|
+
hover: B((r, a) => {
|
|
1897
1897
|
let o = t.current;
|
|
1898
1898
|
if (!o || n) return;
|
|
1899
1899
|
let s = o.getBoundingClientRect(), c = e.view.posAtCoords({
|
|
@@ -1906,7 +1906,7 @@ function Ui(e, t, n) {
|
|
|
1906
1906
|
t,
|
|
1907
1907
|
n
|
|
1908
1908
|
]),
|
|
1909
|
-
unhover:
|
|
1909
|
+
unhover: B(() => {
|
|
1910
1910
|
n || i(null);
|
|
1911
1911
|
}, [n])
|
|
1912
1912
|
};
|
|
@@ -1914,7 +1914,7 @@ function Ui(e, t, n) {
|
|
|
1914
1914
|
//#endregion
|
|
1915
1915
|
//#region lib/components/ui/widgets/editor/partials/editor-block-handle.tsx
|
|
1916
1916
|
function Wi({ children: e, className: t }) {
|
|
1917
|
-
let { handle: n } =
|
|
1917
|
+
let { handle: n } = O(), r = n.features.some((e) => e.key === "dragHandle");
|
|
1918
1918
|
return !n.editor || !r ? /* @__PURE__ */ q("div", {
|
|
1919
1919
|
className: t,
|
|
1920
1920
|
children: e
|
|
@@ -1925,7 +1925,7 @@ function Wi({ children: e, className: t }) {
|
|
|
1925
1925
|
});
|
|
1926
1926
|
}
|
|
1927
1927
|
function Gi({ editor: e, children: n, className: r }) {
|
|
1928
|
-
let { chrome: i } =
|
|
1928
|
+
let { chrome: i } = O(), a = U(null), o = N({
|
|
1929
1929
|
editor: e,
|
|
1930
1930
|
selector: (e) => e.editor.isEditable
|
|
1931
1931
|
}), s = i.state.panel === "block" && o, { active: c, hover: l, unhover: u } = Ui(e, a, s);
|
|
@@ -1943,24 +1943,24 @@ function Gi({ editor: e, children: n, className: r }) {
|
|
|
1943
1943
|
});
|
|
1944
1944
|
}
|
|
1945
1945
|
function Ki({ editor: e, active: n, open: r }) {
|
|
1946
|
-
let { t: i } =
|
|
1946
|
+
let { t: i } = A(), { chrome: a } = O();
|
|
1947
1947
|
return /* @__PURE__ */ J("div", {
|
|
1948
1948
|
"data-slot": "editor-block-handle",
|
|
1949
1949
|
"data-open": r || void 0,
|
|
1950
1950
|
style: { top: n.top },
|
|
1951
1951
|
className: t("absolute end-full me-1.5 flex items-center opacity-0 transition-opacity duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast motion-reduce:transition-none", "group-hover/blocks:opacity-100 group-focus-within/blocks:opacity-100 data-open:opacity-100", "@max-xl:invisible not-pointer-fine:invisible"),
|
|
1952
|
-
children: [/* @__PURE__ */ q(
|
|
1952
|
+
children: [/* @__PURE__ */ q(M, {
|
|
1953
1953
|
variant: "ghost",
|
|
1954
1954
|
className: "size-6 text-muted-foreground",
|
|
1955
1955
|
tooltip: i("material.editor.block.add", "Add a block below"),
|
|
1956
1956
|
onClick: () => Ai(e, n),
|
|
1957
|
-
children: /* @__PURE__ */ q(
|
|
1958
|
-
}), /* @__PURE__ */ J(
|
|
1957
|
+
children: /* @__PURE__ */ q(tn, {})
|
|
1958
|
+
}), /* @__PURE__ */ J(qe, {
|
|
1959
1959
|
open: r,
|
|
1960
1960
|
onOpenChange: (e) => e ? a.actions.openPanel("block") : a.actions.closePanel(),
|
|
1961
|
-
children: [/* @__PURE__ */ q(
|
|
1961
|
+
children: [/* @__PURE__ */ q(Ve, {
|
|
1962
1962
|
asChild: !0,
|
|
1963
|
-
children: /* @__PURE__ */ q(
|
|
1963
|
+
children: /* @__PURE__ */ q(M, {
|
|
1964
1964
|
variant: "ghost",
|
|
1965
1965
|
draggable: !0,
|
|
1966
1966
|
className: "size-6 cursor-grab text-muted-foreground active:cursor-grabbing",
|
|
@@ -1972,9 +1972,9 @@ function Ki({ editor: e, active: n, open: r }) {
|
|
|
1972
1972
|
Ii(e.state)?.pos !== n.pos && e.view.dispatch(Li(e.state.tr, n)), a.actions.openPanel("block");
|
|
1973
1973
|
},
|
|
1974
1974
|
onDragStart: (t) => ji(e, n, t.nativeEvent),
|
|
1975
|
-
children: /* @__PURE__ */ q(
|
|
1975
|
+
children: /* @__PURE__ */ q(Ht, {})
|
|
1976
1976
|
})
|
|
1977
|
-
}), /* @__PURE__ */ q(
|
|
1977
|
+
}), /* @__PURE__ */ q(Ue, {
|
|
1978
1978
|
align: "start",
|
|
1979
1979
|
onCloseAutoFocus: (t) => {
|
|
1980
1980
|
t.preventDefault(), e.isDestroyed || e.commands.focus();
|
|
@@ -1990,7 +1990,7 @@ function Ki({ editor: e, active: n, open: r }) {
|
|
|
1990
1990
|
//#endregion
|
|
1991
1991
|
//#region lib/components/ui/widgets/editor/extensions/find/find-fields.tsx
|
|
1992
1992
|
function qi({ find: e }) {
|
|
1993
|
-
let { t } =
|
|
1993
|
+
let { t } = A(), n = "";
|
|
1994
1994
|
return e.term && (n = e.total === 0 ? t("material.editor.find.none", "No results") : t("material.editor.find.count", "{current} of {total}", {
|
|
1995
1995
|
current: e.current + 1,
|
|
1996
1996
|
total: e.total
|
|
@@ -2002,45 +2002,45 @@ function qi({ find: e }) {
|
|
|
2002
2002
|
});
|
|
2003
2003
|
}
|
|
2004
2004
|
function Ji({ find: e }) {
|
|
2005
|
-
let { t } =
|
|
2006
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
2005
|
+
let { t } = A();
|
|
2006
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(he, {
|
|
2007
2007
|
size: "sm",
|
|
2008
2008
|
"aria-label": t("material.editor.find.match-case", "Match case"),
|
|
2009
2009
|
pressed: e.caseSensitive,
|
|
2010
2010
|
onPressedChange: e.setCaseSensitive,
|
|
2011
|
-
children: /* @__PURE__ */ q(
|
|
2012
|
-
}), /* @__PURE__ */ q(
|
|
2011
|
+
children: /* @__PURE__ */ q(jt, {})
|
|
2012
|
+
}), /* @__PURE__ */ q(he, {
|
|
2013
2013
|
size: "sm",
|
|
2014
2014
|
"aria-label": t("material.editor.find.whole-word", "Whole word"),
|
|
2015
2015
|
pressed: e.wholeWord,
|
|
2016
2016
|
onPressedChange: e.setWholeWord,
|
|
2017
|
-
children: /* @__PURE__ */ q(
|
|
2017
|
+
children: /* @__PURE__ */ q(gn, {})
|
|
2018
2018
|
})] });
|
|
2019
2019
|
}
|
|
2020
2020
|
function Yi({ disabled: e, onStep: t }) {
|
|
2021
|
-
let { t: n } =
|
|
2022
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
2021
|
+
let { t: n } = A();
|
|
2022
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(M, {
|
|
2023
2023
|
variant: "ghost",
|
|
2024
2024
|
className: "size-8",
|
|
2025
2025
|
tooltip: n("material.editor.find.previous", "Previous match"),
|
|
2026
2026
|
disabled: e,
|
|
2027
2027
|
onClick: () => t(-1),
|
|
2028
|
-
children: /* @__PURE__ */ q(
|
|
2029
|
-
}), /* @__PURE__ */ q(
|
|
2028
|
+
children: /* @__PURE__ */ q(It, {})
|
|
2029
|
+
}), /* @__PURE__ */ q(M, {
|
|
2030
2030
|
variant: "ghost",
|
|
2031
2031
|
className: "size-8",
|
|
2032
2032
|
tooltip: n("material.editor.find.next", "Next match"),
|
|
2033
2033
|
disabled: e,
|
|
2034
2034
|
onClick: () => t(1),
|
|
2035
|
-
children: /* @__PURE__ */ q(
|
|
2035
|
+
children: /* @__PURE__ */ q(Nt, {})
|
|
2036
2036
|
})] });
|
|
2037
2037
|
}
|
|
2038
2038
|
function Xi({ find: e, inputRef: t, onStep: n, onClose: r, onKeyDown: i, replaceOpen: a, canReplace: o = !0, onToggleReplace: s }) {
|
|
2039
|
-
let { t: c } =
|
|
2039
|
+
let { t: c } = A();
|
|
2040
2040
|
return /* @__PURE__ */ J("div", {
|
|
2041
2041
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2042
2042
|
children: [
|
|
2043
|
-
/* @__PURE__ */ q(
|
|
2043
|
+
/* @__PURE__ */ q(Be, {
|
|
2044
2044
|
ref: t,
|
|
2045
2045
|
type: "search",
|
|
2046
2046
|
"aria-label": c("material.editor.find.find", "Find"),
|
|
@@ -2051,25 +2051,25 @@ function Xi({ find: e, inputRef: t, onStep: n, onClose: r, onKeyDown: i, replace
|
|
|
2051
2051
|
className: "h-8 min-w-0 flex-1 basis-40 sm:max-w-64"
|
|
2052
2052
|
}),
|
|
2053
2053
|
/* @__PURE__ */ q(Ji, { find: e }),
|
|
2054
|
-
o && /* @__PURE__ */ q(
|
|
2054
|
+
o && /* @__PURE__ */ q(M, {
|
|
2055
2055
|
variant: "ghost",
|
|
2056
2056
|
className: "size-8",
|
|
2057
2057
|
"aria-pressed": a,
|
|
2058
2058
|
tooltip: c("material.editor.find.show-replace", "Show replace"),
|
|
2059
2059
|
onClick: s,
|
|
2060
|
-
children: /* @__PURE__ */ q(
|
|
2060
|
+
children: /* @__PURE__ */ q(rn, {})
|
|
2061
2061
|
}),
|
|
2062
2062
|
/* @__PURE__ */ q(qi, { find: e }),
|
|
2063
2063
|
/* @__PURE__ */ q(Yi, {
|
|
2064
2064
|
disabled: e.total === 0,
|
|
2065
2065
|
onStep: n
|
|
2066
2066
|
}),
|
|
2067
|
-
/* @__PURE__ */ q(
|
|
2067
|
+
/* @__PURE__ */ q(M, {
|
|
2068
2068
|
variant: "ghost",
|
|
2069
2069
|
className: "ms-auto size-8",
|
|
2070
2070
|
tooltip: c("material.editor.find.close", "Close"),
|
|
2071
2071
|
onClick: r,
|
|
2072
|
-
children: /* @__PURE__ */ q(
|
|
2072
|
+
children: /* @__PURE__ */ q(_n, {})
|
|
2073
2073
|
})
|
|
2074
2074
|
]
|
|
2075
2075
|
});
|
|
@@ -2109,7 +2109,7 @@ function ia(e, t, n) {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
//#endregion
|
|
2111
2111
|
//#region lib/components/ui/widgets/editor/extensions/find/find-state.ts
|
|
2112
|
-
var X = new
|
|
2112
|
+
var X = new ut("nxgtFind"), aa = "";
|
|
2113
2113
|
function oa(e) {
|
|
2114
2114
|
let t = [];
|
|
2115
2115
|
return e.descendants((e, n) => e.isTextblock ? (t.push({
|
|
@@ -2118,18 +2118,18 @@ function oa(e) {
|
|
|
2118
2118
|
}), !1) : !0), t;
|
|
2119
2119
|
}
|
|
2120
2120
|
function sa(e, t) {
|
|
2121
|
-
return
|
|
2121
|
+
return F.create(e, t.map((e) => I.inline(e.from, e.to, { class: "nxgt-find-match" })));
|
|
2122
2122
|
}
|
|
2123
2123
|
function ca(e, t) {
|
|
2124
2124
|
let n = t.matches[t.current];
|
|
2125
|
-
return n ?
|
|
2125
|
+
return n ? F.create(e, [I.inline(n.from, n.to, { class: "nxgt-find-current" })]) : F.empty;
|
|
2126
2126
|
}
|
|
2127
2127
|
var la = () => ({
|
|
2128
2128
|
...Zi,
|
|
2129
2129
|
term: "",
|
|
2130
2130
|
matches: [],
|
|
2131
2131
|
current: -1,
|
|
2132
|
-
decorations:
|
|
2132
|
+
decorations: F.empty
|
|
2133
2133
|
});
|
|
2134
2134
|
function ua(e, t, n) {
|
|
2135
2135
|
let r = na(oa(e), t.term, t);
|
|
@@ -2191,7 +2191,7 @@ function fa(e, t, n) {
|
|
|
2191
2191
|
}), !1)), n && (n.blocks += r.length), s.push(...na(r, t.term, t));
|
|
2192
2192
|
}
|
|
2193
2193
|
let c = [...a, ...s].sort((e, t) => e.from - t.from);
|
|
2194
|
-
s.length > 0 && (o = o.add(e.doc, s.map((e) =>
|
|
2194
|
+
s.length > 0 && (o = o.add(e.doc, s.map((e) => I.inline(e.from, e.to, { class: "nxgt-find-match" }))));
|
|
2195
2195
|
let l = t.current >= 0 && t.matches.length === c.length ? Math.min(t.current, c.length - 1) : ra(c, e.selection.from);
|
|
2196
2196
|
return {
|
|
2197
2197
|
...t,
|
|
@@ -2210,7 +2210,7 @@ function ma(e) {
|
|
|
2210
2210
|
return /\n/.test(i) ? "" : i;
|
|
2211
2211
|
}
|
|
2212
2212
|
function ha(e) {
|
|
2213
|
-
let [t, n] =
|
|
2213
|
+
let [t, n] = W(() => ma(e)), [r, i] = W(!1), [a, o] = W(!1), s = N({
|
|
2214
2214
|
editor: e,
|
|
2215
2215
|
selector: ({ editor: e }) => {
|
|
2216
2216
|
let { matches: t, current: n } = pa(e.state);
|
|
@@ -2220,7 +2220,7 @@ function ha(e) {
|
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
2222
2222
|
});
|
|
2223
|
-
return
|
|
2223
|
+
return V(() => {
|
|
2224
2224
|
e.commands.setFind({
|
|
2225
2225
|
term: t,
|
|
2226
2226
|
caseSensitive: r,
|
|
@@ -2231,7 +2231,7 @@ function ha(e) {
|
|
|
2231
2231
|
t,
|
|
2232
2232
|
r,
|
|
2233
2233
|
a
|
|
2234
|
-
]),
|
|
2234
|
+
]), V(() => () => {
|
|
2235
2235
|
e.isDestroyed || e.commands.clearFind();
|
|
2236
2236
|
}, [e]), {
|
|
2237
2237
|
term: t,
|
|
@@ -2247,15 +2247,15 @@ function ha(e) {
|
|
|
2247
2247
|
//#endregion
|
|
2248
2248
|
//#region lib/components/ui/widgets/editor/partials/editor-find-panel.tsx
|
|
2249
2249
|
function ga({ className: e }) {
|
|
2250
|
-
let { handle: t, chrome: n } =
|
|
2250
|
+
let { handle: t, chrome: n } = O(), { editor: r } = t, i = n.state.panel === "find", a = t.features.some((e) => e.key === "find");
|
|
2251
2251
|
return !r || !i || !a ? null : /* @__PURE__ */ q(_a, { className: e });
|
|
2252
2252
|
}
|
|
2253
2253
|
function _a({ className: e }) {
|
|
2254
|
-
let { t } =
|
|
2254
|
+
let { t } = A(), { handle: n, chrome: r } = O(), i = n.editor, a = ha(i), o = U(null), s = N({
|
|
2255
2255
|
editor: i,
|
|
2256
2256
|
selector: (e) => e.editor.isEditable
|
|
2257
2257
|
}), c = s && r.state.findReplace;
|
|
2258
|
-
|
|
2258
|
+
V(() => {
|
|
2259
2259
|
o.current?.focus(), o.current?.select();
|
|
2260
2260
|
}, []);
|
|
2261
2261
|
let l = () => {
|
|
@@ -2286,11 +2286,11 @@ function _a({ className: e }) {
|
|
|
2286
2286
|
});
|
|
2287
2287
|
}
|
|
2288
2288
|
function va({ editor: e, find: t }) {
|
|
2289
|
-
let { t: n } =
|
|
2289
|
+
let { t: n } = A(), [r, i] = W("");
|
|
2290
2290
|
return /* @__PURE__ */ J("div", {
|
|
2291
2291
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2292
2292
|
children: [
|
|
2293
|
-
/* @__PURE__ */ q(
|
|
2293
|
+
/* @__PURE__ */ q(Be, {
|
|
2294
2294
|
"aria-label": n("material.editor.find.replace", "Replace"),
|
|
2295
2295
|
placeholder: n("material.editor.find.replace", "Replace"),
|
|
2296
2296
|
value: r,
|
|
@@ -2300,14 +2300,14 @@ function va({ editor: e, find: t }) {
|
|
|
2300
2300
|
},
|
|
2301
2301
|
className: "h-8 min-w-0 flex-1 basis-40 sm:max-w-64"
|
|
2302
2302
|
}),
|
|
2303
|
-
/* @__PURE__ */ q(
|
|
2303
|
+
/* @__PURE__ */ q(j, {
|
|
2304
2304
|
variant: "tonal",
|
|
2305
2305
|
size: "sm",
|
|
2306
2306
|
disabled: t.total === 0,
|
|
2307
2307
|
onClick: () => e.commands.replaceCurrent(r),
|
|
2308
2308
|
children: n("material.editor.find.replace-one", "Replace")
|
|
2309
2309
|
}),
|
|
2310
|
-
/* @__PURE__ */ q(
|
|
2310
|
+
/* @__PURE__ */ q(j, {
|
|
2311
2311
|
variant: "tonal",
|
|
2312
2312
|
size: "sm",
|
|
2313
2313
|
disabled: t.total === 0,
|
|
@@ -2320,8 +2320,8 @@ function va({ editor: e, find: t }) {
|
|
|
2320
2320
|
//#endregion
|
|
2321
2321
|
//#region lib/components/ui/widgets/editor/partials/editor-focus-exit.tsx
|
|
2322
2322
|
function ya({ className: e }) {
|
|
2323
|
-
let { t: n } =
|
|
2324
|
-
return r.state.focusMode ? /* @__PURE__ */ q(
|
|
2323
|
+
let { t: n } = A(), { chrome: r, handle: i } = O();
|
|
2324
|
+
return r.state.focusMode ? /* @__PURE__ */ q(M, {
|
|
2325
2325
|
variant: "ghost",
|
|
2326
2326
|
"data-slot": "editor-focus-exit",
|
|
2327
2327
|
className: t("size-8 bg-card/80 backdrop-blur", e),
|
|
@@ -2329,7 +2329,7 @@ function ya({ className: e }) {
|
|
|
2329
2329
|
onClick: () => {
|
|
2330
2330
|
r.actions.setFocusMode(!1), i.focus();
|
|
2331
2331
|
},
|
|
2332
|
-
children: /* @__PURE__ */ q(
|
|
2332
|
+
children: /* @__PURE__ */ q(Qt, {})
|
|
2333
2333
|
}) : null;
|
|
2334
2334
|
}
|
|
2335
2335
|
//#endregion
|
|
@@ -2338,7 +2338,7 @@ var ba = (e) => e.trim() ? e.trim().split(/\s+/).length : 0, xa = (e) => e <= 0
|
|
|
2338
2338
|
//#endregion
|
|
2339
2339
|
//#region lib/components/ui/widgets/editor/core/use-editor-stats.ts
|
|
2340
2340
|
function Sa(e) {
|
|
2341
|
-
return
|
|
2341
|
+
return N({
|
|
2342
2342
|
editor: e.editor,
|
|
2343
2343
|
selector: ({ editor: e }) => {
|
|
2344
2344
|
let t = e?.storage.characterCount, n = t?.words?.() ?? ba(e?.getText() ?? ""), r = e?.extensionManager.extensions.find((e) => e.name === "characterCount")?.options.limit;
|
|
@@ -2359,7 +2359,7 @@ function Sa(e) {
|
|
|
2359
2359
|
//#endregion
|
|
2360
2360
|
//#region lib/components/ui/widgets/editor/partials/editor-stats.tsx
|
|
2361
2361
|
function Ca({ readingTime: e = !0 }) {
|
|
2362
|
-
let { t } =
|
|
2362
|
+
let { t } = A(), { handle: n } = O(), r = Sa(n), { words: i } = r;
|
|
2363
2363
|
return /* @__PURE__ */ J("p", {
|
|
2364
2364
|
"data-slot": "editor-stats",
|
|
2365
2365
|
className: "flex flex-wrap gap-x-2",
|
|
@@ -2384,7 +2384,7 @@ var wa = {
|
|
|
2384
2384
|
unsaved: ["material.editor.footer.unsaved", "Unsaved changes"]
|
|
2385
2385
|
};
|
|
2386
2386
|
function Ta({ className: n, status: r, actions: i, readingTime: a = !0 }) {
|
|
2387
|
-
let { t: o } =
|
|
2387
|
+
let { t: o } = A(), s = typeof r == "string" && r in wa, [c, l] = s ? wa[r] : [];
|
|
2388
2388
|
return /* @__PURE__ */ J("div", {
|
|
2389
2389
|
"data-slot": "editor-footer",
|
|
2390
2390
|
className: t("flex flex-wrap items-center gap-x-3 gap-y-2 text-muted-foreground text-sm", n),
|
|
@@ -2433,11 +2433,11 @@ function Da(e, t) {
|
|
|
2433
2433
|
//#region lib/components/ui/widgets/editor/extensions/outline/use-outline.ts
|
|
2434
2434
|
var Oa = 120, ka = 700, Aa = () => window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
2435
2435
|
function ja(e) {
|
|
2436
|
-
let t =
|
|
2436
|
+
let t = N({
|
|
2437
2437
|
editor: e,
|
|
2438
2438
|
selector: ({ editor: e }) => Ea(e.state.doc)
|
|
2439
|
-
}), [n, r] =
|
|
2440
|
-
|
|
2439
|
+
}), [n, r] = W(0), i = U(0);
|
|
2440
|
+
V(() => {
|
|
2441
2441
|
let n = 0, a = () => {
|
|
2442
2442
|
if (n = 0, Date.now() < i.current) return;
|
|
2443
2443
|
let a = t.map((t) => {
|
|
@@ -2455,7 +2455,7 @@ function ja(e) {
|
|
|
2455
2455
|
n && cancelAnimationFrame(n), window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", o);
|
|
2456
2456
|
};
|
|
2457
2457
|
}, [e, t]);
|
|
2458
|
-
let a =
|
|
2458
|
+
let a = B((n) => {
|
|
2459
2459
|
let a = t[n];
|
|
2460
2460
|
if (!a) return;
|
|
2461
2461
|
i.current = Date.now() + ka, r(n), e.chain().focus().setTextSelection(a.pos + 1).run();
|
|
@@ -2479,7 +2479,7 @@ var Ma = {
|
|
|
2479
2479
|
3: "ps-8"
|
|
2480
2480
|
};
|
|
2481
2481
|
function Na({ className: e, onNavigate: t }) {
|
|
2482
|
-
let { handle: n } =
|
|
2482
|
+
let { handle: n } = O();
|
|
2483
2483
|
return n.editor ? /* @__PURE__ */ q(Pa, {
|
|
2484
2484
|
editor: n.editor,
|
|
2485
2485
|
className: e,
|
|
@@ -2487,7 +2487,7 @@ function Na({ className: e, onNavigate: t }) {
|
|
|
2487
2487
|
}) : null;
|
|
2488
2488
|
}
|
|
2489
2489
|
function Pa({ editor: e, className: n, onNavigate: r }) {
|
|
2490
|
-
let { t: i } =
|
|
2490
|
+
let { t: i } = A(), { items: a, active: o, goTo: s } = ja(e);
|
|
2491
2491
|
return /* @__PURE__ */ J("nav", {
|
|
2492
2492
|
"aria-label": i("material.editor.outline", "Outline"),
|
|
2493
2493
|
"data-slot": "editor-outline",
|
|
@@ -2516,7 +2516,7 @@ function Pa({ editor: e, className: n, onNavigate: r }) {
|
|
|
2516
2516
|
//#endregion
|
|
2517
2517
|
//#region lib/components/ui/widgets/editor/partials/editor-outline-panel.tsx
|
|
2518
2518
|
function Fa(e) {
|
|
2519
|
-
let { handle: t, chrome: n } =
|
|
2519
|
+
let { handle: t, chrome: n } = O();
|
|
2520
2520
|
return t.features.some((e) => e.key === "outline") ? /* @__PURE__ */ q(jr, {
|
|
2521
2521
|
id: "outline",
|
|
2522
2522
|
className: "w-72 max-w-[92vw] p-2",
|
|
@@ -2527,12 +2527,12 @@ function Fa(e) {
|
|
|
2527
2527
|
//#region lib/components/ui/widgets/editor/extensions/upload/use-editor-uploads.ts
|
|
2528
2528
|
var Ia = 0, La = 1e6;
|
|
2529
2529
|
function Ra(e) {
|
|
2530
|
-
let t =
|
|
2530
|
+
let t = s(e.editor)?.queue, n = G(B((e) => t?.subscribe(e) ?? (() => {}), [t]), () => {
|
|
2531
2531
|
if (!t) return Ia;
|
|
2532
2532
|
let e = t.list(), n = e.filter((e) => e.status === "error").length;
|
|
2533
2533
|
return (e.length - n) * La + n;
|
|
2534
2534
|
}, () => Ia);
|
|
2535
|
-
return
|
|
2535
|
+
return H(() => ({
|
|
2536
2536
|
pending: Math.floor(n / La),
|
|
2537
2537
|
failed: n % La
|
|
2538
2538
|
}), [n]);
|
|
@@ -2571,10 +2571,10 @@ function Ha(e) {
|
|
|
2571
2571
|
//#endregion
|
|
2572
2572
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-button.tsx
|
|
2573
2573
|
function Ua({ editor: e }) {
|
|
2574
|
-
let { t } =
|
|
2574
|
+
let { t } = A(), { chrome: n } = O(), r = ar(e), i = n.state.panel === "assistant";
|
|
2575
2575
|
if (!r || !e.isEditable) return null;
|
|
2576
2576
|
let a = t("material.editor.assistant.title", "Assistant");
|
|
2577
|
-
return /* @__PURE__ */ q(
|
|
2577
|
+
return /* @__PURE__ */ q(f, {
|
|
2578
2578
|
"data-slot": "editor-assistant-button",
|
|
2579
2579
|
variant: i ? "filled" : "tonal",
|
|
2580
2580
|
"aria-label": a,
|
|
@@ -2583,7 +2583,7 @@ function Ua({ editor: e }) {
|
|
|
2583
2583
|
tooltip: a,
|
|
2584
2584
|
onMouseDown: (e) => e.preventDefault(),
|
|
2585
2585
|
onClick: () => i ? r.close() : r.open(),
|
|
2586
|
-
children: /* @__PURE__ */ q(
|
|
2586
|
+
children: /* @__PURE__ */ q(cn, {})
|
|
2587
2587
|
});
|
|
2588
2588
|
}
|
|
2589
2589
|
//#endregion
|
|
@@ -2714,7 +2714,7 @@ async function ro(e) {
|
|
|
2714
2714
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-controller.ts
|
|
2715
2715
|
var io = class {
|
|
2716
2716
|
host;
|
|
2717
|
-
store =
|
|
2717
|
+
store = pt(rr);
|
|
2718
2718
|
abort = null;
|
|
2719
2719
|
token = 0;
|
|
2720
2720
|
panel = null;
|
|
@@ -2846,7 +2846,7 @@ async function so(e, t, n) {
|
|
|
2846
2846
|
if (n <= t) return "";
|
|
2847
2847
|
let { doc: r } = e.state;
|
|
2848
2848
|
try {
|
|
2849
|
-
return (await
|
|
2849
|
+
return (await _t(r.cut(t, n).toJSON(), { extensions: Cn(e) })).replace(/\s+$/, "");
|
|
2850
2850
|
} catch {
|
|
2851
2851
|
return r.textBetween(t, n, "\n\n");
|
|
2852
2852
|
}
|
|
@@ -2868,7 +2868,7 @@ async function co(e, t) {
|
|
|
2868
2868
|
}
|
|
2869
2869
|
//#endregion
|
|
2870
2870
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-extension.ts
|
|
2871
|
-
var lo =
|
|
2871
|
+
var lo = L.create({
|
|
2872
2872
|
name: "assistant",
|
|
2873
2873
|
addStorage: () => ({}),
|
|
2874
2874
|
onBeforeCreate() {
|
|
@@ -2890,14 +2890,14 @@ var lo = R.create({
|
|
|
2890
2890
|
n.follow = Ja(e, () => r.getState().phase === "idle" ? null : r.getState().range, r.subscribe);
|
|
2891
2891
|
},
|
|
2892
2892
|
addProseMirrorPlugins() {
|
|
2893
|
-
let e = new
|
|
2894
|
-
return [new
|
|
2893
|
+
let e = new ut("assistantRange"), t = () => this.storage.controller;
|
|
2894
|
+
return [new P({
|
|
2895
2895
|
key: e,
|
|
2896
2896
|
props: { decorations: (e) => {
|
|
2897
2897
|
let n = t()?.getState();
|
|
2898
2898
|
if (!n || n.phase === "idle" || !n.hasSelection) return null;
|
|
2899
2899
|
let { from: r, to: i } = n.range;
|
|
2900
|
-
return r >= i || i > e.doc.content.size ? null :
|
|
2900
|
+
return r >= i || i > e.doc.content.size ? null : F.create(e.doc, [I.inline(r, i, { class: "nxgt-assistant-range" })]);
|
|
2901
2901
|
} },
|
|
2902
2902
|
view: (n) => {
|
|
2903
2903
|
let r = () => {
|
|
@@ -2933,11 +2933,11 @@ var lo = R.create({
|
|
|
2933
2933
|
"continue"
|
|
2934
2934
|
],
|
|
2935
2935
|
group: "Insert",
|
|
2936
|
-
icon:
|
|
2936
|
+
icon: cn,
|
|
2937
2937
|
run: ({ editor: e, range: t }) => (e.chain().focus().deleteRange(t).run(), tr(e)?.controller.open(), !0)
|
|
2938
2938
|
}, po = (e = {}) => {
|
|
2939
2939
|
let { onAssist: t, actions: n, allowMedia: r } = e;
|
|
2940
|
-
return
|
|
2940
|
+
return z(t ? {
|
|
2941
2941
|
name: "assistant",
|
|
2942
2942
|
extensions: (e) => [lo.configure({
|
|
2943
2943
|
handler: () => t,
|
|
@@ -2984,10 +2984,10 @@ function mo(e, t) {
|
|
|
2984
2984
|
//#endregion
|
|
2985
2985
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-buttons.tsx
|
|
2986
2986
|
function ho({ editor: e }) {
|
|
2987
|
-
let { t } =
|
|
2987
|
+
let { t } = A(), n = Cr(e);
|
|
2988
2988
|
if (!n) return null;
|
|
2989
2989
|
let r = t("material.editor.comments.comment", "Comment");
|
|
2990
|
-
return /* @__PURE__ */ q(
|
|
2990
|
+
return /* @__PURE__ */ q(f, {
|
|
2991
2991
|
"data-slot": "editor-comment-button",
|
|
2992
2992
|
variant: "ghost",
|
|
2993
2993
|
"aria-label": r,
|
|
@@ -2995,14 +2995,14 @@ function ho({ editor: e }) {
|
|
|
2995
2995
|
tooltip: r,
|
|
2996
2996
|
onMouseDown: (e) => e.preventDefault(),
|
|
2997
2997
|
onClick: () => n.startComposer(),
|
|
2998
|
-
children: /* @__PURE__ */ q(
|
|
2998
|
+
children: /* @__PURE__ */ q(Zt, {})
|
|
2999
2999
|
});
|
|
3000
3000
|
}
|
|
3001
3001
|
function go({ editor: e }) {
|
|
3002
|
-
let { t } =
|
|
3002
|
+
let { t } = A(), { chrome: n } = O(), r = wr(e);
|
|
3003
3003
|
if (!Y(e)) return null;
|
|
3004
3004
|
let i = n.state.panel === "comments", a = hi(r).length, o = t("material.editor.comments.count", "Comments ({count})", { count: a });
|
|
3005
|
-
return /* @__PURE__ */ q(
|
|
3005
|
+
return /* @__PURE__ */ q(f, {
|
|
3006
3006
|
"data-slot": "editor-comments-button",
|
|
3007
3007
|
variant: i ? "filled" : "ghost",
|
|
3008
3008
|
"aria-label": o,
|
|
@@ -3012,7 +3012,7 @@ function go({ editor: e }) {
|
|
|
3012
3012
|
onClick: (t) => {
|
|
3013
3013
|
n.actions.togglePanel("comments"), i && mo(t, e);
|
|
3014
3014
|
},
|
|
3015
|
-
children: /* @__PURE__ */ q(
|
|
3015
|
+
children: /* @__PURE__ */ q(Xt, {})
|
|
3016
3016
|
});
|
|
3017
3017
|
}
|
|
3018
3018
|
function _o(e) {
|
|
@@ -3048,11 +3048,11 @@ function So(e, t) {
|
|
|
3048
3048
|
let o = a.attrs.threadId, s = n.get(o);
|
|
3049
3049
|
if (s === void 0 || s && !t.showResolved) continue;
|
|
3050
3050
|
let c = [bo];
|
|
3051
|
-
s && c.push(`${bo}-resolved`), o === t.activeId && c.push(`${bo}-active`), r.push(
|
|
3051
|
+
s && c.push(`${bo}-resolved`), o === t.activeId && c.push(`${bo}-active`), r.push(I.inline(i, i + e.nodeSize, { class: c.join(" ") }));
|
|
3052
3052
|
}
|
|
3053
3053
|
});
|
|
3054
3054
|
let i = t.composer?.range;
|
|
3055
|
-
return i && i.from < i.to && i.to <= e.content.size && r.push(
|
|
3055
|
+
return i && i.from < i.to && i.to <= e.content.size && r.push(I.inline(i.from, i.to, { class: `${bo} ${bo}-active` })), F.create(e, r);
|
|
3056
3056
|
}
|
|
3057
3057
|
//#endregion
|
|
3058
3058
|
//#region lib/components/ui/widgets/editor/extensions/comments/strip-comment-marks.ts
|
|
@@ -3063,17 +3063,17 @@ var Co = (e) => {
|
|
|
3063
3063
|
let n = e.marks.filter((e) => e.type.name !== "comment");
|
|
3064
3064
|
t.push(n.length === e.marks.length ? e : e.mark(n));
|
|
3065
3065
|
} else t.push(e.copy(Co(e.content)));
|
|
3066
|
-
}),
|
|
3067
|
-
}, wo = (e) => new
|
|
3066
|
+
}), at.fromArray(t);
|
|
3067
|
+
}, wo = (e) => new ot(Co(e.content), e.openStart, e.openEnd), To = (e) => e?.dragging?.move === !0, Eo = (e, t) => To(t) ? e : wo(e), Do = new ut("comments"), Oo = (e, t) => {
|
|
3068
3068
|
let n = [];
|
|
3069
3069
|
for (let r = e; r && r !== t; r = r.parentElement) {
|
|
3070
3070
|
let e = r.getAttribute?.("data-comment-thread");
|
|
3071
3071
|
e && n.push(e);
|
|
3072
3072
|
}
|
|
3073
3073
|
return n;
|
|
3074
|
-
}, ko =
|
|
3074
|
+
}, ko = L.create({
|
|
3075
3075
|
name: "comments",
|
|
3076
|
-
addExtensions: () => [
|
|
3076
|
+
addExtensions: () => [St],
|
|
3077
3077
|
addStorage: () => ({}),
|
|
3078
3078
|
onBeforeCreate() {
|
|
3079
3079
|
let { editor: e, options: t, storage: n } = this;
|
|
@@ -3092,7 +3092,7 @@ var Co = (e) => {
|
|
|
3092
3092
|
focus: () => {
|
|
3093
3093
|
e.commands.focus();
|
|
3094
3094
|
},
|
|
3095
|
-
newId:
|
|
3095
|
+
newId: xt,
|
|
3096
3096
|
openPanel: () => t.panel.open(),
|
|
3097
3097
|
closePanel: () => t.panel.close()
|
|
3098
3098
|
}, t.current().showResolved === !0);
|
|
@@ -3110,7 +3110,7 @@ var Co = (e) => {
|
|
|
3110
3110
|
},
|
|
3111
3111
|
addProseMirrorPlugins() {
|
|
3112
3112
|
let e = () => this.storage.controller, t = null;
|
|
3113
|
-
return [new
|
|
3113
|
+
return [new P({
|
|
3114
3114
|
key: Do,
|
|
3115
3115
|
props: {
|
|
3116
3116
|
transformPasted: Eo,
|
|
@@ -3150,7 +3150,7 @@ var Co = (e) => {
|
|
|
3150
3150
|
keys: e > 0 ? "F8" : "Shift-F8",
|
|
3151
3151
|
editable: !0,
|
|
3152
3152
|
run: ({ editor: t }) => Ao(t)?.step(e) ?? !1
|
|
3153
|
-
}), No = (e = {}) => e.adapter ?
|
|
3153
|
+
}), No = (e = {}) => e.adapter ? z({
|
|
3154
3154
|
name: "comments",
|
|
3155
3155
|
extensions: (t) => [ko.configure({
|
|
3156
3156
|
current: () => e,
|
|
@@ -3181,11 +3181,11 @@ var Co = (e) => {
|
|
|
3181
3181
|
Mo(-1)
|
|
3182
3182
|
],
|
|
3183
3183
|
markdown: "native"
|
|
3184
|
-
}) :
|
|
3184
|
+
}) : z({
|
|
3185
3185
|
name: "comments",
|
|
3186
|
-
extensions: () => [
|
|
3186
|
+
extensions: () => [St],
|
|
3187
3187
|
markdown: "native"
|
|
3188
|
-
}), Po =
|
|
3188
|
+
}), Po = L.create({
|
|
3189
3189
|
name: "nxgtBlockKeys",
|
|
3190
3190
|
addKeyboardShortcuts() {
|
|
3191
3191
|
let e = (e) => () => {
|
|
@@ -3198,7 +3198,7 @@ var Co = (e) => {
|
|
|
3198
3198
|
"Alt-Shift-ArrowDown": e(1)
|
|
3199
3199
|
};
|
|
3200
3200
|
}
|
|
3201
|
-
}), Fo = () =>
|
|
3201
|
+
}), Fo = () => z({
|
|
3202
3202
|
name: "dragHandle",
|
|
3203
3203
|
extensions: () => [Po],
|
|
3204
3204
|
shortcuts: [{
|
|
@@ -3210,18 +3210,18 @@ var Co = (e) => {
|
|
|
3210
3210
|
//#endregion
|
|
3211
3211
|
//#region lib/components/ui/widgets/editor/extensions/find/find-button.tsx
|
|
3212
3212
|
function Io({ editor: e }) {
|
|
3213
|
-
let { t } =
|
|
3214
|
-
return /* @__PURE__ */ q(
|
|
3213
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.panel === "find";
|
|
3214
|
+
return /* @__PURE__ */ q(f, {
|
|
3215
3215
|
variant: r ? "filled" : "ghost",
|
|
3216
3216
|
"aria-pressed": r,
|
|
3217
3217
|
tooltip: t("material.editor.find.title", "Find and replace"),
|
|
3218
3218
|
onClick: () => r ? n.actions.closePanel() : n.actions.openFind({ replace: !1 }),
|
|
3219
|
-
children: /* @__PURE__ */ q(
|
|
3219
|
+
children: /* @__PURE__ */ q(on, {})
|
|
3220
3220
|
});
|
|
3221
3221
|
}
|
|
3222
3222
|
//#endregion
|
|
3223
3223
|
//#region lib/components/ui/widgets/editor/extensions/find/find-plugin.ts
|
|
3224
|
-
var Lo = () => new
|
|
3224
|
+
var Lo = () => new P({
|
|
3225
3225
|
key: X,
|
|
3226
3226
|
state: {
|
|
3227
3227
|
init: la,
|
|
@@ -3236,7 +3236,7 @@ var Lo = () => new F({
|
|
|
3236
3236
|
props: { decorations: (e) => X.getState(e)?.decorations }
|
|
3237
3237
|
}), Ro = () => {
|
|
3238
3238
|
let e;
|
|
3239
|
-
return new
|
|
3239
|
+
return new P({ props: { decorations(t) {
|
|
3240
3240
|
let n = X.getState(t);
|
|
3241
3241
|
if (!n) return;
|
|
3242
3242
|
if (e?.state === n && e.doc === t.doc) return e.set;
|
|
@@ -3247,7 +3247,7 @@ var Lo = () => new F({
|
|
|
3247
3247
|
set: r
|
|
3248
3248
|
}, r;
|
|
3249
3249
|
} } });
|
|
3250
|
-
}, zo =
|
|
3250
|
+
}, zo = L.create({
|
|
3251
3251
|
name: "nxgtFind",
|
|
3252
3252
|
addProseMirrorPlugins() {
|
|
3253
3253
|
return [Lo(), Ro()];
|
|
@@ -3258,7 +3258,7 @@ var Lo = () => new F({
|
|
|
3258
3258
|
findStep: (e) => ({ state: t, tr: n, dispatch: r }) => {
|
|
3259
3259
|
let { matches: i, current: a } = pa(t), o = ia(i.length, a, e), s = i[o];
|
|
3260
3260
|
if (!s) return !1;
|
|
3261
|
-
let c =
|
|
3261
|
+
let c = R.create(n.doc, s.from, s.to);
|
|
3262
3262
|
return r?.(n.setSelection(c).scrollIntoView().setMeta(X, { current: o })), !0;
|
|
3263
3263
|
},
|
|
3264
3264
|
replaceCurrent: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
@@ -3267,7 +3267,7 @@ var Lo = () => new F({
|
|
|
3267
3267
|
if (!s) return !1;
|
|
3268
3268
|
r.insertText(e, s.from, s.to);
|
|
3269
3269
|
let c = s.from + e.length;
|
|
3270
|
-
return r.setSelection(
|
|
3270
|
+
return r.setSelection(R.create(r.doc, c)).scrollIntoView(), i?.(r), !0;
|
|
3271
3271
|
},
|
|
3272
3272
|
replaceAll: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
3273
3273
|
if (!t.isEditable) return !1;
|
|
@@ -3279,7 +3279,7 @@ var Lo = () => new F({
|
|
|
3279
3279
|
clearFind: () => ({ tr: e, dispatch: t }) => (t?.(e.setMeta(X, { clear: !0 })), !0)
|
|
3280
3280
|
};
|
|
3281
3281
|
}
|
|
3282
|
-
}), Bo = (e) => ({ chrome: t, root: n }) => (t.actions.openFind({ replace: e }), n.querySelector("[data-slot=editor-find] input")?.focus(), !0), Vo = () =>
|
|
3282
|
+
}), Bo = (e) => ({ chrome: t, root: n }) => (t.actions.openFind({ replace: e }), n.querySelector("[data-slot=editor-find] input")?.focus(), !0), Vo = () => z({
|
|
3283
3283
|
name: "find",
|
|
3284
3284
|
extensions: () => [zo],
|
|
3285
3285
|
toolbar: [{
|
|
@@ -3309,20 +3309,20 @@ var Lo = () => new F({
|
|
|
3309
3309
|
//#endregion
|
|
3310
3310
|
//#region lib/components/ui/widgets/editor/extensions/focus-mode/focus-mode-button.tsx
|
|
3311
3311
|
function Ho({ editor: e }) {
|
|
3312
|
-
let { t } =
|
|
3313
|
-
return /* @__PURE__ */ q(
|
|
3312
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.focusMode;
|
|
3313
|
+
return /* @__PURE__ */ q(f, {
|
|
3314
3314
|
variant: r ? "filled" : "ghost",
|
|
3315
3315
|
"aria-pressed": r,
|
|
3316
3316
|
tooltip: t("material.editor.focus-mode", "Focus mode"),
|
|
3317
3317
|
onClick: () => {
|
|
3318
3318
|
n.actions.toggleFocusMode(), e.commands.focus();
|
|
3319
3319
|
},
|
|
3320
|
-
children: /* @__PURE__ */ q(
|
|
3320
|
+
children: /* @__PURE__ */ q(Vt, {})
|
|
3321
3321
|
});
|
|
3322
3322
|
}
|
|
3323
3323
|
//#endregion
|
|
3324
3324
|
//#region lib/components/ui/widgets/editor/kit/features/focus-mode.ts
|
|
3325
|
-
var Uo = () =>
|
|
3325
|
+
var Uo = () => z({
|
|
3326
3326
|
name: "focusMode",
|
|
3327
3327
|
extensions: () => [],
|
|
3328
3328
|
requires: ["marks"],
|
|
@@ -3342,25 +3342,25 @@ var Uo = () => B({
|
|
|
3342
3342
|
//#endregion
|
|
3343
3343
|
//#region lib/components/ui/widgets/editor/extensions/marks/inline-code-button.tsx
|
|
3344
3344
|
function Wo({ editor: e }) {
|
|
3345
|
-
let { t } =
|
|
3345
|
+
let { t } = A(), n = N({
|
|
3346
3346
|
editor: e,
|
|
3347
3347
|
selector: (e) => ({
|
|
3348
3348
|
isCode: e.editor.isActive("code") ?? !1,
|
|
3349
3349
|
canCode: e.editor.can().chain().toggleCode().run() ?? !1
|
|
3350
3350
|
})
|
|
3351
3351
|
});
|
|
3352
|
-
return /* @__PURE__ */ q(
|
|
3352
|
+
return /* @__PURE__ */ q(f, {
|
|
3353
3353
|
variant: n.isCode ? "filled" : "ghost",
|
|
3354
3354
|
"aria-pressed": n.isCode,
|
|
3355
3355
|
tooltip: t("material.editor.code", "Inline code"),
|
|
3356
3356
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
3357
3357
|
disabled: !n.canCode,
|
|
3358
|
-
children: /* @__PURE__ */ q(
|
|
3358
|
+
children: /* @__PURE__ */ q(Lt, {})
|
|
3359
3359
|
});
|
|
3360
3360
|
}
|
|
3361
3361
|
//#endregion
|
|
3362
3362
|
//#region lib/components/ui/widgets/editor/kit/features/inline-code.ts
|
|
3363
|
-
var Go = () =>
|
|
3363
|
+
var Go = () => z({
|
|
3364
3364
|
name: "inlineCode",
|
|
3365
3365
|
extensions: () => [],
|
|
3366
3366
|
toolbar: [{
|
|
@@ -3379,20 +3379,20 @@ var Go = () => B({
|
|
|
3379
3379
|
}],
|
|
3380
3380
|
requires: ["marks"],
|
|
3381
3381
|
markdown: "native"
|
|
3382
|
-
}), Ko =
|
|
3382
|
+
}), Ko = L.create({
|
|
3383
3383
|
name: "markdownPaste",
|
|
3384
3384
|
addProseMirrorPlugins() {
|
|
3385
3385
|
let { editor: e } = this, t = !1;
|
|
3386
|
-
return [new
|
|
3387
|
-
key: new
|
|
3386
|
+
return [new P({
|
|
3387
|
+
key: new ut("markdownPaste"),
|
|
3388
3388
|
props: {
|
|
3389
3389
|
handleKeyDown: (e, n) => (t = n.shiftKey && (n.metaKey || n.ctrlKey) && n.key.toLowerCase() === "v", !1),
|
|
3390
3390
|
handleDOMEvents: { keyup: () => (t = !1, !1) },
|
|
3391
3391
|
handlePaste: (n, r) => {
|
|
3392
3392
|
let i = r.clipboardData, a = i?.getData("text/plain") ?? "", o = t;
|
|
3393
|
-
return t = !1, o || !a || i?.getData("text/html") || n.state.selection.$from.parent.type.spec.code || !Ha(a) ? !1 : (
|
|
3393
|
+
return t = !1, o || !a || i?.getData("text/html") || n.state.selection.$from.parent.type.spec.code || !Ha(a) ? !1 : (ft().then((t) => {
|
|
3394
3394
|
if (e.isDestroyed) return;
|
|
3395
|
-
let n = e.extensionManager.extensions, r =
|
|
3395
|
+
let n = e.extensionManager.extensions, r = Ct(t.parse(a, n), n);
|
|
3396
3396
|
e.commands.insertContent(r.content ?? []);
|
|
3397
3397
|
}).catch(() => {
|
|
3398
3398
|
e.isDestroyed || e.commands.insertContent(qo(a));
|
|
@@ -3407,7 +3407,7 @@ var Go = () => B({
|
|
|
3407
3407
|
type: "text",
|
|
3408
3408
|
text: e
|
|
3409
3409
|
}]
|
|
3410
|
-
})), Jo = () =>
|
|
3410
|
+
})), Jo = () => z({
|
|
3411
3411
|
name: "markdownPaste",
|
|
3412
3412
|
extensions: () => [Ko],
|
|
3413
3413
|
markdown: "native"
|
|
@@ -3415,20 +3415,20 @@ var Go = () => B({
|
|
|
3415
3415
|
//#endregion
|
|
3416
3416
|
//#region lib/components/ui/widgets/editor/extensions/outline/outline-button.tsx
|
|
3417
3417
|
function Yo({ editor: e }) {
|
|
3418
|
-
let { t } =
|
|
3419
|
-
return /* @__PURE__ */ q(
|
|
3418
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.panel === "outline";
|
|
3419
|
+
return /* @__PURE__ */ q(f, {
|
|
3420
3420
|
variant: r ? "filled" : "ghost",
|
|
3421
3421
|
"aria-pressed": r,
|
|
3422
3422
|
tooltip: t("material.editor.outline", "Outline"),
|
|
3423
3423
|
onClick: (t) => {
|
|
3424
3424
|
n.actions.togglePanel("outline"), r && mo(t, e);
|
|
3425
3425
|
},
|
|
3426
|
-
children: /* @__PURE__ */ q(
|
|
3426
|
+
children: /* @__PURE__ */ q(dn, {})
|
|
3427
3427
|
});
|
|
3428
3428
|
}
|
|
3429
3429
|
//#endregion
|
|
3430
3430
|
//#region lib/components/ui/widgets/editor/kit/features/outline.ts
|
|
3431
|
-
var Xo = () =>
|
|
3431
|
+
var Xo = () => z({
|
|
3432
3432
|
name: "outline",
|
|
3433
3433
|
extensions: () => [],
|
|
3434
3434
|
toolbar: [{
|
|
@@ -3443,34 +3443,34 @@ var Xo = () => B({
|
|
|
3443
3443
|
//#endregion
|
|
3444
3444
|
//#region lib/components/ui/widgets/editor/extensions/upload/image-alt-button.tsx
|
|
3445
3445
|
function Zo({ editor: e }) {
|
|
3446
|
-
let { t } =
|
|
3446
|
+
let { t } = A(), n = N({
|
|
3447
3447
|
editor: e,
|
|
3448
3448
|
selector: (e) => e.editor.getAttributes("image").alt ?? ""
|
|
3449
|
-
}), [r, i] =
|
|
3450
|
-
return /* @__PURE__ */ J(
|
|
3449
|
+
}), [r, i] = W(""), [a, o] = W(!1), { trigger: s, onCloseAutoFocus: c } = De(), l = t("material.editor.upload.alt", "Alt text");
|
|
3450
|
+
return /* @__PURE__ */ J(_e, {
|
|
3451
3451
|
open: a,
|
|
3452
3452
|
onOpenChange: (e) => {
|
|
3453
3453
|
o(e), e && i(n);
|
|
3454
3454
|
},
|
|
3455
|
-
children: [/* @__PURE__ */ q(
|
|
3455
|
+
children: [/* @__PURE__ */ q(re, {
|
|
3456
3456
|
asChild: !0,
|
|
3457
3457
|
ref: s,
|
|
3458
|
-
children: /* @__PURE__ */ q(
|
|
3458
|
+
children: /* @__PURE__ */ q(f, {
|
|
3459
3459
|
variant: "ghost",
|
|
3460
3460
|
tooltip: l,
|
|
3461
3461
|
"aria-label": l,
|
|
3462
3462
|
className: "rounded size-7",
|
|
3463
3463
|
more: { kind: "dialog" },
|
|
3464
|
-
children: /* @__PURE__ */ q(
|
|
3464
|
+
children: /* @__PURE__ */ q(fn, {})
|
|
3465
3465
|
})
|
|
3466
|
-
}), /* @__PURE__ */ J(
|
|
3466
|
+
}), /* @__PURE__ */ J(Me, {
|
|
3467
3467
|
className: "flex size-max flex-col gap-2 p-2",
|
|
3468
3468
|
onCloseAutoFocus: c,
|
|
3469
|
-
children: [/* @__PURE__ */ q(
|
|
3469
|
+
children: [/* @__PURE__ */ q(rt, {
|
|
3470
3470
|
value: r,
|
|
3471
3471
|
label: t("material.editor.upload.alt-label", "Describe the image"),
|
|
3472
3472
|
onChange: (e) => i(e.target.value)
|
|
3473
|
-
}), /* @__PURE__ */ q(
|
|
3473
|
+
}), /* @__PURE__ */ q(j, {
|
|
3474
3474
|
variant: "tonal",
|
|
3475
3475
|
onClick: () => {
|
|
3476
3476
|
e.chain().focus().updateAttributes("image", { alt: r }).run(), o(!1);
|
|
@@ -3516,7 +3516,7 @@ function os() {
|
|
|
3516
3516
|
}
|
|
3517
3517
|
//#endregion
|
|
3518
3518
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-widgets.ts
|
|
3519
|
-
var ss = /* @__PURE__ */ new WeakMap(), cs = (e, t) =>
|
|
3519
|
+
var ss = /* @__PURE__ */ new WeakMap(), cs = (e, t) => I.widget(e, () => {
|
|
3520
3520
|
let { element: e, destroy: n } = t.build(t.id);
|
|
3521
3521
|
return ss.set(e, n), e;
|
|
3522
3522
|
}, {
|
|
@@ -3530,9 +3530,9 @@ var ss = /* @__PURE__ */ new WeakMap(), cs = (e, t) => L.widget(e, () => {
|
|
|
3530
3530
|
destroy: (e) => ss.get(e)?.()
|
|
3531
3531
|
}), ls = {
|
|
3532
3532
|
cards: [],
|
|
3533
|
-
decorations:
|
|
3533
|
+
decorations: F.empty,
|
|
3534
3534
|
orphaned: []
|
|
3535
|
-
}, us = (e, t) => t.length ?
|
|
3535
|
+
}, us = (e, t) => t.length ? F.create(e, t.map((e) => cs(e.pos, e))) : F.empty, ds = (e) => e.steps.some((t, n) => t instanceof ct && t.from === 0 && t.to === e.docs[n].content.size), fs = (e) => {
|
|
3536
3536
|
let t = !1;
|
|
3537
3537
|
return e.content.descendants((e) => ((e.isText || e.isLeaf) && (t = !0), !t)), t;
|
|
3538
3538
|
};
|
|
@@ -3624,12 +3624,12 @@ function _s(e, t) {
|
|
|
3624
3624
|
}
|
|
3625
3625
|
function vs(e, t) {
|
|
3626
3626
|
if (e.isDestroyed) return;
|
|
3627
|
-
let { doc: n } = e.state, r = n.resolve(Math.max(0, Math.min(t, n.content.size))), i =
|
|
3627
|
+
let { doc: n } = e.state, r = n.resolve(Math.max(0, Math.min(t, n.content.size))), i = lt.findFrom(r, 1, !0) ?? lt.findFrom(r, -1, !0) ?? lt.near(r, -1);
|
|
3628
3628
|
e.view.dispatch(e.state.tr.setSelection(i)), e.commands.focus();
|
|
3629
3629
|
}
|
|
3630
3630
|
//#endregion
|
|
3631
3631
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-plugin.ts
|
|
3632
|
-
var $ = new
|
|
3632
|
+
var $ = new ut("upload");
|
|
3633
3633
|
function ys(e, t) {
|
|
3634
3634
|
let n = e.doc.resolve(Math.min(t ?? e.selection.to, e.doc.content.size)), r = n.parent;
|
|
3635
3635
|
return !r.isTextblock || n.depth === 0 ? {
|
|
@@ -3654,7 +3654,7 @@ var bs = (e, t) => {
|
|
|
3654
3654
|
end: t
|
|
3655
3655
|
} });
|
|
3656
3656
|
function ws({ onFiles: e, onOrphans: t }) {
|
|
3657
|
-
return new
|
|
3657
|
+
return new P({
|
|
3658
3658
|
key: $,
|
|
3659
3659
|
state: {
|
|
3660
3660
|
init: () => ls,
|
|
@@ -3694,7 +3694,7 @@ function Ds(e, { accept: t = "image/*", maxSize: n }) {
|
|
|
3694
3694
|
}
|
|
3695
3695
|
var Os = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ks = (e) => e.type ? e.type.startsWith("image/") : Os.test(e.name);
|
|
3696
3696
|
function As(e) {
|
|
3697
|
-
let t =
|
|
3697
|
+
let t = ht(e);
|
|
3698
3698
|
return t !== void 0 && !/^(mailto|tel):/i.test(t);
|
|
3699
3699
|
}
|
|
3700
3700
|
function js(e) {
|
|
@@ -3746,7 +3746,7 @@ function Fs(e, t, n, r) {
|
|
|
3746
3746
|
if (!a) return;
|
|
3747
3747
|
let o = _s(e, t), s = a.from;
|
|
3748
3748
|
try {
|
|
3749
|
-
let o = e.schema.nodeFromJSON(Ns(e, n, r)), c = i.doc.nodeAt(a.from), l = a.spec.replaceEmpty && Ps(c), u = l ? a.from :
|
|
3749
|
+
let o = e.schema.nodeFromJSON(Ns(e, n, r)), c = i.doc.nodeAt(a.from), l = a.spec.replaceEmpty && Ps(c), u = l ? a.from : st(i.doc, a.from, o.type) ?? ms(i.doc, a.from), d = l ? u + (c?.nodeSize ?? 0) : u, f = i.tr.replaceWith(u, d, o);
|
|
3750
3750
|
s = f.mapping.map(d, 1), e.view.dispatch(f.setMeta($, Cs(t, s)));
|
|
3751
3751
|
} catch {
|
|
3752
3752
|
e.view.dispatch(i.tr.setMeta($, Ss(t)));
|
|
@@ -3771,20 +3771,20 @@ function Ls({ accept: e, multiple: t, label: n }, r) {
|
|
|
3771
3771
|
//#endregion
|
|
3772
3772
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-actions.tsx
|
|
3773
3773
|
function Rs({ id: e, name: t, failed: n, retryable: r, storage: i }) {
|
|
3774
|
-
let { t: a } =
|
|
3774
|
+
let { t: a } = A(), o = n ? a("material.editor.upload.remove", "Remove {name}", { name: t }) : a("material.editor.upload.cancel", "Cancel upload of {name}", { name: t });
|
|
3775
3775
|
return /* @__PURE__ */ J("div", {
|
|
3776
3776
|
className: "ms-auto flex shrink-0 items-center gap-1",
|
|
3777
|
-
children: [n && r && /* @__PURE__ */ J(
|
|
3777
|
+
children: [n && r && /* @__PURE__ */ J(j, {
|
|
3778
3778
|
variant: "tonal",
|
|
3779
3779
|
size: "sm",
|
|
3780
3780
|
onClick: () => i.retry(e),
|
|
3781
|
-
children: [/* @__PURE__ */ q(
|
|
3782
|
-
}), /* @__PURE__ */ q(
|
|
3781
|
+
children: [/* @__PURE__ */ q(an, {}), a("material.editor.upload.retry", "Retry")]
|
|
3782
|
+
}), /* @__PURE__ */ q(M, {
|
|
3783
3783
|
variant: "ghost",
|
|
3784
3784
|
tooltip: o,
|
|
3785
3785
|
"aria-label": o,
|
|
3786
3786
|
onClick: () => i.cancel(e),
|
|
3787
|
-
children: q(n ?
|
|
3787
|
+
children: q(n ? mn : _n, {})
|
|
3788
3788
|
})]
|
|
3789
3789
|
});
|
|
3790
3790
|
}
|
|
@@ -3797,10 +3797,10 @@ function zs({ previewUrl: e, busy: n }) {
|
|
|
3797
3797
|
src: e,
|
|
3798
3798
|
alt: "",
|
|
3799
3799
|
className: t("size-full object-cover", n && "opacity-50")
|
|
3800
|
-
}) : /* @__PURE__ */ q(
|
|
3800
|
+
}) : /* @__PURE__ */ q(Bt, {
|
|
3801
3801
|
"aria-hidden": "true",
|
|
3802
3802
|
className: "size-5"
|
|
3803
|
-
}), n && /* @__PURE__ */ q(
|
|
3803
|
+
}), n && /* @__PURE__ */ q(Te, {
|
|
3804
3804
|
"aria-hidden": "true",
|
|
3805
3805
|
"aria-label": void 0,
|
|
3806
3806
|
contained: !0,
|
|
@@ -3819,7 +3819,7 @@ function Bs(e, t, n) {
|
|
|
3819
3819
|
}
|
|
3820
3820
|
}
|
|
3821
3821
|
function Vs({ id: e, storage: n, maxSize: r }) {
|
|
3822
|
-
let { t: i } =
|
|
3822
|
+
let { t: i } = A(), { queue: a } = n, o = G(a.subscribe, () => a.get(e), () => void 0);
|
|
3823
3823
|
if (!o) return null;
|
|
3824
3824
|
let s = o.file.name, c = o.status === "error";
|
|
3825
3825
|
return /* @__PURE__ */ J("div", {
|
|
@@ -3844,7 +3844,7 @@ function Vs({ id: e, storage: n, maxSize: r }) {
|
|
|
3844
3844
|
role: "alert",
|
|
3845
3845
|
className: "text-xs text-error-text",
|
|
3846
3846
|
children: Bs(i, o.failure, r)
|
|
3847
|
-
}) : /* @__PURE__ */ q(
|
|
3847
|
+
}) : /* @__PURE__ */ q(te, {
|
|
3848
3848
|
value: o.progress === void 0 ? null : o.progress * 100,
|
|
3849
3849
|
"aria-label": i("material.editor.upload.uploading", "Uploading {name}", { name: s }),
|
|
3850
3850
|
className: "mt-1.5"
|
|
@@ -3863,7 +3863,7 @@ function Vs({ id: e, storage: n, maxSize: r }) {
|
|
|
3863
3863
|
//#endregion
|
|
3864
3864
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-widget.tsx
|
|
3865
3865
|
function Hs(e, t, n, r) {
|
|
3866
|
-
let i = new
|
|
3866
|
+
let i = new et(Vs, {
|
|
3867
3867
|
editor: e,
|
|
3868
3868
|
props: {
|
|
3869
3869
|
id: r,
|
|
@@ -3938,7 +3938,7 @@ function Js(e, t, n, r) {
|
|
|
3938
3938
|
var Ys = class {
|
|
3939
3939
|
options;
|
|
3940
3940
|
entries = /* @__PURE__ */ new Map();
|
|
3941
|
-
listeners =
|
|
3941
|
+
listeners = mt();
|
|
3942
3942
|
counter = 0;
|
|
3943
3943
|
preview;
|
|
3944
3944
|
limit;
|
|
@@ -4059,7 +4059,7 @@ function Zs(e) {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
//#endregion
|
|
4061
4061
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-extension.ts
|
|
4062
|
-
var Qs = /* @__PURE__ */ new WeakMap(), $s =
|
|
4062
|
+
var Qs = /* @__PURE__ */ new WeakMap(), $s = L.create({
|
|
4063
4063
|
name: "upload",
|
|
4064
4064
|
addStorage: () => ({}),
|
|
4065
4065
|
onBeforeCreate() {
|
|
@@ -4105,9 +4105,9 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4105
4105
|
}
|
|
4106
4106
|
}), ec = (e = {}) => {
|
|
4107
4107
|
let { onUpload: t, ...n } = e;
|
|
4108
|
-
return
|
|
4108
|
+
return z(t ? {
|
|
4109
4109
|
name: "upload",
|
|
4110
|
-
extensions: (e) => [...e.has("image") ? [] : [
|
|
4110
|
+
extensions: (e) => [...e.has("image") ? [] : [gt], $s.configure({
|
|
4111
4111
|
...n,
|
|
4112
4112
|
onUpload: t,
|
|
4113
4113
|
translate: e.translate,
|
|
@@ -4118,18 +4118,18 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4118
4118
|
order: 61,
|
|
4119
4119
|
priority: 30,
|
|
4120
4120
|
kind: "panel",
|
|
4121
|
-
when: (e) => !!
|
|
4122
|
-
render:
|
|
4121
|
+
when: (e) => !!s(e)?.ownsImage,
|
|
4122
|
+
render: _
|
|
4123
4123
|
}],
|
|
4124
4124
|
bubble: [{
|
|
4125
4125
|
id: "image-alt",
|
|
4126
4126
|
order: 35,
|
|
4127
4127
|
priority: 60,
|
|
4128
4128
|
kind: "panel",
|
|
4129
|
-
when: (e) => !!
|
|
4129
|
+
when: (e) => !!s(e) && e.isActive("image"),
|
|
4130
4130
|
render: Zo
|
|
4131
4131
|
}],
|
|
4132
|
-
slash:
|
|
4132
|
+
slash: l("image"),
|
|
4133
4133
|
markdown: "native"
|
|
4134
4134
|
} : {
|
|
4135
4135
|
name: "upload",
|
|
@@ -4137,101 +4137,101 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4137
4137
|
markdown: "native"
|
|
4138
4138
|
});
|
|
4139
4139
|
}, tc = {
|
|
4140
|
-
accordion:
|
|
4141
|
-
actionCard:
|
|
4140
|
+
accordion: a,
|
|
4141
|
+
actionCard: Ie,
|
|
4142
4142
|
assistant: po,
|
|
4143
|
-
blocks:
|
|
4144
|
-
callout:
|
|
4145
|
-
checkboxGroup:
|
|
4146
|
-
codeBlock:
|
|
4147
|
-
color:
|
|
4143
|
+
blocks: pe,
|
|
4144
|
+
callout: Le,
|
|
4145
|
+
checkboxGroup: je,
|
|
4146
|
+
codeBlock: ue,
|
|
4147
|
+
color: we,
|
|
4148
4148
|
comments: No,
|
|
4149
|
-
count:
|
|
4149
|
+
count: Ee,
|
|
4150
4150
|
dragHandle: Fo,
|
|
4151
|
-
emoji:
|
|
4151
|
+
emoji: ye,
|
|
4152
4152
|
find: Vo,
|
|
4153
4153
|
focusMode: Uo,
|
|
4154
|
-
fontFamily:
|
|
4155
|
-
gallery:
|
|
4156
|
-
headings:
|
|
4157
|
-
highlight:
|
|
4158
|
-
image:
|
|
4154
|
+
fontFamily: Oe,
|
|
4155
|
+
gallery: oe,
|
|
4156
|
+
headings: ce,
|
|
4157
|
+
highlight: g,
|
|
4158
|
+
image: p,
|
|
4159
4159
|
inlineCode: Go,
|
|
4160
|
-
link:
|
|
4161
|
-
lists:
|
|
4160
|
+
link: ae,
|
|
4161
|
+
lists: D,
|
|
4162
4162
|
markdownPaste: Jo,
|
|
4163
|
-
marks:
|
|
4164
|
-
mention:
|
|
4163
|
+
marks: Re,
|
|
4164
|
+
mention: d,
|
|
4165
4165
|
outline: Xo,
|
|
4166
|
-
placeholder:
|
|
4167
|
-
radioGroup:
|
|
4168
|
-
selectCard:
|
|
4169
|
-
selectChip:
|
|
4170
|
-
slash:
|
|
4171
|
-
table:
|
|
4172
|
-
textAlign:
|
|
4166
|
+
placeholder: C,
|
|
4167
|
+
radioGroup: b,
|
|
4168
|
+
selectCard: y,
|
|
4169
|
+
selectChip: be,
|
|
4170
|
+
slash: n,
|
|
4171
|
+
table: xe,
|
|
4172
|
+
textAlign: x,
|
|
4173
4173
|
upload: ec,
|
|
4174
|
-
youtube:
|
|
4174
|
+
youtube: o
|
|
4175
4175
|
}, nc = (...e) => (t) => [...t, ...e], rc = (...e) => (t) => t.filter((t) => !e.includes(t.key ?? t.name)), ic = () => [
|
|
4176
|
-
Fe(),
|
|
4177
|
-
ye(),
|
|
4178
|
-
b(),
|
|
4179
|
-
Ae(),
|
|
4180
|
-
x()
|
|
4181
|
-
], ac = () => [
|
|
4182
4176
|
Ie(),
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4177
|
+
be(),
|
|
4178
|
+
y(),
|
|
4179
|
+
je(),
|
|
4180
|
+
b()
|
|
4181
|
+
], ac = () => [
|
|
4188
4182
|
Le(),
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4183
|
+
a(),
|
|
4184
|
+
oe(),
|
|
4185
|
+
n(),
|
|
4186
|
+
we(),
|
|
4187
|
+
Oe(),
|
|
4188
|
+
Re(),
|
|
4189
|
+
ce(),
|
|
4190
|
+
pe(),
|
|
4191
|
+
ae(),
|
|
4192
|
+
g(),
|
|
4193
|
+
x(),
|
|
4194
|
+
C(),
|
|
4195
|
+
Ee(),
|
|
4196
4196
|
Jo(),
|
|
4197
|
-
|
|
4198
|
-
|
|
4197
|
+
D(),
|
|
4198
|
+
p(),
|
|
4199
4199
|
ec(),
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4200
|
+
o(),
|
|
4201
|
+
ye({ suggest: !0 }),
|
|
4202
|
+
xe(),
|
|
4203
|
+
ue(),
|
|
4204
4204
|
Vo(),
|
|
4205
4205
|
Uo(),
|
|
4206
4206
|
Fo(),
|
|
4207
4207
|
No()
|
|
4208
4208
|
], oc = () => [
|
|
4209
|
-
|
|
4209
|
+
Re({ compact: !0 }),
|
|
4210
4210
|
Go(),
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4211
|
+
ae(),
|
|
4212
|
+
C(),
|
|
4213
|
+
Ee(),
|
|
4214
4214
|
Jo(),
|
|
4215
|
-
|
|
4215
|
+
D(),
|
|
4216
4216
|
ec()
|
|
4217
4217
|
], sc = () => [
|
|
4218
|
-
|
|
4218
|
+
Re({ compact: !0 }),
|
|
4219
4219
|
Go(),
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4220
|
+
ae(),
|
|
4221
|
+
C(),
|
|
4222
|
+
Ee(),
|
|
4223
|
+
ye({ suggest: !0 }),
|
|
4224
|
+
d()
|
|
4225
4225
|
];
|
|
4226
4226
|
//#endregion
|
|
4227
4227
|
//#region lib/components/ui/widgets/editor/extensions/assistant/use-assistant-feature.ts
|
|
4228
4228
|
function cc(e, t) {
|
|
4229
|
-
let n =
|
|
4230
|
-
|
|
4229
|
+
let n = U(e);
|
|
4230
|
+
V(() => {
|
|
4231
4231
|
n.current = e;
|
|
4232
4232
|
}, [e]);
|
|
4233
|
-
let r =
|
|
4234
|
-
return
|
|
4233
|
+
let r = B((e, t) => n.current(e, t), []), i = !!e;
|
|
4234
|
+
return H(() => i ? po({
|
|
4235
4235
|
...t,
|
|
4236
4236
|
onAssist: r
|
|
4237
4237
|
}) : void 0, [i, r]);
|
|
@@ -4239,24 +4239,24 @@ function cc(e, t) {
|
|
|
4239
4239
|
//#endregion
|
|
4240
4240
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-signal.tsx
|
|
4241
4241
|
function lc({ onChange: e }) {
|
|
4242
|
-
let { handle: t } =
|
|
4243
|
-
return
|
|
4242
|
+
let { handle: t } = O(), n = Ra(t).pending > 0, r = U(e), i = U(!1);
|
|
4243
|
+
return V(() => {
|
|
4244
4244
|
r.current = e;
|
|
4245
|
-
}, [e]),
|
|
4245
|
+
}, [e]), V(() => {
|
|
4246
4246
|
n !== i.current && (i.current = n, r.current?.(n));
|
|
4247
|
-
}, [n]),
|
|
4247
|
+
}, [n]), V(() => () => {
|
|
4248
4248
|
i.current && r.current?.(!1);
|
|
4249
4249
|
}, []), null;
|
|
4250
4250
|
}
|
|
4251
4251
|
//#endregion
|
|
4252
4252
|
//#region lib/components/ui/widgets/editor/extensions/upload/use-upload-feature.ts
|
|
4253
4253
|
function uc(e, t) {
|
|
4254
|
-
let n =
|
|
4255
|
-
|
|
4254
|
+
let n = U(e);
|
|
4255
|
+
V(() => {
|
|
4256
4256
|
n.current = e;
|
|
4257
4257
|
}, [e]);
|
|
4258
|
-
let r =
|
|
4259
|
-
return
|
|
4258
|
+
let r = B((e, t) => n.current(e, t), []), i = !!e;
|
|
4259
|
+
return H(() => i ? ec({
|
|
4260
4260
|
...t,
|
|
4261
4261
|
onUpload: r
|
|
4262
4262
|
}) : void 0, [i, r]);
|
|
@@ -4276,7 +4276,7 @@ function dc(e, t) {
|
|
|
4276
4276
|
//#endregion
|
|
4277
4277
|
//#region lib/components/ui/widgets/editor/partials/editor-character-count.tsx
|
|
4278
4278
|
function fc({ className: e }) {
|
|
4279
|
-
let { t: n } =
|
|
4279
|
+
let { t: n } = A(), { handle: r } = O(), i = N({
|
|
4280
4280
|
editor: r.editor,
|
|
4281
4281
|
selector: ({ editor: e }) => {
|
|
4282
4282
|
let t = e?.extensionManager.extensions.find((e) => e.name === "characterCount")?.options.limit;
|
|
@@ -4303,8 +4303,8 @@ function fc({ className: e }) {
|
|
|
4303
4303
|
//#endregion
|
|
4304
4304
|
//#region lib/components/ui/widgets/editor/partials/use-room-for.ts
|
|
4305
4305
|
function pc(e, t) {
|
|
4306
|
-
let [n, r] =
|
|
4307
|
-
return
|
|
4306
|
+
let [n, r] = W(!1);
|
|
4307
|
+
return V(() => {
|
|
4308
4308
|
let n = e.current;
|
|
4309
4309
|
if (!n) return;
|
|
4310
4310
|
if (typeof ResizeObserver > "u") {
|
|
@@ -4322,7 +4322,7 @@ function pc(e, t) {
|
|
|
4322
4322
|
//#region lib/components/ui/widgets/editor/presets/toolbar-looks.ts
|
|
4323
4323
|
var mc = t("[&_button[aria-pressed=true]]:rounded-full [&_button[data-variant=filled]]:rounded-full", "[&_button[aria-pressed=true]]:bg-(--tb-on) [&_button[data-variant=filled]]:bg-(--tb-on)", "[&_button[aria-pressed=true]]:text-(--tb-on-fg) [&_button[data-variant=filled]]:text-(--tb-on-fg)", "[&_button[aria-pressed=true]_svg]:stroke-(--tb-on-fg) [&_button[data-variant=filled]_svg]:stroke-(--tb-on-fg)", "[&_button[aria-pressed=true]_svg]:text-(--tb-on-fg) [&_button[data-variant=filled]_svg]:text-(--tb-on-fg)", "[&_button[aria-pressed=true]_svg]:stroke-[2.6] [&_button[data-variant=filled]_svg]:stroke-[2.6]"), hc = t("[&_button[data-toolbar-fit][data-variant=filled]:not([aria-pressed])]:bg-(--tb-on)", "[&_button[data-toolbar-fit][data-variant=filled]:not([aria-pressed])]:text-(--tb-on-fg)"), gc = t("gap-x-2 gap-y-1.5", "**:data-group-id:gap-0 **:data-group-id:rounded-xl", "**:data-group-id:bg-muted/60 **:data-group-id:p-0.5", "[&_button[data-variant]]:rounded-md", mc, hc), _c = t("items-center gap-1 **:data-group-id:gap-1", "[--tb-item:2.25rem] [&_button[data-variant]]:rounded-full [&_[data-toolbar-more]]:rounded-full", mc, hc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), vc = t(gc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), yc = t(gc, "**:data-[group=outline]:@4xl:hidden", "**:data-[group=comments]:@5xl:hidden"), bc = 56;
|
|
4324
4324
|
function xc({ side: e, children: n }) {
|
|
4325
|
-
let { t: r } =
|
|
4325
|
+
let { t: r } = A();
|
|
4326
4326
|
return /* @__PURE__ */ q("aside", {
|
|
4327
4327
|
"aria-label": r("material.editor.outline-region", "Document outline"),
|
|
4328
4328
|
"data-slot": "document-editor-rail",
|
|
@@ -4335,7 +4335,7 @@ function xc({ side: e, children: n }) {
|
|
|
4335
4335
|
});
|
|
4336
4336
|
}
|
|
4337
4337
|
function Sc({ toolbar: e, bar: n, panels: r, footer: i, outline: a, comments: o, presence: s, outlineSide: c = "start", className: l, children: u }) {
|
|
4338
|
-
let { t: d } =
|
|
4338
|
+
let { t: d } = A(), { chrome: f, handle: p, look: m } = O(), h = p.features.some((e) => e.key === "dragHandle"), g = f.state.focusMode, _ = U(null), v = pc(_, bc), y = a && !g && v, b = pc(_, 64), x = o && !g && b;
|
|
4339
4339
|
return /* @__PURE__ */ J("div", {
|
|
4340
4340
|
ref: _,
|
|
4341
4341
|
"data-slot": "document-editor",
|
|
@@ -4393,7 +4393,7 @@ function Sc({ toolbar: e, bar: n, panels: r, footer: i, outline: a, comments: o,
|
|
|
4393
4393
|
//#endregion
|
|
4394
4394
|
//#region lib/components/ui/widgets/editor/presets/preset-features.ts
|
|
4395
4395
|
var Cc = (e) => (t) => {
|
|
4396
|
-
let { features: n, mentions: r, outline: i, extra: a } = e, o = (typeof n == "function" ? n(t) : n) ?? (r ? [...t,
|
|
4396
|
+
let { features: n, mentions: r, outline: i, extra: a } = e, o = (typeof n == "function" ? n(t) : n) ?? (r ? [...t, d()] : t);
|
|
4397
4397
|
return [...i && !o.some((e) => e.key === "outline") ? [...o, Xo()] : o, ...a.filter((e) => !!e)];
|
|
4398
4398
|
}, wc = [
|
|
4399
4399
|
"min-h-[1lh]",
|
|
@@ -4468,15 +4468,15 @@ function zc(e) {
|
|
|
4468
4468
|
}
|
|
4469
4469
|
//#endregion
|
|
4470
4470
|
//#region lib/components/ui/widgets/editor/presets/compact-editor.tsx
|
|
4471
|
-
function Bc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar:
|
|
4472
|
-
let { t: S } =
|
|
4473
|
-
return /* @__PURE__ */ J(
|
|
4471
|
+
function Bc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: a = !0, look: o = "expressive", actions: s, onUpload: l, uploadOptions: u, onUploadingChange: d, onAssist: f, assistOptions: p, label: m, helperText: g, error: _, required: v, className: y, attributes: b, ...x }) {
|
|
4472
|
+
let { t: S } = A(), C = H(oc, []), ee = uc(l, u), te = cc(f, p), w = !!s || !!x.characterLimit;
|
|
4473
|
+
return /* @__PURE__ */ J(h, {
|
|
4474
4474
|
...x,
|
|
4475
4475
|
look: o,
|
|
4476
4476
|
features: Cc({
|
|
4477
4477
|
features: e,
|
|
4478
4478
|
mentions: x.mentions,
|
|
4479
|
-
extra: [
|
|
4479
|
+
extra: [ee, te]
|
|
4480
4480
|
}),
|
|
4481
4481
|
defaults: C,
|
|
4482
4482
|
attributes: {
|
|
@@ -4485,9 +4485,9 @@ function Bc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look
|
|
|
4485
4485
|
...b
|
|
4486
4486
|
},
|
|
4487
4487
|
children: [
|
|
4488
|
-
/* @__PURE__ */ q(
|
|
4488
|
+
/* @__PURE__ */ q(Ne, {
|
|
4489
4489
|
label: m,
|
|
4490
|
-
helperText:
|
|
4490
|
+
helperText: g,
|
|
4491
4491
|
error: _,
|
|
4492
4492
|
required: v,
|
|
4493
4493
|
className: y,
|
|
@@ -4497,24 +4497,24 @@ function Bc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look
|
|
|
4497
4497
|
"data-look": o,
|
|
4498
4498
|
className: t("overflow-clip border bg-card text-card-foreground transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast motion-reduce:transition-none", Rc(o, _)),
|
|
4499
4499
|
children: [
|
|
4500
|
-
|
|
4500
|
+
a && /* @__PURE__ */ q("div", {
|
|
4501
4501
|
"data-slot": "compact-editor-toolbar",
|
|
4502
4502
|
"data-look": o,
|
|
4503
4503
|
className: zc(o),
|
|
4504
|
-
children: /* @__PURE__ */ q(
|
|
4504
|
+
children: /* @__PURE__ */ q(T, {
|
|
4505
4505
|
dividers: !1,
|
|
4506
4506
|
density: "compact",
|
|
4507
4507
|
className: Ic(o, yc)
|
|
4508
4508
|
})
|
|
4509
4509
|
}),
|
|
4510
|
-
/* @__PURE__ */ q(
|
|
4511
|
-
|
|
4510
|
+
/* @__PURE__ */ q(E, { className: "px-3 py-2.5" }),
|
|
4511
|
+
w && /* @__PURE__ */ q(Vc, { actions: s })
|
|
4512
4512
|
]
|
|
4513
4513
|
})
|
|
4514
4514
|
}),
|
|
4515
|
-
|
|
4516
|
-
/* @__PURE__ */ q(
|
|
4517
|
-
/* @__PURE__ */ q(
|
|
4515
|
+
l && /* @__PURE__ */ q(lc, { onChange: d }),
|
|
4516
|
+
/* @__PURE__ */ q(c, {}),
|
|
4517
|
+
/* @__PURE__ */ q(i, {}),
|
|
4518
4518
|
/* @__PURE__ */ q(sr, {})
|
|
4519
4519
|
]
|
|
4520
4520
|
});
|
|
@@ -4533,16 +4533,16 @@ function Vc({ actions: e }) {
|
|
|
4533
4533
|
//#endregion
|
|
4534
4534
|
//#region lib/components/ui/widgets/editor/presets/compact-editor-form-field.tsx
|
|
4535
4535
|
function Hc({ control: e, name: n, ...r }) {
|
|
4536
|
-
return /* @__PURE__ */ q(
|
|
4536
|
+
return /* @__PURE__ */ q(Qe, {
|
|
4537
4537
|
control: e,
|
|
4538
4538
|
name: n,
|
|
4539
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(
|
|
4539
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q($e, {
|
|
4540
4540
|
onBlur: e.onBlur,
|
|
4541
4541
|
focusRef: e.ref,
|
|
4542
4542
|
children: /* @__PURE__ */ q(Bc, {
|
|
4543
4543
|
...r,
|
|
4544
4544
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
4545
|
-
value: e.value ??
|
|
4545
|
+
value: e.value ?? ze(r.format ?? "html"),
|
|
4546
4546
|
onChange: (t) => e.onChange(t),
|
|
4547
4547
|
editable: (r.editable ?? !0) && !e.disabled,
|
|
4548
4548
|
error: n.invalid,
|
|
@@ -4554,18 +4554,18 @@ function Hc({ control: e, name: n, ...r }) {
|
|
|
4554
4554
|
//#endregion
|
|
4555
4555
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-adapter-sync.tsx
|
|
4556
4556
|
function Uc({ adapter: e }) {
|
|
4557
|
-
let { handle: t } =
|
|
4558
|
-
return
|
|
4557
|
+
let { handle: t } = O(), n = Cr(t.editor);
|
|
4558
|
+
return V(() => n?.checkAdapter(), [n, e]), null;
|
|
4559
4559
|
}
|
|
4560
4560
|
//#endregion
|
|
4561
4561
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-comments-feature.ts
|
|
4562
4562
|
function Wc(e) {
|
|
4563
|
-
let t =
|
|
4564
|
-
|
|
4563
|
+
let t = U(e);
|
|
4564
|
+
xn(() => {
|
|
4565
4565
|
t.current = e;
|
|
4566
4566
|
}, [e]);
|
|
4567
4567
|
let n = !!e?.adapter;
|
|
4568
|
-
return
|
|
4568
|
+
return H(() => {
|
|
4569
4569
|
if (n) return No({
|
|
4570
4570
|
get adapter() {
|
|
4571
4571
|
return t.current?.adapter;
|
|
@@ -4585,8 +4585,8 @@ function Wc(e) {
|
|
|
4585
4585
|
//#endregion
|
|
4586
4586
|
//#region lib/components/ui/widgets/editor/partials/page-mode-switch.tsx
|
|
4587
4587
|
function Gc({ value: e, onChange: t }) {
|
|
4588
|
-
let { t: n } =
|
|
4589
|
-
return /* @__PURE__ */ J(
|
|
4588
|
+
let { t: n } = A();
|
|
4589
|
+
return /* @__PURE__ */ J(nt, {
|
|
4590
4590
|
type: "single",
|
|
4591
4591
|
variant: "segmented",
|
|
4592
4592
|
size: "sm",
|
|
@@ -4595,15 +4595,15 @@ function Gc({ value: e, onChange: t }) {
|
|
|
4595
4595
|
"aria-label": n("material.editor.page.mode", "View"),
|
|
4596
4596
|
"data-slot": "editor-page-mode",
|
|
4597
4597
|
children: [
|
|
4598
|
-
/* @__PURE__ */ q(
|
|
4598
|
+
/* @__PURE__ */ q(tt, {
|
|
4599
4599
|
value: "write",
|
|
4600
4600
|
children: n("material.editor.page.write", "Write")
|
|
4601
4601
|
}),
|
|
4602
|
-
/* @__PURE__ */ q(
|
|
4602
|
+
/* @__PURE__ */ q(tt, {
|
|
4603
4603
|
value: "preview",
|
|
4604
4604
|
children: n("material.editor.page.preview", "Preview")
|
|
4605
4605
|
}),
|
|
4606
|
-
/* @__PURE__ */ q(
|
|
4606
|
+
/* @__PURE__ */ q(tt, {
|
|
4607
4607
|
value: "markdown",
|
|
4608
4608
|
children: n("material.editor.page.markdown", "Markdown")
|
|
4609
4609
|
})
|
|
@@ -4612,14 +4612,14 @@ function Gc({ value: e, onChange: t }) {
|
|
|
4612
4612
|
}
|
|
4613
4613
|
//#endregion
|
|
4614
4614
|
//#region lib/components/ui/widgets/editor/partials/page-mode-views.tsx
|
|
4615
|
-
var Kc =
|
|
4615
|
+
var Kc = yn(() => import("./rich-text-viewer-W15XIwah.js").then((e) => e.n).then((e) => ({ default: e.RichTextViewer })));
|
|
4616
4616
|
function qc() {
|
|
4617
|
-
let { handle: e } =
|
|
4617
|
+
let { handle: e } = O(), { editor: t } = e, n = N({
|
|
4618
4618
|
editor: t,
|
|
4619
4619
|
selector: (e) => e.editor?.state.doc ?? null,
|
|
4620
4620
|
equalityFn: (e, t) => e === t
|
|
4621
4621
|
});
|
|
4622
|
-
return
|
|
4622
|
+
return H(() => !n || !t || e.isEmpty ? null : n.toJSON(), [
|
|
4623
4623
|
n,
|
|
4624
4624
|
t,
|
|
4625
4625
|
e.isEmpty
|
|
@@ -4633,8 +4633,8 @@ function Jc({ children: e }) {
|
|
|
4633
4633
|
});
|
|
4634
4634
|
}
|
|
4635
4635
|
function Yc({ json: e, components: t }) {
|
|
4636
|
-
let { t: n } =
|
|
4637
|
-
return e ? /* @__PURE__ */ q(
|
|
4636
|
+
let { t: n } = A(), { look: r } = O(), i = n("material.editor.page.empty", "Nothing to show yet.");
|
|
4637
|
+
return e ? /* @__PURE__ */ q(vn, {
|
|
4638
4638
|
fallback: /* @__PURE__ */ q(Jc, { children: n("material.editor.page.loading", "Loading…") }),
|
|
4639
4639
|
children: /* @__PURE__ */ q(Kc, {
|
|
4640
4640
|
value: e,
|
|
@@ -4645,8 +4645,8 @@ function Yc({ json: e, components: t }) {
|
|
|
4645
4645
|
}) : /* @__PURE__ */ q(Jc, { children: i });
|
|
4646
4646
|
}
|
|
4647
4647
|
function Xc({ json: e }) {
|
|
4648
|
-
let { t } =
|
|
4649
|
-
return
|
|
4648
|
+
let { t } = A(), { handle: n } = O(), [r, i] = W(null), a = n.editor?.extensionManager.extensions;
|
|
4649
|
+
return V(() => {
|
|
4650
4650
|
let t = !0;
|
|
4651
4651
|
if (!e) {
|
|
4652
4652
|
i("");
|
|
@@ -4680,7 +4680,7 @@ function $c(e, n) {
|
|
|
4680
4680
|
//#endregion
|
|
4681
4681
|
//#region lib/components/ui/widgets/editor/presets/page-rails.tsx
|
|
4682
4682
|
function el({ children: e, fab: t }) {
|
|
4683
|
-
let { t: n } =
|
|
4683
|
+
let { t: n } = A();
|
|
4684
4684
|
return t === void 0 ? /* @__PURE__ */ q("aside", {
|
|
4685
4685
|
"aria-label": n("material.editor.tools", "Tools"),
|
|
4686
4686
|
"data-slot": "document-editor-tools",
|
|
@@ -4700,7 +4700,7 @@ function el({ children: e, fab: t }) {
|
|
|
4700
4700
|
});
|
|
4701
4701
|
}
|
|
4702
4702
|
function tl({ side: e, children: t }) {
|
|
4703
|
-
let { t: n } =
|
|
4703
|
+
let { t: n } = A();
|
|
4704
4704
|
return /* @__PURE__ */ q("aside", {
|
|
4705
4705
|
"aria-label": n("material.editor.outline-region", "Document outline"),
|
|
4706
4706
|
"data-slot": "document-editor-rail",
|
|
@@ -4710,7 +4710,7 @@ function tl({ side: e, children: t }) {
|
|
|
4710
4710
|
});
|
|
4711
4711
|
}
|
|
4712
4712
|
function nl({ children: e }) {
|
|
4713
|
-
let { t } =
|
|
4713
|
+
let { t } = A();
|
|
4714
4714
|
return /* @__PURE__ */ q("aside", {
|
|
4715
4715
|
"aria-label": t("material.editor.comments.title", "Comments"),
|
|
4716
4716
|
"data-slot": "document-editor-comments",
|
|
@@ -4719,14 +4719,14 @@ function nl({ children: e }) {
|
|
|
4719
4719
|
});
|
|
4720
4720
|
}
|
|
4721
4721
|
function rl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, panels: o, footer: s, outline: c, comments: l, presence: u, outlineSide: d = "start", className: f, children: p }) {
|
|
4722
|
-
let { chrome: m, handle: h, look: g } =
|
|
4722
|
+
let { chrome: m, handle: h, look: g } = O(), _ = g === "expressive", v = h.features.some((e) => e.key === "dragHandle"), y = m.state.focusMode, b = U(null), [x, S] = W("write"), C = x === "write", ee = pc(b, 64), te = pc(b, 72), w = C && !y, T = w && ee && r, E = !!(n && w && !T), ne = c && w && te, re = l && w && ee;
|
|
4723
4723
|
return /* @__PURE__ */ J("div", {
|
|
4724
4724
|
ref: b,
|
|
4725
4725
|
"data-slot": "document-editor",
|
|
4726
4726
|
"data-look": g,
|
|
4727
4727
|
"data-layout": "page",
|
|
4728
4728
|
"data-mode": x,
|
|
4729
|
-
className: t(Qc(_,
|
|
4729
|
+
className: t(Qc(_, E), f),
|
|
4730
4730
|
children: [
|
|
4731
4731
|
/* @__PURE__ */ J("div", {
|
|
4732
4732
|
"data-slot": "document-editor-toolbar",
|
|
@@ -4739,20 +4739,20 @@ function rl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4739
4739
|
onChange: S
|
|
4740
4740
|
}), u]
|
|
4741
4741
|
}),
|
|
4742
|
-
|
|
4742
|
+
w && !T && e,
|
|
4743
4743
|
C && o
|
|
4744
4744
|
]
|
|
4745
4745
|
}),
|
|
4746
4746
|
/* @__PURE__ */ q(ya, { className: "absolute end-3 top-3 z-20" }),
|
|
4747
|
-
|
|
4747
|
+
E && n,
|
|
4748
4748
|
/* @__PURE__ */ J("div", {
|
|
4749
4749
|
className: "flex items-start gap-4 px-2 pb-6 @2xl:gap-6 @2xl:px-6",
|
|
4750
4750
|
children: [
|
|
4751
|
-
|
|
4751
|
+
T && /* @__PURE__ */ q(el, {
|
|
4752
4752
|
fab: i,
|
|
4753
4753
|
children: r
|
|
4754
4754
|
}),
|
|
4755
|
-
|
|
4755
|
+
ne && d === "start" && /* @__PURE__ */ q(tl, {
|
|
4756
4756
|
side: "start",
|
|
4757
4757
|
children: c
|
|
4758
4758
|
}),
|
|
@@ -4773,15 +4773,15 @@ function rl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4773
4773
|
})
|
|
4774
4774
|
})
|
|
4775
4775
|
}),
|
|
4776
|
-
|
|
4776
|
+
ne && d === "end" && /* @__PURE__ */ q(tl, {
|
|
4777
4777
|
side: "end",
|
|
4778
4778
|
children: c
|
|
4779
4779
|
}),
|
|
4780
|
-
|
|
4780
|
+
re && /* @__PURE__ */ q(nl, { children: l })
|
|
4781
4781
|
]
|
|
4782
4782
|
}),
|
|
4783
4783
|
s && /* @__PURE__ */ q("div", {
|
|
4784
|
-
className: t("border-t px-4 py-2.5 @2xl:px-8",
|
|
4784
|
+
className: t("border-t px-4 py-2.5 @2xl:px-8", E && "order-3"),
|
|
4785
4785
|
children: s
|
|
4786
4786
|
})
|
|
4787
4787
|
]
|
|
@@ -4811,7 +4811,7 @@ var il = {
|
|
|
4811
4811
|
history: 50
|
|
4812
4812
|
};
|
|
4813
4813
|
function ol(e) {
|
|
4814
|
-
return e.some((e) => e.name === "slash") ?
|
|
4814
|
+
return e.some((e) => e.name === "slash") ? Pe(e.flatMap((e) => e.slash ?? [])) : [];
|
|
4815
4815
|
}
|
|
4816
4816
|
function sl(e, t) {
|
|
4817
4817
|
let n = new Set(t.map((e) => e.id));
|
|
@@ -4821,14 +4821,14 @@ function sl(e, t) {
|
|
|
4821
4821
|
});
|
|
4822
4822
|
}
|
|
4823
4823
|
function cl(e, t) {
|
|
4824
|
-
return sl(e, t).flatMap((e) => e.id === "marks" && e.render ===
|
|
4824
|
+
return sl(e, t).flatMap((e) => e.id === "marks" && e.render === r ? [{
|
|
4825
4825
|
...e,
|
|
4826
|
-
render:
|
|
4826
|
+
render: m
|
|
4827
4827
|
}, {
|
|
4828
4828
|
...e,
|
|
4829
4829
|
id: "marks-extra",
|
|
4830
4830
|
order: e.order + .5,
|
|
4831
|
-
render:
|
|
4831
|
+
render: ie
|
|
4832
4832
|
}] : [e]).map((e) => ({
|
|
4833
4833
|
...e,
|
|
4834
4834
|
priority: al[e.id] ?? e.priority
|
|
@@ -4837,28 +4837,28 @@ function cl(e, t) {
|
|
|
4837
4837
|
//#endregion
|
|
4838
4838
|
//#region lib/components/ui/widgets/editor/partials/use-toolbar-shown.ts
|
|
4839
4839
|
function ll() {
|
|
4840
|
-
let { handle: e, chrome: t } =
|
|
4841
|
-
return !!
|
|
4840
|
+
let { handle: e, chrome: t } = O();
|
|
4841
|
+
return !!N({
|
|
4842
4842
|
editor: e.editor,
|
|
4843
|
-
selector: (e) => !!(e.editor?.isEditable &&
|
|
4843
|
+
selector: (e) => !!(e.editor?.isEditable && v.selectShowToolbar(t.state))
|
|
4844
4844
|
});
|
|
4845
4845
|
}
|
|
4846
4846
|
//#endregion
|
|
4847
4847
|
//#region lib/components/ui/widgets/editor/partials/editor-insert-fab.tsx
|
|
4848
4848
|
function ul() {
|
|
4849
|
-
let { t: e } =
|
|
4850
|
-
return !
|
|
4849
|
+
let { t: e } = A(), { handle: t } = O(), { editor: n, features: r } = t, i = U(!1), a = H(() => ne(ol(r), "", e), [r, e]), o = ll();
|
|
4850
|
+
return !n || !o || a.length === 0 ? null : /* @__PURE__ */ q(ee, {
|
|
4851
4851
|
"data-slot": "editor-insert-fab",
|
|
4852
4852
|
label: e("material.editor.insert", "Insert"),
|
|
4853
|
-
items:
|
|
4853
|
+
items: a.map((e) => ({
|
|
4854
4854
|
id: e.id,
|
|
4855
4855
|
icon: /* @__PURE__ */ q(e.icon, {}),
|
|
4856
4856
|
label: e.title,
|
|
4857
4857
|
onSelect: () => {
|
|
4858
|
-
|
|
4859
|
-
let t =
|
|
4858
|
+
i.current = !0;
|
|
4859
|
+
let t = n.state.selection.from;
|
|
4860
4860
|
e.run({
|
|
4861
|
-
editor:
|
|
4861
|
+
editor: n,
|
|
4862
4862
|
range: {
|
|
4863
4863
|
from: t,
|
|
4864
4864
|
to: t
|
|
@@ -4867,18 +4867,18 @@ function ul() {
|
|
|
4867
4867
|
}
|
|
4868
4868
|
})),
|
|
4869
4869
|
onCloseAutoFocus: (e) => {
|
|
4870
|
-
|
|
4870
|
+
i.current && (i.current = !1, e.preventDefault(), n.isDestroyed || n.commands.focus());
|
|
4871
4871
|
}
|
|
4872
4872
|
});
|
|
4873
4873
|
}
|
|
4874
4874
|
//#endregion
|
|
4875
4875
|
//#region lib/components/ui/widgets/editor/partials/editor-floating-bar.tsx
|
|
4876
4876
|
function dl({ className: e }) {
|
|
4877
|
-
let { handle: t } =
|
|
4877
|
+
let { handle: t } = O(), n = H(() => ol(t.features), [t.features]), r = B((e) => cl(e, n), [n]);
|
|
4878
4878
|
return ll() ? /* @__PURE__ */ q("div", {
|
|
4879
4879
|
"data-slot": "editor-floating-bar",
|
|
4880
4880
|
className: "nxgt-editor-bar",
|
|
4881
|
-
children: /* @__PURE__ */ J(
|
|
4881
|
+
children: /* @__PURE__ */ J(le, { children: [/* @__PURE__ */ q(T, {
|
|
4882
4882
|
variant: "floating",
|
|
4883
4883
|
dividers: !1,
|
|
4884
4884
|
className: e,
|
|
@@ -4889,8 +4889,8 @@ function dl({ className: e }) {
|
|
|
4889
4889
|
//#endregion
|
|
4890
4890
|
//#region lib/components/ui/widgets/editor/partials/editor-rail-toolbar.tsx
|
|
4891
4891
|
function fl({ floating: e, className: t }) {
|
|
4892
|
-
let { handle: n } =
|
|
4893
|
-
return /* @__PURE__ */ q(
|
|
4892
|
+
let { handle: n } = O(), r = H(() => e ? ol(n.features) : [], [e, n.features]), i = B((e) => sl(e, r), [r]);
|
|
4893
|
+
return /* @__PURE__ */ q(T, {
|
|
4894
4894
|
orientation: "vertical",
|
|
4895
4895
|
variant: e ? "floating" : void 0,
|
|
4896
4896
|
className: t,
|
|
@@ -4902,7 +4902,7 @@ function fl({ floating: e, className: t }) {
|
|
|
4902
4902
|
function pl({ look: e, layout: t, previewComponents: n, outline: r, comments: i, collaboration: a, collaborationStatus: o, footer: s, status: c, actions: l }) {
|
|
4903
4903
|
let u = t === "page", d = Lc(e), f = e === "expressive";
|
|
4904
4904
|
return {
|
|
4905
|
-
toolbar: f ? void 0 : /* @__PURE__ */ q(
|
|
4905
|
+
toolbar: f ? void 0 : /* @__PURE__ */ q(T, {
|
|
4906
4906
|
dividers: !1,
|
|
4907
4907
|
className: u ? d.docked : Ic(e, yc)
|
|
4908
4908
|
}),
|
|
@@ -4926,73 +4926,73 @@ function pl({ look: e, layout: t, previewComponents: n, outline: r, comments: i,
|
|
|
4926
4926
|
}
|
|
4927
4927
|
//#endregion
|
|
4928
4928
|
//#region lib/components/ui/widgets/editor/presets/document-editor.tsx
|
|
4929
|
-
function ml({ features: e, layout: n = "docked", look: r = "expressive", previewComponents:
|
|
4930
|
-
let
|
|
4931
|
-
return /* @__PURE__ */ J(
|
|
4932
|
-
...
|
|
4929
|
+
function ml({ features: e, layout: n = "docked", look: r = "expressive", previewComponents: a, status: o, actions: s, footer: l = !0, outline: u = !1, onUpload: d, uploadOptions: f, onUploadingChange: p, onAssist: m, assistOptions: g, comments: _, collaboration: v, collaborationStatus: y, label: b, helperText: x, error: S, required: C, className: ee, attributes: te, ...w }) {
|
|
4930
|
+
let T = H(ac, []), ne = uc(d, f), re = cc(m, g), D = Wc(_), ie = n === "page" ? rl : Sc;
|
|
4931
|
+
return /* @__PURE__ */ J(h, {
|
|
4932
|
+
...w,
|
|
4933
4933
|
look: r,
|
|
4934
4934
|
features: Cc({
|
|
4935
4935
|
features: e,
|
|
4936
|
-
mentions:
|
|
4936
|
+
mentions: w.mentions,
|
|
4937
4937
|
outline: u,
|
|
4938
4938
|
extra: [
|
|
4939
|
-
te,
|
|
4940
4939
|
ne,
|
|
4941
|
-
|
|
4940
|
+
re,
|
|
4941
|
+
D,
|
|
4942
4942
|
v
|
|
4943
4943
|
]
|
|
4944
4944
|
}),
|
|
4945
|
-
defaults:
|
|
4945
|
+
defaults: T,
|
|
4946
4946
|
attributes: {
|
|
4947
4947
|
class: t("nxgt-prose min-h-64 focus:outline-none"),
|
|
4948
|
-
...
|
|
4948
|
+
...te
|
|
4949
4949
|
},
|
|
4950
4950
|
children: [
|
|
4951
|
-
/* @__PURE__ */ q(
|
|
4951
|
+
/* @__PURE__ */ q(Ne, {
|
|
4952
4952
|
label: b,
|
|
4953
4953
|
helperText: x,
|
|
4954
4954
|
error: S,
|
|
4955
4955
|
required: C,
|
|
4956
|
-
className:
|
|
4957
|
-
children: /* @__PURE__ */ q(
|
|
4956
|
+
className: ee,
|
|
4957
|
+
children: /* @__PURE__ */ q(ie, {
|
|
4958
4958
|
...pl({
|
|
4959
4959
|
look: r,
|
|
4960
4960
|
layout: n,
|
|
4961
|
-
previewComponents:
|
|
4961
|
+
previewComponents: a,
|
|
4962
4962
|
outline: u,
|
|
4963
|
-
comments: !!
|
|
4963
|
+
comments: !!D,
|
|
4964
4964
|
collaboration: !!v,
|
|
4965
4965
|
collaborationStatus: y,
|
|
4966
|
-
footer:
|
|
4966
|
+
footer: l,
|
|
4967
4967
|
status: o,
|
|
4968
4968
|
actions: s
|
|
4969
4969
|
}),
|
|
4970
|
-
children: /* @__PURE__ */ q(Wi, { children: /* @__PURE__ */ q(
|
|
4970
|
+
children: /* @__PURE__ */ q(Wi, { children: /* @__PURE__ */ q(E, {}) })
|
|
4971
4971
|
})
|
|
4972
4972
|
}),
|
|
4973
4973
|
d && /* @__PURE__ */ q(lc, { onChange: p }),
|
|
4974
|
-
/* @__PURE__ */ q(
|
|
4975
|
-
/* @__PURE__ */ q(
|
|
4974
|
+
/* @__PURE__ */ q(c, {}),
|
|
4975
|
+
/* @__PURE__ */ q(i, {}),
|
|
4976
4976
|
/* @__PURE__ */ q(sr, {}),
|
|
4977
4977
|
/* @__PURE__ */ q(yi, {}),
|
|
4978
4978
|
/* @__PURE__ */ q(Dr, {}),
|
|
4979
|
-
|
|
4979
|
+
D && /* @__PURE__ */ q(Uc, { adapter: _?.adapter })
|
|
4980
4980
|
]
|
|
4981
4981
|
});
|
|
4982
4982
|
}
|
|
4983
4983
|
//#endregion
|
|
4984
4984
|
//#region lib/components/ui/widgets/editor/presets/document-editor-form-field.tsx
|
|
4985
4985
|
function hl({ control: e, name: n, ...r }) {
|
|
4986
|
-
return /* @__PURE__ */ q(
|
|
4986
|
+
return /* @__PURE__ */ q(Qe, {
|
|
4987
4987
|
control: e,
|
|
4988
4988
|
name: n,
|
|
4989
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(
|
|
4989
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q($e, {
|
|
4990
4990
|
onBlur: e.onBlur,
|
|
4991
4991
|
focusRef: e.ref,
|
|
4992
4992
|
children: /* @__PURE__ */ q(ml, {
|
|
4993
4993
|
...r,
|
|
4994
4994
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
4995
|
-
value: e.value ??
|
|
4995
|
+
value: e.value ?? ze(r.format ?? "html"),
|
|
4996
4996
|
onChange: (t) => e.onChange(t),
|
|
4997
4997
|
editable: (r.editable ?? !0) && !e.disabled,
|
|
4998
4998
|
error: n.invalid,
|
|
@@ -5012,12 +5012,12 @@ function gl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled
|
|
|
5012
5012
|
}),
|
|
5013
5013
|
t && /* @__PURE__ */ q("div", {
|
|
5014
5014
|
className: "w-full",
|
|
5015
|
-
children: /* @__PURE__ */ q(
|
|
5015
|
+
children: /* @__PURE__ */ q(de, {
|
|
5016
5016
|
replyTo: t,
|
|
5017
5017
|
onCancel: n
|
|
5018
5018
|
})
|
|
5019
5019
|
}),
|
|
5020
|
-
/* @__PURE__ */ q(
|
|
5020
|
+
/* @__PURE__ */ q(me, {
|
|
5021
5021
|
attachments: r,
|
|
5022
5022
|
isDisabled: i,
|
|
5023
5023
|
onAttachmentsChange: a,
|
|
@@ -5028,19 +5028,19 @@ function gl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled
|
|
|
5028
5028
|
//#endregion
|
|
5029
5029
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/send-control.tsx
|
|
5030
5030
|
function _l({ sendLabel: e, stopLabel: t, disabled: n, empty: r, onStop: i, onSchedule: a, squircle: o }) {
|
|
5031
|
-
let { t: s } =
|
|
5032
|
-
return !a || i ? /* @__PURE__ */ q(
|
|
5031
|
+
let { t: s } = A();
|
|
5032
|
+
return !a || i ? /* @__PURE__ */ q(ke, {
|
|
5033
5033
|
sendLabel: e,
|
|
5034
5034
|
stopLabel: t,
|
|
5035
5035
|
isDisabled: n,
|
|
5036
5036
|
isEmpty: r,
|
|
5037
5037
|
onStop: i,
|
|
5038
5038
|
shape: o ? "squircle" : "round"
|
|
5039
|
-
}) : /* @__PURE__ */ q(
|
|
5039
|
+
}) : /* @__PURE__ */ q(se, {
|
|
5040
5040
|
type: "submit",
|
|
5041
5041
|
disabled: n || r,
|
|
5042
5042
|
menuLabel: s("material.editor.send-options", "Send options"),
|
|
5043
|
-
menu: /* @__PURE__ */ q(
|
|
5043
|
+
menu: /* @__PURE__ */ q(k, {
|
|
5044
5044
|
onSelect: a,
|
|
5045
5045
|
children: s("material.editor.schedule", "Schedule…")
|
|
5046
5046
|
}),
|
|
@@ -5050,10 +5050,10 @@ function _l({ sendLabel: e, stopLabel: t, disabled: n, empty: r, onStop: i, onSc
|
|
|
5050
5050
|
//#endregion
|
|
5051
5051
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/send-on-enter.tsx
|
|
5052
5052
|
function vl(e, t) {
|
|
5053
|
-
return e.nativeEvent.keyCode !== 229 &&
|
|
5053
|
+
return e.nativeEvent.keyCode !== 229 && Ae(e, t);
|
|
5054
5054
|
}
|
|
5055
5055
|
function yl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i, children: a }) {
|
|
5056
|
-
let { handle: o } =
|
|
5056
|
+
let { handle: o } = O();
|
|
5057
5057
|
return /* @__PURE__ */ q("div", {
|
|
5058
5058
|
"data-slot": "rich-chat-composer-input",
|
|
5059
5059
|
className: i,
|
|
@@ -5067,14 +5067,14 @@ function yl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i,
|
|
|
5067
5067
|
//#endregion
|
|
5068
5068
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/tools-row.tsx
|
|
5069
5069
|
function bl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionable: a, attach: o, actions: s }) {
|
|
5070
|
-
let { t: c } =
|
|
5070
|
+
let { t: c } = A(), { handle: l } = O(), { editor: u } = l, d = c("material.editor.formatting-toggle", "Text formatting"), f = c("material.editor.mention", "Mention someone");
|
|
5071
5071
|
return /* @__PURE__ */ J("div", {
|
|
5072
5072
|
"data-slot": "rich-chat-composer-tools",
|
|
5073
5073
|
className: t("flex min-w-0 items-end gap-1", e ? "order-1" : "flex-1"),
|
|
5074
|
-
children: [/* @__PURE__ */ q(
|
|
5074
|
+
children: [/* @__PURE__ */ q(Se, {
|
|
5075
5075
|
...o,
|
|
5076
|
-
actions: /* @__PURE__ */ J(K, { children: [u?.storage.emoji && /* @__PURE__ */ q(
|
|
5077
|
-
/* @__PURE__ */ q(
|
|
5076
|
+
actions: /* @__PURE__ */ J(K, { children: [u?.storage.emoji && /* @__PURE__ */ q(fe, { editor: u }), !e && /* @__PURE__ */ J(K, { children: [
|
|
5077
|
+
/* @__PURE__ */ q(M, {
|
|
5078
5078
|
variant: "ghost",
|
|
5079
5079
|
color: "default",
|
|
5080
5080
|
tooltip: d,
|
|
@@ -5084,16 +5084,16 @@ function bl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionab
|
|
|
5084
5084
|
"aria-controls": n ? r : void 0,
|
|
5085
5085
|
onClick: i,
|
|
5086
5086
|
className: "size-8 shrink-0 rounded aria-pressed:bg-primary/10 aria-pressed:text-primary-text",
|
|
5087
|
-
children: /* @__PURE__ */ q(
|
|
5087
|
+
children: /* @__PURE__ */ q(jt, {})
|
|
5088
5088
|
}),
|
|
5089
|
-
a && /* @__PURE__ */ q(
|
|
5089
|
+
a && /* @__PURE__ */ q(M, {
|
|
5090
5090
|
variant: "ghost",
|
|
5091
5091
|
color: "default",
|
|
5092
5092
|
tooltip: f,
|
|
5093
5093
|
"aria-label": f,
|
|
5094
5094
|
onClick: () => u?.chain().focus().insertContent("@").run(),
|
|
5095
5095
|
className: "size-8 shrink-0 rounded",
|
|
5096
|
-
children: /* @__PURE__ */ q(
|
|
5096
|
+
children: /* @__PURE__ */ q(At, {})
|
|
5097
5097
|
}),
|
|
5098
5098
|
s
|
|
5099
5099
|
] })] })
|
|
@@ -5103,11 +5103,11 @@ function bl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionab
|
|
|
5103
5103
|
//#endregion
|
|
5104
5104
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-editor.ts
|
|
5105
5105
|
function xl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attributes: a, ...o }) {
|
|
5106
|
-
let { t: s } =
|
|
5106
|
+
let { t: s } = A(), c = H(() => sc().map((e) => e.name === "emoji" ? {
|
|
5107
5107
|
...e,
|
|
5108
5108
|
toolbar: void 0
|
|
5109
5109
|
} : e), []);
|
|
5110
|
-
return
|
|
5110
|
+
return w({
|
|
5111
5111
|
...o,
|
|
5112
5112
|
features: e ?? c,
|
|
5113
5113
|
defaults: c,
|
|
@@ -5123,7 +5123,7 @@ function xl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attri
|
|
|
5123
5123
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-pill.ts
|
|
5124
5124
|
var Sl = "[data-radix-popper-content-wrapper], [role=\"dialog\"]";
|
|
5125
5125
|
function Cl({ collapsed: e, occupied: t, files: n }) {
|
|
5126
|
-
let [r, i] =
|
|
5126
|
+
let [r, i] = W(!1), [a, o] = W(!1), s = bn();
|
|
5127
5127
|
return {
|
|
5128
5128
|
pill: e === "auto" && !a && !t && !r,
|
|
5129
5129
|
formatOpen: r,
|
|
@@ -5153,7 +5153,7 @@ async function wl(e, t) {
|
|
|
5153
5153
|
return {
|
|
5154
5154
|
value: n,
|
|
5155
5155
|
json: r,
|
|
5156
|
-
markdown: await
|
|
5156
|
+
markdown: await _t(r, i && { extensions: i }),
|
|
5157
5157
|
attachments: t
|
|
5158
5158
|
};
|
|
5159
5159
|
}
|
|
@@ -5161,7 +5161,7 @@ var Tl = (e, t) => e.trim().length > 0 || t > 0;
|
|
|
5161
5161
|
//#endregion
|
|
5162
5162
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-send.ts
|
|
5163
5163
|
function El({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSchedule: a, onError: o }) {
|
|
5164
|
-
let { t: s } =
|
|
5164
|
+
let { t: s } = A(), [c, l] = W(!1), u = U(!1), d = () => wl({
|
|
5165
5165
|
getValue: () => e.getValue(),
|
|
5166
5166
|
getJSON: () => e.editor?.getJSON() ?? { type: "doc" },
|
|
5167
5167
|
getExtensions: () => e.editor?.extensionManager.extensions
|
|
@@ -5200,16 +5200,16 @@ function El({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSche
|
|
|
5200
5200
|
//#endregion
|
|
5201
5201
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-rich-chat-composer.ts
|
|
5202
5202
|
function Dl({ handle: e, onSend: t, onSchedule: n, onError: r, disabled: i = !1, isLoading: a = !1, accept: o, maxFiles: s, attachments: c, onAttachmentsChange: l }) {
|
|
5203
|
-
let [u, d] =
|
|
5203
|
+
let [u, d] = W([]), f = c ?? u, p = (e) => {
|
|
5204
5204
|
c === void 0 && d(e), l?.(e);
|
|
5205
|
-
}, m =
|
|
5205
|
+
}, m = U(null), h = ve({
|
|
5206
5206
|
attachments: f,
|
|
5207
5207
|
accept: o,
|
|
5208
5208
|
maxFiles: s,
|
|
5209
5209
|
disabled: i,
|
|
5210
5210
|
isLoading: a,
|
|
5211
5211
|
onAttachmentsChange: p
|
|
5212
|
-
}), g = !Tl(
|
|
5212
|
+
}), g = !Tl(N({
|
|
5213
5213
|
editor: e.editor,
|
|
5214
5214
|
selector: (e) => (e.editor?.getText().trim().length ?? 0) > 0
|
|
5215
5215
|
}) ?? !1 ? "x" : "", f.length), _ = El({
|
|
@@ -5238,7 +5238,7 @@ function Dl({ handle: e, onSend: t, onSchedule: n, onError: r, disabled: i = !1,
|
|
|
5238
5238
|
//#endregion
|
|
5239
5239
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer.ts
|
|
5240
5240
|
function Ol(e) {
|
|
5241
|
-
let { t } =
|
|
5241
|
+
let { t } = A(), { disabled: n = !1, isLoading: r = !1, collapsed: i = "never" } = e, a = !n && !r, o = xl({
|
|
5242
5242
|
...e,
|
|
5243
5243
|
editable: a
|
|
5244
5244
|
}), s = Dl({
|
|
@@ -5269,22 +5269,22 @@ function Ol(e) {
|
|
|
5269
5269
|
//#endregion
|
|
5270
5270
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/rich-chat-composer.tsx
|
|
5271
5271
|
function kl(e) {
|
|
5272
|
-
let { t: n } =
|
|
5272
|
+
let { t: n } = A(), { mentions: r, replyTo: a, onCancelReply: o, actions: s, className: l } = e, { sendOnEnter: u = !0, sendLabel: d, isLoading: f = !1 } = e, { look: p = "expressive" } = e, { handle: m, editable: g, composer: _, ui: v, attach: y } = Ol(e), { files: b, attachments: x } = _, { pill: S } = v;
|
|
5273
5273
|
return /* @__PURE__ */ q("form", {
|
|
5274
5274
|
"data-slot": "rich-chat-composer",
|
|
5275
5275
|
"data-look": p,
|
|
5276
5276
|
"data-collapsed": S || void 0,
|
|
5277
5277
|
onSubmit: _.handleSubmit,
|
|
5278
5278
|
...v.formEvents,
|
|
5279
|
-
className: t("@container flex w-full min-w-0 flex-wrap items-end gap-x-1 gap-y-1.5 border bg-card p-2 text-card-foreground shadow-xs", "transition-[border-color,box-shadow,border-radius] duration-(--nxgt-motion-effects-default-duration) ease-effects-default motion-reduce:transition-none", "focus-within:border-primary/60 dark:focus-within:border-primary-indicator focus-within:ring-[3px] focus-within:ring-primary/15", S ? "rounded-full ps-2.5" : p === "expressive" ? "rounded-[1.75rem]" : "rounded-[1.375rem]", !
|
|
5280
|
-
children: /* @__PURE__ */ J(
|
|
5279
|
+
className: t("@container flex w-full min-w-0 flex-wrap items-end gap-x-1 gap-y-1.5 border bg-card p-2 text-card-foreground shadow-xs", "transition-[border-color,box-shadow,border-radius] duration-(--nxgt-motion-effects-default-duration) ease-effects-default motion-reduce:transition-none", "focus-within:border-primary/60 dark:focus-within:border-primary-indicator focus-within:ring-[3px] focus-within:ring-primary/15", S ? "rounded-full ps-2.5" : p === "expressive" ? "rounded-[1.75rem]" : "rounded-[1.375rem]", !g && "opacity-70", l),
|
|
5280
|
+
children: /* @__PURE__ */ J(h, {
|
|
5281
5281
|
editor: m,
|
|
5282
5282
|
className: "contents",
|
|
5283
5283
|
look: p,
|
|
5284
5284
|
children: [
|
|
5285
5285
|
/* @__PURE__ */ q(gl, {
|
|
5286
5286
|
error: b.errorMessage ?? _.sendError,
|
|
5287
|
-
replyTo:
|
|
5287
|
+
replyTo: a,
|
|
5288
5288
|
onCancelReply: o,
|
|
5289
5289
|
attachments: x,
|
|
5290
5290
|
isDisabled: b.isDisabled,
|
|
@@ -5295,14 +5295,14 @@ function kl(e) {
|
|
|
5295
5295
|
onFocus: v.activate,
|
|
5296
5296
|
onSend: () => void _.send(),
|
|
5297
5297
|
sendOnEnter: u,
|
|
5298
|
-
disabled: !
|
|
5299
|
-
children: /* @__PURE__ */ q(
|
|
5298
|
+
disabled: !g,
|
|
5299
|
+
children: /* @__PURE__ */ q(E, {})
|
|
5300
5300
|
}),
|
|
5301
5301
|
v.formatOpen && !S && /* @__PURE__ */ q("div", {
|
|
5302
5302
|
id: v.toolbarId,
|
|
5303
5303
|
"data-slot": "rich-chat-composer-toolbar",
|
|
5304
5304
|
className: "w-full px-1",
|
|
5305
|
-
children: /* @__PURE__ */ q(
|
|
5305
|
+
children: /* @__PURE__ */ q(T, {
|
|
5306
5306
|
dividers: !1,
|
|
5307
5307
|
density: "compact",
|
|
5308
5308
|
className: Ic(p, yc)
|
|
@@ -5329,8 +5329,8 @@ function kl(e) {
|
|
|
5329
5329
|
squircle: p === "expressive"
|
|
5330
5330
|
})
|
|
5331
5331
|
}),
|
|
5332
|
-
/* @__PURE__ */ q(
|
|
5333
|
-
/* @__PURE__ */ q(
|
|
5332
|
+
/* @__PURE__ */ q(c, {}),
|
|
5333
|
+
/* @__PURE__ */ q(i, {})
|
|
5334
5334
|
]
|
|
5335
5335
|
})
|
|
5336
5336
|
});
|
|
@@ -5338,24 +5338,24 @@ function kl(e) {
|
|
|
5338
5338
|
//#endregion
|
|
5339
5339
|
//#region lib/components/ui/widgets/editor/index.ts
|
|
5340
5340
|
var Al = {
|
|
5341
|
-
Root:
|
|
5342
|
-
Content:
|
|
5343
|
-
Toolbar:
|
|
5341
|
+
Root: h,
|
|
5342
|
+
Content: E,
|
|
5343
|
+
Toolbar: T,
|
|
5344
5344
|
Panel: jr,
|
|
5345
5345
|
AssistantPanel: sr,
|
|
5346
|
-
BubbleMenu:
|
|
5346
|
+
BubbleMenu: c,
|
|
5347
5347
|
CommentsRail: Oi,
|
|
5348
5348
|
CommentsPanel: yi,
|
|
5349
5349
|
CommentComposer: Dr,
|
|
5350
|
-
SuggestionList:
|
|
5350
|
+
SuggestionList: i,
|
|
5351
5351
|
Footer: Ta,
|
|
5352
5352
|
Outline: Na,
|
|
5353
5353
|
OutlinePanel: Fa,
|
|
5354
5354
|
FindPanel: ga,
|
|
5355
5355
|
BlockHandle: Wi,
|
|
5356
5356
|
FocusExit: ya,
|
|
5357
|
-
Field:
|
|
5357
|
+
Field: Ne,
|
|
5358
5358
|
Presence: hr
|
|
5359
5359
|
};
|
|
5360
5360
|
//#endregion
|
|
5361
|
-
export { Bc as CompactEditor, Hc as CompactEditorFormField, ml as DocumentEditor, hl as DocumentEditorFormField, Al as Editor, sr as EditorAssistantPanel, Wi as EditorBlockHandle,
|
|
5361
|
+
export { Bc as CompactEditor, Hc as CompactEditorFormField, ml as DocumentEditor, hl as DocumentEditorFormField, Al as Editor, sr as EditorAssistantPanel, Wi as EditorBlockHandle, c as EditorBubbleMenu, Dr as EditorCommentComposer, yi as EditorCommentsPanel, Oi as EditorCommentsRail, E as EditorContent, Ne as EditorField, ga as EditorFindPanel, ya as EditorFocusExit, Ta as EditorFooter, Na as EditorOutline, Fa as EditorOutlinePanel, jr as EditorPanel, hr as EditorPresence, h as EditorRoot, i as EditorSuggestionList, T as EditorToolbar, kl as RichChatComposer, sc as chatKit, oc as compactKit, z as defineFeature, ac as documentKit, tc as editorFeatures, ic as formNodesKit, yt as fromMarkdown, Ha as looksLikeMarkdown, bt as toHtml, vt as toJson, _t as toMarkdown, w as useEditor, O as useEditorContext, dr as useEditorPresence, Sa as useEditorStats, Ra as useEditorUploads, nc as withFeatures, rc as withoutFeatures };
|