@nxgt/material 3.67.0 → 3.70.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 +38 -0
- package/README.md +6 -4
- package/dist/{alert-dialog-BgQDxcYh.js → alert-dialog-CBkWG32g.js} +1 -1
- package/dist/{async-slice-BCZyWgGr.js → async-slice-CNZ3N55P.js} +1 -1
- package/dist/{button-2de_lrix.js → button-D3qzqDY_.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-Cs0uEjpu.js → chip-CMTe4sQd.js} +2 -2
- package/dist/{code-editor-BYhBAfcc.js → code-editor-Cs7mz1J-.js} +5 -5
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-xhmbF6wA.js → code-language-items-D_QMgjVy.js} +2 -2
- package/dist/{components-BRWaX4Xk.js → components-BbWcozcj.js} +18104 -17600
- package/dist/components.js +28 -28
- package/dist/{dialog-Co5oksU1.js → dialog-B3BSdRci.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-DdzyvN76.js → dropdown-menu-BaupOWgS.js} +1 -1
- package/dist/editor.js +661 -661
- package/dist/{empty-state-CQ0CV0kA.js → empty-state-B2Um5UpI.js} +2 -2
- package/dist/{field-blur-B2y-bNYi.js → field-blur-1XLyxRPr.js} +82 -82
- package/dist/{field-blur-context-BZtwcPUV.js → field-blur-context-XNvCDnMT.js} +1 -1
- package/dist/{hooks-DjuYsY-j.js → hooks-BU21Jpaa.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-BeBVy6tB.js → hover-card-Bvm3svX9.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-DbYsbzwZ.js → icon-badge-wip9bfa2.js} +3 -3
- package/dist/{icon-button-Co6ttdv1.js → icon-button-QwIeBTdw.js} +1 -1
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +3 -3
- package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +13 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +27 -0
- package/dist/lib/components/ui/fields/choice-list/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/choice-list/partials/choice-mark.d.ts +18 -0
- package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/types.d.ts +44 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/country-field/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +2 -0
- package/dist/lib/components/ui/fields/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/phone-field/index.d.ts +1 -1
- package/dist/lib/components/ui/fields/phone-field/parse-phone.d.ts +2 -0
- package/dist/lib/components/ui/fields/phone-field/phone-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/phone-form-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/use-phone-value.d.ts +2 -1
- package/dist/lib/components/ui/fields/postal-address/utils.d.ts +15 -0
- package/dist/lib/components/ui/fields/quantity-field/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-form-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +13 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-unit.d.ts +12 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-value.d.ts +9 -0
- package/dist/lib/components/ui/fields/quantity-field/types.d.ts +45 -0
- package/dist/lib/components/ui/media/upload/index.d.ts +1 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.d.ts +6 -1
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.errors.d.ts +8 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +2 -7
- package/dist/lib/components/ui/media/upload/network-upload-field/use-start-upload.d.ts +7 -3
- package/dist/lib/components/ui/media/upload/network-upload-field/use-upload-item-handlers.d.ts +2 -1
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.d.ts +2 -5
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.utils.d.ts +26 -1
- package/dist/lib/components/ui/media/upload/upload-error.d.ts +33 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-enter.d.ts +18 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/types.d.ts +3 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +10 -0
- package/dist/lib/i18n/resources/en/en.d.ts +20 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/resources.d.ts +40 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +42 -42
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -1
- package/dist/{public-AXwv1h3v.js → public-BuGgOtAl.js} +9 -9
- package/dist/{rich-code-block-qSvkA5rI.js → rich-code-block-DdHqzzek.js} +5 -5
- package/dist/{sortable-provider-DPk-RVEU.js → sortable-provider-DMyaSfZZ.js} +2 -2
- package/dist/{spinner-PdSk7zEs.js → spinner-ByYdcukU.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-CZQckLDd.js → theme-toggle-DB3aZZnO.js} +1 -1
- package/dist/{toolbar-items-BmNYNaRB.js → toolbar-items-DbzIKjo7.js} +3 -3
- package/dist/{translate-material-BlCQ6AW9.js → translate-material-Dh7MYkHT.js} +1 -1
- package/dist/{translator-ChpeKCO3.js → translator-Byhohi1S.js} +42 -2
- package/dist/{typography-C4JSRr2B.js → typography-rUf0mE5a.js} +1 -1
- package/dist/{use-chat-composer-OUa9akfM.js → use-chat-composer-uUUTRB3Z.js} +2401 -2343
- package/dist/{use-heading-spy-K-HUp4o_.js → use-heading-spy-CVzW2NM3.js} +4 -4
- package/dist/{use-material-translation-DkE9J5NE.js → use-material-translation-BAYyZOcH.js} +1 -1
- package/dist/{use-return-focus-KypnR7vv.js → use-return-focus-CQAuk9kh.js} +1 -1
- package/docs/components/form-fields.md +196 -3
- package/docs/components/media-and-files.md +55 -9
- package/docs/components/primitives.md +9 -14
- package/docs/components/rich-widgets.md +2 -1
- package/docs/components/selection-and-choice.md +10 -3
- package/docs/guides/forms.md +4 -3
- package/docs/previews/form-fields-choicelistfield.webp +0 -0
- package/docs/previews/form-fields-quantityfield.webp +0 -0
- package/docs/roadmap.md +5 -2
- package/docs/troubleshooting.md +11 -4
- package/package.json +1 -1
package/dist/editor.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
-
import { $ as n,
|
|
4
|
-
import { l as Ie, n as Le, t as Re } from "./alert-dialog-
|
|
5
|
-
import { c as ze, i as Be, n as Ve, o as He, r as Ue, s as We, t as Ge, u as A } from "./dropdown-menu-
|
|
6
|
-
import { c as Ke, o as qe, s as Je } from "./toolbar-items-
|
|
7
|
-
import { n as Ye, t as j } from "./button-
|
|
8
|
-
import { t as M } from "./use-material-translation-
|
|
9
|
-
import { t as N } from "./icon-button-
|
|
10
|
-
import { r as Xe, t as Ze } from "./field-blur-
|
|
3
|
+
import { $ as n, $i as r, A as i, Bn as a, C as o, D as s, E as c, G as l, Gn as u, J as d, Jn as f, K as p, Kn as m, M as h, Mn as g, N as _, Nn as v, O as y, On as b, Or as x, Q as ee, Qi as S, R as C, Rn as w, S as T, T as E, U as D, W as te, Wn as ne, X as re, Y as ie, Yn as ae, Z as oe, Zi as se, a as ce, ar as le, c as ue, cn as de, cr as O, d as fe, et as pe, g as me, i as he, ir as ge, j as _e, k as ve, kn as ye, l as be, ln as xe, lr as Se, m as Ce, nr as k, or as we, p as Te, q as Ee, qn as De, rr as Oe, s as ke, sn as Ae, t as je, w as Me, x as Ne, z as Pe, zn as Fe } from "./use-chat-composer-uUUTRB3Z.js";
|
|
4
|
+
import { l as Ie, n as Le, t as Re } from "./alert-dialog-CBkWG32g.js";
|
|
5
|
+
import { c as ze, i as Be, n as Ve, o as He, r as Ue, s as We, t as Ge, u as A } from "./dropdown-menu-BaupOWgS.js";
|
|
6
|
+
import { c as Ke, o as qe, s as Je } from "./toolbar-items-DbzIKjo7.js";
|
|
7
|
+
import { n as Ye, t as j } from "./button-D3qzqDY_.js";
|
|
8
|
+
import { t as M } from "./use-material-translation-BAYyZOcH.js";
|
|
9
|
+
import { t as N } from "./icon-button-QwIeBTdw.js";
|
|
10
|
+
import { r as Xe, t as Ze } from "./field-blur-1XLyxRPr.js";
|
|
11
11
|
import { a as Qe, s as P } from "./dist-C3GR7kJd.js";
|
|
12
12
|
import { n as $e, t as et } from "./toggle-group-DXXlqid2.js";
|
|
13
|
-
import { f as tt } from "./dialog-
|
|
14
|
-
import { n as nt } from "./icon-badge-
|
|
13
|
+
import { f as tt } from "./dialog-B3BSdRci.js";
|
|
14
|
+
import { n as nt } from "./icon-badge-wip9bfa2.js";
|
|
15
15
|
import { t as rt } from "./use-mobile-BDro060N.js";
|
|
16
|
-
import { Ft as it, Ht as at, Nt as ot, Ot as st, St as ct, bt as F, ht as I, mt as L, n as R, wt as z, xt as
|
|
17
|
-
import { t as
|
|
18
|
-
import { n as
|
|
19
|
-
import { W as
|
|
20
|
-
import { a as
|
|
21
|
-
import { d as
|
|
22
|
-
import { t as
|
|
23
|
-
import { n as
|
|
24
|
-
import { Suspense as
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { createPortal as
|
|
27
|
-
import { ArrowDown as
|
|
16
|
+
import { Ft as it, Ht as at, Nt as ot, Ot as st, St as ct, bt as F, ht as I, mt as L, n as R, wt as z, xt as B, yt as lt } from "./dist-moutbfbd.js";
|
|
17
|
+
import { t as ut } from "./markdown-Dw_uH7j7.js";
|
|
18
|
+
import { n as dt, r as V, t as ft } from "./create-store-Dqp-PLLn.js";
|
|
19
|
+
import { W as pt, w as mt } from "./youtube-node-A3NPAPgK.js";
|
|
20
|
+
import { a as ht, i as gt, n as _t, r as vt } from "./convert-7g-F5cNf.js";
|
|
21
|
+
import { d as yt, n as bt, r as xt, u as St } from "./headless-extensions-B1NAgmkE.js";
|
|
22
|
+
import { t as Ct } from "./render-json-COvAkihK.js";
|
|
23
|
+
import { n as wt, r as Tt } from "./collab-colors-CDkjUVoQ.js";
|
|
24
|
+
import { Suspense as Et, lazy as Dt, useCallback as H, useEffect as U, useId as Ot, useLayoutEffect as kt, useMemo as W, useRef as G, useState as K, useSyncExternalStore as At } from "react";
|
|
25
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
26
|
+
import { createPortal as jt } from "react-dom";
|
|
27
|
+
import { ArrowDown as Mt, ArrowUp as Nt, AtSign as Pt, CaseSensitive as Ft, Check as It, ChevronDown as Lt, ChevronLeft as Rt, ChevronRight as zt, ChevronUp as Bt, Code as Vt, Copy as Ht, CornerDownLeft as Ut, File as Wt, Focus as Gt, GripVertical as Kt, Heading1 as qt, Heading2 as Jt, Heading3 as Yt, Languages as Xt, List as Zt, ListOrdered as Qt, Maximize2 as $t, MessageSquare as en, MessageSquarePlus as tn, Minimize2 as nn, PenLine as rn, Pilcrow as an, Plus as on, Quote as sn, Replace as cn, RotateCcw as ln, Search as un, Smile as dn, Sparkles as fn, SpellCheck as pn, Square as mn, TableOfContents as hn, TextCursorInput as gn, TextQuote as _n, Trash2 as vn, WandSparkles as yn, WholeWord as bn, X as xn } from "lucide-react";
|
|
28
28
|
//#region lib/components/ui/widgets/editor/extensions/assistant/editor-extensions.ts
|
|
29
|
-
var
|
|
29
|
+
var Sn = (e) => e.extensionManager.baseExtensions;
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region lib/components/ui/widgets/editor/extensions/assistant/apply-result.ts
|
|
32
|
-
function
|
|
32
|
+
function Cn(e, t, n, r) {
|
|
33
33
|
let i = r.content ?? [];
|
|
34
34
|
if (n === "below") {
|
|
35
35
|
let n = e.resolve(t.to);
|
|
@@ -63,108 +63,108 @@ function wn(e, t, n, r) {
|
|
|
63
63
|
content: i.length === 1 && i[0]?.type === "paragraph" && t.from !== t.to && a.parent.isTextblock && a.sameParent(e.resolve(t.to)) ? i[0]?.content ?? [] : i
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
var
|
|
66
|
+
var wn = /* @__PURE__ */ new Set([
|
|
67
67
|
"image",
|
|
68
68
|
"gallery",
|
|
69
69
|
"youtube"
|
|
70
|
-
]),
|
|
70
|
+
]), Tn = /* @__PURE__ */ new Set(["paragraph", "heading"]), En = (e) => {
|
|
71
71
|
let t = typeof e.attrs?.alt == "string" ? e.attrs.alt.trim() : "", n = e.type === "youtube" ? "video" : e.type === "gallery" ? "gallery" : "image";
|
|
72
72
|
return t ? `[${n}: ${t}]` : `[${n}]`;
|
|
73
73
|
};
|
|
74
|
-
function
|
|
74
|
+
function Dn(e, t) {
|
|
75
75
|
if (t === "keep" || !e.content) return e;
|
|
76
|
-
let n =
|
|
77
|
-
if (e.type &&
|
|
76
|
+
let n = Tn.has(e.type ?? ""), r = e.content.flatMap((e) => {
|
|
77
|
+
if (e.type && wn.has(e.type)) {
|
|
78
78
|
if (t === "drop") return [];
|
|
79
79
|
let r = {
|
|
80
80
|
type: "text",
|
|
81
|
-
text:
|
|
81
|
+
text: En(e)
|
|
82
82
|
};
|
|
83
83
|
return [n ? r : {
|
|
84
84
|
type: "paragraph",
|
|
85
85
|
content: [r]
|
|
86
86
|
}];
|
|
87
87
|
}
|
|
88
|
-
return [
|
|
88
|
+
return [Dn(e, t)];
|
|
89
89
|
});
|
|
90
90
|
return {
|
|
91
91
|
...e,
|
|
92
92
|
content: r
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
96
|
-
let r =
|
|
97
|
-
return
|
|
95
|
+
async function On(e, t, n = "drop") {
|
|
96
|
+
let r = Sn(e);
|
|
97
|
+
return Dn(xt(await _t(t, { extensions: r }), r), n);
|
|
98
98
|
}
|
|
99
|
-
async function
|
|
100
|
-
let a = await
|
|
99
|
+
async function kn(e, t, n, r, i = {}) {
|
|
100
|
+
let a = await On(e, t, i.allowMedia ? "keep" : "drop");
|
|
101
101
|
if (e.isDestroyed || !e.isEditable) return !1;
|
|
102
102
|
let o = n();
|
|
103
103
|
if (!o) return !1;
|
|
104
104
|
let s = e.state.doc.content.size, c = {
|
|
105
105
|
from: Math.min(o.from, s),
|
|
106
106
|
to: Math.min(o.to, s)
|
|
107
|
-
}, l =
|
|
107
|
+
}, l = Cn(e.state.doc, c, r, a);
|
|
108
108
|
return l.content.length ? e.chain().focus().insertContentAt(l.range, l.content).run() : !1;
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-actions.ts
|
|
112
|
-
var
|
|
112
|
+
var An = [
|
|
113
113
|
"professional",
|
|
114
114
|
"friendly",
|
|
115
115
|
"direct"
|
|
116
|
-
],
|
|
116
|
+
], jn = [
|
|
117
117
|
"en",
|
|
118
118
|
"fr",
|
|
119
119
|
"es",
|
|
120
120
|
"de",
|
|
121
121
|
"pt"
|
|
122
|
-
],
|
|
122
|
+
], Mn = {
|
|
123
123
|
en: "English",
|
|
124
124
|
fr: "French",
|
|
125
125
|
es: "Spanish",
|
|
126
126
|
de: "German",
|
|
127
127
|
pt: "Portuguese"
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
let t = (t, n) => e(
|
|
128
|
+
}, Nn = (e) => `material.editor.assistant.${e}`;
|
|
129
|
+
function Pn(e) {
|
|
130
|
+
let t = (t, n) => e(Nn(`action.${t}`), n);
|
|
131
131
|
return [
|
|
132
132
|
{
|
|
133
133
|
id: "improve",
|
|
134
134
|
label: t("improve", "Improve writing"),
|
|
135
|
-
icon:
|
|
135
|
+
icon: yn,
|
|
136
136
|
prompt: "Improve the writing: clearer, smoother, same meaning and language.",
|
|
137
137
|
needsSelection: !0
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
id: "fix",
|
|
141
141
|
label: t("fix", "Fix spelling & grammar"),
|
|
142
|
-
icon:
|
|
142
|
+
icon: pn,
|
|
143
143
|
prompt: "Fix the spelling and grammar. Change nothing else.",
|
|
144
144
|
needsSelection: !0
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
id: "shorter",
|
|
148
148
|
label: t("shorter", "Make shorter"),
|
|
149
|
-
icon:
|
|
149
|
+
icon: nn,
|
|
150
150
|
prompt: "Make it shorter and keep the meaning.",
|
|
151
151
|
needsSelection: !0
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
id: "longer",
|
|
155
155
|
label: t("longer", "Make longer"),
|
|
156
|
-
icon:
|
|
156
|
+
icon: $t,
|
|
157
157
|
prompt: "Make it longer: develop the ideas and keep the meaning.",
|
|
158
158
|
needsSelection: !0
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
id: "tone",
|
|
162
162
|
label: t("tone", "Change tone"),
|
|
163
|
-
icon:
|
|
163
|
+
icon: dn,
|
|
164
164
|
needsSelection: !0,
|
|
165
|
-
actions:
|
|
165
|
+
actions: An.map((t) => ({
|
|
166
166
|
id: `tone:${t}`,
|
|
167
|
-
label: e(
|
|
167
|
+
label: e(Nn(`tone.${t}`), t[0]?.toUpperCase() + t.slice(1)),
|
|
168
168
|
prompt: `Rewrite it in a ${t} tone.`,
|
|
169
169
|
needsSelection: !0
|
|
170
170
|
}))
|
|
@@ -172,33 +172,33 @@ function Fn(e) {
|
|
|
172
172
|
{
|
|
173
173
|
id: "summarise",
|
|
174
174
|
label: t("summarise", "Summarise"),
|
|
175
|
-
icon:
|
|
175
|
+
icon: _n,
|
|
176
176
|
prompt: "Summarise it in a few sentences.",
|
|
177
177
|
needsSelection: !0
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
id: "continue",
|
|
181
181
|
label: t("continue", "Continue writing"),
|
|
182
|
-
icon:
|
|
182
|
+
icon: rn,
|
|
183
183
|
prompt: "Continue the text from where it stops, in the same style.",
|
|
184
184
|
needsSelection: !1
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
id: "translate",
|
|
188
188
|
label: t("translate", "Translate"),
|
|
189
|
-
icon:
|
|
189
|
+
icon: Xt,
|
|
190
190
|
needsSelection: !0,
|
|
191
|
-
actions:
|
|
191
|
+
actions: jn.map((t) => ({
|
|
192
192
|
id: `translate:${t}`,
|
|
193
|
-
label: e(
|
|
194
|
-
prompt: `Translate it into ${
|
|
193
|
+
label: e(Nn(`lang.${t}`), Mn[t]),
|
|
194
|
+
prompt: `Translate it into ${Mn[t]}.`,
|
|
195
195
|
needsSelection: !0
|
|
196
196
|
}))
|
|
197
197
|
}
|
|
198
198
|
];
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
let n =
|
|
200
|
+
function Fn(e, t) {
|
|
201
|
+
let n = Pn(t);
|
|
202
202
|
for (let t of e ?? []) {
|
|
203
203
|
let e = n.findIndex((e) => e.id === t.id);
|
|
204
204
|
e < 0 ? n.push(t) : n[e] = {
|
|
@@ -208,16 +208,16 @@ function In(e, t) {
|
|
|
208
208
|
}
|
|
209
209
|
return n;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function In(e, t) {
|
|
212
212
|
return e.filter((e) => t || !e.needsSelection).map((e) => e.actions ? {
|
|
213
213
|
...e,
|
|
214
|
-
actions:
|
|
214
|
+
actions: In(e.actions, t)
|
|
215
215
|
} : e);
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-shell.tsx
|
|
219
|
-
function
|
|
220
|
-
return
|
|
219
|
+
function Ln(e, t) {
|
|
220
|
+
return W(() => ({ current: { getBoundingClientRect: () => {
|
|
221
221
|
let { from: n, to: r } = t.getState().range;
|
|
222
222
|
try {
|
|
223
223
|
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,19 +227,19 @@ function Rn(e, t) {
|
|
|
227
227
|
}
|
|
228
228
|
} } }), [e, t]);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
let s = rt(), c =
|
|
232
|
-
return s ?
|
|
230
|
+
function Rn({ editor: e, controller: t, label: n, slot: r = "editor-assistant", locked: i, onDismiss: a, children: o }) {
|
|
231
|
+
let s = rt(), c = Ln(e, t);
|
|
232
|
+
return s ? jt(/* @__PURE__ */ J("section", {
|
|
233
233
|
role: "dialog",
|
|
234
234
|
"aria-label": n,
|
|
235
235
|
"data-slot": r,
|
|
236
236
|
"data-layout": "sheet",
|
|
237
237
|
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",
|
|
238
238
|
children: o
|
|
239
|
-
}), document.body) : /* @__PURE__ */
|
|
239
|
+
}), document.body) : /* @__PURE__ */ Y(qe, {
|
|
240
240
|
open: !0,
|
|
241
241
|
onOpenChange: (e) => !e && a("outside"),
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ J(Je, { virtualRef: c }), /* @__PURE__ */ J(Ke, {
|
|
243
243
|
role: "dialog",
|
|
244
244
|
"aria-label": n,
|
|
245
245
|
"data-slot": r,
|
|
@@ -258,7 +258,7 @@ function zn({ editor: e, controller: t, label: n, slot: r = "editor-assistant",
|
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-menu.tsx
|
|
261
|
-
function
|
|
261
|
+
function zn(e) {
|
|
262
262
|
if (![
|
|
263
263
|
"ArrowDown",
|
|
264
264
|
"ArrowUp",
|
|
@@ -268,8 +268,8 @@ function Bn(e) {
|
|
|
268
268
|
let t = [...e.currentTarget.querySelectorAll("input, [role=menuitem]")], n = t.indexOf(document.activeElement), r = e.key === "ArrowUp" ? -1 : 1, i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + r + t.length) % t.length;
|
|
269
269
|
e.preventDefault(), t[i]?.focus();
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
let { t: r } = M(), [i, a] =
|
|
271
|
+
function Bn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
272
|
+
let { t: r } = M(), [i, a] = K(null), o = W(() => In(i?.actions ?? e, t), [
|
|
273
273
|
i,
|
|
274
274
|
e,
|
|
275
275
|
t
|
|
@@ -280,23 +280,23 @@ function Vn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
280
280
|
prompt: e.prompt
|
|
281
281
|
});
|
|
282
282
|
};
|
|
283
|
-
return /* @__PURE__ */
|
|
284
|
-
onKeyDown:
|
|
283
|
+
return /* @__PURE__ */ Y("div", {
|
|
284
|
+
onKeyDown: zn,
|
|
285
285
|
className: "grid gap-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ J(Vn, { onAsk: (e) => n({
|
|
287
287
|
action: "ask",
|
|
288
288
|
label: e,
|
|
289
289
|
prompt: e
|
|
290
|
-
}) }), /* @__PURE__ */
|
|
290
|
+
}) }), /* @__PURE__ */ Y("div", {
|
|
291
291
|
role: "menu",
|
|
292
292
|
"aria-label": i?.label ?? r("material.editor.assistant.actions", "Actions"),
|
|
293
293
|
className: "grid gap-0.5",
|
|
294
|
-
children: [i && /* @__PURE__ */
|
|
295
|
-
icon: /* @__PURE__ */
|
|
294
|
+
children: [i && /* @__PURE__ */ J(Hn, {
|
|
295
|
+
icon: /* @__PURE__ */ J(Rt, { className: "size-4" }),
|
|
296
296
|
label: r("material.editor.assistant.back", "Back"),
|
|
297
297
|
onClick: () => a(null)
|
|
298
|
-
}), o.map((e) => /* @__PURE__ */
|
|
299
|
-
icon: e.icon && /* @__PURE__ */
|
|
298
|
+
}), o.map((e) => /* @__PURE__ */ J(Hn, {
|
|
299
|
+
icon: e.icon && /* @__PURE__ */ J(e.icon, { className: "size-4" }),
|
|
300
300
|
label: e.label,
|
|
301
301
|
submenu: !!e.actions,
|
|
302
302
|
onClick: () => s(e)
|
|
@@ -304,16 +304,16 @@ function Vn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
304
304
|
})]
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
let { t } = M(), [n, r] =
|
|
309
|
-
|
|
307
|
+
function Vn({ onAsk: e }) {
|
|
308
|
+
let { t } = M(), [n, r] = K(""), i = G(null);
|
|
309
|
+
U(() => i.current?.focus({ preventScroll: !0 }), []);
|
|
310
310
|
let a = () => {
|
|
311
311
|
let t = n.trim();
|
|
312
312
|
t && e(t);
|
|
313
313
|
};
|
|
314
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ Y("div", {
|
|
315
315
|
className: "flex items-center gap-1.5",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ J(tt, {
|
|
317
317
|
ref: i,
|
|
318
318
|
value: n,
|
|
319
319
|
"aria-label": t("material.editor.assistant.ask-label", "Ask the assistant"),
|
|
@@ -323,56 +323,56 @@ function Hn({ onAsk: e }) {
|
|
|
323
323
|
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), a());
|
|
324
324
|
},
|
|
325
325
|
className: "h-9 min-w-0 flex-1"
|
|
326
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ J(N, {
|
|
327
327
|
variant: "filled",
|
|
328
328
|
"aria-label": t("material.editor.assistant.send", "Send"),
|
|
329
329
|
disabled: !n.trim(),
|
|
330
330
|
onClick: a,
|
|
331
331
|
className: "size-9",
|
|
332
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ J(Nt, {})
|
|
333
333
|
})]
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
return /* @__PURE__ */
|
|
336
|
+
function Hn({ icon: e, label: n, submenu: r, onClick: i }) {
|
|
337
|
+
return /* @__PURE__ */ Y("button", {
|
|
338
338
|
type: "button",
|
|
339
339
|
role: "menuitem",
|
|
340
340
|
"aria-haspopup": r || void 0,
|
|
341
341
|
onClick: i,
|
|
342
342
|
className: t("flex min-h-9 w-full items-center gap-2.5 rounded-lg px-2.5 text-start text-sm", "text-popover-foreground transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast motion-reduce:transition-none hover:bg-primary/10", "focus-visible:bg-primary/10 focus-visible:outline-2 focus-visible:outline-primary-indicator focus-visible:-outline-offset-2"),
|
|
343
343
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ J("span", {
|
|
345
345
|
className: "grid size-4 shrink-0 place-items-center text-primary-text",
|
|
346
346
|
children: e
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ J("span", {
|
|
349
349
|
className: "min-w-0 flex-1 truncate",
|
|
350
350
|
children: n
|
|
351
351
|
}),
|
|
352
|
-
r && /* @__PURE__ */
|
|
352
|
+
r && /* @__PURE__ */ J(zt, { className: "size-4 text-muted-foreground rtl:rotate-180" })
|
|
353
353
|
]
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-preview.tsx
|
|
358
|
-
var
|
|
359
|
-
function
|
|
360
|
-
let [n, r] =
|
|
361
|
-
return
|
|
358
|
+
var Un = 90;
|
|
359
|
+
function Wn({ editor: e, markdown: t }) {
|
|
360
|
+
let [n, r] = K(null);
|
|
361
|
+
return U(() => {
|
|
362
362
|
let n = !0, i = setTimeout(() => {
|
|
363
|
-
|
|
364
|
-
n && r(
|
|
363
|
+
On(e, t, "inert").then((t) => {
|
|
364
|
+
n && r(Ct(t, void 0, Sn(e)));
|
|
365
365
|
}).catch(() => {
|
|
366
|
-
n && r(/* @__PURE__ */
|
|
366
|
+
n && r(/* @__PURE__ */ J("p", { children: t }));
|
|
367
367
|
});
|
|
368
|
-
},
|
|
368
|
+
}, Un);
|
|
369
369
|
return () => {
|
|
370
370
|
n = !1, clearTimeout(i);
|
|
371
371
|
};
|
|
372
|
-
}, [e, t]), /* @__PURE__ */
|
|
372
|
+
}, [e, t]), /* @__PURE__ */ J("div", {
|
|
373
373
|
"data-slot": "editor-assistant-preview",
|
|
374
374
|
className: "nxgt-prose max-h-64 overflow-auto rounded-lg border bg-card/60 px-3 py-2 text-sm max-md:max-h-[34svh]",
|
|
375
|
-
children: n ?? /* @__PURE__ */
|
|
375
|
+
children: n ?? /* @__PURE__ */ J("p", {
|
|
376
376
|
className: "whitespace-pre-wrap",
|
|
377
377
|
children: t
|
|
378
378
|
})
|
|
@@ -380,88 +380,88 @@ function Gn({ editor: e, markdown: t }) {
|
|
|
380
380
|
}
|
|
381
381
|
//#endregion
|
|
382
382
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-result.tsx
|
|
383
|
-
async function
|
|
383
|
+
async function Gn(e) {
|
|
384
384
|
try {
|
|
385
385
|
return await navigator.clipboard.writeText(e), !0;
|
|
386
386
|
} catch {
|
|
387
387
|
return !1;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
let { t } = M(), [n, r] =
|
|
392
|
-
return
|
|
390
|
+
function Kn({ text: e }) {
|
|
391
|
+
let { t } = M(), [n, r] = K(!1);
|
|
392
|
+
return U(() => {
|
|
393
393
|
if (!n) return;
|
|
394
394
|
let e = setTimeout(() => r(!1), 1600);
|
|
395
395
|
return () => clearTimeout(e);
|
|
396
|
-
}, [n]), /* @__PURE__ */
|
|
396
|
+
}, [n]), /* @__PURE__ */ Y(j, {
|
|
397
397
|
variant: "ghost",
|
|
398
398
|
size: "sm",
|
|
399
|
-
onClick: async () => r(await
|
|
400
|
-
children: [
|
|
399
|
+
onClick: async () => r(await Gn(e)),
|
|
400
|
+
children: [J(n ? It : Ht, {}), n ? t("material.editor.assistant.copied", "Copied") : t("material.editor.assistant.copy", "Copy")]
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
let { t: n } = M(), r =
|
|
405
|
-
return
|
|
403
|
+
function qn({ state: e, on: t }) {
|
|
404
|
+
let { t: n } = M(), r = G(null);
|
|
405
|
+
return U(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ Y("div", {
|
|
406
406
|
className: "flex flex-wrap items-center gap-1.5",
|
|
407
407
|
children: [
|
|
408
|
-
e.hasSelection && /* @__PURE__ */
|
|
408
|
+
e.hasSelection && /* @__PURE__ */ Y(j, {
|
|
409
409
|
ref: r,
|
|
410
410
|
size: "sm",
|
|
411
411
|
disabled: e.applying,
|
|
412
412
|
onClick: () => t.onApply("replace"),
|
|
413
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ J(cn, {}), n("material.editor.assistant.replace", "Replace selection")]
|
|
414
414
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ Y(j, {
|
|
416
416
|
ref: e.hasSelection ? void 0 : r,
|
|
417
417
|
variant: e.hasSelection ? "outlined" : "filled",
|
|
418
418
|
size: "sm",
|
|
419
419
|
disabled: e.applying,
|
|
420
420
|
onClick: () => t.onApply("below"),
|
|
421
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ J(Ut, {}), n("material.editor.assistant.insert-below", "Insert below")]
|
|
422
422
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ J(Kn, { text: e.text }),
|
|
424
|
+
/* @__PURE__ */ Y(j, {
|
|
425
425
|
variant: "ghost",
|
|
426
426
|
size: "sm",
|
|
427
427
|
disabled: e.applying,
|
|
428
428
|
onClick: t.onRetry,
|
|
429
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ J(ln, {}), n("material.editor.assistant.retry", "Retry")]
|
|
430
430
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ Y(j, {
|
|
432
432
|
variant: "ghost",
|
|
433
433
|
size: "sm",
|
|
434
434
|
onClick: t.onDiscard,
|
|
435
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ J(xn, {}), n("material.editor.assistant.discard", "Discard")]
|
|
436
436
|
})
|
|
437
437
|
]
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
let { t: n } = M(), r =
|
|
442
|
-
return
|
|
440
|
+
function Jn({ state: e, on: t }) {
|
|
441
|
+
let { t: n } = M(), r = G(null);
|
|
442
|
+
return U(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ Y("div", {
|
|
443
443
|
className: "grid gap-2",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ J("p", {
|
|
445
445
|
role: "alert",
|
|
446
446
|
"data-slot": "editor-assistant-error",
|
|
447
447
|
className: "rounded-lg border border-error/40 bg-error/10 px-3 py-2 text-sm",
|
|
448
448
|
children: e.error ? n("material.editor.assistant.failed", "The assistant could not answer: {message}", { message: e.error }) : n("material.editor.assistant.empty", "The assistant sent nothing.")
|
|
449
|
-
}), /* @__PURE__ */
|
|
449
|
+
}), /* @__PURE__ */ Y("div", {
|
|
450
450
|
className: "flex flex-wrap items-center gap-1.5",
|
|
451
451
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ Y(j, {
|
|
453
453
|
ref: r,
|
|
454
454
|
size: "sm",
|
|
455
455
|
onClick: t.onRetry,
|
|
456
|
-
children: [/* @__PURE__ */
|
|
456
|
+
children: [/* @__PURE__ */ J(ln, {}), n("material.editor.assistant.retry", "Retry")]
|
|
457
457
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ J(j, {
|
|
459
459
|
variant: "ghost",
|
|
460
460
|
size: "sm",
|
|
461
461
|
onClick: t.onBack,
|
|
462
462
|
children: n("material.editor.assistant.back", "Back")
|
|
463
463
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ J(j, {
|
|
465
465
|
variant: "ghost",
|
|
466
466
|
size: "sm",
|
|
467
467
|
onClick: t.onDiscard,
|
|
@@ -471,25 +471,25 @@ function Yn({ state: e, on: t }) {
|
|
|
471
471
|
})]
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
let { t: i } = M(), a =
|
|
476
|
-
return
|
|
474
|
+
function Yn({ editor: e, state: t, on: n, status: r }) {
|
|
475
|
+
let { t: i } = M(), a = G(null), o = t.phase === "streaming";
|
|
476
|
+
return U(() => {
|
|
477
477
|
o && a.current?.focus({ preventScroll: !0 });
|
|
478
|
-
}, [o]), /* @__PURE__ */
|
|
478
|
+
}, [o]), /* @__PURE__ */ Y("div", {
|
|
479
479
|
className: "grid gap-2",
|
|
480
480
|
children: [
|
|
481
481
|
r,
|
|
482
|
-
t.text && /* @__PURE__ */
|
|
482
|
+
t.text && /* @__PURE__ */ J(Wn, {
|
|
483
483
|
editor: e,
|
|
484
484
|
markdown: t.text
|
|
485
485
|
}),
|
|
486
|
-
o ? /* @__PURE__ */
|
|
486
|
+
o ? /* @__PURE__ */ J("div", { children: /* @__PURE__ */ Y(j, {
|
|
487
487
|
ref: a,
|
|
488
488
|
variant: "tonal",
|
|
489
489
|
size: "sm",
|
|
490
490
|
onClick: n.onStop,
|
|
491
|
-
children: [/* @__PURE__ */
|
|
492
|
-
}) }) : /* @__PURE__ */
|
|
491
|
+
children: [/* @__PURE__ */ J(mn, {}), i("material.editor.assistant.stop", "Stop")]
|
|
492
|
+
}) }) : /* @__PURE__ */ J(qn, {
|
|
493
493
|
state: t,
|
|
494
494
|
on: n
|
|
495
495
|
})
|
|
@@ -498,63 +498,63 @@ function Xn({ editor: e, state: t, on: n, status: r }) {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-stage.tsx
|
|
501
|
-
function
|
|
501
|
+
function Xn({ label: e, onDiscard: t }) {
|
|
502
502
|
let { t: n } = M();
|
|
503
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ Y("div", {
|
|
504
504
|
className: "flex items-center gap-2",
|
|
505
505
|
children: [
|
|
506
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ J(fn, {
|
|
507
507
|
className: "size-4 text-primary-text",
|
|
508
508
|
"aria-hidden": !0
|
|
509
509
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ J("span", {
|
|
511
511
|
className: "min-w-0 flex-1 truncate font-medium text-sm",
|
|
512
512
|
children: e
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ J(N, {
|
|
515
515
|
variant: "ghost",
|
|
516
516
|
"aria-label": n("material.editor.assistant.discard", "Discard"),
|
|
517
517
|
onClick: t,
|
|
518
518
|
className: "size-7",
|
|
519
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ J(xn, {})
|
|
520
520
|
})
|
|
521
521
|
]
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
return t.phase === "menu" ? /* @__PURE__ */
|
|
524
|
+
function Zn({ editor: e, state: t, actions: n, onChoose: r, on: i }) {
|
|
525
|
+
return t.phase === "menu" ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Qn, { note: t.note }), /* @__PURE__ */ J(Bn, {
|
|
526
526
|
actions: n,
|
|
527
527
|
hasSelection: t.hasSelection,
|
|
528
528
|
onChoose: r
|
|
529
|
-
})] }) : t.phase === "error" ? /* @__PURE__ */
|
|
529
|
+
})] }) : t.phase === "error" ? /* @__PURE__ */ J(Jn, {
|
|
530
530
|
state: t,
|
|
531
531
|
on: i
|
|
532
|
-
}) : t.phase === "streaming" || t.phase === "done" ? /* @__PURE__ */
|
|
532
|
+
}) : t.phase === "streaming" || t.phase === "done" ? /* @__PURE__ */ J(Yn, {
|
|
533
533
|
editor: e,
|
|
534
534
|
state: t,
|
|
535
535
|
on: i,
|
|
536
|
-
status: /* @__PURE__ */
|
|
536
|
+
status: /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J($n, {
|
|
537
537
|
phase: t.phase,
|
|
538
538
|
stopped: t.stopped
|
|
539
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ J(Qn, { note: t.note })] })
|
|
540
540
|
}) : null;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Qn({ note: e }) {
|
|
543
543
|
let { t } = M();
|
|
544
|
-
return e ? /* @__PURE__ */
|
|
544
|
+
return e ? /* @__PURE__ */ J("p", {
|
|
545
545
|
role: "status",
|
|
546
546
|
"data-slot": "editor-assistant-note",
|
|
547
547
|
className: "text-muted-foreground text-xs",
|
|
548
548
|
children: e === "selection-gone" ? t("material.editor.assistant.selection-gone", "The selected text was removed.") : t("material.editor.assistant.read-only", "The document is read-only.")
|
|
549
549
|
}) : null;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function $n({ phase: e, stopped: t }) {
|
|
552
552
|
let { t: n } = M(), r = n("material.editor.assistant.writing", "Writing…");
|
|
553
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ J("div", {
|
|
554
554
|
role: "status",
|
|
555
555
|
"data-slot": "editor-assistant-status",
|
|
556
556
|
className: "flex min-h-6 items-center gap-2 text-muted-foreground text-xs",
|
|
557
|
-
children: e === "streaming" ? /* @__PURE__ */
|
|
557
|
+
children: e === "streaming" ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Te, {
|
|
558
558
|
label: r,
|
|
559
559
|
className: "size-6"
|
|
560
560
|
}), r] }) : t ? n("material.editor.assistant.stopped", "Stopped") : n("material.editor.assistant.ready", "Answer ready")
|
|
@@ -562,13 +562,13 @@ function er({ phase: e, stopped: t }) {
|
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-storage.ts
|
|
565
|
-
var
|
|
565
|
+
var er = (e) => {
|
|
566
566
|
let t = e.storage.assistant;
|
|
567
567
|
return t?.controller ? t : void 0;
|
|
568
568
|
};
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-state.ts
|
|
571
|
-
function
|
|
571
|
+
function tr(e, t) {
|
|
572
572
|
let { range: n } = e, r = t(n.from, 1), i = Math.max(r, t(n.to, -1));
|
|
573
573
|
return r === n.from && i === n.to ? null : e.hasSelection && r === i ? {
|
|
574
574
|
range: {
|
|
@@ -582,7 +582,7 @@ function nr(e, t) {
|
|
|
582
582
|
to: i
|
|
583
583
|
} };
|
|
584
584
|
}
|
|
585
|
-
var
|
|
585
|
+
var nr = {
|
|
586
586
|
phase: "idle",
|
|
587
587
|
range: {
|
|
588
588
|
from: 0,
|
|
@@ -595,42 +595,42 @@ var Y = {
|
|
|
595
595
|
run: null,
|
|
596
596
|
applying: !1,
|
|
597
597
|
note: null
|
|
598
|
-
}, rr = () => () => {}, ir = (e) => e ?
|
|
598
|
+
}, rr = () => () => {}, ir = (e) => e ? er(e)?.controller : void 0;
|
|
599
599
|
function ar(e) {
|
|
600
600
|
let t = ir(e);
|
|
601
|
-
return
|
|
601
|
+
return At(t?.subscribe ?? rr, t?.getState ?? (() => nr), () => nr);
|
|
602
602
|
}
|
|
603
603
|
//#endregion
|
|
604
604
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-panel.tsx
|
|
605
605
|
function or(e) {
|
|
606
606
|
let { handle: t, chrome: n } = O(), r = t.features.some((e) => e.key === "assistant");
|
|
607
|
-
return !t.editor || !r || n.state.panel !== "assistant" ? null : /* @__PURE__ */
|
|
607
|
+
return !t.editor || !r || n.state.panel !== "assistant" ? null : /* @__PURE__ */ J(sr, {});
|
|
608
608
|
}
|
|
609
609
|
function sr() {
|
|
610
|
-
let { t: e, language: t } = M(), { handle: n } = O(), r = n.editor, i =
|
|
611
|
-
if (
|
|
610
|
+
let { t: e, language: t } = M(), { handle: n } = O(), r = n.editor, i = er(r), a = ar(r), o = i?.controller, s = W(() => Fn(i?.actions, e), [i?.actions, e]);
|
|
611
|
+
if (U(() => (o?.getState().phase === "idle" && o.begin(), () => o?.reset()), [o]), !o || a.phase === "idle") return null;
|
|
612
612
|
let c = (e) => {
|
|
613
613
|
o.close(), e !== "outside" && r.commands.focus();
|
|
614
614
|
}, l = () => c("discard"), u = (e) => void o.run({
|
|
615
615
|
...e,
|
|
616
616
|
locale: t ?? "en"
|
|
617
|
-
}), d = (e) => void o.apply(async (t) => await
|
|
617
|
+
}), d = (e) => void o.apply(async (t) => await kn(r, a.text, t, e, { allowMedia: i?.allowMedia }) ? "done" : r.isEditable ? "nothing" : "read-only"), f = (e) => {
|
|
618
618
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), c("escape"));
|
|
619
619
|
}, p = e("material.editor.assistant.title", "Assistant");
|
|
620
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ J(Rn, {
|
|
621
621
|
editor: r,
|
|
622
622
|
controller: o,
|
|
623
623
|
label: p,
|
|
624
624
|
locked: a.phase !== "menu",
|
|
625
625
|
onDismiss: c,
|
|
626
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ Y("div", {
|
|
627
627
|
ref: o.setPanel,
|
|
628
628
|
onKeyDown: f,
|
|
629
629
|
className: "grid gap-2.5",
|
|
630
|
-
children: [/* @__PURE__ */
|
|
630
|
+
children: [/* @__PURE__ */ J(Xn, {
|
|
631
631
|
label: a.run?.label ?? p,
|
|
632
632
|
onDiscard: l
|
|
633
|
-
}), /* @__PURE__ */
|
|
633
|
+
}), /* @__PURE__ */ J(Zn, {
|
|
634
634
|
editor: r,
|
|
635
635
|
state: a,
|
|
636
636
|
actions: s,
|
|
@@ -655,7 +655,7 @@ function ur() {
|
|
|
655
655
|
}
|
|
656
656
|
function dr(e) {
|
|
657
657
|
let t = e?.storage.nxgtPresence?.store ?? null;
|
|
658
|
-
return
|
|
658
|
+
return At(t ? t.subscribe : lr, t ? t.getSnapshot : () => cr, () => cr);
|
|
659
659
|
}
|
|
660
660
|
//#endregion
|
|
661
661
|
//#region lib/components/ui/widgets/editor/extensions/collab/editor-presence.tsx
|
|
@@ -677,17 +677,17 @@ var fr = {
|
|
|
677
677
|
]
|
|
678
678
|
};
|
|
679
679
|
function pr({ user: e }) {
|
|
680
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ J("span", {
|
|
681
681
|
role: "img",
|
|
682
682
|
"aria-label": e.name,
|
|
683
683
|
title: e.name,
|
|
684
684
|
className: "flex",
|
|
685
|
-
children: /* @__PURE__ */
|
|
685
|
+
children: /* @__PURE__ */ J(me, { fallback: /* @__PURE__ */ J("span", {
|
|
686
686
|
ref: (t) => {
|
|
687
|
-
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg",
|
|
687
|
+
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg", Tt(e.color));
|
|
688
688
|
},
|
|
689
689
|
className: "grid size-full place-items-center rounded-full bg-[var(--nxgt-collab-color)] text-[var(--nxgt-collab-fg)]",
|
|
690
|
-
children:
|
|
690
|
+
children: wt(e.name)
|
|
691
691
|
}) })
|
|
692
692
|
});
|
|
693
693
|
}
|
|
@@ -695,22 +695,22 @@ function mr({ status: e, max: n = 4, className: r }) {
|
|
|
695
695
|
let { t: i } = M(), a = ur();
|
|
696
696
|
if (!e && a.length === 0) return null;
|
|
697
697
|
let [o, s, c] = e ? fr[e] : [];
|
|
698
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ Y("div", {
|
|
699
699
|
"data-slot": "editor-presence",
|
|
700
700
|
"data-status": e,
|
|
701
701
|
className: t("flex items-center gap-3", r),
|
|
702
|
-
children: [s && o && /* @__PURE__ */
|
|
702
|
+
children: [s && o && /* @__PURE__ */ J(Ne, {
|
|
703
703
|
tone: o,
|
|
704
704
|
pulse: e === "connecting",
|
|
705
705
|
role: "status",
|
|
706
706
|
className: "text-muted-foreground text-xs",
|
|
707
707
|
children: i(s, c)
|
|
708
|
-
}), a.length > 0 && /* @__PURE__ */
|
|
708
|
+
}), a.length > 0 && /* @__PURE__ */ J(Ce, {
|
|
709
709
|
size: "sm",
|
|
710
710
|
max: n,
|
|
711
711
|
role: "group",
|
|
712
712
|
"aria-label": i("material.editor.collab.people", "{count, plural, one {# person editing} other {# people editing}}", { count: a.length }),
|
|
713
|
-
children: a.map((e) => /* @__PURE__ */
|
|
713
|
+
children: a.map((e) => /* @__PURE__ */ J(pr, { user: e }, e.clientId))
|
|
714
714
|
})]
|
|
715
715
|
});
|
|
716
716
|
}
|
|
@@ -721,7 +721,7 @@ var hr = "[&_textarea]:min-w-0", gr = (e) => e.key === "Enter" && (e.metaKey ||
|
|
|
721
721
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer-form.tsx
|
|
722
722
|
function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
723
723
|
let { t: a } = M(), o = e.error === "invalid-id" ? a("material.editor.comments.invalid-id", "The adapter answered a thread id that is not allowed.") : e.error;
|
|
724
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ Y("form", {
|
|
725
725
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2.5",
|
|
726
726
|
onSubmit: (e) => {
|
|
727
727
|
e.preventDefault(), r();
|
|
@@ -730,11 +730,11 @@ function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
730
730
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), i());
|
|
731
731
|
},
|
|
732
732
|
children: [
|
|
733
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ J("blockquote", {
|
|
734
734
|
className: "line-clamp-2 border-s-2 ps-2 text-muted-foreground text-xs italic",
|
|
735
735
|
children: e.quote
|
|
736
736
|
}),
|
|
737
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ J(ae, {
|
|
738
738
|
className: hr,
|
|
739
739
|
"aria-label": a("material.editor.comments.body-label", "Comment"),
|
|
740
740
|
placeholder: a("material.editor.comments.placeholder", "Write a comment…"),
|
|
@@ -747,12 +747,12 @@ function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
747
747
|
gr(e) && (e.preventDefault(), r());
|
|
748
748
|
}
|
|
749
749
|
}),
|
|
750
|
-
o && /* @__PURE__ */
|
|
750
|
+
o && /* @__PURE__ */ J("p", {
|
|
751
751
|
role: "alert",
|
|
752
752
|
className: "text-error text-xs",
|
|
753
753
|
children: a("material.editor.comments.failed", "Not saved: {message}", { message: o })
|
|
754
754
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ J(vr, {
|
|
756
756
|
pending: e.pending,
|
|
757
757
|
empty: !t.trim(),
|
|
758
758
|
onDismiss: i
|
|
@@ -762,16 +762,16 @@ function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
762
762
|
}
|
|
763
763
|
function vr({ pending: e, empty: t, onDismiss: n }) {
|
|
764
764
|
let { t: r } = M();
|
|
765
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ Y("div", {
|
|
766
766
|
className: "flex justify-end gap-2",
|
|
767
|
-
children: [/* @__PURE__ */
|
|
767
|
+
children: [/* @__PURE__ */ J(j, {
|
|
768
768
|
type: "button",
|
|
769
769
|
size: "sm",
|
|
770
770
|
variant: Ye,
|
|
771
771
|
disabled: e,
|
|
772
772
|
onClick: n,
|
|
773
773
|
children: r("material.editor.comments.cancel", "Cancel")
|
|
774
|
-
}), /* @__PURE__ */
|
|
774
|
+
}), /* @__PURE__ */ J(j, {
|
|
775
775
|
type: "submit",
|
|
776
776
|
size: "sm",
|
|
777
777
|
loading: e,
|
|
@@ -798,7 +798,7 @@ var yr = (e = !1) => ({
|
|
|
798
798
|
}, br = () => () => {}, xr = yr(), Sr = (e) => e ? X(e)?.controller : void 0;
|
|
799
799
|
function Cr(e) {
|
|
800
800
|
let t = Sr(e);
|
|
801
|
-
return
|
|
801
|
+
return At(t?.subscribe ?? br, t?.getState ?? (() => xr), () => xr);
|
|
802
802
|
}
|
|
803
803
|
//#endregion
|
|
804
804
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-live.tsx
|
|
@@ -811,33 +811,33 @@ var wr = {
|
|
|
811
811
|
};
|
|
812
812
|
function Tr({ editor: e }) {
|
|
813
813
|
let { t } = M(), { notice: n } = Cr(e), r = n ? wr[n.kind] : null;
|
|
814
|
-
return /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ J("div", {
|
|
815
815
|
role: "status",
|
|
816
816
|
"aria-live": "polite",
|
|
817
817
|
"data-slot": "editor-comments-status",
|
|
818
818
|
className: "sr-only",
|
|
819
|
-
children: n && r ? /* @__PURE__ */
|
|
819
|
+
children: n && r ? /* @__PURE__ */ J("span", { children: t(`material.editor.comments.${r[0]}`, r[1]) }, n.seq) : null
|
|
820
820
|
});
|
|
821
821
|
}
|
|
822
822
|
//#endregion
|
|
823
823
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer.tsx
|
|
824
824
|
function Er(e) {
|
|
825
825
|
let { handle: t } = O(), { editor: n } = t;
|
|
826
|
-
return !n || !X(n) ? null : /* @__PURE__ */
|
|
826
|
+
return !n || !X(n) ? null : /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Dr, { editor: n }), /* @__PURE__ */ J(Tr, { editor: n })] });
|
|
827
827
|
}
|
|
828
828
|
function Dr({ editor: e }) {
|
|
829
829
|
let t = X(e)?.controller;
|
|
830
|
-
return Cr(e).composer === null ? null : /* @__PURE__ */
|
|
830
|
+
return Cr(e).composer === null ? null : /* @__PURE__ */ J(Or, {
|
|
831
831
|
editor: e,
|
|
832
832
|
controller: t
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
835
|
function Or({ editor: e, controller: t }) {
|
|
836
836
|
let { t: n } = M(), { chrome: r } = O(), i = Cr(e).composer, { actions: a } = r;
|
|
837
|
-
|
|
837
|
+
U(() => (a.setBubbleSuppressed(!0), () => {
|
|
838
838
|
a.setBubbleSuppressed(!1);
|
|
839
839
|
}), [a]);
|
|
840
|
-
let [o, s] =
|
|
840
|
+
let [o, s] = K(""), c = W(() => ({ getState: () => ({ range: t.getState().composer?.range ?? {
|
|
841
841
|
from: 0,
|
|
842
842
|
to: 0
|
|
843
843
|
} }) }), [t]);
|
|
@@ -845,14 +845,14 @@ function Or({ editor: e, controller: t }) {
|
|
|
845
845
|
let l = (n) => {
|
|
846
846
|
t.closeComposer(), n && e.commands.focus();
|
|
847
847
|
};
|
|
848
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ J(Rn, {
|
|
849
849
|
editor: e,
|
|
850
850
|
controller: c,
|
|
851
851
|
label: n("material.editor.comments.composer", "New comment"),
|
|
852
852
|
slot: "editor-comment-composer",
|
|
853
853
|
locked: i.pending,
|
|
854
854
|
onDismiss: (e) => l(e !== "outside"),
|
|
855
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ J(_r, {
|
|
856
856
|
composer: i,
|
|
857
857
|
body: o,
|
|
858
858
|
onBody: s,
|
|
@@ -868,14 +868,14 @@ function kr(e, t) {
|
|
|
868
868
|
return !n || !(t instanceof Element) ? !1 : n.contains(t) ? !0 : n.getAttribute("aria-expanded") === "true" && !!t.closest("[role=\"menu\"]");
|
|
869
869
|
}
|
|
870
870
|
function Ar({ id: e, children: t, ...n }) {
|
|
871
|
-
let { chrome: r, toolbarRef: i } = O(), a = r.state.panel === e, [o, s] =
|
|
872
|
-
return
|
|
871
|
+
let { chrome: r, toolbarRef: i } = O(), a = r.state.panel === e, [o, s] = K();
|
|
872
|
+
return kt(() => {
|
|
873
873
|
let e = i.current, t = e?.getAttribute("aria-orientation") === "vertical" ? getComputedStyle(e).direction === "rtl" ? "left" : "right" : void 0;
|
|
874
874
|
t !== o && s(t);
|
|
875
|
-
}), /* @__PURE__ */
|
|
875
|
+
}), /* @__PURE__ */ Y(qe, {
|
|
876
876
|
open: a,
|
|
877
877
|
onOpenChange: (t) => t ? r.actions.openPanel(e) : r.actions.closePanel(),
|
|
878
|
-
children: [/* @__PURE__ */
|
|
878
|
+
children: [/* @__PURE__ */ J(Je, { virtualRef: i }), /* @__PURE__ */ J(Ke, {
|
|
879
879
|
"data-panel": e,
|
|
880
880
|
side: o,
|
|
881
881
|
align: "start",
|
|
@@ -897,7 +897,7 @@ function Ar({ id: e, children: t, ...n }) {
|
|
|
897
897
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-status.tsx
|
|
898
898
|
function jr({ state: e, controller: t, count: n }) {
|
|
899
899
|
let { t: r } = M();
|
|
900
|
-
return n === 0 && !e.showResolved ? null : /* @__PURE__ */
|
|
900
|
+
return n === 0 && !e.showResolved ? null : /* @__PURE__ */ J(x, {
|
|
901
901
|
label: r("material.editor.comments.show-resolved", "Show resolved"),
|
|
902
902
|
checked: e.showResolved,
|
|
903
903
|
onCheckedChange: t.setShowResolved
|
|
@@ -905,7 +905,7 @@ function jr({ state: e, controller: t, count: n }) {
|
|
|
905
905
|
}
|
|
906
906
|
function Mr({ state: e, empty: t }) {
|
|
907
907
|
let { t: n } = M(), r = null;
|
|
908
|
-
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__ */
|
|
908
|
+
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__ */ J("p", {
|
|
909
909
|
role: e.phase === "failed" ? "alert" : void 0,
|
|
910
910
|
className: "px-1 text-muted-foreground text-sm",
|
|
911
911
|
children: r
|
|
@@ -915,9 +915,9 @@ function Mr({ state: e, empty: t }) {
|
|
|
915
915
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-edit-form.tsx
|
|
916
916
|
function Nr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
917
917
|
let { t: i } = M();
|
|
918
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ Y("div", {
|
|
919
919
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2",
|
|
920
|
-
children: [/* @__PURE__ */
|
|
920
|
+
children: [/* @__PURE__ */ J(ae, {
|
|
921
921
|
className: hr,
|
|
922
922
|
"aria-label": i("material.editor.comments.body-label", "Comment"),
|
|
923
923
|
value: e,
|
|
@@ -927,14 +927,14 @@ function Nr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
|
927
927
|
onKeyDown: (e) => {
|
|
928
928
|
e.key === "Escape" ? (e.stopPropagation(), r()) : gr(e) && (e.preventDefault(), n());
|
|
929
929
|
}
|
|
930
|
-
}), /* @__PURE__ */
|
|
930
|
+
}), /* @__PURE__ */ Y("div", {
|
|
931
931
|
className: "flex gap-2",
|
|
932
|
-
children: [/* @__PURE__ */
|
|
932
|
+
children: [/* @__PURE__ */ J(j, {
|
|
933
933
|
size: "sm",
|
|
934
934
|
disabled: !e.trim(),
|
|
935
935
|
onClick: n,
|
|
936
936
|
children: i("material.editor.comments.save", "Save")
|
|
937
|
-
}), /* @__PURE__ */
|
|
937
|
+
}), /* @__PURE__ */ J(j, {
|
|
938
938
|
size: "sm",
|
|
939
939
|
variant: Ye,
|
|
940
940
|
onClick: r,
|
|
@@ -977,7 +977,7 @@ var Pr = "pending:", Fr = (e) => e.id.startsWith(Pr), Ir = (e, t, n) => e.map((e
|
|
|
977
977
|
if (!Wr(e) || !Wr(e.author)) return null;
|
|
978
978
|
let { id: t, body: n, author: r } = e;
|
|
979
979
|
return typeof t != "string" || !t || typeof n != "string" || typeof r.name != "string" ? null : e;
|
|
980
|
-
}, Kr = (e) => !Wr(e) || !
|
|
980
|
+
}, Kr = (e) => !Wr(e) || !St(e.id) || !Array.isArray(e.comments) ? null : {
|
|
981
981
|
...e,
|
|
982
982
|
quote: typeof e.quote == "string" ? e.quote : "",
|
|
983
983
|
resolved: e.resolved === !0,
|
|
@@ -1008,25 +1008,25 @@ function Yr(e, t, n) {
|
|
|
1008
1008
|
var Xr = (e) => e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase()).join("");
|
|
1009
1009
|
function Zr({ comment: e, pending: t, onEdit: n }) {
|
|
1010
1010
|
let { t: r, language: i } = M();
|
|
1011
|
-
return /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ Y("div", {
|
|
1012
1012
|
className: "flex items-center gap-2",
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
src:
|
|
1014
|
+
/* @__PURE__ */ J(me, {
|
|
1015
|
+
src: pt(e.author.avatarUrl),
|
|
1016
1016
|
alt: "",
|
|
1017
1017
|
fallback: Xr(e.author.name),
|
|
1018
1018
|
className: "size-6 text-[0.625rem]"
|
|
1019
1019
|
}),
|
|
1020
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ J("b", {
|
|
1021
1021
|
className: "min-w-0 truncate font-semibold text-sm",
|
|
1022
1022
|
children: e.author.name
|
|
1023
1023
|
}),
|
|
1024
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ J("time", {
|
|
1025
1025
|
dateTime: e.createdAt,
|
|
1026
1026
|
className: "shrink-0 text-muted-foreground text-xs",
|
|
1027
1027
|
children: t ? r("material.editor.comments.sending", "Sending…") : Yr(e.createdAt, Date.now(), i)
|
|
1028
1028
|
}),
|
|
1029
|
-
n && !t && /* @__PURE__ */
|
|
1029
|
+
n && !t && /* @__PURE__ */ J(j, {
|
|
1030
1030
|
variant: "ghost",
|
|
1031
1031
|
size: "xs",
|
|
1032
1032
|
className: "ms-auto",
|
|
@@ -1037,22 +1037,22 @@ function Zr({ comment: e, pending: t, onEdit: n }) {
|
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
1039
|
function Qr({ comment: e, editable: n, onEdit: r }) {
|
|
1040
|
-
let [i, a] =
|
|
1040
|
+
let [i, a] = K(null), o = Fr(e), s = async () => {
|
|
1041
1041
|
let t = i;
|
|
1042
1042
|
a(null), t !== null && t.trim() !== e.body && await r(t);
|
|
1043
1043
|
};
|
|
1044
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ Y("li", {
|
|
1045
1045
|
"data-slot": "comment-entry",
|
|
1046
1046
|
"aria-busy": o || void 0,
|
|
1047
1047
|
className: t("grid grid-cols-[minmax(0,1fr)] gap-1.5", o && "opacity-60"),
|
|
1048
|
-
children: [/* @__PURE__ */
|
|
1048
|
+
children: [/* @__PURE__ */ J(Zr, {
|
|
1049
1049
|
comment: e,
|
|
1050
1050
|
pending: o,
|
|
1051
1051
|
onEdit: n && i === null ? () => a(e.body) : void 0
|
|
1052
|
-
}), i === null ? /* @__PURE__ */
|
|
1052
|
+
}), i === null ? /* @__PURE__ */ J("p", {
|
|
1053
1053
|
className: "whitespace-pre-wrap break-words text-sm leading-relaxed",
|
|
1054
1054
|
children: e.body
|
|
1055
|
-
}) : /* @__PURE__ */
|
|
1055
|
+
}) : /* @__PURE__ */ J(Nr, {
|
|
1056
1056
|
draft: i,
|
|
1057
1057
|
onChange: a,
|
|
1058
1058
|
onSave: () => void s(),
|
|
@@ -1063,11 +1063,11 @@ function Qr({ comment: e, editable: n, onEdit: r }) {
|
|
|
1063
1063
|
//#endregion
|
|
1064
1064
|
//#region lib/components/ui/widgets/editor/extensions/comments/thread-reply.tsx
|
|
1065
1065
|
function $r({ thread: e, controller: t, canRemove: n }) {
|
|
1066
|
-
let { t: r } = M(), [i, a] =
|
|
1066
|
+
let { t: r } = M(), [i, a] = K(""), o = async () => {
|
|
1067
1067
|
let n = i;
|
|
1068
1068
|
n.trim() && (a(""), await t.reply(e.id, n) || a(n));
|
|
1069
1069
|
};
|
|
1070
|
-
return /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(ae, {
|
|
1071
1071
|
className: hr,
|
|
1072
1072
|
"aria-label": r("material.editor.comments.reply-label", "Reply to this thread"),
|
|
1073
1073
|
placeholder: r("material.editor.comments.reply-placeholder", "Reply…"),
|
|
@@ -1077,10 +1077,10 @@ function $r({ thread: e, controller: t, canRemove: n }) {
|
|
|
1077
1077
|
onKeyDown: (e) => {
|
|
1078
1078
|
gr(e) && (e.preventDefault(), o());
|
|
1079
1079
|
}
|
|
1080
|
-
}), /* @__PURE__ */
|
|
1080
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1081
1081
|
className: "flex flex-wrap gap-2",
|
|
1082
1082
|
children: [
|
|
1083
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ J(j, {
|
|
1084
1084
|
size: "sm",
|
|
1085
1085
|
variant: "outlined",
|
|
1086
1086
|
color: "default",
|
|
@@ -1088,13 +1088,13 @@ function $r({ thread: e, controller: t, canRemove: n }) {
|
|
|
1088
1088
|
onClick: () => void o(),
|
|
1089
1089
|
children: r("material.editor.comments.reply", "Reply")
|
|
1090
1090
|
}),
|
|
1091
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ J(j, {
|
|
1092
1092
|
size: "sm",
|
|
1093
1093
|
variant: "tonal",
|
|
1094
1094
|
onClick: () => void t.resolve(e.id, !e.resolved),
|
|
1095
1095
|
children: e.resolved ? r("material.editor.comments.reopen", "Reopen") : r("material.editor.comments.resolve", "Resolve")
|
|
1096
1096
|
}),
|
|
1097
|
-
n && /* @__PURE__ */
|
|
1097
|
+
n && /* @__PURE__ */ J(j, {
|
|
1098
1098
|
size: "sm",
|
|
1099
1099
|
variant: "ghost",
|
|
1100
1100
|
color: "error",
|
|
@@ -1109,7 +1109,7 @@ function $r({ thread: e, controller: t, canRemove: n }) {
|
|
|
1109
1109
|
//#region lib/components/ui/widgets/editor/extensions/comments/thread-card.tsx
|
|
1110
1110
|
function ei(e) {
|
|
1111
1111
|
let { thread: n, controller: r, active: i, detached: a, error: o, user: s } = e, { t: c } = M(), l = n.comments[0]?.author.id === s?.id && !!s;
|
|
1112
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ Y("section", {
|
|
1113
1113
|
ref: e.cardRef,
|
|
1114
1114
|
"data-slot": "comment-thread",
|
|
1115
1115
|
"data-thread": n.id,
|
|
@@ -1121,27 +1121,27 @@ function ei(e) {
|
|
|
1121
1121
|
onPointerDownCapture: () => r.setActive(n.id),
|
|
1122
1122
|
className: t("grid grid-cols-[minmax(0,1fr)] gap-2.5 rounded-2xl border bg-card p-3 text-card-foreground text-sm shadow-xs transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast motion-reduce:transition-none", "data-[active]:bg-primary/5 data-[active]:shadow-[inset_3px_0_0_0_var(--primary-indicator)]", "data-[resolved]:opacity-80", e.className),
|
|
1123
1123
|
children: [
|
|
1124
|
-
/* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ Y("blockquote", {
|
|
1125
1125
|
className: "line-clamp-2 border-s-2 ps-2 text-muted-foreground text-xs italic",
|
|
1126
|
-
children: [a && /* @__PURE__ */
|
|
1126
|
+
children: [a && /* @__PURE__ */ Y("span", {
|
|
1127
1127
|
className: "not-italic font-medium",
|
|
1128
1128
|
children: [c("material.editor.comments.detached-hint", "The commented text was removed."), " "]
|
|
1129
1129
|
}), n.quote]
|
|
1130
1130
|
}),
|
|
1131
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ J("ul", {
|
|
1132
1132
|
className: "grid grid-cols-[minmax(0,1fr)] gap-3",
|
|
1133
|
-
children: n.comments.map((t) => /* @__PURE__ */
|
|
1133
|
+
children: n.comments.map((t) => /* @__PURE__ */ J(Qr, {
|
|
1134
1134
|
comment: t,
|
|
1135
1135
|
editable: e.canEdit && t.author.id === s?.id,
|
|
1136
1136
|
onEdit: (e) => r.edit(n.id, t.id, e)
|
|
1137
1137
|
}, t.id))
|
|
1138
1138
|
}),
|
|
1139
|
-
o && /* @__PURE__ */
|
|
1139
|
+
o && /* @__PURE__ */ J("p", {
|
|
1140
1140
|
role: "alert",
|
|
1141
1141
|
className: "text-error text-xs",
|
|
1142
1142
|
children: c("material.editor.comments.failed", "Not saved: {message}", { message: o })
|
|
1143
1143
|
}),
|
|
1144
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ J($r, {
|
|
1145
1145
|
thread: n,
|
|
1146
1146
|
controller: r,
|
|
1147
1147
|
canRemove: e.canRemove && l
|
|
@@ -1153,13 +1153,13 @@ function ei(e) {
|
|
|
1153
1153
|
//#region lib/components/ui/widgets/editor/extensions/comments/detached-threads.tsx
|
|
1154
1154
|
function ti({ views: e }) {
|
|
1155
1155
|
let { t } = M(), { controller: n, state: r, detached: i } = e;
|
|
1156
|
-
return !n || i.length === 0 ? null : /* @__PURE__ */
|
|
1156
|
+
return !n || i.length === 0 ? null : /* @__PURE__ */ Y("section", {
|
|
1157
1157
|
"data-slot": "comment-detached",
|
|
1158
1158
|
className: "grid gap-2",
|
|
1159
|
-
children: [/* @__PURE__ */
|
|
1159
|
+
children: [/* @__PURE__ */ J("h3", {
|
|
1160
1160
|
className: "px-1 font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1161
1161
|
children: t("material.editor.comments.detached", "Detached")
|
|
1162
|
-
}), i.map((t) => /* @__PURE__ */
|
|
1162
|
+
}), i.map((t) => /* @__PURE__ */ J(ei, {
|
|
1163
1163
|
...ni(e, t),
|
|
1164
1164
|
detached: !0,
|
|
1165
1165
|
active: r.activeId === t.id
|
|
@@ -1328,7 +1328,7 @@ var gi = class {
|
|
|
1328
1328
|
current;
|
|
1329
1329
|
core;
|
|
1330
1330
|
constructor(e, t = !1) {
|
|
1331
|
-
this.host = e, this.store =
|
|
1331
|
+
this.host = e, this.store = dt(yr(t)), this.core = {
|
|
1332
1332
|
host: e,
|
|
1333
1333
|
get: () => this.state,
|
|
1334
1334
|
set: (e) => this.set(e),
|
|
@@ -1447,7 +1447,7 @@ var gi = class {
|
|
|
1447
1447
|
//#endregion
|
|
1448
1448
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-thread-views.ts
|
|
1449
1449
|
function _i(e) {
|
|
1450
|
-
let t = Cr(e), n = X(e), r = mi(t), { anchors: i } = t, a =
|
|
1450
|
+
let t = Cr(e), n = X(e), r = mi(t), { anchors: i } = t, a = W(() => {
|
|
1451
1451
|
let e = new Map(r.map((e) => [e.id, e]));
|
|
1452
1452
|
return {
|
|
1453
1453
|
anchored: ai(i).flatMap((t) => e.get(t) ?? []),
|
|
@@ -1468,53 +1468,53 @@ function _i(e) {
|
|
|
1468
1468
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-panel.tsx
|
|
1469
1469
|
function vi(e) {
|
|
1470
1470
|
let { handle: t, chrome: n } = O(), { editor: r } = t;
|
|
1471
|
-
return !r || !X(r) ? null : /* @__PURE__ */
|
|
1471
|
+
return !r || !X(r) ? null : /* @__PURE__ */ J(Ar, {
|
|
1472
1472
|
id: "comments",
|
|
1473
1473
|
className: "max-h-[min(36rem,80svh)] w-96 max-w-[92vw] overflow-y-auto p-3",
|
|
1474
1474
|
onEscapeKeyDown: () => r.commands.focus(),
|
|
1475
|
-
children: n.state.panel === "comments" && /* @__PURE__ */
|
|
1475
|
+
children: n.state.panel === "comments" && /* @__PURE__ */ J(yi, { editor: r })
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
1478
|
function yi({ editor: e }) {
|
|
1479
|
-
let { t } = M(), n = _i(e), { controller: r, state: i, anchored: a } = n, o =
|
|
1480
|
-
if (
|
|
1479
|
+
let { t } = M(), n = _i(e), { controller: r, state: i, anchored: a } = n, o = G(null);
|
|
1480
|
+
if (U(() => {
|
|
1481
1481
|
o.current?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" });
|
|
1482
1482
|
}, [i.activeId]), !r) return null;
|
|
1483
|
-
let s = (e, t) => /* @__PURE__ */
|
|
1483
|
+
let s = (e, t) => /* @__PURE__ */ J(N, {
|
|
1484
1484
|
variant: "ghost",
|
|
1485
1485
|
"aria-label": t,
|
|
1486
1486
|
tooltip: t,
|
|
1487
1487
|
onClick: () => r.step(e),
|
|
1488
|
-
children:
|
|
1488
|
+
children: J(e > 0 ? Lt : Bt, {})
|
|
1489
1489
|
});
|
|
1490
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ Y("div", {
|
|
1491
1491
|
ref: o,
|
|
1492
1492
|
className: "grid gap-3",
|
|
1493
1493
|
children: [
|
|
1494
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ Y("div", {
|
|
1495
1495
|
className: "flex items-center justify-between gap-2",
|
|
1496
|
-
children: [/* @__PURE__ */
|
|
1496
|
+
children: [/* @__PURE__ */ J("h2", {
|
|
1497
1497
|
className: "font-medium text-sm",
|
|
1498
1498
|
children: t("material.editor.comments.title", "Comments")
|
|
1499
|
-
}), /* @__PURE__ */
|
|
1499
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1500
1500
|
className: "flex",
|
|
1501
1501
|
children: [s(-1, t("material.editor.comments.previous", "Previous comment")), s(1, t("material.editor.comments.next", "Next comment"))]
|
|
1502
1502
|
})]
|
|
1503
1503
|
}),
|
|
1504
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ J(jr, {
|
|
1505
1505
|
state: i,
|
|
1506
1506
|
controller: r,
|
|
1507
1507
|
count: n.resolvedCount
|
|
1508
1508
|
}),
|
|
1509
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ J(Mr, {
|
|
1510
1510
|
state: i,
|
|
1511
1511
|
empty: i.threads.length === 0
|
|
1512
1512
|
}),
|
|
1513
|
-
a.map((e) => /* @__PURE__ */
|
|
1513
|
+
a.map((e) => /* @__PURE__ */ J(ei, {
|
|
1514
1514
|
...ni(n, e),
|
|
1515
1515
|
active: i.activeId === e.id
|
|
1516
1516
|
}, e.id)),
|
|
1517
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ J(ti, { views: n })
|
|
1518
1518
|
]
|
|
1519
1519
|
});
|
|
1520
1520
|
}
|
|
@@ -1562,8 +1562,8 @@ function wi(e) {
|
|
|
1562
1562
|
//#endregion
|
|
1563
1563
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-rail-observer.ts
|
|
1564
1564
|
function Ti(e, t, n) {
|
|
1565
|
-
let r =
|
|
1566
|
-
return
|
|
1565
|
+
let r = G(null);
|
|
1566
|
+
return U(() => {
|
|
1567
1567
|
if (typeof ResizeObserver > "u") return;
|
|
1568
1568
|
let i = new ResizeObserver(n);
|
|
1569
1569
|
r.current = i, i.observe(e.view.dom);
|
|
@@ -1583,11 +1583,11 @@ function Ti(e, t, n) {
|
|
|
1583
1583
|
//#endregion
|
|
1584
1584
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-rail-layout.ts
|
|
1585
1585
|
function Ei(e, t, n, r) {
|
|
1586
|
-
let i =
|
|
1586
|
+
let i = G(/* @__PURE__ */ new Map()), a = G(/* @__PURE__ */ new Map()), o = G(0), [s, c] = K({
|
|
1587
1587
|
tops: {},
|
|
1588
1588
|
height: 0,
|
|
1589
1589
|
measured: !1
|
|
1590
|
-
}), l =
|
|
1590
|
+
}), l = G({
|
|
1591
1591
|
items: n,
|
|
1592
1592
|
activeId: r
|
|
1593
1593
|
});
|
|
@@ -1595,7 +1595,7 @@ function Ei(e, t, n, r) {
|
|
|
1595
1595
|
items: n,
|
|
1596
1596
|
activeId: r
|
|
1597
1597
|
};
|
|
1598
|
-
let u = n.map((e) => e.id).join(","), d = n.map((e) => e.from).join(","), f =
|
|
1598
|
+
let u = n.map((e) => e.id).join(","), d = n.map((e) => e.from).join(","), f = H(() => {
|
|
1599
1599
|
let { items: n, activeId: r } = l.current, a = wi({
|
|
1600
1600
|
editor: e,
|
|
1601
1601
|
box: t.current,
|
|
@@ -1604,18 +1604,18 @@ function Ei(e, t, n, r) {
|
|
|
1604
1604
|
activeId: r
|
|
1605
1605
|
});
|
|
1606
1606
|
a && c((e) => Ci(e, a) ? e : a);
|
|
1607
|
-
}, [t, e]), p =
|
|
1607
|
+
}, [t, e]), p = H(() => {
|
|
1608
1608
|
o.current ||= requestAnimationFrame(() => {
|
|
1609
1609
|
o.current = 0, f();
|
|
1610
1610
|
});
|
|
1611
1611
|
}, [f]);
|
|
1612
|
-
|
|
1612
|
+
kt(f, [
|
|
1613
1613
|
u,
|
|
1614
1614
|
r,
|
|
1615
1615
|
f
|
|
1616
|
-
]),
|
|
1616
|
+
]), U(p, [d, p]);
|
|
1617
1617
|
let { observe: m, unobserve: h } = Ti(e, i, p);
|
|
1618
|
-
return
|
|
1618
|
+
return U(() => () => {
|
|
1619
1619
|
cancelAnimationFrame(o.current), o.current = 0;
|
|
1620
1620
|
}, []), {
|
|
1621
1621
|
layout: s,
|
|
@@ -1632,32 +1632,32 @@ function Ei(e, t, n, r) {
|
|
|
1632
1632
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-rail.tsx
|
|
1633
1633
|
function Di(e) {
|
|
1634
1634
|
let { handle: t } = O(), { editor: n } = t;
|
|
1635
|
-
return !n || !X(n) ? null : /* @__PURE__ */
|
|
1635
|
+
return !n || !X(n) ? null : /* @__PURE__ */ J(Oi, { editor: n });
|
|
1636
1636
|
}
|
|
1637
1637
|
function Oi({ editor: e }) {
|
|
1638
|
-
let { t } = M(), n = _i(e), { controller: r, state: i, anchored: a } = n, o =
|
|
1638
|
+
let { t } = M(), n = _i(e), { controller: r, state: i, anchored: a } = n, o = G(null), { layout: s, cardRef: c } = Ei(e, o, a.map((e) => ({
|
|
1639
1639
|
id: e.id,
|
|
1640
1640
|
from: i.anchors[e.id]?.from ?? 0
|
|
1641
1641
|
})), i.activeId);
|
|
1642
|
-
return
|
|
1642
|
+
return U(() => (r?.setRail(!0), () => r?.setRail(!1)), [r]), r ? /* @__PURE__ */ Y("section", {
|
|
1643
1643
|
"data-slot": "editor-comments-rail",
|
|
1644
1644
|
"aria-label": t("material.editor.comments.threads", "Comment threads"),
|
|
1645
1645
|
className: "grid gap-3",
|
|
1646
1646
|
children: [
|
|
1647
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ J(jr, {
|
|
1648
1648
|
state: i,
|
|
1649
1649
|
controller: r,
|
|
1650
1650
|
count: n.resolvedCount
|
|
1651
1651
|
}),
|
|
1652
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ J(Mr, {
|
|
1653
1653
|
state: i,
|
|
1654
1654
|
empty: i.threads.length === 0
|
|
1655
1655
|
}),
|
|
1656
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ J("div", {
|
|
1657
1657
|
ref: o,
|
|
1658
1658
|
className: "relative",
|
|
1659
1659
|
style: { height: s.height },
|
|
1660
|
-
children: a.map((e) => /* @__PURE__ */
|
|
1660
|
+
children: a.map((e) => /* @__PURE__ */ J(ei, {
|
|
1661
1661
|
...ni(n, e),
|
|
1662
1662
|
active: i.activeId === e.id,
|
|
1663
1663
|
cardRef: c(e.id),
|
|
@@ -1668,7 +1668,7 @@ function Oi({ editor: e }) {
|
|
|
1668
1668
|
}
|
|
1669
1669
|
}, e.id))
|
|
1670
1670
|
}),
|
|
1671
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ J(ti, { views: n })
|
|
1672
1672
|
]
|
|
1673
1673
|
}) : null;
|
|
1674
1674
|
}
|
|
@@ -1687,7 +1687,7 @@ function ki(e, t) {
|
|
|
1687
1687
|
//#endregion
|
|
1688
1688
|
//#region lib/components/ui/widgets/editor/extensions/block/block-drag.ts
|
|
1689
1689
|
function Ai(e, t, n) {
|
|
1690
|
-
let { view: r } = e, i =
|
|
1690
|
+
let { view: r } = e, i = lt.create(r.state.doc, t.pos);
|
|
1691
1691
|
r.dispatch(r.state.tr.setSelection(i)), r.dragging = {
|
|
1692
1692
|
slice: i.content(),
|
|
1693
1693
|
move: !0
|
|
@@ -1705,7 +1705,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1705
1705
|
id: "paragraph",
|
|
1706
1706
|
label: "Paragraph",
|
|
1707
1707
|
key: "material.editor.block.paragraph",
|
|
1708
|
-
icon:
|
|
1708
|
+
icon: an,
|
|
1709
1709
|
node: "paragraph",
|
|
1710
1710
|
run: (e) => e.chain().focus().setParagraph().run()
|
|
1711
1711
|
},
|
|
@@ -1713,7 +1713,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1713
1713
|
id: "h1",
|
|
1714
1714
|
label: "Heading 1",
|
|
1715
1715
|
key: "material.editor.block.heading-1",
|
|
1716
|
-
icon:
|
|
1716
|
+
icon: qt,
|
|
1717
1717
|
node: "heading",
|
|
1718
1718
|
run: ji(1)
|
|
1719
1719
|
},
|
|
@@ -1721,7 +1721,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1721
1721
|
id: "h2",
|
|
1722
1722
|
label: "Heading 2",
|
|
1723
1723
|
key: "material.editor.block.heading-2",
|
|
1724
|
-
icon:
|
|
1724
|
+
icon: Jt,
|
|
1725
1725
|
node: "heading",
|
|
1726
1726
|
run: ji(2)
|
|
1727
1727
|
},
|
|
@@ -1729,7 +1729,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1729
1729
|
id: "h3",
|
|
1730
1730
|
label: "Heading 3",
|
|
1731
1731
|
key: "material.editor.block.heading-3",
|
|
1732
|
-
icon:
|
|
1732
|
+
icon: Yt,
|
|
1733
1733
|
node: "heading",
|
|
1734
1734
|
run: ji(3)
|
|
1735
1735
|
},
|
|
@@ -1737,7 +1737,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1737
1737
|
id: "bullet",
|
|
1738
1738
|
label: "Bulleted list",
|
|
1739
1739
|
key: "material.editor.block.bullet-list",
|
|
1740
|
-
icon:
|
|
1740
|
+
icon: Zt,
|
|
1741
1741
|
node: "bulletList",
|
|
1742
1742
|
run: (e) => e.chain().focus().toggleBulletList().run()
|
|
1743
1743
|
},
|
|
@@ -1745,7 +1745,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1745
1745
|
id: "ordered",
|
|
1746
1746
|
label: "Numbered list",
|
|
1747
1747
|
key: "material.editor.block.ordered-list",
|
|
1748
|
-
icon:
|
|
1748
|
+
icon: Qt,
|
|
1749
1749
|
node: "orderedList",
|
|
1750
1750
|
run: (e) => e.chain().focus().toggleOrderedList().run()
|
|
1751
1751
|
},
|
|
@@ -1753,7 +1753,7 @@ var ji = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), Mi = [
|
|
|
1753
1753
|
id: "quote",
|
|
1754
1754
|
label: "Quote",
|
|
1755
1755
|
key: "material.editor.block.quote",
|
|
1756
|
-
icon:
|
|
1756
|
+
icon: sn,
|
|
1757
1757
|
node: "blockquote",
|
|
1758
1758
|
run: (e) => e.chain().focus().toggleBlockquote().run()
|
|
1759
1759
|
}
|
|
@@ -1779,7 +1779,7 @@ function Pi(e, t) {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
var Fi = (e) => Pi(e.doc, e.selection.head);
|
|
1781
1781
|
function Ii(e, t) {
|
|
1782
|
-
let n = t.node.isAtom ?
|
|
1782
|
+
let n = t.node.isAtom ? lt.create(e.doc, t.pos) : z.near(e.doc.resolve(t.pos + 1));
|
|
1783
1783
|
return e.setSelection(n);
|
|
1784
1784
|
}
|
|
1785
1785
|
function Li(e, t, n = Fi(e)) {
|
|
@@ -1789,7 +1789,7 @@ function Li(e, t, n = Fi(e)) {
|
|
|
1789
1789
|
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];
|
|
1790
1790
|
i.replaceWith(s, c, l);
|
|
1791
1791
|
let u = t === 1 ? r.nodeSize : -r.nodeSize;
|
|
1792
|
-
return a >= n.pos && a <= n.pos + n.node.nodeSize && e.selection instanceof z ? i.setSelection(z.create(i.doc, o + u, a + u)) : e.selection instanceof
|
|
1792
|
+
return a >= n.pos && a <= n.pos + n.node.nodeSize && e.selection instanceof z ? i.setSelection(z.create(i.doc, o + u, a + u)) : e.selection instanceof lt && i.setSelection(lt.create(i.doc, n.pos + u)), i.scrollIntoView();
|
|
1793
1793
|
}
|
|
1794
1794
|
function Ri(e, t = Fi(e)) {
|
|
1795
1795
|
if (!t) return null;
|
|
@@ -1822,48 +1822,48 @@ function Vi({ editor: e, block: t }) {
|
|
|
1822
1822
|
...t,
|
|
1823
1823
|
node: r.child(t.index)
|
|
1824
1824
|
});
|
|
1825
|
-
return /* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ Y(q, { children: [
|
|
1826
|
+
/* @__PURE__ */ Y(Ue, { children: [/* @__PURE__ */ J(Be, { children: n("material.editor.block.turn-into", "Turn into") }), Ni(e).map((t) => /* @__PURE__ */ Y(A, {
|
|
1827
1827
|
onSelect: () => t.run(e),
|
|
1828
|
-
children: [/* @__PURE__ */
|
|
1828
|
+
children: [/* @__PURE__ */ J(t.icon, {}), n(t.key, t.label)]
|
|
1829
1829
|
}, t.id))] }),
|
|
1830
|
-
/* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ J(He, {}),
|
|
1831
|
+
/* @__PURE__ */ Y(Ue, { children: [
|
|
1832
|
+
/* @__PURE__ */ Y(A, {
|
|
1833
1833
|
onSelect: () => Bi(e, () => Ri(e.state, i())),
|
|
1834
|
-
children: [/* @__PURE__ */
|
|
1834
|
+
children: [/* @__PURE__ */ J(Ht, {}), n("material.editor.block.duplicate", "Duplicate")]
|
|
1835
1835
|
}),
|
|
1836
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ Y(A, {
|
|
1837
1837
|
disabled: t.index === 0,
|
|
1838
1838
|
onSelect: () => Bi(e, () => Li(e.state, -1, i())),
|
|
1839
1839
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ J(Nt, {}),
|
|
1841
1841
|
n("material.editor.block.move-up", "Move up"),
|
|
1842
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ J(We, { children: "⌥⇧↑" })
|
|
1843
1843
|
]
|
|
1844
1844
|
}),
|
|
1845
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ Y(A, {
|
|
1846
1846
|
disabled: t.index >= r.childCount - 1,
|
|
1847
1847
|
onSelect: () => Bi(e, () => Li(e.state, 1, i())),
|
|
1848
1848
|
children: [
|
|
1849
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ J(Mt, {}),
|
|
1850
1850
|
n("material.editor.block.move-down", "Move down"),
|
|
1851
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ J(We, { children: "⌥⇧↓" })
|
|
1852
1852
|
]
|
|
1853
1853
|
})
|
|
1854
1854
|
] }),
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1855
|
+
/* @__PURE__ */ J(He, {}),
|
|
1856
|
+
/* @__PURE__ */ Y(A, {
|
|
1857
1857
|
variant: "error",
|
|
1858
1858
|
onSelect: () => Bi(e, () => zi(e.state, i())),
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1859
|
+
children: [/* @__PURE__ */ J(vn, {}), n("material.editor.block.delete", "Delete")]
|
|
1860
1860
|
})
|
|
1861
1861
|
] });
|
|
1862
1862
|
}
|
|
1863
1863
|
//#endregion
|
|
1864
1864
|
//#region lib/components/ui/widgets/editor/extensions/block/use-active-block.ts
|
|
1865
1865
|
function Hi(e, t, n) {
|
|
1866
|
-
let [r, i] =
|
|
1866
|
+
let [r, i] = K(null), [a, o] = K(null), s = H(() => {
|
|
1867
1867
|
let n = t.current;
|
|
1868
1868
|
if (!n) return;
|
|
1869
1869
|
let { doc: i } = e.state, a = r === null ? Fi(e.state) : Pi(i, Math.min(r, i.content.size)), s = a ? e.view.nodeDOM(a.pos) : null;
|
|
@@ -1878,7 +1878,7 @@ function Hi(e, t, n) {
|
|
|
1878
1878
|
t,
|
|
1879
1879
|
r
|
|
1880
1880
|
]);
|
|
1881
|
-
return
|
|
1881
|
+
return U(() => {
|
|
1882
1882
|
if (n) return;
|
|
1883
1883
|
let t = 0, r = () => {
|
|
1884
1884
|
t ||= requestAnimationFrame(() => {
|
|
@@ -1894,7 +1894,7 @@ function Hi(e, t, n) {
|
|
|
1894
1894
|
n
|
|
1895
1895
|
]), {
|
|
1896
1896
|
active: a,
|
|
1897
|
-
hover:
|
|
1897
|
+
hover: H((r, a) => {
|
|
1898
1898
|
let o = t.current;
|
|
1899
1899
|
if (!o || n) return;
|
|
1900
1900
|
let s = o.getBoundingClientRect(), c = e.view.posAtCoords({
|
|
@@ -1907,7 +1907,7 @@ function Hi(e, t, n) {
|
|
|
1907
1907
|
t,
|
|
1908
1908
|
n
|
|
1909
1909
|
]),
|
|
1910
|
-
unhover:
|
|
1910
|
+
unhover: H(() => {
|
|
1911
1911
|
n || i(null);
|
|
1912
1912
|
}, [n])
|
|
1913
1913
|
};
|
|
@@ -1916,27 +1916,27 @@ function Hi(e, t, n) {
|
|
|
1916
1916
|
//#region lib/components/ui/widgets/editor/partials/editor-block-handle.tsx
|
|
1917
1917
|
function Ui({ children: e, className: t }) {
|
|
1918
1918
|
let { handle: n } = O(), r = n.features.some((e) => e.key === "dragHandle");
|
|
1919
|
-
return !n.editor || !r ? /* @__PURE__ */
|
|
1919
|
+
return !n.editor || !r ? /* @__PURE__ */ J("div", {
|
|
1920
1920
|
className: t,
|
|
1921
1921
|
children: e
|
|
1922
|
-
}) : /* @__PURE__ */
|
|
1922
|
+
}) : /* @__PURE__ */ J(Wi, {
|
|
1923
1923
|
editor: n.editor,
|
|
1924
1924
|
className: t,
|
|
1925
1925
|
children: e
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
1928
|
function Wi({ editor: e, children: n, className: r }) {
|
|
1929
|
-
let { chrome: i } = O(), a =
|
|
1929
|
+
let { chrome: i } = O(), a = G(null), o = P({
|
|
1930
1930
|
editor: e,
|
|
1931
1931
|
selector: (e) => e.editor.isEditable
|
|
1932
1932
|
}), s = i.state.panel === "block" && o, { active: c, hover: l, unhover: u } = Hi(e, a, s);
|
|
1933
|
-
return /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ Y("div", {
|
|
1934
1934
|
ref: a,
|
|
1935
1935
|
"data-slot": "editor-block-area",
|
|
1936
1936
|
onPointerMove: (e) => l(e.clientX, e.clientY),
|
|
1937
1937
|
onPointerLeave: u,
|
|
1938
1938
|
className: t("group/blocks relative", r),
|
|
1939
|
-
children: [n, o && c && !i.state.focusMode && /* @__PURE__ */
|
|
1939
|
+
children: [n, o && c && !i.state.focusMode && /* @__PURE__ */ J(Gi, {
|
|
1940
1940
|
editor: e,
|
|
1941
1941
|
active: c,
|
|
1942
1942
|
open: s
|
|
@@ -1945,23 +1945,23 @@ function Wi({ editor: e, children: n, className: r }) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
function Gi({ editor: e, active: n, open: r }) {
|
|
1947
1947
|
let { t: i } = M(), { chrome: a } = O();
|
|
1948
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ Y("div", {
|
|
1949
1949
|
"data-slot": "editor-block-handle",
|
|
1950
1950
|
"data-open": r || void 0,
|
|
1951
1951
|
style: { top: n.top },
|
|
1952
1952
|
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"),
|
|
1953
|
-
children: [/* @__PURE__ */
|
|
1953
|
+
children: [/* @__PURE__ */ J(N, {
|
|
1954
1954
|
variant: "ghost",
|
|
1955
1955
|
className: "size-6 text-muted-foreground",
|
|
1956
1956
|
tooltip: i("material.editor.block.add", "Add a block below"),
|
|
1957
1957
|
onClick: () => ki(e, n),
|
|
1958
|
-
children: /* @__PURE__ */
|
|
1959
|
-
}), /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ J(on, {})
|
|
1959
|
+
}), /* @__PURE__ */ Y(Ge, {
|
|
1960
1960
|
open: r,
|
|
1961
1961
|
onOpenChange: (e) => e ? a.actions.openPanel("block") : a.actions.closePanel(),
|
|
1962
|
-
children: [/* @__PURE__ */
|
|
1962
|
+
children: [/* @__PURE__ */ J(ze, {
|
|
1963
1963
|
asChild: !0,
|
|
1964
|
-
children: /* @__PURE__ */
|
|
1964
|
+
children: /* @__PURE__ */ J(N, {
|
|
1965
1965
|
variant: "ghost",
|
|
1966
1966
|
draggable: !0,
|
|
1967
1967
|
className: "size-6 cursor-grab text-muted-foreground active:cursor-grabbing",
|
|
@@ -1973,14 +1973,14 @@ function Gi({ editor: e, active: n, open: r }) {
|
|
|
1973
1973
|
Fi(e.state)?.pos !== n.pos && e.view.dispatch(Ii(e.state.tr, n)), a.actions.openPanel("block");
|
|
1974
1974
|
},
|
|
1975
1975
|
onDragStart: (t) => Ai(e, n, t.nativeEvent),
|
|
1976
|
-
children: /* @__PURE__ */
|
|
1976
|
+
children: /* @__PURE__ */ J(Kt, {})
|
|
1977
1977
|
})
|
|
1978
|
-
}), /* @__PURE__ */
|
|
1978
|
+
}), /* @__PURE__ */ J(Ve, {
|
|
1979
1979
|
align: "start",
|
|
1980
1980
|
onCloseAutoFocus: (t) => {
|
|
1981
1981
|
t.preventDefault(), e.isDestroyed || e.commands.focus();
|
|
1982
1982
|
},
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1983
|
+
children: /* @__PURE__ */ J(Vi, {
|
|
1984
1984
|
editor: e,
|
|
1985
1985
|
block: n
|
|
1986
1986
|
})
|
|
@@ -1995,7 +1995,7 @@ function Ki({ find: e }) {
|
|
|
1995
1995
|
return e.term && (n = e.total === 0 ? t("material.editor.find.none", "No results") : t("material.editor.find.count", "{current} of {total}", {
|
|
1996
1996
|
current: e.current + 1,
|
|
1997
1997
|
total: e.total
|
|
1998
|
-
})), /* @__PURE__ */
|
|
1998
|
+
})), /* @__PURE__ */ J("output", {
|
|
1999
1999
|
"data-slot": "editor-find-count",
|
|
2000
2000
|
"aria-live": "polite",
|
|
2001
2001
|
className: "min-w-16 text-center text-muted-foreground text-sm tabular-nums",
|
|
@@ -2004,44 +2004,44 @@ function Ki({ find: e }) {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
function qi({ find: e }) {
|
|
2006
2006
|
let { t } = M();
|
|
2007
|
-
return /* @__PURE__ */
|
|
2007
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(fe, {
|
|
2008
2008
|
size: "sm",
|
|
2009
2009
|
"aria-label": t("material.editor.find.match-case", "Match case"),
|
|
2010
2010
|
pressed: e.caseSensitive,
|
|
2011
2011
|
onPressedChange: e.setCaseSensitive,
|
|
2012
|
-
children: /* @__PURE__ */
|
|
2013
|
-
}), /* @__PURE__ */
|
|
2012
|
+
children: /* @__PURE__ */ J(Ft, {})
|
|
2013
|
+
}), /* @__PURE__ */ J(fe, {
|
|
2014
2014
|
size: "sm",
|
|
2015
2015
|
"aria-label": t("material.editor.find.whole-word", "Whole word"),
|
|
2016
2016
|
pressed: e.wholeWord,
|
|
2017
2017
|
onPressedChange: e.setWholeWord,
|
|
2018
|
-
children: /* @__PURE__ */
|
|
2018
|
+
children: /* @__PURE__ */ J(bn, {})
|
|
2019
2019
|
})] });
|
|
2020
2020
|
}
|
|
2021
2021
|
function Ji({ disabled: e, onStep: t }) {
|
|
2022
2022
|
let { t: n } = M();
|
|
2023
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(N, {
|
|
2024
2024
|
variant: "ghost",
|
|
2025
2025
|
className: "size-8",
|
|
2026
2026
|
tooltip: n("material.editor.find.previous", "Previous match"),
|
|
2027
2027
|
disabled: e,
|
|
2028
2028
|
onClick: () => t(-1),
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2030
|
-
}), /* @__PURE__ */
|
|
2029
|
+
children: /* @__PURE__ */ J(Bt, {})
|
|
2030
|
+
}), /* @__PURE__ */ J(N, {
|
|
2031
2031
|
variant: "ghost",
|
|
2032
2032
|
className: "size-8",
|
|
2033
2033
|
tooltip: n("material.editor.find.next", "Next match"),
|
|
2034
2034
|
disabled: e,
|
|
2035
2035
|
onClick: () => t(1),
|
|
2036
|
-
children: /* @__PURE__ */
|
|
2036
|
+
children: /* @__PURE__ */ J(Lt, {})
|
|
2037
2037
|
})] });
|
|
2038
2038
|
}
|
|
2039
2039
|
function Yi({ find: e, inputRef: t, onStep: n, onClose: r, onKeyDown: i, replaceOpen: a, canReplace: o = !0, onToggleReplace: s }) {
|
|
2040
2040
|
let { t: c } = M();
|
|
2041
|
-
return /* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ Y("div", {
|
|
2042
2042
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2043
2043
|
children: [
|
|
2044
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ J(tt, {
|
|
2045
2045
|
ref: t,
|
|
2046
2046
|
type: "search",
|
|
2047
2047
|
"aria-label": c("material.editor.find.find", "Find"),
|
|
@@ -2051,26 +2051,26 @@ function Yi({ find: e, inputRef: t, onStep: n, onClose: r, onKeyDown: i, replace
|
|
|
2051
2051
|
onKeyDown: i,
|
|
2052
2052
|
className: "h-8 min-w-0 flex-1 basis-40 sm:max-w-64"
|
|
2053
2053
|
}),
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
o && /* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ J(qi, { find: e }),
|
|
2055
|
+
o && /* @__PURE__ */ J(N, {
|
|
2056
2056
|
variant: "ghost",
|
|
2057
2057
|
className: "size-8",
|
|
2058
2058
|
"aria-pressed": a,
|
|
2059
2059
|
tooltip: c("material.editor.find.show-replace", "Show replace"),
|
|
2060
2060
|
onClick: s,
|
|
2061
|
-
children: /* @__PURE__ */
|
|
2061
|
+
children: /* @__PURE__ */ J(cn, {})
|
|
2062
2062
|
}),
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ J(Ki, { find: e }),
|
|
2064
|
+
/* @__PURE__ */ J(Ji, {
|
|
2065
2065
|
disabled: e.total === 0,
|
|
2066
2066
|
onStep: n
|
|
2067
2067
|
}),
|
|
2068
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ J(N, {
|
|
2069
2069
|
variant: "ghost",
|
|
2070
2070
|
className: "ms-auto size-8",
|
|
2071
2071
|
tooltip: c("material.editor.find.close", "Close"),
|
|
2072
2072
|
onClick: r,
|
|
2073
|
-
children: /* @__PURE__ */
|
|
2073
|
+
children: /* @__PURE__ */ J(xn, {})
|
|
2074
2074
|
})
|
|
2075
2075
|
]
|
|
2076
2076
|
});
|
|
@@ -2110,7 +2110,7 @@ function ra(e, t, n) {
|
|
|
2110
2110
|
}
|
|
2111
2111
|
//#endregion
|
|
2112
2112
|
//#region lib/components/ui/widgets/editor/extensions/find/find-state.ts
|
|
2113
|
-
var Z = new
|
|
2113
|
+
var Z = new B("nxgtFind"), ia = "";
|
|
2114
2114
|
function aa(e) {
|
|
2115
2115
|
let t = [];
|
|
2116
2116
|
return e.descendants((e, n) => e.isTextblock ? (t.push({
|
|
@@ -2211,7 +2211,7 @@ function pa(e) {
|
|
|
2211
2211
|
return /\n/.test(i) ? "" : i;
|
|
2212
2212
|
}
|
|
2213
2213
|
function ma(e) {
|
|
2214
|
-
let [t, n] =
|
|
2214
|
+
let [t, n] = K(() => pa(e)), [r, i] = K(!1), [a, o] = K(!1), s = P({
|
|
2215
2215
|
editor: e,
|
|
2216
2216
|
selector: ({ editor: e }) => {
|
|
2217
2217
|
let { matches: t, current: n } = fa(e.state);
|
|
@@ -2221,7 +2221,7 @@ function ma(e) {
|
|
|
2221
2221
|
};
|
|
2222
2222
|
}
|
|
2223
2223
|
});
|
|
2224
|
-
return
|
|
2224
|
+
return U(() => {
|
|
2225
2225
|
e.commands.setFind({
|
|
2226
2226
|
term: t,
|
|
2227
2227
|
caseSensitive: r,
|
|
@@ -2232,7 +2232,7 @@ function ma(e) {
|
|
|
2232
2232
|
t,
|
|
2233
2233
|
r,
|
|
2234
2234
|
a
|
|
2235
|
-
]),
|
|
2235
|
+
]), U(() => () => {
|
|
2236
2236
|
e.isDestroyed || e.commands.clearFind();
|
|
2237
2237
|
}, [e]), {
|
|
2238
2238
|
term: t,
|
|
@@ -2249,27 +2249,27 @@ function ma(e) {
|
|
|
2249
2249
|
//#region lib/components/ui/widgets/editor/partials/editor-find-panel.tsx
|
|
2250
2250
|
function ha({ className: e }) {
|
|
2251
2251
|
let { handle: t, chrome: n } = O(), { editor: r } = t, i = n.state.panel === "find", a = t.features.some((e) => e.key === "find");
|
|
2252
|
-
return !r || !i || !a ? null : /* @__PURE__ */
|
|
2252
|
+
return !r || !i || !a ? null : /* @__PURE__ */ J(ga, { className: e });
|
|
2253
2253
|
}
|
|
2254
2254
|
function ga({ className: e }) {
|
|
2255
|
-
let { t } = M(), { handle: n, chrome: r } = O(), i = n.editor, a = ma(i), o =
|
|
2255
|
+
let { t } = M(), { handle: n, chrome: r } = O(), i = n.editor, a = ma(i), o = G(null), s = P({
|
|
2256
2256
|
editor: i,
|
|
2257
2257
|
selector: (e) => e.editor.isEditable
|
|
2258
2258
|
}), c = s && r.state.findReplace;
|
|
2259
|
-
|
|
2259
|
+
U(() => {
|
|
2260
2260
|
o.current?.focus(), o.current?.select();
|
|
2261
2261
|
}, []);
|
|
2262
2262
|
let l = () => {
|
|
2263
2263
|
r.actions.closePanel(), i.commands.focus();
|
|
2264
2264
|
}, u = (e) => i.commands.findStep(e);
|
|
2265
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ Y("search", {
|
|
2266
2266
|
"aria-label": t("material.editor.find.title", "Find and replace"),
|
|
2267
2267
|
"data-slot": "editor-find",
|
|
2268
2268
|
onKeyDown: (e) => {
|
|
2269
2269
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), l());
|
|
2270
2270
|
},
|
|
2271
2271
|
className: e ?? "grid gap-1.5",
|
|
2272
|
-
children: [/* @__PURE__ */
|
|
2272
|
+
children: [/* @__PURE__ */ J(Yi, {
|
|
2273
2273
|
find: a,
|
|
2274
2274
|
inputRef: o,
|
|
2275
2275
|
onStep: u,
|
|
@@ -2280,18 +2280,18 @@ function ga({ className: e }) {
|
|
|
2280
2280
|
replaceOpen: c,
|
|
2281
2281
|
canReplace: s,
|
|
2282
2282
|
onToggleReplace: () => r.actions.setFindReplace(!c)
|
|
2283
|
-
}), c && /* @__PURE__ */
|
|
2283
|
+
}), c && /* @__PURE__ */ J(_a, {
|
|
2284
2284
|
editor: i,
|
|
2285
2285
|
find: a
|
|
2286
2286
|
})]
|
|
2287
2287
|
});
|
|
2288
2288
|
}
|
|
2289
2289
|
function _a({ editor: e, find: t }) {
|
|
2290
|
-
let { t: n } = M(), [r, i] =
|
|
2291
|
-
return /* @__PURE__ */
|
|
2290
|
+
let { t: n } = M(), [r, i] = K("");
|
|
2291
|
+
return /* @__PURE__ */ Y("div", {
|
|
2292
2292
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2293
2293
|
children: [
|
|
2294
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ J(tt, {
|
|
2295
2295
|
"aria-label": n("material.editor.find.replace", "Replace"),
|
|
2296
2296
|
placeholder: n("material.editor.find.replace", "Replace"),
|
|
2297
2297
|
value: r,
|
|
@@ -2301,14 +2301,14 @@ function _a({ editor: e, find: t }) {
|
|
|
2301
2301
|
},
|
|
2302
2302
|
className: "h-8 min-w-0 flex-1 basis-40 sm:max-w-64"
|
|
2303
2303
|
}),
|
|
2304
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ J(j, {
|
|
2305
2305
|
variant: "tonal",
|
|
2306
2306
|
size: "sm",
|
|
2307
2307
|
disabled: t.total === 0,
|
|
2308
2308
|
onClick: () => e.commands.replaceCurrent(r),
|
|
2309
2309
|
children: n("material.editor.find.replace-one", "Replace")
|
|
2310
2310
|
}),
|
|
2311
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ J(j, {
|
|
2312
2312
|
variant: "tonal",
|
|
2313
2313
|
size: "sm",
|
|
2314
2314
|
disabled: t.total === 0,
|
|
@@ -2322,7 +2322,7 @@ function _a({ editor: e, find: t }) {
|
|
|
2322
2322
|
//#region lib/components/ui/widgets/editor/partials/editor-focus-exit.tsx
|
|
2323
2323
|
function va({ className: e }) {
|
|
2324
2324
|
let { t: n } = M(), { chrome: r, handle: i } = O();
|
|
2325
|
-
return r.state.focusMode ? /* @__PURE__ */
|
|
2325
|
+
return r.state.focusMode ? /* @__PURE__ */ J(N, {
|
|
2326
2326
|
variant: "ghost",
|
|
2327
2327
|
"data-slot": "editor-focus-exit",
|
|
2328
2328
|
className: t("size-8 bg-card/80 backdrop-blur", e),
|
|
@@ -2330,7 +2330,7 @@ function va({ className: e }) {
|
|
|
2330
2330
|
onClick: () => {
|
|
2331
2331
|
r.actions.setFocusMode(!1), i.focus();
|
|
2332
2332
|
},
|
|
2333
|
-
children: /* @__PURE__ */
|
|
2333
|
+
children: /* @__PURE__ */ J(nn, {})
|
|
2334
2334
|
}) : null;
|
|
2335
2335
|
}
|
|
2336
2336
|
//#endregion
|
|
@@ -2361,19 +2361,19 @@ function xa(e) {
|
|
|
2361
2361
|
//#region lib/components/ui/widgets/editor/partials/editor-stats.tsx
|
|
2362
2362
|
function Sa({ readingTime: e = !0 }) {
|
|
2363
2363
|
let { t } = M(), { handle: n } = O(), r = xa(n), { words: i } = r;
|
|
2364
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ Y("p", {
|
|
2365
2365
|
"data-slot": "editor-stats",
|
|
2366
2366
|
className: "flex flex-wrap gap-x-2",
|
|
2367
2367
|
children: [
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
e && /* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ J("span", { children: t("material.editor.footer.words", "{count, plural, one {# word} other {# words}}", { count: i }) }),
|
|
2369
|
+
e && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("span", {
|
|
2370
2370
|
"aria-hidden": "true",
|
|
2371
2371
|
children: "·"
|
|
2372
|
-
}), /* @__PURE__ */
|
|
2373
|
-
r.limit ? /* @__PURE__ */
|
|
2372
|
+
}), /* @__PURE__ */ J("span", { children: t("material.editor.footer.reading-time", "{minutes, plural, one {# min read} other {# min read}}", { minutes: r.readingMinutes }) })] }),
|
|
2373
|
+
r.limit ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("span", {
|
|
2374
2374
|
"aria-hidden": "true",
|
|
2375
2375
|
children: "·"
|
|
2376
|
-
}), /* @__PURE__ */
|
|
2376
|
+
}), /* @__PURE__ */ J("span", { children: `${r.characters ?? 0}/${r.limit}` })] }) : null
|
|
2377
2377
|
]
|
|
2378
2378
|
});
|
|
2379
2379
|
}
|
|
@@ -2386,22 +2386,22 @@ var Ca = {
|
|
|
2386
2386
|
};
|
|
2387
2387
|
function wa({ className: n, status: r, actions: i, readingTime: a = !0 }) {
|
|
2388
2388
|
let { t: o } = M(), s = typeof r == "string" && r in Ca, [c, l] = s ? Ca[r] : [];
|
|
2389
|
-
return /* @__PURE__ */
|
|
2389
|
+
return /* @__PURE__ */ Y("div", {
|
|
2390
2390
|
"data-slot": "editor-footer",
|
|
2391
2391
|
className: t("flex flex-wrap items-center gap-x-3 gap-y-2 text-muted-foreground text-sm", n),
|
|
2392
2392
|
children: [
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
e(r) ? /* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ J(Sa, { readingTime: a }),
|
|
2394
|
+
e(r) ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("span", {
|
|
2395
2395
|
"aria-hidden": "true",
|
|
2396
2396
|
children: "·"
|
|
2397
|
-
}), /* @__PURE__ */
|
|
2397
|
+
}), /* @__PURE__ */ J("span", {
|
|
2398
2398
|
"data-slot": "editor-save-status",
|
|
2399
2399
|
role: "status",
|
|
2400
2400
|
"aria-live": "polite",
|
|
2401
2401
|
"data-status": s ? r : void 0,
|
|
2402
2402
|
children: s && c ? o(c, l) : r
|
|
2403
2403
|
})] }) : null,
|
|
2404
|
-
i && /* @__PURE__ */
|
|
2404
|
+
i && /* @__PURE__ */ J("div", {
|
|
2405
2405
|
"data-slot": "editor-actions",
|
|
2406
2406
|
className: "ms-auto flex items-center gap-2",
|
|
2407
2407
|
children: i
|
|
@@ -2437,8 +2437,8 @@ function Aa(e) {
|
|
|
2437
2437
|
let t = P({
|
|
2438
2438
|
editor: e,
|
|
2439
2439
|
selector: ({ editor: e }) => Ta(e.state.doc)
|
|
2440
|
-
}), [n, r] =
|
|
2441
|
-
|
|
2440
|
+
}), [n, r] = K(0), i = G(0);
|
|
2441
|
+
U(() => {
|
|
2442
2442
|
let n = 0, a = () => {
|
|
2443
2443
|
if (n = 0, Date.now() < i.current) return;
|
|
2444
2444
|
let a = t.map((t) => {
|
|
@@ -2456,7 +2456,7 @@ function Aa(e) {
|
|
|
2456
2456
|
n && cancelAnimationFrame(n), window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", o);
|
|
2457
2457
|
};
|
|
2458
2458
|
}, [e, t]);
|
|
2459
|
-
let a =
|
|
2459
|
+
let a = H((n) => {
|
|
2460
2460
|
let a = t[n];
|
|
2461
2461
|
if (!a) return;
|
|
2462
2462
|
i.current = Date.now() + Oa, r(n), e.chain().focus().setTextSelection(a.pos + 1).run();
|
|
@@ -2481,7 +2481,7 @@ var ja = {
|
|
|
2481
2481
|
};
|
|
2482
2482
|
function Ma({ className: e, onNavigate: t }) {
|
|
2483
2483
|
let { handle: n } = O();
|
|
2484
|
-
return n.editor ? /* @__PURE__ */
|
|
2484
|
+
return n.editor ? /* @__PURE__ */ J(Na, {
|
|
2485
2485
|
editor: n.editor,
|
|
2486
2486
|
className: e,
|
|
2487
2487
|
onNavigate: t
|
|
@@ -2489,19 +2489,19 @@ function Ma({ className: e, onNavigate: t }) {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
function Na({ editor: e, className: n, onNavigate: r }) {
|
|
2491
2491
|
let { t: i } = M(), { items: a, active: o, goTo: s } = Aa(e);
|
|
2492
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ Y("nav", {
|
|
2493
2493
|
"aria-label": i("material.editor.outline", "Outline"),
|
|
2494
2494
|
"data-slot": "editor-outline",
|
|
2495
2495
|
className: t("text-sm", n),
|
|
2496
|
-
children: [/* @__PURE__ */
|
|
2496
|
+
children: [/* @__PURE__ */ J("p", {
|
|
2497
2497
|
className: "mb-2 px-2 font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
2498
2498
|
children: i("material.editor.outline", "Outline")
|
|
2499
|
-
}), a.length === 0 ? /* @__PURE__ */
|
|
2499
|
+
}), a.length === 0 ? /* @__PURE__ */ J("p", {
|
|
2500
2500
|
className: "px-2 text-muted-foreground",
|
|
2501
2501
|
children: i("material.editor.outline-empty", "No headings yet")
|
|
2502
|
-
}) : /* @__PURE__ */
|
|
2502
|
+
}) : /* @__PURE__ */ J("ul", {
|
|
2503
2503
|
className: "grid gap-0.5",
|
|
2504
|
-
children: a.map((e, n) => /* @__PURE__ */
|
|
2504
|
+
children: a.map((e, n) => /* @__PURE__ */ J("li", { children: /* @__PURE__ */ J("button", {
|
|
2505
2505
|
type: "button",
|
|
2506
2506
|
"data-level": e.level,
|
|
2507
2507
|
"aria-current": n === o ? "location" : void 0,
|
|
@@ -2518,22 +2518,22 @@ function Na({ editor: e, className: n, onNavigate: r }) {
|
|
|
2518
2518
|
//#region lib/components/ui/widgets/editor/partials/editor-outline-panel.tsx
|
|
2519
2519
|
function Pa(e) {
|
|
2520
2520
|
let { handle: t, chrome: n } = O();
|
|
2521
|
-
return t.features.some((e) => e.key === "outline") ? /* @__PURE__ */
|
|
2521
|
+
return t.features.some((e) => e.key === "outline") ? /* @__PURE__ */ J(Ar, {
|
|
2522
2522
|
id: "outline",
|
|
2523
2523
|
className: "w-72 max-w-[92vw] p-2",
|
|
2524
|
-
children: /* @__PURE__ */
|
|
2524
|
+
children: /* @__PURE__ */ J(Ma, { onNavigate: () => n.actions.closePanel() })
|
|
2525
2525
|
}) : null;
|
|
2526
2526
|
}
|
|
2527
2527
|
//#endregion
|
|
2528
2528
|
//#region lib/components/ui/widgets/editor/extensions/upload/use-editor-uploads.ts
|
|
2529
2529
|
var Fa = 0, Ia = 1e6;
|
|
2530
2530
|
function La(e) {
|
|
2531
|
-
let t = f(e.editor)?.queue, n =
|
|
2531
|
+
let t = f(e.editor)?.queue, n = At(H((e) => t?.subscribe(e) ?? (() => {}), [t]), () => {
|
|
2532
2532
|
if (!t) return Fa;
|
|
2533
2533
|
let e = t.list(), n = e.filter((e) => e.status === "error").length;
|
|
2534
2534
|
return (e.length - n) * Ia + n;
|
|
2535
2535
|
}, () => Fa);
|
|
2536
|
-
return
|
|
2536
|
+
return W(() => ({
|
|
2537
2537
|
pending: Math.floor(n / Ia),
|
|
2538
2538
|
failed: n % Ia
|
|
2539
2539
|
}), [n]);
|
|
@@ -2575,7 +2575,7 @@ function Ha({ editor: e }) {
|
|
|
2575
2575
|
let { t } = M(), { chrome: n } = O(), r = ir(e), i = n.state.panel === "assistant";
|
|
2576
2576
|
if (!r || !e.isEditable) return null;
|
|
2577
2577
|
let a = t("material.editor.assistant.title", "Assistant");
|
|
2578
|
-
return /* @__PURE__ */
|
|
2578
|
+
return /* @__PURE__ */ J(k, {
|
|
2579
2579
|
"data-slot": "editor-assistant-button",
|
|
2580
2580
|
variant: i ? "filled" : "tonal",
|
|
2581
2581
|
"aria-label": a,
|
|
@@ -2584,7 +2584,7 @@ function Ha({ editor: e }) {
|
|
|
2584
2584
|
tooltip: a,
|
|
2585
2585
|
onMouseDown: (e) => e.preventDefault(),
|
|
2586
2586
|
onClick: () => i ? r.close() : r.open(),
|
|
2587
|
-
children: /* @__PURE__ */
|
|
2587
|
+
children: /* @__PURE__ */ J(fn, {})
|
|
2588
2588
|
});
|
|
2589
2589
|
}
|
|
2590
2590
|
//#endregion
|
|
@@ -2715,7 +2715,7 @@ async function no(e) {
|
|
|
2715
2715
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-controller.ts
|
|
2716
2716
|
var ro = class {
|
|
2717
2717
|
host;
|
|
2718
|
-
store =
|
|
2718
|
+
store = dt(nr);
|
|
2719
2719
|
abort = null;
|
|
2720
2720
|
token = 0;
|
|
2721
2721
|
panel = null;
|
|
@@ -2744,7 +2744,7 @@ var ro = class {
|
|
|
2744
2744
|
this.cancel();
|
|
2745
2745
|
let e = this.host.range();
|
|
2746
2746
|
this.store.replace({
|
|
2747
|
-
...
|
|
2747
|
+
...nr,
|
|
2748
2748
|
phase: "menu",
|
|
2749
2749
|
range: e,
|
|
2750
2750
|
hasSelection: e.from !== e.to
|
|
@@ -2832,14 +2832,14 @@ var ro = class {
|
|
|
2832
2832
|
}));
|
|
2833
2833
|
};
|
|
2834
2834
|
reset = () => {
|
|
2835
|
-
this.cancel(), this.store.replace(
|
|
2835
|
+
this.cancel(), this.store.replace(nr);
|
|
2836
2836
|
};
|
|
2837
2837
|
close = () => {
|
|
2838
2838
|
this.reset(), this.host.closePanel();
|
|
2839
2839
|
};
|
|
2840
2840
|
mapRange = (e) => {
|
|
2841
2841
|
if (this.state.phase === "idle") return;
|
|
2842
|
-
let t =
|
|
2842
|
+
let t = tr(this.state, e);
|
|
2843
2843
|
t && this.set(t);
|
|
2844
2844
|
};
|
|
2845
2845
|
}, io = (e) => new ro(e), ao = Xa * 3;
|
|
@@ -2847,7 +2847,7 @@ async function oo(e, t, n) {
|
|
|
2847
2847
|
if (n <= t) return "";
|
|
2848
2848
|
let { doc: r } = e.state;
|
|
2849
2849
|
try {
|
|
2850
|
-
return (await
|
|
2850
|
+
return (await ht(r.cut(t, n).toJSON(), { extensions: Sn(e) })).replace(/\s+$/, "");
|
|
2851
2851
|
} catch {
|
|
2852
2852
|
return r.textBetween(t, n, "\n\n");
|
|
2853
2853
|
}
|
|
@@ -2891,7 +2891,7 @@ var co = R.create({
|
|
|
2891
2891
|
n.follow = qa(e, () => r.getState().phase === "idle" ? null : r.getState().range, r.subscribe);
|
|
2892
2892
|
},
|
|
2893
2893
|
addProseMirrorPlugins() {
|
|
2894
|
-
let e = new
|
|
2894
|
+
let e = new B("assistantRange"), t = () => this.storage.controller;
|
|
2895
2895
|
return [new F({
|
|
2896
2896
|
key: e,
|
|
2897
2897
|
props: { decorations: (e) => {
|
|
@@ -2920,7 +2920,7 @@ var co = R.create({
|
|
|
2920
2920
|
this.storage.controller?.reset();
|
|
2921
2921
|
}
|
|
2922
2922
|
}), lo = ({ editor: e, chrome: t }) => {
|
|
2923
|
-
let n =
|
|
2923
|
+
let n = er(e)?.controller;
|
|
2924
2924
|
return n ? t.state.panel === "assistant" ? (n.focusPanel(), !0) : (n.open(), !0) : !1;
|
|
2925
2925
|
}, uo = {
|
|
2926
2926
|
id: "assistant",
|
|
@@ -2934,11 +2934,11 @@ var co = R.create({
|
|
|
2934
2934
|
"continue"
|
|
2935
2935
|
],
|
|
2936
2936
|
group: "Insert",
|
|
2937
|
-
icon:
|
|
2938
|
-
run: ({ editor: e, range: t }) => (e.chain().focus().deleteRange(t).run(),
|
|
2937
|
+
icon: fn,
|
|
2938
|
+
run: ({ editor: e, range: t }) => (e.chain().focus().deleteRange(t).run(), er(e)?.controller.open(), !0)
|
|
2939
2939
|
}, fo = (e = {}) => {
|
|
2940
2940
|
let { onAssist: t, actions: n, allowMedia: r } = e;
|
|
2941
|
-
return
|
|
2941
|
+
return V(t ? {
|
|
2942
2942
|
name: "assistant",
|
|
2943
2943
|
extensions: (e) => [co.configure({
|
|
2944
2944
|
handler: () => t,
|
|
@@ -2988,7 +2988,7 @@ function mo({ editor: e }) {
|
|
|
2988
2988
|
let { t } = M(), n = Sr(e);
|
|
2989
2989
|
if (!n) return null;
|
|
2990
2990
|
let r = t("material.editor.comments.comment", "Comment");
|
|
2991
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ J(k, {
|
|
2992
2992
|
"data-slot": "editor-comment-button",
|
|
2993
2993
|
variant: "ghost",
|
|
2994
2994
|
"aria-label": r,
|
|
@@ -2996,14 +2996,14 @@ function mo({ editor: e }) {
|
|
|
2996
2996
|
tooltip: r,
|
|
2997
2997
|
onMouseDown: (e) => e.preventDefault(),
|
|
2998
2998
|
onClick: () => n.startComposer(),
|
|
2999
|
-
children: /* @__PURE__ */
|
|
2999
|
+
children: /* @__PURE__ */ J(tn, {})
|
|
3000
3000
|
});
|
|
3001
3001
|
}
|
|
3002
3002
|
function ho({ editor: e }) {
|
|
3003
3003
|
let { t } = M(), { chrome: n } = O(), r = Cr(e);
|
|
3004
3004
|
if (!X(e)) return null;
|
|
3005
3005
|
let i = n.state.panel === "comments", a = mi(r).length, o = t("material.editor.comments.count", "Comments ({count})", { count: a });
|
|
3006
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ J(k, {
|
|
3007
3007
|
"data-slot": "editor-comments-button",
|
|
3008
3008
|
variant: i ? "filled" : "ghost",
|
|
3009
3009
|
"aria-label": o,
|
|
@@ -3013,7 +3013,7 @@ function ho({ editor: e }) {
|
|
|
3013
3013
|
onClick: (t) => {
|
|
3014
3014
|
n.actions.togglePanel("comments"), i && po(t, e);
|
|
3015
3015
|
},
|
|
3016
|
-
children: /* @__PURE__ */
|
|
3016
|
+
children: /* @__PURE__ */ J(en, {})
|
|
3017
3017
|
});
|
|
3018
3018
|
}
|
|
3019
3019
|
function go(e) {
|
|
@@ -3065,7 +3065,7 @@ var So = (e) => {
|
|
|
3065
3065
|
t.push(n.length === e.marks.length ? e : e.mark(n));
|
|
3066
3066
|
} else t.push(e.copy(So(e.content)));
|
|
3067
3067
|
}), it.fromArray(t);
|
|
3068
|
-
}, Co = (e) => new at(So(e.content), e.openStart, e.openEnd), wo = (e) => e?.dragging?.move === !0, To = (e, t) => wo(t) ? e : Co(e), Eo = new
|
|
3068
|
+
}, Co = (e) => new at(So(e.content), e.openStart, e.openEnd), wo = (e) => e?.dragging?.move === !0, To = (e, t) => wo(t) ? e : Co(e), Eo = new B("comments"), Do = (e, t) => {
|
|
3069
3069
|
let n = [];
|
|
3070
3070
|
for (let r = e; r && r !== t; r = r.parentElement) {
|
|
3071
3071
|
let e = r.getAttribute?.("data-comment-thread");
|
|
@@ -3074,7 +3074,7 @@ var So = (e) => {
|
|
|
3074
3074
|
return n;
|
|
3075
3075
|
}, Oo = R.create({
|
|
3076
3076
|
name: "comments",
|
|
3077
|
-
addExtensions: () => [
|
|
3077
|
+
addExtensions: () => [bt],
|
|
3078
3078
|
addStorage: () => ({}),
|
|
3079
3079
|
onBeforeCreate() {
|
|
3080
3080
|
let { editor: e, options: t, storage: n } = this;
|
|
@@ -3093,7 +3093,7 @@ var So = (e) => {
|
|
|
3093
3093
|
focus: () => {
|
|
3094
3094
|
e.commands.focus();
|
|
3095
3095
|
},
|
|
3096
|
-
newId:
|
|
3096
|
+
newId: yt,
|
|
3097
3097
|
openPanel: () => t.panel.open(),
|
|
3098
3098
|
closePanel: () => t.panel.close()
|
|
3099
3099
|
}, t.current().showResolved === !0);
|
|
@@ -3151,7 +3151,7 @@ var So = (e) => {
|
|
|
3151
3151
|
keys: e > 0 ? "F8" : "Shift-F8",
|
|
3152
3152
|
editable: !0,
|
|
3153
3153
|
run: ({ editor: t }) => ko(t)?.step(e) ?? !1
|
|
3154
|
-
}), Mo = (e = {}) => e.adapter ?
|
|
3154
|
+
}), Mo = (e = {}) => e.adapter ? V({
|
|
3155
3155
|
name: "comments",
|
|
3156
3156
|
extensions: (t) => [Oo.configure({
|
|
3157
3157
|
current: () => e,
|
|
@@ -3182,9 +3182,9 @@ var So = (e) => {
|
|
|
3182
3182
|
jo(-1)
|
|
3183
3183
|
],
|
|
3184
3184
|
markdown: "native"
|
|
3185
|
-
}) :
|
|
3185
|
+
}) : V({
|
|
3186
3186
|
name: "comments",
|
|
3187
|
-
extensions: () => [
|
|
3187
|
+
extensions: () => [bt],
|
|
3188
3188
|
markdown: "native"
|
|
3189
3189
|
}), No = R.create({
|
|
3190
3190
|
name: "nxgtBlockKeys",
|
|
@@ -3199,7 +3199,7 @@ var So = (e) => {
|
|
|
3199
3199
|
"Alt-Shift-ArrowDown": e(1)
|
|
3200
3200
|
};
|
|
3201
3201
|
}
|
|
3202
|
-
}), Po = () =>
|
|
3202
|
+
}), Po = () => V({
|
|
3203
3203
|
name: "dragHandle",
|
|
3204
3204
|
extensions: () => [No],
|
|
3205
3205
|
shortcuts: [{
|
|
@@ -3212,12 +3212,12 @@ var So = (e) => {
|
|
|
3212
3212
|
//#region lib/components/ui/widgets/editor/extensions/find/find-button.tsx
|
|
3213
3213
|
function Fo({ editor: e }) {
|
|
3214
3214
|
let { t } = M(), { chrome: n } = O(), r = n.state.panel === "find";
|
|
3215
|
-
return /* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ J(k, {
|
|
3216
3216
|
variant: r ? "filled" : "ghost",
|
|
3217
3217
|
"aria-pressed": r,
|
|
3218
3218
|
tooltip: t("material.editor.find.title", "Find and replace"),
|
|
3219
3219
|
onClick: () => r ? n.actions.closePanel() : n.actions.openFind({ replace: !1 }),
|
|
3220
|
-
children: /* @__PURE__ */
|
|
3220
|
+
children: /* @__PURE__ */ J(un, {})
|
|
3221
3221
|
});
|
|
3222
3222
|
}
|
|
3223
3223
|
//#endregion
|
|
@@ -3280,7 +3280,7 @@ var Io = () => new F({
|
|
|
3280
3280
|
clearFind: () => ({ tr: e, dispatch: t }) => (t?.(e.setMeta(Z, { clear: !0 })), !0)
|
|
3281
3281
|
};
|
|
3282
3282
|
}
|
|
3283
|
-
}), zo = (e) => ({ chrome: t, root: n }) => (t.actions.openFind({ replace: e }), n.querySelector("[data-slot=editor-find] input")?.focus(), !0), Bo = () =>
|
|
3283
|
+
}), zo = (e) => ({ chrome: t, root: n }) => (t.actions.openFind({ replace: e }), n.querySelector("[data-slot=editor-find] input")?.focus(), !0), Bo = () => V({
|
|
3284
3284
|
name: "find",
|
|
3285
3285
|
extensions: () => [Ro],
|
|
3286
3286
|
toolbar: [{
|
|
@@ -3311,19 +3311,19 @@ var Io = () => new F({
|
|
|
3311
3311
|
//#region lib/components/ui/widgets/editor/extensions/focus-mode/focus-mode-button.tsx
|
|
3312
3312
|
function Vo({ editor: e }) {
|
|
3313
3313
|
let { t } = M(), { chrome: n } = O(), r = n.state.focusMode;
|
|
3314
|
-
return /* @__PURE__ */
|
|
3314
|
+
return /* @__PURE__ */ J(k, {
|
|
3315
3315
|
variant: r ? "filled" : "ghost",
|
|
3316
3316
|
"aria-pressed": r,
|
|
3317
3317
|
tooltip: t("material.editor.focus-mode", "Focus mode"),
|
|
3318
3318
|
onClick: () => {
|
|
3319
3319
|
n.actions.toggleFocusMode(), e.commands.focus();
|
|
3320
3320
|
},
|
|
3321
|
-
children: /* @__PURE__ */
|
|
3321
|
+
children: /* @__PURE__ */ J(Gt, {})
|
|
3322
3322
|
});
|
|
3323
3323
|
}
|
|
3324
3324
|
//#endregion
|
|
3325
3325
|
//#region lib/components/ui/widgets/editor/kit/features/focus-mode.ts
|
|
3326
|
-
var Ho = () =>
|
|
3326
|
+
var Ho = () => V({
|
|
3327
3327
|
name: "focusMode",
|
|
3328
3328
|
extensions: () => [],
|
|
3329
3329
|
requires: ["marks"],
|
|
@@ -3350,18 +3350,18 @@ function Uo({ editor: e }) {
|
|
|
3350
3350
|
canCode: e.editor.can().chain().toggleCode().run() ?? !1
|
|
3351
3351
|
})
|
|
3352
3352
|
});
|
|
3353
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ J(k, {
|
|
3354
3354
|
variant: n.isCode ? "filled" : "ghost",
|
|
3355
3355
|
"aria-pressed": n.isCode,
|
|
3356
3356
|
tooltip: t("material.editor.code", "Inline code"),
|
|
3357
3357
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
3358
3358
|
disabled: !n.canCode,
|
|
3359
|
-
children: /* @__PURE__ */
|
|
3359
|
+
children: /* @__PURE__ */ J(Vt, {})
|
|
3360
3360
|
});
|
|
3361
3361
|
}
|
|
3362
3362
|
//#endregion
|
|
3363
3363
|
//#region lib/components/ui/widgets/editor/kit/features/inline-code.ts
|
|
3364
|
-
var Wo = () =>
|
|
3364
|
+
var Wo = () => V({
|
|
3365
3365
|
name: "inlineCode",
|
|
3366
3366
|
extensions: () => [],
|
|
3367
3367
|
toolbar: [{
|
|
@@ -3385,15 +3385,15 @@ var Wo = () => B({
|
|
|
3385
3385
|
addProseMirrorPlugins() {
|
|
3386
3386
|
let { editor: e } = this, t = !1;
|
|
3387
3387
|
return [new F({
|
|
3388
|
-
key: new
|
|
3388
|
+
key: new B("markdownPaste"),
|
|
3389
3389
|
props: {
|
|
3390
3390
|
handleKeyDown: (e, n) => (t = n.shiftKey && (n.metaKey || n.ctrlKey) && n.key.toLowerCase() === "v", !1),
|
|
3391
3391
|
handleDOMEvents: { keyup: () => (t = !1, !1) },
|
|
3392
3392
|
handlePaste: (n, r) => {
|
|
3393
3393
|
let i = r.clipboardData, a = i?.getData("text/plain") ?? "", o = t;
|
|
3394
|
-
return t = !1, o || !a || i?.getData("text/html") || n.state.selection.$from.parent.type.spec.code || !Va(a) ? !1 : (
|
|
3394
|
+
return t = !1, o || !a || i?.getData("text/html") || n.state.selection.$from.parent.type.spec.code || !Va(a) ? !1 : (ut().then((t) => {
|
|
3395
3395
|
if (e.isDestroyed) return;
|
|
3396
|
-
let n = e.extensionManager.extensions, r =
|
|
3396
|
+
let n = e.extensionManager.extensions, r = xt(t.parse(a, n), n);
|
|
3397
3397
|
e.commands.insertContent(r.content ?? []);
|
|
3398
3398
|
}).catch(() => {
|
|
3399
3399
|
e.isDestroyed || e.commands.insertContent(Ko(a));
|
|
@@ -3408,7 +3408,7 @@ var Wo = () => B({
|
|
|
3408
3408
|
type: "text",
|
|
3409
3409
|
text: e
|
|
3410
3410
|
}]
|
|
3411
|
-
})), qo = () =>
|
|
3411
|
+
})), qo = () => V({
|
|
3412
3412
|
name: "markdownPaste",
|
|
3413
3413
|
extensions: () => [Go],
|
|
3414
3414
|
markdown: "native"
|
|
@@ -3417,19 +3417,19 @@ var Wo = () => B({
|
|
|
3417
3417
|
//#region lib/components/ui/widgets/editor/extensions/outline/outline-button.tsx
|
|
3418
3418
|
function Jo({ editor: e }) {
|
|
3419
3419
|
let { t } = M(), { chrome: n } = O(), r = n.state.panel === "outline";
|
|
3420
|
-
return /* @__PURE__ */
|
|
3420
|
+
return /* @__PURE__ */ J(k, {
|
|
3421
3421
|
variant: r ? "filled" : "ghost",
|
|
3422
3422
|
"aria-pressed": r,
|
|
3423
3423
|
tooltip: t("material.editor.outline", "Outline"),
|
|
3424
3424
|
onClick: (t) => {
|
|
3425
3425
|
n.actions.togglePanel("outline"), r && po(t, e);
|
|
3426
3426
|
},
|
|
3427
|
-
children: /* @__PURE__ */
|
|
3427
|
+
children: /* @__PURE__ */ J(hn, {})
|
|
3428
3428
|
});
|
|
3429
3429
|
}
|
|
3430
3430
|
//#endregion
|
|
3431
3431
|
//#region lib/components/ui/widgets/editor/kit/features/outline.ts
|
|
3432
|
-
var Yo = () =>
|
|
3432
|
+
var Yo = () => V({
|
|
3433
3433
|
name: "outline",
|
|
3434
3434
|
extensions: () => [],
|
|
3435
3435
|
toolbar: [{
|
|
@@ -3447,31 +3447,31 @@ function Xo({ editor: e }) {
|
|
|
3447
3447
|
let { t } = M(), n = P({
|
|
3448
3448
|
editor: e,
|
|
3449
3449
|
selector: (e) => e.editor.getAttributes("image").alt ?? ""
|
|
3450
|
-
}), [r, i] =
|
|
3451
|
-
return /* @__PURE__ */
|
|
3450
|
+
}), [r, i] = K(""), [a, o] = K(!1), { trigger: s, onCloseAutoFocus: c } = oe(), l = t("material.editor.upload.alt", "Alt text");
|
|
3451
|
+
return /* @__PURE__ */ Y(Re, {
|
|
3452
3452
|
open: a,
|
|
3453
3453
|
onOpenChange: (e) => {
|
|
3454
3454
|
o(e), e && i(n);
|
|
3455
3455
|
},
|
|
3456
|
-
children: [/* @__PURE__ */
|
|
3456
|
+
children: [/* @__PURE__ */ J(Ie, {
|
|
3457
3457
|
asChild: !0,
|
|
3458
3458
|
ref: s,
|
|
3459
|
-
children: /* @__PURE__ */
|
|
3459
|
+
children: /* @__PURE__ */ J(k, {
|
|
3460
3460
|
variant: "ghost",
|
|
3461
3461
|
tooltip: l,
|
|
3462
3462
|
"aria-label": l,
|
|
3463
3463
|
className: "rounded size-7",
|
|
3464
3464
|
more: { kind: "dialog" },
|
|
3465
|
-
children: /* @__PURE__ */
|
|
3465
|
+
children: /* @__PURE__ */ J(gn, {})
|
|
3466
3466
|
})
|
|
3467
|
-
}), /* @__PURE__ */
|
|
3467
|
+
}), /* @__PURE__ */ Y(Le, {
|
|
3468
3468
|
className: "flex size-max flex-col gap-2 p-2",
|
|
3469
3469
|
onCloseAutoFocus: c,
|
|
3470
|
-
children: [/* @__PURE__ */
|
|
3470
|
+
children: [/* @__PURE__ */ J(nt, {
|
|
3471
3471
|
value: r,
|
|
3472
3472
|
label: t("material.editor.upload.alt-label", "Describe the image"),
|
|
3473
3473
|
onChange: (e) => i(e.target.value)
|
|
3474
|
-
}), /* @__PURE__ */
|
|
3474
|
+
}), /* @__PURE__ */ J(j, {
|
|
3475
3475
|
variant: "tonal",
|
|
3476
3476
|
onClick: () => {
|
|
3477
3477
|
e.chain().focus().updateAttributes("image", { alt: r }).run(), o(!1);
|
|
@@ -3630,7 +3630,7 @@ function vs(e, t) {
|
|
|
3630
3630
|
}
|
|
3631
3631
|
//#endregion
|
|
3632
3632
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-plugin.ts
|
|
3633
|
-
var $ = new
|
|
3633
|
+
var $ = new B("upload");
|
|
3634
3634
|
function ys(e, t) {
|
|
3635
3635
|
let n = e.doc.resolve(Math.min(t ?? e.selection.to, e.doc.content.size)), r = n.parent;
|
|
3636
3636
|
return !r.isTextblock || n.depth === 0 ? {
|
|
@@ -3695,7 +3695,7 @@ function Ds(e, { accept: t = "image/*", maxSize: n }) {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
var Os = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ks = (e) => e.type ? e.type.startsWith("image/") : Os.test(e.name);
|
|
3697
3697
|
function As(e) {
|
|
3698
|
-
let t =
|
|
3698
|
+
let t = pt(e);
|
|
3699
3699
|
return t !== void 0 && !/^(mailto|tel):/i.test(t);
|
|
3700
3700
|
}
|
|
3701
3701
|
function js(e) {
|
|
@@ -3773,35 +3773,35 @@ function Ls({ accept: e, multiple: t, label: n }, r) {
|
|
|
3773
3773
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-actions.tsx
|
|
3774
3774
|
function Rs({ id: e, name: t, failed: n, retryable: r, storage: i }) {
|
|
3775
3775
|
let { t: a } = M(), o = n ? a("material.editor.upload.remove", "Remove {name}", { name: t }) : a("material.editor.upload.cancel", "Cancel upload of {name}", { name: t });
|
|
3776
|
-
return /* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ Y("div", {
|
|
3777
3777
|
className: "ms-auto flex shrink-0 items-center gap-1",
|
|
3778
|
-
children: [n && r && /* @__PURE__ */
|
|
3778
|
+
children: [n && r && /* @__PURE__ */ Y(j, {
|
|
3779
3779
|
variant: "tonal",
|
|
3780
3780
|
size: "sm",
|
|
3781
3781
|
onClick: () => i.retry(e),
|
|
3782
|
-
children: [/* @__PURE__ */
|
|
3783
|
-
}), /* @__PURE__ */
|
|
3782
|
+
children: [/* @__PURE__ */ J(ln, {}), a("material.editor.upload.retry", "Retry")]
|
|
3783
|
+
}), /* @__PURE__ */ J(N, {
|
|
3784
3784
|
variant: "ghost",
|
|
3785
3785
|
tooltip: o,
|
|
3786
3786
|
"aria-label": o,
|
|
3787
3787
|
onClick: () => i.cancel(e),
|
|
3788
|
-
children:
|
|
3788
|
+
children: J(n ? vn : xn, {})
|
|
3789
3789
|
})]
|
|
3790
3790
|
});
|
|
3791
3791
|
}
|
|
3792
3792
|
//#endregion
|
|
3793
3793
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-thumb.tsx
|
|
3794
3794
|
function zs({ previewUrl: e, busy: n }) {
|
|
3795
|
-
return /* @__PURE__ */
|
|
3795
|
+
return /* @__PURE__ */ Y("div", {
|
|
3796
3796
|
className: "relative grid size-12 shrink-0 place-items-center overflow-hidden rounded-md bg-muted text-muted-foreground",
|
|
3797
|
-
children: [e ? /* @__PURE__ */
|
|
3797
|
+
children: [e ? /* @__PURE__ */ J("img", {
|
|
3798
3798
|
src: e,
|
|
3799
3799
|
alt: "",
|
|
3800
3800
|
className: t("size-full object-cover", n && "opacity-50")
|
|
3801
|
-
}) : /* @__PURE__ */
|
|
3801
|
+
}) : /* @__PURE__ */ J(Wt, {
|
|
3802
3802
|
"aria-hidden": "true",
|
|
3803
3803
|
className: "size-5"
|
|
3804
|
-
}), n && /* @__PURE__ */
|
|
3804
|
+
}), n && /* @__PURE__ */ J(Te, {
|
|
3805
3805
|
"aria-hidden": "true",
|
|
3806
3806
|
"aria-label": void 0,
|
|
3807
3807
|
contained: !0,
|
|
@@ -3820,10 +3820,10 @@ function Bs(e, t, n) {
|
|
|
3820
3820
|
}
|
|
3821
3821
|
}
|
|
3822
3822
|
function Vs({ id: e, storage: n, maxSize: r }) {
|
|
3823
|
-
let { t: i } = M(), { queue: a } = n, o =
|
|
3823
|
+
let { t: i } = M(), { queue: a } = n, o = At(a.subscribe, () => a.get(e), () => void 0);
|
|
3824
3824
|
if (!o) return null;
|
|
3825
3825
|
let s = o.file.name, c = o.status === "error";
|
|
3826
|
-
return /* @__PURE__ */
|
|
3826
|
+
return /* @__PURE__ */ Y("div", {
|
|
3827
3827
|
"data-slot": "editor-upload",
|
|
3828
3828
|
"data-upload-id": e,
|
|
3829
3829
|
"data-status": o.status,
|
|
@@ -3832,26 +3832,26 @@ function Vs({ id: e, storage: n, maxSize: r }) {
|
|
|
3832
3832
|
contentEditable: !1,
|
|
3833
3833
|
className: t("not-prose my-3 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border bg-card p-2.5 text-card-foreground shadow-xs", c && "border-error/60 bg-error/5"),
|
|
3834
3834
|
children: [
|
|
3835
|
-
/* @__PURE__ */
|
|
3835
|
+
/* @__PURE__ */ J(zs, {
|
|
3836
3836
|
previewUrl: o.previewUrl,
|
|
3837
3837
|
busy: !c
|
|
3838
3838
|
}),
|
|
3839
|
-
/* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ Y("div", {
|
|
3840
3840
|
className: "min-w-32 flex-1 basis-32",
|
|
3841
|
-
children: [/* @__PURE__ */
|
|
3841
|
+
children: [/* @__PURE__ */ J("div", {
|
|
3842
3842
|
className: "truncate text-sm font-medium",
|
|
3843
3843
|
children: s
|
|
3844
|
-
}), c ? /* @__PURE__ */
|
|
3844
|
+
}), c ? /* @__PURE__ */ J("div", {
|
|
3845
3845
|
role: "alert",
|
|
3846
3846
|
className: "text-xs text-error-text",
|
|
3847
3847
|
children: Bs(i, o.failure, r)
|
|
3848
|
-
}) : /* @__PURE__ */
|
|
3848
|
+
}) : /* @__PURE__ */ J(Se, {
|
|
3849
3849
|
value: o.progress === void 0 ? null : o.progress * 100,
|
|
3850
3850
|
"aria-label": i("material.editor.upload.uploading", "Uploading {name}", { name: s }),
|
|
3851
3851
|
className: "mt-1.5"
|
|
3852
3852
|
})]
|
|
3853
3853
|
}),
|
|
3854
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ J(Rs, {
|
|
3855
3855
|
id: e,
|
|
3856
3856
|
name: s,
|
|
3857
3857
|
failed: c,
|
|
@@ -3939,7 +3939,7 @@ function Js(e, t, n, r) {
|
|
|
3939
3939
|
var Ys = class {
|
|
3940
3940
|
options;
|
|
3941
3941
|
entries = /* @__PURE__ */ new Map();
|
|
3942
|
-
listeners =
|
|
3942
|
+
listeners = ft();
|
|
3943
3943
|
counter = 0;
|
|
3944
3944
|
preview;
|
|
3945
3945
|
limit;
|
|
@@ -4106,9 +4106,9 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4106
4106
|
}
|
|
4107
4107
|
}), ec = (e = {}) => {
|
|
4108
4108
|
let { onUpload: t, ...n } = e;
|
|
4109
|
-
return
|
|
4109
|
+
return V(t ? {
|
|
4110
4110
|
name: "upload",
|
|
4111
|
-
extensions: (e) => [...e.has("image") ? [] : [
|
|
4111
|
+
extensions: (e) => [...e.has("image") ? [] : [mt], $s.configure({
|
|
4112
4112
|
...n,
|
|
4113
4113
|
onUpload: t,
|
|
4114
4114
|
translate: e.translate,
|
|
@@ -4120,7 +4120,7 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4120
4120
|
priority: 30,
|
|
4121
4121
|
kind: "panel",
|
|
4122
4122
|
when: (e) => !!f(e)?.ownsImage,
|
|
4123
|
-
render:
|
|
4123
|
+
render: re
|
|
4124
4124
|
}],
|
|
4125
4125
|
bubble: [{
|
|
4126
4126
|
id: "image-alt",
|
|
@@ -4138,11 +4138,11 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4138
4138
|
markdown: "native"
|
|
4139
4139
|
});
|
|
4140
4140
|
}, tc = {
|
|
4141
|
-
accordion:
|
|
4142
|
-
actionCard:
|
|
4141
|
+
accordion: ne,
|
|
4142
|
+
actionCard: a,
|
|
4143
4143
|
assistant: fo,
|
|
4144
4144
|
blocks: Fe,
|
|
4145
|
-
callout:
|
|
4145
|
+
callout: w,
|
|
4146
4146
|
checkboxGroup: v,
|
|
4147
4147
|
codeBlock: g,
|
|
4148
4148
|
color: ye,
|
|
@@ -4155,50 +4155,50 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4155
4155
|
fontFamily: Ae,
|
|
4156
4156
|
gallery: pe,
|
|
4157
4157
|
headings: n,
|
|
4158
|
-
highlight:
|
|
4159
|
-
image:
|
|
4158
|
+
highlight: ee,
|
|
4159
|
+
image: ie,
|
|
4160
4160
|
inlineCode: Wo,
|
|
4161
4161
|
link: d,
|
|
4162
4162
|
lists: Ee,
|
|
4163
4163
|
markdownPaste: qo,
|
|
4164
|
-
marks:
|
|
4164
|
+
marks: D,
|
|
4165
4165
|
mention: Pe,
|
|
4166
4166
|
outline: Yo,
|
|
4167
|
-
placeholder:
|
|
4167
|
+
placeholder: C,
|
|
4168
4168
|
radioGroup: _,
|
|
4169
4169
|
selectCard: h,
|
|
4170
4170
|
selectChip: _e,
|
|
4171
|
-
slash:
|
|
4171
|
+
slash: i,
|
|
4172
4172
|
table: ve,
|
|
4173
4173
|
textAlign: y,
|
|
4174
4174
|
upload: ec,
|
|
4175
|
-
youtube:
|
|
4175
|
+
youtube: s
|
|
4176
4176
|
}, nc = (...e) => (t) => [...t, ...e], rc = (...e) => (t) => t.filter((t) => !e.includes(t.key ?? t.name)), ic = () => [
|
|
4177
|
-
|
|
4177
|
+
a(),
|
|
4178
4178
|
_e(),
|
|
4179
4179
|
h(),
|
|
4180
4180
|
v(),
|
|
4181
4181
|
_()
|
|
4182
4182
|
], ac = () => [
|
|
4183
|
-
|
|
4184
|
-
|
|
4183
|
+
w(),
|
|
4184
|
+
ne(),
|
|
4185
4185
|
pe(),
|
|
4186
|
-
|
|
4186
|
+
i(),
|
|
4187
4187
|
ye(),
|
|
4188
4188
|
Ae(),
|
|
4189
|
-
|
|
4189
|
+
D(),
|
|
4190
4190
|
n(),
|
|
4191
4191
|
Fe(),
|
|
4192
4192
|
d(),
|
|
4193
|
-
|
|
4193
|
+
ee(),
|
|
4194
4194
|
y(),
|
|
4195
|
-
|
|
4195
|
+
C(),
|
|
4196
4196
|
b(),
|
|
4197
4197
|
qo(),
|
|
4198
4198
|
Ee(),
|
|
4199
|
-
|
|
4199
|
+
ie(),
|
|
4200
4200
|
ec(),
|
|
4201
|
-
|
|
4201
|
+
s(),
|
|
4202
4202
|
de({ suggest: !0 }),
|
|
4203
4203
|
ve(),
|
|
4204
4204
|
g(),
|
|
@@ -4207,19 +4207,19 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4207
4207
|
Po(),
|
|
4208
4208
|
Mo()
|
|
4209
4209
|
], oc = () => [
|
|
4210
|
-
|
|
4210
|
+
D({ compact: !0 }),
|
|
4211
4211
|
Wo(),
|
|
4212
4212
|
d(),
|
|
4213
|
-
|
|
4213
|
+
C(),
|
|
4214
4214
|
b(),
|
|
4215
4215
|
qo(),
|
|
4216
4216
|
Ee(),
|
|
4217
4217
|
ec()
|
|
4218
4218
|
], sc = () => [
|
|
4219
|
-
|
|
4219
|
+
D({ compact: !0 }),
|
|
4220
4220
|
Wo(),
|
|
4221
4221
|
d(),
|
|
4222
|
-
|
|
4222
|
+
C(),
|
|
4223
4223
|
b(),
|
|
4224
4224
|
de({ suggest: !0 }),
|
|
4225
4225
|
Pe()
|
|
@@ -4227,12 +4227,12 @@ var Qs = /* @__PURE__ */ new WeakMap(), $s = R.create({
|
|
|
4227
4227
|
//#endregion
|
|
4228
4228
|
//#region lib/components/ui/widgets/editor/extensions/assistant/use-assistant-feature.ts
|
|
4229
4229
|
function cc(e, t) {
|
|
4230
|
-
let n =
|
|
4231
|
-
|
|
4230
|
+
let n = G(e);
|
|
4231
|
+
U(() => {
|
|
4232
4232
|
n.current = e;
|
|
4233
4233
|
}, [e]);
|
|
4234
|
-
let r =
|
|
4235
|
-
return
|
|
4234
|
+
let r = H((e, t) => n.current(e, t), []), i = !!e;
|
|
4235
|
+
return W(() => i ? fo({
|
|
4236
4236
|
...t,
|
|
4237
4237
|
onAssist: r
|
|
4238
4238
|
}) : void 0, [i, r]);
|
|
@@ -4240,24 +4240,24 @@ function cc(e, t) {
|
|
|
4240
4240
|
//#endregion
|
|
4241
4241
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-signal.tsx
|
|
4242
4242
|
function lc({ onChange: e }) {
|
|
4243
|
-
let { handle: t } = O(), n = La(t).pending > 0, r =
|
|
4244
|
-
return
|
|
4243
|
+
let { handle: t } = O(), n = La(t).pending > 0, r = G(e), i = G(!1);
|
|
4244
|
+
return U(() => {
|
|
4245
4245
|
r.current = e;
|
|
4246
|
-
}, [e]),
|
|
4246
|
+
}, [e]), U(() => {
|
|
4247
4247
|
n !== i.current && (i.current = n, r.current?.(n));
|
|
4248
|
-
}, [n]),
|
|
4248
|
+
}, [n]), U(() => () => {
|
|
4249
4249
|
i.current && r.current?.(!1);
|
|
4250
4250
|
}, []), null;
|
|
4251
4251
|
}
|
|
4252
4252
|
//#endregion
|
|
4253
4253
|
//#region lib/components/ui/widgets/editor/extensions/upload/use-upload-feature.ts
|
|
4254
4254
|
function uc(e, t) {
|
|
4255
|
-
let n =
|
|
4256
|
-
|
|
4255
|
+
let n = G(e);
|
|
4256
|
+
U(() => {
|
|
4257
4257
|
n.current = e;
|
|
4258
4258
|
}, [e]);
|
|
4259
|
-
let r =
|
|
4260
|
-
return
|
|
4259
|
+
let r = H((e, t) => n.current(e, t), []), i = !!e;
|
|
4260
|
+
return W(() => i ? ec({
|
|
4261
4261
|
...t,
|
|
4262
4262
|
onUpload: r
|
|
4263
4263
|
}) : void 0, [i, r]);
|
|
@@ -4284,15 +4284,15 @@ function fc({ className: e }) {
|
|
|
4284
4284
|
return t ? dc(e?.storage.characterCount?.characters?.() ?? 0, t) : null;
|
|
4285
4285
|
}
|
|
4286
4286
|
});
|
|
4287
|
-
return i ? /* @__PURE__ */
|
|
4287
|
+
return i ? /* @__PURE__ */ Y("span", {
|
|
4288
4288
|
"data-slot": "editor-character-count",
|
|
4289
4289
|
"data-near": i.near || void 0,
|
|
4290
4290
|
role: i.near ? "status" : void 0,
|
|
4291
4291
|
className: t("text-xs tabular-nums", i.near ? "text-error-text" : "text-muted-foreground", e),
|
|
4292
|
-
children: [/* @__PURE__ */
|
|
4292
|
+
children: [/* @__PURE__ */ J("span", {
|
|
4293
4293
|
"aria-hidden": "true",
|
|
4294
4294
|
children: `${i.characters} / ${i.limit}`
|
|
4295
|
-
}), /* @__PURE__ */
|
|
4295
|
+
}), /* @__PURE__ */ J("span", {
|
|
4296
4296
|
className: "sr-only",
|
|
4297
4297
|
children: n("material.editor.count", "{characters} of {limit} characters", {
|
|
4298
4298
|
characters: i.characters,
|
|
@@ -4304,8 +4304,8 @@ function fc({ className: e }) {
|
|
|
4304
4304
|
//#endregion
|
|
4305
4305
|
//#region lib/components/ui/widgets/editor/partials/use-room-for.ts
|
|
4306
4306
|
function pc(e, t) {
|
|
4307
|
-
let [n, r] =
|
|
4308
|
-
return
|
|
4307
|
+
let [n, r] = K(!1);
|
|
4308
|
+
return U(() => {
|
|
4309
4309
|
let n = e.current;
|
|
4310
4310
|
if (!n) return;
|
|
4311
4311
|
if (typeof ResizeObserver > "u") {
|
|
@@ -4323,12 +4323,12 @@ function pc(e, t) {
|
|
|
4323
4323
|
//#region lib/components/ui/widgets/editor/presets/document-editor-frame-parts.tsx
|
|
4324
4324
|
function mc({ side: e, children: n }) {
|
|
4325
4325
|
let { t: r } = M();
|
|
4326
|
-
return /* @__PURE__ */
|
|
4326
|
+
return /* @__PURE__ */ J("aside", {
|
|
4327
4327
|
"aria-label": r("material.editor.outline-region", "Document outline"),
|
|
4328
4328
|
"data-slot": "document-editor-rail",
|
|
4329
4329
|
"data-side": e,
|
|
4330
4330
|
className: t("hidden w-56 shrink-0 @4xl:block", e === "start" ? "border-e" : "border-s"),
|
|
4331
|
-
children: /* @__PURE__ */
|
|
4331
|
+
children: /* @__PURE__ */ J("div", {
|
|
4332
4332
|
className: "sticky top-16 max-h-[calc(100svh-5rem)] overflow-y-auto p-3",
|
|
4333
4333
|
children: n
|
|
4334
4334
|
})
|
|
@@ -4338,11 +4338,11 @@ function hc(e, n, r) {
|
|
|
4338
4338
|
return t("@container relative overflow-clip border bg-card text-card-foreground shadow-xs", e === "expressive" ? "rounded-(--nxgt-shape-corner-xl)" : "rounded-[20px]", "transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast motion-reduce:transition-none focus-within:border-primary/60 dark:focus-within:border-primary-indicator", n && "flex flex-col", r);
|
|
4339
4339
|
}
|
|
4340
4340
|
function gc({ presence: e, panels: t, children: n }) {
|
|
4341
|
-
return /* @__PURE__ */
|
|
4341
|
+
return /* @__PURE__ */ Y("div", {
|
|
4342
4342
|
"data-slot": "document-editor-toolbar",
|
|
4343
4343
|
className: "sticky top-0 z-10 grid gap-2 border-b bg-card/95 px-3 py-2 backdrop-blur empty:hidden",
|
|
4344
4344
|
children: [
|
|
4345
|
-
e && /* @__PURE__ */
|
|
4345
|
+
e && /* @__PURE__ */ J("div", {
|
|
4346
4346
|
className: "flex justify-end empty:hidden",
|
|
4347
4347
|
children: e
|
|
4348
4348
|
}),
|
|
@@ -4353,7 +4353,7 @@ function gc({ presence: e, panels: t, children: n }) {
|
|
|
4353
4353
|
}
|
|
4354
4354
|
function _c({ children: e }) {
|
|
4355
4355
|
let { t } = M();
|
|
4356
|
-
return /* @__PURE__ */
|
|
4356
|
+
return /* @__PURE__ */ J("aside", {
|
|
4357
4357
|
"aria-label": t("material.editor.comments.title", "Comments"),
|
|
4358
4358
|
"data-slot": "document-editor-comments",
|
|
4359
4359
|
className: "w-72 shrink-0 border-s bg-muted/20 p-3",
|
|
@@ -4364,43 +4364,43 @@ function _c({ children: e }) {
|
|
|
4364
4364
|
//#region lib/components/ui/widgets/editor/presets/toolbar-looks.ts
|
|
4365
4365
|
var vc = 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]"), yc = 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)"), bc = 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", vc, yc), xc = t("items-center gap-1 **:data-group-id:gap-1", "[--tb-item:2.25rem] [&_button[data-variant]]:rounded-full [&_[data-toolbar-more]]:rounded-full", vc, yc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), Sc = t(bc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), Cc = t(bc, "**:data-[group=outline]:@4xl:hidden", "**:data-[group=comments]:@5xl:hidden"), wc = 56;
|
|
4366
4366
|
function Tc({ toolbar: e, bar: n, panels: r, footer: i, outline: a, comments: o, presence: s, outlineSide: c = "start", className: l, children: u }) {
|
|
4367
|
-
let { chrome: d, handle: f, look: p } = O(), m = f.features.some((e) => e.key === "dragHandle"), h = d.state.focusMode, g =
|
|
4368
|
-
return /* @__PURE__ */
|
|
4367
|
+
let { chrome: d, handle: f, look: p } = O(), m = f.features.some((e) => e.key === "dragHandle"), h = d.state.focusMode, g = G(null), _ = pc(g, wc), v = a && !h && _, y = pc(g, 64), b = o && !h && y;
|
|
4368
|
+
return /* @__PURE__ */ Y("div", {
|
|
4369
4369
|
ref: g,
|
|
4370
4370
|
"data-slot": "document-editor",
|
|
4371
4371
|
"data-look": p,
|
|
4372
4372
|
"data-layout": "docked",
|
|
4373
4373
|
className: hc(p, !!n, l),
|
|
4374
4374
|
children: [
|
|
4375
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ J(gc, {
|
|
4376
4376
|
presence: s,
|
|
4377
4377
|
panels: r,
|
|
4378
4378
|
children: !h && e
|
|
4379
4379
|
}),
|
|
4380
|
-
/* @__PURE__ */
|
|
4380
|
+
/* @__PURE__ */ J(va, { className: "absolute end-3 top-3 z-20" }),
|
|
4381
4381
|
!h && n,
|
|
4382
|
-
/* @__PURE__ */
|
|
4382
|
+
/* @__PURE__ */ Y("div", {
|
|
4383
4383
|
className: "flex",
|
|
4384
4384
|
children: [
|
|
4385
|
-
v && c === "start" && /* @__PURE__ */
|
|
4385
|
+
v && c === "start" && /* @__PURE__ */ J(mc, {
|
|
4386
4386
|
side: "start",
|
|
4387
4387
|
children: a
|
|
4388
4388
|
}),
|
|
4389
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ J("div", {
|
|
4390
4390
|
className: t("min-w-0 flex-1 px-5 py-6 @xl:px-10 @xl:py-10", m && "@xl:pointer-fine:ps-16"),
|
|
4391
|
-
children: /* @__PURE__ */
|
|
4391
|
+
children: /* @__PURE__ */ J("div", {
|
|
4392
4392
|
className: "mx-auto w-full max-w-[680px]",
|
|
4393
4393
|
children: u
|
|
4394
4394
|
})
|
|
4395
4395
|
}),
|
|
4396
|
-
v && c === "end" && /* @__PURE__ */
|
|
4396
|
+
v && c === "end" && /* @__PURE__ */ J(mc, {
|
|
4397
4397
|
side: "end",
|
|
4398
4398
|
children: a
|
|
4399
4399
|
}),
|
|
4400
|
-
b && /* @__PURE__ */
|
|
4400
|
+
b && /* @__PURE__ */ J(_c, { children: o })
|
|
4401
4401
|
]
|
|
4402
4402
|
}),
|
|
4403
|
-
i && /* @__PURE__ */
|
|
4403
|
+
i && /* @__PURE__ */ J("div", {
|
|
4404
4404
|
className: t("border-t px-4 py-2.5 sm:px-6", n && "order-3"),
|
|
4405
4405
|
children: i
|
|
4406
4406
|
})
|
|
@@ -4431,11 +4431,11 @@ function Fc(e) {
|
|
|
4431
4431
|
//#endregion
|
|
4432
4432
|
//#region lib/components/ui/widgets/editor/presets/compact-editor-parts.tsx
|
|
4433
4433
|
function Ic({ look: e }) {
|
|
4434
|
-
return /* @__PURE__ */
|
|
4434
|
+
return /* @__PURE__ */ J("div", {
|
|
4435
4435
|
"data-slot": "compact-editor-toolbar",
|
|
4436
4436
|
"data-look": e,
|
|
4437
4437
|
className: Fc(e),
|
|
4438
|
-
children: /* @__PURE__ */
|
|
4438
|
+
children: /* @__PURE__ */ J(T, {
|
|
4439
4439
|
dividers: !1,
|
|
4440
4440
|
density: "compact",
|
|
4441
4441
|
className: Mc(e, Cc)
|
|
@@ -4443,10 +4443,10 @@ function Ic({ look: e }) {
|
|
|
4443
4443
|
});
|
|
4444
4444
|
}
|
|
4445
4445
|
function Lc({ actions: e }) {
|
|
4446
|
-
return /* @__PURE__ */
|
|
4446
|
+
return /* @__PURE__ */ Y("div", {
|
|
4447
4447
|
"data-slot": "compact-editor-footer",
|
|
4448
4448
|
className: "flex flex-wrap items-center gap-x-3 gap-y-2 border-t px-3 py-2",
|
|
4449
|
-
children: [/* @__PURE__ */
|
|
4449
|
+
children: [/* @__PURE__ */ J(fc, {}), e && /* @__PURE__ */ J("div", {
|
|
4450
4450
|
"data-slot": "editor-actions",
|
|
4451
4451
|
className: "ms-auto flex items-center gap-2",
|
|
4452
4452
|
children: e
|
|
@@ -4510,58 +4510,58 @@ function Wc(e = 2, t = 8) {
|
|
|
4510
4510
|
}
|
|
4511
4511
|
//#endregion
|
|
4512
4512
|
//#region lib/components/ui/widgets/editor/presets/compact-editor.tsx
|
|
4513
|
-
function Gc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look:
|
|
4514
|
-
let { t: x } = M(),
|
|
4515
|
-
return /* @__PURE__ */
|
|
4513
|
+
function Gc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look: a = "expressive", actions: s, onUpload: l, uploadOptions: u, onUploadingChange: d, onAssist: f, assistOptions: p, label: m, helperText: h, error: g, required: _, className: v, attributes: y, ...b }) {
|
|
4514
|
+
let { t: x } = M(), ee = W(oc, []), S = uc(l, u), C = cc(f, p), w = !!s || !!b.characterLimit;
|
|
4515
|
+
return /* @__PURE__ */ Y(Oe, {
|
|
4516
4516
|
...b,
|
|
4517
|
-
look:
|
|
4517
|
+
look: a,
|
|
4518
4518
|
features: Rc({
|
|
4519
4519
|
features: e,
|
|
4520
4520
|
mentions: b.mentions,
|
|
4521
|
-
extra: [
|
|
4521
|
+
extra: [S, C]
|
|
4522
4522
|
}),
|
|
4523
|
-
defaults:
|
|
4523
|
+
defaults: ee,
|
|
4524
4524
|
attributes: {
|
|
4525
4525
|
class: t("nxgt-prose text-[0.9375rem] leading-relaxed focus:outline-none", Wc(n, r)),
|
|
4526
4526
|
"aria-label": x("material.editor.comment", "Comment"),
|
|
4527
4527
|
...y
|
|
4528
4528
|
},
|
|
4529
4529
|
children: [
|
|
4530
|
-
/* @__PURE__ */
|
|
4530
|
+
/* @__PURE__ */ J(Me, {
|
|
4531
4531
|
label: m,
|
|
4532
4532
|
helperText: h,
|
|
4533
4533
|
error: g,
|
|
4534
4534
|
required: _,
|
|
4535
4535
|
className: v,
|
|
4536
|
-
children: /* @__PURE__ */
|
|
4536
|
+
children: /* @__PURE__ */ Y("div", {
|
|
4537
4537
|
"data-slot": "compact-editor",
|
|
4538
4538
|
"data-invalid": g || void 0,
|
|
4539
|
-
"data-look":
|
|
4540
|
-
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", Pc(
|
|
4539
|
+
"data-look": a,
|
|
4540
|
+
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", Pc(a, g)),
|
|
4541
4541
|
children: [
|
|
4542
|
-
i && /* @__PURE__ */
|
|
4543
|
-
/* @__PURE__ */
|
|
4544
|
-
|
|
4542
|
+
i && /* @__PURE__ */ J(Ic, { look: a }),
|
|
4543
|
+
/* @__PURE__ */ J(E, { className: "px-3 py-2.5" }),
|
|
4544
|
+
w && /* @__PURE__ */ J(Lc, { actions: s })
|
|
4545
4545
|
]
|
|
4546
4546
|
})
|
|
4547
4547
|
}),
|
|
4548
|
-
l && /* @__PURE__ */
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4551
|
-
/* @__PURE__ */
|
|
4548
|
+
l && /* @__PURE__ */ J(lc, { onChange: d }),
|
|
4549
|
+
/* @__PURE__ */ J(c, {}),
|
|
4550
|
+
/* @__PURE__ */ J(o, {}),
|
|
4551
|
+
/* @__PURE__ */ J(or, {})
|
|
4552
4552
|
]
|
|
4553
4553
|
});
|
|
4554
4554
|
}
|
|
4555
4555
|
//#endregion
|
|
4556
4556
|
//#region lib/components/ui/widgets/editor/presets/compact-editor-form-field.tsx
|
|
4557
4557
|
function Kc({ control: e, name: n, ...r }) {
|
|
4558
|
-
return /* @__PURE__ */
|
|
4558
|
+
return /* @__PURE__ */ J(Xe, {
|
|
4559
4559
|
control: e,
|
|
4560
4560
|
name: n,
|
|
4561
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */
|
|
4561
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ J(Ze, {
|
|
4562
4562
|
onBlur: e.onBlur,
|
|
4563
4563
|
focusRef: e.ref,
|
|
4564
|
-
children: /* @__PURE__ */
|
|
4564
|
+
children: /* @__PURE__ */ J(Gc, {
|
|
4565
4565
|
...r,
|
|
4566
4566
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
4567
4567
|
value: e.value ?? we(r.format ?? "html"),
|
|
@@ -4577,7 +4577,7 @@ function Kc({ control: e, name: n, ...r }) {
|
|
|
4577
4577
|
//#region lib/components/ui/widgets/editor/partials/page-mode-switch.tsx
|
|
4578
4578
|
function qc({ value: e, onChange: t }) {
|
|
4579
4579
|
let { t: n } = M();
|
|
4580
|
-
return /* @__PURE__ */
|
|
4580
|
+
return /* @__PURE__ */ Y(et, {
|
|
4581
4581
|
type: "single",
|
|
4582
4582
|
variant: "segmented",
|
|
4583
4583
|
size: "sm",
|
|
@@ -4586,15 +4586,15 @@ function qc({ value: e, onChange: t }) {
|
|
|
4586
4586
|
"aria-label": n("material.editor.page.mode", "View"),
|
|
4587
4587
|
"data-slot": "editor-page-mode",
|
|
4588
4588
|
children: [
|
|
4589
|
-
/* @__PURE__ */
|
|
4589
|
+
/* @__PURE__ */ J($e, {
|
|
4590
4590
|
value: "write",
|
|
4591
4591
|
children: n("material.editor.page.write", "Write")
|
|
4592
4592
|
}),
|
|
4593
|
-
/* @__PURE__ */
|
|
4593
|
+
/* @__PURE__ */ J($e, {
|
|
4594
4594
|
value: "preview",
|
|
4595
4595
|
children: n("material.editor.page.preview", "Preview")
|
|
4596
4596
|
}),
|
|
4597
|
-
/* @__PURE__ */
|
|
4597
|
+
/* @__PURE__ */ J($e, {
|
|
4598
4598
|
value: "markdown",
|
|
4599
4599
|
children: n("material.editor.page.markdown", "Markdown")
|
|
4600
4600
|
})
|
|
@@ -4603,21 +4603,21 @@ function qc({ value: e, onChange: t }) {
|
|
|
4603
4603
|
}
|
|
4604
4604
|
//#endregion
|
|
4605
4605
|
//#region lib/components/ui/widgets/editor/partials/page-mode-views.tsx
|
|
4606
|
-
var Jc =
|
|
4606
|
+
var Jc = Dt(() => import("./rich-text-viewer-CXJp584B.js").then((e) => e.n).then((e) => ({ default: e.RichTextViewer })));
|
|
4607
4607
|
function Yc() {
|
|
4608
4608
|
let { handle: e } = O(), { editor: t } = e, n = P({
|
|
4609
4609
|
editor: t,
|
|
4610
4610
|
selector: (e) => e.editor?.state.doc ?? null,
|
|
4611
4611
|
equalityFn: (e, t) => e === t
|
|
4612
4612
|
});
|
|
4613
|
-
return
|
|
4613
|
+
return W(() => !n || !t || e.isEmpty ? null : n.toJSON(), [
|
|
4614
4614
|
n,
|
|
4615
4615
|
t,
|
|
4616
4616
|
e.isEmpty
|
|
4617
4617
|
]);
|
|
4618
4618
|
}
|
|
4619
4619
|
function Xc({ children: e }) {
|
|
4620
|
-
return /* @__PURE__ */
|
|
4620
|
+
return /* @__PURE__ */ J("p", {
|
|
4621
4621
|
"data-slot": "editor-page-empty",
|
|
4622
4622
|
className: "text-muted-foreground text-sm",
|
|
4623
4623
|
children: e
|
|
@@ -4625,19 +4625,19 @@ function Xc({ children: e }) {
|
|
|
4625
4625
|
}
|
|
4626
4626
|
function Zc({ json: e, components: t }) {
|
|
4627
4627
|
let { t: n } = M(), { look: r } = O(), i = n("material.editor.page.empty", "Nothing to show yet.");
|
|
4628
|
-
return e ? /* @__PURE__ */
|
|
4629
|
-
fallback: /* @__PURE__ */
|
|
4630
|
-
children: /* @__PURE__ */
|
|
4628
|
+
return e ? /* @__PURE__ */ J(Et, {
|
|
4629
|
+
fallback: /* @__PURE__ */ J(Xc, { children: n("material.editor.page.loading", "Loading…") }),
|
|
4630
|
+
children: /* @__PURE__ */ J(Jc, {
|
|
4631
4631
|
value: e,
|
|
4632
4632
|
format: "json",
|
|
4633
4633
|
components: t,
|
|
4634
4634
|
look: r
|
|
4635
4635
|
})
|
|
4636
|
-
}) : /* @__PURE__ */
|
|
4636
|
+
}) : /* @__PURE__ */ J(Xc, { children: i });
|
|
4637
4637
|
}
|
|
4638
4638
|
function Qc({ json: e }) {
|
|
4639
|
-
let { t } = M(), { handle: n } = O(), [r, i] =
|
|
4640
|
-
return
|
|
4639
|
+
let { t } = M(), { handle: n } = O(), [r, i] = K(null), a = n.editor?.extensionManager.extensions;
|
|
4640
|
+
return U(() => {
|
|
4641
4641
|
let t = !0;
|
|
4642
4642
|
if (!e) {
|
|
4643
4643
|
i("");
|
|
@@ -4646,19 +4646,19 @@ function Qc({ json: e }) {
|
|
|
4646
4646
|
return import("./convert-7g-F5cNf.js").then((e) => e.t).then((t) => t.toMarkdown(e, { extensions: a })).then((e) => t && i(e)).catch(() => t && i("")), () => {
|
|
4647
4647
|
t = !1;
|
|
4648
4648
|
};
|
|
4649
|
-
}, [e, a]), r === null ? /* @__PURE__ */
|
|
4649
|
+
}, [e, a]), r === null ? /* @__PURE__ */ J(Xc, { children: t("material.editor.page.loading", "Loading…") }) : r.trim() ? /* @__PURE__ */ J("pre", {
|
|
4650
4650
|
"data-slot": "editor-page-markdown",
|
|
4651
4651
|
tabIndex: 0,
|
|
4652
4652
|
className: "m-0 overflow-x-auto whitespace-pre-wrap break-words font-mono text-sm leading-relaxed",
|
|
4653
|
-
children: /* @__PURE__ */
|
|
4654
|
-
}) : /* @__PURE__ */
|
|
4653
|
+
children: /* @__PURE__ */ J("code", { children: r })
|
|
4654
|
+
}) : /* @__PURE__ */ J(Xc, { children: t("material.editor.page.empty", "Nothing to show yet.") });
|
|
4655
4655
|
}
|
|
4656
4656
|
function $c({ mode: e, components: t }) {
|
|
4657
4657
|
let n = Yc();
|
|
4658
|
-
return e === "preview" ? /* @__PURE__ */
|
|
4658
|
+
return e === "preview" ? /* @__PURE__ */ J(Zc, {
|
|
4659
4659
|
json: n,
|
|
4660
4660
|
components: t
|
|
4661
|
-
}) : /* @__PURE__ */
|
|
4661
|
+
}) : /* @__PURE__ */ J(Qc, { json: n });
|
|
4662
4662
|
}
|
|
4663
4663
|
//#endregion
|
|
4664
4664
|
//#region lib/components/ui/widgets/editor/presets/page-classes.ts
|
|
@@ -4671,13 +4671,13 @@ function tl(e, n) {
|
|
|
4671
4671
|
//#endregion
|
|
4672
4672
|
//#region lib/components/ui/widgets/editor/presets/document-editor-page-parts.tsx
|
|
4673
4673
|
function nl({ mode: e, onModeChange: t, showSwitch: n, presence: r, panels: i, children: a }) {
|
|
4674
|
-
return /* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ Y("div", {
|
|
4675
4675
|
"data-slot": "document-editor-toolbar",
|
|
4676
4676
|
className: "sticky top-0 z-10 grid gap-2 bg-(--page-tint)/85 px-2 py-2 backdrop-blur @2xl:px-6",
|
|
4677
4677
|
children: [
|
|
4678
|
-
n && /* @__PURE__ */
|
|
4678
|
+
n && /* @__PURE__ */ Y("div", {
|
|
4679
4679
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
4680
|
-
children: [/* @__PURE__ */
|
|
4680
|
+
children: [/* @__PURE__ */ J(qc, {
|
|
4681
4681
|
value: e,
|
|
4682
4682
|
onChange: t
|
|
4683
4683
|
}), r]
|
|
@@ -4689,15 +4689,15 @@ function nl({ mode: e, onModeChange: t, showSwitch: n, presence: r, panels: i, c
|
|
|
4689
4689
|
}
|
|
4690
4690
|
function rl({ expressive: e, handleGutter: t, mode: n, previewComponents: r, children: i }) {
|
|
4691
4691
|
let a = n === "write";
|
|
4692
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ J("article", {
|
|
4693
4693
|
"data-slot": "document-editor-sheet",
|
|
4694
4694
|
className: tl(e, t),
|
|
4695
|
-
children: /* @__PURE__ */
|
|
4695
|
+
children: /* @__PURE__ */ Y("div", {
|
|
4696
4696
|
className: "mx-auto w-full max-w-[680px]",
|
|
4697
|
-
children: [/* @__PURE__ */
|
|
4697
|
+
children: [/* @__PURE__ */ J("div", {
|
|
4698
4698
|
hidden: !a,
|
|
4699
4699
|
children: i
|
|
4700
|
-
}), !a && /* @__PURE__ */
|
|
4700
|
+
}), !a && /* @__PURE__ */ J($c, {
|
|
4701
4701
|
mode: n,
|
|
4702
4702
|
components: r
|
|
4703
4703
|
})]
|
|
@@ -4705,7 +4705,7 @@ function rl({ expressive: e, handleGutter: t, mode: n, previewComponents: r, chi
|
|
|
4705
4705
|
});
|
|
4706
4706
|
}
|
|
4707
4707
|
function il({ floating: e, children: n }) {
|
|
4708
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ J("div", {
|
|
4709
4709
|
className: t("border-t px-4 py-2.5 @2xl:px-8", e && "order-3"),
|
|
4710
4710
|
children: n
|
|
4711
4711
|
});
|
|
@@ -4714,19 +4714,19 @@ function il({ floating: e, children: n }) {
|
|
|
4714
4714
|
//#region lib/components/ui/widgets/editor/presets/page-rails.tsx
|
|
4715
4715
|
function al({ children: e, fab: t }) {
|
|
4716
4716
|
let { t: n } = M();
|
|
4717
|
-
return t === void 0 ? /* @__PURE__ */
|
|
4717
|
+
return t === void 0 ? /* @__PURE__ */ J("aside", {
|
|
4718
4718
|
"aria-label": n("material.editor.tools", "Tools"),
|
|
4719
4719
|
"data-slot": "document-editor-tools",
|
|
4720
4720
|
className: "sticky top-16 w-12 shrink-0 self-start rounded-2xl border bg-card p-1.5 shadow-xs",
|
|
4721
|
-
children: /* @__PURE__ */
|
|
4721
|
+
children: /* @__PURE__ */ J("div", {
|
|
4722
4722
|
className: "max-h-[calc(100svh-7rem)] overflow-y-clip",
|
|
4723
4723
|
children: e
|
|
4724
4724
|
})
|
|
4725
|
-
}) : /* @__PURE__ */
|
|
4725
|
+
}) : /* @__PURE__ */ Y("aside", {
|
|
4726
4726
|
"aria-label": n("material.editor.tools", "Tools"),
|
|
4727
4727
|
"data-slot": "document-editor-tools",
|
|
4728
4728
|
className: "sticky top-16 flex w-fit shrink-0 flex-col items-center gap-3 self-start",
|
|
4729
|
-
children: [/* @__PURE__ */
|
|
4729
|
+
children: [/* @__PURE__ */ J("div", {
|
|
4730
4730
|
className: "max-h-[calc(100svh-12rem)] overflow-clip [overflow-clip-margin:24px]",
|
|
4731
4731
|
children: e
|
|
4732
4732
|
}), t]
|
|
@@ -4734,7 +4734,7 @@ function al({ children: e, fab: t }) {
|
|
|
4734
4734
|
}
|
|
4735
4735
|
function ol({ side: e, children: t }) {
|
|
4736
4736
|
let { t: n } = M();
|
|
4737
|
-
return /* @__PURE__ */
|
|
4737
|
+
return /* @__PURE__ */ J("aside", {
|
|
4738
4738
|
"aria-label": n("material.editor.outline-region", "Document outline"),
|
|
4739
4739
|
"data-slot": "document-editor-rail",
|
|
4740
4740
|
"data-side": e,
|
|
@@ -4744,7 +4744,7 @@ function ol({ side: e, children: t }) {
|
|
|
4744
4744
|
}
|
|
4745
4745
|
function sl({ children: e }) {
|
|
4746
4746
|
let { t } = M();
|
|
4747
|
-
return /* @__PURE__ */
|
|
4747
|
+
return /* @__PURE__ */ J("aside", {
|
|
4748
4748
|
"aria-label": t("material.editor.comments.title", "Comments"),
|
|
4749
4749
|
"data-slot": "document-editor-comments",
|
|
4750
4750
|
className: "w-64 shrink-0 self-stretch @6xl:w-72",
|
|
@@ -4752,8 +4752,8 @@ function sl({ children: e }) {
|
|
|
4752
4752
|
});
|
|
4753
4753
|
}
|
|
4754
4754
|
function cl({ 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 }) {
|
|
4755
|
-
let { chrome: m, handle: h, look: g } = O(), _ = g === "expressive", v = h.features.some((e) => e.key === "dragHandle"), y = m.state.focusMode, b =
|
|
4756
|
-
return /* @__PURE__ */
|
|
4755
|
+
let { chrome: m, handle: h, look: g } = O(), _ = g === "expressive", v = h.features.some((e) => e.key === "dragHandle"), y = m.state.focusMode, b = G(null), [x, ee] = K("write"), S = x === "write", C = pc(b, 64), w = pc(b, 72), T = S && !y, E = T && C && r, D = !!(n && T && !E), te = c && T && w, ne = l && T && C;
|
|
4756
|
+
return /* @__PURE__ */ Y("div", {
|
|
4757
4757
|
ref: b,
|
|
4758
4758
|
"data-slot": "document-editor",
|
|
4759
4759
|
"data-look": g,
|
|
@@ -4761,30 +4761,30 @@ function cl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4761
4761
|
"data-mode": x,
|
|
4762
4762
|
className: t(el(_, D), f),
|
|
4763
4763
|
children: [
|
|
4764
|
-
/* @__PURE__ */
|
|
4764
|
+
/* @__PURE__ */ J(nl, {
|
|
4765
4765
|
mode: x,
|
|
4766
|
-
onModeChange:
|
|
4766
|
+
onModeChange: ee,
|
|
4767
4767
|
showSwitch: !y,
|
|
4768
4768
|
presence: u,
|
|
4769
|
-
panels:
|
|
4770
|
-
children:
|
|
4769
|
+
panels: S && o,
|
|
4770
|
+
children: T && !E && e
|
|
4771
4771
|
}),
|
|
4772
|
-
/* @__PURE__ */
|
|
4772
|
+
/* @__PURE__ */ J(va, { className: "absolute end-3 top-3 z-20" }),
|
|
4773
4773
|
D && n,
|
|
4774
|
-
/* @__PURE__ */
|
|
4774
|
+
/* @__PURE__ */ Y("div", {
|
|
4775
4775
|
className: "flex items-start gap-4 px-2 pb-6 @2xl:gap-6 @2xl:px-6",
|
|
4776
4776
|
children: [
|
|
4777
|
-
|
|
4777
|
+
E && /* @__PURE__ */ J(al, {
|
|
4778
4778
|
fab: i,
|
|
4779
4779
|
children: r
|
|
4780
4780
|
}),
|
|
4781
|
-
te && d === "start" && /* @__PURE__ */
|
|
4781
|
+
te && d === "start" && /* @__PURE__ */ J(ol, {
|
|
4782
4782
|
side: "start",
|
|
4783
4783
|
children: c
|
|
4784
4784
|
}),
|
|
4785
|
-
/* @__PURE__ */
|
|
4785
|
+
/* @__PURE__ */ J("div", {
|
|
4786
4786
|
className: "min-w-0 flex-1",
|
|
4787
|
-
children: /* @__PURE__ */
|
|
4787
|
+
children: /* @__PURE__ */ J(rl, {
|
|
4788
4788
|
expressive: _,
|
|
4789
4789
|
handleGutter: v,
|
|
4790
4790
|
mode: x,
|
|
@@ -4792,14 +4792,14 @@ function cl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4792
4792
|
children: p
|
|
4793
4793
|
})
|
|
4794
4794
|
}),
|
|
4795
|
-
te && d === "end" && /* @__PURE__ */
|
|
4795
|
+
te && d === "end" && /* @__PURE__ */ J(ol, {
|
|
4796
4796
|
side: "end",
|
|
4797
4797
|
children: c
|
|
4798
4798
|
}),
|
|
4799
|
-
ne && /* @__PURE__ */
|
|
4799
|
+
ne && /* @__PURE__ */ J(sl, { children: l })
|
|
4800
4800
|
]
|
|
4801
4801
|
}),
|
|
4802
|
-
s && /* @__PURE__ */
|
|
4802
|
+
s && /* @__PURE__ */ J(il, {
|
|
4803
4803
|
floating: D,
|
|
4804
4804
|
children: s
|
|
4805
4805
|
})
|
|
@@ -4840,7 +4840,7 @@ function fl(e, t) {
|
|
|
4840
4840
|
});
|
|
4841
4841
|
}
|
|
4842
4842
|
function pl(e, t) {
|
|
4843
|
-
return fl(e, t).flatMap((e) => e.id === "marks" && e.render ===
|
|
4843
|
+
return fl(e, t).flatMap((e) => e.id === "marks" && e.render === te ? [{
|
|
4844
4844
|
...e,
|
|
4845
4845
|
render: p
|
|
4846
4846
|
}, {
|
|
@@ -4865,16 +4865,16 @@ function ml() {
|
|
|
4865
4865
|
//#endregion
|
|
4866
4866
|
//#region lib/components/ui/widgets/editor/partials/editor-insert-fab.tsx
|
|
4867
4867
|
function hl() {
|
|
4868
|
-
let { t: e } = M(), { handle: t } = O(), { editor: n, features:
|
|
4869
|
-
return !n || !
|
|
4868
|
+
let { t: e } = M(), { handle: t } = O(), { editor: n, features: i } = t, a = G(!1), o = W(() => m(dl(i), "", e), [i, e]), s = ml();
|
|
4869
|
+
return !n || !s || o.length === 0 ? null : /* @__PURE__ */ J(r, {
|
|
4870
4870
|
"data-slot": "editor-insert-fab",
|
|
4871
4871
|
label: e("material.editor.insert", "Insert"),
|
|
4872
|
-
items:
|
|
4872
|
+
items: o.map((e) => ({
|
|
4873
4873
|
id: e.id,
|
|
4874
|
-
icon: /* @__PURE__ */
|
|
4874
|
+
icon: /* @__PURE__ */ J(e.icon, {}),
|
|
4875
4875
|
label: e.title,
|
|
4876
4876
|
onSelect: () => {
|
|
4877
|
-
|
|
4877
|
+
a.current = !0;
|
|
4878
4878
|
let t = n.state.selection.from;
|
|
4879
4879
|
e.run({
|
|
4880
4880
|
editor: n,
|
|
@@ -4886,30 +4886,30 @@ function hl() {
|
|
|
4886
4886
|
}
|
|
4887
4887
|
})),
|
|
4888
4888
|
onCloseAutoFocus: (e) => {
|
|
4889
|
-
|
|
4889
|
+
a.current && (a.current = !1, e.preventDefault(), n.isDestroyed || n.commands.focus());
|
|
4890
4890
|
}
|
|
4891
4891
|
});
|
|
4892
4892
|
}
|
|
4893
4893
|
//#endregion
|
|
4894
4894
|
//#region lib/components/ui/widgets/editor/partials/editor-floating-bar.tsx
|
|
4895
4895
|
function gl({ className: e }) {
|
|
4896
|
-
let { handle: t } = O(), n =
|
|
4897
|
-
return ml() ? /* @__PURE__ */
|
|
4896
|
+
let { handle: t } = O(), n = W(() => dl(t.features), [t.features]), r = H((e) => pl(e, n), [n]);
|
|
4897
|
+
return ml() ? /* @__PURE__ */ J("div", {
|
|
4898
4898
|
"data-slot": "editor-floating-bar",
|
|
4899
4899
|
className: "nxgt-editor-bar",
|
|
4900
|
-
children: /* @__PURE__ */
|
|
4900
|
+
children: /* @__PURE__ */ Y(se, { children: [/* @__PURE__ */ J(T, {
|
|
4901
4901
|
variant: "floating",
|
|
4902
4902
|
dividers: !1,
|
|
4903
4903
|
className: e,
|
|
4904
4904
|
groupsFor: r
|
|
4905
|
-
}), /* @__PURE__ */
|
|
4905
|
+
}), /* @__PURE__ */ J(hl, {})] })
|
|
4906
4906
|
}) : null;
|
|
4907
4907
|
}
|
|
4908
4908
|
//#endregion
|
|
4909
4909
|
//#region lib/components/ui/widgets/editor/partials/editor-rail-toolbar.tsx
|
|
4910
4910
|
function _l({ floating: e, className: t }) {
|
|
4911
|
-
let { handle: n } = O(), r =
|
|
4912
|
-
return /* @__PURE__ */
|
|
4911
|
+
let { handle: n } = O(), r = W(() => e ? dl(n.features) : [], [e, n.features]), i = H((e) => fl(e, r), [r]);
|
|
4912
|
+
return /* @__PURE__ */ J(T, {
|
|
4913
4913
|
orientation: "vertical",
|
|
4914
4914
|
variant: e ? "floating" : void 0,
|
|
4915
4915
|
className: t,
|
|
@@ -4921,23 +4921,23 @@ function _l({ floating: e, className: t }) {
|
|
|
4921
4921
|
function vl({ look: e, layout: t, previewComponents: n, outline: r, comments: i, collaboration: a, collaborationStatus: o, footer: s, status: c, actions: l }) {
|
|
4922
4922
|
let u = t === "page", d = Nc(e), f = e === "expressive";
|
|
4923
4923
|
return {
|
|
4924
|
-
toolbar: f ? void 0 : /* @__PURE__ */
|
|
4924
|
+
toolbar: f ? void 0 : /* @__PURE__ */ J(T, {
|
|
4925
4925
|
dividers: !1,
|
|
4926
4926
|
className: u ? d.docked : Mc(e, Cc)
|
|
4927
4927
|
}),
|
|
4928
|
-
bar: f ? /* @__PURE__ */
|
|
4928
|
+
bar: f ? /* @__PURE__ */ J(gl, { className: u ? Ac : kc }) : void 0,
|
|
4929
4929
|
previewComponents: n,
|
|
4930
|
-
rail: u ? /* @__PURE__ */
|
|
4930
|
+
rail: u ? /* @__PURE__ */ J(_l, {
|
|
4931
4931
|
floating: f,
|
|
4932
4932
|
className: d.rail
|
|
4933
4933
|
}) : void 0,
|
|
4934
|
-
railFab: u && f ? /* @__PURE__ */
|
|
4935
|
-
panels: /* @__PURE__ */
|
|
4936
|
-
outline: r ? /* @__PURE__ */
|
|
4937
|
-
comments: i ? /* @__PURE__ */
|
|
4938
|
-
presence: a && /* @__PURE__ */
|
|
4934
|
+
railFab: u && f ? /* @__PURE__ */ J(hl, {}) : void 0,
|
|
4935
|
+
panels: /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(ha, {}), /* @__PURE__ */ J(Pa, {})] }),
|
|
4936
|
+
outline: r ? /* @__PURE__ */ J(Ma, {}) : void 0,
|
|
4937
|
+
comments: i ? /* @__PURE__ */ J(Di, {}) : void 0,
|
|
4938
|
+
presence: a && /* @__PURE__ */ J(mr, { status: o }),
|
|
4939
4939
|
outlineSide: r || "start",
|
|
4940
|
-
footer: s && /* @__PURE__ */
|
|
4940
|
+
footer: s && /* @__PURE__ */ J(wa, {
|
|
4941
4941
|
status: c,
|
|
4942
4942
|
actions: l
|
|
4943
4943
|
})
|
|
@@ -4946,39 +4946,39 @@ function vl({ look: e, layout: t, previewComponents: n, outline: r, comments: i,
|
|
|
4946
4946
|
//#endregion
|
|
4947
4947
|
//#region lib/components/ui/widgets/editor/presets/document-editor-layout.tsx
|
|
4948
4948
|
function yl(e) {
|
|
4949
|
-
return /* @__PURE__ */
|
|
4949
|
+
return /* @__PURE__ */ J(e.layout === "page" ? cl : Tc, {
|
|
4950
4950
|
...vl(e),
|
|
4951
|
-
children: /* @__PURE__ */
|
|
4951
|
+
children: /* @__PURE__ */ J(Ui, { children: /* @__PURE__ */ J(E, {}) })
|
|
4952
4952
|
});
|
|
4953
4953
|
}
|
|
4954
4954
|
//#endregion
|
|
4955
4955
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-adapter-sync.tsx
|
|
4956
4956
|
function bl({ adapter: e }) {
|
|
4957
4957
|
let { handle: t } = O(), n = Sr(t.editor);
|
|
4958
|
-
return
|
|
4958
|
+
return U(() => n?.checkAdapter(), [n, e]), null;
|
|
4959
4959
|
}
|
|
4960
4960
|
//#endregion
|
|
4961
4961
|
//#region lib/components/ui/widgets/editor/presets/document-editor-overlays.tsx
|
|
4962
4962
|
function xl({ onUpload: e, onUploadingChange: t, withComments: n, commentsAdapter: r }) {
|
|
4963
|
-
return /* @__PURE__ */
|
|
4964
|
-
e && /* @__PURE__ */
|
|
4965
|
-
/* @__PURE__ */
|
|
4966
|
-
/* @__PURE__ */
|
|
4967
|
-
/* @__PURE__ */
|
|
4968
|
-
/* @__PURE__ */
|
|
4969
|
-
/* @__PURE__ */
|
|
4970
|
-
n && /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ Y(q, { children: [
|
|
4964
|
+
e && /* @__PURE__ */ J(lc, { onChange: t }),
|
|
4965
|
+
/* @__PURE__ */ J(c, {}),
|
|
4966
|
+
/* @__PURE__ */ J(o, {}),
|
|
4967
|
+
/* @__PURE__ */ J(or, {}),
|
|
4968
|
+
/* @__PURE__ */ J(vi, {}),
|
|
4969
|
+
/* @__PURE__ */ J(Er, {}),
|
|
4970
|
+
n && /* @__PURE__ */ J(bl, { adapter: r })
|
|
4971
4971
|
] });
|
|
4972
4972
|
}
|
|
4973
4973
|
//#endregion
|
|
4974
4974
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-comments-feature.ts
|
|
4975
4975
|
function Sl(e) {
|
|
4976
|
-
let t =
|
|
4977
|
-
|
|
4976
|
+
let t = G(e);
|
|
4977
|
+
kt(() => {
|
|
4978
4978
|
t.current = e;
|
|
4979
4979
|
}, [e]);
|
|
4980
4980
|
let n = !!e?.adapter;
|
|
4981
|
-
return
|
|
4981
|
+
return W(() => {
|
|
4982
4982
|
if (n) return Mo({
|
|
4983
4983
|
get adapter() {
|
|
4984
4984
|
return t.current?.adapter;
|
|
@@ -4998,7 +4998,7 @@ function Sl(e) {
|
|
|
4998
4998
|
//#endregion
|
|
4999
4999
|
//#region lib/components/ui/widgets/editor/presets/use-document-features.ts
|
|
5000
5000
|
function Cl({ features: e, mentions: t, outline: n, onUpload: r, uploadOptions: i, onAssist: a, assistOptions: o, comments: s, collaboration: c }) {
|
|
5001
|
-
let l =
|
|
5001
|
+
let l = W(ac, []), u = uc(r, i), d = cc(a, o), f = Sl(s);
|
|
5002
5002
|
return {
|
|
5003
5003
|
defaults: l,
|
|
5004
5004
|
commentsFeature: f,
|
|
@@ -5017,10 +5017,10 @@ function Cl({ features: e, mentions: t, outline: n, onUpload: r, uploadOptions:
|
|
|
5017
5017
|
}
|
|
5018
5018
|
//#endregion
|
|
5019
5019
|
//#region lib/components/ui/widgets/editor/presets/document-editor.tsx
|
|
5020
|
-
function wl({ features: e, layout: n = "docked", look: r = "expressive", previewComponents: i, status: a, actions: o, footer: s = !0, outline: c = !1, onUpload: l, uploadOptions: u, onUploadingChange: d, onAssist: f, assistOptions: p, comments: m, collaboration: h, collaborationStatus: g, label: _, helperText: v, error: y, required: b, className: x, attributes:
|
|
5021
|
-
let { defaults:
|
|
5020
|
+
function wl({ features: e, layout: n = "docked", look: r = "expressive", previewComponents: i, status: a, actions: o, footer: s = !0, outline: c = !1, onUpload: l, uploadOptions: u, onUploadingChange: d, onAssist: f, assistOptions: p, comments: m, collaboration: h, collaborationStatus: g, label: _, helperText: v, error: y, required: b, className: x, attributes: ee, ...S }) {
|
|
5021
|
+
let { defaults: C, commentsFeature: w, editorFeatures: T } = Cl({
|
|
5022
5022
|
features: e,
|
|
5023
|
-
mentions:
|
|
5023
|
+
mentions: S.mentions,
|
|
5024
5024
|
outline: c,
|
|
5025
5025
|
onUpload: l,
|
|
5026
5026
|
uploadOptions: u,
|
|
@@ -5029,51 +5029,51 @@ function wl({ features: e, layout: n = "docked", look: r = "expressive", preview
|
|
|
5029
5029
|
comments: m,
|
|
5030
5030
|
collaboration: h
|
|
5031
5031
|
});
|
|
5032
|
-
return /* @__PURE__ */
|
|
5033
|
-
...
|
|
5032
|
+
return /* @__PURE__ */ Y(Oe, {
|
|
5033
|
+
...S,
|
|
5034
5034
|
look: r,
|
|
5035
|
-
features:
|
|
5036
|
-
defaults:
|
|
5035
|
+
features: T,
|
|
5036
|
+
defaults: C,
|
|
5037
5037
|
attributes: {
|
|
5038
5038
|
class: t("nxgt-prose min-h-64 focus:outline-none"),
|
|
5039
|
-
...
|
|
5039
|
+
...ee
|
|
5040
5040
|
},
|
|
5041
|
-
children: [/* @__PURE__ */
|
|
5041
|
+
children: [/* @__PURE__ */ J(Me, {
|
|
5042
5042
|
label: _,
|
|
5043
5043
|
helperText: v,
|
|
5044
5044
|
error: y,
|
|
5045
5045
|
required: b,
|
|
5046
5046
|
className: x,
|
|
5047
|
-
children: /* @__PURE__ */
|
|
5047
|
+
children: /* @__PURE__ */ J(yl, {
|
|
5048
5048
|
layout: n,
|
|
5049
5049
|
look: r,
|
|
5050
5050
|
previewComponents: i,
|
|
5051
5051
|
outline: c,
|
|
5052
|
-
comments: !!
|
|
5052
|
+
comments: !!w,
|
|
5053
5053
|
collaboration: !!h,
|
|
5054
5054
|
collaborationStatus: g,
|
|
5055
5055
|
footer: s,
|
|
5056
5056
|
status: a,
|
|
5057
5057
|
actions: o
|
|
5058
5058
|
})
|
|
5059
|
-
}), /* @__PURE__ */
|
|
5059
|
+
}), /* @__PURE__ */ J(xl, {
|
|
5060
5060
|
onUpload: l,
|
|
5061
5061
|
onUploadingChange: d,
|
|
5062
|
-
commentsAdapter:
|
|
5063
|
-
withComments: !!
|
|
5062
|
+
commentsAdapter: w ? m?.adapter : void 0,
|
|
5063
|
+
withComments: !!w
|
|
5064
5064
|
})]
|
|
5065
5065
|
});
|
|
5066
5066
|
}
|
|
5067
5067
|
//#endregion
|
|
5068
5068
|
//#region lib/components/ui/widgets/editor/presets/document-editor-form-field.tsx
|
|
5069
5069
|
function Tl({ control: e, name: n, ...r }) {
|
|
5070
|
-
return /* @__PURE__ */
|
|
5070
|
+
return /* @__PURE__ */ J(Xe, {
|
|
5071
5071
|
control: e,
|
|
5072
5072
|
name: n,
|
|
5073
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */
|
|
5073
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ J(Ze, {
|
|
5074
5074
|
onBlur: e.onBlur,
|
|
5075
5075
|
focusRef: e.ref,
|
|
5076
|
-
children: /* @__PURE__ */
|
|
5076
|
+
children: /* @__PURE__ */ J(wl, {
|
|
5077
5077
|
...r,
|
|
5078
5078
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
5079
5079
|
value: e.value ?? we(r.format ?? "html"),
|
|
@@ -5093,20 +5093,20 @@ function El({ pill: e, look: n, editable: r, className: i }) {
|
|
|
5093
5093
|
//#endregion
|
|
5094
5094
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/composer-notices.tsx
|
|
5095
5095
|
function Dl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled: i, onAttachmentsChange: a }) {
|
|
5096
|
-
return /* @__PURE__ */
|
|
5097
|
-
e && /* @__PURE__ */
|
|
5096
|
+
return /* @__PURE__ */ Y(q, { children: [
|
|
5097
|
+
e && /* @__PURE__ */ J("div", {
|
|
5098
5098
|
role: "alert",
|
|
5099
5099
|
className: "w-full px-1 text-error-text text-xs",
|
|
5100
5100
|
children: e
|
|
5101
5101
|
}),
|
|
5102
|
-
t && /* @__PURE__ */
|
|
5102
|
+
t && /* @__PURE__ */ J("div", {
|
|
5103
5103
|
className: "w-full",
|
|
5104
|
-
children: /* @__PURE__ */
|
|
5104
|
+
children: /* @__PURE__ */ J(ce, {
|
|
5105
5105
|
replyTo: t,
|
|
5106
5106
|
onCancel: n
|
|
5107
5107
|
})
|
|
5108
5108
|
}),
|
|
5109
|
-
/* @__PURE__ */
|
|
5109
|
+
/* @__PURE__ */ J(ue, {
|
|
5110
5110
|
attachments: r,
|
|
5111
5111
|
isDisabled: i,
|
|
5112
5112
|
onAttachmentsChange: a,
|
|
@@ -5117,11 +5117,11 @@ function Dl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled
|
|
|
5117
5117
|
//#endregion
|
|
5118
5118
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/composer-toolbar.tsx
|
|
5119
5119
|
function Ol({ id: e, look: t }) {
|
|
5120
|
-
return /* @__PURE__ */
|
|
5120
|
+
return /* @__PURE__ */ J("div", {
|
|
5121
5121
|
id: e,
|
|
5122
5122
|
"data-slot": "rich-chat-composer-toolbar",
|
|
5123
5123
|
className: "w-full px-1",
|
|
5124
|
-
children: /* @__PURE__ */
|
|
5124
|
+
children: /* @__PURE__ */ J(T, {
|
|
5125
5125
|
dividers: !1,
|
|
5126
5126
|
density: "compact",
|
|
5127
5127
|
className: Mc(t, Cc)
|
|
@@ -5132,18 +5132,18 @@ function Ol({ id: e, look: t }) {
|
|
|
5132
5132
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/send-control.tsx
|
|
5133
5133
|
function kl({ sendLabel: e, stopLabel: t, disabled: n, empty: r, onStop: i, onSchedule: a, squircle: o }) {
|
|
5134
5134
|
let { t: s } = M();
|
|
5135
|
-
return !a || i ? /* @__PURE__ */
|
|
5135
|
+
return !a || i ? /* @__PURE__ */ J(ke, {
|
|
5136
5136
|
sendLabel: e,
|
|
5137
5137
|
stopLabel: t,
|
|
5138
5138
|
isDisabled: n,
|
|
5139
5139
|
isEmpty: r,
|
|
5140
5140
|
onStop: i,
|
|
5141
5141
|
shape: o ? "squircle" : "round"
|
|
5142
|
-
}) : /* @__PURE__ */
|
|
5142
|
+
}) : /* @__PURE__ */ J(S, {
|
|
5143
5143
|
type: "submit",
|
|
5144
5144
|
disabled: n || r,
|
|
5145
5145
|
menuLabel: s("material.editor.send-options", "Send options"),
|
|
5146
|
-
menu: /* @__PURE__ */
|
|
5146
|
+
menu: /* @__PURE__ */ J(A, {
|
|
5147
5147
|
onSelect: a,
|
|
5148
5148
|
children: s("material.editor.schedule", "Schedule…")
|
|
5149
5149
|
}),
|
|
@@ -5157,7 +5157,7 @@ function Al(e, t) {
|
|
|
5157
5157
|
}
|
|
5158
5158
|
function jl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i, children: a }) {
|
|
5159
5159
|
let { handle: o } = O();
|
|
5160
|
-
return /* @__PURE__ */
|
|
5160
|
+
return /* @__PURE__ */ J("div", {
|
|
5161
5161
|
"data-slot": "rich-chat-composer-input",
|
|
5162
5162
|
className: i,
|
|
5163
5163
|
onFocus: r,
|
|
@@ -5171,7 +5171,7 @@ function jl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i,
|
|
|
5171
5171
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/format-buttons.tsx
|
|
5172
5172
|
function Ml({ formatOpen: e, toolbarId: t, onFormatToggle: n, mentionable: r }) {
|
|
5173
5173
|
let { t: i } = M(), { editor: a } = O().handle, o = i("material.editor.formatting-toggle", "Text formatting"), s = i("material.editor.mention", "Mention someone");
|
|
5174
|
-
return /* @__PURE__ */
|
|
5174
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(N, {
|
|
5175
5175
|
variant: "ghost",
|
|
5176
5176
|
color: "default",
|
|
5177
5177
|
tooltip: o,
|
|
@@ -5181,39 +5181,39 @@ function Ml({ formatOpen: e, toolbarId: t, onFormatToggle: n, mentionable: r })
|
|
|
5181
5181
|
"aria-controls": e ? t : void 0,
|
|
5182
5182
|
onClick: n,
|
|
5183
5183
|
className: "size-8 shrink-0 rounded aria-pressed:bg-primary/10 aria-pressed:text-primary-text",
|
|
5184
|
-
children: /* @__PURE__ */
|
|
5185
|
-
}), r && /* @__PURE__ */
|
|
5184
|
+
children: /* @__PURE__ */ J(Ft, {})
|
|
5185
|
+
}), r && /* @__PURE__ */ J(N, {
|
|
5186
5186
|
variant: "ghost",
|
|
5187
5187
|
color: "default",
|
|
5188
5188
|
tooltip: s,
|
|
5189
5189
|
"aria-label": s,
|
|
5190
5190
|
onClick: () => a?.chain().focus().insertContent("@").run(),
|
|
5191
5191
|
className: "size-8 shrink-0 rounded",
|
|
5192
|
-
children: /* @__PURE__ */
|
|
5192
|
+
children: /* @__PURE__ */ J(Pt, {})
|
|
5193
5193
|
})] });
|
|
5194
5194
|
}
|
|
5195
5195
|
//#endregion
|
|
5196
5196
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/tools-row.tsx
|
|
5197
5197
|
function Nl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionable: a, attach: o, actions: s }) {
|
|
5198
5198
|
let { handle: c } = O(), { editor: l } = c;
|
|
5199
|
-
return /* @__PURE__ */
|
|
5199
|
+
return /* @__PURE__ */ Y("div", {
|
|
5200
5200
|
"data-slot": "rich-chat-composer-tools",
|
|
5201
5201
|
className: t("flex min-w-0 items-end gap-1", e ? "order-1" : "flex-1"),
|
|
5202
|
-
children: [/* @__PURE__ */
|
|
5202
|
+
children: [/* @__PURE__ */ J(be, {
|
|
5203
5203
|
...o,
|
|
5204
|
-
actions: /* @__PURE__ */
|
|
5204
|
+
actions: /* @__PURE__ */ Y(q, { children: [l?.storage.emoji && /* @__PURE__ */ J(xe, { editor: l }), !e && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(Ml, {
|
|
5205
5205
|
formatOpen: n,
|
|
5206
5206
|
toolbarId: r,
|
|
5207
5207
|
onFormatToggle: i,
|
|
5208
5208
|
mentionable: a
|
|
5209
5209
|
}), s] })] })
|
|
5210
|
-
}), !e && /* @__PURE__ */
|
|
5210
|
+
}), !e && /* @__PURE__ */ J(fc, { className: "ms-auto self-center px-2" })]
|
|
5211
5211
|
});
|
|
5212
5212
|
}
|
|
5213
5213
|
//#endregion
|
|
5214
5214
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-editor.ts
|
|
5215
5215
|
function Pl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attributes: a, ...o }) {
|
|
5216
|
-
let { t: s } = M(), c =
|
|
5216
|
+
let { t: s } = M(), c = W(() => sc().map((e) => e.name === "emoji" ? {
|
|
5217
5217
|
...e,
|
|
5218
5218
|
toolbar: void 0
|
|
5219
5219
|
} : e), []);
|
|
@@ -5233,7 +5233,7 @@ function Pl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attri
|
|
|
5233
5233
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-pill.ts
|
|
5234
5234
|
var Fl = "[data-radix-popper-content-wrapper], [role=\"dialog\"]";
|
|
5235
5235
|
function Il({ collapsed: e, occupied: t, files: n }) {
|
|
5236
|
-
let [r, i] =
|
|
5236
|
+
let [r, i] = K(!1), [a, o] = K(!1), s = Ot();
|
|
5237
5237
|
return {
|
|
5238
5238
|
pill: e === "auto" && !a && !t && !r,
|
|
5239
5239
|
formatOpen: r,
|
|
@@ -5263,7 +5263,7 @@ async function Ll(e, t) {
|
|
|
5263
5263
|
return {
|
|
5264
5264
|
value: n,
|
|
5265
5265
|
json: r,
|
|
5266
|
-
markdown: await
|
|
5266
|
+
markdown: await ht(r, i && { extensions: i }),
|
|
5267
5267
|
attachments: t
|
|
5268
5268
|
};
|
|
5269
5269
|
}
|
|
@@ -5271,7 +5271,7 @@ var Rl = (e, t) => e.trim().length > 0 || t > 0;
|
|
|
5271
5271
|
//#endregion
|
|
5272
5272
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-send.ts
|
|
5273
5273
|
function zl({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSchedule: a, onError: o }) {
|
|
5274
|
-
let { t: s } = M(), [c, l] =
|
|
5274
|
+
let { t: s } = M(), [c, l] = K(!1), u = G(!1), d = () => Ll({
|
|
5275
5275
|
getValue: () => e.getValue(),
|
|
5276
5276
|
getJSON: () => e.editor?.getJSON() ?? { type: "doc" },
|
|
5277
5277
|
getExtensions: () => e.editor?.extensionManager.extensions
|
|
@@ -5310,9 +5310,9 @@ function zl({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSche
|
|
|
5310
5310
|
//#endregion
|
|
5311
5311
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-rich-chat-composer.ts
|
|
5312
5312
|
function Bl({ handle: e, onSend: t, onSchedule: n, onError: r, disabled: i = !1, isLoading: a = !1, accept: o, maxFiles: s, attachments: c, onAttachmentsChange: l }) {
|
|
5313
|
-
let [u, d] =
|
|
5313
|
+
let [u, d] = K([]), f = c ?? u, p = (e) => {
|
|
5314
5314
|
c === void 0 && d(e), l?.(e);
|
|
5315
|
-
}, m =
|
|
5315
|
+
}, m = G(null), h = he({
|
|
5316
5316
|
attachments: f,
|
|
5317
5317
|
accept: o,
|
|
5318
5318
|
maxFiles: s,
|
|
@@ -5379,8 +5379,8 @@ function Vl(e) {
|
|
|
5379
5379
|
//#endregion
|
|
5380
5380
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/rich-chat-composer.tsx
|
|
5381
5381
|
function Hl(e) {
|
|
5382
|
-
let { t: n } = M(), { mentions: r, replyTo: i, onCancelReply:
|
|
5383
|
-
return /* @__PURE__ */
|
|
5382
|
+
let { t: n } = M(), { mentions: r, replyTo: i, onCancelReply: a, actions: s, className: l } = e, { sendOnEnter: u = !0, sendLabel: d, isLoading: f = !1 } = e, { look: p = "expressive" } = e, { handle: m, editable: h, composer: g, ui: _, attach: v } = Vl(e), { files: y, attachments: b } = g, { pill: x } = _;
|
|
5383
|
+
return /* @__PURE__ */ J("form", {
|
|
5384
5384
|
"data-slot": "rich-chat-composer",
|
|
5385
5385
|
"data-look": p,
|
|
5386
5386
|
"data-collapsed": x || void 0,
|
|
@@ -5392,43 +5392,43 @@ function Hl(e) {
|
|
|
5392
5392
|
editable: h,
|
|
5393
5393
|
className: l
|
|
5394
5394
|
}),
|
|
5395
|
-
children: /* @__PURE__ */
|
|
5395
|
+
children: /* @__PURE__ */ Y(Oe, {
|
|
5396
5396
|
editor: m,
|
|
5397
5397
|
className: "contents",
|
|
5398
5398
|
look: p,
|
|
5399
5399
|
children: [
|
|
5400
|
-
/* @__PURE__ */
|
|
5400
|
+
/* @__PURE__ */ J(Dl, {
|
|
5401
5401
|
error: y.errorMessage ?? g.sendError,
|
|
5402
5402
|
replyTo: i,
|
|
5403
|
-
onCancelReply:
|
|
5403
|
+
onCancelReply: a,
|
|
5404
5404
|
attachments: b,
|
|
5405
5405
|
isDisabled: y.isDisabled,
|
|
5406
5406
|
onAttachmentsChange: g.setAttachments
|
|
5407
5407
|
}),
|
|
5408
|
-
/* @__PURE__ */
|
|
5408
|
+
/* @__PURE__ */ J(jl, {
|
|
5409
5409
|
className: t("min-w-0 px-2 py-1", x ? "order-2 flex-1" : "w-full"),
|
|
5410
5410
|
onFocus: _.activate,
|
|
5411
5411
|
onSend: () => void g.send(),
|
|
5412
5412
|
sendOnEnter: u,
|
|
5413
5413
|
disabled: !h,
|
|
5414
|
-
children: /* @__PURE__ */
|
|
5414
|
+
children: /* @__PURE__ */ J(E, {})
|
|
5415
5415
|
}),
|
|
5416
|
-
_.formatOpen && !x && /* @__PURE__ */
|
|
5416
|
+
_.formatOpen && !x && /* @__PURE__ */ J(Ol, {
|
|
5417
5417
|
id: _.toolbarId,
|
|
5418
5418
|
look: p
|
|
5419
5419
|
}),
|
|
5420
|
-
/* @__PURE__ */
|
|
5420
|
+
/* @__PURE__ */ J(Nl, {
|
|
5421
5421
|
pill: x,
|
|
5422
5422
|
formatOpen: _.formatOpen,
|
|
5423
5423
|
toolbarId: _.toolbarId,
|
|
5424
5424
|
onFormatToggle: _.toggleFormat,
|
|
5425
5425
|
mentionable: !!r?.length,
|
|
5426
|
-
actions:
|
|
5426
|
+
actions: s,
|
|
5427
5427
|
attach: v
|
|
5428
5428
|
}),
|
|
5429
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ J("div", {
|
|
5430
5430
|
className: t("shrink-0", x && "order-3"),
|
|
5431
|
-
children: /* @__PURE__ */
|
|
5431
|
+
children: /* @__PURE__ */ J(kl, {
|
|
5432
5432
|
sendLabel: d ?? n("material.chat.send", "Send"),
|
|
5433
5433
|
stopLabel: n("material.chat.composer.stop", "Stop generating"),
|
|
5434
5434
|
disabled: y.isDisabled,
|
|
@@ -5438,8 +5438,8 @@ function Hl(e) {
|
|
|
5438
5438
|
squircle: p === "expressive"
|
|
5439
5439
|
})
|
|
5440
5440
|
}),
|
|
5441
|
-
/* @__PURE__ */
|
|
5442
|
-
/* @__PURE__ */
|
|
5441
|
+
/* @__PURE__ */ J(c, {}),
|
|
5442
|
+
/* @__PURE__ */ J(o, {})
|
|
5443
5443
|
]
|
|
5444
5444
|
})
|
|
5445
5445
|
});
|
|
@@ -5448,15 +5448,15 @@ function Hl(e) {
|
|
|
5448
5448
|
//#region lib/components/ui/widgets/editor/index.ts
|
|
5449
5449
|
var Ul = {
|
|
5450
5450
|
Root: Oe,
|
|
5451
|
-
Content:
|
|
5452
|
-
Toolbar:
|
|
5451
|
+
Content: E,
|
|
5452
|
+
Toolbar: T,
|
|
5453
5453
|
Panel: Ar,
|
|
5454
5454
|
AssistantPanel: or,
|
|
5455
|
-
BubbleMenu:
|
|
5455
|
+
BubbleMenu: c,
|
|
5456
5456
|
CommentsRail: Di,
|
|
5457
5457
|
CommentsPanel: vi,
|
|
5458
5458
|
CommentComposer: Er,
|
|
5459
|
-
SuggestionList:
|
|
5459
|
+
SuggestionList: o,
|
|
5460
5460
|
Footer: wa,
|
|
5461
5461
|
Outline: Ma,
|
|
5462
5462
|
OutlinePanel: Pa,
|
|
@@ -5467,4 +5467,4 @@ var Ul = {
|
|
|
5467
5467
|
Presence: mr
|
|
5468
5468
|
};
|
|
5469
5469
|
//#endregion
|
|
5470
|
-
export { Gc as CompactEditor, Kc as CompactEditorFormField, wl as DocumentEditor, Tl as DocumentEditorFormField, Ul as Editor, or as EditorAssistantPanel, Ui as EditorBlockHandle,
|
|
5470
|
+
export { Gc as CompactEditor, Kc as CompactEditorFormField, wl as DocumentEditor, Tl as DocumentEditorFormField, Ul as Editor, or as EditorAssistantPanel, Ui as EditorBlockHandle, c as EditorBubbleMenu, Er as EditorCommentComposer, vi as EditorCommentsPanel, Di as EditorCommentsRail, E as EditorContent, Me as EditorField, ha as EditorFindPanel, va as EditorFocusExit, wa as EditorFooter, Ma as EditorOutline, Pa as EditorOutlinePanel, Ar as EditorPanel, mr as EditorPresence, Oe as EditorRoot, o as EditorSuggestionList, T as EditorToolbar, Hl as RichChatComposer, sc as chatKit, oc as compactKit, V as defineFeature, ac as documentKit, tc as editorFeatures, ic as formNodesKit, _t as fromMarkdown, Va as looksLikeMarkdown, vt as toHtml, gt as toJson, ht as toMarkdown, le as useEditor, O as useEditorContext, ur as useEditorPresence, xa as useEditorStats, La as useEditorUploads, nc as withFeatures, rc as withoutFeatures };
|