@nxgt/material 3.7.4 → 3.8.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 +56 -0
- package/README.md +39 -6
- package/bin/nxgt-theme.js +6 -0
- package/dist/{async-slice-o_fpqeGX.js → async-slice-DDjaJY_F.js} +2 -2
- package/dist/background--Bf_EbFR.js +159 -0
- package/dist/backgrounds/backgrounds.css +2 -0
- package/dist/backgrounds/css-react/moon.css +97 -0
- package/dist/backgrounds.js +3 -139
- package/dist/browser-only-DQ94lWF8.js +18 -0
- package/dist/bubble-input-B7BVd9fX.js +237 -0
- package/dist/{button--cF4gY14.js → button-DbfdITBB.js} +51 -57
- package/dist/charts.js +3 -3
- package/dist/{chip-D1B1dL77.js → chip-DpySRqCy.js} +2 -2
- package/dist/{client-only.utils-lQ7GqP8w.js → client-only.utils-3nHNzCki.js} +1 -1
- package/dist/{code-editor-0CdGwKDg.js → code-editor-BiA14xua.js} +7 -7
- package/dist/code-editor.js +6 -6
- package/dist/{code-language-items-CGARRbVm.js → code-language-items-C_dJ6GVs.js} +2 -2
- package/dist/components/theme-tokens.css +34 -35
- package/dist/components/tones/app-tones.css +2 -1
- package/dist/components/tones/containers.css +4 -1
- package/dist/components/tones/index.css +2 -0
- package/dist/components/tones/surface.css +1 -0
- package/dist/components/tones/tokens.css +8 -3
- package/dist/components/tones/zone-paint.css +15 -0
- package/dist/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop.css +62 -1
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/dist/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/dist/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/dist/{components-DD7_NI6U.js → components-B9EIfMdd.js} +18652 -18553
- package/dist/components.js +24 -22
- package/dist/{dialog-DdJ1C4BR.js → dialog-CkIYpJXk.js} +55 -53
- package/dist/dist-B7RjY7SL.js +158 -0
- package/dist/dist-C4wtXCjf.js +593 -0
- package/dist/dist-DVRQkaTK.js +111 -0
- package/dist/dist-lmHmz_bu.js +419 -0
- package/dist/dnd.js +1 -1
- package/dist/dropdown-menu-BC5Tbhb9.js +908 -0
- package/dist/editor.js +527 -527
- package/dist/empty-state-s2CSjKXJ.js +126 -0
- package/dist/{escape-owner-B8k7DvFa.js → escape-owner-CripBce_.js} +2 -1
- package/dist/{field-blur-DFUazxsL.js → field-blur-DPLsMufs.js} +1 -1
- package/dist/{field-blur-context-Dw9ZAgBr.js → field-blur-context-1ZwJgsHE.js} +2 -2
- package/dist/has-text-content-Ds2dkHX_.js +10 -0
- package/dist/hooks.js +35 -33
- package/dist/{hover-card-D5iHS9q1.js → hover-card-Cox-tPDz.js} +41 -39
- package/dist/{i18n-provider-C6SBK_nO.js → i18n-provider-C6HhBw34.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/{icon-badge-Bb5-73XP.js → icon-badge-q3Ve8gra.js} +3 -3
- package/dist/{icon-button-5A6Mrj6w.js → icon-button-DJcWpIhu.js} +2 -1
- package/dist/{in-dialog-AiwTD3DK.js → in-dialog-Vwkyp-M5.js} +6 -5
- package/dist/lib/backgrounds/background/available.d.ts +3 -3
- package/dist/lib/backgrounds/background/background.d.ts +7 -3
- package/dist/lib/backgrounds/background/types.d.ts +7 -1
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-chrome.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +6 -4
- package/dist/lib/components/ui/layout/app-shell/backdrop-layer.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +6 -0
- package/dist/lib/components/ui/layout/app-shell/use-activity-backdrop.d.ts +18 -0
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +9 -0
- package/dist/lib/hooks/resolve-theme.d.ts +46 -1
- package/dist/lib/hooks/theme-store.d.ts +35 -4
- package/dist/lib/hooks/use-theme.d.ts +20 -4
- package/dist/lib/i18n/resources/en/en.d.ts +4 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/resources.d.ts +8 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/theme-picker/index.d.ts +7 -0
- package/dist/lib/theme-picker/partials/mini-background.d.ts +10 -0
- package/dist/lib/theme-picker/partials/mode-control.d.ts +5 -0
- package/dist/lib/theme-picker/partials/theme-tile.d.ts +12 -0
- package/dist/lib/theme-picker/theme-label.d.ts +7 -0
- package/dist/lib/theme-picker/theme-picker.d.ts +25 -0
- package/dist/lib/themes/index.d.ts +14 -0
- package/dist/lib/themes/nxgt-theme-provider.d.ts +29 -0
- package/dist/lib/themes/nxgt-theme.d.ts +22 -0
- package/dist/lib/themes/theme-context.d.ts +28 -0
- package/dist/lib/themes/theme-value.d.ts +5 -0
- package/dist/lib/vite/index.d.ts +1 -1
- package/dist/lib.js +3 -3
- package/dist/main.js +43 -39
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-CgSb9Obl.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-SsiazLEv.js → public-Ce30uvp0.js} +591 -587
- package/dist/read-storage-C2J90bNm.js +10 -0
- package/dist/{rich-code-block-CwNwQs5z.js → rich-code-block-C2Fp_FDU.js} +5 -5
- package/dist/{sortable-provider-BvD98s8Y.js → sortable-provider-pVaEZzty.js} +3 -3
- package/dist/{spinner-CtGCPza-.js → spinner-CsHcmcpF.js} +2 -2
- package/dist/{stored-language-Bb7yX5uE.js → stored-language-BeIKw3-K.js} +15 -15
- package/dist/styles.css +8 -1
- package/dist/theme-context-BagPvRcz.js +16 -0
- package/dist/theme-picker.js +118 -0
- package/dist/theme-store-CSl51uNH.js +91 -0
- package/dist/theme-toggle-C8os82b4.js +48 -0
- package/dist/themes.js +42 -0
- package/dist/toggle-group-j8zaxEg1.js +69 -0
- package/dist/{toolbar-items-DsDDD5AY.js → toolbar-items-CqHvlTU8.js} +443 -589
- package/dist/tooltip-rhbqNmr3.js +1064 -0
- package/dist/{translate-material-Bsjc4Tow.js → translate-material-CGZljjp1.js} +2 -2
- package/dist/{translator-or2y0JJB.js → translator-DCYO4Ij3.js} +3 -3
- package/dist/{use-background-activity-B8jLHNop.js → use-background-activity-KxQgelFF.js} +1 -1
- package/dist/{use-chat-composer-DZ01a16D.js → use-chat-composer-CDrgWGMM.js} +4684 -4886
- package/dist/{use-heading-spy-ByOQNnFZ.js → use-heading-spy-DXo6IOX9.js} +52 -121
- package/dist/{use-material-translation-hLQzOjF0.js → use-material-translation-DkxcLbLM.js} +2 -2
- package/dist/use-slice-reducer-BGkeGtML.js +42 -0
- package/dist/use-theme-Cd-aiDJo.js +31 -0
- package/docs/README.md +2 -1
- package/docs/components/foundations.md +39 -0
- package/docs/components/navigation-and-layout.md +3 -3
- package/docs/getting-started.md +1 -1
- package/docs/guides/app-shell.md +46 -7
- package/docs/guides/backgrounds.md +43 -7
- package/docs/guides/i18n.md +1 -1
- package/docs/guides/themes.md +103 -0
- package/docs/guides/theming.md +288 -84
- package/docs/guides/vite-plugin.md +26 -0
- package/docs/previews/backgrounds-background-from-theme.webp +0 -0
- package/docs/previews/backgrounds-geometry-more.webp +0 -0
- package/docs/previews/backgrounds-geometry.webp +0 -0
- package/docs/previews/backgrounds-illustrated-scenes.webp +0 -0
- package/docs/previews/backgrounds-light-more.webp +0 -0
- package/docs/previews/backgrounds-light.webp +0 -0
- package/docs/previews/backgrounds-material-more.webp +0 -0
- package/docs/previews/backgrounds-matrix.webp +0 -0
- package/docs/previews/backgrounds-moon.webp +0 -0
- package/docs/previews/backgrounds-motif-shapes.webp +0 -0
- package/docs/previews/backgrounds-motifs.webp +0 -0
- package/docs/previews/foundations-themes-themepicker.webp +0 -0
- package/docs/roadmap.md +25 -0
- package/docs/troubleshooting.md +35 -7
- package/lib/backgrounds/backgrounds.css +2 -0
- package/lib/backgrounds/css-react/moon.css +97 -0
- package/lib/components/theme-tokens.css +34 -35
- package/lib/components/tones/app-tones.css +2 -1
- package/lib/components/tones/containers.css +4 -1
- package/lib/components/tones/index.css +2 -0
- package/lib/components/tones/surface.css +1 -0
- package/lib/components/tones/tokens.css +8 -3
- package/lib/components/tones/zone-paint.css +15 -0
- package/lib/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop.css +62 -1
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/lib/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/lib/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/lib/styles.css +8 -1
- package/lib/theme-picker/theme-picker-list.css +29 -0
- package/lib/theme-picker/theme-picker.css +192 -0
- package/lib/theme-picker/theme-tile-background.css +77 -0
- package/lib/theme-picker/theme-tile-textures-night.css +63 -0
- package/lib/theme-picker/theme-tile-textures.css +153 -0
- package/lib/themes/ambre.css +134 -0
- package/lib/themes/ardoise.css +133 -0
- package/lib/themes/bleumono.css +136 -0
- package/lib/themes/bluemoon.css +136 -0
- package/lib/themes/corail.css +136 -0
- package/lib/themes/foret.css +133 -0
- package/lib/themes/lavande.css +133 -0
- package/lib/themes/menthe.css +136 -0
- package/lib/themes/ocean.css +136 -0
- package/lib/themes/pink.css +134 -0
- package/lib/themes/prune.css +133 -0
- package/lib/themes/sable.css +133 -0
- package/lib/themes/slate.css +133 -0
- package/lib/themes/teal.css +137 -0
- package/package.json +30 -2
- package/dist/dropdown-menu-DWtgUVW7.js +0 -1490
- package/dist/empty-state-CRWLQ1sM.js +0 -191
- package/dist/tooltip-tmFoTU_d.js +0 -1582
- package/dist/use-slice-reducer-0r5dXnJe.js +0 -58
package/dist/editor.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-Bcd2Z3ea.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { r as
|
|
11
|
-
import { a as
|
|
12
|
-
import {
|
|
13
|
-
import { n as
|
|
14
|
-
import { t as
|
|
15
|
-
import { Ft as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { Z as
|
|
19
|
-
import { a as
|
|
20
|
-
import { d as
|
|
21
|
-
import { t as
|
|
22
|
-
import { n as
|
|
23
|
-
import { ArrowDown as
|
|
24
|
-
import { Suspense as
|
|
3
|
+
import { A as n, B as r, C as i, Cn as a, D as o, Dn as s, E as c, En as l, Er as u, F as d, Fn as f, G as p, H as m, In as h, J as g, K as _, Ln as v, M as y, N as b, O as x, On as S, P as C, Qi as ee, Qn as te, Rn as w, S as T, T as E, Tn as ne, Tr as re, U as D, V as ie, Vn as O, W as ae, X as oe, Xi as se, Y as ce, Yi as le, _n as ue, a as de, an as fe, bn as pe, c as me, d as he, g as ge, hr as _e, i as ve, in as ye, j as be, k as xe, l as Se, m as Ce, mn as we, p as Te, pn as Ee, q as De, rn as Oe, s as ke, t as Ae, vn as je, vr as Me, w as Ne, wn as Pe, x as Fe, xn as Ie, yn as Le, z as Re, zn as ze } from "./use-chat-composer-CDrgWGMM.js";
|
|
4
|
+
import { f as Be } from "./dialog-CkIYpJXk.js";
|
|
5
|
+
import { c as Ve, i as He, n as Ue, o as We, r as Ge, s as Ke, t as qe, u as k } from "./dropdown-menu-BC5Tbhb9.js";
|
|
6
|
+
import { c as Je, o as Ye, s as Xe } from "./toolbar-items-CqHvlTU8.js";
|
|
7
|
+
import { t as A } from "./use-material-translation-DkxcLbLM.js";
|
|
8
|
+
import { t as j } from "./button-DbfdITBB.js";
|
|
9
|
+
import { t as M } from "./icon-button-DJcWpIhu.js";
|
|
10
|
+
import { r as Ze, t as Qe } from "./field-blur-DPLsMufs.js";
|
|
11
|
+
import { a as $e, s as N } from "./dist-C3GR7kJd.js";
|
|
12
|
+
import { n as et, t as tt } from "./toggle-group-j8zaxEg1.js";
|
|
13
|
+
import { n as nt } from "./icon-badge-q3Ve8gra.js";
|
|
14
|
+
import { t as rt } from "./use-mobile-BDro060N.js";
|
|
15
|
+
import { Ft as it, Ht as at, Nt as ot, Ot as st, St as ct, bt as P, ht as F, mt as I, n as L, wt as R, xt as lt, yt as ut } from "./dist-moutbfbd.js";
|
|
16
|
+
import { t as dt } from "./markdown-Dw_uH7j7.js";
|
|
17
|
+
import { n as ft, r as z, t as pt } from "./create-store-Dqp-PLLn.js";
|
|
18
|
+
import { Z as mt, w as ht } from "./youtube-node-OWSNlYCc.js";
|
|
19
|
+
import { a as gt, i as _t, n as vt, r as yt } from "./convert-XAkWyO8-.js";
|
|
20
|
+
import { d as bt, n as xt, r as St, u as Ct } from "./headless-extensions-CvmdhANJ.js";
|
|
21
|
+
import { t as wt } from "./render-json-DyFYFIkZ.js";
|
|
22
|
+
import { n as Tt, r as Et } from "./collab-colors-CDkjUVoQ.js";
|
|
23
|
+
import { ArrowDown as Dt, ArrowUp as Ot, AtSign as kt, CaseSensitive as At, Check as jt, ChevronDown as Mt, ChevronLeft as Nt, ChevronRight as Pt, ChevronUp as Ft, Code as It, Copy as Lt, CornerDownLeft as Rt, File as zt, Focus as Bt, GripVertical as Vt, Heading1 as Ht, Heading2 as Ut, Heading3 as Wt, Languages as Gt, List as Kt, ListOrdered as qt, Maximize2 as Jt, MessageSquare as Yt, MessageSquarePlus as Xt, Minimize2 as Zt, PenLine as Qt, Pilcrow as $t, Plus as en, Quote as tn, Replace as nn, RotateCcw as rn, Search as an, Smile as on, Sparkles as sn, SpellCheck as cn, Square as ln, TableOfContents as un, TextCursorInput as dn, TextQuote as fn, Trash2 as pn, WandSparkles as mn, WholeWord as hn, X as gn } from "lucide-react";
|
|
24
|
+
import { Suspense as _n, lazy as vn, useCallback as B, useEffect as V, useId as yn, useLayoutEffect as bn, useMemo as H, useRef as U, useState as W, useSyncExternalStore as G } from "react";
|
|
25
25
|
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
26
26
|
import { createPortal as xn } from "react-dom";
|
|
27
27
|
//#region lib/components/ui/widgets/editor/extensions/assistant/editor-extensions.ts
|
|
@@ -93,7 +93,7 @@ function Dn(e, t) {
|
|
|
93
93
|
}
|
|
94
94
|
async function On(e, t, n = "drop") {
|
|
95
95
|
let r = Sn(e);
|
|
96
|
-
return Dn(
|
|
96
|
+
return Dn(St(await vt(t, { extensions: r }), r), n);
|
|
97
97
|
}
|
|
98
98
|
async function kn(e, t, n, r, i = {}) {
|
|
99
99
|
let a = await On(e, t, i.allowMedia ? "keep" : "drop");
|
|
@@ -131,35 +131,35 @@ function Pn(e) {
|
|
|
131
131
|
{
|
|
132
132
|
id: "improve",
|
|
133
133
|
label: t("improve", "Improve writing"),
|
|
134
|
-
icon:
|
|
134
|
+
icon: mn,
|
|
135
135
|
prompt: "Improve the writing: clearer, smoother, same meaning and language.",
|
|
136
136
|
needsSelection: !0
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
id: "fix",
|
|
140
140
|
label: t("fix", "Fix spelling & grammar"),
|
|
141
|
-
icon:
|
|
141
|
+
icon: cn,
|
|
142
142
|
prompt: "Fix the spelling and grammar. Change nothing else.",
|
|
143
143
|
needsSelection: !0
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
id: "shorter",
|
|
147
147
|
label: t("shorter", "Make shorter"),
|
|
148
|
-
icon:
|
|
148
|
+
icon: Zt,
|
|
149
149
|
prompt: "Make it shorter and keep the meaning.",
|
|
150
150
|
needsSelection: !0
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
id: "longer",
|
|
154
154
|
label: t("longer", "Make longer"),
|
|
155
|
-
icon:
|
|
155
|
+
icon: Jt,
|
|
156
156
|
prompt: "Make it longer: develop the ideas and keep the meaning.",
|
|
157
157
|
needsSelection: !0
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
id: "tone",
|
|
161
161
|
label: t("tone", "Change tone"),
|
|
162
|
-
icon:
|
|
162
|
+
icon: on,
|
|
163
163
|
needsSelection: !0,
|
|
164
164
|
actions: An.map((t) => ({
|
|
165
165
|
id: `tone:${t}`,
|
|
@@ -171,21 +171,21 @@ function Pn(e) {
|
|
|
171
171
|
{
|
|
172
172
|
id: "summarise",
|
|
173
173
|
label: t("summarise", "Summarise"),
|
|
174
|
-
icon:
|
|
174
|
+
icon: fn,
|
|
175
175
|
prompt: "Summarise it in a few sentences.",
|
|
176
176
|
needsSelection: !0
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
id: "continue",
|
|
180
180
|
label: t("continue", "Continue writing"),
|
|
181
|
-
icon:
|
|
181
|
+
icon: Qt,
|
|
182
182
|
prompt: "Continue the text from where it stops, in the same style.",
|
|
183
183
|
needsSelection: !1
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
id: "translate",
|
|
187
187
|
label: t("translate", "Translate"),
|
|
188
|
-
icon:
|
|
188
|
+
icon: Gt,
|
|
189
189
|
needsSelection: !0,
|
|
190
190
|
actions: jn.map((t) => ({
|
|
191
191
|
id: `translate:${t}`,
|
|
@@ -216,7 +216,7 @@ function In(e, t) {
|
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-shell.tsx
|
|
218
218
|
function Ln(e, t) {
|
|
219
|
-
return
|
|
219
|
+
return H(() => ({ current: { getBoundingClientRect: () => {
|
|
220
220
|
let { from: n, to: r } = t.getState().range;
|
|
221
221
|
try {
|
|
222
222
|
let t = e.view.coordsAtPos(n), i = e.view.coordsAtPos(r), a = i.bottom - t.top > window.innerHeight / 2, o = a ? i.top : t.top, s = a ? i.left : Math.min(t.left, i.left), c = Math.max(t.right, i.right, s + 1);
|
|
@@ -227,7 +227,7 @@ function Ln(e, t) {
|
|
|
227
227
|
} } }), [e, t]);
|
|
228
228
|
}
|
|
229
229
|
function Rn({ editor: e, controller: t, label: n, slot: r = "editor-assistant", locked: i, onDismiss: a, children: o }) {
|
|
230
|
-
let s =
|
|
230
|
+
let s = rt(), c = Ln(e, t);
|
|
231
231
|
return s ? xn(/* @__PURE__ */ q("section", {
|
|
232
232
|
role: "dialog",
|
|
233
233
|
"aria-label": n,
|
|
@@ -235,10 +235,10 @@ function Rn({ editor: e, controller: t, label: n, slot: r = "editor-assistant",
|
|
|
235
235
|
"data-layout": "sheet",
|
|
236
236
|
className: "fixed inset-x-2 bottom-[max(0.5rem,env(safe-area-inset-bottom))] z-50 max-h-[75svh] overflow-y-auto overscroll-contain rounded-2xl border bg-popover p-3 text-popover-foreground shadow-lg",
|
|
237
237
|
children: o
|
|
238
|
-
}), document.body) : /* @__PURE__ */ J(
|
|
238
|
+
}), document.body) : /* @__PURE__ */ J(Ye, {
|
|
239
239
|
open: !0,
|
|
240
240
|
onOpenChange: (e) => !e && a("outside"),
|
|
241
|
-
children: [/* @__PURE__ */ q(
|
|
241
|
+
children: [/* @__PURE__ */ q(Xe, { virtualRef: c }), /* @__PURE__ */ q(Je, {
|
|
242
242
|
role: "dialog",
|
|
243
243
|
"aria-label": n,
|
|
244
244
|
"data-slot": r,
|
|
@@ -268,7 +268,7 @@ function zn(e) {
|
|
|
268
268
|
e.preventDefault(), t[i]?.focus();
|
|
269
269
|
}
|
|
270
270
|
function Bn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
271
|
-
let { t: r } =
|
|
271
|
+
let { t: r } = A(), [i, a] = W(null), o = H(() => In(i?.actions ?? e, t), [
|
|
272
272
|
i,
|
|
273
273
|
e,
|
|
274
274
|
t
|
|
@@ -291,7 +291,7 @@ function Bn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
291
291
|
"aria-label": i?.label ?? r("material.editor.assistant.actions", "Actions"),
|
|
292
292
|
className: "grid gap-0.5",
|
|
293
293
|
children: [i && /* @__PURE__ */ q(Hn, {
|
|
294
|
-
icon: /* @__PURE__ */ q(
|
|
294
|
+
icon: /* @__PURE__ */ q(Nt, { className: "size-4" }),
|
|
295
295
|
label: r("material.editor.assistant.back", "Back"),
|
|
296
296
|
onClick: () => a(null)
|
|
297
297
|
}), o.map((e) => /* @__PURE__ */ q(Hn, {
|
|
@@ -304,15 +304,15 @@ function Bn({ actions: e, hasSelection: t, onChoose: n }) {
|
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
function Vn({ onAsk: e }) {
|
|
307
|
-
let { t } =
|
|
308
|
-
|
|
307
|
+
let { t } = A(), [n, r] = W(""), i = U(null);
|
|
308
|
+
V(() => i.current?.focus({ preventScroll: !0 }), []);
|
|
309
309
|
let a = () => {
|
|
310
310
|
let t = n.trim();
|
|
311
311
|
t && e(t);
|
|
312
312
|
};
|
|
313
313
|
return /* @__PURE__ */ J("div", {
|
|
314
314
|
className: "flex items-center gap-1.5",
|
|
315
|
-
children: [/* @__PURE__ */ q(
|
|
315
|
+
children: [/* @__PURE__ */ q(Be, {
|
|
316
316
|
ref: i,
|
|
317
317
|
value: n,
|
|
318
318
|
"aria-label": t("material.editor.assistant.ask-label", "Ask the assistant"),
|
|
@@ -322,13 +322,13 @@ function Vn({ onAsk: e }) {
|
|
|
322
322
|
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), a());
|
|
323
323
|
},
|
|
324
324
|
className: "h-9 min-w-0 flex-1"
|
|
325
|
-
}), /* @__PURE__ */ q(
|
|
325
|
+
}), /* @__PURE__ */ q(M, {
|
|
326
326
|
variant: "filled",
|
|
327
327
|
"aria-label": t("material.editor.assistant.send", "Send"),
|
|
328
328
|
disabled: !n.trim(),
|
|
329
329
|
onClick: a,
|
|
330
330
|
className: "size-9",
|
|
331
|
-
children: /* @__PURE__ */ q(
|
|
331
|
+
children: /* @__PURE__ */ q(Ot, {})
|
|
332
332
|
})]
|
|
333
333
|
});
|
|
334
334
|
}
|
|
@@ -348,7 +348,7 @@ function Hn({ icon: e, label: n, submenu: r, onClick: i }) {
|
|
|
348
348
|
className: "min-w-0 flex-1 truncate",
|
|
349
349
|
children: n
|
|
350
350
|
}),
|
|
351
|
-
r && /* @__PURE__ */ q(
|
|
351
|
+
r && /* @__PURE__ */ q(Pt, { className: "size-4 text-muted-foreground rtl:rotate-180" })
|
|
352
352
|
]
|
|
353
353
|
});
|
|
354
354
|
}
|
|
@@ -356,11 +356,11 @@ function Hn({ icon: e, label: n, submenu: r, onClick: i }) {
|
|
|
356
356
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-preview.tsx
|
|
357
357
|
var Un = 90;
|
|
358
358
|
function Wn({ editor: e, markdown: t }) {
|
|
359
|
-
let [n, r] =
|
|
360
|
-
return
|
|
359
|
+
let [n, r] = W(null);
|
|
360
|
+
return V(() => {
|
|
361
361
|
let n = !0, i = setTimeout(() => {
|
|
362
362
|
On(e, t, "inert").then((t) => {
|
|
363
|
-
n && r(
|
|
363
|
+
n && r(wt(t, void 0, Sn(e)));
|
|
364
364
|
}).catch(() => {
|
|
365
365
|
n && r(/* @__PURE__ */ q("p", { children: t }));
|
|
366
366
|
});
|
|
@@ -387,58 +387,58 @@ async function Gn(e) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
function Kn({ text: e }) {
|
|
390
|
-
let { t } =
|
|
391
|
-
return
|
|
390
|
+
let { t } = A(), [n, r] = W(!1);
|
|
391
|
+
return V(() => {
|
|
392
392
|
if (!n) return;
|
|
393
393
|
let e = setTimeout(() => r(!1), 1600);
|
|
394
394
|
return () => clearTimeout(e);
|
|
395
|
-
}, [n]), /* @__PURE__ */ J(
|
|
395
|
+
}, [n]), /* @__PURE__ */ J(j, {
|
|
396
396
|
variant: "ghost",
|
|
397
397
|
size: "sm",
|
|
398
398
|
onClick: async () => r(await Gn(e)),
|
|
399
|
-
children: [q(n ?
|
|
399
|
+
children: [q(n ? jt : Lt, {}), n ? t("material.editor.assistant.copied", "Copied") : t("material.editor.assistant.copy", "Copy")]
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
function qn({ state: e, on: t }) {
|
|
403
|
-
let { t: n } =
|
|
404
|
-
return
|
|
403
|
+
let { t: n } = A(), r = U(null);
|
|
404
|
+
return V(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ J("div", {
|
|
405
405
|
className: "flex flex-wrap items-center gap-1.5",
|
|
406
406
|
children: [
|
|
407
|
-
e.hasSelection && /* @__PURE__ */ J(
|
|
407
|
+
e.hasSelection && /* @__PURE__ */ J(j, {
|
|
408
408
|
ref: r,
|
|
409
409
|
size: "sm",
|
|
410
410
|
disabled: e.applying,
|
|
411
411
|
onClick: () => t.onApply("replace"),
|
|
412
|
-
children: [/* @__PURE__ */ q(
|
|
412
|
+
children: [/* @__PURE__ */ q(nn, {}), n("material.editor.assistant.replace", "Replace selection")]
|
|
413
413
|
}),
|
|
414
|
-
/* @__PURE__ */ J(
|
|
414
|
+
/* @__PURE__ */ J(j, {
|
|
415
415
|
ref: e.hasSelection ? void 0 : r,
|
|
416
416
|
variant: e.hasSelection ? "outlined" : "filled",
|
|
417
417
|
size: "sm",
|
|
418
418
|
disabled: e.applying,
|
|
419
419
|
onClick: () => t.onApply("below"),
|
|
420
|
-
children: [/* @__PURE__ */ q(
|
|
420
|
+
children: [/* @__PURE__ */ q(Rt, {}), n("material.editor.assistant.insert-below", "Insert below")]
|
|
421
421
|
}),
|
|
422
422
|
/* @__PURE__ */ q(Kn, { text: e.text }),
|
|
423
|
-
/* @__PURE__ */ J(
|
|
423
|
+
/* @__PURE__ */ J(j, {
|
|
424
424
|
variant: "ghost",
|
|
425
425
|
size: "sm",
|
|
426
426
|
disabled: e.applying,
|
|
427
427
|
onClick: t.onRetry,
|
|
428
|
-
children: [/* @__PURE__ */ q(
|
|
428
|
+
children: [/* @__PURE__ */ q(rn, {}), n("material.editor.assistant.retry", "Retry")]
|
|
429
429
|
}),
|
|
430
|
-
/* @__PURE__ */ J(
|
|
430
|
+
/* @__PURE__ */ J(j, {
|
|
431
431
|
variant: "ghost",
|
|
432
432
|
size: "sm",
|
|
433
433
|
onClick: t.onDiscard,
|
|
434
|
-
children: [/* @__PURE__ */ q(
|
|
434
|
+
children: [/* @__PURE__ */ q(gn, {}), n("material.editor.assistant.discard", "Discard")]
|
|
435
435
|
})
|
|
436
436
|
]
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
function Jn({ state: e, on: t }) {
|
|
440
|
-
let { t: n } =
|
|
441
|
-
return
|
|
440
|
+
let { t: n } = A(), r = U(null);
|
|
441
|
+
return V(() => r.current?.focus({ preventScroll: !0 }), []), /* @__PURE__ */ J("div", {
|
|
442
442
|
className: "grid gap-2",
|
|
443
443
|
children: [/* @__PURE__ */ q("p", {
|
|
444
444
|
role: "alert",
|
|
@@ -448,19 +448,19 @@ function Jn({ state: e, on: t }) {
|
|
|
448
448
|
}), /* @__PURE__ */ J("div", {
|
|
449
449
|
className: "flex flex-wrap items-center gap-1.5",
|
|
450
450
|
children: [
|
|
451
|
-
/* @__PURE__ */ J(
|
|
451
|
+
/* @__PURE__ */ J(j, {
|
|
452
452
|
ref: r,
|
|
453
453
|
size: "sm",
|
|
454
454
|
onClick: t.onRetry,
|
|
455
|
-
children: [/* @__PURE__ */ q(
|
|
455
|
+
children: [/* @__PURE__ */ q(rn, {}), n("material.editor.assistant.retry", "Retry")]
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */ q(
|
|
457
|
+
/* @__PURE__ */ q(j, {
|
|
458
458
|
variant: "ghost",
|
|
459
459
|
size: "sm",
|
|
460
460
|
onClick: t.onBack,
|
|
461
461
|
children: n("material.editor.assistant.back", "Back")
|
|
462
462
|
}),
|
|
463
|
-
/* @__PURE__ */ q(
|
|
463
|
+
/* @__PURE__ */ q(j, {
|
|
464
464
|
variant: "ghost",
|
|
465
465
|
size: "sm",
|
|
466
466
|
onClick: t.onDiscard,
|
|
@@ -471,8 +471,8 @@ function Jn({ state: e, on: t }) {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
function Yn({ editor: e, state: t, on: n, status: r }) {
|
|
474
|
-
let { t: i } =
|
|
475
|
-
return
|
|
474
|
+
let { t: i } = A(), a = U(null), o = t.phase === "streaming";
|
|
475
|
+
return V(() => {
|
|
476
476
|
o && a.current?.focus({ preventScroll: !0 });
|
|
477
477
|
}, [o]), /* @__PURE__ */ J("div", {
|
|
478
478
|
className: "grid gap-2",
|
|
@@ -482,12 +482,12 @@ function Yn({ editor: e, state: t, on: n, status: r }) {
|
|
|
482
482
|
editor: e,
|
|
483
483
|
markdown: t.text
|
|
484
484
|
}),
|
|
485
|
-
o ? /* @__PURE__ */ q("div", { children: /* @__PURE__ */ J(
|
|
485
|
+
o ? /* @__PURE__ */ q("div", { children: /* @__PURE__ */ J(j, {
|
|
486
486
|
ref: a,
|
|
487
487
|
variant: "tonal",
|
|
488
488
|
size: "sm",
|
|
489
489
|
onClick: n.onStop,
|
|
490
|
-
children: [/* @__PURE__ */ q(
|
|
490
|
+
children: [/* @__PURE__ */ q(ln, {}), i("material.editor.assistant.stop", "Stop")]
|
|
491
491
|
}) }) : /* @__PURE__ */ q(qn, {
|
|
492
492
|
state: t,
|
|
493
493
|
on: n
|
|
@@ -498,11 +498,11 @@ function Yn({ editor: e, state: t, on: n, status: r }) {
|
|
|
498
498
|
//#endregion
|
|
499
499
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-stage.tsx
|
|
500
500
|
function Xn({ label: e, onDiscard: t }) {
|
|
501
|
-
let { t: n } =
|
|
501
|
+
let { t: n } = A();
|
|
502
502
|
return /* @__PURE__ */ J("div", {
|
|
503
503
|
className: "flex items-center gap-2",
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ q(
|
|
505
|
+
/* @__PURE__ */ q(sn, {
|
|
506
506
|
className: "size-4 text-primary-text",
|
|
507
507
|
"aria-hidden": !0
|
|
508
508
|
}),
|
|
@@ -510,12 +510,12 @@ function Xn({ label: e, onDiscard: t }) {
|
|
|
510
510
|
className: "min-w-0 flex-1 truncate font-medium text-sm",
|
|
511
511
|
children: e
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */ q(
|
|
513
|
+
/* @__PURE__ */ q(M, {
|
|
514
514
|
variant: "ghost",
|
|
515
515
|
"aria-label": n("material.editor.assistant.discard", "Discard"),
|
|
516
516
|
onClick: t,
|
|
517
517
|
className: "size-7",
|
|
518
|
-
children: /* @__PURE__ */ q(
|
|
518
|
+
children: /* @__PURE__ */ q(gn, {})
|
|
519
519
|
})
|
|
520
520
|
]
|
|
521
521
|
});
|
|
@@ -539,7 +539,7 @@ function Zn({ editor: e, state: t, actions: n, onChoose: r, on: i }) {
|
|
|
539
539
|
}) : null;
|
|
540
540
|
}
|
|
541
541
|
function Qn({ note: e }) {
|
|
542
|
-
let { t } =
|
|
542
|
+
let { t } = A();
|
|
543
543
|
return e ? /* @__PURE__ */ q("p", {
|
|
544
544
|
role: "status",
|
|
545
545
|
"data-slot": "editor-assistant-note",
|
|
@@ -548,12 +548,12 @@ function Qn({ note: e }) {
|
|
|
548
548
|
}) : null;
|
|
549
549
|
}
|
|
550
550
|
function $n({ phase: e, stopped: t }) {
|
|
551
|
-
let { t: n } =
|
|
551
|
+
let { t: n } = A(), r = n("material.editor.assistant.writing", "Writing…");
|
|
552
552
|
return /* @__PURE__ */ q("div", {
|
|
553
553
|
role: "status",
|
|
554
554
|
"data-slot": "editor-assistant-status",
|
|
555
555
|
className: "flex min-h-6 items-center gap-2 text-muted-foreground text-xs",
|
|
556
|
-
children: e === "streaming" ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
556
|
+
children: e === "streaming" ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Te, {
|
|
557
557
|
label: r,
|
|
558
558
|
className: "size-6"
|
|
559
559
|
}), r] }) : t ? n("material.editor.assistant.stopped", "Stopped") : n("material.editor.assistant.ready", "Answer ready")
|
|
@@ -597,17 +597,17 @@ var nr = {
|
|
|
597
597
|
}, rr = () => () => {}, ir = (e) => e ? er(e)?.controller : void 0;
|
|
598
598
|
function ar(e) {
|
|
599
599
|
let t = ir(e);
|
|
600
|
-
return
|
|
600
|
+
return G(t?.subscribe ?? rr, t?.getState ?? (() => nr), () => nr);
|
|
601
601
|
}
|
|
602
602
|
//#endregion
|
|
603
603
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-panel.tsx
|
|
604
604
|
function or(e) {
|
|
605
|
-
let { handle: t, chrome: n } =
|
|
605
|
+
let { handle: t, chrome: n } = O(), r = t.features.some((e) => e.key === "assistant");
|
|
606
606
|
return !t.editor || !r || n.state.panel !== "assistant" ? null : /* @__PURE__ */ q(sr, {});
|
|
607
607
|
}
|
|
608
608
|
function sr() {
|
|
609
|
-
let { t: e, language: t } =
|
|
610
|
-
if (
|
|
609
|
+
let { t: e, language: t } = A(), { handle: n } = O(), r = n.editor, i = er(r), a = ar(r), o = i?.controller, s = H(() => Fn(i?.actions, e), [i?.actions, e]);
|
|
610
|
+
if (V(() => (o?.getState().phase === "idle" && o.begin(), () => o?.reset()), [o]), !o || a.phase === "idle") return null;
|
|
611
611
|
let c = (e) => {
|
|
612
612
|
o.close(), e !== "outside" && r.commands.focus();
|
|
613
613
|
}, l = () => c("discard"), u = (e) => void o.run({
|
|
@@ -649,12 +649,12 @@ function sr() {
|
|
|
649
649
|
//#region lib/components/ui/widgets/editor/extensions/collab/use-presence.ts
|
|
650
650
|
var cr = [], lr = () => () => {};
|
|
651
651
|
function ur() {
|
|
652
|
-
let { editor: e } =
|
|
652
|
+
let { editor: e } = O().handle;
|
|
653
653
|
return dr(e);
|
|
654
654
|
}
|
|
655
655
|
function dr(e) {
|
|
656
656
|
let t = e?.storage.nxgtPresence?.store ?? null;
|
|
657
|
-
return
|
|
657
|
+
return G(t ? t.subscribe : lr, t ? t.getSnapshot : () => cr, () => cr);
|
|
658
658
|
}
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region lib/components/ui/widgets/editor/extensions/collab/editor-presence.tsx
|
|
@@ -681,30 +681,30 @@ function pr({ user: e }) {
|
|
|
681
681
|
"aria-label": e.name,
|
|
682
682
|
title: e.name,
|
|
683
683
|
className: "flex",
|
|
684
|
-
children: /* @__PURE__ */ q(
|
|
684
|
+
children: /* @__PURE__ */ q(ge, { fallback: /* @__PURE__ */ q("span", {
|
|
685
685
|
ref: (t) => {
|
|
686
|
-
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg",
|
|
686
|
+
t?.style.setProperty("--nxgt-collab-color", e.color), t?.style.setProperty("--nxgt-collab-fg", Et(e.color));
|
|
687
687
|
},
|
|
688
688
|
className: "grid size-full place-items-center rounded-full bg-[var(--nxgt-collab-color)] text-[var(--nxgt-collab-fg)]",
|
|
689
|
-
children:
|
|
689
|
+
children: Tt(e.name)
|
|
690
690
|
}) })
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
693
|
function mr({ status: e, max: n = 4, className: r }) {
|
|
694
|
-
let { t: i } =
|
|
694
|
+
let { t: i } = A(), a = ur();
|
|
695
695
|
if (!e && a.length === 0) return null;
|
|
696
696
|
let [o, s, c] = e ? fr[e] : [];
|
|
697
697
|
return /* @__PURE__ */ J("div", {
|
|
698
698
|
"data-slot": "editor-presence",
|
|
699
699
|
"data-status": e,
|
|
700
700
|
className: t("flex items-center gap-3", r),
|
|
701
|
-
children: [s && o && /* @__PURE__ */ q(
|
|
701
|
+
children: [s && o && /* @__PURE__ */ q(Fe, {
|
|
702
702
|
tone: o,
|
|
703
703
|
pulse: e === "connecting",
|
|
704
704
|
role: "status",
|
|
705
705
|
className: "text-muted-foreground text-xs",
|
|
706
706
|
children: i(s, c)
|
|
707
|
-
}), a.length > 0 && /* @__PURE__ */ q(
|
|
707
|
+
}), a.length > 0 && /* @__PURE__ */ q(Ce, {
|
|
708
708
|
size: "sm",
|
|
709
709
|
max: n,
|
|
710
710
|
role: "group",
|
|
@@ -719,7 +719,7 @@ var hr = "[&_textarea]:min-w-0", gr = (e) => e.key === "Enter" && (e.metaKey ||
|
|
|
719
719
|
//#endregion
|
|
720
720
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer-form.tsx
|
|
721
721
|
function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
722
|
-
let { t: a } =
|
|
722
|
+
let { t: a } = A(), o = e.error === "invalid-id" ? a("material.editor.comments.invalid-id", "The adapter answered a thread id that is not allowed.") : e.error;
|
|
723
723
|
return /* @__PURE__ */ J("form", {
|
|
724
724
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2.5",
|
|
725
725
|
onSubmit: (e) => {
|
|
@@ -733,7 +733,7 @@ function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
733
733
|
className: "line-clamp-2 border-s-2 ps-2 text-muted-foreground text-xs italic",
|
|
734
734
|
children: e.quote
|
|
735
735
|
}),
|
|
736
|
-
/* @__PURE__ */ q(
|
|
736
|
+
/* @__PURE__ */ q(S, {
|
|
737
737
|
className: hr,
|
|
738
738
|
"aria-label": a("material.editor.comments.body-label", "Comment"),
|
|
739
739
|
placeholder: a("material.editor.comments.placeholder", "Write a comment…"),
|
|
@@ -760,17 +760,17 @@ function _r({ composer: e, body: t, onBody: n, onSubmit: r, onDismiss: i }) {
|
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
function vr({ pending: e, empty: t, onDismiss: n }) {
|
|
763
|
-
let { t: r } =
|
|
763
|
+
let { t: r } = A();
|
|
764
764
|
return /* @__PURE__ */ J("div", {
|
|
765
765
|
className: "flex justify-end gap-2",
|
|
766
|
-
children: [/* @__PURE__ */ q(
|
|
766
|
+
children: [/* @__PURE__ */ q(j, {
|
|
767
767
|
type: "button",
|
|
768
768
|
size: "sm",
|
|
769
769
|
variant: "ghost",
|
|
770
770
|
disabled: e,
|
|
771
771
|
onClick: n,
|
|
772
772
|
children: r("material.editor.comments.cancel", "Cancel")
|
|
773
|
-
}), /* @__PURE__ */ q(
|
|
773
|
+
}), /* @__PURE__ */ q(j, {
|
|
774
774
|
type: "submit",
|
|
775
775
|
size: "sm",
|
|
776
776
|
loading: e,
|
|
@@ -797,7 +797,7 @@ var yr = (e = !1) => ({
|
|
|
797
797
|
}, br = () => () => {}, xr = yr(), Sr = (e) => e ? Y(e)?.controller : void 0;
|
|
798
798
|
function Cr(e) {
|
|
799
799
|
let t = Sr(e);
|
|
800
|
-
return
|
|
800
|
+
return G(t?.subscribe ?? br, t?.getState ?? (() => xr), () => xr);
|
|
801
801
|
}
|
|
802
802
|
//#endregion
|
|
803
803
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-live.tsx
|
|
@@ -809,7 +809,7 @@ var wr = {
|
|
|
809
809
|
deleted: ["deleted-notice", "Thread deleted"]
|
|
810
810
|
};
|
|
811
811
|
function Tr({ editor: e }) {
|
|
812
|
-
let { t } =
|
|
812
|
+
let { t } = A(), { notice: n } = Cr(e), r = n ? wr[n.kind] : null;
|
|
813
813
|
return /* @__PURE__ */ q("div", {
|
|
814
814
|
role: "status",
|
|
815
815
|
"aria-live": "polite",
|
|
@@ -821,7 +821,7 @@ function Tr({ editor: e }) {
|
|
|
821
821
|
//#endregion
|
|
822
822
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-composer.tsx
|
|
823
823
|
function Er(e) {
|
|
824
|
-
let { handle: t } =
|
|
824
|
+
let { handle: t } = O(), { editor: n } = t;
|
|
825
825
|
return !n || !Y(n) ? null : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(Dr, { editor: n }), /* @__PURE__ */ q(Tr, { editor: n })] });
|
|
826
826
|
}
|
|
827
827
|
function Dr({ editor: e }) {
|
|
@@ -832,11 +832,11 @@ function Dr({ editor: e }) {
|
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
function Or({ editor: e, controller: t }) {
|
|
835
|
-
let { t: n } =
|
|
836
|
-
|
|
835
|
+
let { t: n } = A(), { chrome: r } = O(), i = Cr(e).composer, { actions: a } = r;
|
|
836
|
+
V(() => (a.setBubbleSuppressed(!0), () => {
|
|
837
837
|
a.setBubbleSuppressed(!1);
|
|
838
838
|
}), [a]);
|
|
839
|
-
let [o, s] =
|
|
839
|
+
let [o, s] = W(""), c = H(() => ({ getState: () => ({ range: t.getState().composer?.range ?? {
|
|
840
840
|
from: 0,
|
|
841
841
|
to: 0
|
|
842
842
|
} }) }), [t]);
|
|
@@ -867,14 +867,14 @@ function kr(e, t) {
|
|
|
867
867
|
return !n || !(t instanceof Element) ? !1 : n.contains(t) ? !0 : n.getAttribute("aria-expanded") === "true" && !!t.closest("[role=\"menu\"]");
|
|
868
868
|
}
|
|
869
869
|
function Ar({ id: e, children: t, ...n }) {
|
|
870
|
-
let { chrome: r, toolbarRef: i } =
|
|
871
|
-
return
|
|
870
|
+
let { chrome: r, toolbarRef: i } = O(), a = r.state.panel === e, [o, s] = W();
|
|
871
|
+
return bn(() => {
|
|
872
872
|
let e = i.current, t = e?.getAttribute("aria-orientation") === "vertical" ? getComputedStyle(e).direction === "rtl" ? "left" : "right" : void 0;
|
|
873
873
|
t !== o && s(t);
|
|
874
|
-
}), /* @__PURE__ */ J(
|
|
874
|
+
}), /* @__PURE__ */ J(Ye, {
|
|
875
875
|
open: a,
|
|
876
876
|
onOpenChange: (t) => t ? r.actions.openPanel(e) : r.actions.closePanel(),
|
|
877
|
-
children: [/* @__PURE__ */ q(
|
|
877
|
+
children: [/* @__PURE__ */ q(Xe, { virtualRef: i }), /* @__PURE__ */ q(Je, {
|
|
878
878
|
"data-panel": e,
|
|
879
879
|
side: o,
|
|
880
880
|
align: "start",
|
|
@@ -895,15 +895,15 @@ function Ar({ id: e, children: t, ...n }) {
|
|
|
895
895
|
//#endregion
|
|
896
896
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-status.tsx
|
|
897
897
|
function jr({ state: e, controller: t, count: n }) {
|
|
898
|
-
let { t: r } =
|
|
899
|
-
return n === 0 && !e.showResolved ? null : /* @__PURE__ */ q(
|
|
898
|
+
let { t: r } = A();
|
|
899
|
+
return n === 0 && !e.showResolved ? null : /* @__PURE__ */ q(u, {
|
|
900
900
|
label: r("material.editor.comments.show-resolved", "Show resolved"),
|
|
901
901
|
checked: e.showResolved,
|
|
902
902
|
onCheckedChange: t.setShowResolved
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
905
|
function Mr({ state: e, empty: t }) {
|
|
906
|
-
let { t: n } =
|
|
906
|
+
let { t: n } = A(), r = null;
|
|
907
907
|
return e.phase === "loading" ? r = n("material.editor.comments.loading", "Loading comments…") : e.phase === "failed" ? r = n("material.editor.comments.load-failed", "Comments could not be loaded: {message}", { message: e.loadError ?? "" }) : t && (r = n("material.editor.comments.empty", "No comments yet")), r ? /* @__PURE__ */ q("p", {
|
|
908
908
|
role: e.phase === "failed" ? "alert" : void 0,
|
|
909
909
|
className: "px-1 text-muted-foreground text-sm",
|
|
@@ -913,10 +913,10 @@ function Mr({ state: e, empty: t }) {
|
|
|
913
913
|
//#endregion
|
|
914
914
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-edit-form.tsx
|
|
915
915
|
function Nr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
916
|
-
let { t: i } =
|
|
916
|
+
let { t: i } = A();
|
|
917
917
|
return /* @__PURE__ */ J("div", {
|
|
918
918
|
className: "grid grid-cols-[minmax(0,1fr)] gap-2",
|
|
919
|
-
children: [/* @__PURE__ */ q(
|
|
919
|
+
children: [/* @__PURE__ */ q(S, {
|
|
920
920
|
className: hr,
|
|
921
921
|
"aria-label": i("material.editor.comments.body-label", "Comment"),
|
|
922
922
|
value: e,
|
|
@@ -928,13 +928,13 @@ function Nr({ draft: e, onChange: t, onSave: n, onCancel: r }) {
|
|
|
928
928
|
}
|
|
929
929
|
}), /* @__PURE__ */ J("div", {
|
|
930
930
|
className: "flex gap-2",
|
|
931
|
-
children: [/* @__PURE__ */ q(
|
|
931
|
+
children: [/* @__PURE__ */ q(j, {
|
|
932
932
|
size: "sm",
|
|
933
933
|
variant: "tonal",
|
|
934
934
|
disabled: !e.trim(),
|
|
935
935
|
onClick: n,
|
|
936
936
|
children: i("material.editor.comments.save", "Save")
|
|
937
|
-
}), /* @__PURE__ */ q(
|
|
937
|
+
}), /* @__PURE__ */ q(j, {
|
|
938
938
|
size: "sm",
|
|
939
939
|
variant: "ghost",
|
|
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) || !Ct(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,
|
|
@@ -1007,12 +1007,12 @@ function Yr(e, t, n) {
|
|
|
1007
1007
|
//#region lib/components/ui/widgets/editor/extensions/comments/comment-entry.tsx
|
|
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
|
-
let { t: r, language: i } =
|
|
1010
|
+
let { t: r, language: i } = A();
|
|
1011
1011
|
return /* @__PURE__ */ J("div", {
|
|
1012
1012
|
className: "flex items-center gap-2",
|
|
1013
1013
|
children: [
|
|
1014
|
-
/* @__PURE__ */ q(
|
|
1015
|
-
src:
|
|
1014
|
+
/* @__PURE__ */ q(ge, {
|
|
1015
|
+
src: mt(e.author.avatarUrl),
|
|
1016
1016
|
alt: "",
|
|
1017
1017
|
fallback: Xr(e.author.name),
|
|
1018
1018
|
className: "size-6 text-[0.625rem]"
|
|
@@ -1026,7 +1026,7 @@ function Zr({ comment: e, pending: t, onEdit: n }) {
|
|
|
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__ */ q(
|
|
1029
|
+
n && !t && /* @__PURE__ */ q(j, {
|
|
1030
1030
|
variant: "ghost",
|
|
1031
1031
|
size: "xs",
|
|
1032
1032
|
className: "ms-auto",
|
|
@@ -1037,7 +1037,7 @@ 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] = W(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
|
};
|
|
@@ -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 } =
|
|
1066
|
+
let { t: r } = A(), [i, a] = W(""), 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__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
1070
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(S, {
|
|
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…"),
|
|
@@ -1080,7 +1080,7 @@ function $r({ thread: e, controller: t, canRemove: n }) {
|
|
|
1080
1080
|
}), /* @__PURE__ */ J("div", {
|
|
1081
1081
|
className: "flex flex-wrap gap-2",
|
|
1082
1082
|
children: [
|
|
1083
|
-
/* @__PURE__ */ q(
|
|
1083
|
+
/* @__PURE__ */ q(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__ */ q(
|
|
1091
|
+
/* @__PURE__ */ q(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__ */ q(
|
|
1097
|
+
n && /* @__PURE__ */ q(j, {
|
|
1098
1098
|
size: "sm",
|
|
1099
1099
|
variant: "ghost",
|
|
1100
1100
|
color: "error",
|
|
@@ -1108,7 +1108,7 @@ function $r({ thread: e, controller: t, canRemove: n }) {
|
|
|
1108
1108
|
//#endregion
|
|
1109
1109
|
//#region lib/components/ui/widgets/editor/extensions/comments/thread-card.tsx
|
|
1110
1110
|
function ei(e) {
|
|
1111
|
-
let { thread: n, controller: r, active: i, detached: a, error: o, user: s } = e, { t: c } =
|
|
1111
|
+
let { thread: n, controller: r, active: i, detached: a, error: o, user: s } = e, { t: c } = A(), l = n.comments[0]?.author.id === s?.id && !!s;
|
|
1112
1112
|
return /* @__PURE__ */ J("section", {
|
|
1113
1113
|
ref: e.cardRef,
|
|
1114
1114
|
"data-slot": "comment-thread",
|
|
@@ -1152,7 +1152,7 @@ function ei(e) {
|
|
|
1152
1152
|
//#endregion
|
|
1153
1153
|
//#region lib/components/ui/widgets/editor/extensions/comments/detached-threads.tsx
|
|
1154
1154
|
function ti({ views: e }) {
|
|
1155
|
-
let { t } =
|
|
1155
|
+
let { t } = A(), { controller: n, state: r, detached: i } = e;
|
|
1156
1156
|
return !n || i.length === 0 ? null : /* @__PURE__ */ J("section", {
|
|
1157
1157
|
"data-slot": "comment-detached",
|
|
1158
1158
|
className: "grid gap-2",
|
|
@@ -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 = ft(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 = Y(e), r = mi(t), { anchors: i } = t, a =
|
|
1450
|
+
let t = Cr(e), n = Y(e), r = mi(t), { anchors: i } = t, a = H(() => {
|
|
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) ?? []),
|
|
@@ -1467,7 +1467,7 @@ function _i(e) {
|
|
|
1467
1467
|
//#endregion
|
|
1468
1468
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-panel.tsx
|
|
1469
1469
|
function vi(e) {
|
|
1470
|
-
let { handle: t, chrome: n } =
|
|
1470
|
+
let { handle: t, chrome: n } = O(), { editor: r } = t;
|
|
1471
1471
|
return !r || !Y(r) ? null : /* @__PURE__ */ q(Ar, {
|
|
1472
1472
|
id: "comments",
|
|
1473
1473
|
className: "max-h-[min(36rem,80svh)] w-96 max-w-[92vw] overflow-y-auto p-3",
|
|
@@ -1476,16 +1476,16 @@ function vi(e) {
|
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
1478
|
function yi({ editor: e }) {
|
|
1479
|
-
let { t } =
|
|
1480
|
-
if (
|
|
1479
|
+
let { t } = A(), n = _i(e), { controller: r, state: i, anchored: a } = n, o = U(null);
|
|
1480
|
+
if (V(() => {
|
|
1481
1481
|
o.current?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" });
|
|
1482
1482
|
}, [i.activeId]), !r) return null;
|
|
1483
|
-
let s = (e, t) => /* @__PURE__ */ q(
|
|
1483
|
+
let s = (e, t) => /* @__PURE__ */ q(M, {
|
|
1484
1484
|
variant: "ghost",
|
|
1485
1485
|
"aria-label": t,
|
|
1486
1486
|
tooltip: t,
|
|
1487
1487
|
onClick: () => r.step(e),
|
|
1488
|
-
children: q(e > 0 ?
|
|
1488
|
+
children: q(e > 0 ? Mt : Ft, {})
|
|
1489
1489
|
});
|
|
1490
1490
|
return /* @__PURE__ */ J("div", {
|
|
1491
1491
|
ref: o,
|
|
@@ -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 = U(null);
|
|
1566
|
+
return V(() => {
|
|
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 = U(/* @__PURE__ */ new Map()), a = U(/* @__PURE__ */ new Map()), o = U(0), [s, c] = W({
|
|
1587
1587
|
tops: {},
|
|
1588
1588
|
height: 0,
|
|
1589
1589
|
measured: !1
|
|
1590
|
-
}), l =
|
|
1590
|
+
}), l = U({
|
|
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 = B(() => {
|
|
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 = B(() => {
|
|
1608
1608
|
o.current ||= requestAnimationFrame(() => {
|
|
1609
1609
|
o.current = 0, f();
|
|
1610
1610
|
});
|
|
1611
1611
|
}, [f]);
|
|
1612
|
-
|
|
1612
|
+
bn(f, [
|
|
1613
1613
|
u,
|
|
1614
1614
|
r,
|
|
1615
1615
|
f
|
|
1616
|
-
]),
|
|
1616
|
+
]), V(p, [d, p]);
|
|
1617
1617
|
let { observe: m, unobserve: h } = Ti(e, i, p);
|
|
1618
|
-
return
|
|
1618
|
+
return V(() => () => {
|
|
1619
1619
|
cancelAnimationFrame(o.current), o.current = 0;
|
|
1620
1620
|
}, []), {
|
|
1621
1621
|
layout: s,
|
|
@@ -1631,15 +1631,15 @@ function Ei(e, t, n, r) {
|
|
|
1631
1631
|
//#endregion
|
|
1632
1632
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-rail.tsx
|
|
1633
1633
|
function Di(e) {
|
|
1634
|
-
let { handle: t } =
|
|
1634
|
+
let { handle: t } = O(), { editor: n } = t;
|
|
1635
1635
|
return !n || !Y(n) ? null : /* @__PURE__ */ q(Oi, { editor: n });
|
|
1636
1636
|
}
|
|
1637
1637
|
function Oi({ editor: e }) {
|
|
1638
|
-
let { t } =
|
|
1638
|
+
let { t } = A(), n = _i(e), { controller: r, state: i, anchored: a } = n, o = U(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 V(() => (r?.setRail(!0), () => r?.setRail(!1)), [r]), r ? /* @__PURE__ */ J("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",
|
|
@@ -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 = ut.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: $t,
|
|
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: Ht,
|
|
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: Ut,
|
|
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: Wt,
|
|
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: Kt,
|
|
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: tn,
|
|
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 ? ut.create(e.doc, t.pos) : R.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
|
|
1792
|
+
return a >= n.pos && a <= n.pos + n.node.nodeSize && e.selection instanceof R ? i.setSelection(R.create(i.doc, o + u, a + u)) : e.selection instanceof ut && i.setSelection(ut.create(i.doc, n.pos + u)), i.scrollIntoView();
|
|
1793
1793
|
}
|
|
1794
1794
|
function Ri(e, t = Fi(e)) {
|
|
1795
1795
|
if (!t) return null;
|
|
@@ -1809,7 +1809,7 @@ function zi(e, t = Fi(e)) {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
n.delete(t.pos, r);
|
|
1811
1811
|
let i = Math.min(t.pos, n.doc.content.size);
|
|
1812
|
-
return n.setSelection(
|
|
1812
|
+
return n.setSelection(R.near(n.doc.resolve(i), -1)).scrollIntoView();
|
|
1813
1813
|
}
|
|
1814
1814
|
//#endregion
|
|
1815
1815
|
//#region lib/components/ui/widgets/editor/extensions/block/block-menu.tsx
|
|
@@ -1818,52 +1818,52 @@ function Bi(e, t) {
|
|
|
1818
1818
|
n && e.view.dispatch(n), e.isDestroyed || e.commands.focus();
|
|
1819
1819
|
}
|
|
1820
1820
|
function Vi({ editor: e, block: t }) {
|
|
1821
|
-
let { t: n } =
|
|
1821
|
+
let { t: n } = A(), { doc: r } = e.state, i = () => ({
|
|
1822
1822
|
...t,
|
|
1823
1823
|
node: r.child(t.index)
|
|
1824
1824
|
});
|
|
1825
1825
|
return /* @__PURE__ */ J(K, { children: [
|
|
1826
|
-
/* @__PURE__ */ J(
|
|
1826
|
+
/* @__PURE__ */ J(Ge, { children: [/* @__PURE__ */ q(He, { children: n("material.editor.block.turn-into", "Turn into") }), Ni(e).map((t) => /* @__PURE__ */ J(k, {
|
|
1827
1827
|
onSelect: () => t.run(e),
|
|
1828
1828
|
children: [/* @__PURE__ */ q(t.icon, {}), n(t.key, t.label)]
|
|
1829
1829
|
}, t.id))] }),
|
|
1830
|
-
/* @__PURE__ */ q(
|
|
1831
|
-
/* @__PURE__ */ J(
|
|
1832
|
-
/* @__PURE__ */ J(
|
|
1830
|
+
/* @__PURE__ */ q(We, {}),
|
|
1831
|
+
/* @__PURE__ */ J(Ge, { children: [
|
|
1832
|
+
/* @__PURE__ */ J(k, {
|
|
1833
1833
|
onSelect: () => Bi(e, () => Ri(e.state, i())),
|
|
1834
|
-
children: [/* @__PURE__ */ q(
|
|
1834
|
+
children: [/* @__PURE__ */ q(Lt, {}), n("material.editor.block.duplicate", "Duplicate")]
|
|
1835
1835
|
}),
|
|
1836
|
-
/* @__PURE__ */ J(
|
|
1836
|
+
/* @__PURE__ */ J(k, {
|
|
1837
1837
|
disabled: t.index === 0,
|
|
1838
1838
|
onSelect: () => Bi(e, () => Li(e.state, -1, i())),
|
|
1839
1839
|
children: [
|
|
1840
|
-
/* @__PURE__ */ q(
|
|
1840
|
+
/* @__PURE__ */ q(Ot, {}),
|
|
1841
1841
|
n("material.editor.block.move-up", "Move up"),
|
|
1842
|
-
/* @__PURE__ */ q(
|
|
1842
|
+
/* @__PURE__ */ q(Ke, { children: "⌥⇧↑" })
|
|
1843
1843
|
]
|
|
1844
1844
|
}),
|
|
1845
|
-
/* @__PURE__ */ J(
|
|
1845
|
+
/* @__PURE__ */ J(k, {
|
|
1846
1846
|
disabled: t.index >= r.childCount - 1,
|
|
1847
1847
|
onSelect: () => Bi(e, () => Li(e.state, 1, i())),
|
|
1848
1848
|
children: [
|
|
1849
|
-
/* @__PURE__ */ q(
|
|
1849
|
+
/* @__PURE__ */ q(Dt, {}),
|
|
1850
1850
|
n("material.editor.block.move-down", "Move down"),
|
|
1851
|
-
/* @__PURE__ */ q(
|
|
1851
|
+
/* @__PURE__ */ q(Ke, { children: "⌥⇧↓" })
|
|
1852
1852
|
]
|
|
1853
1853
|
})
|
|
1854
1854
|
] }),
|
|
1855
|
-
/* @__PURE__ */ q(
|
|
1856
|
-
/* @__PURE__ */ J(
|
|
1855
|
+
/* @__PURE__ */ q(We, {}),
|
|
1856
|
+
/* @__PURE__ */ J(k, {
|
|
1857
1857
|
variant: "error",
|
|
1858
1858
|
onSelect: () => Bi(e, () => zi(e.state, i())),
|
|
1859
|
-
children: [/* @__PURE__ */ q(
|
|
1859
|
+
children: [/* @__PURE__ */ q(pn, {}), 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] = W(null), [a, o] = W(null), s = B(() => {
|
|
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 V(() => {
|
|
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: B((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: B(() => {
|
|
1911
1911
|
n || i(null);
|
|
1912
1912
|
}, [n])
|
|
1913
1913
|
};
|
|
@@ -1915,7 +1915,7 @@ function Hi(e, t, n) {
|
|
|
1915
1915
|
//#endregion
|
|
1916
1916
|
//#region lib/components/ui/widgets/editor/partials/editor-block-handle.tsx
|
|
1917
1917
|
function Ui({ children: e, className: t }) {
|
|
1918
|
-
let { handle: n } =
|
|
1918
|
+
let { handle: n } = O(), r = n.features.some((e) => e.key === "dragHandle");
|
|
1919
1919
|
return !n.editor || !r ? /* @__PURE__ */ q("div", {
|
|
1920
1920
|
className: t,
|
|
1921
1921
|
children: e
|
|
@@ -1926,7 +1926,7 @@ function Ui({ children: e, className: t }) {
|
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
1928
|
function Wi({ editor: e, children: n, className: r }) {
|
|
1929
|
-
let { chrome: i } =
|
|
1929
|
+
let { chrome: i } = O(), a = U(null), o = N({
|
|
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);
|
|
@@ -1944,24 +1944,24 @@ function Wi({ editor: e, children: n, className: r }) {
|
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
function Gi({ editor: e, active: n, open: r }) {
|
|
1947
|
-
let { t: i } =
|
|
1947
|
+
let { t: i } = A(), { chrome: a } = O();
|
|
1948
1948
|
return /* @__PURE__ */ J("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__ */ q(
|
|
1953
|
+
children: [/* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
1959
|
-
}), /* @__PURE__ */ J(
|
|
1958
|
+
children: /* @__PURE__ */ q(en, {})
|
|
1959
|
+
}), /* @__PURE__ */ J(qe, {
|
|
1960
1960
|
open: r,
|
|
1961
1961
|
onOpenChange: (e) => e ? a.actions.openPanel("block") : a.actions.closePanel(),
|
|
1962
|
-
children: [/* @__PURE__ */ q(
|
|
1962
|
+
children: [/* @__PURE__ */ q(Ve, {
|
|
1963
1963
|
asChild: !0,
|
|
1964
|
-
children: /* @__PURE__ */ q(
|
|
1964
|
+
children: /* @__PURE__ */ q(M, {
|
|
1965
1965
|
variant: "ghost",
|
|
1966
1966
|
draggable: !0,
|
|
1967
1967
|
className: "size-6 cursor-grab text-muted-foreground active:cursor-grabbing",
|
|
@@ -1973,9 +1973,9 @@ 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__ */ q(
|
|
1976
|
+
children: /* @__PURE__ */ q(Vt, {})
|
|
1977
1977
|
})
|
|
1978
|
-
}), /* @__PURE__ */ q(
|
|
1978
|
+
}), /* @__PURE__ */ q(Ue, {
|
|
1979
1979
|
align: "start",
|
|
1980
1980
|
onCloseAutoFocus: (t) => {
|
|
1981
1981
|
t.preventDefault(), e.isDestroyed || e.commands.focus();
|
|
@@ -1991,7 +1991,7 @@ function Gi({ editor: e, active: n, open: r }) {
|
|
|
1991
1991
|
//#endregion
|
|
1992
1992
|
//#region lib/components/ui/widgets/editor/extensions/find/find-fields.tsx
|
|
1993
1993
|
function Ki({ find: e }) {
|
|
1994
|
-
let { t } =
|
|
1994
|
+
let { t } = A(), n = "";
|
|
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
|
|
@@ -2003,45 +2003,45 @@ function Ki({ find: e }) {
|
|
|
2003
2003
|
});
|
|
2004
2004
|
}
|
|
2005
2005
|
function qi({ find: e }) {
|
|
2006
|
-
let { t } =
|
|
2007
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
2006
|
+
let { t } = A();
|
|
2007
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(he, {
|
|
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__ */ q(
|
|
2013
|
-
}), /* @__PURE__ */ q(
|
|
2012
|
+
children: /* @__PURE__ */ q(At, {})
|
|
2013
|
+
}), /* @__PURE__ */ q(he, {
|
|
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__ */ q(
|
|
2018
|
+
children: /* @__PURE__ */ q(hn, {})
|
|
2019
2019
|
})] });
|
|
2020
2020
|
}
|
|
2021
2021
|
function Ji({ disabled: e, onStep: t }) {
|
|
2022
|
-
let { t: n } =
|
|
2023
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
2022
|
+
let { t: n } = A();
|
|
2023
|
+
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
2030
|
-
}), /* @__PURE__ */ q(
|
|
2029
|
+
children: /* @__PURE__ */ q(Ft, {})
|
|
2030
|
+
}), /* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
2036
|
+
children: /* @__PURE__ */ q(Mt, {})
|
|
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
|
-
let { t: c } =
|
|
2040
|
+
let { t: c } = A();
|
|
2041
2041
|
return /* @__PURE__ */ J("div", {
|
|
2042
2042
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2043
2043
|
children: [
|
|
2044
|
-
/* @__PURE__ */ q(
|
|
2044
|
+
/* @__PURE__ */ q(Be, {
|
|
2045
2045
|
ref: t,
|
|
2046
2046
|
type: "search",
|
|
2047
2047
|
"aria-label": c("material.editor.find.find", "Find"),
|
|
@@ -2052,25 +2052,25 @@ function Yi({ find: e, inputRef: t, onStep: n, onClose: r, onKeyDown: i, replace
|
|
|
2052
2052
|
className: "h-8 min-w-0 flex-1 basis-40 sm:max-w-64"
|
|
2053
2053
|
}),
|
|
2054
2054
|
/* @__PURE__ */ q(qi, { find: e }),
|
|
2055
|
-
o && /* @__PURE__ */ q(
|
|
2055
|
+
o && /* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
2061
|
+
children: /* @__PURE__ */ q(nn, {})
|
|
2062
2062
|
}),
|
|
2063
2063
|
/* @__PURE__ */ q(Ki, { find: e }),
|
|
2064
2064
|
/* @__PURE__ */ q(Ji, {
|
|
2065
2065
|
disabled: e.total === 0,
|
|
2066
2066
|
onStep: n
|
|
2067
2067
|
}),
|
|
2068
|
-
/* @__PURE__ */ q(
|
|
2068
|
+
/* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
2073
|
+
children: /* @__PURE__ */ q(gn, {})
|
|
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 X = new
|
|
2113
|
+
var X = new lt("nxgtFind"), ia = "";
|
|
2114
2114
|
function aa(e) {
|
|
2115
2115
|
let t = [];
|
|
2116
2116
|
return e.descendants((e, n) => e.isTextblock ? (t.push({
|
|
@@ -2119,18 +2119,18 @@ function aa(e) {
|
|
|
2119
2119
|
}), !1) : !0), t;
|
|
2120
2120
|
}
|
|
2121
2121
|
function oa(e, t) {
|
|
2122
|
-
return
|
|
2122
|
+
return F.create(e, t.map((e) => I.inline(e.from, e.to, { class: "nxgt-find-match" })));
|
|
2123
2123
|
}
|
|
2124
2124
|
function sa(e, t) {
|
|
2125
2125
|
let n = t.matches[t.current];
|
|
2126
|
-
return n ?
|
|
2126
|
+
return n ? F.create(e, [I.inline(n.from, n.to, { class: "nxgt-find-current" })]) : F.empty;
|
|
2127
2127
|
}
|
|
2128
2128
|
var ca = () => ({
|
|
2129
2129
|
...Xi,
|
|
2130
2130
|
term: "",
|
|
2131
2131
|
matches: [],
|
|
2132
2132
|
current: -1,
|
|
2133
|
-
decorations:
|
|
2133
|
+
decorations: F.empty
|
|
2134
2134
|
});
|
|
2135
2135
|
function la(e, t, n) {
|
|
2136
2136
|
let r = ta(aa(e), t.term, t);
|
|
@@ -2192,7 +2192,7 @@ function da(e, t, n) {
|
|
|
2192
2192
|
}), !1)), n && (n.blocks += r.length), s.push(...ta(r, t.term, t));
|
|
2193
2193
|
}
|
|
2194
2194
|
let c = [...a, ...s].sort((e, t) => e.from - t.from);
|
|
2195
|
-
s.length > 0 && (o = o.add(e.doc, s.map((e) =>
|
|
2195
|
+
s.length > 0 && (o = o.add(e.doc, s.map((e) => I.inline(e.from, e.to, { class: "nxgt-find-match" }))));
|
|
2196
2196
|
let l = t.current >= 0 && t.matches.length === c.length ? Math.min(t.current, c.length - 1) : na(c, e.selection.from);
|
|
2197
2197
|
return {
|
|
2198
2198
|
...t,
|
|
@@ -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] = W(() => pa(e)), [r, i] = W(!1), [a, o] = W(!1), s = N({
|
|
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 V(() => {
|
|
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
|
+
]), V(() => () => {
|
|
2236
2236
|
e.isDestroyed || e.commands.clearFind();
|
|
2237
2237
|
}, [e]), {
|
|
2238
2238
|
term: t,
|
|
@@ -2248,15 +2248,15 @@ function ma(e) {
|
|
|
2248
2248
|
//#endregion
|
|
2249
2249
|
//#region lib/components/ui/widgets/editor/partials/editor-find-panel.tsx
|
|
2250
2250
|
function ha({ className: e }) {
|
|
2251
|
-
let { handle: t, chrome: n } =
|
|
2251
|
+
let { handle: t, chrome: n } = O(), { editor: r } = t, i = n.state.panel === "find", a = t.features.some((e) => e.key === "find");
|
|
2252
2252
|
return !r || !i || !a ? null : /* @__PURE__ */ q(ga, { className: e });
|
|
2253
2253
|
}
|
|
2254
2254
|
function ga({ className: e }) {
|
|
2255
|
-
let { t } =
|
|
2255
|
+
let { t } = A(), { handle: n, chrome: r } = O(), i = n.editor, a = ma(i), o = U(null), s = N({
|
|
2256
2256
|
editor: i,
|
|
2257
2257
|
selector: (e) => e.editor.isEditable
|
|
2258
2258
|
}), c = s && r.state.findReplace;
|
|
2259
|
-
|
|
2259
|
+
V(() => {
|
|
2260
2260
|
o.current?.focus(), o.current?.select();
|
|
2261
2261
|
}, []);
|
|
2262
2262
|
let l = () => {
|
|
@@ -2287,11 +2287,11 @@ function ga({ className: e }) {
|
|
|
2287
2287
|
});
|
|
2288
2288
|
}
|
|
2289
2289
|
function _a({ editor: e, find: t }) {
|
|
2290
|
-
let { t: n } =
|
|
2290
|
+
let { t: n } = A(), [r, i] = W("");
|
|
2291
2291
|
return /* @__PURE__ */ J("div", {
|
|
2292
2292
|
className: "flex flex-wrap items-center gap-1.5",
|
|
2293
2293
|
children: [
|
|
2294
|
-
/* @__PURE__ */ q(
|
|
2294
|
+
/* @__PURE__ */ q(Be, {
|
|
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__ */ q(
|
|
2304
|
+
/* @__PURE__ */ q(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__ */ q(
|
|
2311
|
+
/* @__PURE__ */ q(j, {
|
|
2312
2312
|
variant: "tonal",
|
|
2313
2313
|
size: "sm",
|
|
2314
2314
|
disabled: t.total === 0,
|
|
@@ -2321,8 +2321,8 @@ function _a({ editor: e, find: t }) {
|
|
|
2321
2321
|
//#endregion
|
|
2322
2322
|
//#region lib/components/ui/widgets/editor/partials/editor-focus-exit.tsx
|
|
2323
2323
|
function va({ className: e }) {
|
|
2324
|
-
let { t: n } =
|
|
2325
|
-
return r.state.focusMode ? /* @__PURE__ */ q(
|
|
2324
|
+
let { t: n } = A(), { chrome: r, handle: i } = O();
|
|
2325
|
+
return r.state.focusMode ? /* @__PURE__ */ q(M, {
|
|
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__ */ q(
|
|
2333
|
+
children: /* @__PURE__ */ q(Zt, {})
|
|
2334
2334
|
}) : null;
|
|
2335
2335
|
}
|
|
2336
2336
|
//#endregion
|
|
@@ -2339,7 +2339,7 @@ var ya = (e) => e.trim() ? e.trim().split(/\s+/).length : 0, ba = (e) => e <= 0
|
|
|
2339
2339
|
//#endregion
|
|
2340
2340
|
//#region lib/components/ui/widgets/editor/core/use-editor-stats.ts
|
|
2341
2341
|
function xa(e) {
|
|
2342
|
-
return
|
|
2342
|
+
return N({
|
|
2343
2343
|
editor: e.editor,
|
|
2344
2344
|
selector: ({ editor: e }) => {
|
|
2345
2345
|
let t = e?.storage.characterCount, n = t?.words?.() ?? ya(e?.getText() ?? ""), r = e?.extensionManager.extensions.find((e) => e.name === "characterCount")?.options.limit;
|
|
@@ -2360,7 +2360,7 @@ function xa(e) {
|
|
|
2360
2360
|
//#endregion
|
|
2361
2361
|
//#region lib/components/ui/widgets/editor/partials/editor-stats.tsx
|
|
2362
2362
|
function Sa({ readingTime: e = !0 }) {
|
|
2363
|
-
let { t } =
|
|
2363
|
+
let { t } = A(), { handle: n } = O(), r = xa(n), { words: i } = r;
|
|
2364
2364
|
return /* @__PURE__ */ J("p", {
|
|
2365
2365
|
"data-slot": "editor-stats",
|
|
2366
2366
|
className: "flex flex-wrap gap-x-2",
|
|
@@ -2385,7 +2385,7 @@ var Ca = {
|
|
|
2385
2385
|
unsaved: ["material.editor.footer.unsaved", "Unsaved changes"]
|
|
2386
2386
|
};
|
|
2387
2387
|
function wa({ className: n, status: r, actions: i, readingTime: a = !0 }) {
|
|
2388
|
-
let { t: o } =
|
|
2388
|
+
let { t: o } = A(), s = typeof r == "string" && r in Ca, [c, l] = s ? Ca[r] : [];
|
|
2389
2389
|
return /* @__PURE__ */ J("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),
|
|
@@ -2434,11 +2434,11 @@ function Ea(e, t) {
|
|
|
2434
2434
|
//#region lib/components/ui/widgets/editor/extensions/outline/use-outline.ts
|
|
2435
2435
|
var Da = 120, Oa = 700, ka = () => window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
2436
2436
|
function Aa(e) {
|
|
2437
|
-
let t =
|
|
2437
|
+
let t = N({
|
|
2438
2438
|
editor: e,
|
|
2439
2439
|
selector: ({ editor: e }) => Ta(e.state.doc)
|
|
2440
|
-
}), [n, r] =
|
|
2441
|
-
|
|
2440
|
+
}), [n, r] = W(0), i = U(0);
|
|
2441
|
+
V(() => {
|
|
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 = B((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();
|
|
@@ -2480,7 +2480,7 @@ var ja = {
|
|
|
2480
2480
|
3: "ps-8"
|
|
2481
2481
|
};
|
|
2482
2482
|
function Ma({ className: e, onNavigate: t }) {
|
|
2483
|
-
let { handle: n } =
|
|
2483
|
+
let { handle: n } = O();
|
|
2484
2484
|
return n.editor ? /* @__PURE__ */ q(Na, {
|
|
2485
2485
|
editor: n.editor,
|
|
2486
2486
|
className: e,
|
|
@@ -2488,7 +2488,7 @@ function Ma({ className: e, onNavigate: t }) {
|
|
|
2488
2488
|
}) : null;
|
|
2489
2489
|
}
|
|
2490
2490
|
function Na({ editor: e, className: n, onNavigate: r }) {
|
|
2491
|
-
let { t: i } =
|
|
2491
|
+
let { t: i } = A(), { items: a, active: o, goTo: s } = Aa(e);
|
|
2492
2492
|
return /* @__PURE__ */ J("nav", {
|
|
2493
2493
|
"aria-label": i("material.editor.outline", "Outline"),
|
|
2494
2494
|
"data-slot": "editor-outline",
|
|
@@ -2517,7 +2517,7 @@ function Na({ editor: e, className: n, onNavigate: r }) {
|
|
|
2517
2517
|
//#endregion
|
|
2518
2518
|
//#region lib/components/ui/widgets/editor/partials/editor-outline-panel.tsx
|
|
2519
2519
|
function Pa(e) {
|
|
2520
|
-
let { handle: t, chrome: n } =
|
|
2520
|
+
let { handle: t, chrome: n } = O();
|
|
2521
2521
|
return t.features.some((e) => e.key === "outline") ? /* @__PURE__ */ q(Ar, {
|
|
2522
2522
|
id: "outline",
|
|
2523
2523
|
className: "w-72 max-w-[92vw] p-2",
|
|
@@ -2528,12 +2528,12 @@ function Pa(e) {
|
|
|
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 =
|
|
2531
|
+
let t = s(e.editor)?.queue, n = G(B((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 H(() => ({
|
|
2537
2537
|
pending: Math.floor(n / Ia),
|
|
2538
2538
|
failed: n % Ia
|
|
2539
2539
|
}), [n]);
|
|
@@ -2572,10 +2572,10 @@ function Va(e) {
|
|
|
2572
2572
|
//#endregion
|
|
2573
2573
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-button.tsx
|
|
2574
2574
|
function Ha({ editor: e }) {
|
|
2575
|
-
let { t } =
|
|
2575
|
+
let { t } = A(), { 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__ */ q(
|
|
2578
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
2587
|
+
children: /* @__PURE__ */ q(sn, {})
|
|
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 = ft(nr);
|
|
2719
2719
|
abort = null;
|
|
2720
2720
|
token = 0;
|
|
2721
2721
|
panel = null;
|
|
@@ -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 gt(r.cut(t, n).toJSON(), { extensions: Sn(e) })).replace(/\s+$/, "");
|
|
2851
2851
|
} catch {
|
|
2852
2852
|
return r.textBetween(t, n, "\n\n");
|
|
2853
2853
|
}
|
|
@@ -2869,7 +2869,7 @@ async function so(e, t) {
|
|
|
2869
2869
|
}
|
|
2870
2870
|
//#endregion
|
|
2871
2871
|
//#region lib/components/ui/widgets/editor/extensions/assistant/assistant-extension.ts
|
|
2872
|
-
var co =
|
|
2872
|
+
var co = L.create({
|
|
2873
2873
|
name: "assistant",
|
|
2874
2874
|
addStorage: () => ({}),
|
|
2875
2875
|
onBeforeCreate() {
|
|
@@ -2891,14 +2891,14 @@ 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
|
|
2895
|
-
return [new
|
|
2894
|
+
let e = new lt("assistantRange"), t = () => this.storage.controller;
|
|
2895
|
+
return [new P({
|
|
2896
2896
|
key: e,
|
|
2897
2897
|
props: { decorations: (e) => {
|
|
2898
2898
|
let n = t()?.getState();
|
|
2899
2899
|
if (!n || n.phase === "idle" || !n.hasSelection) return null;
|
|
2900
2900
|
let { from: r, to: i } = n.range;
|
|
2901
|
-
return r >= i || i > e.doc.content.size ? null :
|
|
2901
|
+
return r >= i || i > e.doc.content.size ? null : F.create(e.doc, [I.inline(r, i, { class: "nxgt-assistant-range" })]);
|
|
2902
2902
|
} },
|
|
2903
2903
|
view: (n) => {
|
|
2904
2904
|
let r = () => {
|
|
@@ -2934,11 +2934,11 @@ var co = R.create({
|
|
|
2934
2934
|
"continue"
|
|
2935
2935
|
],
|
|
2936
2936
|
group: "Insert",
|
|
2937
|
-
icon:
|
|
2937
|
+
icon: sn,
|
|
2938
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 z(t ? {
|
|
2942
2942
|
name: "assistant",
|
|
2943
2943
|
extensions: (e) => [co.configure({
|
|
2944
2944
|
handler: () => t,
|
|
@@ -2985,10 +2985,10 @@ function po(e, t) {
|
|
|
2985
2985
|
//#endregion
|
|
2986
2986
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-buttons.tsx
|
|
2987
2987
|
function mo({ editor: e }) {
|
|
2988
|
-
let { t } =
|
|
2988
|
+
let { t } = A(), n = Sr(e);
|
|
2989
2989
|
if (!n) return null;
|
|
2990
2990
|
let r = t("material.editor.comments.comment", "Comment");
|
|
2991
|
-
return /* @__PURE__ */ q(
|
|
2991
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
2999
|
+
children: /* @__PURE__ */ q(Xt, {})
|
|
3000
3000
|
});
|
|
3001
3001
|
}
|
|
3002
3002
|
function ho({ editor: e }) {
|
|
3003
|
-
let { t } =
|
|
3003
|
+
let { t } = A(), { chrome: n } = O(), r = Cr(e);
|
|
3004
3004
|
if (!Y(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__ */ q(
|
|
3006
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3016
|
+
children: /* @__PURE__ */ q(Yt, {})
|
|
3017
3017
|
});
|
|
3018
3018
|
}
|
|
3019
3019
|
function go(e) {
|
|
@@ -3049,11 +3049,11 @@ function xo(e, t) {
|
|
|
3049
3049
|
let o = a.attrs.threadId, s = n.get(o);
|
|
3050
3050
|
if (s === void 0 || s && !t.showResolved) continue;
|
|
3051
3051
|
let c = [yo];
|
|
3052
|
-
s && c.push(`${yo}-resolved`), o === t.activeId && c.push(`${yo}-active`), r.push(
|
|
3052
|
+
s && c.push(`${yo}-resolved`), o === t.activeId && c.push(`${yo}-active`), r.push(I.inline(i, i + e.nodeSize, { class: c.join(" ") }));
|
|
3053
3053
|
}
|
|
3054
3054
|
});
|
|
3055
3055
|
let i = t.composer?.range;
|
|
3056
|
-
return i && i.from < i.to && i.to <= e.content.size && r.push(
|
|
3056
|
+
return i && i.from < i.to && i.to <= e.content.size && r.push(I.inline(i.from, i.to, { class: `${yo} ${yo}-active` })), F.create(e, r);
|
|
3057
3057
|
}
|
|
3058
3058
|
//#endregion
|
|
3059
3059
|
//#region lib/components/ui/widgets/editor/extensions/comments/strip-comment-marks.ts
|
|
@@ -3064,17 +3064,17 @@ var So = (e) => {
|
|
|
3064
3064
|
let n = e.marks.filter((e) => e.type.name !== "comment");
|
|
3065
3065
|
t.push(n.length === e.marks.length ? e : e.mark(n));
|
|
3066
3066
|
} else t.push(e.copy(So(e.content)));
|
|
3067
|
-
}),
|
|
3068
|
-
}, Co = (e) => new
|
|
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 lt("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");
|
|
3072
3072
|
e && n.push(e);
|
|
3073
3073
|
}
|
|
3074
3074
|
return n;
|
|
3075
|
-
}, Oo =
|
|
3075
|
+
}, Oo = L.create({
|
|
3076
3076
|
name: "comments",
|
|
3077
|
-
addExtensions: () => [
|
|
3077
|
+
addExtensions: () => [xt],
|
|
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: bt,
|
|
3097
3097
|
openPanel: () => t.panel.open(),
|
|
3098
3098
|
closePanel: () => t.panel.close()
|
|
3099
3099
|
}, t.current().showResolved === !0);
|
|
@@ -3111,7 +3111,7 @@ var So = (e) => {
|
|
|
3111
3111
|
},
|
|
3112
3112
|
addProseMirrorPlugins() {
|
|
3113
3113
|
let e = () => this.storage.controller, t = null;
|
|
3114
|
-
return [new
|
|
3114
|
+
return [new P({
|
|
3115
3115
|
key: Eo,
|
|
3116
3116
|
props: {
|
|
3117
3117
|
transformPasted: To,
|
|
@@ -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 ? z({
|
|
3155
3155
|
name: "comments",
|
|
3156
3156
|
extensions: (t) => [Oo.configure({
|
|
3157
3157
|
current: () => e,
|
|
@@ -3182,11 +3182,11 @@ var So = (e) => {
|
|
|
3182
3182
|
jo(-1)
|
|
3183
3183
|
],
|
|
3184
3184
|
markdown: "native"
|
|
3185
|
-
}) :
|
|
3185
|
+
}) : z({
|
|
3186
3186
|
name: "comments",
|
|
3187
|
-
extensions: () => [
|
|
3187
|
+
extensions: () => [xt],
|
|
3188
3188
|
markdown: "native"
|
|
3189
|
-
}), No =
|
|
3189
|
+
}), No = L.create({
|
|
3190
3190
|
name: "nxgtBlockKeys",
|
|
3191
3191
|
addKeyboardShortcuts() {
|
|
3192
3192
|
let e = (e) => () => {
|
|
@@ -3199,7 +3199,7 @@ var So = (e) => {
|
|
|
3199
3199
|
"Alt-Shift-ArrowDown": e(1)
|
|
3200
3200
|
};
|
|
3201
3201
|
}
|
|
3202
|
-
}), Po = () =>
|
|
3202
|
+
}), Po = () => z({
|
|
3203
3203
|
name: "dragHandle",
|
|
3204
3204
|
extensions: () => [No],
|
|
3205
3205
|
shortcuts: [{
|
|
@@ -3211,18 +3211,18 @@ var So = (e) => {
|
|
|
3211
3211
|
//#endregion
|
|
3212
3212
|
//#region lib/components/ui/widgets/editor/extensions/find/find-button.tsx
|
|
3213
3213
|
function Fo({ editor: e }) {
|
|
3214
|
-
let { t } =
|
|
3215
|
-
return /* @__PURE__ */ q(
|
|
3214
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.panel === "find";
|
|
3215
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3220
|
+
children: /* @__PURE__ */ q(an, {})
|
|
3221
3221
|
});
|
|
3222
3222
|
}
|
|
3223
3223
|
//#endregion
|
|
3224
3224
|
//#region lib/components/ui/widgets/editor/extensions/find/find-plugin.ts
|
|
3225
|
-
var Io = () => new
|
|
3225
|
+
var Io = () => new P({
|
|
3226
3226
|
key: X,
|
|
3227
3227
|
state: {
|
|
3228
3228
|
init: ca,
|
|
@@ -3237,7 +3237,7 @@ var Io = () => new F({
|
|
|
3237
3237
|
props: { decorations: (e) => X.getState(e)?.decorations }
|
|
3238
3238
|
}), Lo = () => {
|
|
3239
3239
|
let e;
|
|
3240
|
-
return new
|
|
3240
|
+
return new P({ props: { decorations(t) {
|
|
3241
3241
|
let n = X.getState(t);
|
|
3242
3242
|
if (!n) return;
|
|
3243
3243
|
if (e?.state === n && e.doc === t.doc) return e.set;
|
|
@@ -3248,7 +3248,7 @@ var Io = () => new F({
|
|
|
3248
3248
|
set: r
|
|
3249
3249
|
}, r;
|
|
3250
3250
|
} } });
|
|
3251
|
-
}, Ro =
|
|
3251
|
+
}, Ro = L.create({
|
|
3252
3252
|
name: "nxgtFind",
|
|
3253
3253
|
addProseMirrorPlugins() {
|
|
3254
3254
|
return [Io(), Lo()];
|
|
@@ -3259,7 +3259,7 @@ var Io = () => new F({
|
|
|
3259
3259
|
findStep: (e) => ({ state: t, tr: n, dispatch: r }) => {
|
|
3260
3260
|
let { matches: i, current: a } = fa(t), o = ra(i.length, a, e), s = i[o];
|
|
3261
3261
|
if (!s) return !1;
|
|
3262
|
-
let c =
|
|
3262
|
+
let c = R.create(n.doc, s.from, s.to);
|
|
3263
3263
|
return r?.(n.setSelection(c).scrollIntoView().setMeta(X, { current: o })), !0;
|
|
3264
3264
|
},
|
|
3265
3265
|
replaceCurrent: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
@@ -3268,7 +3268,7 @@ var Io = () => new F({
|
|
|
3268
3268
|
if (!s) return !1;
|
|
3269
3269
|
r.insertText(e, s.from, s.to);
|
|
3270
3270
|
let c = s.from + e.length;
|
|
3271
|
-
return r.setSelection(
|
|
3271
|
+
return r.setSelection(R.create(r.doc, c)).scrollIntoView(), i?.(r), !0;
|
|
3272
3272
|
},
|
|
3273
3273
|
replaceAll: (e) => ({ editor: t, state: n, tr: r, dispatch: i }) => {
|
|
3274
3274
|
if (!t.isEditable) return !1;
|
|
@@ -3280,7 +3280,7 @@ var Io = () => new F({
|
|
|
3280
3280
|
clearFind: () => ({ tr: e, dispatch: t }) => (t?.(e.setMeta(X, { 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 = () => z({
|
|
3284
3284
|
name: "find",
|
|
3285
3285
|
extensions: () => [Ro],
|
|
3286
3286
|
toolbar: [{
|
|
@@ -3310,20 +3310,20 @@ var Io = () => new F({
|
|
|
3310
3310
|
//#endregion
|
|
3311
3311
|
//#region lib/components/ui/widgets/editor/extensions/focus-mode/focus-mode-button.tsx
|
|
3312
3312
|
function Vo({ editor: e }) {
|
|
3313
|
-
let { t } =
|
|
3314
|
-
return /* @__PURE__ */ q(
|
|
3313
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.focusMode;
|
|
3314
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3321
|
+
children: /* @__PURE__ */ q(Bt, {})
|
|
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 = () => z({
|
|
3327
3327
|
name: "focusMode",
|
|
3328
3328
|
extensions: () => [],
|
|
3329
3329
|
requires: ["marks"],
|
|
@@ -3343,25 +3343,25 @@ var Ho = () => B({
|
|
|
3343
3343
|
//#endregion
|
|
3344
3344
|
//#region lib/components/ui/widgets/editor/extensions/marks/inline-code-button.tsx
|
|
3345
3345
|
function Uo({ editor: e }) {
|
|
3346
|
-
let { t } =
|
|
3346
|
+
let { t } = A(), n = N({
|
|
3347
3347
|
editor: e,
|
|
3348
3348
|
selector: (e) => ({
|
|
3349
3349
|
isCode: e.editor.isActive("code") ?? !1,
|
|
3350
3350
|
canCode: e.editor.can().chain().toggleCode().run() ?? !1
|
|
3351
3351
|
})
|
|
3352
3352
|
});
|
|
3353
|
-
return /* @__PURE__ */ q(
|
|
3353
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3359
|
+
children: /* @__PURE__ */ q(It, {})
|
|
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 = () => z({
|
|
3365
3365
|
name: "inlineCode",
|
|
3366
3366
|
extensions: () => [],
|
|
3367
3367
|
toolbar: [{
|
|
@@ -3380,20 +3380,20 @@ var Wo = () => B({
|
|
|
3380
3380
|
}],
|
|
3381
3381
|
requires: ["marks"],
|
|
3382
3382
|
markdown: "native"
|
|
3383
|
-
}), Go =
|
|
3383
|
+
}), Go = L.create({
|
|
3384
3384
|
name: "markdownPaste",
|
|
3385
3385
|
addProseMirrorPlugins() {
|
|
3386
3386
|
let { editor: e } = this, t = !1;
|
|
3387
|
-
return [new
|
|
3388
|
-
key: new
|
|
3387
|
+
return [new P({
|
|
3388
|
+
key: new lt("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 : (dt().then((t) => {
|
|
3395
3395
|
if (e.isDestroyed) return;
|
|
3396
|
-
let n = e.extensionManager.extensions, r =
|
|
3396
|
+
let n = e.extensionManager.extensions, r = St(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 = () => z({
|
|
3412
3412
|
name: "markdownPaste",
|
|
3413
3413
|
extensions: () => [Go],
|
|
3414
3414
|
markdown: "native"
|
|
@@ -3416,20 +3416,20 @@ var Wo = () => B({
|
|
|
3416
3416
|
//#endregion
|
|
3417
3417
|
//#region lib/components/ui/widgets/editor/extensions/outline/outline-button.tsx
|
|
3418
3418
|
function Jo({ editor: e }) {
|
|
3419
|
-
let { t } =
|
|
3420
|
-
return /* @__PURE__ */ q(
|
|
3419
|
+
let { t } = A(), { chrome: n } = O(), r = n.state.panel === "outline";
|
|
3420
|
+
return /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3427
|
+
children: /* @__PURE__ */ q(un, {})
|
|
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 = () => z({
|
|
3433
3433
|
name: "outline",
|
|
3434
3434
|
extensions: () => [],
|
|
3435
3435
|
toolbar: [{
|
|
@@ -3444,34 +3444,34 @@ var Yo = () => B({
|
|
|
3444
3444
|
//#endregion
|
|
3445
3445
|
//#region lib/components/ui/widgets/editor/extensions/upload/image-alt-button.tsx
|
|
3446
3446
|
function Xo({ editor: e }) {
|
|
3447
|
-
let { t } =
|
|
3447
|
+
let { t } = A(), n = N({
|
|
3448
3448
|
editor: e,
|
|
3449
3449
|
selector: (e) => e.editor.getAttributes("image").alt ?? ""
|
|
3450
|
-
}), [r, i] =
|
|
3451
|
-
return /* @__PURE__ */ J(
|
|
3450
|
+
}), [r, i] = W(""), [a, o] = W(!1), { trigger: s, onCloseAutoFocus: c } = De(), l = t("material.editor.upload.alt", "Alt text");
|
|
3451
|
+
return /* @__PURE__ */ J(_e, {
|
|
3452
3452
|
open: a,
|
|
3453
3453
|
onOpenChange: (e) => {
|
|
3454
3454
|
o(e), e && i(n);
|
|
3455
3455
|
},
|
|
3456
|
-
children: [/* @__PURE__ */ q(
|
|
3456
|
+
children: [/* @__PURE__ */ q(re, {
|
|
3457
3457
|
asChild: !0,
|
|
3458
3458
|
ref: s,
|
|
3459
|
-
children: /* @__PURE__ */ q(
|
|
3459
|
+
children: /* @__PURE__ */ q(f, {
|
|
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__ */ q(
|
|
3465
|
+
children: /* @__PURE__ */ q(dn, {})
|
|
3466
3466
|
})
|
|
3467
|
-
}), /* @__PURE__ */ J(
|
|
3467
|
+
}), /* @__PURE__ */ J(Me, {
|
|
3468
3468
|
className: "flex size-max flex-col gap-2 p-2",
|
|
3469
3469
|
onCloseAutoFocus: c,
|
|
3470
|
-
children: [/* @__PURE__ */ q(
|
|
3470
|
+
children: [/* @__PURE__ */ q(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__ */ q(
|
|
3474
|
+
}), /* @__PURE__ */ q(j, {
|
|
3475
3475
|
variant: "tonal",
|
|
3476
3476
|
onClick: () => {
|
|
3477
3477
|
e.chain().focus().updateAttributes("image", { alt: r }).run(), o(!1);
|
|
@@ -3517,7 +3517,7 @@ function as() {
|
|
|
3517
3517
|
}
|
|
3518
3518
|
//#endregion
|
|
3519
3519
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-widgets.ts
|
|
3520
|
-
var os = /* @__PURE__ */ new WeakMap(), ss = (e, t) =>
|
|
3520
|
+
var os = /* @__PURE__ */ new WeakMap(), ss = (e, t) => I.widget(e, () => {
|
|
3521
3521
|
let { element: e, destroy: n } = t.build(t.id);
|
|
3522
3522
|
return os.set(e, n), e;
|
|
3523
3523
|
}, {
|
|
@@ -3531,9 +3531,9 @@ var os = /* @__PURE__ */ new WeakMap(), ss = (e, t) => L.widget(e, () => {
|
|
|
3531
3531
|
destroy: (e) => os.get(e)?.()
|
|
3532
3532
|
}), cs = {
|
|
3533
3533
|
cards: [],
|
|
3534
|
-
decorations:
|
|
3534
|
+
decorations: F.empty,
|
|
3535
3535
|
orphaned: []
|
|
3536
|
-
}, ls = (e, t) => t.length ?
|
|
3536
|
+
}, ls = (e, t) => t.length ? F.create(e, t.map((e) => ss(e.pos, e))) : F.empty, us = (e) => e.steps.some((t, n) => t instanceof st && t.from === 0 && t.to === e.docs[n].content.size), ds = (e) => {
|
|
3537
3537
|
let t = !1;
|
|
3538
3538
|
return e.content.descendants((e) => ((e.isText || e.isLeaf) && (t = !0), !t)), t;
|
|
3539
3539
|
};
|
|
@@ -3625,12 +3625,12 @@ function gs(e, t) {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
function _s(e, t) {
|
|
3627
3627
|
if (e.isDestroyed) return;
|
|
3628
|
-
let { doc: n } = e.state, r = n.resolve(Math.max(0, Math.min(t, n.content.size))), i =
|
|
3628
|
+
let { doc: n } = e.state, r = n.resolve(Math.max(0, Math.min(t, n.content.size))), i = ct.findFrom(r, 1, !0) ?? ct.findFrom(r, -1, !0) ?? ct.near(r, -1);
|
|
3629
3629
|
e.view.dispatch(e.state.tr.setSelection(i)), e.commands.focus();
|
|
3630
3630
|
}
|
|
3631
3631
|
//#endregion
|
|
3632
3632
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-plugin.ts
|
|
3633
|
-
var $ = new
|
|
3633
|
+
var $ = new lt("upload");
|
|
3634
3634
|
function vs(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 ? {
|
|
@@ -3655,7 +3655,7 @@ var ys = (e, t) => {
|
|
|
3655
3655
|
end: t
|
|
3656
3656
|
} });
|
|
3657
3657
|
function Cs({ onFiles: e, onOrphans: t }) {
|
|
3658
|
-
return new
|
|
3658
|
+
return new P({
|
|
3659
3659
|
key: $,
|
|
3660
3660
|
state: {
|
|
3661
3661
|
init: () => cs,
|
|
@@ -3695,7 +3695,7 @@ function Es(e, { accept: t = "image/*", maxSize: n }) {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
var Ds = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Os = (e) => e.type ? e.type.startsWith("image/") : Ds.test(e.name);
|
|
3697
3697
|
function ks(e) {
|
|
3698
|
-
let t =
|
|
3698
|
+
let t = mt(e);
|
|
3699
3699
|
return t !== void 0 && !/^(mailto|tel):/i.test(t);
|
|
3700
3700
|
}
|
|
3701
3701
|
function As(e) {
|
|
@@ -3747,7 +3747,7 @@ function Ps(e, t, n, r) {
|
|
|
3747
3747
|
if (!a) return;
|
|
3748
3748
|
let o = gs(e, t), s = a.from;
|
|
3749
3749
|
try {
|
|
3750
|
-
let o = e.schema.nodeFromJSON(Ms(e, n, r)), c = i.doc.nodeAt(a.from), l = a.spec.replaceEmpty && Ns(c), u = l ? a.from :
|
|
3750
|
+
let o = e.schema.nodeFromJSON(Ms(e, n, r)), c = i.doc.nodeAt(a.from), l = a.spec.replaceEmpty && Ns(c), u = l ? a.from : ot(i.doc, a.from, o.type) ?? ps(i.doc, a.from), d = l ? u + (c?.nodeSize ?? 0) : u, f = i.tr.replaceWith(u, d, o);
|
|
3751
3751
|
s = f.mapping.map(d, 1), e.view.dispatch(f.setMeta($, Ss(t, s)));
|
|
3752
3752
|
} catch {
|
|
3753
3753
|
e.view.dispatch(i.tr.setMeta($, xs(t)));
|
|
@@ -3772,20 +3772,20 @@ function Is({ accept: e, multiple: t, label: n }, r) {
|
|
|
3772
3772
|
//#endregion
|
|
3773
3773
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-actions.tsx
|
|
3774
3774
|
function Ls({ id: e, name: t, failed: n, retryable: r, storage: i }) {
|
|
3775
|
-
let { t: a } =
|
|
3775
|
+
let { t: a } = A(), o = n ? a("material.editor.upload.remove", "Remove {name}", { name: t }) : a("material.editor.upload.cancel", "Cancel upload of {name}", { name: t });
|
|
3776
3776
|
return /* @__PURE__ */ J("div", {
|
|
3777
3777
|
className: "ms-auto flex shrink-0 items-center gap-1",
|
|
3778
|
-
children: [n && r && /* @__PURE__ */ J(
|
|
3778
|
+
children: [n && r && /* @__PURE__ */ J(j, {
|
|
3779
3779
|
variant: "tonal",
|
|
3780
3780
|
size: "sm",
|
|
3781
3781
|
onClick: () => i.retry(e),
|
|
3782
|
-
children: [/* @__PURE__ */ q(
|
|
3783
|
-
}), /* @__PURE__ */ q(
|
|
3782
|
+
children: [/* @__PURE__ */ q(rn, {}), a("material.editor.upload.retry", "Retry")]
|
|
3783
|
+
}), /* @__PURE__ */ q(M, {
|
|
3784
3784
|
variant: "ghost",
|
|
3785
3785
|
tooltip: o,
|
|
3786
3786
|
"aria-label": o,
|
|
3787
3787
|
onClick: () => i.cancel(e),
|
|
3788
|
-
children: q(n ?
|
|
3788
|
+
children: q(n ? pn : gn, {})
|
|
3789
3789
|
})]
|
|
3790
3790
|
});
|
|
3791
3791
|
}
|
|
@@ -3798,10 +3798,10 @@ function Rs({ previewUrl: e, busy: n }) {
|
|
|
3798
3798
|
src: e,
|
|
3799
3799
|
alt: "",
|
|
3800
3800
|
className: t("size-full object-cover", n && "opacity-50")
|
|
3801
|
-
}) : /* @__PURE__ */ q(
|
|
3801
|
+
}) : /* @__PURE__ */ q(zt, {
|
|
3802
3802
|
"aria-hidden": "true",
|
|
3803
3803
|
className: "size-5"
|
|
3804
|
-
}), n && /* @__PURE__ */ q(
|
|
3804
|
+
}), n && /* @__PURE__ */ q(Te, {
|
|
3805
3805
|
"aria-hidden": "true",
|
|
3806
3806
|
"aria-label": void 0,
|
|
3807
3807
|
contained: !0,
|
|
@@ -3820,7 +3820,7 @@ function zs(e, t, n) {
|
|
|
3820
3820
|
}
|
|
3821
3821
|
}
|
|
3822
3822
|
function Bs({ id: e, storage: n, maxSize: r }) {
|
|
3823
|
-
let { t: i } =
|
|
3823
|
+
let { t: i } = A(), { queue: a } = n, o = G(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
3826
|
return /* @__PURE__ */ J("div", {
|
|
@@ -3845,7 +3845,7 @@ function Bs({ id: e, storage: n, maxSize: r }) {
|
|
|
3845
3845
|
role: "alert",
|
|
3846
3846
|
className: "text-xs text-error-text",
|
|
3847
3847
|
children: zs(i, o.failure, r)
|
|
3848
|
-
}) : /* @__PURE__ */ q(
|
|
3848
|
+
}) : /* @__PURE__ */ q(te, {
|
|
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"
|
|
@@ -3864,7 +3864,7 @@ function Bs({ id: e, storage: n, maxSize: r }) {
|
|
|
3864
3864
|
//#endregion
|
|
3865
3865
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-widget.tsx
|
|
3866
3866
|
function Vs(e, t, n, r) {
|
|
3867
|
-
let i = new
|
|
3867
|
+
let i = new $e(Bs, {
|
|
3868
3868
|
editor: e,
|
|
3869
3869
|
props: {
|
|
3870
3870
|
id: r,
|
|
@@ -3939,7 +3939,7 @@ function qs(e, t, n, r) {
|
|
|
3939
3939
|
var Js = class {
|
|
3940
3940
|
options;
|
|
3941
3941
|
entries = /* @__PURE__ */ new Map();
|
|
3942
|
-
listeners =
|
|
3942
|
+
listeners = pt();
|
|
3943
3943
|
counter = 0;
|
|
3944
3944
|
preview;
|
|
3945
3945
|
limit;
|
|
@@ -4060,7 +4060,7 @@ function Xs(e) {
|
|
|
4060
4060
|
}
|
|
4061
4061
|
//#endregion
|
|
4062
4062
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-extension.ts
|
|
4063
|
-
var Zs = /* @__PURE__ */ new WeakMap(), Qs =
|
|
4063
|
+
var Zs = /* @__PURE__ */ new WeakMap(), Qs = L.create({
|
|
4064
4064
|
name: "upload",
|
|
4065
4065
|
addStorage: () => ({}),
|
|
4066
4066
|
onBeforeCreate() {
|
|
@@ -4106,9 +4106,9 @@ var Zs = /* @__PURE__ */ new WeakMap(), Qs = R.create({
|
|
|
4106
4106
|
}
|
|
4107
4107
|
}), $s = (e = {}) => {
|
|
4108
4108
|
let { onUpload: t, ...n } = e;
|
|
4109
|
-
return
|
|
4109
|
+
return z(t ? {
|
|
4110
4110
|
name: "upload",
|
|
4111
|
-
extensions: (e) => [...e.has("image") ? [] : [
|
|
4111
|
+
extensions: (e) => [...e.has("image") ? [] : [ht], Qs.configure({
|
|
4112
4112
|
...n,
|
|
4113
4113
|
onUpload: t,
|
|
4114
4114
|
translate: e.translate,
|
|
@@ -4119,18 +4119,18 @@ var Zs = /* @__PURE__ */ new WeakMap(), Qs = R.create({
|
|
|
4119
4119
|
order: 61,
|
|
4120
4120
|
priority: 30,
|
|
4121
4121
|
kind: "panel",
|
|
4122
|
-
when: (e) => !!
|
|
4123
|
-
render:
|
|
4122
|
+
when: (e) => !!s(e)?.ownsImage,
|
|
4123
|
+
render: _
|
|
4124
4124
|
}],
|
|
4125
4125
|
bubble: [{
|
|
4126
4126
|
id: "image-alt",
|
|
4127
4127
|
order: 35,
|
|
4128
4128
|
priority: 60,
|
|
4129
4129
|
kind: "panel",
|
|
4130
|
-
when: (e) => !!
|
|
4130
|
+
when: (e) => !!s(e) && e.isActive("image"),
|
|
4131
4131
|
render: Xo
|
|
4132
4132
|
}],
|
|
4133
|
-
slash:
|
|
4133
|
+
slash: l("image"),
|
|
4134
4134
|
markdown: "native"
|
|
4135
4135
|
} : {
|
|
4136
4136
|
name: "upload",
|
|
@@ -4138,101 +4138,101 @@ var Zs = /* @__PURE__ */ new WeakMap(), Qs = R.create({
|
|
|
4138
4138
|
markdown: "native"
|
|
4139
4139
|
});
|
|
4140
4140
|
}, ec = {
|
|
4141
|
-
accordion:
|
|
4142
|
-
actionCard:
|
|
4141
|
+
accordion: a,
|
|
4142
|
+
actionCard: Ie,
|
|
4143
4143
|
assistant: fo,
|
|
4144
|
-
blocks:
|
|
4145
|
-
callout:
|
|
4146
|
-
checkboxGroup:
|
|
4147
|
-
codeBlock:
|
|
4148
|
-
color:
|
|
4144
|
+
blocks: pe,
|
|
4145
|
+
callout: Le,
|
|
4146
|
+
checkboxGroup: je,
|
|
4147
|
+
codeBlock: ue,
|
|
4148
|
+
color: we,
|
|
4149
4149
|
comments: Mo,
|
|
4150
|
-
count:
|
|
4150
|
+
count: Ee,
|
|
4151
4151
|
dragHandle: Po,
|
|
4152
|
-
emoji:
|
|
4152
|
+
emoji: ye,
|
|
4153
4153
|
find: Bo,
|
|
4154
4154
|
focusMode: Ho,
|
|
4155
|
-
fontFamily:
|
|
4156
|
-
gallery:
|
|
4157
|
-
headings:
|
|
4158
|
-
highlight:
|
|
4159
|
-
image:
|
|
4155
|
+
fontFamily: Oe,
|
|
4156
|
+
gallery: oe,
|
|
4157
|
+
headings: ce,
|
|
4158
|
+
highlight: g,
|
|
4159
|
+
image: p,
|
|
4160
4160
|
inlineCode: Wo,
|
|
4161
|
-
link:
|
|
4162
|
-
lists:
|
|
4161
|
+
link: ae,
|
|
4162
|
+
lists: D,
|
|
4163
4163
|
markdownPaste: qo,
|
|
4164
|
-
marks:
|
|
4165
|
-
mention:
|
|
4164
|
+
marks: Re,
|
|
4165
|
+
mention: d,
|
|
4166
4166
|
outline: Yo,
|
|
4167
|
-
placeholder:
|
|
4168
|
-
radioGroup:
|
|
4169
|
-
selectCard:
|
|
4170
|
-
selectChip:
|
|
4171
|
-
slash:
|
|
4172
|
-
table:
|
|
4173
|
-
textAlign:
|
|
4167
|
+
placeholder: C,
|
|
4168
|
+
radioGroup: b,
|
|
4169
|
+
selectCard: y,
|
|
4170
|
+
selectChip: be,
|
|
4171
|
+
slash: n,
|
|
4172
|
+
table: xe,
|
|
4173
|
+
textAlign: x,
|
|
4174
4174
|
upload: $s,
|
|
4175
|
-
youtube:
|
|
4175
|
+
youtube: o
|
|
4176
4176
|
}, tc = (...e) => (t) => [...t, ...e], nc = (...e) => (t) => t.filter((t) => !e.includes(t.key ?? t.name)), rc = () => [
|
|
4177
|
-
Fe(),
|
|
4178
|
-
ye(),
|
|
4179
|
-
b(),
|
|
4180
|
-
Ae(),
|
|
4181
|
-
x()
|
|
4182
|
-
], ic = () => [
|
|
4183
4177
|
Ie(),
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4178
|
+
be(),
|
|
4179
|
+
y(),
|
|
4180
|
+
je(),
|
|
4181
|
+
b()
|
|
4182
|
+
], ic = () => [
|
|
4189
4183
|
Le(),
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4184
|
+
a(),
|
|
4185
|
+
oe(),
|
|
4186
|
+
n(),
|
|
4187
|
+
we(),
|
|
4188
|
+
Oe(),
|
|
4189
|
+
Re(),
|
|
4190
|
+
ce(),
|
|
4191
|
+
pe(),
|
|
4192
|
+
ae(),
|
|
4193
|
+
g(),
|
|
4194
|
+
x(),
|
|
4195
|
+
C(),
|
|
4196
|
+
Ee(),
|
|
4197
4197
|
qo(),
|
|
4198
|
-
|
|
4199
|
-
|
|
4198
|
+
D(),
|
|
4199
|
+
p(),
|
|
4200
4200
|
$s(),
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4201
|
+
o(),
|
|
4202
|
+
ye({ suggest: !0 }),
|
|
4203
|
+
xe(),
|
|
4204
|
+
ue(),
|
|
4205
4205
|
Bo(),
|
|
4206
4206
|
Ho(),
|
|
4207
4207
|
Po(),
|
|
4208
4208
|
Mo()
|
|
4209
4209
|
], ac = () => [
|
|
4210
|
-
|
|
4210
|
+
Re({ compact: !0 }),
|
|
4211
4211
|
Wo(),
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4212
|
+
ae(),
|
|
4213
|
+
C(),
|
|
4214
|
+
Ee(),
|
|
4215
4215
|
qo(),
|
|
4216
|
-
|
|
4216
|
+
D(),
|
|
4217
4217
|
$s()
|
|
4218
4218
|
], oc = () => [
|
|
4219
|
-
|
|
4219
|
+
Re({ compact: !0 }),
|
|
4220
4220
|
Wo(),
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4221
|
+
ae(),
|
|
4222
|
+
C(),
|
|
4223
|
+
Ee(),
|
|
4224
|
+
ye({ suggest: !0 }),
|
|
4225
|
+
d()
|
|
4226
4226
|
];
|
|
4227
4227
|
//#endregion
|
|
4228
4228
|
//#region lib/components/ui/widgets/editor/extensions/assistant/use-assistant-feature.ts
|
|
4229
4229
|
function sc(e, t) {
|
|
4230
|
-
let n =
|
|
4231
|
-
|
|
4230
|
+
let n = U(e);
|
|
4231
|
+
V(() => {
|
|
4232
4232
|
n.current = e;
|
|
4233
4233
|
}, [e]);
|
|
4234
|
-
let r =
|
|
4235
|
-
return
|
|
4234
|
+
let r = B((e, t) => n.current(e, t), []), i = !!e;
|
|
4235
|
+
return H(() => i ? fo({
|
|
4236
4236
|
...t,
|
|
4237
4237
|
onAssist: r
|
|
4238
4238
|
}) : void 0, [i, r]);
|
|
@@ -4240,24 +4240,24 @@ function sc(e, t) {
|
|
|
4240
4240
|
//#endregion
|
|
4241
4241
|
//#region lib/components/ui/widgets/editor/extensions/upload/upload-signal.tsx
|
|
4242
4242
|
function cc({ onChange: e }) {
|
|
4243
|
-
let { handle: t } =
|
|
4244
|
-
return
|
|
4243
|
+
let { handle: t } = O(), n = La(t).pending > 0, r = U(e), i = U(!1);
|
|
4244
|
+
return V(() => {
|
|
4245
4245
|
r.current = e;
|
|
4246
|
-
}, [e]),
|
|
4246
|
+
}, [e]), V(() => {
|
|
4247
4247
|
n !== i.current && (i.current = n, r.current?.(n));
|
|
4248
|
-
}, [n]),
|
|
4248
|
+
}, [n]), V(() => () => {
|
|
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 lc(e, t) {
|
|
4255
|
-
let n =
|
|
4256
|
-
|
|
4255
|
+
let n = U(e);
|
|
4256
|
+
V(() => {
|
|
4257
4257
|
n.current = e;
|
|
4258
4258
|
}, [e]);
|
|
4259
|
-
let r =
|
|
4260
|
-
return
|
|
4259
|
+
let r = B((e, t) => n.current(e, t), []), i = !!e;
|
|
4260
|
+
return H(() => i ? $s({
|
|
4261
4261
|
...t,
|
|
4262
4262
|
onUpload: r
|
|
4263
4263
|
}) : void 0, [i, r]);
|
|
@@ -4277,7 +4277,7 @@ function uc(e, t) {
|
|
|
4277
4277
|
//#endregion
|
|
4278
4278
|
//#region lib/components/ui/widgets/editor/partials/editor-character-count.tsx
|
|
4279
4279
|
function dc({ className: e }) {
|
|
4280
|
-
let { t: n } =
|
|
4280
|
+
let { t: n } = A(), { handle: r } = O(), i = N({
|
|
4281
4281
|
editor: r.editor,
|
|
4282
4282
|
selector: ({ editor: e }) => {
|
|
4283
4283
|
let t = e?.extensionManager.extensions.find((e) => e.name === "characterCount")?.options.limit;
|
|
@@ -4304,8 +4304,8 @@ function dc({ className: e }) {
|
|
|
4304
4304
|
//#endregion
|
|
4305
4305
|
//#region lib/components/ui/widgets/editor/partials/use-room-for.ts
|
|
4306
4306
|
function fc(e, t) {
|
|
4307
|
-
let [n, r] =
|
|
4308
|
-
return
|
|
4307
|
+
let [n, r] = W(!1);
|
|
4308
|
+
return V(() => {
|
|
4309
4309
|
let n = e.current;
|
|
4310
4310
|
if (!n) return;
|
|
4311
4311
|
if (typeof ResizeObserver > "u") {
|
|
@@ -4323,7 +4323,7 @@ function fc(e, t) {
|
|
|
4323
4323
|
//#region lib/components/ui/widgets/editor/presets/toolbar-looks.ts
|
|
4324
4324
|
var pc = 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]"), mc = 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)"), hc = 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", pc, mc), gc = t("items-center gap-1 **:data-group-id:gap-1", "[--tb-item:2.25rem] [&_button[data-variant]]:rounded-full [&_[data-toolbar-more]]:rounded-full", pc, mc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), _c = t(hc, "**:data-[group=outline]:@6xl:hidden", "**:data-[group=comments]:@5xl:hidden"), vc = t(hc, "**:data-[group=outline]:@4xl:hidden", "**:data-[group=comments]:@5xl:hidden"), yc = 56;
|
|
4325
4325
|
function bc({ side: e, children: n }) {
|
|
4326
|
-
let { t: r } =
|
|
4326
|
+
let { t: r } = A();
|
|
4327
4327
|
return /* @__PURE__ */ q("aside", {
|
|
4328
4328
|
"aria-label": r("material.editor.outline-region", "Document outline"),
|
|
4329
4329
|
"data-slot": "document-editor-rail",
|
|
@@ -4336,7 +4336,7 @@ function bc({ side: e, children: n }) {
|
|
|
4336
4336
|
});
|
|
4337
4337
|
}
|
|
4338
4338
|
function xc({ toolbar: e, bar: n, panels: r, footer: i, outline: a, comments: o, presence: s, outlineSide: c = "start", className: l, children: u }) {
|
|
4339
|
-
let { t: d } =
|
|
4339
|
+
let { t: d } = A(), { chrome: f, handle: p, look: m } = O(), h = p.features.some((e) => e.key === "dragHandle"), g = f.state.focusMode, _ = U(null), v = fc(_, yc), y = a && !g && v, b = fc(_, 64), x = o && !g && b;
|
|
4340
4340
|
return /* @__PURE__ */ J("div", {
|
|
4341
4341
|
ref: _,
|
|
4342
4342
|
"data-slot": "document-editor",
|
|
@@ -4394,7 +4394,7 @@ function xc({ toolbar: e, bar: n, panels: r, footer: i, outline: a, comments: o,
|
|
|
4394
4394
|
//#endregion
|
|
4395
4395
|
//#region lib/components/ui/widgets/editor/presets/preset-features.ts
|
|
4396
4396
|
var Sc = (e) => (t) => {
|
|
4397
|
-
let { features: n, mentions: r, outline: i, extra: a } = e, o = (typeof n == "function" ? n(t) : n) ?? (r ? [...t,
|
|
4397
|
+
let { features: n, mentions: r, outline: i, extra: a } = e, o = (typeof n == "function" ? n(t) : n) ?? (r ? [...t, d()] : t);
|
|
4398
4398
|
return [...i && !o.some((e) => e.key === "outline") ? [...o, Yo()] : o, ...a.filter((e) => !!e)];
|
|
4399
4399
|
}, Cc = [
|
|
4400
4400
|
"min-h-[1lh]",
|
|
@@ -4469,15 +4469,15 @@ function Rc(e) {
|
|
|
4469
4469
|
}
|
|
4470
4470
|
//#endregion
|
|
4471
4471
|
//#region lib/components/ui/widgets/editor/presets/compact-editor.tsx
|
|
4472
|
-
function zc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar:
|
|
4473
|
-
let { t: S } =
|
|
4474
|
-
return /* @__PURE__ */ J(
|
|
4472
|
+
function zc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: a = !0, look: o = "expressive", actions: s, onUpload: l, uploadOptions: u, onUploadingChange: d, onAssist: f, assistOptions: p, label: m, helperText: g, error: _, required: v, className: y, attributes: b, ...x }) {
|
|
4473
|
+
let { t: S } = A(), C = H(ac, []), ee = lc(l, u), te = sc(f, p), w = !!s || !!x.characterLimit;
|
|
4474
|
+
return /* @__PURE__ */ J(h, {
|
|
4475
4475
|
...x,
|
|
4476
4476
|
look: o,
|
|
4477
4477
|
features: Sc({
|
|
4478
4478
|
features: e,
|
|
4479
4479
|
mentions: x.mentions,
|
|
4480
|
-
extra: [
|
|
4480
|
+
extra: [ee, te]
|
|
4481
4481
|
}),
|
|
4482
4482
|
defaults: C,
|
|
4483
4483
|
attributes: {
|
|
@@ -4486,9 +4486,9 @@ function zc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look
|
|
|
4486
4486
|
...b
|
|
4487
4487
|
},
|
|
4488
4488
|
children: [
|
|
4489
|
-
/* @__PURE__ */ q(
|
|
4489
|
+
/* @__PURE__ */ q(Ne, {
|
|
4490
4490
|
label: m,
|
|
4491
|
-
helperText:
|
|
4491
|
+
helperText: g,
|
|
4492
4492
|
error: _,
|
|
4493
4493
|
required: v,
|
|
4494
4494
|
className: y,
|
|
@@ -4498,24 +4498,24 @@ function zc({ features: e, minRows: n = 2, maxRows: r = 8, toolbar: i = !0, look
|
|
|
4498
4498
|
"data-look": o,
|
|
4499
4499
|
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", Lc(o, _)),
|
|
4500
4500
|
children: [
|
|
4501
|
-
|
|
4501
|
+
a && /* @__PURE__ */ q("div", {
|
|
4502
4502
|
"data-slot": "compact-editor-toolbar",
|
|
4503
4503
|
"data-look": o,
|
|
4504
4504
|
className: Rc(o),
|
|
4505
|
-
children: /* @__PURE__ */ q(
|
|
4505
|
+
children: /* @__PURE__ */ q(T, {
|
|
4506
4506
|
dividers: !1,
|
|
4507
4507
|
density: "compact",
|
|
4508
4508
|
className: Fc(o, vc)
|
|
4509
4509
|
})
|
|
4510
4510
|
}),
|
|
4511
|
-
/* @__PURE__ */ q(
|
|
4512
|
-
|
|
4511
|
+
/* @__PURE__ */ q(E, { className: "px-3 py-2.5" }),
|
|
4512
|
+
w && /* @__PURE__ */ q(Bc, { actions: s })
|
|
4513
4513
|
]
|
|
4514
4514
|
})
|
|
4515
4515
|
}),
|
|
4516
|
-
|
|
4517
|
-
/* @__PURE__ */ q(
|
|
4518
|
-
/* @__PURE__ */ q(
|
|
4516
|
+
l && /* @__PURE__ */ q(cc, { onChange: d }),
|
|
4517
|
+
/* @__PURE__ */ q(c, {}),
|
|
4518
|
+
/* @__PURE__ */ q(i, {}),
|
|
4519
4519
|
/* @__PURE__ */ q(or, {})
|
|
4520
4520
|
]
|
|
4521
4521
|
});
|
|
@@ -4534,16 +4534,16 @@ function Bc({ actions: e }) {
|
|
|
4534
4534
|
//#endregion
|
|
4535
4535
|
//#region lib/components/ui/widgets/editor/presets/compact-editor-form-field.tsx
|
|
4536
4536
|
function Vc({ control: e, name: n, ...r }) {
|
|
4537
|
-
return /* @__PURE__ */ q(
|
|
4537
|
+
return /* @__PURE__ */ q(Ze, {
|
|
4538
4538
|
control: e,
|
|
4539
4539
|
name: n,
|
|
4540
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(
|
|
4540
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(Qe, {
|
|
4541
4541
|
onBlur: e.onBlur,
|
|
4542
4542
|
focusRef: e.ref,
|
|
4543
4543
|
children: /* @__PURE__ */ q(zc, {
|
|
4544
4544
|
...r,
|
|
4545
4545
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
4546
|
-
value: e.value ??
|
|
4546
|
+
value: e.value ?? ze(r.format ?? "html"),
|
|
4547
4547
|
onChange: (t) => e.onChange(t),
|
|
4548
4548
|
editable: (r.editable ?? !0) && !e.disabled,
|
|
4549
4549
|
error: n.invalid,
|
|
@@ -4555,18 +4555,18 @@ function Vc({ control: e, name: n, ...r }) {
|
|
|
4555
4555
|
//#endregion
|
|
4556
4556
|
//#region lib/components/ui/widgets/editor/extensions/comments/comments-adapter-sync.tsx
|
|
4557
4557
|
function Hc({ adapter: e }) {
|
|
4558
|
-
let { handle: t } =
|
|
4559
|
-
return
|
|
4558
|
+
let { handle: t } = O(), n = Sr(t.editor);
|
|
4559
|
+
return V(() => n?.checkAdapter(), [n, e]), null;
|
|
4560
4560
|
}
|
|
4561
4561
|
//#endregion
|
|
4562
4562
|
//#region lib/components/ui/widgets/editor/extensions/comments/use-comments-feature.ts
|
|
4563
4563
|
function Uc(e) {
|
|
4564
|
-
let t =
|
|
4565
|
-
|
|
4564
|
+
let t = U(e);
|
|
4565
|
+
bn(() => {
|
|
4566
4566
|
t.current = e;
|
|
4567
4567
|
}, [e]);
|
|
4568
4568
|
let n = !!e?.adapter;
|
|
4569
|
-
return
|
|
4569
|
+
return H(() => {
|
|
4570
4570
|
if (n) return Mo({
|
|
4571
4571
|
get adapter() {
|
|
4572
4572
|
return t.current?.adapter;
|
|
@@ -4586,8 +4586,8 @@ function Uc(e) {
|
|
|
4586
4586
|
//#endregion
|
|
4587
4587
|
//#region lib/components/ui/widgets/editor/partials/page-mode-switch.tsx
|
|
4588
4588
|
function Wc({ value: e, onChange: t }) {
|
|
4589
|
-
let { t: n } =
|
|
4590
|
-
return /* @__PURE__ */ J(
|
|
4589
|
+
let { t: n } = A();
|
|
4590
|
+
return /* @__PURE__ */ J(tt, {
|
|
4591
4591
|
type: "single",
|
|
4592
4592
|
variant: "segmented",
|
|
4593
4593
|
size: "sm",
|
|
@@ -4596,15 +4596,15 @@ function Wc({ value: e, onChange: t }) {
|
|
|
4596
4596
|
"aria-label": n("material.editor.page.mode", "View"),
|
|
4597
4597
|
"data-slot": "editor-page-mode",
|
|
4598
4598
|
children: [
|
|
4599
|
-
/* @__PURE__ */ q(
|
|
4599
|
+
/* @__PURE__ */ q(et, {
|
|
4600
4600
|
value: "write",
|
|
4601
4601
|
children: n("material.editor.page.write", "Write")
|
|
4602
4602
|
}),
|
|
4603
|
-
/* @__PURE__ */ q(
|
|
4603
|
+
/* @__PURE__ */ q(et, {
|
|
4604
4604
|
value: "preview",
|
|
4605
4605
|
children: n("material.editor.page.preview", "Preview")
|
|
4606
4606
|
}),
|
|
4607
|
-
/* @__PURE__ */ q(
|
|
4607
|
+
/* @__PURE__ */ q(et, {
|
|
4608
4608
|
value: "markdown",
|
|
4609
4609
|
children: n("material.editor.page.markdown", "Markdown")
|
|
4610
4610
|
})
|
|
@@ -4613,14 +4613,14 @@ function Wc({ value: e, onChange: t }) {
|
|
|
4613
4613
|
}
|
|
4614
4614
|
//#endregion
|
|
4615
4615
|
//#region lib/components/ui/widgets/editor/partials/page-mode-views.tsx
|
|
4616
|
-
var Gc =
|
|
4616
|
+
var Gc = vn(() => import("./rich-text-viewer-LO1IZCWs.js").then((e) => e.n).then((e) => ({ default: e.RichTextViewer })));
|
|
4617
4617
|
function Kc() {
|
|
4618
|
-
let { handle: e } =
|
|
4618
|
+
let { handle: e } = O(), { editor: t } = e, n = N({
|
|
4619
4619
|
editor: t,
|
|
4620
4620
|
selector: (e) => e.editor?.state.doc ?? null,
|
|
4621
4621
|
equalityFn: (e, t) => e === t
|
|
4622
4622
|
});
|
|
4623
|
-
return
|
|
4623
|
+
return H(() => !n || !t || e.isEmpty ? null : n.toJSON(), [
|
|
4624
4624
|
n,
|
|
4625
4625
|
t,
|
|
4626
4626
|
e.isEmpty
|
|
@@ -4634,8 +4634,8 @@ function qc({ children: e }) {
|
|
|
4634
4634
|
});
|
|
4635
4635
|
}
|
|
4636
4636
|
function Jc({ json: e, components: t }) {
|
|
4637
|
-
let { t: n } =
|
|
4638
|
-
return e ? /* @__PURE__ */ q(
|
|
4637
|
+
let { t: n } = A(), { look: r } = O(), i = n("material.editor.page.empty", "Nothing to show yet.");
|
|
4638
|
+
return e ? /* @__PURE__ */ q(_n, {
|
|
4639
4639
|
fallback: /* @__PURE__ */ q(qc, { children: n("material.editor.page.loading", "Loading…") }),
|
|
4640
4640
|
children: /* @__PURE__ */ q(Gc, {
|
|
4641
4641
|
value: e,
|
|
@@ -4646,8 +4646,8 @@ function Jc({ json: e, components: t }) {
|
|
|
4646
4646
|
}) : /* @__PURE__ */ q(qc, { children: i });
|
|
4647
4647
|
}
|
|
4648
4648
|
function Yc({ json: e }) {
|
|
4649
|
-
let { t } =
|
|
4650
|
-
return
|
|
4649
|
+
let { t } = A(), { handle: n } = O(), [r, i] = W(null), a = n.editor?.extensionManager.extensions;
|
|
4650
|
+
return V(() => {
|
|
4651
4651
|
let t = !0;
|
|
4652
4652
|
if (!e) {
|
|
4653
4653
|
i("");
|
|
@@ -4681,7 +4681,7 @@ function Qc(e, n) {
|
|
|
4681
4681
|
//#endregion
|
|
4682
4682
|
//#region lib/components/ui/widgets/editor/presets/page-rails.tsx
|
|
4683
4683
|
function $c({ children: e, fab: t }) {
|
|
4684
|
-
let { t: n } =
|
|
4684
|
+
let { t: n } = A();
|
|
4685
4685
|
return t === void 0 ? /* @__PURE__ */ q("aside", {
|
|
4686
4686
|
"aria-label": n("material.editor.tools", "Tools"),
|
|
4687
4687
|
"data-slot": "document-editor-tools",
|
|
@@ -4701,7 +4701,7 @@ function $c({ children: e, fab: t }) {
|
|
|
4701
4701
|
});
|
|
4702
4702
|
}
|
|
4703
4703
|
function el({ side: e, children: t }) {
|
|
4704
|
-
let { t: n } =
|
|
4704
|
+
let { t: n } = A();
|
|
4705
4705
|
return /* @__PURE__ */ q("aside", {
|
|
4706
4706
|
"aria-label": n("material.editor.outline-region", "Document outline"),
|
|
4707
4707
|
"data-slot": "document-editor-rail",
|
|
@@ -4711,7 +4711,7 @@ function el({ side: e, children: t }) {
|
|
|
4711
4711
|
});
|
|
4712
4712
|
}
|
|
4713
4713
|
function tl({ children: e }) {
|
|
4714
|
-
let { t } =
|
|
4714
|
+
let { t } = A();
|
|
4715
4715
|
return /* @__PURE__ */ q("aside", {
|
|
4716
4716
|
"aria-label": t("material.editor.comments.title", "Comments"),
|
|
4717
4717
|
"data-slot": "document-editor-comments",
|
|
@@ -4720,14 +4720,14 @@ function tl({ children: e }) {
|
|
|
4720
4720
|
});
|
|
4721
4721
|
}
|
|
4722
4722
|
function nl({ 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 }) {
|
|
4723
|
-
let { chrome: m, handle: h, look: g } =
|
|
4723
|
+
let { chrome: m, handle: h, look: g } = O(), _ = g === "expressive", v = h.features.some((e) => e.key === "dragHandle"), y = m.state.focusMode, b = U(null), [x, S] = W("write"), C = x === "write", ee = fc(b, 64), te = fc(b, 72), w = C && !y, T = w && ee && r, E = !!(n && w && !T), ne = c && w && te, re = l && w && ee;
|
|
4724
4724
|
return /* @__PURE__ */ J("div", {
|
|
4725
4725
|
ref: b,
|
|
4726
4726
|
"data-slot": "document-editor",
|
|
4727
4727
|
"data-look": g,
|
|
4728
4728
|
"data-layout": "page",
|
|
4729
4729
|
"data-mode": x,
|
|
4730
|
-
className: t(Zc(_,
|
|
4730
|
+
className: t(Zc(_, E), f),
|
|
4731
4731
|
children: [
|
|
4732
4732
|
/* @__PURE__ */ J("div", {
|
|
4733
4733
|
"data-slot": "document-editor-toolbar",
|
|
@@ -4740,20 +4740,20 @@ function nl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4740
4740
|
onChange: S
|
|
4741
4741
|
}), u]
|
|
4742
4742
|
}),
|
|
4743
|
-
|
|
4743
|
+
w && !T && e,
|
|
4744
4744
|
C && o
|
|
4745
4745
|
]
|
|
4746
4746
|
}),
|
|
4747
4747
|
/* @__PURE__ */ q(va, { className: "absolute end-3 top-3 z-20" }),
|
|
4748
|
-
|
|
4748
|
+
E && n,
|
|
4749
4749
|
/* @__PURE__ */ J("div", {
|
|
4750
4750
|
className: "flex items-start gap-4 px-2 pb-6 @2xl:gap-6 @2xl:px-6",
|
|
4751
4751
|
children: [
|
|
4752
|
-
|
|
4752
|
+
T && /* @__PURE__ */ q($c, {
|
|
4753
4753
|
fab: i,
|
|
4754
4754
|
children: r
|
|
4755
4755
|
}),
|
|
4756
|
-
|
|
4756
|
+
ne && d === "start" && /* @__PURE__ */ q(el, {
|
|
4757
4757
|
side: "start",
|
|
4758
4758
|
children: c
|
|
4759
4759
|
}),
|
|
@@ -4774,15 +4774,15 @@ function nl({ toolbar: e, bar: n, rail: r, railFab: i, previewComponents: a, pan
|
|
|
4774
4774
|
})
|
|
4775
4775
|
})
|
|
4776
4776
|
}),
|
|
4777
|
-
|
|
4777
|
+
ne && d === "end" && /* @__PURE__ */ q(el, {
|
|
4778
4778
|
side: "end",
|
|
4779
4779
|
children: c
|
|
4780
4780
|
}),
|
|
4781
|
-
|
|
4781
|
+
re && /* @__PURE__ */ q(tl, { children: l })
|
|
4782
4782
|
]
|
|
4783
4783
|
}),
|
|
4784
4784
|
s && /* @__PURE__ */ q("div", {
|
|
4785
|
-
className: t("border-t px-4 py-2.5 @2xl:px-8",
|
|
4785
|
+
className: t("border-t px-4 py-2.5 @2xl:px-8", E && "order-3"),
|
|
4786
4786
|
children: s
|
|
4787
4787
|
})
|
|
4788
4788
|
]
|
|
@@ -4812,7 +4812,7 @@ var rl = {
|
|
|
4812
4812
|
history: 50
|
|
4813
4813
|
};
|
|
4814
4814
|
function al(e) {
|
|
4815
|
-
return e.some((e) => e.name === "slash") ?
|
|
4815
|
+
return e.some((e) => e.name === "slash") ? Pe(e.flatMap((e) => e.slash ?? [])) : [];
|
|
4816
4816
|
}
|
|
4817
4817
|
function ol(e, t) {
|
|
4818
4818
|
let n = new Set(t.map((e) => e.id));
|
|
@@ -4822,14 +4822,14 @@ function ol(e, t) {
|
|
|
4822
4822
|
});
|
|
4823
4823
|
}
|
|
4824
4824
|
function sl(e, t) {
|
|
4825
|
-
return ol(e, t).flatMap((e) => e.id === "marks" && e.render ===
|
|
4825
|
+
return ol(e, t).flatMap((e) => e.id === "marks" && e.render === r ? [{
|
|
4826
4826
|
...e,
|
|
4827
|
-
render:
|
|
4827
|
+
render: m
|
|
4828
4828
|
}, {
|
|
4829
4829
|
...e,
|
|
4830
4830
|
id: "marks-extra",
|
|
4831
4831
|
order: e.order + .5,
|
|
4832
|
-
render:
|
|
4832
|
+
render: ie
|
|
4833
4833
|
}] : [e]).map((e) => ({
|
|
4834
4834
|
...e,
|
|
4835
4835
|
priority: il[e.id] ?? e.priority
|
|
@@ -4838,28 +4838,28 @@ function sl(e, t) {
|
|
|
4838
4838
|
//#endregion
|
|
4839
4839
|
//#region lib/components/ui/widgets/editor/partials/use-toolbar-shown.ts
|
|
4840
4840
|
function cl() {
|
|
4841
|
-
let { handle: e, chrome: t } =
|
|
4842
|
-
return !!
|
|
4841
|
+
let { handle: e, chrome: t } = O();
|
|
4842
|
+
return !!N({
|
|
4843
4843
|
editor: e.editor,
|
|
4844
|
-
selector: (e) => !!(e.editor?.isEditable &&
|
|
4844
|
+
selector: (e) => !!(e.editor?.isEditable && v.selectShowToolbar(t.state))
|
|
4845
4845
|
});
|
|
4846
4846
|
}
|
|
4847
4847
|
//#endregion
|
|
4848
4848
|
//#region lib/components/ui/widgets/editor/partials/editor-insert-fab.tsx
|
|
4849
4849
|
function ll() {
|
|
4850
|
-
let { t: e } =
|
|
4851
|
-
return !
|
|
4850
|
+
let { t: e } = A(), { handle: t } = O(), { editor: n, features: r } = t, i = U(!1), a = H(() => ne(al(r), "", e), [r, e]), o = cl();
|
|
4851
|
+
return !n || !o || a.length === 0 ? null : /* @__PURE__ */ q(ee, {
|
|
4852
4852
|
"data-slot": "editor-insert-fab",
|
|
4853
4853
|
label: e("material.editor.insert", "Insert"),
|
|
4854
|
-
items:
|
|
4854
|
+
items: a.map((e) => ({
|
|
4855
4855
|
id: e.id,
|
|
4856
4856
|
icon: /* @__PURE__ */ q(e.icon, {}),
|
|
4857
4857
|
label: e.title,
|
|
4858
4858
|
onSelect: () => {
|
|
4859
|
-
|
|
4860
|
-
let t =
|
|
4859
|
+
i.current = !0;
|
|
4860
|
+
let t = n.state.selection.from;
|
|
4861
4861
|
e.run({
|
|
4862
|
-
editor:
|
|
4862
|
+
editor: n,
|
|
4863
4863
|
range: {
|
|
4864
4864
|
from: t,
|
|
4865
4865
|
to: t
|
|
@@ -4868,18 +4868,18 @@ function ll() {
|
|
|
4868
4868
|
}
|
|
4869
4869
|
})),
|
|
4870
4870
|
onCloseAutoFocus: (e) => {
|
|
4871
|
-
|
|
4871
|
+
i.current && (i.current = !1, e.preventDefault(), n.isDestroyed || n.commands.focus());
|
|
4872
4872
|
}
|
|
4873
4873
|
});
|
|
4874
4874
|
}
|
|
4875
4875
|
//#endregion
|
|
4876
4876
|
//#region lib/components/ui/widgets/editor/partials/editor-floating-bar.tsx
|
|
4877
4877
|
function ul({ className: e }) {
|
|
4878
|
-
let { handle: t } =
|
|
4878
|
+
let { handle: t } = O(), n = H(() => al(t.features), [t.features]), r = B((e) => sl(e, n), [n]);
|
|
4879
4879
|
return cl() ? /* @__PURE__ */ q("div", {
|
|
4880
4880
|
"data-slot": "editor-floating-bar",
|
|
4881
4881
|
className: "nxgt-editor-bar",
|
|
4882
|
-
children: /* @__PURE__ */ J(
|
|
4882
|
+
children: /* @__PURE__ */ J(le, { children: [/* @__PURE__ */ q(T, {
|
|
4883
4883
|
variant: "floating",
|
|
4884
4884
|
dividers: !1,
|
|
4885
4885
|
className: e,
|
|
@@ -4890,8 +4890,8 @@ function ul({ className: e }) {
|
|
|
4890
4890
|
//#endregion
|
|
4891
4891
|
//#region lib/components/ui/widgets/editor/partials/editor-rail-toolbar.tsx
|
|
4892
4892
|
function dl({ floating: e, className: t }) {
|
|
4893
|
-
let { handle: n } =
|
|
4894
|
-
return /* @__PURE__ */ q(
|
|
4893
|
+
let { handle: n } = O(), r = H(() => e ? al(n.features) : [], [e, n.features]), i = B((e) => ol(e, r), [r]);
|
|
4894
|
+
return /* @__PURE__ */ q(T, {
|
|
4895
4895
|
orientation: "vertical",
|
|
4896
4896
|
variant: e ? "floating" : void 0,
|
|
4897
4897
|
className: t,
|
|
@@ -4903,7 +4903,7 @@ function dl({ floating: e, className: t }) {
|
|
|
4903
4903
|
function fl({ look: e, layout: t, previewComponents: n, outline: r, comments: i, collaboration: a, collaborationStatus: o, footer: s, status: c, actions: l }) {
|
|
4904
4904
|
let u = t === "page", d = Ic(e), f = e === "expressive";
|
|
4905
4905
|
return {
|
|
4906
|
-
toolbar: f ? void 0 : /* @__PURE__ */ q(
|
|
4906
|
+
toolbar: f ? void 0 : /* @__PURE__ */ q(T, {
|
|
4907
4907
|
dividers: !1,
|
|
4908
4908
|
className: u ? d.docked : Fc(e, vc)
|
|
4909
4909
|
}),
|
|
@@ -4927,73 +4927,73 @@ function fl({ look: e, layout: t, previewComponents: n, outline: r, comments: i,
|
|
|
4927
4927
|
}
|
|
4928
4928
|
//#endregion
|
|
4929
4929
|
//#region lib/components/ui/widgets/editor/presets/document-editor.tsx
|
|
4930
|
-
function pl({ features: e, layout: n = "docked", look: r = "expressive", previewComponents:
|
|
4931
|
-
let
|
|
4932
|
-
return /* @__PURE__ */ J(
|
|
4933
|
-
...
|
|
4930
|
+
function pl({ features: e, layout: n = "docked", look: r = "expressive", previewComponents: a, status: o, actions: s, footer: l = !0, outline: u = !1, onUpload: d, uploadOptions: f, onUploadingChange: p, onAssist: m, assistOptions: g, comments: _, collaboration: v, collaborationStatus: y, label: b, helperText: x, error: S, required: C, className: ee, attributes: te, ...w }) {
|
|
4931
|
+
let T = H(ic, []), ne = lc(d, f), re = sc(m, g), D = Uc(_), ie = n === "page" ? nl : xc;
|
|
4932
|
+
return /* @__PURE__ */ J(h, {
|
|
4933
|
+
...w,
|
|
4934
4934
|
look: r,
|
|
4935
4935
|
features: Sc({
|
|
4936
4936
|
features: e,
|
|
4937
|
-
mentions:
|
|
4937
|
+
mentions: w.mentions,
|
|
4938
4938
|
outline: u,
|
|
4939
4939
|
extra: [
|
|
4940
|
-
te,
|
|
4941
4940
|
ne,
|
|
4942
|
-
|
|
4941
|
+
re,
|
|
4942
|
+
D,
|
|
4943
4943
|
v
|
|
4944
4944
|
]
|
|
4945
4945
|
}),
|
|
4946
|
-
defaults:
|
|
4946
|
+
defaults: T,
|
|
4947
4947
|
attributes: {
|
|
4948
4948
|
class: t("nxgt-prose min-h-64 focus:outline-none"),
|
|
4949
|
-
...
|
|
4949
|
+
...te
|
|
4950
4950
|
},
|
|
4951
4951
|
children: [
|
|
4952
|
-
/* @__PURE__ */ q(
|
|
4952
|
+
/* @__PURE__ */ q(Ne, {
|
|
4953
4953
|
label: b,
|
|
4954
4954
|
helperText: x,
|
|
4955
4955
|
error: S,
|
|
4956
4956
|
required: C,
|
|
4957
|
-
className:
|
|
4958
|
-
children: /* @__PURE__ */ q(
|
|
4957
|
+
className: ee,
|
|
4958
|
+
children: /* @__PURE__ */ q(ie, {
|
|
4959
4959
|
...fl({
|
|
4960
4960
|
look: r,
|
|
4961
4961
|
layout: n,
|
|
4962
|
-
previewComponents:
|
|
4962
|
+
previewComponents: a,
|
|
4963
4963
|
outline: u,
|
|
4964
|
-
comments: !!
|
|
4964
|
+
comments: !!D,
|
|
4965
4965
|
collaboration: !!v,
|
|
4966
4966
|
collaborationStatus: y,
|
|
4967
|
-
footer:
|
|
4967
|
+
footer: l,
|
|
4968
4968
|
status: o,
|
|
4969
4969
|
actions: s
|
|
4970
4970
|
}),
|
|
4971
|
-
children: /* @__PURE__ */ q(Ui, { children: /* @__PURE__ */ q(
|
|
4971
|
+
children: /* @__PURE__ */ q(Ui, { children: /* @__PURE__ */ q(E, {}) })
|
|
4972
4972
|
})
|
|
4973
4973
|
}),
|
|
4974
4974
|
d && /* @__PURE__ */ q(cc, { onChange: p }),
|
|
4975
|
-
/* @__PURE__ */ q(
|
|
4976
|
-
/* @__PURE__ */ q(
|
|
4975
|
+
/* @__PURE__ */ q(c, {}),
|
|
4976
|
+
/* @__PURE__ */ q(i, {}),
|
|
4977
4977
|
/* @__PURE__ */ q(or, {}),
|
|
4978
4978
|
/* @__PURE__ */ q(vi, {}),
|
|
4979
4979
|
/* @__PURE__ */ q(Er, {}),
|
|
4980
|
-
|
|
4980
|
+
D && /* @__PURE__ */ q(Hc, { adapter: _?.adapter })
|
|
4981
4981
|
]
|
|
4982
4982
|
});
|
|
4983
4983
|
}
|
|
4984
4984
|
//#endregion
|
|
4985
4985
|
//#region lib/components/ui/widgets/editor/presets/document-editor-form-field.tsx
|
|
4986
4986
|
function ml({ control: e, name: n, ...r }) {
|
|
4987
|
-
return /* @__PURE__ */ q(
|
|
4987
|
+
return /* @__PURE__ */ q(Ze, {
|
|
4988
4988
|
control: e,
|
|
4989
4989
|
name: n,
|
|
4990
|
-
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(
|
|
4990
|
+
render: ({ field: e, fieldState: n }) => /* @__PURE__ */ q(Qe, {
|
|
4991
4991
|
onBlur: e.onBlur,
|
|
4992
4992
|
focusRef: e.ref,
|
|
4993
4993
|
children: /* @__PURE__ */ q(pl, {
|
|
4994
4994
|
...r,
|
|
4995
4995
|
className: t(r.className, e.disabled && "nxgt-editor-disabled"),
|
|
4996
|
-
value: e.value ??
|
|
4996
|
+
value: e.value ?? ze(r.format ?? "html"),
|
|
4997
4997
|
onChange: (t) => e.onChange(t),
|
|
4998
4998
|
editable: (r.editable ?? !0) && !e.disabled,
|
|
4999
4999
|
error: n.invalid,
|
|
@@ -5013,12 +5013,12 @@ function hl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled
|
|
|
5013
5013
|
}),
|
|
5014
5014
|
t && /* @__PURE__ */ q("div", {
|
|
5015
5015
|
className: "w-full",
|
|
5016
|
-
children: /* @__PURE__ */ q(
|
|
5016
|
+
children: /* @__PURE__ */ q(de, {
|
|
5017
5017
|
replyTo: t,
|
|
5018
5018
|
onCancel: n
|
|
5019
5019
|
})
|
|
5020
5020
|
}),
|
|
5021
|
-
/* @__PURE__ */ q(
|
|
5021
|
+
/* @__PURE__ */ q(me, {
|
|
5022
5022
|
attachments: r,
|
|
5023
5023
|
isDisabled: i,
|
|
5024
5024
|
onAttachmentsChange: a,
|
|
@@ -5029,19 +5029,19 @@ function hl({ error: e, replyTo: t, onCancelReply: n, attachments: r, isDisabled
|
|
|
5029
5029
|
//#endregion
|
|
5030
5030
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/send-control.tsx
|
|
5031
5031
|
function gl({ sendLabel: e, stopLabel: t, disabled: n, empty: r, onStop: i, onSchedule: a, squircle: o }) {
|
|
5032
|
-
let { t: s } =
|
|
5033
|
-
return !a || i ? /* @__PURE__ */ q(
|
|
5032
|
+
let { t: s } = A();
|
|
5033
|
+
return !a || i ? /* @__PURE__ */ q(ke, {
|
|
5034
5034
|
sendLabel: e,
|
|
5035
5035
|
stopLabel: t,
|
|
5036
5036
|
isDisabled: n,
|
|
5037
5037
|
isEmpty: r,
|
|
5038
5038
|
onStop: i,
|
|
5039
5039
|
shape: o ? "squircle" : "round"
|
|
5040
|
-
}) : /* @__PURE__ */ q(
|
|
5040
|
+
}) : /* @__PURE__ */ q(se, {
|
|
5041
5041
|
type: "submit",
|
|
5042
5042
|
disabled: n || r,
|
|
5043
5043
|
menuLabel: s("material.editor.send-options", "Send options"),
|
|
5044
|
-
menu: /* @__PURE__ */ q(
|
|
5044
|
+
menu: /* @__PURE__ */ q(k, {
|
|
5045
5045
|
onSelect: a,
|
|
5046
5046
|
children: s("material.editor.schedule", "Schedule…")
|
|
5047
5047
|
}),
|
|
@@ -5051,10 +5051,10 @@ function gl({ sendLabel: e, stopLabel: t, disabled: n, empty: r, onStop: i, onSc
|
|
|
5051
5051
|
//#endregion
|
|
5052
5052
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/send-on-enter.tsx
|
|
5053
5053
|
function _l(e, t) {
|
|
5054
|
-
return e.nativeEvent.keyCode !== 229 &&
|
|
5054
|
+
return e.nativeEvent.keyCode !== 229 && Ae(e, t);
|
|
5055
5055
|
}
|
|
5056
5056
|
function vl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i, children: a }) {
|
|
5057
|
-
let { handle: o } =
|
|
5057
|
+
let { handle: o } = O();
|
|
5058
5058
|
return /* @__PURE__ */ q("div", {
|
|
5059
5059
|
"data-slot": "rich-chat-composer-input",
|
|
5060
5060
|
className: i,
|
|
@@ -5068,14 +5068,14 @@ function vl({ onSend: e, sendOnEnter: t, disabled: n, onFocus: r, className: i,
|
|
|
5068
5068
|
//#endregion
|
|
5069
5069
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/partials/tools-row.tsx
|
|
5070
5070
|
function yl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionable: a, attach: o, actions: s }) {
|
|
5071
|
-
let { t: c } =
|
|
5071
|
+
let { t: c } = A(), { handle: l } = O(), { editor: u } = l, d = c("material.editor.formatting-toggle", "Text formatting"), f = c("material.editor.mention", "Mention someone");
|
|
5072
5072
|
return /* @__PURE__ */ J("div", {
|
|
5073
5073
|
"data-slot": "rich-chat-composer-tools",
|
|
5074
5074
|
className: t("flex min-w-0 items-end gap-1", e ? "order-1" : "flex-1"),
|
|
5075
|
-
children: [/* @__PURE__ */ q(
|
|
5075
|
+
children: [/* @__PURE__ */ q(Se, {
|
|
5076
5076
|
...o,
|
|
5077
|
-
actions: /* @__PURE__ */ J(K, { children: [u?.storage.emoji && /* @__PURE__ */ q(
|
|
5078
|
-
/* @__PURE__ */ q(
|
|
5077
|
+
actions: /* @__PURE__ */ J(K, { children: [u?.storage.emoji && /* @__PURE__ */ q(fe, { editor: u }), !e && /* @__PURE__ */ J(K, { children: [
|
|
5078
|
+
/* @__PURE__ */ q(M, {
|
|
5079
5079
|
variant: "ghost",
|
|
5080
5080
|
color: "default",
|
|
5081
5081
|
tooltip: d,
|
|
@@ -5085,16 +5085,16 @@ function yl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionab
|
|
|
5085
5085
|
"aria-controls": n ? r : void 0,
|
|
5086
5086
|
onClick: i,
|
|
5087
5087
|
className: "size-8 shrink-0 rounded aria-pressed:bg-primary/10 aria-pressed:text-primary-text",
|
|
5088
|
-
children: /* @__PURE__ */ q(
|
|
5088
|
+
children: /* @__PURE__ */ q(At, {})
|
|
5089
5089
|
}),
|
|
5090
|
-
a && /* @__PURE__ */ q(
|
|
5090
|
+
a && /* @__PURE__ */ q(M, {
|
|
5091
5091
|
variant: "ghost",
|
|
5092
5092
|
color: "default",
|
|
5093
5093
|
tooltip: f,
|
|
5094
5094
|
"aria-label": f,
|
|
5095
5095
|
onClick: () => u?.chain().focus().insertContent("@").run(),
|
|
5096
5096
|
className: "size-8 shrink-0 rounded",
|
|
5097
|
-
children: /* @__PURE__ */ q(
|
|
5097
|
+
children: /* @__PURE__ */ q(kt, {})
|
|
5098
5098
|
}),
|
|
5099
5099
|
s
|
|
5100
5100
|
] })] })
|
|
@@ -5104,11 +5104,11 @@ function yl({ pill: e, formatOpen: n, toolbarId: r, onFormatToggle: i, mentionab
|
|
|
5104
5104
|
//#endregion
|
|
5105
5105
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-editor.ts
|
|
5106
5106
|
function bl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attributes: a, ...o }) {
|
|
5107
|
-
let { t: s } =
|
|
5107
|
+
let { t: s } = A(), c = H(() => oc().map((e) => e.name === "emoji" ? {
|
|
5108
5108
|
...e,
|
|
5109
5109
|
toolbar: void 0
|
|
5110
5110
|
} : e), []);
|
|
5111
|
-
return
|
|
5111
|
+
return w({
|
|
5112
5112
|
...o,
|
|
5113
5113
|
features: e ?? c,
|
|
5114
5114
|
defaults: c,
|
|
@@ -5124,7 +5124,7 @@ function bl({ features: e, minRows: n = 1, maxRows: r = 8, placeholder: i, attri
|
|
|
5124
5124
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-pill.ts
|
|
5125
5125
|
var xl = "[data-radix-popper-content-wrapper], [role=\"dialog\"]";
|
|
5126
5126
|
function Sl({ collapsed: e, occupied: t, files: n }) {
|
|
5127
|
-
let [r, i] =
|
|
5127
|
+
let [r, i] = W(!1), [a, o] = W(!1), s = yn();
|
|
5128
5128
|
return {
|
|
5129
5129
|
pill: e === "auto" && !a && !t && !r,
|
|
5130
5130
|
formatOpen: r,
|
|
@@ -5154,7 +5154,7 @@ async function Cl(e, t) {
|
|
|
5154
5154
|
return {
|
|
5155
5155
|
value: n,
|
|
5156
5156
|
json: r,
|
|
5157
|
-
markdown: await
|
|
5157
|
+
markdown: await gt(r, i && { extensions: i }),
|
|
5158
5158
|
attachments: t
|
|
5159
5159
|
};
|
|
5160
5160
|
}
|
|
@@ -5162,7 +5162,7 @@ var wl = (e, t) => e.trim().length > 0 || t > 0;
|
|
|
5162
5162
|
//#endregion
|
|
5163
5163
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer-send.ts
|
|
5164
5164
|
function Tl({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSchedule: a, onError: o }) {
|
|
5165
|
-
let { t: s } =
|
|
5165
|
+
let { t: s } = A(), [c, l] = W(!1), u = U(!1), d = () => Cl({
|
|
5166
5166
|
getValue: () => e.getValue(),
|
|
5167
5167
|
getJSON: () => e.editor?.getJSON() ?? { type: "doc" },
|
|
5168
5168
|
getExtensions: () => e.editor?.extensionManager.extensions
|
|
@@ -5201,16 +5201,16 @@ function Tl({ handle: e, attachments: t, blocked: n, clear: r, onSend: i, onSche
|
|
|
5201
5201
|
//#endregion
|
|
5202
5202
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-rich-chat-composer.ts
|
|
5203
5203
|
function El({ handle: e, onSend: t, onSchedule: n, onError: r, disabled: i = !1, isLoading: a = !1, accept: o, maxFiles: s, attachments: c, onAttachmentsChange: l }) {
|
|
5204
|
-
let [u, d] =
|
|
5204
|
+
let [u, d] = W([]), f = c ?? u, p = (e) => {
|
|
5205
5205
|
c === void 0 && d(e), l?.(e);
|
|
5206
|
-
}, m =
|
|
5206
|
+
}, m = U(null), h = ve({
|
|
5207
5207
|
attachments: f,
|
|
5208
5208
|
accept: o,
|
|
5209
5209
|
maxFiles: s,
|
|
5210
5210
|
disabled: i,
|
|
5211
5211
|
isLoading: a,
|
|
5212
5212
|
onAttachmentsChange: p
|
|
5213
|
-
}), g = !wl(
|
|
5213
|
+
}), g = !wl(N({
|
|
5214
5214
|
editor: e.editor,
|
|
5215
5215
|
selector: (e) => (e.editor?.getText().trim().length ?? 0) > 0
|
|
5216
5216
|
}) ?? !1 ? "x" : "", f.length), _ = Tl({
|
|
@@ -5239,7 +5239,7 @@ function El({ handle: e, onSend: t, onSchedule: n, onError: r, disabled: i = !1,
|
|
|
5239
5239
|
//#endregion
|
|
5240
5240
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/use-composer.ts
|
|
5241
5241
|
function Dl(e) {
|
|
5242
|
-
let { t } =
|
|
5242
|
+
let { t } = A(), { disabled: n = !1, isLoading: r = !1, collapsed: i = "never" } = e, a = !n && !r, o = bl({
|
|
5243
5243
|
...e,
|
|
5244
5244
|
editable: a
|
|
5245
5245
|
}), s = El({
|
|
@@ -5270,22 +5270,22 @@ function Dl(e) {
|
|
|
5270
5270
|
//#endregion
|
|
5271
5271
|
//#region lib/components/ui/widgets/editor/presets/rich-chat-composer/rich-chat-composer.tsx
|
|
5272
5272
|
function Ol(e) {
|
|
5273
|
-
let { t: n } =
|
|
5273
|
+
let { t: n } = A(), { mentions: r, replyTo: a, onCancelReply: o, actions: s, className: l } = e, { sendOnEnter: u = !0, sendLabel: d, isLoading: f = !1 } = e, { look: p = "expressive" } = e, { handle: m, editable: g, composer: _, ui: v, attach: y } = Dl(e), { files: b, attachments: x } = _, { pill: S } = v;
|
|
5274
5274
|
return /* @__PURE__ */ q("form", {
|
|
5275
5275
|
"data-slot": "rich-chat-composer",
|
|
5276
5276
|
"data-look": p,
|
|
5277
5277
|
"data-collapsed": S || void 0,
|
|
5278
5278
|
onSubmit: _.handleSubmit,
|
|
5279
5279
|
...v.formEvents,
|
|
5280
|
-
className: t("@container flex w-full min-w-0 flex-wrap items-end gap-x-1 gap-y-1.5 border bg-card p-2 text-card-foreground shadow-xs", "transition-[border-color,box-shadow,border-radius] duration-(--nxgt-motion-effects-default-duration) ease-effects-default motion-reduce:transition-none", "focus-within:border-primary/60 dark:focus-within:border-primary-indicator focus-within:ring-[3px] focus-within:ring-primary/15", S ? "rounded-full ps-2.5" : p === "expressive" ? "rounded-[1.75rem]" : "rounded-[1.375rem]", !
|
|
5281
|
-
children: /* @__PURE__ */ J(
|
|
5280
|
+
className: t("@container flex w-full min-w-0 flex-wrap items-end gap-x-1 gap-y-1.5 border bg-card p-2 text-card-foreground shadow-xs", "transition-[border-color,box-shadow,border-radius] duration-(--nxgt-motion-effects-default-duration) ease-effects-default motion-reduce:transition-none", "focus-within:border-primary/60 dark:focus-within:border-primary-indicator focus-within:ring-[3px] focus-within:ring-primary/15", S ? "rounded-full ps-2.5" : p === "expressive" ? "rounded-[1.75rem]" : "rounded-[1.375rem]", !g && "opacity-70", l),
|
|
5281
|
+
children: /* @__PURE__ */ J(h, {
|
|
5282
5282
|
editor: m,
|
|
5283
5283
|
className: "contents",
|
|
5284
5284
|
look: p,
|
|
5285
5285
|
children: [
|
|
5286
5286
|
/* @__PURE__ */ q(hl, {
|
|
5287
5287
|
error: b.errorMessage ?? _.sendError,
|
|
5288
|
-
replyTo:
|
|
5288
|
+
replyTo: a,
|
|
5289
5289
|
onCancelReply: o,
|
|
5290
5290
|
attachments: x,
|
|
5291
5291
|
isDisabled: b.isDisabled,
|
|
@@ -5296,14 +5296,14 @@ function Ol(e) {
|
|
|
5296
5296
|
onFocus: v.activate,
|
|
5297
5297
|
onSend: () => void _.send(),
|
|
5298
5298
|
sendOnEnter: u,
|
|
5299
|
-
disabled: !
|
|
5300
|
-
children: /* @__PURE__ */ q(
|
|
5299
|
+
disabled: !g,
|
|
5300
|
+
children: /* @__PURE__ */ q(E, {})
|
|
5301
5301
|
}),
|
|
5302
5302
|
v.formatOpen && !S && /* @__PURE__ */ q("div", {
|
|
5303
5303
|
id: v.toolbarId,
|
|
5304
5304
|
"data-slot": "rich-chat-composer-toolbar",
|
|
5305
5305
|
className: "w-full px-1",
|
|
5306
|
-
children: /* @__PURE__ */ q(
|
|
5306
|
+
children: /* @__PURE__ */ q(T, {
|
|
5307
5307
|
dividers: !1,
|
|
5308
5308
|
density: "compact",
|
|
5309
5309
|
className: Fc(p, vc)
|
|
@@ -5330,8 +5330,8 @@ function Ol(e) {
|
|
|
5330
5330
|
squircle: p === "expressive"
|
|
5331
5331
|
})
|
|
5332
5332
|
}),
|
|
5333
|
-
/* @__PURE__ */ q(
|
|
5334
|
-
/* @__PURE__ */ q(
|
|
5333
|
+
/* @__PURE__ */ q(c, {}),
|
|
5334
|
+
/* @__PURE__ */ q(i, {})
|
|
5335
5335
|
]
|
|
5336
5336
|
})
|
|
5337
5337
|
});
|
|
@@ -5339,24 +5339,24 @@ function Ol(e) {
|
|
|
5339
5339
|
//#endregion
|
|
5340
5340
|
//#region lib/components/ui/widgets/editor/index.ts
|
|
5341
5341
|
var kl = {
|
|
5342
|
-
Root:
|
|
5343
|
-
Content:
|
|
5344
|
-
Toolbar:
|
|
5342
|
+
Root: h,
|
|
5343
|
+
Content: E,
|
|
5344
|
+
Toolbar: T,
|
|
5345
5345
|
Panel: Ar,
|
|
5346
5346
|
AssistantPanel: or,
|
|
5347
|
-
BubbleMenu:
|
|
5347
|
+
BubbleMenu: c,
|
|
5348
5348
|
CommentsRail: Di,
|
|
5349
5349
|
CommentsPanel: vi,
|
|
5350
5350
|
CommentComposer: Er,
|
|
5351
|
-
SuggestionList:
|
|
5351
|
+
SuggestionList: i,
|
|
5352
5352
|
Footer: wa,
|
|
5353
5353
|
Outline: Ma,
|
|
5354
5354
|
OutlinePanel: Pa,
|
|
5355
5355
|
FindPanel: ha,
|
|
5356
5356
|
BlockHandle: Ui,
|
|
5357
5357
|
FocusExit: va,
|
|
5358
|
-
Field:
|
|
5358
|
+
Field: Ne,
|
|
5359
5359
|
Presence: mr
|
|
5360
5360
|
};
|
|
5361
5361
|
//#endregion
|
|
5362
|
-
export { zc as CompactEditor, Vc as CompactEditorFormField, pl as DocumentEditor, ml as DocumentEditorFormField, kl as Editor, or as EditorAssistantPanel, Ui as EditorBlockHandle,
|
|
5362
|
+
export { zc as CompactEditor, Vc as CompactEditorFormField, pl as DocumentEditor, ml as DocumentEditorFormField, kl as Editor, or as EditorAssistantPanel, Ui as EditorBlockHandle, c as EditorBubbleMenu, Er as EditorCommentComposer, vi as EditorCommentsPanel, Di as EditorCommentsRail, E as EditorContent, Ne as EditorField, ha as EditorFindPanel, va as EditorFocusExit, wa as EditorFooter, Ma as EditorOutline, Pa as EditorOutlinePanel, Ar as EditorPanel, mr as EditorPresence, h as EditorRoot, i as EditorSuggestionList, T as EditorToolbar, Ol as RichChatComposer, oc as chatKit, ac as compactKit, z as defineFeature, ic as documentKit, ec as editorFeatures, rc as formNodesKit, vt as fromMarkdown, Va as looksLikeMarkdown, yt as toHtml, _t as toJson, gt as toMarkdown, w as useEditor, O as useEditorContext, ur as useEditorPresence, xa as useEditorStats, La as useEditorUploads, tc as withFeatures, nc as withoutFeatures };
|