@alfadocs/ui-kit-debug 1.43.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{calendar-ChJQzRw-.js → calendar-U6N0F99w.js} +383 -359
- package/dist/_chunks/calendar-U6N0F99w.js.map +1 -0
- package/dist/_chunks/calendar-workspace-DBYAtdyd.js +12161 -0
- package/dist/_chunks/calendar-workspace-DBYAtdyd.js.map +1 -0
- package/dist/_chunks/{face-scheme-Dg6ZyLKb.js → face-scheme-Bm6pe7R8.js} +265 -275
- package/dist/_chunks/face-scheme-Bm6pe7R8.js.map +1 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js +741 -0
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +1 -0
- package/dist/_chunks/{notes-panel-CRAovkjx.js → notes-panel-CY4KmDo-.js} +159 -152
- package/dist/_chunks/notes-panel-CY4KmDo-.js.map +1 -0
- package/dist/_chunks/{panel-subview-PMBRPFOa.js → panel-subview-CYnuX-KR.js} +61 -40
- package/dist/_chunks/panel-subview-CYnuX-KR.js.map +1 -0
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js +3839 -0
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js.map +1 -0
- package/dist/_chunks/undo-2-CYNAzclj.js +26 -0
- package/dist/_chunks/undo-2-CYNAzclj.js.map +1 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js +401 -0
- package/dist/_chunks/variables-menu-vXUaSBj4.js.map +1 -0
- package/dist/agent-catalog.json +84 -3
- package/dist/agent-i18n/en.json +14 -3
- package/dist/components/calendar/calendar.d.ts +6 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +4 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/panel-subview/panel-subview.d.ts +6 -0
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +35 -3
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.d.ts +1 -1
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.agent.d.ts.map +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +98 -15
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/variables-menu/index.d.ts +4 -0
- package/dist/components/variables-menu/index.d.ts.map +1 -0
- package/dist/components/variables-menu/index.js +6 -0
- package/dist/components/variables-menu/index.js.map +1 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts +10 -0
- package/dist/components/variables-menu/variables-menu.agent.d.ts.map +1 -0
- package/dist/components/variables-menu/variables-menu.d.ts +53 -0
- package/dist/components/variables-menu/variables-menu.d.ts.map +1 -0
- package/dist/host-compat.css +5 -5
- package/dist/i18n/locales/ar.d.ts +77 -6
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +78 -7
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +77 -6
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +78 -7
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +77 -6
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +78 -7
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +77 -6
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +85 -7
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +77 -6
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +78 -7
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +77 -6
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +78 -7
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +77 -6
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +78 -7
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +77 -6
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +78 -7
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +77 -6
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +78 -7
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +77 -6
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +78 -7
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +77 -6
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +78 -7
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +77 -6
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +78 -7
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +77 -6
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +78 -7
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +77 -6
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +78 -7
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +77 -6
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +78 -7
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +77 -6
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +78 -7
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +77 -6
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +78 -7
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +77 -6
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +78 -7
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +916 -913
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +78 -7
- package/dist/locales/de.json +78 -7
- package/dist/locales/el.json +78 -7
- package/dist/locales/en.json +78 -7
- package/dist/locales/es.json +78 -7
- package/dist/locales/fr.json +78 -7
- package/dist/locales/hi.json +78 -7
- package/dist/locales/it.json +78 -7
- package/dist/locales/ja.json +78 -7
- package/dist/locales/nl.json +78 -7
- package/dist/locales/pl.json +78 -7
- package/dist/locales/pt.json +78 -7
- package/dist/locales/ro.json +78 -7
- package/dist/locales/ru.json +78 -7
- package/dist/locales/sq.json +78 -7
- package/dist/locales/sv.json +78 -7
- package/dist/locales/tr.json +78 -7
- package/dist/locales/zh.json +78 -7
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts +8 -3
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-care-rules.d.ts +49 -0
- package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts +31 -0
- package/dist/patterns/calendar/calendar-task-editor.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +8 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +39 -12
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +9 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +35 -3
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.model.d.ts +23 -1
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +21 -3
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts +6 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.types.d.ts +32 -1
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +58 -26
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts +1 -1
- package/dist/patterns/help-me-write-templates/index.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/tokens.css +6 -6
- package/package.json +5 -1
- package/dist/_chunks/calendar-ChJQzRw-.js.map +0 -1
- package/dist/_chunks/calendar-workspace-DhXqqu-D.js +0 -11392
- package/dist/_chunks/calendar-workspace-DhXqqu-D.js.map +0 -1
- package/dist/_chunks/face-scheme-Dg6ZyLKb.js.map +0 -1
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js +0 -775
- package/dist/_chunks/help-me-write-templates-B-m7zgJa.js.map +0 -1
- package/dist/_chunks/highlighter-DSkckT2Q.js +0 -15
- package/dist/_chunks/highlighter-DSkckT2Q.js.map +0 -1
- package/dist/_chunks/notes-panel-CRAovkjx.js.map +0 -1
- package/dist/_chunks/panel-subview-PMBRPFOa.js.map +0 -1
- package/dist/_chunks/rich-text-editor-DUMeifwc.js +0 -3176
- package/dist/_chunks/rich-text-editor-DUMeifwc.js.map +0 -1
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js +0 -27
- package/dist/_chunks/wand-sparkles-DAjKyhz7.js.map +0 -1
|
@@ -1,3176 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as k, Fragment as Me } from "react/jsx-runtime";
|
|
2
|
-
import { useId as Ee, useState as z, useRef as T, useCallback as x, useEffect as I, Fragment as vt, forwardRef as nn, useMemo as Pe, useImperativeHandle as on } from "react";
|
|
3
|
-
import { c as Ft } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as se } from "react-i18next";
|
|
5
|
-
import { SafeHtml as an, sanitiseHtml as sn } from "../safe-html/index.js";
|
|
6
|
-
import { u as ln } from "./registry-DvAUVLHh.js";
|
|
7
|
-
import { S as kr } from "./spinner-hbwuKwMf.js";
|
|
8
|
-
import { B as ve } from "./button-CaUe1uyd.js";
|
|
9
|
-
import { A as cn } from "./ai-consent-banner-D7I2U-cz.js";
|
|
10
|
-
import { I as V } from "./icon-button-CehAeZoP.js";
|
|
11
|
-
import { T as dn } from "./text-area-Bt3p7Pt0.js";
|
|
12
|
-
import { E as Cr } from "./editor-overlay-DwNKaI22.js";
|
|
13
|
-
import { X as mr } from "./x-B5YnXwCz.js";
|
|
14
|
-
import { R as un } from "./rotate-ccw-BBQnIVTr.js";
|
|
15
|
-
import { C as mn } from "./check-DrFSN__t.js";
|
|
16
|
-
import { S as pt } from "./square-DASBRZ0U.js";
|
|
17
|
-
import { M as Nr } from "./mic-CUklMZGF.js";
|
|
18
|
-
import { S as fn } from "./send-C5kDJ-Mz.js";
|
|
19
|
-
import { a as Tr } from "./tooltip-Cp-PLePW.js";
|
|
20
|
-
import { P as K } from "./popover-DO-pssF3.js";
|
|
21
|
-
import { D as ye } from "./dropdown-menu-DU-Hrf33.js";
|
|
22
|
-
import { D as Z } from "./dialog-BJiLqhx6.js";
|
|
23
|
-
import { C as jt } from "./color-picker-Bl5f0iK1.js";
|
|
24
|
-
import { T as bt } from "./text-input-CUvCb6ST.js";
|
|
25
|
-
import { C as gn } from "./checkbox-CZkipDn7.js";
|
|
26
|
-
import { F as hn } from "./file-upload-BDpb08GM.js";
|
|
27
|
-
import { c as S } from "./createLucideIcon-DhHxpK9K.js";
|
|
28
|
-
import { E as pn } from "./ellipsis-dRo9ouSU.js";
|
|
29
|
-
import { H as bn } from "./highlighter-DSkckT2Q.js";
|
|
30
|
-
import { I as yn } from "./image-B_5MNK0x.js";
|
|
31
|
-
import { C as vn } from "./chevron-down-DWE7GSq9.js";
|
|
32
|
-
import { T as wn } from "./trash-2-uumy3fy1.js";
|
|
33
|
-
import { W as xn } from "./wand-sparkles-DAjKyhz7.js";
|
|
34
|
-
import { A as kn } from "./astroid-BN4f5VXU.js";
|
|
35
|
-
/**
|
|
36
|
-
* @license lucide-react v1.22.0 - ISC
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the ISC license.
|
|
39
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/
|
|
41
|
-
const Cn = [
|
|
42
|
-
["path", { d: "M4 20h16", key: "14thso" }],
|
|
43
|
-
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
44
|
-
["path", { d: "M8 12h8", key: "1wcyev" }]
|
|
45
|
-
], Nn = S("baseline", Cn);
|
|
46
|
-
/**
|
|
47
|
-
* @license lucide-react v1.22.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/
|
|
52
|
-
const Tn = [
|
|
53
|
-
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
|
|
54
|
-
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
|
|
55
|
-
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
|
|
56
|
-
], An = S("between-horizontal-end", Tn);
|
|
57
|
-
/**
|
|
58
|
-
* @license lucide-react v1.22.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/
|
|
63
|
-
const zn = [
|
|
64
|
-
["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
|
|
65
|
-
["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
|
|
66
|
-
["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
|
|
67
|
-
], Rn = S("between-horizontal-start", zn);
|
|
68
|
-
/**
|
|
69
|
-
* @license lucide-react v1.22.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/
|
|
74
|
-
const _n = [
|
|
75
|
-
["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
|
|
76
|
-
["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
|
|
77
|
-
["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
|
|
78
|
-
], Mn = S("between-vertical-end", _n);
|
|
79
|
-
/**
|
|
80
|
-
* @license lucide-react v1.22.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/
|
|
85
|
-
const En = [
|
|
86
|
-
["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
|
|
87
|
-
["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
|
|
88
|
-
["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
|
|
89
|
-
], Sn = S("between-vertical-start", En);
|
|
90
|
-
/**
|
|
91
|
-
* @license lucide-react v1.22.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/
|
|
96
|
-
const Ln = [
|
|
97
|
-
[
|
|
98
|
-
"path",
|
|
99
|
-
{ d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
|
|
100
|
-
]
|
|
101
|
-
], In = S("bold", Ln);
|
|
102
|
-
/**
|
|
103
|
-
* @license lucide-react v1.22.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/
|
|
108
|
-
const $n = [
|
|
109
|
-
[
|
|
110
|
-
"path",
|
|
111
|
-
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
112
|
-
],
|
|
113
|
-
[
|
|
114
|
-
"path",
|
|
115
|
-
{
|
|
116
|
-
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
|
|
117
|
-
key: "e1hn23"
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
], Hn = S("braces", $n);
|
|
121
|
-
/**
|
|
122
|
-
* @license lucide-react v1.22.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/
|
|
127
|
-
const Dn = [
|
|
128
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
129
|
-
["path", { d: "M12 3v18", key: "108xh3" }]
|
|
130
|
-
], On = S("columns-2", Dn);
|
|
131
|
-
/**
|
|
132
|
-
* @license lucide-react v1.22.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/
|
|
137
|
-
const qn = [
|
|
138
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
139
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
140
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
141
|
-
["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
|
|
142
|
-
], Pn = S("heading-2", qn);
|
|
143
|
-
/**
|
|
144
|
-
* @license lucide-react v1.22.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/
|
|
149
|
-
const Fn = [
|
|
150
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
151
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
152
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
153
|
-
["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
|
|
154
|
-
["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
|
|
155
|
-
], jn = S("heading-3", Fn);
|
|
156
|
-
/**
|
|
157
|
-
* @license lucide-react v1.22.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/
|
|
162
|
-
const Bn = [
|
|
163
|
-
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
164
|
-
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
165
|
-
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
166
|
-
], Gn = S("italic", Bn);
|
|
167
|
-
/**
|
|
168
|
-
* @license lucide-react v1.22.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/
|
|
173
|
-
const Vn = [
|
|
174
|
-
["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
|
|
175
|
-
["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
|
|
176
|
-
], Kn = S("link", Vn);
|
|
177
|
-
/**
|
|
178
|
-
* @license lucide-react v1.22.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/
|
|
183
|
-
const Wn = [
|
|
184
|
-
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
185
|
-
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
186
|
-
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
187
|
-
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
188
|
-
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
189
|
-
["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
|
|
190
|
-
], Xn = S("list-ordered", Wn);
|
|
191
|
-
/**
|
|
192
|
-
* @license lucide-react v1.22.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/
|
|
197
|
-
const Zn = [
|
|
198
|
-
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
199
|
-
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
200
|
-
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
201
|
-
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
202
|
-
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
203
|
-
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
204
|
-
], Un = S("list", Zn);
|
|
205
|
-
/**
|
|
206
|
-
* @license lucide-react v1.22.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/
|
|
211
|
-
const Qn = [
|
|
212
|
-
["path", { d: "M11 7 6 2", key: "1jwth8" }],
|
|
213
|
-
["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
|
|
214
|
-
[
|
|
215
|
-
"path",
|
|
216
|
-
{
|
|
217
|
-
d: "M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595",
|
|
218
|
-
key: "1nkol4"
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
[
|
|
222
|
-
"path",
|
|
223
|
-
{
|
|
224
|
-
d: "m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33",
|
|
225
|
-
key: "1nk1rd"
|
|
226
|
-
}
|
|
227
|
-
]
|
|
228
|
-
], Yn = S("paint-bucket", Qn);
|
|
229
|
-
/**
|
|
230
|
-
* @license lucide-react v1.22.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/
|
|
235
|
-
const Jn = [
|
|
236
|
-
["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
|
|
237
|
-
["path", { d: "M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2", key: "1b9h7c" }],
|
|
238
|
-
["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
|
|
239
|
-
], eo = S("paint-roller", Jn);
|
|
240
|
-
/**
|
|
241
|
-
* @license lucide-react v1.22.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/
|
|
246
|
-
const to = [
|
|
247
|
-
[
|
|
248
|
-
"path",
|
|
249
|
-
{
|
|
250
|
-
d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
|
|
251
|
-
key: "e79jfc"
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
|
|
255
|
-
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
256
|
-
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
257
|
-
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
258
|
-
], ro = S("palette", to);
|
|
259
|
-
/**
|
|
260
|
-
* @license lucide-react v1.22.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/
|
|
265
|
-
const no = [
|
|
266
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
267
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
268
|
-
], oo = S("panel-left", no);
|
|
269
|
-
/**
|
|
270
|
-
* @license lucide-react v1.22.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/
|
|
275
|
-
const ao = [
|
|
276
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
277
|
-
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
278
|
-
], io = S("panel-right", ao);
|
|
279
|
-
/**
|
|
280
|
-
* @license lucide-react v1.22.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/
|
|
285
|
-
const so = [
|
|
286
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
287
|
-
["path", { d: "M14 9h1", key: "l0svgy" }],
|
|
288
|
-
["path", { d: "M19 9h2", key: "te2zfg" }],
|
|
289
|
-
["path", { d: "M3 9h2", key: "1h4ldw" }],
|
|
290
|
-
["path", { d: "M9 9h1", key: "15jzuz" }]
|
|
291
|
-
], lo = S("panel-top-dashed", so);
|
|
292
|
-
/**
|
|
293
|
-
* @license lucide-react v1.22.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/
|
|
298
|
-
const co = [
|
|
299
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
300
|
-
["path", { d: "M3 9h18", key: "1pudct" }]
|
|
301
|
-
], uo = S("panel-top", co);
|
|
302
|
-
/**
|
|
303
|
-
* @license lucide-react v1.22.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/
|
|
308
|
-
const mo = [
|
|
309
|
-
["path", { d: "M13 4v16", key: "8vvj80" }],
|
|
310
|
-
["path", { d: "M17 4v16", key: "7dpous" }],
|
|
311
|
-
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
|
|
312
|
-
], fo = S("pilcrow", mo);
|
|
313
|
-
/**
|
|
314
|
-
* @license lucide-react v1.22.0 - ISC
|
|
315
|
-
*
|
|
316
|
-
* This source code is licensed under the ISC license.
|
|
317
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/
|
|
319
|
-
const go = [
|
|
320
|
-
[
|
|
321
|
-
"path",
|
|
322
|
-
{
|
|
323
|
-
d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
|
|
324
|
-
key: "rib7q0"
|
|
325
|
-
}
|
|
326
|
-
],
|
|
327
|
-
[
|
|
328
|
-
"path",
|
|
329
|
-
{
|
|
330
|
-
d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
|
|
331
|
-
key: "1ymkrd"
|
|
332
|
-
}
|
|
333
|
-
]
|
|
334
|
-
], ho = S("quote", go);
|
|
335
|
-
/**
|
|
336
|
-
* @license lucide-react v1.22.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/
|
|
341
|
-
const po = [
|
|
342
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
343
|
-
["path", { d: "M3 12h18", key: "1i2n21" }]
|
|
344
|
-
], bo = S("rows-2", po);
|
|
345
|
-
/**
|
|
346
|
-
* @license lucide-react v1.22.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/
|
|
351
|
-
const yo = [
|
|
352
|
-
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
353
|
-
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
354
|
-
["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
|
|
355
|
-
], vo = S("spell-check", yo);
|
|
356
|
-
/**
|
|
357
|
-
* @license lucide-react v1.22.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/
|
|
362
|
-
const wo = [
|
|
363
|
-
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
364
|
-
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
365
|
-
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
366
|
-
], xo = S("strikethrough", wo);
|
|
367
|
-
/**
|
|
368
|
-
* @license lucide-react v1.22.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/
|
|
373
|
-
const ko = [
|
|
374
|
-
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
375
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
376
|
-
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
377
|
-
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
378
|
-
], Co = S("table", ko);
|
|
379
|
-
/**
|
|
380
|
-
* @license lucide-react v1.22.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/
|
|
385
|
-
const No = [
|
|
386
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
387
|
-
["path", { d: "M17 12H7", key: "16if0g" }],
|
|
388
|
-
["path", { d: "M19 19H5", key: "vjpgq2" }]
|
|
389
|
-
], To = S("text-align-center", No);
|
|
390
|
-
/**
|
|
391
|
-
* @license lucide-react v1.22.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/
|
|
396
|
-
const Ao = [
|
|
397
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
398
|
-
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
399
|
-
["path", { d: "M21 19H7", key: "4cu937" }]
|
|
400
|
-
], zo = S("text-align-end", Ao);
|
|
401
|
-
/**
|
|
402
|
-
* @license lucide-react v1.22.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/
|
|
407
|
-
const Ro = [
|
|
408
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
409
|
-
["path", { d: "M15 12H3", key: "6jk70r" }],
|
|
410
|
-
["path", { d: "M17 19H3", key: "z6ezky" }]
|
|
411
|
-
], _o = S("text-align-start", Ro);
|
|
412
|
-
/**
|
|
413
|
-
* @license lucide-react v1.22.0 - ISC
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the ISC license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/
|
|
418
|
-
const Mo = [
|
|
419
|
-
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
|
|
420
|
-
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
|
|
421
|
-
], Eo = S("underline", Mo);
|
|
422
|
-
/**
|
|
423
|
-
* @license lucide-react v1.22.0 - ISC
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the ISC license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/
|
|
428
|
-
const So = [
|
|
429
|
-
[
|
|
430
|
-
"path",
|
|
431
|
-
{
|
|
432
|
-
d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
|
|
433
|
-
key: "1ngwbx"
|
|
434
|
-
}
|
|
435
|
-
]
|
|
436
|
-
], Lo = S("wrench", So), Io = {
|
|
437
|
-
id: "rich-text-editor",
|
|
438
|
-
capabilities: ["edit_inline"],
|
|
439
|
-
state: {
|
|
440
|
-
html: {
|
|
441
|
-
type: "string",
|
|
442
|
-
descriptionKey: "ui.agent.richTextEditor.state.html",
|
|
443
|
-
description: "Sanitised HTML representation of the editor content.",
|
|
444
|
-
read: (o) => o.getHTML()
|
|
445
|
-
},
|
|
446
|
-
text: {
|
|
447
|
-
type: "string",
|
|
448
|
-
descriptionKey: "ui.agent.richTextEditor.state.text",
|
|
449
|
-
description: "Plain-text content of the editor (tags stripped).",
|
|
450
|
-
read: (o) => o.getText()
|
|
451
|
-
},
|
|
452
|
-
markdown: {
|
|
453
|
-
type: "string",
|
|
454
|
-
descriptionKey: "ui.agent.richTextEditor.state.markdown",
|
|
455
|
-
description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
|
|
456
|
-
read: (o) => o.getMarkdown()
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
// Image wrap/align/resize are intentionally NOT agent actions — they target
|
|
460
|
-
// the ephemeral click-selected image the handle can't address. Agents emit
|
|
461
|
-
// `<img class="wysiwyg-img-*" style="width:N%">` via set_content instead.
|
|
462
|
-
actions: {
|
|
463
|
-
set_content: {
|
|
464
|
-
// Replaces the whole document — discards whatever the user had typed.
|
|
465
|
-
safety: "destructive",
|
|
466
|
-
argsType: "{ html: string }",
|
|
467
|
-
argsSchema: {
|
|
468
|
-
type: "object",
|
|
469
|
-
properties: {
|
|
470
|
-
html: {
|
|
471
|
-
type: "string",
|
|
472
|
-
description: "Replacement HTML (sanitised via DOMPurify)."
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
required: ["html"]
|
|
476
|
-
},
|
|
477
|
-
idempotent: !0,
|
|
478
|
-
descriptionKey: "ui.agent.richTextEditor.actions.setContent",
|
|
479
|
-
description: "Replace the editor content. Loses unsaved input.",
|
|
480
|
-
invoke: (o, i) => {
|
|
481
|
-
o.setContent(i.html);
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
insert_at_cursor: {
|
|
485
|
-
// Reversible via the editor's own undo stack — write, not destructive.
|
|
486
|
-
safety: "write",
|
|
487
|
-
argsType: "{ content: string; asHtml?: boolean }",
|
|
488
|
-
argsSchema: {
|
|
489
|
-
type: "object",
|
|
490
|
-
properties: {
|
|
491
|
-
content: {
|
|
492
|
-
type: "string",
|
|
493
|
-
description: "Content to insert at the caret."
|
|
494
|
-
},
|
|
495
|
-
asHtml: {
|
|
496
|
-
type: "boolean",
|
|
497
|
-
description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
required: ["content"]
|
|
501
|
-
},
|
|
502
|
-
descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
|
|
503
|
-
description: "Insert content at the caret (replacing any selection). HTML is sanitised; pass asHtml:false for plain text. Seam for merge/template variables and AI-generated drafts.",
|
|
504
|
-
examples: [
|
|
505
|
-
{
|
|
506
|
-
args: { content: "{{patient.firstName}}", asHtml: !1 },
|
|
507
|
-
note: "Insert a merge variable as plain text."
|
|
508
|
-
}
|
|
509
|
-
],
|
|
510
|
-
invoke: (o, i) => {
|
|
511
|
-
o.insertAtCursor(i.content, { asHtml: i.asHtml });
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
apply_format: {
|
|
515
|
-
// Reversible via undo — write, not destructive.
|
|
516
|
-
safety: "write",
|
|
517
|
-
argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
|
|
518
|
-
argsSchema: {
|
|
519
|
-
type: "object",
|
|
520
|
-
properties: {
|
|
521
|
-
format: {
|
|
522
|
-
type: "string",
|
|
523
|
-
enum: [
|
|
524
|
-
"bold",
|
|
525
|
-
"italic",
|
|
526
|
-
"strikethrough",
|
|
527
|
-
"bulletedList",
|
|
528
|
-
"numberedList",
|
|
529
|
-
"heading",
|
|
530
|
-
"quote",
|
|
531
|
-
"paragraph"
|
|
532
|
-
],
|
|
533
|
-
description: "Block or inline format to toggle/apply."
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
required: ["format"]
|
|
537
|
-
},
|
|
538
|
-
descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
|
|
539
|
-
description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
|
|
540
|
-
examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
|
|
541
|
-
invoke: (o, i) => {
|
|
542
|
-
o.applyFormat(i.format);
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
clear: {
|
|
546
|
-
// Empties the document — loses unsaved input.
|
|
547
|
-
safety: "destructive",
|
|
548
|
-
idempotent: !0,
|
|
549
|
-
descriptionKey: "ui.agent.richTextEditor.actions.clear",
|
|
550
|
-
description: "Empty the editor. Loses unsaved input.",
|
|
551
|
-
invoke: (o) => {
|
|
552
|
-
o.clear();
|
|
553
|
-
}
|
|
554
|
-
},
|
|
555
|
-
focus: {
|
|
556
|
-
safety: "read",
|
|
557
|
-
idempotent: !0,
|
|
558
|
-
descriptionKey: "ui.agent.richTextEditor.actions.focus",
|
|
559
|
-
description: "Move keyboard focus to the editor surface.",
|
|
560
|
-
invoke: (o) => {
|
|
561
|
-
o.focus();
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
domHooks: {
|
|
566
|
-
root: { attr: "data-component", value: "rich-text-editor" },
|
|
567
|
-
instanceId: {
|
|
568
|
-
attr: "data-component-id",
|
|
569
|
-
sourceProp: "id",
|
|
570
|
-
description: "Sourced from the id prop."
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}, $o = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", _e = "ds:!size-[var(--min-target-size)]", Ho = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Do = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", fr = [
|
|
574
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
575
|
-
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
576
|
-
"ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
|
|
577
|
-
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
|
|
578
|
-
// The preview renders arbitrary model-generated rich text, and the
|
|
579
|
-
// `rich-text` SafeHtml profile allows ul/ol/li. Inside a
|
|
580
|
-
// [data-component] preflight's list reset still applies and the host
|
|
581
|
-
// undo deliberately does not reach, so markers and indent have to be
|
|
582
|
-
// asked for explicitly — otherwise a generated bullet list previews as
|
|
583
|
-
// flush, marker-less lines.
|
|
584
|
-
"ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
|
|
585
|
-
"ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
|
|
586
|
-
].join(" ");
|
|
587
|
-
function gr(o, i) {
|
|
588
|
-
return i ? o ? /\s$/.test(o) ? `${o}${i}` : `${o} ${i}` : i : o;
|
|
589
|
-
}
|
|
590
|
-
function Oo({
|
|
591
|
-
open: o,
|
|
592
|
-
onClose: i,
|
|
593
|
-
onRequestAiDraft: m,
|
|
594
|
-
onInsert: c,
|
|
595
|
-
previewAsHtml: g = !0,
|
|
596
|
-
privacyNotice: l,
|
|
597
|
-
onDictate: b
|
|
598
|
-
}) {
|
|
599
|
-
const { t: d } = se(), p = Ee(), C = Ee(), [R, $] = z(""), [L, M] = z(!1), [G, h] = z(!1), [u, y] = z(null), E = T(null), [A, H] = z(!1), [w, O] = z(""), [q, U] = z(""), X = T(null), P = x(() => {
|
|
600
|
-
var F;
|
|
601
|
-
(F = X.current) == null || F.abort();
|
|
602
|
-
}, []), ne = x(() => {
|
|
603
|
-
if (!b) return;
|
|
604
|
-
const F = new AbortController();
|
|
605
|
-
X.current = F, H(!0), O(""), U(d("editor.ai.listening")), b({
|
|
606
|
-
signal: F.signal,
|
|
607
|
-
onPartialTranscript: (W) => {
|
|
608
|
-
F.signal.aborted || O(W);
|
|
609
|
-
},
|
|
610
|
-
onFinalTranscript: (W) => {
|
|
611
|
-
if (F.signal.aborted) return;
|
|
612
|
-
const oe = W.trim();
|
|
613
|
-
O(""), oe && ($((N) => gr(N, oe)), U(oe));
|
|
614
|
-
}
|
|
615
|
-
}).catch(() => {
|
|
616
|
-
}).finally(() => {
|
|
617
|
-
O(""), X.current === F && (X.current = null, H(!1), U(""));
|
|
618
|
-
});
|
|
619
|
-
}, [b, d]), we = x(() => {
|
|
620
|
-
A ? P() : ne();
|
|
621
|
-
}, [A, ne, P]);
|
|
622
|
-
I(() => {
|
|
623
|
-
var F, W;
|
|
624
|
-
o ? ($(""), M(!1), h(!1), y(null), O(""), U("")) : ((F = E.current) == null || F.abort(), E.current = null, (W = X.current) == null || W.abort());
|
|
625
|
-
}, [o]), I(
|
|
626
|
-
() => () => {
|
|
627
|
-
var F, W;
|
|
628
|
-
(F = E.current) == null || F.abort(), (W = X.current) == null || W.abort();
|
|
629
|
-
},
|
|
630
|
-
[]
|
|
631
|
-
);
|
|
632
|
-
const j = x(() => {
|
|
633
|
-
var oe;
|
|
634
|
-
const F = R.trim();
|
|
635
|
-
if (!F || L) return;
|
|
636
|
-
P(), (oe = E.current) == null || oe.abort();
|
|
637
|
-
const W = new AbortController();
|
|
638
|
-
E.current = W, h(!1), M(!0), m({ prompt: F, signal: W.signal }).then((N) => {
|
|
639
|
-
W.signal.aborted || (y(N), M(!1));
|
|
640
|
-
}).catch((N) => {
|
|
641
|
-
W.signal.aborted || N && typeof N == "object" && "name" in N && N.name === "AbortError" || (h(!0), M(!1));
|
|
642
|
-
});
|
|
643
|
-
}, [R, L, m, P]), Q = x(() => {
|
|
644
|
-
u != null && (c(u), i());
|
|
645
|
-
}, [u, c, i]), Se = u != null, D = A ? gr(R, w) : R;
|
|
646
|
-
return /* @__PURE__ */ t(
|
|
647
|
-
Cr,
|
|
648
|
-
{
|
|
649
|
-
open: o,
|
|
650
|
-
onClose: i,
|
|
651
|
-
ariaLabel: d("editor.ai.dialogTitle"),
|
|
652
|
-
children: Se ? /* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
653
|
-
/* @__PURE__ */ t(
|
|
654
|
-
V,
|
|
655
|
-
{
|
|
656
|
-
size: "md",
|
|
657
|
-
intent: "outline",
|
|
658
|
-
className: _e,
|
|
659
|
-
icon: /* @__PURE__ */ t(mr, {}),
|
|
660
|
-
"aria-label": d("common.close"),
|
|
661
|
-
onClick: i
|
|
662
|
-
}
|
|
663
|
-
),
|
|
664
|
-
/* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: g ? /* @__PURE__ */ t(
|
|
665
|
-
an,
|
|
666
|
-
{
|
|
667
|
-
html: u,
|
|
668
|
-
profile: "rich-text",
|
|
669
|
-
className: fr,
|
|
670
|
-
tabIndex: 0,
|
|
671
|
-
"aria-label": d("editor.ai.dialogTitle")
|
|
672
|
-
}
|
|
673
|
-
) : (
|
|
674
|
-
// Focusable so a keyboard user can scroll a long draft preview
|
|
675
|
-
// (mirrors the SafeHtml preview branch above). The lint rule's
|
|
676
|
-
// tabIndex allowlist doesn't cover a scrollable, non-interactive
|
|
677
|
-
// text region.
|
|
678
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
679
|
-
/* @__PURE__ */ t("p", { className: fr, tabIndex: 0, children: u })
|
|
680
|
-
) }),
|
|
681
|
-
/* @__PURE__ */ t(
|
|
682
|
-
V,
|
|
683
|
-
{
|
|
684
|
-
size: "md",
|
|
685
|
-
intent: "outline",
|
|
686
|
-
className: `${_e} ds:rounded-full`,
|
|
687
|
-
icon: /* @__PURE__ */ t(un, {}),
|
|
688
|
-
"aria-label": d("editor.ai.retry"),
|
|
689
|
-
onClick: () => y(null)
|
|
690
|
-
}
|
|
691
|
-
),
|
|
692
|
-
/* @__PURE__ */ t(
|
|
693
|
-
V,
|
|
694
|
-
{
|
|
695
|
-
size: "md",
|
|
696
|
-
intent: "primary",
|
|
697
|
-
className: `${_e} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
698
|
-
icon: /* @__PURE__ */ t(mn, {}),
|
|
699
|
-
"aria-label": d("common.confirm"),
|
|
700
|
-
onClick: Q
|
|
701
|
-
}
|
|
702
|
-
)
|
|
703
|
-
] }) : /* @__PURE__ */ k(Me, { children: [
|
|
704
|
-
/* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
705
|
-
/* @__PURE__ */ t(
|
|
706
|
-
V,
|
|
707
|
-
{
|
|
708
|
-
size: "md",
|
|
709
|
-
intent: "outline",
|
|
710
|
-
className: _e,
|
|
711
|
-
icon: /* @__PURE__ */ t(mr, {}),
|
|
712
|
-
"aria-label": d("common.close"),
|
|
713
|
-
onClick: i
|
|
714
|
-
}
|
|
715
|
-
),
|
|
716
|
-
/* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ t(
|
|
717
|
-
dn,
|
|
718
|
-
{
|
|
719
|
-
id: p,
|
|
720
|
-
size: "md",
|
|
721
|
-
value: D,
|
|
722
|
-
onChange: (F) => $(F.target.value),
|
|
723
|
-
placeholder: d("editor.ai.promptPlaceholder"),
|
|
724
|
-
"aria-label": d("editor.ai.promptLabel"),
|
|
725
|
-
autoResize: !0,
|
|
726
|
-
minRows: 1,
|
|
727
|
-
maxRows: 3,
|
|
728
|
-
readOnly: A,
|
|
729
|
-
tone: G ? "error" : "default",
|
|
730
|
-
"aria-describedby": G ? C : void 0
|
|
731
|
-
}
|
|
732
|
-
) }),
|
|
733
|
-
b ? /* @__PURE__ */ t(
|
|
734
|
-
V,
|
|
735
|
-
{
|
|
736
|
-
size: "md",
|
|
737
|
-
intent: "outline",
|
|
738
|
-
className: A ? `${_e} ${$o}` : _e,
|
|
739
|
-
icon: A ? /* @__PURE__ */ t(pt, { className: "ds:fill-current" }) : /* @__PURE__ */ t(Nr, {}),
|
|
740
|
-
"aria-pressed": A,
|
|
741
|
-
"aria-label": d(A ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
742
|
-
onClick: we
|
|
743
|
-
}
|
|
744
|
-
) : null,
|
|
745
|
-
/* @__PURE__ */ t(
|
|
746
|
-
V,
|
|
747
|
-
{
|
|
748
|
-
size: "md",
|
|
749
|
-
intent: "primary",
|
|
750
|
-
icon: L ? /* @__PURE__ */ t(kr, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(fn, {}),
|
|
751
|
-
className: `${_e} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
752
|
-
disabled: L || !R.trim(),
|
|
753
|
-
"aria-busy": L || void 0,
|
|
754
|
-
"aria-label": d("editor.ai.generate"),
|
|
755
|
-
onClick: j
|
|
756
|
-
}
|
|
757
|
-
)
|
|
758
|
-
] }),
|
|
759
|
-
b ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: q }) : null,
|
|
760
|
-
G ? /* @__PURE__ */ t("p", { id: C, role: "alert", className: Do, children: d("editor.ai.error") }) : l ? /* @__PURE__ */ t("p", { className: Ho, children: l }) : null
|
|
761
|
-
] })
|
|
762
|
-
}
|
|
763
|
-
);
|
|
764
|
-
}
|
|
765
|
-
const qo = {
|
|
766
|
-
bold: {
|
|
767
|
-
id: "bold",
|
|
768
|
-
icon: /* @__PURE__ */ t(In, {}),
|
|
769
|
-
label: ["editor.bold", "Bold"],
|
|
770
|
-
command: ["module.inline.format", { tag: "b" }],
|
|
771
|
-
toggle: "bold"
|
|
772
|
-
},
|
|
773
|
-
italic: {
|
|
774
|
-
id: "italic",
|
|
775
|
-
icon: /* @__PURE__ */ t(Gn, {}),
|
|
776
|
-
label: ["editor.italic", "Italic"],
|
|
777
|
-
command: ["module.inline.format", { tag: "i" }],
|
|
778
|
-
toggle: "italic"
|
|
779
|
-
},
|
|
780
|
-
underline: {
|
|
781
|
-
id: "underline",
|
|
782
|
-
icon: /* @__PURE__ */ t(Eo, {}),
|
|
783
|
-
label: ["editor.underline", "Underline"],
|
|
784
|
-
command: ["module.inline.format", { tag: "u" }],
|
|
785
|
-
toggle: "underline"
|
|
786
|
-
},
|
|
787
|
-
strike: {
|
|
788
|
-
id: "strike",
|
|
789
|
-
icon: /* @__PURE__ */ t(xo, {}),
|
|
790
|
-
label: ["editor.strike", "Strikethrough"],
|
|
791
|
-
command: ["module.inline.format", { tag: "del" }],
|
|
792
|
-
toggle: "strike"
|
|
793
|
-
},
|
|
794
|
-
ul: {
|
|
795
|
-
id: "ul",
|
|
796
|
-
icon: /* @__PURE__ */ t(Un, {}),
|
|
797
|
-
label: ["editor.list.bullet", "Bulleted list"],
|
|
798
|
-
command: ["module.list.toggle", "ul"],
|
|
799
|
-
toggle: "ul"
|
|
800
|
-
},
|
|
801
|
-
ol: {
|
|
802
|
-
id: "ol",
|
|
803
|
-
icon: /* @__PURE__ */ t(Xn, {}),
|
|
804
|
-
label: ["editor.list.ordered", "Numbered list"],
|
|
805
|
-
command: ["module.list.toggle", "ol"],
|
|
806
|
-
toggle: "ol"
|
|
807
|
-
}
|
|
808
|
-
}, Ht = [
|
|
809
|
-
{
|
|
810
|
-
id: "paragraph",
|
|
811
|
-
tag: "p",
|
|
812
|
-
icon: /* @__PURE__ */ t(fo, {}),
|
|
813
|
-
label: ["editor.paragraph", "Paragraph"]
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
id: "h2",
|
|
817
|
-
tag: "h2",
|
|
818
|
-
icon: /* @__PURE__ */ t(Pn, {}),
|
|
819
|
-
label: ["editor.heading2", "Heading 2"]
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
id: "h3",
|
|
823
|
-
tag: "h3",
|
|
824
|
-
icon: /* @__PURE__ */ t(jn, {}),
|
|
825
|
-
label: ["editor.heading3", "Heading 3"]
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
id: "quote",
|
|
829
|
-
tag: "blockquote",
|
|
830
|
-
icon: /* @__PURE__ */ t(ho, {}),
|
|
831
|
-
label: ["editor.quote", "Quote"]
|
|
832
|
-
}
|
|
833
|
-
], Po = {
|
|
834
|
-
minimal: ["bold", "italic", "underline", "link"],
|
|
835
|
-
standard: [
|
|
836
|
-
"format",
|
|
837
|
-
"bold",
|
|
838
|
-
"italic",
|
|
839
|
-
"underline",
|
|
840
|
-
"strike",
|
|
841
|
-
"ul",
|
|
842
|
-
"ol",
|
|
843
|
-
"link"
|
|
844
|
-
],
|
|
845
|
-
full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
|
|
846
|
-
}, Ar = [
|
|
847
|
-
{
|
|
848
|
-
id: "rowAbove",
|
|
849
|
-
command: "plugin.table.addRowAbove",
|
|
850
|
-
icon: /* @__PURE__ */ t(Rn, {}),
|
|
851
|
-
label: ["editor.table.rowAbove", "Add row above"]
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
id: "rowBelow",
|
|
855
|
-
command: "plugin.table.addRowBelow",
|
|
856
|
-
icon: /* @__PURE__ */ t(An, {}),
|
|
857
|
-
label: ["editor.table.rowBelow", "Add row below"]
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
id: "colLeft",
|
|
861
|
-
command: "plugin.table.addColumnLeft",
|
|
862
|
-
icon: /* @__PURE__ */ t(Sn, {}),
|
|
863
|
-
label: ["editor.table.columnLeft", "Add column left"]
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
id: "colRight",
|
|
867
|
-
command: "plugin.table.addColumnRight",
|
|
868
|
-
icon: /* @__PURE__ */ t(Mn, {}),
|
|
869
|
-
label: ["editor.table.columnRight", "Add column right"]
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
id: "addHead",
|
|
873
|
-
command: "plugin.table.addHead",
|
|
874
|
-
icon: /* @__PURE__ */ t(uo, {}),
|
|
875
|
-
label: ["editor.table.addHeader", "Add header row"]
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
id: "deleteHead",
|
|
879
|
-
command: "plugin.table.deleteHead",
|
|
880
|
-
icon: /* @__PURE__ */ t(lo, {}),
|
|
881
|
-
label: ["editor.table.deleteHeader", "Remove header row"]
|
|
882
|
-
},
|
|
883
|
-
{
|
|
884
|
-
id: "deleteRow",
|
|
885
|
-
command: "plugin.table.deleteRow",
|
|
886
|
-
icon: /* @__PURE__ */ t(bo, {}),
|
|
887
|
-
label: ["editor.table.deleteRow", "Delete row"]
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
id: "deleteColumn",
|
|
891
|
-
command: "plugin.table.deleteColumn",
|
|
892
|
-
icon: /* @__PURE__ */ t(On, {}),
|
|
893
|
-
label: ["editor.table.deleteColumn", "Delete column"]
|
|
894
|
-
},
|
|
895
|
-
{
|
|
896
|
-
id: "deleteTable",
|
|
897
|
-
command: "plugin.table.deleteTable",
|
|
898
|
-
icon: /* @__PURE__ */ t(wn, {}),
|
|
899
|
-
label: ["editor.table.deleteTable", "Delete table"]
|
|
900
|
-
}
|
|
901
|
-
], ft = 6, Fo = Ft(
|
|
902
|
-
[
|
|
903
|
-
"ds:@container/toolbar",
|
|
904
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
905
|
-
"ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
|
|
906
|
-
"ds:shadow-[var(--shadow-md)]"
|
|
907
|
-
].join(" ")
|
|
908
|
-
), jo = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", Bt = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Ke = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
909
|
-
function yt(o) {
|
|
910
|
-
return o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
911
|
-
}
|
|
912
|
-
function Bo({
|
|
913
|
-
variables: o,
|
|
914
|
-
insertVariable: i,
|
|
915
|
-
saveSelection: m
|
|
916
|
-
}) {
|
|
917
|
-
const { t: c } = se(), g = T(!1);
|
|
918
|
-
return /* @__PURE__ */ k(
|
|
919
|
-
ye.Root,
|
|
920
|
-
{
|
|
921
|
-
onOpenChange: (l) => {
|
|
922
|
-
l && m();
|
|
923
|
-
},
|
|
924
|
-
children: [
|
|
925
|
-
/* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
926
|
-
V,
|
|
927
|
-
{
|
|
928
|
-
size: "sm",
|
|
929
|
-
intent: "ghost",
|
|
930
|
-
icon: /* @__PURE__ */ t(Hn, {}),
|
|
931
|
-
"aria-label": c("editor.insertVariable", "Insert variable")
|
|
932
|
-
}
|
|
933
|
-
) }),
|
|
934
|
-
/* @__PURE__ */ k(
|
|
935
|
-
ye.Content,
|
|
936
|
-
{
|
|
937
|
-
align: "start",
|
|
938
|
-
onCloseAutoFocus: (l) => {
|
|
939
|
-
g.current && l.preventDefault(), g.current = !1;
|
|
940
|
-
},
|
|
941
|
-
children: [
|
|
942
|
-
/* @__PURE__ */ t(ye.Label, { children: c("editor.variables", "Variables") }),
|
|
943
|
-
o.map((l) => /* @__PURE__ */ t(
|
|
944
|
-
ye.Item,
|
|
945
|
-
{
|
|
946
|
-
description: l.description ?? `[[${l.token}]]`,
|
|
947
|
-
onSelect: () => {
|
|
948
|
-
g.current = !0, i(l.token);
|
|
949
|
-
},
|
|
950
|
-
children: l.label
|
|
951
|
-
},
|
|
952
|
-
l.token
|
|
953
|
-
))
|
|
954
|
-
]
|
|
955
|
-
}
|
|
956
|
-
)
|
|
957
|
-
]
|
|
958
|
-
}
|
|
959
|
-
);
|
|
960
|
-
}
|
|
961
|
-
function Go({
|
|
962
|
-
run: o,
|
|
963
|
-
active: i,
|
|
964
|
-
onTriggerDown: m
|
|
965
|
-
}) {
|
|
966
|
-
const { t: c } = se(), g = Ht.find((l) => i.has(l.id)) ?? Ht[0];
|
|
967
|
-
return /* @__PURE__ */ k(ye.Root, { children: [
|
|
968
|
-
/* @__PURE__ */ t(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
969
|
-
ve,
|
|
970
|
-
{
|
|
971
|
-
size: "sm",
|
|
972
|
-
intent: "ghost",
|
|
973
|
-
startIcon: g.icon,
|
|
974
|
-
endIcon: /* @__PURE__ */ t(vn, {}),
|
|
975
|
-
"aria-label": `${c("editor.format", "Paragraph style")}: ${c(
|
|
976
|
-
g.label[0],
|
|
977
|
-
g.label[1]
|
|
978
|
-
)}`,
|
|
979
|
-
onMouseDown: m,
|
|
980
|
-
children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(g.label[0], g.label[1]) })
|
|
981
|
-
}
|
|
982
|
-
) }),
|
|
983
|
-
/* @__PURE__ */ t(ye.Content, { align: "start", children: Ht.map((l) => /* @__PURE__ */ t(
|
|
984
|
-
ye.Item,
|
|
985
|
-
{
|
|
986
|
-
startIcon: l.icon,
|
|
987
|
-
onSelect: () => o("module.block.format", { tag: l.tag }),
|
|
988
|
-
children: c(l.label[0], l.label[1])
|
|
989
|
-
},
|
|
990
|
-
l.id
|
|
991
|
-
)) })
|
|
992
|
-
] });
|
|
993
|
-
}
|
|
994
|
-
function Vo({
|
|
995
|
-
insertHtml: o,
|
|
996
|
-
saveSelection: i,
|
|
997
|
-
restoreSelection: m,
|
|
998
|
-
getSelectedText: c
|
|
999
|
-
}) {
|
|
1000
|
-
const { t: g } = se(), [l, b] = z(!1), [d, p] = z(""), [C, R] = z(""), [$, L] = z(!1), M = Ee(), G = Ee(), h = () => {
|
|
1001
|
-
p(""), R(""), L(!1);
|
|
1002
|
-
}, u = () => {
|
|
1003
|
-
const y = d.trim();
|
|
1004
|
-
if (!y) return;
|
|
1005
|
-
const E = C.trim() || y, A = $ ? ' target="_blank" rel="noopener noreferrer"' : "", H = `<a href="${yt(y)}"${A}>${yt(E)}</a>`;
|
|
1006
|
-
b(!1), h(), window.requestAnimationFrame(() => {
|
|
1007
|
-
m(), o(H);
|
|
1008
|
-
});
|
|
1009
|
-
};
|
|
1010
|
-
return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: b, children: [
|
|
1011
|
-
/* @__PURE__ */ t(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1012
|
-
V,
|
|
1013
|
-
{
|
|
1014
|
-
size: "sm",
|
|
1015
|
-
intent: "ghost",
|
|
1016
|
-
icon: /* @__PURE__ */ t(Kn, {}),
|
|
1017
|
-
"aria-label": g("editor.link.insert", "Insert link"),
|
|
1018
|
-
onMouseDown: () => {
|
|
1019
|
-
i(), R(c());
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
) }),
|
|
1023
|
-
/* @__PURE__ */ k(Z.Content, { children: [
|
|
1024
|
-
/* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: g("editor.link.insert", "Insert link") }) }),
|
|
1025
|
-
/* @__PURE__ */ k(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1026
|
-
/* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1027
|
-
/* @__PURE__ */ t("label", { htmlFor: M, className: Ke, children: g("editor.link.url", "URL") }),
|
|
1028
|
-
/* @__PURE__ */ t(
|
|
1029
|
-
bt,
|
|
1030
|
-
{
|
|
1031
|
-
id: M,
|
|
1032
|
-
type: "url",
|
|
1033
|
-
value: d,
|
|
1034
|
-
onChange: (y) => p(y.target.value),
|
|
1035
|
-
placeholder: "https://…"
|
|
1036
|
-
}
|
|
1037
|
-
)
|
|
1038
|
-
] }),
|
|
1039
|
-
/* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1040
|
-
/* @__PURE__ */ t("label", { htmlFor: G, className: Ke, children: g("editor.link.text", "Text to display") }),
|
|
1041
|
-
/* @__PURE__ */ t(
|
|
1042
|
-
bt,
|
|
1043
|
-
{
|
|
1044
|
-
id: G,
|
|
1045
|
-
value: C,
|
|
1046
|
-
onChange: (y) => R(y.target.value),
|
|
1047
|
-
placeholder: g("editor.link.textPlaceholder", "Link text")
|
|
1048
|
-
}
|
|
1049
|
-
)
|
|
1050
|
-
] }),
|
|
1051
|
-
/* @__PURE__ */ t(
|
|
1052
|
-
gn,
|
|
1053
|
-
{
|
|
1054
|
-
checked: $,
|
|
1055
|
-
onCheckedChange: (y) => L(y === !0),
|
|
1056
|
-
label: g("editor.link.newTab", "Open in new tab")
|
|
1057
|
-
}
|
|
1058
|
-
)
|
|
1059
|
-
] }),
|
|
1060
|
-
/* @__PURE__ */ k(Z.Footer, { children: [
|
|
1061
|
-
/* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(ve, { intent: "secondary", children: g("common.cancel") }) }),
|
|
1062
|
-
/* @__PURE__ */ t(ve, { onClick: u, disabled: !d.trim(), children: g("editor.link.insertAction", "Insert") })
|
|
1063
|
-
] })
|
|
1064
|
-
] })
|
|
1065
|
-
] });
|
|
1066
|
-
}
|
|
1067
|
-
function Ko({
|
|
1068
|
-
insertHtml: o,
|
|
1069
|
-
saveSelection: i,
|
|
1070
|
-
restoreSelection: m,
|
|
1071
|
-
uploadImage: c
|
|
1072
|
-
}) {
|
|
1073
|
-
const { t: g } = se(), [l, b] = z(!1), [d, p] = z(""), [C, R] = z(""), $ = Ee(), L = Ee(), M = (h, u) => {
|
|
1074
|
-
const y = `<img src="${yt(h)}" alt="${yt(u)}" loading="lazy">`;
|
|
1075
|
-
b(!1), p(""), R(""), window.requestAnimationFrame(() => {
|
|
1076
|
-
m(), o(y);
|
|
1077
|
-
});
|
|
1078
|
-
}, G = () => {
|
|
1079
|
-
const h = d.trim();
|
|
1080
|
-
h && M(h, C.trim());
|
|
1081
|
-
};
|
|
1082
|
-
return /* @__PURE__ */ k(Z.Root, { open: l, onOpenChange: b, children: [
|
|
1083
|
-
/* @__PURE__ */ t(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1084
|
-
V,
|
|
1085
|
-
{
|
|
1086
|
-
size: "sm",
|
|
1087
|
-
intent: "ghost",
|
|
1088
|
-
icon: /* @__PURE__ */ t(yn, {}),
|
|
1089
|
-
"aria-label": g("editor.image.insert", "Insert image"),
|
|
1090
|
-
onMouseDown: () => i()
|
|
1091
|
-
}
|
|
1092
|
-
) }),
|
|
1093
|
-
/* @__PURE__ */ k(Z.Content, { children: [
|
|
1094
|
-
/* @__PURE__ */ t(Z.Header, { children: /* @__PURE__ */ t(Z.Title, { children: g("editor.image.insert", "Insert image") }) }),
|
|
1095
|
-
/* @__PURE__ */ k(Z.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1096
|
-
c ? /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1097
|
-
/* @__PURE__ */ t("span", { className: Ke, children: g("editor.image.upload", "Upload") }),
|
|
1098
|
-
/* @__PURE__ */ t(
|
|
1099
|
-
hn,
|
|
1100
|
-
{
|
|
1101
|
-
variant: "dropzone",
|
|
1102
|
-
accept: {
|
|
1103
|
-
"image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
|
|
1104
|
-
},
|
|
1105
|
-
maxFiles: 1,
|
|
1106
|
-
onUpload: async (h, { signal: u }) => {
|
|
1107
|
-
const y = await c(h, u);
|
|
1108
|
-
M(y, h.name);
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
),
|
|
1112
|
-
/* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: g("editor.image.orUrl", "Or paste an image URL") })
|
|
1113
|
-
] }) : null,
|
|
1114
|
-
/* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1115
|
-
/* @__PURE__ */ t("label", { htmlFor: $, className: Ke, children: g("editor.image.url", "Image URL") }),
|
|
1116
|
-
/* @__PURE__ */ t(
|
|
1117
|
-
bt,
|
|
1118
|
-
{
|
|
1119
|
-
id: $,
|
|
1120
|
-
type: "url",
|
|
1121
|
-
value: d,
|
|
1122
|
-
onChange: (h) => p(h.target.value),
|
|
1123
|
-
placeholder: "https://…"
|
|
1124
|
-
}
|
|
1125
|
-
)
|
|
1126
|
-
] }),
|
|
1127
|
-
/* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1128
|
-
/* @__PURE__ */ t("label", { htmlFor: L, className: Ke, children: g("editor.image.alt", "Alt text") }),
|
|
1129
|
-
/* @__PURE__ */ t(
|
|
1130
|
-
bt,
|
|
1131
|
-
{
|
|
1132
|
-
id: L,
|
|
1133
|
-
value: C,
|
|
1134
|
-
onChange: (h) => R(h.target.value),
|
|
1135
|
-
placeholder: g(
|
|
1136
|
-
"editor.image.altPlaceholder",
|
|
1137
|
-
"Describe the image"
|
|
1138
|
-
)
|
|
1139
|
-
}
|
|
1140
|
-
)
|
|
1141
|
-
] })
|
|
1142
|
-
] }),
|
|
1143
|
-
/* @__PURE__ */ k(Z.Footer, { children: [
|
|
1144
|
-
/* @__PURE__ */ t(Z.Close, { asChild: !0, children: /* @__PURE__ */ t(ve, { intent: "secondary", children: g("common.cancel") }) }),
|
|
1145
|
-
/* @__PURE__ */ t(ve, { onClick: G, disabled: !d.trim(), children: g("editor.image.insertAction", "Insert") })
|
|
1146
|
-
] })
|
|
1147
|
-
] })
|
|
1148
|
-
] });
|
|
1149
|
-
}
|
|
1150
|
-
function Wo({
|
|
1151
|
-
run: o,
|
|
1152
|
-
saveSelection: i,
|
|
1153
|
-
restoreSelection: m
|
|
1154
|
-
}) {
|
|
1155
|
-
const { t: c } = se(), [g, l] = z("#1f2a5c"), b = (p) => {
|
|
1156
|
-
l(p), m(), o("module.inline.format", {
|
|
1157
|
-
tag: "span",
|
|
1158
|
-
style: { color: p },
|
|
1159
|
-
type: "toggle"
|
|
1160
|
-
});
|
|
1161
|
-
}, d = () => {
|
|
1162
|
-
m(), o("module.inline.remove", { style: "color" });
|
|
1163
|
-
};
|
|
1164
|
-
return /* @__PURE__ */ k(K, { onOpenChange: (p) => p && i(), children: [
|
|
1165
|
-
/* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1166
|
-
V,
|
|
1167
|
-
{
|
|
1168
|
-
size: "sm",
|
|
1169
|
-
intent: "ghost",
|
|
1170
|
-
icon: /* @__PURE__ */ t(ro, {}),
|
|
1171
|
-
"aria-label": c("editor.textColor", "Text colour"),
|
|
1172
|
-
onMouseDown: (p) => {
|
|
1173
|
-
p.preventDefault(), i();
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
) }),
|
|
1177
|
-
/* @__PURE__ */ k(K.Content, { side: "bottom", align: "start", children: [
|
|
1178
|
-
/* @__PURE__ */ t(K.Heading, { children: c("editor.textColor", "Text colour") }),
|
|
1179
|
-
/* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
|
|
1180
|
-
jt,
|
|
1181
|
-
{
|
|
1182
|
-
variant: "inline",
|
|
1183
|
-
size: "sm",
|
|
1184
|
-
value: g,
|
|
1185
|
-
onChange: b
|
|
1186
|
-
}
|
|
1187
|
-
) }),
|
|
1188
|
-
/* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(ve, { size: "sm", intent: "secondary", onClick: d, children: c("editor.color.remove", "Remove colour") }) })
|
|
1189
|
-
] })
|
|
1190
|
-
] });
|
|
1191
|
-
}
|
|
1192
|
-
function Xo({
|
|
1193
|
-
run: o,
|
|
1194
|
-
saveSelection: i,
|
|
1195
|
-
restoreSelection: m
|
|
1196
|
-
}) {
|
|
1197
|
-
const { t: c } = se(), [g, l] = z("#fff3a3"), b = (p) => {
|
|
1198
|
-
l(p), m(), o("module.inline.format", {
|
|
1199
|
-
tag: "span",
|
|
1200
|
-
style: { "background-color": p },
|
|
1201
|
-
type: "toggle"
|
|
1202
|
-
});
|
|
1203
|
-
}, d = () => {
|
|
1204
|
-
m(), o("module.inline.remove", { style: "background-color" });
|
|
1205
|
-
};
|
|
1206
|
-
return /* @__PURE__ */ k(K, { onOpenChange: (p) => p && i(), children: [
|
|
1207
|
-
/* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1208
|
-
V,
|
|
1209
|
-
{
|
|
1210
|
-
size: "sm",
|
|
1211
|
-
intent: "ghost",
|
|
1212
|
-
icon: /* @__PURE__ */ t(bn, {}),
|
|
1213
|
-
"aria-label": c("editor.highlightColor", "Highlight"),
|
|
1214
|
-
onMouseDown: (p) => {
|
|
1215
|
-
p.preventDefault(), i();
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
) }),
|
|
1219
|
-
/* @__PURE__ */ k(K.Content, { side: "bottom", align: "start", children: [
|
|
1220
|
-
/* @__PURE__ */ t(K.Heading, { children: c("editor.highlightColor", "Highlight") }),
|
|
1221
|
-
/* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
|
|
1222
|
-
jt,
|
|
1223
|
-
{
|
|
1224
|
-
variant: "inline",
|
|
1225
|
-
size: "sm",
|
|
1226
|
-
value: g,
|
|
1227
|
-
onChange: b
|
|
1228
|
-
}
|
|
1229
|
-
) }),
|
|
1230
|
-
/* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(ve, { size: "sm", intent: "secondary", onClick: d, children: c("editor.highlight.remove", "Remove highlight") }) })
|
|
1231
|
-
] })
|
|
1232
|
-
] });
|
|
1233
|
-
}
|
|
1234
|
-
function Zo(o, i) {
|
|
1235
|
-
const m = Array.from({ length: i }, () => "<td><br></td>").join("");
|
|
1236
|
-
return `<table><tbody>${Array.from({ length: o }, () => `<tr>${m}</tr>`).join("")}</tbody></table>`;
|
|
1237
|
-
}
|
|
1238
|
-
function Uo({
|
|
1239
|
-
run: o,
|
|
1240
|
-
insertTable: i,
|
|
1241
|
-
active: m
|
|
1242
|
-
}) {
|
|
1243
|
-
const { t: c } = se(), [g, l] = z({ r: 0, c: 0 }), b = m.has("table");
|
|
1244
|
-
return /* @__PURE__ */ k(K, { onOpenChange: (d) => !d && l({ r: 0, c: 0 }), children: [
|
|
1245
|
-
/* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1246
|
-
V,
|
|
1247
|
-
{
|
|
1248
|
-
size: "sm",
|
|
1249
|
-
intent: "ghost",
|
|
1250
|
-
icon: /* @__PURE__ */ t(Co, {}),
|
|
1251
|
-
"aria-label": c("editor.table.insert", "Insert table"),
|
|
1252
|
-
onMouseDown: (d) => d.preventDefault()
|
|
1253
|
-
}
|
|
1254
|
-
) }),
|
|
1255
|
-
/* @__PURE__ */ t(K.Content, { side: "bottom", align: "start", children: b ? (
|
|
1256
|
-
// Caret is already inside a table — offer the manage ops only, never
|
|
1257
|
-
// a nested-table insert (mirrors Redactor's native dropdown, which
|
|
1258
|
-
// disables "insert table" while the caret is in a table).
|
|
1259
|
-
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: Ar.map((d) => /* @__PURE__ */ k(
|
|
1260
|
-
"button",
|
|
1261
|
-
{
|
|
1262
|
-
type: "button",
|
|
1263
|
-
onClick: () => o(d.command),
|
|
1264
|
-
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-start ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]",
|
|
1265
|
-
children: [
|
|
1266
|
-
/* @__PURE__ */ t(
|
|
1267
|
-
"span",
|
|
1268
|
-
{
|
|
1269
|
-
"aria-hidden": "true",
|
|
1270
|
-
className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
|
|
1271
|
-
children: d.icon
|
|
1272
|
-
}
|
|
1273
|
-
),
|
|
1274
|
-
c(d.label[0], d.label[1])
|
|
1275
|
-
]
|
|
1276
|
-
},
|
|
1277
|
-
d.id
|
|
1278
|
-
)) })
|
|
1279
|
-
) : /* @__PURE__ */ k(Me, { children: [
|
|
1280
|
-
/* @__PURE__ */ t(K.Heading, { children: c("editor.table.insert", "Insert table") }),
|
|
1281
|
-
/* @__PURE__ */ t(
|
|
1282
|
-
"div",
|
|
1283
|
-
{
|
|
1284
|
-
role: "group",
|
|
1285
|
-
"aria-label": c("editor.table.sizePicker", "Table size"),
|
|
1286
|
-
className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
|
|
1287
|
-
onMouseLeave: () => l({ r: 0, c: 0 }),
|
|
1288
|
-
children: Array.from({ length: ft * ft }, (d, p) => {
|
|
1289
|
-
const C = Math.floor(p / ft) + 1, R = p % ft + 1, $ = C <= g.r && R <= g.c;
|
|
1290
|
-
return /* @__PURE__ */ t(
|
|
1291
|
-
"button",
|
|
1292
|
-
{
|
|
1293
|
-
type: "button",
|
|
1294
|
-
"aria-label": c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1295
|
-
r: C,
|
|
1296
|
-
c: R
|
|
1297
|
-
}),
|
|
1298
|
-
onMouseEnter: () => l({ r: C, c: R }),
|
|
1299
|
-
onClick: () => i(Zo(C, R)),
|
|
1300
|
-
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${$ ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
|
|
1301
|
-
},
|
|
1302
|
-
p
|
|
1303
|
-
);
|
|
1304
|
-
})
|
|
1305
|
-
}
|
|
1306
|
-
),
|
|
1307
|
-
/* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: g.r > 0 ? c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1308
|
-
r: g.r,
|
|
1309
|
-
c: g.c
|
|
1310
|
-
}) : c("editor.table.sizeHint", "Pick a size") })
|
|
1311
|
-
] }) })
|
|
1312
|
-
] });
|
|
1313
|
-
}
|
|
1314
|
-
const Qo = Object.fromEntries(Ar.map((o) => [o.id, o])), Yo = [
|
|
1315
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1316
|
-
"ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
|
|
1317
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1318
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1319
|
-
].join(" "), Jo = "#fde68a";
|
|
1320
|
-
function hr({
|
|
1321
|
-
scope: o,
|
|
1322
|
-
icon: i,
|
|
1323
|
-
label: m,
|
|
1324
|
-
onOpenChange: c,
|
|
1325
|
-
saveTableCell: g,
|
|
1326
|
-
applyTableBackground: l
|
|
1327
|
-
}) {
|
|
1328
|
-
const { t: b } = se(), [d, p] = z(Jo);
|
|
1329
|
-
return /* @__PURE__ */ k(
|
|
1330
|
-
K,
|
|
1331
|
-
{
|
|
1332
|
-
onOpenChange: (C) => {
|
|
1333
|
-
c(C), C && g();
|
|
1334
|
-
},
|
|
1335
|
-
children: [
|
|
1336
|
-
/* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1337
|
-
V,
|
|
1338
|
-
{
|
|
1339
|
-
size: "sm",
|
|
1340
|
-
intent: "ghost",
|
|
1341
|
-
icon: i,
|
|
1342
|
-
tooltip: m,
|
|
1343
|
-
onMouseDown: (C) => C.preventDefault()
|
|
1344
|
-
}
|
|
1345
|
-
) }),
|
|
1346
|
-
/* @__PURE__ */ k(K.Content, { side: "bottom", align: "center", children: [
|
|
1347
|
-
/* @__PURE__ */ t(
|
|
1348
|
-
jt,
|
|
1349
|
-
{
|
|
1350
|
-
variant: "inline",
|
|
1351
|
-
size: "sm",
|
|
1352
|
-
value: d,
|
|
1353
|
-
onChange: (C) => {
|
|
1354
|
-
p(C), l(o, C);
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
),
|
|
1358
|
-
/* @__PURE__ */ t(
|
|
1359
|
-
ve,
|
|
1360
|
-
{
|
|
1361
|
-
size: "sm",
|
|
1362
|
-
intent: "ghost",
|
|
1363
|
-
className: "ds:mt-[var(--spacing-xs)] ds:w-full",
|
|
1364
|
-
onClick: () => l(o, null),
|
|
1365
|
-
children: b("editor.table.clearColor", "Clear colour")
|
|
1366
|
-
}
|
|
1367
|
-
)
|
|
1368
|
-
] })
|
|
1369
|
-
]
|
|
1370
|
-
}
|
|
1371
|
-
);
|
|
1372
|
-
}
|
|
1373
|
-
function ea({
|
|
1374
|
-
active: o,
|
|
1375
|
-
run: i,
|
|
1376
|
-
areaRef: m,
|
|
1377
|
-
getActiveTableEl: c,
|
|
1378
|
-
enableColor: g = !1,
|
|
1379
|
-
saveTableCell: l,
|
|
1380
|
-
applyTableBackground: b
|
|
1381
|
-
}) {
|
|
1382
|
-
const { t: d } = se(), p = o.has("table"), [C, R] = z(null), $ = T(0), [L, M] = z(!1), G = x((u) => {
|
|
1383
|
-
$.current = Math.max(
|
|
1384
|
-
0,
|
|
1385
|
-
$.current + (u ? 1 : -1)
|
|
1386
|
-
), M($.current > 0);
|
|
1387
|
-
}, []);
|
|
1388
|
-
if (I(() => {
|
|
1389
|
-
if (L) return;
|
|
1390
|
-
if (!p || typeof window > "u") {
|
|
1391
|
-
R(null);
|
|
1392
|
-
return;
|
|
1393
|
-
}
|
|
1394
|
-
const u = () => {
|
|
1395
|
-
const H = m.current, w = c();
|
|
1396
|
-
if (!H || !w) {
|
|
1397
|
-
R(null);
|
|
1398
|
-
return;
|
|
1399
|
-
}
|
|
1400
|
-
const O = H.getBoundingClientRect(), q = w.getBoundingClientRect(), U = getComputedStyle(H).direction === "rtl", X = Math.max(0, q.top - O.top - 44), P = U ? O.right - q.right + q.width / 2 : q.left - O.left + q.width / 2;
|
|
1401
|
-
R({ top: X, start: Math.max(0, P), rtl: U });
|
|
1402
|
-
};
|
|
1403
|
-
u();
|
|
1404
|
-
const y = new ResizeObserver(u), E = m.current, A = c();
|
|
1405
|
-
return E && y.observe(E), A && y.observe(A), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1406
|
-
y.disconnect(), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1407
|
-
};
|
|
1408
|
-
}, [p, L, m, c]), !p && !L || !C) return null;
|
|
1409
|
-
const h = [
|
|
1410
|
-
["rowAbove", "rowBelow"],
|
|
1411
|
-
["colLeft", "colRight"],
|
|
1412
|
-
["addHead"],
|
|
1413
|
-
...g ? ["colour"] : [],
|
|
1414
|
-
["deleteRow", "deleteColumn"],
|
|
1415
|
-
["deleteTable"]
|
|
1416
|
-
];
|
|
1417
|
-
return (
|
|
1418
|
-
// Tooltips disambiguate the icon-only ops on hover (and provide each
|
|
1419
|
-
// button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
|
|
1420
|
-
// needs a provider ancestor, so scope one to the bar.
|
|
1421
|
-
/* @__PURE__ */ t(Tr, { children: /* @__PURE__ */ t(
|
|
1422
|
-
"div",
|
|
1423
|
-
{
|
|
1424
|
-
role: "group",
|
|
1425
|
-
"aria-label": d("editor.table.toolbar", "Table tools"),
|
|
1426
|
-
className: `${Yo} ${C.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1427
|
-
style: {
|
|
1428
|
-
"--rte-tt-top": `${C.top}px`,
|
|
1429
|
-
"--rte-tt-start": `${C.start}px`
|
|
1430
|
-
},
|
|
1431
|
-
children: h.map((u, y) => /* @__PURE__ */ k(vt, { children: [
|
|
1432
|
-
y > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }) : null,
|
|
1433
|
-
u === "colour" ? /* @__PURE__ */ k(Me, { children: [
|
|
1434
|
-
/* @__PURE__ */ t(
|
|
1435
|
-
hr,
|
|
1436
|
-
{
|
|
1437
|
-
scope: "cell",
|
|
1438
|
-
icon: /* @__PURE__ */ t(Yn, {}),
|
|
1439
|
-
label: d("editor.table.cellColor", "Cell colour"),
|
|
1440
|
-
onOpenChange: G,
|
|
1441
|
-
saveTableCell: l,
|
|
1442
|
-
applyTableBackground: b
|
|
1443
|
-
}
|
|
1444
|
-
),
|
|
1445
|
-
/* @__PURE__ */ t(
|
|
1446
|
-
hr,
|
|
1447
|
-
{
|
|
1448
|
-
scope: "row",
|
|
1449
|
-
icon: /* @__PURE__ */ t(eo, {}),
|
|
1450
|
-
label: d("editor.table.rowColor", "Row colour"),
|
|
1451
|
-
onOpenChange: G,
|
|
1452
|
-
saveTableCell: l,
|
|
1453
|
-
applyTableBackground: b
|
|
1454
|
-
}
|
|
1455
|
-
)
|
|
1456
|
-
] }) : u.map((E) => {
|
|
1457
|
-
const A = Qo[E];
|
|
1458
|
-
return /* @__PURE__ */ t(
|
|
1459
|
-
V,
|
|
1460
|
-
{
|
|
1461
|
-
size: "sm",
|
|
1462
|
-
intent: "ghost",
|
|
1463
|
-
icon: A.icon,
|
|
1464
|
-
tooltip: d(A.label[0], A.label[1]),
|
|
1465
|
-
onMouseDown: (H) => H.preventDefault(),
|
|
1466
|
-
onClick: () => i(A.command)
|
|
1467
|
-
},
|
|
1468
|
-
E
|
|
1469
|
-
);
|
|
1470
|
-
})
|
|
1471
|
-
] }, u === "colour" ? "colour" : u[0]))
|
|
1472
|
-
}
|
|
1473
|
-
) })
|
|
1474
|
-
);
|
|
1475
|
-
}
|
|
1476
|
-
const Ot = [
|
|
1477
|
-
"wysiwyg-img-inline",
|
|
1478
|
-
"wysiwyg-img-wrap-left",
|
|
1479
|
-
"wysiwyg-img-wrap-right"
|
|
1480
|
-
], zr = [
|
|
1481
|
-
"wysiwyg-img-align-left",
|
|
1482
|
-
"wysiwyg-img-align-center",
|
|
1483
|
-
"wysiwyg-img-align-right"
|
|
1484
|
-
];
|
|
1485
|
-
function pr(o, i) {
|
|
1486
|
-
return i.find((m) => o.classList.contains(m)) ?? "";
|
|
1487
|
-
}
|
|
1488
|
-
function ta(o) {
|
|
1489
|
-
const i = o.closest(".redactor-in"), m = i instanceof HTMLElement ? i.clientWidth : 0, c = o.getBoundingClientRect().width;
|
|
1490
|
-
return m <= 0 || c <= 0 ? We : Math.round(Math.min(We, c / m * 100));
|
|
1491
|
-
}
|
|
1492
|
-
const qt = 10, We = 100, ra = 5, na = 10, br = (o) => Math.min(We, Math.max(qt, Math.round(o))), oa = [
|
|
1493
|
-
{
|
|
1494
|
-
id: "wysiwyg-img-inline",
|
|
1495
|
-
icon: /* @__PURE__ */ t(Nn, {}),
|
|
1496
|
-
label: ["editor.image.inline", "Inline with text"]
|
|
1497
|
-
},
|
|
1498
|
-
{
|
|
1499
|
-
id: "wysiwyg-img-wrap-left",
|
|
1500
|
-
icon: /* @__PURE__ */ t(oo, {}),
|
|
1501
|
-
label: ["editor.image.wrapLeft", "Wrap left"]
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
id: "wysiwyg-img-wrap-right",
|
|
1505
|
-
icon: /* @__PURE__ */ t(io, {}),
|
|
1506
|
-
label: ["editor.image.wrapRight", "Wrap right"]
|
|
1507
|
-
}
|
|
1508
|
-
], aa = [
|
|
1509
|
-
{
|
|
1510
|
-
id: "wysiwyg-img-align-left",
|
|
1511
|
-
icon: /* @__PURE__ */ t(_o, {}),
|
|
1512
|
-
label: ["editor.image.alignLeft", "Align left"]
|
|
1513
|
-
},
|
|
1514
|
-
{
|
|
1515
|
-
id: "wysiwyg-img-align-center",
|
|
1516
|
-
icon: /* @__PURE__ */ t(To, {}),
|
|
1517
|
-
label: ["editor.image.alignCenter", "Align centre"]
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
id: "wysiwyg-img-align-right",
|
|
1521
|
-
icon: /* @__PURE__ */ t(zo, {}),
|
|
1522
|
-
label: ["editor.image.alignRight", "Align right"]
|
|
1523
|
-
}
|
|
1524
|
-
], ia = [
|
|
1525
|
-
{
|
|
1526
|
-
id: "tl",
|
|
1527
|
-
pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
|
|
1528
|
-
cursor: "ds:cursor-nwse-resize",
|
|
1529
|
-
sign: -1,
|
|
1530
|
-
labelKey: "editor.image.resizeTopStart",
|
|
1531
|
-
labelFallback: "Resize image, top-start corner"
|
|
1532
|
-
},
|
|
1533
|
-
{
|
|
1534
|
-
id: "tr",
|
|
1535
|
-
pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
|
|
1536
|
-
cursor: "ds:cursor-nesw-resize",
|
|
1537
|
-
sign: 1,
|
|
1538
|
-
labelKey: "editor.image.resizeTopEnd",
|
|
1539
|
-
labelFallback: "Resize image, top-end corner"
|
|
1540
|
-
},
|
|
1541
|
-
{
|
|
1542
|
-
id: "bl",
|
|
1543
|
-
pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
|
|
1544
|
-
cursor: "ds:cursor-nesw-resize",
|
|
1545
|
-
sign: -1,
|
|
1546
|
-
labelKey: "editor.image.resizeBottomStart",
|
|
1547
|
-
labelFallback: "Resize image, bottom-start corner"
|
|
1548
|
-
},
|
|
1549
|
-
{
|
|
1550
|
-
id: "br",
|
|
1551
|
-
pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
|
|
1552
|
-
cursor: "ds:cursor-nwse-resize",
|
|
1553
|
-
sign: 1,
|
|
1554
|
-
labelKey: "editor.image.resizeBottomEnd",
|
|
1555
|
-
labelFallback: "Resize image, bottom-end corner"
|
|
1556
|
-
}
|
|
1557
|
-
], sa = [
|
|
1558
|
-
"ds:absolute ds:z-20 ds:pointer-events-none",
|
|
1559
|
-
"ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
|
|
1560
|
-
"ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
|
|
1561
|
-
"ds:rounded-[var(--radius-2xs)]",
|
|
1562
|
-
"ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
|
|
1563
|
-
"ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
|
|
1564
|
-
].join(" "), la = [
|
|
1565
|
-
"ds:absolute ds:pointer-events-auto ds:touch-none",
|
|
1566
|
-
"ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
|
|
1567
|
-
"ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
|
|
1568
|
-
"ds:bg-[var(--accent)] ds:border ds:border-[color:var(--background)]",
|
|
1569
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
1570
|
-
"ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
|
|
1571
|
-
"ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
|
|
1572
|
-
"ds:forced-colors:bg-[CanvasText]"
|
|
1573
|
-
].join(" "), ca = [
|
|
1574
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1575
|
-
"ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
|
|
1576
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1577
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1578
|
-
].join(" ");
|
|
1579
|
-
function da({
|
|
1580
|
-
areaRef: o,
|
|
1581
|
-
activeImageEl: i,
|
|
1582
|
-
applyImageClass: m,
|
|
1583
|
-
setImageWidth: c
|
|
1584
|
-
}) {
|
|
1585
|
-
const { t: g } = se(), [l, b] = z(null), d = T(null);
|
|
1586
|
-
I(() => {
|
|
1587
|
-
if (!i || typeof window > "u") {
|
|
1588
|
-
b(null);
|
|
1589
|
-
return;
|
|
1590
|
-
}
|
|
1591
|
-
const h = () => {
|
|
1592
|
-
const H = o.current;
|
|
1593
|
-
if (!H) {
|
|
1594
|
-
b(null);
|
|
1595
|
-
return;
|
|
1596
|
-
}
|
|
1597
|
-
const w = H.getBoundingClientRect(), O = i.getBoundingClientRect(), q = getComputedStyle(H).direction === "rtl", U = O.top - w.top, X = q ? w.right - O.right : O.left - w.left, P = X + O.width / 2, ne = Math.max(0, U - 44);
|
|
1598
|
-
b({
|
|
1599
|
-
top: U,
|
|
1600
|
-
start: Math.max(0, X),
|
|
1601
|
-
width: O.width,
|
|
1602
|
-
height: O.height,
|
|
1603
|
-
center: Math.max(0, P),
|
|
1604
|
-
barTop: ne,
|
|
1605
|
-
pct: ta(i),
|
|
1606
|
-
rtl: q
|
|
1607
|
-
});
|
|
1608
|
-
};
|
|
1609
|
-
h();
|
|
1610
|
-
const u = new ResizeObserver(h);
|
|
1611
|
-
u.observe(i);
|
|
1612
|
-
const y = o.current;
|
|
1613
|
-
y && u.observe(y);
|
|
1614
|
-
const E = i.closest(".redactor-in");
|
|
1615
|
-
let A = null;
|
|
1616
|
-
return E && (A = new MutationObserver(h), A.observe(E, {
|
|
1617
|
-
subtree: !0,
|
|
1618
|
-
childList: !0,
|
|
1619
|
-
characterData: !0,
|
|
1620
|
-
attributes: !0,
|
|
1621
|
-
attributeFilter: ["class", "style", "width", "height", "src"]
|
|
1622
|
-
})), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
|
|
1623
|
-
u.disconnect(), A == null || A.disconnect(), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
1624
|
-
};
|
|
1625
|
-
}, [i, o]);
|
|
1626
|
-
const p = x(
|
|
1627
|
-
(h) => (u) => {
|
|
1628
|
-
!u.isPrimary || !l || (u.preventDefault(), u.currentTarget.setPointerCapture(u.pointerId), d.current = {
|
|
1629
|
-
pointerId: u.pointerId,
|
|
1630
|
-
startX: u.clientX,
|
|
1631
|
-
startPct: l.pct,
|
|
1632
|
-
sign: h.sign * (l.rtl ? -1 : 1)
|
|
1633
|
-
});
|
|
1634
|
-
},
|
|
1635
|
-
[l]
|
|
1636
|
-
), C = x(
|
|
1637
|
-
(h) => {
|
|
1638
|
-
const u = d.current;
|
|
1639
|
-
if (!u || h.pointerId !== u.pointerId || !i) return;
|
|
1640
|
-
const y = i.closest(".redactor-in"), E = y instanceof HTMLElement ? y.clientWidth : 0;
|
|
1641
|
-
if (E <= 0) return;
|
|
1642
|
-
const A = u.sign * (h.clientX - u.startX) / E * 100;
|
|
1643
|
-
c(br(u.startPct + A));
|
|
1644
|
-
},
|
|
1645
|
-
[i, c]
|
|
1646
|
-
), R = x(
|
|
1647
|
-
(h) => {
|
|
1648
|
-
const u = d.current;
|
|
1649
|
-
!u || h.pointerId !== u.pointerId || (h.currentTarget.releasePointerCapture(h.pointerId), d.current = null);
|
|
1650
|
-
},
|
|
1651
|
-
[]
|
|
1652
|
-
), $ = x(
|
|
1653
|
-
(h) => {
|
|
1654
|
-
if (!l) return;
|
|
1655
|
-
let u = null;
|
|
1656
|
-
const y = h.shiftKey ? na : ra;
|
|
1657
|
-
switch (h.key) {
|
|
1658
|
-
// Up / right always grow; down / left always shrink — independent of
|
|
1659
|
-
// which corner has focus, so the gesture reads the same everywhere.
|
|
1660
|
-
case "ArrowRight":
|
|
1661
|
-
case "ArrowUp":
|
|
1662
|
-
u = l.pct + y;
|
|
1663
|
-
break;
|
|
1664
|
-
case "ArrowLeft":
|
|
1665
|
-
case "ArrowDown":
|
|
1666
|
-
u = l.pct - y;
|
|
1667
|
-
break;
|
|
1668
|
-
case "Home":
|
|
1669
|
-
u = qt;
|
|
1670
|
-
break;
|
|
1671
|
-
case "End":
|
|
1672
|
-
u = We;
|
|
1673
|
-
break;
|
|
1674
|
-
default:
|
|
1675
|
-
return;
|
|
1676
|
-
}
|
|
1677
|
-
h.preventDefault(), c(br(u));
|
|
1678
|
-
},
|
|
1679
|
-
[l, c]
|
|
1680
|
-
);
|
|
1681
|
-
if (!i || !l) return null;
|
|
1682
|
-
const L = pr(i, Ot), M = pr(i, zr), G = g("editor.image.widthAnnounce", {
|
|
1683
|
-
width: l.pct,
|
|
1684
|
-
defaultValue: "{{width}} percent"
|
|
1685
|
-
});
|
|
1686
|
-
return /* @__PURE__ */ k(Me, { children: [
|
|
1687
|
-
/* @__PURE__ */ t(
|
|
1688
|
-
"div",
|
|
1689
|
-
{
|
|
1690
|
-
className: sa,
|
|
1691
|
-
style: {
|
|
1692
|
-
"--rte-img-top": `${l.top}px`,
|
|
1693
|
-
"--rte-img-start": `${l.start}px`,
|
|
1694
|
-
"--rte-img-width": `${l.width}px`,
|
|
1695
|
-
"--rte-img-height": `${l.height}px`
|
|
1696
|
-
},
|
|
1697
|
-
children: ia.map((h) => /* @__PURE__ */ t(
|
|
1698
|
-
"div",
|
|
1699
|
-
{
|
|
1700
|
-
role: "slider",
|
|
1701
|
-
tabIndex: 0,
|
|
1702
|
-
"aria-label": g(h.labelKey, h.labelFallback),
|
|
1703
|
-
"aria-orientation": "horizontal",
|
|
1704
|
-
"aria-valuemin": qt,
|
|
1705
|
-
"aria-valuemax": We,
|
|
1706
|
-
"aria-valuenow": l.pct,
|
|
1707
|
-
"aria-valuetext": G,
|
|
1708
|
-
className: `${la} ${h.pos} ${h.cursor}`,
|
|
1709
|
-
onPointerDown: p(h),
|
|
1710
|
-
onPointerMove: C,
|
|
1711
|
-
onPointerUp: R,
|
|
1712
|
-
onPointerCancel: R,
|
|
1713
|
-
onKeyDown: $
|
|
1714
|
-
},
|
|
1715
|
-
h.id
|
|
1716
|
-
))
|
|
1717
|
-
}
|
|
1718
|
-
),
|
|
1719
|
-
/* @__PURE__ */ t(Tr, { children: /* @__PURE__ */ t(
|
|
1720
|
-
"div",
|
|
1721
|
-
{
|
|
1722
|
-
role: "group",
|
|
1723
|
-
"aria-label": g("editor.image.toolbar", "Image tools"),
|
|
1724
|
-
className: `${ca} ${l.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1725
|
-
style: {
|
|
1726
|
-
"--rte-img-bar-top": `${l.barTop}px`,
|
|
1727
|
-
"--rte-img-center": `${l.center}px`
|
|
1728
|
-
},
|
|
1729
|
-
children: [oa, aa].map((h, u) => /* @__PURE__ */ k(vt, { children: [
|
|
1730
|
-
u > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }) : null,
|
|
1731
|
-
h.map((y) => {
|
|
1732
|
-
const E = u === 0 ? L === y.id : M === y.id;
|
|
1733
|
-
return /* @__PURE__ */ t(
|
|
1734
|
-
V,
|
|
1735
|
-
{
|
|
1736
|
-
size: "sm",
|
|
1737
|
-
intent: "ghost",
|
|
1738
|
-
icon: y.icon,
|
|
1739
|
-
"aria-pressed": E,
|
|
1740
|
-
tooltip: g(y.label[0], y.label[1]),
|
|
1741
|
-
onMouseDown: (A) => A.preventDefault(),
|
|
1742
|
-
onClick: () => m(y.id)
|
|
1743
|
-
},
|
|
1744
|
-
y.id
|
|
1745
|
-
);
|
|
1746
|
-
})
|
|
1747
|
-
] }, u === 0 ? "flow" : "align"))
|
|
1748
|
-
}
|
|
1749
|
-
) })
|
|
1750
|
-
] });
|
|
1751
|
-
}
|
|
1752
|
-
function ua({
|
|
1753
|
-
run: o,
|
|
1754
|
-
active: i,
|
|
1755
|
-
preset: m,
|
|
1756
|
-
insertHtml: c,
|
|
1757
|
-
insertTable: g,
|
|
1758
|
-
saveSelection: l,
|
|
1759
|
-
restoreSelection: b,
|
|
1760
|
-
getSelectedText: d,
|
|
1761
|
-
uploadImage: p,
|
|
1762
|
-
enableColor: C = !1,
|
|
1763
|
-
enableImage: R = !1,
|
|
1764
|
-
enableTable: $ = !1,
|
|
1765
|
-
showExtensions: L = !1,
|
|
1766
|
-
variables: M,
|
|
1767
|
-
insertVariable: G
|
|
1768
|
-
}) {
|
|
1769
|
-
const { t: h } = se(), u = (j) => j.preventDefault(), y = (j) => Po[m].includes(j), E = (j) => {
|
|
1770
|
-
if (!y(j)) return null;
|
|
1771
|
-
const Q = qo[j];
|
|
1772
|
-
return /* @__PURE__ */ t(
|
|
1773
|
-
V,
|
|
1774
|
-
{
|
|
1775
|
-
size: "sm",
|
|
1776
|
-
intent: "ghost",
|
|
1777
|
-
icon: Q.icon,
|
|
1778
|
-
"aria-label": h(Q.label[0], Q.label[1]),
|
|
1779
|
-
"aria-pressed": Q.toggle ? i.has(Q.toggle) : void 0,
|
|
1780
|
-
onMouseDown: u,
|
|
1781
|
-
onClick: () => o(...Q.command)
|
|
1782
|
-
},
|
|
1783
|
-
Q.id
|
|
1784
|
-
);
|
|
1785
|
-
}, A = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: Bt }), H = y("format"), w = [
|
|
1786
|
-
E("bold"),
|
|
1787
|
-
E("italic"),
|
|
1788
|
-
E("underline"),
|
|
1789
|
-
E("strike"),
|
|
1790
|
-
C ? /* @__PURE__ */ t(
|
|
1791
|
-
Wo,
|
|
1792
|
-
{
|
|
1793
|
-
run: o,
|
|
1794
|
-
saveSelection: l,
|
|
1795
|
-
restoreSelection: b
|
|
1796
|
-
},
|
|
1797
|
-
"colour"
|
|
1798
|
-
) : null,
|
|
1799
|
-
C ? /* @__PURE__ */ t(
|
|
1800
|
-
Xo,
|
|
1801
|
-
{
|
|
1802
|
-
run: o,
|
|
1803
|
-
saveSelection: l,
|
|
1804
|
-
restoreSelection: b
|
|
1805
|
-
},
|
|
1806
|
-
"highlight"
|
|
1807
|
-
) : null
|
|
1808
|
-
].filter(Boolean), O = H || w.length > 0, q = [E("ul"), E("ol")].filter(Boolean), U = [
|
|
1809
|
-
y("link") ? /* @__PURE__ */ t(
|
|
1810
|
-
Vo,
|
|
1811
|
-
{
|
|
1812
|
-
insertHtml: c,
|
|
1813
|
-
saveSelection: l,
|
|
1814
|
-
restoreSelection: b,
|
|
1815
|
-
getSelectedText: d
|
|
1816
|
-
},
|
|
1817
|
-
"link"
|
|
1818
|
-
) : null,
|
|
1819
|
-
R ? /* @__PURE__ */ t(
|
|
1820
|
-
Ko,
|
|
1821
|
-
{
|
|
1822
|
-
insertHtml: c,
|
|
1823
|
-
saveSelection: l,
|
|
1824
|
-
restoreSelection: b,
|
|
1825
|
-
uploadImage: p
|
|
1826
|
-
},
|
|
1827
|
-
"image"
|
|
1828
|
-
) : null,
|
|
1829
|
-
$ ? /* @__PURE__ */ t(
|
|
1830
|
-
Uo,
|
|
1831
|
-
{
|
|
1832
|
-
run: o,
|
|
1833
|
-
insertTable: g,
|
|
1834
|
-
active: i
|
|
1835
|
-
},
|
|
1836
|
-
"table"
|
|
1837
|
-
) : null,
|
|
1838
|
-
M && M.length > 0 && G ? /* @__PURE__ */ t(
|
|
1839
|
-
Bo,
|
|
1840
|
-
{
|
|
1841
|
-
variables: M,
|
|
1842
|
-
insertVariable: G,
|
|
1843
|
-
saveSelection: l
|
|
1844
|
-
},
|
|
1845
|
-
"variables"
|
|
1846
|
-
) : null
|
|
1847
|
-
].filter(Boolean), X = L ? [
|
|
1848
|
-
/* @__PURE__ */ t(
|
|
1849
|
-
V,
|
|
1850
|
-
{
|
|
1851
|
-
size: "sm",
|
|
1852
|
-
intent: "ghost",
|
|
1853
|
-
icon: /* @__PURE__ */ t(Lo, {}),
|
|
1854
|
-
"aria-label": h("editor.extensions", "Editor extensions"),
|
|
1855
|
-
disabled: !0,
|
|
1856
|
-
onMouseDown: u
|
|
1857
|
-
},
|
|
1858
|
-
"extensions"
|
|
1859
|
-
)
|
|
1860
|
-
] : [], P = [q, U, X].filter(
|
|
1861
|
-
(j) => j.length > 0
|
|
1862
|
-
), ne = P.length > 0, we = (j) => P.map((Q, Se) => /* @__PURE__ */ k(vt, { children: [
|
|
1863
|
-
Se > 0 || j ? /* @__PURE__ */ t(A, {}) : null,
|
|
1864
|
-
Q
|
|
1865
|
-
] }, Se));
|
|
1866
|
-
return (
|
|
1867
|
-
// Outer element is the query container + visual chrome; the flex row is an
|
|
1868
|
-
// inner child so `container-type` never lands on the flex parent (which
|
|
1869
|
-
// would blockify the inline controls).
|
|
1870
|
-
/* @__PURE__ */ t("div", { className: Fo(), "data-component": "editor-toolbar", children: /* @__PURE__ */ k(
|
|
1871
|
-
"div",
|
|
1872
|
-
{
|
|
1873
|
-
role: "group",
|
|
1874
|
-
"aria-label": h("editor.toolbarLabel"),
|
|
1875
|
-
className: jo,
|
|
1876
|
-
children: [
|
|
1877
|
-
H ? /* @__PURE__ */ t(Go, { run: o, active: i, onTriggerDown: u }) : null,
|
|
1878
|
-
H && w.length > 0 ? /* @__PURE__ */ t(A, {}) : null,
|
|
1879
|
-
w,
|
|
1880
|
-
ne ? /* @__PURE__ */ k(Me, { children: [
|
|
1881
|
-
/* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: we(O) }),
|
|
1882
|
-
/* @__PURE__ */ k("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
|
|
1883
|
-
O ? /* @__PURE__ */ t(A, {}) : null,
|
|
1884
|
-
/* @__PURE__ */ k(K, { children: [
|
|
1885
|
-
/* @__PURE__ */ t(K.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1886
|
-
V,
|
|
1887
|
-
{
|
|
1888
|
-
size: "sm",
|
|
1889
|
-
intent: "ghost",
|
|
1890
|
-
icon: /* @__PURE__ */ t(pn, {}),
|
|
1891
|
-
"aria-label": h("editor.more", "More options"),
|
|
1892
|
-
onMouseDown: u
|
|
1893
|
-
}
|
|
1894
|
-
) }),
|
|
1895
|
-
/* @__PURE__ */ t(K.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: we(!1) }) })
|
|
1896
|
-
] })
|
|
1897
|
-
] })
|
|
1898
|
-
] }) : null
|
|
1899
|
-
]
|
|
1900
|
-
}
|
|
1901
|
-
) })
|
|
1902
|
-
);
|
|
1903
|
-
}
|
|
1904
|
-
function fe(o) {
|
|
1905
|
-
return sn(o, "rich-text");
|
|
1906
|
-
}
|
|
1907
|
-
function gt(o = "") {
|
|
1908
|
-
const i = String(o).trim();
|
|
1909
|
-
if (i === "" || i === "<p><br></p>" || i === "<p> </p>")
|
|
1910
|
-
return "";
|
|
1911
|
-
const m = i.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
1912
|
-
return m === "" && /<img\b[^>]*>/i.test(i) ? i : m === "" ? "" : i;
|
|
1913
|
-
}
|
|
1914
|
-
function yr(o) {
|
|
1915
|
-
return o.replace(
|
|
1916
|
-
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
1917
|
-
'<img loading="lazy"$1>'
|
|
1918
|
-
);
|
|
1919
|
-
}
|
|
1920
|
-
const Dt = /^[A-Za-z0-9_]+$/, Rr = /\[\[([A-Za-z0-9_]+)\]\]/g, Pt = "rte-variable-invalid", ma = new RegExp(
|
|
1921
|
-
`\\s*\\b${Pt}\\b`,
|
|
1922
|
-
"g"
|
|
1923
|
-
);
|
|
1924
|
-
function vr(o) {
|
|
1925
|
-
return o.includes('data-redactor-type="variable"') ? o.replace(
|
|
1926
|
-
/<span\b[^>]*data-redactor-type="variable"[^>]*>/g,
|
|
1927
|
-
(i) => i.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(ma, "").replace(/\sclass=""/g, "")
|
|
1928
|
-
) : o;
|
|
1929
|
-
}
|
|
1930
|
-
function fa(o) {
|
|
1931
|
-
const i = o.replace(/<[^>]*>/g, " ");
|
|
1932
|
-
return Array.from(i.matchAll(Rr), (m) => m[1]);
|
|
1933
|
-
}
|
|
1934
|
-
function ga(o) {
|
|
1935
|
-
return typeof o == "object" && o !== null && "name" in o && o.name === "AiCreditsExhaustedError";
|
|
1936
|
-
}
|
|
1937
|
-
function wr(o) {
|
|
1938
|
-
return o.replace(/<[^>]*>/g, "").replace(/ /gi, "").replace(/[\s\u200B\uFEFF]+/g, "");
|
|
1939
|
-
}
|
|
1940
|
-
function ha(o) {
|
|
1941
|
-
const i = window.getSelection();
|
|
1942
|
-
if (!i || i.rangeCount === 0) return null;
|
|
1943
|
-
const m = i.getRangeAt(0);
|
|
1944
|
-
if (!o.contains(m.startContainer)) return null;
|
|
1945
|
-
const c = document.createRange();
|
|
1946
|
-
return c.selectNodeContents(o), c.setEnd(m.startContainer, m.startOffset), c.toString().length;
|
|
1947
|
-
}
|
|
1948
|
-
function pa(o, i) {
|
|
1949
|
-
var l;
|
|
1950
|
-
const m = window.getSelection();
|
|
1951
|
-
if (!m) return;
|
|
1952
|
-
const c = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
|
|
1953
|
-
let g = 0;
|
|
1954
|
-
for (let b = c.nextNode(); b; b = c.nextNode()) {
|
|
1955
|
-
const d = b;
|
|
1956
|
-
if (g + d.data.length >= i) {
|
|
1957
|
-
const p = document.createRange(), C = (l = d.parentElement) == null ? void 0 : l.closest(
|
|
1958
|
-
'[data-redactor-type="variable"]'
|
|
1959
|
-
);
|
|
1960
|
-
C ? p.setStartAfter(C) : p.setStart(d, i - g), p.collapse(!0), m.removeAllRanges(), m.addRange(p);
|
|
1961
|
-
return;
|
|
1962
|
-
}
|
|
1963
|
-
g += d.data.length;
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
function xr(o) {
|
|
1967
|
-
return `<span data-redactor-type="variable">[[${o}]]</span>`;
|
|
1968
|
-
}
|
|
1969
|
-
function ht(o, i) {
|
|
1970
|
-
var b;
|
|
1971
|
-
if (i.size === 0 || !o.includes("[[") || typeof DOMParser > "u")
|
|
1972
|
-
return o;
|
|
1973
|
-
const m = new DOMParser().parseFromString(
|
|
1974
|
-
`<body>${o}</body>`,
|
|
1975
|
-
"text/html"
|
|
1976
|
-
), c = m.createTreeWalker(m.body, NodeFilter.SHOW_TEXT), g = [];
|
|
1977
|
-
for (let d = c.nextNode(); d; d = c.nextNode()) {
|
|
1978
|
-
const p = d;
|
|
1979
|
-
(b = p.parentElement) != null && b.closest('[data-redactor-type="variable"]') || p.data.includes("[[") && g.push(p);
|
|
1980
|
-
}
|
|
1981
|
-
let l = !1;
|
|
1982
|
-
for (const d of g) {
|
|
1983
|
-
const p = m.createDocumentFragment();
|
|
1984
|
-
let C = 0;
|
|
1985
|
-
for (const R of d.data.matchAll(Rr)) {
|
|
1986
|
-
const $ = i.get(R[1].toLowerCase());
|
|
1987
|
-
if (!$ || R.index === void 0) continue;
|
|
1988
|
-
p.append(d.data.slice(C, R.index));
|
|
1989
|
-
const L = m.createElement("span");
|
|
1990
|
-
L.setAttribute("data-redactor-type", "variable"), L.textContent = `[[${$}]]`, p.append(L), C = R.index + R[0].length;
|
|
1991
|
-
}
|
|
1992
|
-
C !== 0 && (p.append(d.data.slice(C)), d.replaceWith(p), l = !0);
|
|
1993
|
-
}
|
|
1994
|
-
return l ? m.body.innerHTML : o;
|
|
1995
|
-
}
|
|
1996
|
-
function ba(o) {
|
|
1997
|
-
if (!o || typeof o != "object") return;
|
|
1998
|
-
const i = o, m = (c) => {
|
|
1999
|
-
if (c && typeof c == "object" && "url" in c) {
|
|
2000
|
-
const g = c.url;
|
|
2001
|
-
return typeof g == "string" ? g : void 0;
|
|
2002
|
-
}
|
|
2003
|
-
};
|
|
2004
|
-
return typeof i.url == "string" ? i.url : m(i.file) ?? m(i.data) ?? Object.values(i).map(m).find(Boolean);
|
|
2005
|
-
}
|
|
2006
|
-
function ya(o) {
|
|
2007
|
-
if (o) return o;
|
|
2008
|
-
if (typeof window > "u") return null;
|
|
2009
|
-
const i = window;
|
|
2010
|
-
return i.$R ?? i.Redactor ?? null;
|
|
2011
|
-
}
|
|
2012
|
-
const va = {
|
|
2013
|
-
bold: ["module.inline.format", { tag: "b" }],
|
|
2014
|
-
italic: ["module.inline.format", { tag: "i" }],
|
|
2015
|
-
strikethrough: ["module.inline.format", { tag: "del" }],
|
|
2016
|
-
bulletedList: ["module.list.toggle", "ul"],
|
|
2017
|
-
numberedList: ["module.list.toggle", "ol"],
|
|
2018
|
-
heading: ["module.block.format", { tag: "h2" }],
|
|
2019
|
-
quote: ["module.block.format", { tag: "blockquote" }],
|
|
2020
|
-
paragraph: ["module.block.format", { tag: "p" }]
|
|
2021
|
-
}, wa = {
|
|
2022
|
-
zh: "zh_cn",
|
|
2023
|
-
pt: "pt_br"
|
|
2024
|
-
};
|
|
2025
|
-
function xa(o) {
|
|
2026
|
-
const i = o.split("-")[0];
|
|
2027
|
-
return wa[i] ?? i ?? "en";
|
|
2028
|
-
}
|
|
2029
|
-
const ka = Ft(
|
|
2030
|
-
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
2031
|
-
), Ca = [
|
|
2032
|
-
"ds:absolute ds:z-30 ds:flex ds:flex-col ds:p-[var(--spacing-2xs)]",
|
|
2033
|
-
"ds:[inset-inline-start:var(--rte-typeahead-x)] ds:[inset-block-start:var(--rte-typeahead-y)]",
|
|
2034
|
-
"ds:min-w-[16rem] ds:[max-block-size:16rem] ds:overflow-y-auto",
|
|
2035
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
2036
|
-
"ds:bg-[var(--popover)] ds:text-[color:var(--popover-foreground)] ds:shadow-[var(--shadow-lg)]"
|
|
2037
|
-
].join(" "), Na = [
|
|
2038
|
-
"ds:group ds:flex ds:items-baseline ds:gap-[var(--spacing-sm)] ds:cursor-pointer",
|
|
2039
|
-
"ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
2040
|
-
"ds:text-[length:var(--font-size-sm)]",
|
|
2041
|
-
"ds:aria-selected:bg-[var(--accent)] ds:aria-selected:text-[color:var(--accent-foreground)]"
|
|
2042
|
-
].join(" "), Ta = Ft(
|
|
2043
|
-
[
|
|
2044
|
-
"ds:block ds:[inline-size:100%]",
|
|
2045
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
2046
|
-
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
2047
|
-
"ds:shadow-[var(--shadow-md)]",
|
|
2048
|
-
"ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
|
|
2049
|
-
"ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
|
|
2050
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
2051
|
-
"ds:focus-visible:outline-solid",
|
|
2052
|
-
"ds:focus-visible:outline-[var(--ring)]",
|
|
2053
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
2054
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
2055
|
-
].join(" ")
|
|
2056
|
-
), _r = [
|
|
2057
|
-
"ds:inline-flex ds:items-center ds:justify-center",
|
|
2058
|
-
"ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
|
|
2059
|
-
"ds:text-[color:var(--primary-foreground)]",
|
|
2060
|
-
"ds:transition-colors",
|
|
2061
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
2062
|
-
"ds:focus-visible:outline-solid",
|
|
2063
|
-
"ds:focus-visible:outline-[var(--primary-foreground)]",
|
|
2064
|
-
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
|
|
2065
|
-
].join(" "), Aa = `${_r} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, za = `${_r} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, Ra = nn(
|
|
2066
|
-
({
|
|
2067
|
-
id: o,
|
|
2068
|
-
defaultValue: i,
|
|
2069
|
-
value: m,
|
|
2070
|
-
onChange: c,
|
|
2071
|
-
toolbar: g = "standard",
|
|
2072
|
-
placeholder: l,
|
|
2073
|
-
readOnly: b = !1,
|
|
2074
|
-
ariaLabel: d,
|
|
2075
|
-
minHeight: p,
|
|
2076
|
-
showExtensions: C,
|
|
2077
|
-
className: R,
|
|
2078
|
-
redactor: $,
|
|
2079
|
-
options: L,
|
|
2080
|
-
plugins: M,
|
|
2081
|
-
lang: G,
|
|
2082
|
-
imageUploadUrl: h,
|
|
2083
|
-
onUploadImage: u,
|
|
2084
|
-
onKeyDown: y,
|
|
2085
|
-
onRequestAiDraft: E,
|
|
2086
|
-
aiDraftFormat: A = "html",
|
|
2087
|
-
aiPrivacyNotice: H,
|
|
2088
|
-
aiConsent: w,
|
|
2089
|
-
aiConsentHeadingLevel: O,
|
|
2090
|
-
onDictate: q,
|
|
2091
|
-
onProofread: U,
|
|
2092
|
-
onAutoFormat: X,
|
|
2093
|
-
variables: P,
|
|
2094
|
-
validateVariable: ne,
|
|
2095
|
-
onVariableValidityChange: we,
|
|
2096
|
-
renderHelpMeWrite: j,
|
|
2097
|
-
onAiCreditsExhausted: Q
|
|
2098
|
-
}, Se) => {
|
|
2099
|
-
const { t: D, i18n: F } = se(), W = Ee(), oe = Pe(
|
|
2100
|
-
() => `rte-${W.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
2101
|
-
[W]
|
|
2102
|
-
), N = `#${oe}`, de = T(null), J = T(null), wt = T(!1), xt = T(b), B = T(null), Xe = T(null), [ae, Gt] = z(!1), [Vt, Le] = z(!1), [Mr, Er] = z(""), [Sr, Kt] = z(!1), Ze = T(Q), Wt = T(j);
|
|
2103
|
-
I(() => {
|
|
2104
|
-
Ze.current = Q, Wt.current = j;
|
|
2105
|
-
}, [Q, j]);
|
|
2106
|
-
const Ue = T(null), ee = Pe(
|
|
2107
|
-
() => new Map(
|
|
2108
|
-
(P ?? []).map((e) => e.token).filter((e) => Dt.test(e)).map((e) => [e.toLowerCase(), e])
|
|
2109
|
-
),
|
|
2110
|
-
[P]
|
|
2111
|
-
), Xt = Pe(
|
|
2112
|
-
() => new Map(
|
|
2113
|
-
(P ?? []).map(
|
|
2114
|
-
(e) => [e.token.toLowerCase(), e.label]
|
|
2115
|
-
)
|
|
2116
|
-
),
|
|
2117
|
-
[P]
|
|
2118
|
-
), Qe = T(ee);
|
|
2119
|
-
I(() => {
|
|
2120
|
-
Qe.current = ee;
|
|
2121
|
-
}, [ee]);
|
|
2122
|
-
const kt = T(ne);
|
|
2123
|
-
I(() => {
|
|
2124
|
-
kt.current = ne;
|
|
2125
|
-
}, [ne]);
|
|
2126
|
-
const Ct = ne !== void 0, Nt = x(
|
|
2127
|
-
(e) => Ct && kt.current ? kt.current(e) : ee.has(e.toLowerCase()),
|
|
2128
|
-
[Ct, ee]
|
|
2129
|
-
), Ie = ee.size > 0 || Ct, [$e, Zt] = z([]), ke = T(we);
|
|
2130
|
-
I(() => {
|
|
2131
|
-
ke.current = we;
|
|
2132
|
-
}, [we]);
|
|
2133
|
-
const ge = T(() => {
|
|
2134
|
-
}), [Ut, Lr] = z(
|
|
2135
|
-
() => /* @__PURE__ */ new Set()
|
|
2136
|
-
), Ye = T(null), [Ir, $r] = z(
|
|
2137
|
-
null
|
|
2138
|
-
), Je = x((e) => {
|
|
2139
|
-
Ye.current = e, $r(e);
|
|
2140
|
-
}, []), Fe = T(null), et = T(null), te = T(c), tt = T(y);
|
|
2141
|
-
I(() => {
|
|
2142
|
-
te.current = c, tt.current = y;
|
|
2143
|
-
}, [c, y]);
|
|
2144
|
-
const Hr = T(
|
|
2145
|
-
(() => {
|
|
2146
|
-
const e = m ?? i ?? "";
|
|
2147
|
-
return e ? fe(e) : "";
|
|
2148
|
-
})()
|
|
2149
|
-
), le = x(() => {
|
|
2150
|
-
var r;
|
|
2151
|
-
const e = J.current;
|
|
2152
|
-
if (e)
|
|
2153
|
-
try {
|
|
2154
|
-
const n = e(N, "source.getCode");
|
|
2155
|
-
if (typeof n == "string") return vr(n);
|
|
2156
|
-
} catch {
|
|
2157
|
-
}
|
|
2158
|
-
return ((r = de.current) == null ? void 0 : r.value) ?? "";
|
|
2159
|
-
}, [N]);
|
|
2160
|
-
I(() => {
|
|
2161
|
-
ge.current = () => {
|
|
2162
|
-
var n;
|
|
2163
|
-
if (!Ie) {
|
|
2164
|
-
Zt((a) => a.length ? [] : a);
|
|
2165
|
-
return;
|
|
2166
|
-
}
|
|
2167
|
-
const e = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in");
|
|
2168
|
-
e == null || e.querySelectorAll('[data-redactor-type="variable"]').forEach((a) => {
|
|
2169
|
-
const s = /^\[\[([A-Za-z0-9_]+)\]\]$/.exec(
|
|
2170
|
-
a.textContent ?? ""
|
|
2171
|
-
), f = !s || !Nt(s[1]);
|
|
2172
|
-
a.classList.contains(Pt) !== f && a.classList.toggle(Pt, f);
|
|
2173
|
-
const v = s ? Xt.get(s[1].toLowerCase()) ?? s[1] : a.textContent ?? "";
|
|
2174
|
-
a.getAttribute("data-label") !== v && a.setAttribute("data-label", v);
|
|
2175
|
-
const _ = a.textContent ?? "";
|
|
2176
|
-
a.getAttribute("title") !== _ && a.setAttribute("title", _);
|
|
2177
|
-
});
|
|
2178
|
-
const r = Array.from(
|
|
2179
|
-
new Set(
|
|
2180
|
-
fa(le()).filter(
|
|
2181
|
-
(a) => !Nt(a)
|
|
2182
|
-
)
|
|
2183
|
-
)
|
|
2184
|
-
);
|
|
2185
|
-
Zt(
|
|
2186
|
-
(a) => a.length === r.length && a.every((s, f) => s === r[f]) ? a : r
|
|
2187
|
-
);
|
|
2188
|
-
}, ge.current();
|
|
2189
|
-
}, [Ie, Nt, Xt, le]), I(() => {
|
|
2190
|
-
var n;
|
|
2191
|
-
const r = ((n = B.current) == null ? void 0 : n.querySelector(".redactor-in")) ?? de.current;
|
|
2192
|
-
r && ($e.length > 0 ? (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", `${oe}-variables-error`)) : (r.removeAttribute("aria-invalid"), r.removeAttribute("aria-describedby")));
|
|
2193
|
-
}, [$e, oe, ae]);
|
|
2194
|
-
const Tt = T(!1);
|
|
2195
|
-
I(() => {
|
|
2196
|
-
var e, r;
|
|
2197
|
-
Ie ? (Tt.current = !0, (e = ke.current) == null || e.call(ke, $e)) : Tt.current && (Tt.current = !1, (r = ke.current) == null || r.call(ke, []));
|
|
2198
|
-
}, [$e, Ie]), I(() => {
|
|
2199
|
-
ne && ge.current();
|
|
2200
|
-
}, [ne]);
|
|
2201
|
-
const ie = x(
|
|
2202
|
-
(e, ...r) => {
|
|
2203
|
-
const n = J.current;
|
|
2204
|
-
if (!n) return !1;
|
|
2205
|
-
const a = xt.current;
|
|
2206
|
-
if (a)
|
|
2207
|
-
try {
|
|
2208
|
-
n(N, "disableReadOnly");
|
|
2209
|
-
} catch {
|
|
2210
|
-
}
|
|
2211
|
-
try {
|
|
2212
|
-
return n(N, e, ...r), !0;
|
|
2213
|
-
} catch {
|
|
2214
|
-
return !1;
|
|
2215
|
-
} finally {
|
|
2216
|
-
if (a)
|
|
2217
|
-
try {
|
|
2218
|
-
n(N, "enableReadOnly");
|
|
2219
|
-
} catch {
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
},
|
|
2223
|
-
[N]
|
|
2224
|
-
), ue = x(
|
|
2225
|
-
(e, r) => {
|
|
2226
|
-
var be;
|
|
2227
|
-
const n = (r == null ? void 0 : r.asHtml) ?? !0, a = n ? fe(e) : e;
|
|
2228
|
-
if (ie(n ? "insertion.insertHtml" : "insertion.insertText", a)) return;
|
|
2229
|
-
const f = de.current;
|
|
2230
|
-
if (!f) return;
|
|
2231
|
-
const v = f.selectionStart ?? f.value.length, _ = f.selectionEnd ?? f.value.length;
|
|
2232
|
-
f.value = f.value.slice(0, v) + a + f.value.slice(_);
|
|
2233
|
-
const re = v + a.length;
|
|
2234
|
-
try {
|
|
2235
|
-
f.setSelectionRange(re, re);
|
|
2236
|
-
} catch {
|
|
2237
|
-
}
|
|
2238
|
-
(be = te.current) == null || be.call(te, { html: fe(f.value), markdown: "" });
|
|
2239
|
-
},
|
|
2240
|
-
[ie]
|
|
2241
|
-
), Ce = T(null), ce = x(() => {
|
|
2242
|
-
var a;
|
|
2243
|
-
const e = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
|
|
2244
|
-
if (e && r && r.anchorNode && e.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
|
|
2245
|
-
r.rangeCount > 0 && (Ce.current = r.getRangeAt(0).cloneRange());
|
|
2246
|
-
try {
|
|
2247
|
-
document.queryCommandState("bold") && n.add("bold"), document.queryCommandState("italic") && n.add("italic"), document.queryCommandState("underline") && n.add("underline"), document.queryCommandState("strikeThrough") && n.add("strike"), document.queryCommandState("insertUnorderedList") && n.add("ul"), document.queryCommandState("insertOrderedList") && n.add("ol");
|
|
2248
|
-
const s = String(
|
|
2249
|
-
document.queryCommandValue("formatBlock") || ""
|
|
2250
|
-
).toLowerCase();
|
|
2251
|
-
/^h[1-6]$/.test(s) ? (n.add("heading"), n.add(s)) : s === "blockquote" ? n.add("quote") : n.add("paragraph");
|
|
2252
|
-
const f = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
|
|
2253
|
-
f && e.contains(f) && f.closest("table") && n.add("table");
|
|
2254
|
-
} catch {
|
|
2255
|
-
}
|
|
2256
|
-
}
|
|
2257
|
-
Lr(
|
|
2258
|
-
(s) => s.size === n.size && [...n].every((f) => s.has(f)) ? s : n
|
|
2259
|
-
);
|
|
2260
|
-
}, []), He = x(
|
|
2261
|
-
(e, ...r) => {
|
|
2262
|
-
ie(e, ...r), typeof window < "u" ? window.requestAnimationFrame(() => ce()) : ce();
|
|
2263
|
-
},
|
|
2264
|
-
[ie, ce]
|
|
2265
|
-
);
|
|
2266
|
-
I(() => {
|
|
2267
|
-
const e = B.current;
|
|
2268
|
-
if (!e) return;
|
|
2269
|
-
const r = {
|
|
2270
|
-
b: ["module.inline.format", { tag: "b" }],
|
|
2271
|
-
i: ["module.inline.format", { tag: "i" }],
|
|
2272
|
-
u: ["module.inline.format", { tag: "u" }]
|
|
2273
|
-
}, n = (a) => {
|
|
2274
|
-
if (!(a.metaKey || a.ctrlKey) || a.altKey || a.shiftKey || a.isComposing) return;
|
|
2275
|
-
const s = r[a.key.toLowerCase()];
|
|
2276
|
-
if (!s) return;
|
|
2277
|
-
const f = e.querySelector(".redactor-in");
|
|
2278
|
-
!f || !(a.target instanceof Node) || !f.contains(a.target) || xt.current || (a.preventDefault(), a.stopImmediatePropagation(), He(...s));
|
|
2279
|
-
};
|
|
2280
|
-
return e.addEventListener("keydown", n, !0), () => e.removeEventListener("keydown", n, !0);
|
|
2281
|
-
}, [He]);
|
|
2282
|
-
const Ne = x(
|
|
2283
|
-
(e) => {
|
|
2284
|
-
ue(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ce());
|
|
2285
|
-
},
|
|
2286
|
-
[ue, ce]
|
|
2287
|
-
), [Y, At] = z(null), je = T(null), Be = `${oe}-variables`, Te = Pe(() => {
|
|
2288
|
-
if (!Y) return [];
|
|
2289
|
-
const e = Y.query.trim().toLowerCase(), r = e.replace(/\s+/g, "_");
|
|
2290
|
-
return (P ?? []).filter(
|
|
2291
|
-
(n) => Dt.test(n.token) && (!e || n.token.toLowerCase().includes(r) || n.label.toLowerCase().includes(e))
|
|
2292
|
-
);
|
|
2293
|
-
}, [Y, P]), he = x(() => {
|
|
2294
|
-
je.current = null, At(null);
|
|
2295
|
-
}, []), rt = x(
|
|
2296
|
-
(e, r) => {
|
|
2297
|
-
const n = window.getSelection();
|
|
2298
|
-
if (!n) return;
|
|
2299
|
-
const a = document.createRange();
|
|
2300
|
-
a.setStart(r.node, r.start), a.setEnd(r.node, r.end), n.removeAllRanges(), n.addRange(a), Ne(xr(e)), window.requestAnimationFrame(() => ge.current());
|
|
2301
|
-
},
|
|
2302
|
-
[Ne]
|
|
2303
|
-
);
|
|
2304
|
-
I(() => {
|
|
2305
|
-
const e = B.current;
|
|
2306
|
-
if (!e || !Ie) return;
|
|
2307
|
-
const r = () => {
|
|
2308
|
-
var ur;
|
|
2309
|
-
const s = e.querySelector(".redactor-in"), f = window.getSelection();
|
|
2310
|
-
if (!s || !f || f.rangeCount === 0 || !f.isCollapsed) {
|
|
2311
|
-
he();
|
|
2312
|
-
return;
|
|
2313
|
-
}
|
|
2314
|
-
const { startContainer: v, startOffset: _ } = f.getRangeAt(0);
|
|
2315
|
-
if (v.nodeType !== Node.TEXT_NODE || !s.contains(v) || (((ur = v.parentElement) == null ? void 0 : ur.closest(
|
|
2316
|
-
'[data-redactor-type="variable"]'
|
|
2317
|
-
)) ?? null) !== null) {
|
|
2318
|
-
he();
|
|
2319
|
-
return;
|
|
2320
|
-
}
|
|
2321
|
-
const re = v, be = re.data.slice(0, _), Re = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(be);
|
|
2322
|
-
if (Re) {
|
|
2323
|
-
he(), rt(
|
|
2324
|
-
ee.get(Re[1].toLowerCase()) ?? Re[1],
|
|
2325
|
-
{ node: re, start: _ - Re[0].length, end: _ }
|
|
2326
|
-
);
|
|
2327
|
-
return;
|
|
2328
|
-
}
|
|
2329
|
-
const mt = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(be), Mt = Xe.current;
|
|
2330
|
-
if (!mt || !Mt || (P ?? []).length === 0) {
|
|
2331
|
-
he();
|
|
2332
|
-
return;
|
|
2333
|
-
}
|
|
2334
|
-
const Et = {
|
|
2335
|
-
node: re,
|
|
2336
|
-
start: _ - mt[0].length,
|
|
2337
|
-
end: _
|
|
2338
|
-
};
|
|
2339
|
-
je.current = Et;
|
|
2340
|
-
const St = document.createRange();
|
|
2341
|
-
St.setStart(re, Et.start), St.setEnd(re, Et.end);
|
|
2342
|
-
const Lt = St.getBoundingClientRect(), It = Mt.getBoundingClientRect(), rn = getComputedStyle(Mt).direction === "rtl";
|
|
2343
|
-
At(($t) => ({
|
|
2344
|
-
query: mt[1],
|
|
2345
|
-
index: $t && $t.query === mt[1] ? $t.index : 0,
|
|
2346
|
-
left: rn ? It.right - Lt.right : Lt.left - It.left,
|
|
2347
|
-
top: Lt.bottom - It.top + 4
|
|
2348
|
-
}));
|
|
2349
|
-
}, n = (s) => {
|
|
2350
|
-
if (!je.current) return;
|
|
2351
|
-
const f = nt.current.length;
|
|
2352
|
-
if (s.key === "ArrowDown" || s.key === "ArrowUp") {
|
|
2353
|
-
if (!f) return;
|
|
2354
|
-
s.preventDefault(), s.stopImmediatePropagation();
|
|
2355
|
-
const v = s.key === "ArrowDown" ? 1 : f - 1;
|
|
2356
|
-
At(
|
|
2357
|
-
(_) => _ && { ..._, index: (_.index + v) % f }
|
|
2358
|
-
);
|
|
2359
|
-
} else if ((s.key === "Enter" || s.key === "Tab") && f) {
|
|
2360
|
-
s.preventDefault(), s.stopImmediatePropagation();
|
|
2361
|
-
const v = nt.current[Qt.current] ?? nt.current[0], _ = je.current;
|
|
2362
|
-
he(), rt(v.token, _);
|
|
2363
|
-
} else s.key === "Escape" && (s.preventDefault(), s.stopImmediatePropagation(), he());
|
|
2364
|
-
}, a = () => he();
|
|
2365
|
-
return e.addEventListener("input", r), e.addEventListener("keydown", n, !0), e.addEventListener("focusout", a), () => {
|
|
2366
|
-
e.removeEventListener("input", r), e.removeEventListener("keydown", n, !0), e.removeEventListener("focusout", a);
|
|
2367
|
-
};
|
|
2368
|
-
}, [
|
|
2369
|
-
Ie,
|
|
2370
|
-
ee,
|
|
2371
|
-
P,
|
|
2372
|
-
rt,
|
|
2373
|
-
he
|
|
2374
|
-
]);
|
|
2375
|
-
const nt = T(Te), Qt = T(0);
|
|
2376
|
-
I(() => {
|
|
2377
|
-
nt.current = Te, Qt.current = (Y == null ? void 0 : Y.index) ?? 0;
|
|
2378
|
-
}, [Te, Y]), I(() => {
|
|
2379
|
-
var r;
|
|
2380
|
-
const e = (r = B.current) == null ? void 0 : r.querySelector(".redactor-in");
|
|
2381
|
-
if (e)
|
|
2382
|
-
if (Y) {
|
|
2383
|
-
e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", Be);
|
|
2384
|
-
const n = Te[Y.index];
|
|
2385
|
-
n ? e.setAttribute(
|
|
2386
|
-
"aria-activedescendant",
|
|
2387
|
-
`${Be}-${n.token}`
|
|
2388
|
-
) : e.removeAttribute("aria-activedescendant");
|
|
2389
|
-
} else
|
|
2390
|
-
e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-activedescendant");
|
|
2391
|
-
}, [Y, Te, Be]);
|
|
2392
|
-
const Ge = x(() => {
|
|
2393
|
-
var r;
|
|
2394
|
-
if (typeof window < "u") {
|
|
2395
|
-
const n = (r = B.current) == null ? void 0 : r.querySelector(".redactor-in"), a = window.getSelection();
|
|
2396
|
-
n && a && a.rangeCount > 0 && a.anchorNode && n.contains(a.anchorNode) && (Ce.current = a.getRangeAt(0).cloneRange());
|
|
2397
|
-
}
|
|
2398
|
-
const e = J.current;
|
|
2399
|
-
if (e)
|
|
2400
|
-
try {
|
|
2401
|
-
e(N, "selection.save");
|
|
2402
|
-
} catch {
|
|
2403
|
-
}
|
|
2404
|
-
}, [N]), xe = x(() => {
|
|
2405
|
-
const e = J.current;
|
|
2406
|
-
if (!e) return;
|
|
2407
|
-
const r = Ce.current;
|
|
2408
|
-
try {
|
|
2409
|
-
e(N, "editor.focus");
|
|
2410
|
-
} catch {
|
|
2411
|
-
}
|
|
2412
|
-
if (r && typeof window < "u") {
|
|
2413
|
-
const n = window.getSelection();
|
|
2414
|
-
if (n)
|
|
2415
|
-
try {
|
|
2416
|
-
n.removeAllRanges(), n.addRange(r);
|
|
2417
|
-
return;
|
|
2418
|
-
} catch {
|
|
2419
|
-
}
|
|
2420
|
-
}
|
|
2421
|
-
try {
|
|
2422
|
-
e(N, "selection.restore");
|
|
2423
|
-
} catch {
|
|
2424
|
-
}
|
|
2425
|
-
}, [N]), Dr = x(() => {
|
|
2426
|
-
var n;
|
|
2427
|
-
if (typeof window > "u") return "";
|
|
2428
|
-
const e = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
|
|
2429
|
-
return !e || !r || !r.anchorNode || !e.contains(r.anchorNode) ? "" : r.toString();
|
|
2430
|
-
}, []), Or = x(() => {
|
|
2431
|
-
var s;
|
|
2432
|
-
if (typeof window > "u") return null;
|
|
2433
|
-
const e = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
|
|
2434
|
-
if (!e || !r || r.rangeCount === 0) return null;
|
|
2435
|
-
const n = r.anchorNode, a = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
2436
|
-
return !a || !e.contains(a) ? null : a.closest("table");
|
|
2437
|
-
}, []), Yt = T(null), ot = x(() => {
|
|
2438
|
-
var s;
|
|
2439
|
-
if (typeof window > "u") return null;
|
|
2440
|
-
const e = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
|
|
2441
|
-
if (!e || !r || r.rangeCount === 0) return null;
|
|
2442
|
-
const n = r.anchorNode, a = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
|
|
2443
|
-
return !a || !e.contains(a) ? null : a.closest("td,th");
|
|
2444
|
-
}, []), qr = x(() => {
|
|
2445
|
-
Yt.current = ot();
|
|
2446
|
-
}, [ot]), Pr = x(
|
|
2447
|
-
(e, r) => {
|
|
2448
|
-
var f;
|
|
2449
|
-
const n = Yt.current ?? ot();
|
|
2450
|
-
if (!n) return;
|
|
2451
|
-
const a = e === "row" ? Array.from(((f = n.closest("tr")) == null ? void 0 : f.children) ?? [n]).filter(
|
|
2452
|
-
(v) => v instanceof HTMLElement && (v.tagName === "TD" || v.tagName === "TH")
|
|
2453
|
-
) : [n], s = J.current;
|
|
2454
|
-
if (s)
|
|
2455
|
-
try {
|
|
2456
|
-
s(N, "module.buffer.trigger");
|
|
2457
|
-
} catch {
|
|
2458
|
-
}
|
|
2459
|
-
for (const v of a)
|
|
2460
|
-
r ? v.style.setProperty("background-color", r) : v.style.removeProperty("background-color");
|
|
2461
|
-
if (s)
|
|
2462
|
-
try {
|
|
2463
|
-
s(N, "broadcast", "hardsync");
|
|
2464
|
-
} catch {
|
|
2465
|
-
}
|
|
2466
|
-
typeof window < "u" && window.requestAnimationFrame(() => ce());
|
|
2467
|
-
},
|
|
2468
|
-
[ot, N, ce]
|
|
2469
|
-
);
|
|
2470
|
-
I(() => {
|
|
2471
|
-
const e = B.current;
|
|
2472
|
-
if (typeof window > "u" || !e) return;
|
|
2473
|
-
const r = (s) => {
|
|
2474
|
-
const f = e.querySelector(".redactor-in"), v = s.target;
|
|
2475
|
-
if (!f || !(v instanceof Node) || !f.contains(v))
|
|
2476
|
-
return;
|
|
2477
|
-
const _ = v instanceof Element ? v.closest("img") : null;
|
|
2478
|
-
Je(_ && f.contains(_) ? _ : null);
|
|
2479
|
-
}, n = (s) => {
|
|
2480
|
-
s.key === "Escape" && Ye.current && Je(null);
|
|
2481
|
-
}, a = (s) => {
|
|
2482
|
-
const f = s.relatedTarget;
|
|
2483
|
-
(!(f instanceof Node) || !e.contains(f)) && Je(null);
|
|
2484
|
-
};
|
|
2485
|
-
return e.addEventListener("click", r), e.addEventListener("keydown", n), e.addEventListener("focusout", a), () => {
|
|
2486
|
-
e.removeEventListener("click", r), e.removeEventListener("keydown", n), e.removeEventListener("focusout", a);
|
|
2487
|
-
};
|
|
2488
|
-
}, [Je]);
|
|
2489
|
-
const Fr = x(
|
|
2490
|
-
(e) => {
|
|
2491
|
-
const r = Ye.current;
|
|
2492
|
-
if (!r) return;
|
|
2493
|
-
const n = Ot.includes(
|
|
2494
|
-
e
|
|
2495
|
-
) ? Ot : zr, a = J.current;
|
|
2496
|
-
if (a)
|
|
2497
|
-
try {
|
|
2498
|
-
a(N, "module.buffer.trigger");
|
|
2499
|
-
} catch {
|
|
2500
|
-
}
|
|
2501
|
-
for (const s of n) r.classList.remove(s);
|
|
2502
|
-
if (r.classList.add(e), a)
|
|
2503
|
-
try {
|
|
2504
|
-
a(N, "broadcast", "hardsync");
|
|
2505
|
-
} catch {
|
|
2506
|
-
}
|
|
2507
|
-
typeof window < "u" && window.requestAnimationFrame(() => ce());
|
|
2508
|
-
},
|
|
2509
|
-
[N, ce]
|
|
2510
|
-
), jr = x(
|
|
2511
|
-
(e) => {
|
|
2512
|
-
const r = Ye.current;
|
|
2513
|
-
if (!r) return;
|
|
2514
|
-
const n = J.current;
|
|
2515
|
-
if (n)
|
|
2516
|
-
try {
|
|
2517
|
-
n(N, "module.buffer.trigger");
|
|
2518
|
-
} catch {
|
|
2519
|
-
}
|
|
2520
|
-
if (r.style.setProperty("width", `${e}%`), n)
|
|
2521
|
-
try {
|
|
2522
|
-
n(N, "broadcast", "hardsync");
|
|
2523
|
-
} catch {
|
|
2524
|
-
}
|
|
2525
|
-
typeof window < "u" && window.requestAnimationFrame(() => ce());
|
|
2526
|
-
},
|
|
2527
|
-
[N, ce]
|
|
2528
|
-
), Br = x(
|
|
2529
|
-
(e) => {
|
|
2530
|
-
var n;
|
|
2531
|
-
const r = J.current;
|
|
2532
|
-
if (r && typeof window < "u") {
|
|
2533
|
-
const a = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), s = window.getSelection(), f = s == null ? void 0 : s.anchorNode, v = f && f.nodeType === Node.TEXT_NODE ? f.parentElement : f, _ = v && (a != null && a.contains(v)) ? v.closest("ul,ol") : null;
|
|
2534
|
-
if (_)
|
|
2535
|
-
try {
|
|
2536
|
-
r(N, "caret.setAfter", _);
|
|
2537
|
-
} catch {
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
Ne(e), typeof window < "u" && window.requestAnimationFrame(() => {
|
|
2541
|
-
var s;
|
|
2542
|
-
const a = (s = B.current) == null ? void 0 : s.querySelector(".redactor-in");
|
|
2543
|
-
a == null || a.querySelectorAll("table td, table th").forEach((f) => {
|
|
2544
|
-
let v = f.lastChild;
|
|
2545
|
-
for (; v && v.nodeType === Node.TEXT_NODE && !(v.textContent ?? "").trim(); ) {
|
|
2546
|
-
const _ = v.previousSibling;
|
|
2547
|
-
f.removeChild(v), v = _;
|
|
2548
|
-
}
|
|
2549
|
-
});
|
|
2550
|
-
});
|
|
2551
|
-
},
|
|
2552
|
-
[Ne, N]
|
|
2553
|
-
), Gr = x(
|
|
2554
|
-
async (e, r) => {
|
|
2555
|
-
if (u) return u(e, r);
|
|
2556
|
-
if (!h) throw new Error("No image upload URL configured.");
|
|
2557
|
-
const n = new FormData();
|
|
2558
|
-
n.append("file", e);
|
|
2559
|
-
const a = await fetch(h, {
|
|
2560
|
-
method: "POST",
|
|
2561
|
-
body: n,
|
|
2562
|
-
credentials: "same-origin",
|
|
2563
|
-
signal: r
|
|
2564
|
-
});
|
|
2565
|
-
if (!a.ok) throw new Error(`Image upload failed (${a.status}).`);
|
|
2566
|
-
const s = ba(await a.json());
|
|
2567
|
-
if (!s) throw new Error("Image upload response contained no URL.");
|
|
2568
|
-
return s;
|
|
2569
|
-
},
|
|
2570
|
-
[h, u]
|
|
2571
|
-
), Ve = T(null), at = T(null), [Ae, Jt] = z(!1), [Vr, er] = z(!1), [Kr, zt] = z(""), it = x(() => {
|
|
2572
|
-
const e = at.current;
|
|
2573
|
-
e != null && e.parentNode && e.parentNode.removeChild(e), at.current = null;
|
|
2574
|
-
}, []), tr = x((e) => {
|
|
2575
|
-
var a;
|
|
2576
|
-
const r = (a = B.current) == null ? void 0 : a.querySelector(
|
|
2577
|
-
".redactor-in"
|
|
2578
|
-
);
|
|
2579
|
-
if (!r) return;
|
|
2580
|
-
let n = at.current;
|
|
2581
|
-
if (!n || !r.contains(n)) {
|
|
2582
|
-
n = document.createElement("span"), n.setAttribute("data-rte-interim", ""), n.setAttribute("contenteditable", "false");
|
|
2583
|
-
const s = window.getSelection();
|
|
2584
|
-
if (s && s.rangeCount > 0 && r.contains(s.anchorNode)) {
|
|
2585
|
-
const f = s.getRangeAt(0);
|
|
2586
|
-
f.collapse(!1), f.insertNode(n);
|
|
2587
|
-
} else
|
|
2588
|
-
r.appendChild(n);
|
|
2589
|
-
at.current = n;
|
|
2590
|
-
}
|
|
2591
|
-
n.textContent = e;
|
|
2592
|
-
}, []), st = x(() => {
|
|
2593
|
-
var e;
|
|
2594
|
-
(e = Ve.current) == null || e.abort();
|
|
2595
|
-
}, []), rr = x(() => {
|
|
2596
|
-
var f;
|
|
2597
|
-
if (typeof window > "u") return !1;
|
|
2598
|
-
const e = window.getSelection(), r = (f = B.current) == null ? void 0 : f.querySelector(".redactor-in");
|
|
2599
|
-
if (!e || e.rangeCount === 0 || !r) return !1;
|
|
2600
|
-
const { startContainer: n, startOffset: a } = e.getRangeAt(0);
|
|
2601
|
-
if (!r.contains(n) || n.nodeType !== Node.TEXT_NODE || a === 0)
|
|
2602
|
-
return !1;
|
|
2603
|
-
const s = n.data.charAt(a - 1);
|
|
2604
|
-
return /\S/.test(s) && s !== " ";
|
|
2605
|
-
}, []), me = w !== void 0 && !w.granted, lt = x(() => {
|
|
2606
|
-
if (!q || me) return;
|
|
2607
|
-
const e = new AbortController();
|
|
2608
|
-
Ve.current = e, er(!1), Jt(!0), zt(D("editor.ai.listening")), it(), q({
|
|
2609
|
-
signal: e.signal,
|
|
2610
|
-
// Interim text shows live in the editor (grey + caret); each final
|
|
2611
|
-
// replaces it with committed text at the caret.
|
|
2612
|
-
onPartialTranscript: (r) => {
|
|
2613
|
-
e.signal.aborted || tr(r);
|
|
2614
|
-
},
|
|
2615
|
-
onFinalTranscript: (r) => {
|
|
2616
|
-
if (e.signal.aborted) return;
|
|
2617
|
-
it();
|
|
2618
|
-
const n = r.trim();
|
|
2619
|
-
if (n) {
|
|
2620
|
-
const a = rr() ? " " : "";
|
|
2621
|
-
ue(`${a}${n} `, { asHtml: !1 }), zt(n);
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
}).catch((r) => {
|
|
2625
|
-
var n;
|
|
2626
|
-
if (!(e.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError")) {
|
|
2627
|
-
if (ga(r) && ((n = Ze.current) == null || n.call(Ze), Wt.current)) {
|
|
2628
|
-
Kt(!0), Le(!0);
|
|
2629
|
-
return;
|
|
2630
|
-
}
|
|
2631
|
-
er(!0);
|
|
2632
|
-
}
|
|
2633
|
-
}).finally(() => {
|
|
2634
|
-
it(), Ve.current === e && (Ve.current = null, Jt(!1), zt(""));
|
|
2635
|
-
});
|
|
2636
|
-
}, [
|
|
2637
|
-
q,
|
|
2638
|
-
me,
|
|
2639
|
-
ue,
|
|
2640
|
-
it,
|
|
2641
|
-
tr,
|
|
2642
|
-
rr,
|
|
2643
|
-
D
|
|
2644
|
-
]);
|
|
2645
|
-
I(() => () => {
|
|
2646
|
-
var e;
|
|
2647
|
-
return (e = Ve.current) == null ? void 0 : e.abort();
|
|
2648
|
-
}, []);
|
|
2649
|
-
const [Wr, ct] = z(null), De = T(null), [Xr, nr] = z(!1), Zr = ((w == null ? void 0 : w.pending) ?? !1) || Xr, dt = T(!1), or = x(() => {
|
|
2650
|
-
De.current = null, dt.current = !1, ct(null);
|
|
2651
|
-
}, []), Ur = x(() => {
|
|
2652
|
-
var r;
|
|
2653
|
-
dt.current = !0;
|
|
2654
|
-
const e = (r = w == null ? void 0 : w.onGrant) == null ? void 0 : r.call(w);
|
|
2655
|
-
e && typeof e.then == "function" && (nr(!0), Promise.resolve(e).catch(() => {
|
|
2656
|
-
}).finally(() => nr(!1)));
|
|
2657
|
-
}, [w]), ar = T((w == null ? void 0 : w.granted) ?? !0);
|
|
2658
|
-
I(() => {
|
|
2659
|
-
const e = ar.current;
|
|
2660
|
-
if (ar.current = (w == null ? void 0 : w.granted) ?? !0, !e && (w != null && w.granted) && De.current) {
|
|
2661
|
-
const r = De.current, n = dt.current;
|
|
2662
|
-
if (De.current = null, dt.current = !1, ct(null), !n) return;
|
|
2663
|
-
r === "write" ? Le(!0) : (xe(), lt());
|
|
2664
|
-
}
|
|
2665
|
-
}, [w == null ? void 0 : w.granted, xe, lt]), I(() => {
|
|
2666
|
-
me && (Le(!1), Ae && st());
|
|
2667
|
-
}, [me, Ae, st]);
|
|
2668
|
-
const Qr = x(() => {
|
|
2669
|
-
if (Ae) {
|
|
2670
|
-
st();
|
|
2671
|
-
return;
|
|
2672
|
-
}
|
|
2673
|
-
if (me) {
|
|
2674
|
-
Ge(), De.current = "dictate", ct("dictate");
|
|
2675
|
-
return;
|
|
2676
|
-
}
|
|
2677
|
-
lt();
|
|
2678
|
-
}, [Ae, st, me, Ge, lt]), Yr = x(() => {
|
|
2679
|
-
Ge();
|
|
2680
|
-
const e = Ce.current;
|
|
2681
|
-
if (Ue.current = e ? e.cloneRange() : null, Er(e && !e.collapsed ? e.toString() : ""), me) {
|
|
2682
|
-
De.current = "write", ct("write");
|
|
2683
|
-
return;
|
|
2684
|
-
}
|
|
2685
|
-
Le(!0);
|
|
2686
|
-
}, [Ge, me]), ir = Pe(() => w != null && w.granted ? /* @__PURE__ */ k(Me, { children: [
|
|
2687
|
-
D(
|
|
2688
|
-
"editor.ai.consentRecorded",
|
|
2689
|
-
"AI assistance consent has been recorded."
|
|
2690
|
-
),
|
|
2691
|
-
H ? /* @__PURE__ */ k(Me, { children: [
|
|
2692
|
-
" ",
|
|
2693
|
-
H
|
|
2694
|
-
] }) : null
|
|
2695
|
-
] }) : H, [w, H, D]), [pe, Rt] = z(null), ze = T(null), sr = x(
|
|
2696
|
-
(e, r) => {
|
|
2697
|
-
if (ze.current) return;
|
|
2698
|
-
const n = new AbortController();
|
|
2699
|
-
ze.current = n, Rt(e);
|
|
2700
|
-
const a = le();
|
|
2701
|
-
Promise.resolve(r({ html: a, signal: n.signal })).then((s) => {
|
|
2702
|
-
var v;
|
|
2703
|
-
if (n.signal.aborted) return;
|
|
2704
|
-
const f = fe(String(s ?? ""));
|
|
2705
|
-
ie("source.setCode", f), (v = te.current) == null || v.call(te, { html: f, markdown: "" });
|
|
2706
|
-
}).catch(() => {
|
|
2707
|
-
}).finally(() => {
|
|
2708
|
-
ze.current === n && (ze.current = null, Rt(null));
|
|
2709
|
-
});
|
|
2710
|
-
},
|
|
2711
|
-
[le, ie]
|
|
2712
|
-
), lr = x(() => {
|
|
2713
|
-
var e;
|
|
2714
|
-
(e = ze.current) == null || e.abort(), ze.current = null, Rt(null);
|
|
2715
|
-
}, []);
|
|
2716
|
-
I(() => () => {
|
|
2717
|
-
var e;
|
|
2718
|
-
return (e = ze.current) == null ? void 0 : e.abort();
|
|
2719
|
-
}, []), I(() => {
|
|
2720
|
-
const e = de.current;
|
|
2721
|
-
if (!e) return;
|
|
2722
|
-
e.value = Hr.current, ge.current();
|
|
2723
|
-
const r = ya($);
|
|
2724
|
-
if (!r) {
|
|
2725
|
-
Gt(!0);
|
|
2726
|
-
return;
|
|
2727
|
-
}
|
|
2728
|
-
J.current = r, e.value = ht(e.value, Qe.current);
|
|
2729
|
-
const n = {
|
|
2730
|
-
lang: G ?? xa(F.language || "en"),
|
|
2731
|
-
// The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
|
|
2732
|
-
// via the command API, so Redactor's native toolbar is suppressed.
|
|
2733
|
-
toolbar: !1,
|
|
2734
|
-
plugins: M ?? [],
|
|
2735
|
-
placeholder: l ?? D("editor.placeholder"),
|
|
2736
|
-
toolbarFixed: !1,
|
|
2737
|
-
// Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
|
|
2738
|
-
shortcodes: !1,
|
|
2739
|
-
// The kit owns image editing: ImageFloatingToolbar provides DS-native,
|
|
2740
|
-
// keyboard-accessible resize + wrap/align, so Redactor's own image
|
|
2741
|
-
// popup AND its single-handle drag-resizer are both disabled to avoid a
|
|
2742
|
-
// second, untokenised, mouse-only UI competing with ours.
|
|
2743
|
-
imageEditable: !1,
|
|
2744
|
-
imageResizable: !1
|
|
2745
|
-
}, a = h ? { imageUpload: h } : {}, s = (L == null ? void 0 : L.callbacks) ?? {}, f = {
|
|
2746
|
-
...n,
|
|
2747
|
-
...a,
|
|
2748
|
-
...L ?? {},
|
|
2749
|
-
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
2750
|
-
// the sanitising change handler or re-enable Redactor's native image UI
|
|
2751
|
-
// (the kit's ImageFloatingToolbar replaces both — see kitDefaults above).
|
|
2752
|
-
imageEditable: !1,
|
|
2753
|
-
imageResizable: !1,
|
|
2754
|
-
callbacks: {
|
|
2755
|
-
...s,
|
|
2756
|
-
changed(v) {
|
|
2757
|
-
ge.current();
|
|
2758
|
-
const _ = gt(
|
|
2759
|
-
yr(vr(v))
|
|
2760
|
-
), re = fe(_), be = dr.current;
|
|
2761
|
-
if (be && Date.now() < be.until && wr(re) === be.text) {
|
|
2762
|
-
et.current = re;
|
|
2763
|
-
return;
|
|
2764
|
-
}
|
|
2765
|
-
re !== et.current && (et.current = re, wt.current = !0, te.current && (Fe.current && clearTimeout(Fe.current), Fe.current = setTimeout(() => {
|
|
2766
|
-
var Re;
|
|
2767
|
-
(Re = te.current) == null || Re.call(te, { html: re, markdown: "" });
|
|
2768
|
-
}, 100)));
|
|
2769
|
-
},
|
|
2770
|
-
keydown(v) {
|
|
2771
|
-
var _;
|
|
2772
|
-
(_ = tt.current) == null || _.call(tt, v);
|
|
2773
|
-
},
|
|
2774
|
-
observe() {
|
|
2775
|
-
ce();
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
};
|
|
2779
|
-
try {
|
|
2780
|
-
if (r(N, f), et.current = fe(
|
|
2781
|
-
gt(yr(le()))
|
|
2782
|
-
), ge.current(), b)
|
|
2783
|
-
try {
|
|
2784
|
-
r(N, "enableReadOnly");
|
|
2785
|
-
} catch {
|
|
2786
|
-
}
|
|
2787
|
-
} catch {
|
|
2788
|
-
Gt(!0);
|
|
2789
|
-
}
|
|
2790
|
-
return () => {
|
|
2791
|
-
Fe.current && clearTimeout(Fe.current);
|
|
2792
|
-
try {
|
|
2793
|
-
r(N, "destroy");
|
|
2794
|
-
} catch {
|
|
2795
|
-
}
|
|
2796
|
-
J.current = null;
|
|
2797
|
-
};
|
|
2798
|
-
}, []);
|
|
2799
|
-
const cr = T(ee), dr = T(
|
|
2800
|
-
null
|
|
2801
|
-
);
|
|
2802
|
-
I(() => {
|
|
2803
|
-
var n, a;
|
|
2804
|
-
if (cr.current === ee || (cr.current = ee, !J.current || ee.size === 0)) return;
|
|
2805
|
-
const e = le(), r = ht(e, ee);
|
|
2806
|
-
if (r !== e) {
|
|
2807
|
-
const s = (n = B.current) == null ? void 0 : n.querySelector(".redactor-in"), v = s != null && s.contains(document.activeElement) && s ? ha(s) : null;
|
|
2808
|
-
dr.current = {
|
|
2809
|
-
text: wr(e),
|
|
2810
|
-
until: Date.now() + 1e3
|
|
2811
|
-
}, ie("source.setCode", r);
|
|
2812
|
-
const _ = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in");
|
|
2813
|
-
v !== null && _ && pa(_, v);
|
|
2814
|
-
}
|
|
2815
|
-
window.requestAnimationFrame(() => ge.current());
|
|
2816
|
-
}, [ee, le, ie]), I(() => {
|
|
2817
|
-
if (!J.current || m === void 0) return;
|
|
2818
|
-
if (wt.current) {
|
|
2819
|
-
wt.current = !1;
|
|
2820
|
-
return;
|
|
2821
|
-
}
|
|
2822
|
-
const e = ht(
|
|
2823
|
-
fe(gt(m)),
|
|
2824
|
-
Qe.current
|
|
2825
|
-
);
|
|
2826
|
-
gt(le()) !== e && ie("source.setCode", e);
|
|
2827
|
-
}, [m, le, ie]), I(() => {
|
|
2828
|
-
xt.current = b;
|
|
2829
|
-
const e = J.current;
|
|
2830
|
-
if (e)
|
|
2831
|
-
try {
|
|
2832
|
-
e(N, b ? "enableReadOnly" : "disableReadOnly");
|
|
2833
|
-
} catch {
|
|
2834
|
-
}
|
|
2835
|
-
}, [b, N]), I(() => {
|
|
2836
|
-
if (!ae || m === void 0) return;
|
|
2837
|
-
const e = de.current;
|
|
2838
|
-
if (!e) return;
|
|
2839
|
-
const r = fe(m);
|
|
2840
|
-
e.value !== r && document.activeElement !== e && (e.value = r);
|
|
2841
|
-
}, [ae, m]);
|
|
2842
|
-
const Oe = Pe(
|
|
2843
|
-
() => ({
|
|
2844
|
-
getHTML() {
|
|
2845
|
-
return le();
|
|
2846
|
-
},
|
|
2847
|
-
getText() {
|
|
2848
|
-
return le().replace(/<[^>]*>/g, " ").replace(/ /gi, " ").replace(/\s+/g, " ").trim();
|
|
2849
|
-
},
|
|
2850
|
-
getMarkdown() {
|
|
2851
|
-
return "";
|
|
2852
|
-
},
|
|
2853
|
-
setContent(e) {
|
|
2854
|
-
const r = fe(e);
|
|
2855
|
-
ie(
|
|
2856
|
-
"source.setCode",
|
|
2857
|
-
ht(r, Qe.current)
|
|
2858
|
-
) || de.current && (de.current.value = r);
|
|
2859
|
-
},
|
|
2860
|
-
insertAtCursor: ue,
|
|
2861
|
-
applyFormat(e) {
|
|
2862
|
-
const r = va[e];
|
|
2863
|
-
r && He(...r);
|
|
2864
|
-
},
|
|
2865
|
-
focus() {
|
|
2866
|
-
var r;
|
|
2867
|
-
const e = J.current;
|
|
2868
|
-
if (e)
|
|
2869
|
-
try {
|
|
2870
|
-
e(N, "editor.focus");
|
|
2871
|
-
return;
|
|
2872
|
-
} catch {
|
|
2873
|
-
}
|
|
2874
|
-
(r = de.current) == null || r.focus();
|
|
2875
|
-
},
|
|
2876
|
-
clear() {
|
|
2877
|
-
ie("source.setCode", "") || de.current && (de.current.value = "");
|
|
2878
|
-
}
|
|
2879
|
-
}),
|
|
2880
|
-
[N, le, ie, ue, He]
|
|
2881
|
-
);
|
|
2882
|
-
on(Se, () => Oe, [Oe]), ln(Io, Oe, o);
|
|
2883
|
-
const Jr = x(
|
|
2884
|
-
(e) => {
|
|
2885
|
-
var r;
|
|
2886
|
-
ge.current(), (r = te.current) == null || r.call(te, {
|
|
2887
|
-
html: fe(e.target.value),
|
|
2888
|
-
markdown: ""
|
|
2889
|
-
});
|
|
2890
|
-
},
|
|
2891
|
-
[]
|
|
2892
|
-
), ut = d ?? D("editor.regionLabel"), en = l ?? D("editor.placeholder");
|
|
2893
|
-
I(() => {
|
|
2894
|
-
var a;
|
|
2895
|
-
if (ae) return;
|
|
2896
|
-
const e = (a = B.current) == null ? void 0 : a.querySelector(".redactor-in");
|
|
2897
|
-
if (!e) return;
|
|
2898
|
-
const r = () => {
|
|
2899
|
-
e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== ut && e.setAttribute("aria-label", ut), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
|
|
2900
|
-
};
|
|
2901
|
-
r();
|
|
2902
|
-
const n = new MutationObserver(r);
|
|
2903
|
-
return n.observe(e, {
|
|
2904
|
-
attributes: !0,
|
|
2905
|
-
attributeFilter: ["role", "aria-labelledby"]
|
|
2906
|
-
}), () => n.disconnect();
|
|
2907
|
-
}, [ae, ut]);
|
|
2908
|
-
const _t = pe !== null, tn = x(
|
|
2909
|
-
(e) => {
|
|
2910
|
-
if (Dt.test(e)) {
|
|
2911
|
-
if (ae) {
|
|
2912
|
-
ue(`[[${e}]]`, { asHtml: !1 });
|
|
2913
|
-
return;
|
|
2914
|
-
}
|
|
2915
|
-
xe(), Ne(xr(e));
|
|
2916
|
-
}
|
|
2917
|
-
},
|
|
2918
|
-
[ae, ue, xe, Ne]
|
|
2919
|
-
), qe = [];
|
|
2920
|
-
return q && qe.push({
|
|
2921
|
-
key: "dictate",
|
|
2922
|
-
icon: Ae ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(Nr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2923
|
-
label: D(Ae ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
2924
|
-
onClick: Qr,
|
|
2925
|
-
recording: Ae
|
|
2926
|
-
}), U && qe.push({
|
|
2927
|
-
key: "proofread",
|
|
2928
|
-
// While running, the segment becomes a STOP/cancel button (progress is
|
|
2929
|
-
// shown by the scrim spinner).
|
|
2930
|
-
icon: pe === "proofread" ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(vo, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2931
|
-
label: pe === "proofread" ? D("common.cancel") : D("editor.ai.proofread", "Check spelling & grammar"),
|
|
2932
|
-
onClick: pe === "proofread" ? lr : () => sr("proofread", U),
|
|
2933
|
-
running: pe === "proofread"
|
|
2934
|
-
}), X && qe.push({
|
|
2935
|
-
key: "format",
|
|
2936
|
-
icon: pe === "format" ? /* @__PURE__ */ t(pt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(xn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2937
|
-
label: pe === "format" ? D("common.cancel") : D("editor.ai.autoFormat", "Auto-format document"),
|
|
2938
|
-
onClick: pe === "format" ? lr : () => sr("format", X),
|
|
2939
|
-
running: pe === "format"
|
|
2940
|
-
}), (E || j) && qe.push({
|
|
2941
|
-
key: "write",
|
|
2942
|
-
icon: /* @__PURE__ */ t(kn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
2943
|
-
label: D("editor.ai.helpMeWrite"),
|
|
2944
|
-
onClick: Yr
|
|
2945
|
-
}), /* @__PURE__ */ k(
|
|
2946
|
-
"div",
|
|
2947
|
-
{
|
|
2948
|
-
ref: B,
|
|
2949
|
-
className: [ka(), R].filter(Boolean).join(" "),
|
|
2950
|
-
"data-component": "rich-text-editor",
|
|
2951
|
-
"data-component-id": o,
|
|
2952
|
-
"data-min-height": p,
|
|
2953
|
-
children: [
|
|
2954
|
-
!ae && !b ? /* @__PURE__ */ t(
|
|
2955
|
-
ua,
|
|
2956
|
-
{
|
|
2957
|
-
run: He,
|
|
2958
|
-
active: Ut,
|
|
2959
|
-
preset: g,
|
|
2960
|
-
insertHtml: Ne,
|
|
2961
|
-
insertTable: Br,
|
|
2962
|
-
saveSelection: Ge,
|
|
2963
|
-
restoreSelection: xe,
|
|
2964
|
-
getSelectedText: Dr,
|
|
2965
|
-
uploadImage: h || u ? Gr : void 0,
|
|
2966
|
-
enableColor: (M == null ? void 0 : M.includes("fontcolor")) ?? !1,
|
|
2967
|
-
enableImage: !!(h || u),
|
|
2968
|
-
enableTable: (M == null ? void 0 : M.includes("table")) ?? !1,
|
|
2969
|
-
showExtensions: C,
|
|
2970
|
-
variables: P,
|
|
2971
|
-
insertVariable: tn
|
|
2972
|
-
}
|
|
2973
|
-
) : null,
|
|
2974
|
-
/* @__PURE__ */ k("div", { className: "ds:relative", ref: Xe, children: [
|
|
2975
|
-
/* @__PURE__ */ t(
|
|
2976
|
-
"textarea",
|
|
2977
|
-
{
|
|
2978
|
-
ref: de,
|
|
2979
|
-
id: oe,
|
|
2980
|
-
"aria-label": ut,
|
|
2981
|
-
"aria-multiline": "true",
|
|
2982
|
-
"aria-busy": _t || void 0,
|
|
2983
|
-
placeholder: en,
|
|
2984
|
-
onChange: ae ? Jr : void 0,
|
|
2985
|
-
readOnly: ae ? b : void 0,
|
|
2986
|
-
className: ae ? Ta() : void 0
|
|
2987
|
-
}
|
|
2988
|
-
),
|
|
2989
|
-
_t ? /* @__PURE__ */ t(
|
|
2990
|
-
"div",
|
|
2991
|
-
{
|
|
2992
|
-
"aria-hidden": "true",
|
|
2993
|
-
className: "ds:absolute ds:inset-0 ds:z-[5] ds:flex ds:items-center ds:justify-center ds:cursor-wait ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--background)_40%,transparent)]",
|
|
2994
|
-
children: /* @__PURE__ */ t(kr, { size: "lg", variant: "prism" })
|
|
2995
|
-
}
|
|
2996
|
-
) : null,
|
|
2997
|
-
/* @__PURE__ */ k("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
|
|
2998
|
-
qe.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10 ds:flex ds:items-center ds:overflow-hidden ds:rounded-full ds:bg-[var(--primary)] ds:bg-[image:var(--gradient-brand)] ds:shadow-[0_8px_24px_color-mix(in_srgb,var(--primary)_35%,transparent)]", children: qe.map((e, r) => /* @__PURE__ */ k(vt, { children: [
|
|
2999
|
-
r > 0 ? /* @__PURE__ */ t(
|
|
3000
|
-
"span",
|
|
3001
|
-
{
|
|
3002
|
-
"aria-hidden": "true",
|
|
3003
|
-
className: "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[color-mix(in_srgb,var(--primary-foreground)_35%,transparent)]"
|
|
3004
|
-
}
|
|
3005
|
-
) : null,
|
|
3006
|
-
/* @__PURE__ */ t(
|
|
3007
|
-
"button",
|
|
3008
|
-
{
|
|
3009
|
-
type: "button",
|
|
3010
|
-
onClick: e.onClick,
|
|
3011
|
-
"aria-pressed": e.recording || void 0,
|
|
3012
|
-
"aria-busy": e.running || void 0,
|
|
3013
|
-
disabled: _t && !e.running || void 0,
|
|
3014
|
-
"aria-label": e.label,
|
|
3015
|
-
className: e.recording ? za : Aa,
|
|
3016
|
-
children: e.icon
|
|
3017
|
-
}
|
|
3018
|
-
)
|
|
3019
|
-
] }, e.key)) }) : null,
|
|
3020
|
-
j ? j({
|
|
3021
|
-
open: Vt && !me,
|
|
3022
|
-
onClose: () => {
|
|
3023
|
-
Le(!1), Kt(!1);
|
|
3024
|
-
},
|
|
3025
|
-
selectionText: Mr,
|
|
3026
|
-
creditsExhausted: Sr,
|
|
3027
|
-
getHTML: Oe.getHTML,
|
|
3028
|
-
getText: Oe.getText,
|
|
3029
|
-
insertAtSelection: (e) => {
|
|
3030
|
-
Ue.current && (Ce.current = Ue.current.cloneRange()), xe(), ue(e, { asHtml: !0 });
|
|
3031
|
-
},
|
|
3032
|
-
insertAfterSelection: (e) => {
|
|
3033
|
-
const r = Ue.current ?? Ce.current;
|
|
3034
|
-
if (r) {
|
|
3035
|
-
const n = r.cloneRange();
|
|
3036
|
-
n.collapse(!1), Ce.current = n;
|
|
3037
|
-
}
|
|
3038
|
-
xe(), ue(e, { asHtml: !0 });
|
|
3039
|
-
},
|
|
3040
|
-
setContent: Oe.setContent,
|
|
3041
|
-
onDictate: q,
|
|
3042
|
-
privacyNotice: ir
|
|
3043
|
-
}) : E ? /* @__PURE__ */ t(
|
|
3044
|
-
Oo,
|
|
3045
|
-
{
|
|
3046
|
-
open: Vt && !me,
|
|
3047
|
-
onClose: () => Le(!1),
|
|
3048
|
-
onRequestAiDraft: E,
|
|
3049
|
-
onInsert: (e) => {
|
|
3050
|
-
xe(), ue(e, { asHtml: A !== "text" });
|
|
3051
|
-
},
|
|
3052
|
-
previewAsHtml: A !== "text",
|
|
3053
|
-
privacyNotice: ir,
|
|
3054
|
-
onDictate: q
|
|
3055
|
-
}
|
|
3056
|
-
) : null,
|
|
3057
|
-
w ? /* @__PURE__ */ t(
|
|
3058
|
-
Cr,
|
|
3059
|
-
{
|
|
3060
|
-
open: Wr !== null,
|
|
3061
|
-
onClose: or,
|
|
3062
|
-
ariaLabel: D(
|
|
3063
|
-
"editor.ai.consentRegionLabel",
|
|
3064
|
-
"AI assistance consent for this document"
|
|
3065
|
-
),
|
|
3066
|
-
footer: /* @__PURE__ */ t(ve, { intent: "ghost", size: "sm", onClick: or, children: D("common.close") }),
|
|
3067
|
-
children: /* @__PURE__ */ t(
|
|
3068
|
-
cn,
|
|
3069
|
-
{
|
|
3070
|
-
granted: w.granted,
|
|
3071
|
-
grantedAt: w.grantedAt,
|
|
3072
|
-
grantedBy: w.grantedBy,
|
|
3073
|
-
canGrant: (w.canGrant ?? !0) && w.onGrant !== void 0,
|
|
3074
|
-
pending: Zr,
|
|
3075
|
-
onGrantConsent: Ur,
|
|
3076
|
-
headingLevel: O,
|
|
3077
|
-
"aria-label": D(
|
|
3078
|
-
"editor.ai.consentRegionLabel",
|
|
3079
|
-
"AI assistance consent for this document"
|
|
3080
|
-
)
|
|
3081
|
-
}
|
|
3082
|
-
)
|
|
3083
|
-
}
|
|
3084
|
-
) : null
|
|
3085
|
-
] }),
|
|
3086
|
-
!ae && !b && ((M == null ? void 0 : M.includes("table")) ?? !1) ? /* @__PURE__ */ t(
|
|
3087
|
-
ea,
|
|
3088
|
-
{
|
|
3089
|
-
active: Ut,
|
|
3090
|
-
run: He,
|
|
3091
|
-
areaRef: Xe,
|
|
3092
|
-
getActiveTableEl: Or,
|
|
3093
|
-
enableColor: (M == null ? void 0 : M.includes("fontcolor")) ?? !1,
|
|
3094
|
-
saveTableCell: qr,
|
|
3095
|
-
applyTableBackground: Pr
|
|
3096
|
-
}
|
|
3097
|
-
) : null,
|
|
3098
|
-
!ae && !b ? /* @__PURE__ */ t(
|
|
3099
|
-
da,
|
|
3100
|
-
{
|
|
3101
|
-
areaRef: Xe,
|
|
3102
|
-
activeImageEl: Ir,
|
|
3103
|
-
applyImageClass: Fr,
|
|
3104
|
-
setImageWidth: jr
|
|
3105
|
-
}
|
|
3106
|
-
) : null,
|
|
3107
|
-
Y ? /* @__PURE__ */ t(
|
|
3108
|
-
"div",
|
|
3109
|
-
{
|
|
3110
|
-
id: Be,
|
|
3111
|
-
role: "listbox",
|
|
3112
|
-
"aria-label": D("editor.variables", "Variables"),
|
|
3113
|
-
"data-component": "variable-typeahead",
|
|
3114
|
-
className: Ca,
|
|
3115
|
-
style: {
|
|
3116
|
-
"--rte-typeahead-x": `${Y.left}px`,
|
|
3117
|
-
"--rte-typeahead-y": `${Y.top}px`
|
|
3118
|
-
},
|
|
3119
|
-
children: Te.length === 0 ? /* @__PURE__ */ t("p", { className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: D("editor.variableNoMatch", {
|
|
3120
|
-
query: Y.query,
|
|
3121
|
-
defaultValue: "No variable matches “{{query}}”"
|
|
3122
|
-
}) }) : Te.map((e, r) => /* @__PURE__ */ k(
|
|
3123
|
-
"div",
|
|
3124
|
-
{
|
|
3125
|
-
id: `${Be}-${e.token}`,
|
|
3126
|
-
role: "option",
|
|
3127
|
-
tabIndex: -1,
|
|
3128
|
-
"aria-selected": r === Y.index,
|
|
3129
|
-
className: Na,
|
|
3130
|
-
onMouseDown: (n) => {
|
|
3131
|
-
n.preventDefault();
|
|
3132
|
-
const a = je.current;
|
|
3133
|
-
he(), a && rt(e.token, a);
|
|
3134
|
-
},
|
|
3135
|
-
children: [
|
|
3136
|
-
/* @__PURE__ */ t("span", { className: "ds:truncate", children: e.label }),
|
|
3137
|
-
/* @__PURE__ */ t("span", { className: "ds:ms-auto ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)] ds:group-aria-selected:text-[color:var(--accent-foreground)]", children: `[[${e.token}]]` })
|
|
3138
|
-
]
|
|
3139
|
-
},
|
|
3140
|
-
e.token
|
|
3141
|
-
))
|
|
3142
|
-
}
|
|
3143
|
-
) : null
|
|
3144
|
-
] }),
|
|
3145
|
-
q ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Kr }) : null,
|
|
3146
|
-
$e.length > 0 ? /* @__PURE__ */ t(
|
|
3147
|
-
"p",
|
|
3148
|
-
{
|
|
3149
|
-
id: `${oe}-variables-error`,
|
|
3150
|
-
role: "alert",
|
|
3151
|
-
className: "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
3152
|
-
children: D("editor.variableInvalid", {
|
|
3153
|
-
tokens: $e.map((e) => `[[${e}]]`).join(", ")
|
|
3154
|
-
})
|
|
3155
|
-
}
|
|
3156
|
-
) : null,
|
|
3157
|
-
q && Vr ? /* @__PURE__ */ t(
|
|
3158
|
-
"p",
|
|
3159
|
-
{
|
|
3160
|
-
role: "alert",
|
|
3161
|
-
className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
3162
|
-
children: D("editor.ai.dictationError")
|
|
3163
|
-
}
|
|
3164
|
-
) : null
|
|
3165
|
-
]
|
|
3166
|
-
}
|
|
3167
|
-
);
|
|
3168
|
-
}
|
|
3169
|
-
);
|
|
3170
|
-
Ra.displayName = "RichTextEditor";
|
|
3171
|
-
export {
|
|
3172
|
-
Ra as R,
|
|
3173
|
-
Io as r,
|
|
3174
|
-
ka as w
|
|
3175
|
-
};
|
|
3176
|
-
//# sourceMappingURL=rich-text-editor-DUMeifwc.js.map
|