@alfadocs/ui-kit 1.148.0 → 1.149.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-appointment-editor-dialog-Cz8F2H4M.js → calendar-appointment-editor-dialog-Dx9_KIWA.js} +5 -5
- package/dist/_chunks/{calendar-waiting-list-panel-C4T85b4q.js → calendar-waiting-list-panel-BKBHfBpn.js} +2 -2
- package/dist/_chunks/{calendar.sheets-DsgPdycU.js → calendar.sheets-lgAqJB34.js} +2 -2
- package/dist/_chunks/notes-panel-Cw06dLDm.js +1135 -0
- package/dist/_chunks/rich-text-editor-eGdYDPK2.js +4405 -0
- package/dist/_chunks/task-editor-4zFL10oM.js +1153 -0
- package/dist/_chunks/{tasks-panel-DufAoAxG.js → tasks-panel-BDPQPOP6.js} +475 -461
- package/dist/_chunks/{use-appointment-details-read-kYp-gfhb.js → use-appointment-details-read-Bl1DHXQ2.js} +568 -554
- package/dist/agent-catalog.json +9 -7
- package/dist/agent-i18n/en.json +4 -4
- package/dist/appointment-editor-panel/index.js +1 -1
- package/dist/aws-transcribe/index.js +287 -181
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/save-outcome.d.ts +23 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +12 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +5 -3
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/task-editor/use-task-editor-form.d.ts +7 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +2 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +2 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +2 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +2 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +2 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +2 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +2 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +2 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +2 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +2 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +2 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +2 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +2 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +2 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +2 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +2 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +2 -1
- package/dist/index.js +1407 -1403
- package/dist/locales/ar.json +2 -1
- package/dist/locales/de.json +2 -1
- package/dist/locales/el.json +2 -1
- package/dist/locales/en.json +2 -1
- package/dist/locales/es.json +2 -1
- package/dist/locales/fr.json +2 -1
- package/dist/locales/hi.json +2 -1
- package/dist/locales/it.json +2 -1
- package/dist/locales/ja.json +2 -1
- package/dist/locales/nl.json +2 -1
- package/dist/locales/pl.json +2 -1
- package/dist/locales/pt.json +2 -1
- package/dist/locales/ro.json +2 -1
- package/dist/locales/ru.json +2 -1
- package/dist/locales/sq.json +2 -1
- package/dist/locales/sv.json +2 -1
- package/dist/locales/tr.json +2 -1
- package/dist/locales/zh.json +2 -1
- package/dist/online-bookings-panel/index.js +1 -1
- package/dist/patterns/calendar/index.js +2 -2
- package/dist/save-outcome/index.js +20 -0
- package/dist/speech/aws-transcribe.d.ts +30 -6
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +2 -2
- package/package.json +5 -1
- package/dist/_chunks/notes-panel-BHMnLbEH.js +0 -1116
- package/dist/_chunks/rich-text-editor-BAcJq1PO.js +0 -4359
- package/dist/_chunks/task-editor-B9YpfwcW.js +0 -1095
|
@@ -1,4359 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as N, Fragment as Be } from "react/jsx-runtime";
|
|
2
|
-
import { useId as Ge, useState as R, useRef as x, useCallback as w, useEffect as H, Fragment as yt, useLayoutEffect as si, forwardRef as li, useMemo as ht, useImperativeHandle as ci } from "react";
|
|
3
|
-
import { c as wt } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as se } from "react-i18next";
|
|
5
|
-
import { SafeHtml as di, sanitiseHtml as ui } from "../safe-html/index.js";
|
|
6
|
-
import { a as mi, c as fi, d as gi, b as oo } from "./ai-fab-pill-BOu96kCx.js";
|
|
7
|
-
import { u as hi } from "./registry-DvAUVLHh.js";
|
|
8
|
-
import { u as pi } from "./use-ai-sparkle-Cf4yVTLB.js";
|
|
9
|
-
import { S as Zn } from "./spinner-CoflYlEx.js";
|
|
10
|
-
import { A as bi } from "./ai-sparkle-D23NT8Z_.js";
|
|
11
|
-
import { B as Se } from "./button-Dp4j9ygh.js";
|
|
12
|
-
import { I as X } from "./icon-button-u9VMQn3x.js";
|
|
13
|
-
import { A as vi } from "./ai-permission-notice-C_YB3MBA.js";
|
|
14
|
-
import { T as yi } from "./text-area-COMVJ1yE.js";
|
|
15
|
-
import { E as Bn } from "./editor-overlay-jc9HUeQ2.js";
|
|
16
|
-
import { u as wi } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
17
|
-
import { X as ki } from "./x-B5YnXwCz.js";
|
|
18
|
-
import { R as xi } from "./rotate-ccw-BBQnIVTr.js";
|
|
19
|
-
import { C as Ci } from "./check-DrFSN__t.js";
|
|
20
|
-
import { L as Fn } from "./loader-circle-BECIU_8N.js";
|
|
21
|
-
import { S as $t } from "./square-DASBRZ0U.js";
|
|
22
|
-
import { M as jn } from "./mic-CUklMZGF.js";
|
|
23
|
-
import { S as Ai } from "./send-C5kDJ-Mz.js";
|
|
24
|
-
import { D as j } from "./dropdown-menu-Bm1KALnk.js";
|
|
25
|
-
import * as sn from "@radix-ui/react-popover";
|
|
26
|
-
import { u as Ni, f as Ti } from "./non-modal-tab-exit-DqJao_E-.js";
|
|
27
|
-
import { V as io } from "./variables-menu-C4NcClKi.js";
|
|
28
|
-
import { a as Qn } from "./tooltip-uEBdD1-5.js";
|
|
29
|
-
import { P as ae } from "./popover-C9O7my6h.js";
|
|
30
|
-
import { D as de } from "./dialog-239Geb7Z.js";
|
|
31
|
-
import { C as Jn } from "./color-picker-5FKOk_z1.js";
|
|
32
|
-
import { S as mn } from "./state-backed-text-input-DVETOhSS.js";
|
|
33
|
-
import { C as Ei } from "./checkbox-DV4sNDeB.js";
|
|
34
|
-
import { F as Ri } from "./file-upload-DQc0LsBM.js";
|
|
35
|
-
import { c as O } from "./createLucideIcon-DhHxpK9K.js";
|
|
36
|
-
import { E as Mi } from "./ellipsis-dRo9ouSU.js";
|
|
37
|
-
import { H as Si } from "./highlighter-DSkckT2Q.js";
|
|
38
|
-
import { C as Yn } from "./chevron-down-DWE7GSq9.js";
|
|
39
|
-
import { I as zi } from "./image-B_5MNK0x.js";
|
|
40
|
-
import { P as Li } from "./plus-DzMQ_c6b.js";
|
|
41
|
-
import { S as _i } from "./settings-d25ju_6L.js";
|
|
42
|
-
import { U as Ii } from "./undo-2-EBxWjj1W.js";
|
|
43
|
-
import { T as $i } from "./trash-2-uumy3fy1.js";
|
|
44
|
-
import { u as Hi, w as pt } from "./ai-credits-notice-B6buIgmV.js";
|
|
45
|
-
/**
|
|
46
|
-
* @license lucide-react v1.22.0 - ISC
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the ISC license.
|
|
49
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/
|
|
51
|
-
const Oi = [
|
|
52
|
-
["path", { d: "M4 20h16", key: "14thso" }],
|
|
53
|
-
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
54
|
-
["path", { d: "M8 12h8", key: "1wcyev" }]
|
|
55
|
-
], Di = O("baseline", Oi);
|
|
56
|
-
/**
|
|
57
|
-
* @license lucide-react v1.22.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/
|
|
62
|
-
const Pi = [
|
|
63
|
-
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
|
|
64
|
-
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
|
|
65
|
-
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
|
|
66
|
-
], qi = O("between-horizontal-end", Pi);
|
|
67
|
-
/**
|
|
68
|
-
* @license lucide-react v1.22.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/
|
|
73
|
-
const Bi = [
|
|
74
|
-
["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
|
|
75
|
-
["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
|
|
76
|
-
["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
|
|
77
|
-
], Fi = O("between-horizontal-start", Bi);
|
|
78
|
-
/**
|
|
79
|
-
* @license lucide-react v1.22.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/
|
|
84
|
-
const ji = [
|
|
85
|
-
["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
|
|
86
|
-
["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
|
|
87
|
-
["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
|
|
88
|
-
], Gi = O("between-vertical-end", ji);
|
|
89
|
-
/**
|
|
90
|
-
* @license lucide-react v1.22.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/
|
|
95
|
-
const Ki = [
|
|
96
|
-
["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
|
|
97
|
-
["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
|
|
98
|
-
["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
|
|
99
|
-
], Vi = O("between-vertical-start", Ki);
|
|
100
|
-
/**
|
|
101
|
-
* @license lucide-react v1.22.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/
|
|
106
|
-
const Wi = [
|
|
107
|
-
[
|
|
108
|
-
"path",
|
|
109
|
-
{
|
|
110
|
-
d: "M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",
|
|
111
|
-
key: "1ah6g2"
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
["rect", { x: "14", y: "2", width: "8", height: "8", rx: "1", key: "88lufb" }]
|
|
115
|
-
], Gn = O("blocks", Wi);
|
|
116
|
-
/**
|
|
117
|
-
* @license lucide-react v1.22.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/
|
|
122
|
-
const Xi = [
|
|
123
|
-
[
|
|
124
|
-
"path",
|
|
125
|
-
{ 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" }
|
|
126
|
-
]
|
|
127
|
-
], Ui = O("bold", Xi);
|
|
128
|
-
/**
|
|
129
|
-
* @license lucide-react v1.22.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/
|
|
134
|
-
const Zi = [
|
|
135
|
-
[
|
|
136
|
-
"path",
|
|
137
|
-
{ 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" }
|
|
138
|
-
],
|
|
139
|
-
[
|
|
140
|
-
"path",
|
|
141
|
-
{
|
|
142
|
-
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",
|
|
143
|
-
key: "e1hn23"
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
], Qi = O("braces", Zi);
|
|
147
|
-
/**
|
|
148
|
-
* @license lucide-react v1.22.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/
|
|
153
|
-
const Ji = [
|
|
154
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
155
|
-
["path", { d: "M12 3v18", key: "108xh3" }]
|
|
156
|
-
], Yi = O("columns-2", Ji);
|
|
157
|
-
/**
|
|
158
|
-
* @license lucide-react v1.22.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/
|
|
163
|
-
const ea = [
|
|
164
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
165
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
166
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
167
|
-
["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
|
|
168
|
-
], ta = O("heading-2", ea);
|
|
169
|
-
/**
|
|
170
|
-
* @license lucide-react v1.22.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/
|
|
175
|
-
const na = [
|
|
176
|
-
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
177
|
-
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
178
|
-
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
179
|
-
["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
|
|
180
|
-
["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
|
|
181
|
-
], ra = O("heading-3", na);
|
|
182
|
-
/**
|
|
183
|
-
* @license lucide-react v1.22.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/
|
|
188
|
-
const oa = [
|
|
189
|
-
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
190
|
-
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
191
|
-
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
192
|
-
], ia = O("italic", oa);
|
|
193
|
-
/**
|
|
194
|
-
* @license lucide-react v1.22.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/
|
|
199
|
-
const aa = [
|
|
200
|
-
["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" }],
|
|
201
|
-
["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" }]
|
|
202
|
-
], sa = O("link", aa);
|
|
203
|
-
/**
|
|
204
|
-
* @license lucide-react v1.22.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/
|
|
209
|
-
const la = [
|
|
210
|
-
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
211
|
-
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
212
|
-
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
213
|
-
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
214
|
-
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
215
|
-
["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" }]
|
|
216
|
-
], ca = O("list-ordered", la);
|
|
217
|
-
/**
|
|
218
|
-
* @license lucide-react v1.22.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/
|
|
223
|
-
const da = [
|
|
224
|
-
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
225
|
-
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
226
|
-
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
227
|
-
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
228
|
-
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
229
|
-
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
230
|
-
], ua = O("list", da);
|
|
231
|
-
/**
|
|
232
|
-
* @license lucide-react v1.22.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/
|
|
237
|
-
const ma = [
|
|
238
|
-
["path", { d: "M11 7 6 2", key: "1jwth8" }],
|
|
239
|
-
["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
|
|
240
|
-
[
|
|
241
|
-
"path",
|
|
242
|
-
{
|
|
243
|
-
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",
|
|
244
|
-
key: "1nkol4"
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
[
|
|
248
|
-
"path",
|
|
249
|
-
{
|
|
250
|
-
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",
|
|
251
|
-
key: "1nk1rd"
|
|
252
|
-
}
|
|
253
|
-
]
|
|
254
|
-
], fa = O("paint-bucket", ma);
|
|
255
|
-
/**
|
|
256
|
-
* @license lucide-react v1.22.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/
|
|
261
|
-
const ga = [
|
|
262
|
-
["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
|
|
263
|
-
["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" }],
|
|
264
|
-
["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
|
|
265
|
-
], ha = O("paint-roller", ga);
|
|
266
|
-
/**
|
|
267
|
-
* @license lucide-react v1.22.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/
|
|
272
|
-
const pa = [
|
|
273
|
-
[
|
|
274
|
-
"path",
|
|
275
|
-
{
|
|
276
|
-
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",
|
|
277
|
-
key: "e79jfc"
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
|
|
281
|
-
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
282
|
-
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
283
|
-
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
284
|
-
], ba = O("palette", pa);
|
|
285
|
-
/**
|
|
286
|
-
* @license lucide-react v1.22.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/
|
|
291
|
-
const va = [
|
|
292
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
293
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
294
|
-
], ya = O("panel-left", va);
|
|
295
|
-
/**
|
|
296
|
-
* @license lucide-react v1.22.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/
|
|
301
|
-
const wa = [
|
|
302
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
303
|
-
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
304
|
-
], ka = O("panel-right", wa);
|
|
305
|
-
/**
|
|
306
|
-
* @license lucide-react v1.22.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/
|
|
311
|
-
const xa = [
|
|
312
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
313
|
-
["path", { d: "M14 9h1", key: "l0svgy" }],
|
|
314
|
-
["path", { d: "M19 9h2", key: "te2zfg" }],
|
|
315
|
-
["path", { d: "M3 9h2", key: "1h4ldw" }],
|
|
316
|
-
["path", { d: "M9 9h1", key: "15jzuz" }]
|
|
317
|
-
], Ca = O("panel-top-dashed", xa);
|
|
318
|
-
/**
|
|
319
|
-
* @license lucide-react v1.22.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/
|
|
324
|
-
const Aa = [
|
|
325
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
326
|
-
["path", { d: "M3 9h18", key: "1pudct" }]
|
|
327
|
-
], Na = O("panel-top", Aa);
|
|
328
|
-
/**
|
|
329
|
-
* @license lucide-react v1.22.0 - ISC
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the ISC license.
|
|
332
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/
|
|
334
|
-
const Ta = [
|
|
335
|
-
["path", { d: "M10 3H8", key: "mzdi2d" }],
|
|
336
|
-
["path", { d: "m15.007 5.008 3.987 3.986", key: "1scubj" }],
|
|
337
|
-
["path", { d: "M20 15v4", key: "nmhudv" }],
|
|
338
|
-
[
|
|
339
|
-
"path",
|
|
340
|
-
{
|
|
341
|
-
d: "M21.174 6.813a2.82 2.82 0 0 0-3.986-3.987L3.842 16.175a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
342
|
-
key: "fs0856"
|
|
343
|
-
}
|
|
344
|
-
],
|
|
345
|
-
["path", { d: "M22 17h-4", key: "1sj068" }],
|
|
346
|
-
["path", { d: "M4 5v4", key: "13jjxc" }],
|
|
347
|
-
["path", { d: "M6 7H2", key: "8zbtv0" }],
|
|
348
|
-
["path", { d: "M9 2v2", key: "165o2o" }]
|
|
349
|
-
], qr = O("pencil-sparkles", Ta);
|
|
350
|
-
/**
|
|
351
|
-
* @license lucide-react v1.22.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/
|
|
356
|
-
const Ea = [
|
|
357
|
-
["path", { d: "M13 4v16", key: "8vvj80" }],
|
|
358
|
-
["path", { d: "M17 4v16", key: "7dpous" }],
|
|
359
|
-
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
|
|
360
|
-
], Ra = O("pilcrow", Ea);
|
|
361
|
-
/**
|
|
362
|
-
* @license lucide-react v1.22.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/
|
|
367
|
-
const Ma = [
|
|
368
|
-
[
|
|
369
|
-
"path",
|
|
370
|
-
{
|
|
371
|
-
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",
|
|
372
|
-
key: "rib7q0"
|
|
373
|
-
}
|
|
374
|
-
],
|
|
375
|
-
[
|
|
376
|
-
"path",
|
|
377
|
-
{
|
|
378
|
-
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",
|
|
379
|
-
key: "1ymkrd"
|
|
380
|
-
}
|
|
381
|
-
]
|
|
382
|
-
], Sa = O("quote", Ma);
|
|
383
|
-
/**
|
|
384
|
-
* @license lucide-react v1.22.0 - ISC
|
|
385
|
-
*
|
|
386
|
-
* This source code is licensed under the ISC license.
|
|
387
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
-
*/
|
|
389
|
-
const za = [
|
|
390
|
-
["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
|
|
391
|
-
["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
|
|
392
|
-
], La = O("redo-2", za);
|
|
393
|
-
/**
|
|
394
|
-
* @license lucide-react v1.22.0 - ISC
|
|
395
|
-
*
|
|
396
|
-
* This source code is licensed under the ISC license.
|
|
397
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
-
*/
|
|
399
|
-
const _a = [
|
|
400
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
401
|
-
["path", { d: "M3 12h18", key: "1i2n21" }]
|
|
402
|
-
], Ia = O("rows-2", _a);
|
|
403
|
-
/**
|
|
404
|
-
* @license lucide-react v1.22.0 - ISC
|
|
405
|
-
*
|
|
406
|
-
* This source code is licensed under the ISC license.
|
|
407
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
-
*/
|
|
409
|
-
const $a = [
|
|
410
|
-
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
|
|
411
|
-
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
412
|
-
["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
|
|
413
|
-
], Br = O("spell-check", $a);
|
|
414
|
-
/**
|
|
415
|
-
* @license lucide-react v1.22.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/
|
|
420
|
-
const Ha = [
|
|
421
|
-
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
422
|
-
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
423
|
-
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
424
|
-
], Oa = O("strikethrough", Ha);
|
|
425
|
-
/**
|
|
426
|
-
* @license lucide-react v1.22.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/
|
|
431
|
-
const Da = [
|
|
432
|
-
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
433
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
434
|
-
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
435
|
-
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
436
|
-
], Pa = O("table", Da);
|
|
437
|
-
/**
|
|
438
|
-
* @license lucide-react v1.22.0 - ISC
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the ISC license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/
|
|
443
|
-
const qa = [
|
|
444
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
445
|
-
["path", { d: "M17 12H7", key: "16if0g" }],
|
|
446
|
-
["path", { d: "M19 19H5", key: "vjpgq2" }]
|
|
447
|
-
], ao = O("text-align-center", qa);
|
|
448
|
-
/**
|
|
449
|
-
* @license lucide-react v1.22.0 - ISC
|
|
450
|
-
*
|
|
451
|
-
* This source code is licensed under the ISC license.
|
|
452
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
-
*/
|
|
454
|
-
const Ba = [
|
|
455
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
456
|
-
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
457
|
-
["path", { d: "M21 19H7", key: "4cu937" }]
|
|
458
|
-
], so = O("text-align-end", Ba);
|
|
459
|
-
/**
|
|
460
|
-
* @license lucide-react v1.22.0 - ISC
|
|
461
|
-
*
|
|
462
|
-
* This source code is licensed under the ISC license.
|
|
463
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/
|
|
465
|
-
const Fa = [
|
|
466
|
-
["path", { d: "M3 5h18", key: "1u36vt" }],
|
|
467
|
-
["path", { d: "M3 12h18", key: "1i2n21" }],
|
|
468
|
-
["path", { d: "M3 19h18", key: "awlh7x" }]
|
|
469
|
-
], ja = O("text-align-justify", Fa);
|
|
470
|
-
/**
|
|
471
|
-
* @license lucide-react v1.22.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/
|
|
476
|
-
const Ga = [
|
|
477
|
-
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
478
|
-
["path", { d: "M15 12H3", key: "6jk70r" }],
|
|
479
|
-
["path", { d: "M17 19H3", key: "z6ezky" }]
|
|
480
|
-
], lo = O("text-align-start", Ga);
|
|
481
|
-
/**
|
|
482
|
-
* @license lucide-react v1.22.0 - ISC
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the ISC license.
|
|
485
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/
|
|
487
|
-
const Ka = [
|
|
488
|
-
["rect", { width: "18", height: "12", x: "3", y: "8", rx: "1", key: "158fvp" }],
|
|
489
|
-
["path", { d: "M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3", key: "s0042v" }],
|
|
490
|
-
["path", { d: "M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3", key: "9wmeh2" }]
|
|
491
|
-
], Kn = O("toy-brick", Ka);
|
|
492
|
-
/**
|
|
493
|
-
* @license lucide-react v1.22.0 - ISC
|
|
494
|
-
*
|
|
495
|
-
* This source code is licensed under the ISC license.
|
|
496
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
497
|
-
*/
|
|
498
|
-
const Va = [
|
|
499
|
-
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
|
|
500
|
-
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
|
|
501
|
-
], Wa = O("underline", Va);
|
|
502
|
-
/**
|
|
503
|
-
* @license lucide-react v1.22.0 - ISC
|
|
504
|
-
*
|
|
505
|
-
* This source code is licensed under the ISC license.
|
|
506
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
507
|
-
*/
|
|
508
|
-
const Xa = [
|
|
509
|
-
[
|
|
510
|
-
"path",
|
|
511
|
-
{
|
|
512
|
-
d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
|
|
513
|
-
key: "ul74o6"
|
|
514
|
-
}
|
|
515
|
-
],
|
|
516
|
-
["path", { d: "m14 7 3 3", key: "1r5n42" }],
|
|
517
|
-
["path", { d: "M5 6v4", key: "ilb8ba" }],
|
|
518
|
-
["path", { d: "M19 14v4", key: "blhpug" }],
|
|
519
|
-
["path", { d: "M10 2v2", key: "7u0qdc" }],
|
|
520
|
-
["path", { d: "M7 8H3", key: "zfb6yr" }],
|
|
521
|
-
["path", { d: "M21 16h-4", key: "1cnmox" }],
|
|
522
|
-
["path", { d: "M11 3H9", key: "1obp7u" }]
|
|
523
|
-
], Fr = O("wand-sparkles", Xa);
|
|
524
|
-
function jr(r) {
|
|
525
|
-
return {
|
|
526
|
-
format: r("editor.vendor.format"),
|
|
527
|
-
image: r("editor.vendor.image"),
|
|
528
|
-
file: r("editor.vendor.file"),
|
|
529
|
-
link: r("editor.vendor.link"),
|
|
530
|
-
bold: r("editor.bold"),
|
|
531
|
-
italic: r("editor.italic"),
|
|
532
|
-
deleted: r("editor.strike"),
|
|
533
|
-
underline: r("editor.underline"),
|
|
534
|
-
superscript: r("editor.vendor.superscript"),
|
|
535
|
-
subscript: r("editor.vendor.subscript"),
|
|
536
|
-
"bold-abbr": r("editor.vendor.boldAbbr"),
|
|
537
|
-
"italic-abbr": r("editor.vendor.italicAbbr"),
|
|
538
|
-
"deleted-abbr": r("editor.vendor.deletedAbbr"),
|
|
539
|
-
"underline-abbr": r("editor.vendor.underlineAbbr"),
|
|
540
|
-
"superscript-abbr": r("editor.vendor.superscriptAbbr"),
|
|
541
|
-
"subscript-abbr": r("editor.vendor.subscriptAbbr"),
|
|
542
|
-
lists: r("editor.vendor.lists"),
|
|
543
|
-
"link-insert": r("editor.link.insert"),
|
|
544
|
-
"link-edit": r("editor.link.edit"),
|
|
545
|
-
"link-in-new-tab": r("editor.vendor.linkInNewTab"),
|
|
546
|
-
unlink: r("editor.vendor.unlink"),
|
|
547
|
-
cancel: r("common.cancel"),
|
|
548
|
-
close: r("common.close"),
|
|
549
|
-
insert: r("editor.link.insertAction"),
|
|
550
|
-
save: r("common.save"),
|
|
551
|
-
delete: r("common.delete"),
|
|
552
|
-
text: r("editor.vendor.text"),
|
|
553
|
-
edit: r("editor.vendor.edit"),
|
|
554
|
-
title: r("editor.image.alt"),
|
|
555
|
-
paragraph: r("editor.vendor.paragraph"),
|
|
556
|
-
quote: r("editor.quote"),
|
|
557
|
-
code: r("editor.vendor.code"),
|
|
558
|
-
heading1: r("editor.vendor.heading1"),
|
|
559
|
-
heading2: r("editor.heading2"),
|
|
560
|
-
heading3: r("editor.heading3"),
|
|
561
|
-
heading4: r("editor.vendor.heading4"),
|
|
562
|
-
heading5: r("editor.vendor.heading5"),
|
|
563
|
-
heading6: r("editor.vendor.heading6"),
|
|
564
|
-
filename: r("editor.vendor.filename"),
|
|
565
|
-
optional: r("common.optional"),
|
|
566
|
-
unorderedlist: r("editor.vendor.unorderedlist"),
|
|
567
|
-
orderedlist: r("editor.vendor.orderedlist"),
|
|
568
|
-
outdent: r("editor.vendor.outdent"),
|
|
569
|
-
indent: r("editor.vendor.indent"),
|
|
570
|
-
horizontalrule: r("editor.vendor.horizontalrule"),
|
|
571
|
-
upload: r("editor.image.upload"),
|
|
572
|
-
"upload-label": r("editor.vendor.uploadLabel"),
|
|
573
|
-
"accessibility-help-label": r("editor.regionLabel"),
|
|
574
|
-
caption: r("editor.vendor.caption"),
|
|
575
|
-
bulletslist: r("editor.vendor.bulletslist"),
|
|
576
|
-
numberslist: r("editor.vendor.numberslist"),
|
|
577
|
-
"image-position": r("editor.vendor.imagePosition"),
|
|
578
|
-
none: r("editor.vendor.none"),
|
|
579
|
-
left: r("editor.vendor.left"),
|
|
580
|
-
right: r("editor.vendor.right"),
|
|
581
|
-
center: r("editor.vendor.center"),
|
|
582
|
-
undo: r("editor.undo"),
|
|
583
|
-
redo: r("editor.redo"),
|
|
584
|
-
size: r("editor.vendor.fontSize"),
|
|
585
|
-
"remove-size": r("editor.vendor.removeSize"),
|
|
586
|
-
fontcolor: r("editor.textColor"),
|
|
587
|
-
highlight: r("editor.highlightColor"),
|
|
588
|
-
table: r("editor.vendor.table"),
|
|
589
|
-
"insert-table": r("editor.table.insert"),
|
|
590
|
-
"insert-row-above": r("editor.table.rowAbove"),
|
|
591
|
-
"insert-row-below": r("editor.table.rowBelow"),
|
|
592
|
-
"insert-column-left": r("editor.table.columnLeft"),
|
|
593
|
-
"insert-column-right": r("editor.table.columnRight"),
|
|
594
|
-
"add-head": r("editor.table.addHeader"),
|
|
595
|
-
"delete-head": r("editor.table.deleteHeader"),
|
|
596
|
-
"delete-column": r("editor.table.deleteColumn"),
|
|
597
|
-
"delete-row": r("editor.table.deleteRow"),
|
|
598
|
-
"delete-table": r("editor.table.deleteTable")
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
const Ua = {
|
|
602
|
-
id: "rich-text-editor",
|
|
603
|
-
capabilities: ["edit_inline"],
|
|
604
|
-
state: {
|
|
605
|
-
html: {
|
|
606
|
-
type: "string",
|
|
607
|
-
descriptionKey: "ui.agent.richTextEditor.state.html",
|
|
608
|
-
description: "Sanitised HTML representation of the editor content.",
|
|
609
|
-
read: (r) => r.getHTML()
|
|
610
|
-
},
|
|
611
|
-
text: {
|
|
612
|
-
type: "string",
|
|
613
|
-
descriptionKey: "ui.agent.richTextEditor.state.text",
|
|
614
|
-
description: "Plain-text content of the editor (tags stripped).",
|
|
615
|
-
read: (r) => r.getText()
|
|
616
|
-
},
|
|
617
|
-
markdown: {
|
|
618
|
-
type: "string",
|
|
619
|
-
descriptionKey: "ui.agent.richTextEditor.state.markdown",
|
|
620
|
-
description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
|
|
621
|
-
read: (r) => r.getMarkdown()
|
|
622
|
-
},
|
|
623
|
-
aiBusy: {
|
|
624
|
-
type: "boolean",
|
|
625
|
-
descriptionKey: "ui.agent.richTextEditor.state.aiBusy",
|
|
626
|
-
description: "True while a one-shot AI action (a practice template, spelling or auto-format) is rewriting the note. Read `html` once it is false.",
|
|
627
|
-
read: (r) => r.isAiBusy()
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
|
-
// Image wrap/align/resize are intentionally NOT agent actions — they target
|
|
631
|
-
// the ephemeral click-selected image the handle can't address. Agents emit
|
|
632
|
-
// `<img class="wysiwyg-img-*" style="width:N%">` via set_content instead.
|
|
633
|
-
actions: {
|
|
634
|
-
set_content: {
|
|
635
|
-
// Replaces the whole document — discards whatever the user had typed.
|
|
636
|
-
safety: "destructive",
|
|
637
|
-
argsType: "{ html: string }",
|
|
638
|
-
argsSchema: {
|
|
639
|
-
type: "object",
|
|
640
|
-
properties: {
|
|
641
|
-
html: {
|
|
642
|
-
type: "string",
|
|
643
|
-
description: "Replacement HTML (sanitised via DOMPurify)."
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
required: ["html"]
|
|
647
|
-
},
|
|
648
|
-
idempotent: !0,
|
|
649
|
-
descriptionKey: "ui.agent.richTextEditor.actions.setContent",
|
|
650
|
-
description: "Replace the editor content. Loses unsaved input.",
|
|
651
|
-
invoke: (r, a) => {
|
|
652
|
-
r.setContent(a.html);
|
|
653
|
-
}
|
|
654
|
-
},
|
|
655
|
-
insert_at_cursor: {
|
|
656
|
-
// Reversible via the editor's own undo stack — write, not destructive.
|
|
657
|
-
safety: "write",
|
|
658
|
-
argsType: "{ content: string; asHtml?: boolean }",
|
|
659
|
-
argsSchema: {
|
|
660
|
-
type: "object",
|
|
661
|
-
properties: {
|
|
662
|
-
content: {
|
|
663
|
-
type: "string",
|
|
664
|
-
description: "Content to insert at the caret."
|
|
665
|
-
},
|
|
666
|
-
asHtml: {
|
|
667
|
-
type: "boolean",
|
|
668
|
-
description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
required: ["content"]
|
|
672
|
-
},
|
|
673
|
-
descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
|
|
674
|
-
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.",
|
|
675
|
-
examples: [
|
|
676
|
-
{
|
|
677
|
-
args: { content: "{{patient.firstName}}", asHtml: !1 },
|
|
678
|
-
note: "Insert a merge variable as plain text."
|
|
679
|
-
}
|
|
680
|
-
],
|
|
681
|
-
invoke: (r, a) => {
|
|
682
|
-
r.insertAtCursor(a.content, { asHtml: a.asHtml });
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
apply_format: {
|
|
686
|
-
// Reversible via undo — write, not destructive.
|
|
687
|
-
safety: "write",
|
|
688
|
-
argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
|
|
689
|
-
argsSchema: {
|
|
690
|
-
type: "object",
|
|
691
|
-
properties: {
|
|
692
|
-
format: {
|
|
693
|
-
type: "string",
|
|
694
|
-
enum: [
|
|
695
|
-
"bold",
|
|
696
|
-
"italic",
|
|
697
|
-
"strikethrough",
|
|
698
|
-
"bulletedList",
|
|
699
|
-
"numberedList",
|
|
700
|
-
"heading",
|
|
701
|
-
"quote",
|
|
702
|
-
"paragraph"
|
|
703
|
-
],
|
|
704
|
-
description: "Block or inline format to toggle/apply."
|
|
705
|
-
}
|
|
706
|
-
},
|
|
707
|
-
required: ["format"]
|
|
708
|
-
},
|
|
709
|
-
descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
|
|
710
|
-
description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
|
|
711
|
-
examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
|
|
712
|
-
invoke: (r, a) => {
|
|
713
|
-
r.applyFormat(a.format);
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
clear: {
|
|
717
|
-
// Empties the document — loses unsaved input.
|
|
718
|
-
safety: "destructive",
|
|
719
|
-
idempotent: !0,
|
|
720
|
-
descriptionKey: "ui.agent.richTextEditor.actions.clear",
|
|
721
|
-
description: "Empty the editor. Loses unsaved input.",
|
|
722
|
-
invoke: (r) => {
|
|
723
|
-
r.clear();
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
focus: {
|
|
727
|
-
safety: "read",
|
|
728
|
-
idempotent: !0,
|
|
729
|
-
descriptionKey: "ui.agent.richTextEditor.actions.focus",
|
|
730
|
-
description: "Move keyboard focus to the editor surface.",
|
|
731
|
-
invoke: (r) => {
|
|
732
|
-
r.focus();
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
},
|
|
736
|
-
domHooks: {
|
|
737
|
-
root: { attr: "data-component", value: "rich-text-editor" },
|
|
738
|
-
instanceId: {
|
|
739
|
-
attr: "data-component-id",
|
|
740
|
-
sourceProp: "id",
|
|
741
|
-
description: "Sourced from the id prop."
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}, Za = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", bt = "ds:!size-[var(--min-target-size)]", Qa = 384, Ja = "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", Gr = wt("ds:flex ds:gap-[var(--spacing-sm)]", {
|
|
745
|
-
variants: { stacked: { true: "ds:flex-col", false: "ds:items-center" } }
|
|
746
|
-
}), Kr = wt("ds:min-w-0", {
|
|
747
|
-
variants: { stacked: { true: "", false: "ds:flex-1" } }
|
|
748
|
-
}), Vr = wt(
|
|
749
|
-
"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
750
|
-
{ variants: { stacked: { true: "ds:justify-end", false: "" } } }
|
|
751
|
-
), Ya = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", es = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]";
|
|
752
|
-
function co({ id: r }) {
|
|
753
|
-
const { t: a } = se("ui");
|
|
754
|
-
return /* @__PURE__ */ t(
|
|
755
|
-
"p",
|
|
756
|
-
{
|
|
757
|
-
"data-component": "editor-request-error",
|
|
758
|
-
id: r,
|
|
759
|
-
role: "alert",
|
|
760
|
-
className: es,
|
|
761
|
-
children: a("editor.ai.error")
|
|
762
|
-
}
|
|
763
|
-
);
|
|
764
|
-
}
|
|
765
|
-
const Wr = [
|
|
766
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
767
|
-
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
768
|
-
"ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
|
|
769
|
-
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
|
|
770
|
-
// The preview renders arbitrary model-generated rich text, and the
|
|
771
|
-
// `rich-text` SafeHtml profile allows ul/ol/li. Inside a
|
|
772
|
-
// [data-component] preflight's list reset still applies and the host
|
|
773
|
-
// undo deliberately does not reach, so markers and indent have to be
|
|
774
|
-
// asked for explicitly — otherwise a generated bullet list previews as
|
|
775
|
-
// flush, marker-less lines.
|
|
776
|
-
"ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
|
|
777
|
-
"ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
|
|
778
|
-
].join(" ");
|
|
779
|
-
function Xr(r, a) {
|
|
780
|
-
return a ? r ? /\s$/.test(r) ? `${r}${a}` : `${r} ${a}` : a : r;
|
|
781
|
-
}
|
|
782
|
-
function ts({
|
|
783
|
-
open: r,
|
|
784
|
-
onClose: a,
|
|
785
|
-
onRequestAiDraft: u,
|
|
786
|
-
onInsert: c,
|
|
787
|
-
previewAsHtml: p = !0,
|
|
788
|
-
privacyNotice: h,
|
|
789
|
-
onDictate: b
|
|
790
|
-
}) {
|
|
791
|
-
const { t: f } = se("ui"), y = Ge(), E = Ge(), [C, M] = R(""), [I, L] = R(!1), [P, g] = R(!1), [m, v] = R(null), z = x(null), [_, D] = R(!1), [K, G] = R("listening"), [B, k] = R(""), [le, F] = R(""), U = x(null), re = x(null), Y = w((W = !1) => {
|
|
792
|
-
var A;
|
|
793
|
-
re.current && (re.current.keepLate = W), (A = U.current) == null || A.abort();
|
|
794
|
-
}, []), ke = w(() => {
|
|
795
|
-
if (!b) return;
|
|
796
|
-
const W = new AbortController();
|
|
797
|
-
U.current = W;
|
|
798
|
-
const A = { keepLate: !1 };
|
|
799
|
-
re.current = A;
|
|
800
|
-
let Ee = !1;
|
|
801
|
-
const ce = () => !Ee && (!W.signal.aborted || A.keepLate);
|
|
802
|
-
D(!0), G("listening"), k(""), F(f("editor.ai.listening")), b({
|
|
803
|
-
signal: W.signal,
|
|
804
|
-
onStatus: (ge) => {
|
|
805
|
-
ce() && (G(ge), F(
|
|
806
|
-
f(ge === "connecting" ? "voiceControl.status.starting" : "editor.ai.listening")
|
|
807
|
-
));
|
|
808
|
-
},
|
|
809
|
-
onPartialTranscript: (ge) => {
|
|
810
|
-
ce() && k(ge);
|
|
811
|
-
},
|
|
812
|
-
onFinalTranscript: (ge) => {
|
|
813
|
-
if (!ce()) return;
|
|
814
|
-
const $ = ge.trim();
|
|
815
|
-
k(""), $ && (M((te) => Xr(te, $)), F($));
|
|
816
|
-
}
|
|
817
|
-
}).catch(() => {
|
|
818
|
-
}).finally(() => {
|
|
819
|
-
Ee = !0, k(""), U.current === W && (U.current = null, re.current = null, D(!1), F(""));
|
|
820
|
-
});
|
|
821
|
-
}, [b, f]), ee = w(() => {
|
|
822
|
-
_ ? Y(!0) : ke();
|
|
823
|
-
}, [_, ke, Y]);
|
|
824
|
-
H(() => {
|
|
825
|
-
var W, A;
|
|
826
|
-
r ? (M(""), L(!1), g(!1), v(null), k(""), F("")) : ((W = z.current) == null || W.abort(), z.current = null, (A = U.current) == null || A.abort());
|
|
827
|
-
}, [r]), H(
|
|
828
|
-
() => () => {
|
|
829
|
-
var W, A;
|
|
830
|
-
(W = z.current) == null || W.abort(), (A = U.current) == null || A.abort();
|
|
831
|
-
},
|
|
832
|
-
[]
|
|
833
|
-
);
|
|
834
|
-
const _e = w(() => {
|
|
835
|
-
var Ee;
|
|
836
|
-
const W = C.trim();
|
|
837
|
-
if (!W || I) return;
|
|
838
|
-
Y(), (Ee = z.current) == null || Ee.abort();
|
|
839
|
-
const A = new AbortController();
|
|
840
|
-
z.current = A, g(!1), L(!0), u({ prompt: W, signal: A.signal }).then((ce) => {
|
|
841
|
-
A.signal.aborted || (v(ce), L(!1));
|
|
842
|
-
}).catch((ce) => {
|
|
843
|
-
A.signal.aborted || ce && typeof ce == "object" && "name" in ce && ce.name === "AbortError" || (g(!0), L(!1));
|
|
844
|
-
});
|
|
845
|
-
}, [C, I, u, Y]), V = w(() => {
|
|
846
|
-
m != null && (c(m), a());
|
|
847
|
-
}, [m, c, a]), oe = x(null), [Z, Ne] = R(!1);
|
|
848
|
-
wi(() => {
|
|
849
|
-
const W = oe.current;
|
|
850
|
-
if (!r || !W) return;
|
|
851
|
-
const A = () => {
|
|
852
|
-
const ce = W.clientWidth;
|
|
853
|
-
Ne(ce > 0 && ce < Qa);
|
|
854
|
-
};
|
|
855
|
-
if (A(), typeof ResizeObserver > "u") return;
|
|
856
|
-
const Ee = new ResizeObserver(A);
|
|
857
|
-
return Ee.observe(W), () => Ee.disconnect();
|
|
858
|
-
}, [r]);
|
|
859
|
-
const kt = m != null, Te = _ && K === "connecting", xt = _ ? Xr(C, B) : C, Dt = Z ? null : /* @__PURE__ */ t(
|
|
860
|
-
X,
|
|
861
|
-
{
|
|
862
|
-
size: "md",
|
|
863
|
-
intent: "outline",
|
|
864
|
-
className: bt,
|
|
865
|
-
icon: /* @__PURE__ */ t(ki, {}),
|
|
866
|
-
"aria-label": f("common.close"),
|
|
867
|
-
onClick: a
|
|
868
|
-
}
|
|
869
|
-
);
|
|
870
|
-
return /* @__PURE__ */ t(
|
|
871
|
-
Bn,
|
|
872
|
-
{
|
|
873
|
-
open: r,
|
|
874
|
-
onClose: a,
|
|
875
|
-
title: Z ? f("editor.ai.dialogTitle") : void 0,
|
|
876
|
-
ariaLabel: f("editor.ai.dialogTitle"),
|
|
877
|
-
children: /* @__PURE__ */ t("div", { ref: oe, className: Ja, children: kt ? /* @__PURE__ */ N("div", { className: Gr({ stacked: Z }), children: [
|
|
878
|
-
Dt,
|
|
879
|
-
/* @__PURE__ */ t("div", { className: Kr({ stacked: Z }), children: p ? /* @__PURE__ */ t(
|
|
880
|
-
di,
|
|
881
|
-
{
|
|
882
|
-
html: m,
|
|
883
|
-
profile: "rich-text",
|
|
884
|
-
className: Wr,
|
|
885
|
-
tabIndex: 0,
|
|
886
|
-
"aria-label": f("editor.ai.dialogTitle")
|
|
887
|
-
}
|
|
888
|
-
) : (
|
|
889
|
-
// Focusable so a keyboard user can scroll a long draft preview
|
|
890
|
-
// (mirrors the SafeHtml preview branch above). The lint rule's
|
|
891
|
-
// tabIndex allowlist doesn't cover a scrollable, non-interactive
|
|
892
|
-
// text region.
|
|
893
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
894
|
-
/* @__PURE__ */ t("p", { className: Wr, tabIndex: 0, children: m })
|
|
895
|
-
) }),
|
|
896
|
-
/* @__PURE__ */ N("div", { className: Vr({ stacked: Z }), children: [
|
|
897
|
-
/* @__PURE__ */ t(
|
|
898
|
-
X,
|
|
899
|
-
{
|
|
900
|
-
size: "md",
|
|
901
|
-
intent: "outline",
|
|
902
|
-
className: `${bt} ds:rounded-full`,
|
|
903
|
-
icon: /* @__PURE__ */ t(xi, {}),
|
|
904
|
-
"aria-label": f("editor.ai.retry"),
|
|
905
|
-
onClick: () => v(null)
|
|
906
|
-
}
|
|
907
|
-
),
|
|
908
|
-
/* @__PURE__ */ t(
|
|
909
|
-
X,
|
|
910
|
-
{
|
|
911
|
-
size: "md",
|
|
912
|
-
intent: "primary",
|
|
913
|
-
className: `${bt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
914
|
-
icon: /* @__PURE__ */ t(Ci, {}),
|
|
915
|
-
"aria-label": f("common.confirm"),
|
|
916
|
-
onClick: V
|
|
917
|
-
}
|
|
918
|
-
)
|
|
919
|
-
] })
|
|
920
|
-
] }) : /* @__PURE__ */ N(Be, { children: [
|
|
921
|
-
/* @__PURE__ */ N("div", { className: Gr({ stacked: Z }), children: [
|
|
922
|
-
Dt,
|
|
923
|
-
/* @__PURE__ */ t("div", { className: Kr({ stacked: Z }), children: /* @__PURE__ */ t(
|
|
924
|
-
yi,
|
|
925
|
-
{
|
|
926
|
-
id: y,
|
|
927
|
-
size: "md",
|
|
928
|
-
value: xt,
|
|
929
|
-
onChange: (W) => M(W.target.value),
|
|
930
|
-
placeholder: f(_ ? Te ? "voiceControl.status.starting" : "editor.ai.listening" : "editor.ai.promptPlaceholder"),
|
|
931
|
-
"aria-label": f("editor.ai.promptLabel"),
|
|
932
|
-
autoResize: !0,
|
|
933
|
-
minRows: 1,
|
|
934
|
-
maxRows: 3,
|
|
935
|
-
readOnly: _,
|
|
936
|
-
tone: P ? "error" : "default",
|
|
937
|
-
"aria-describedby": P ? E : void 0
|
|
938
|
-
}
|
|
939
|
-
) }),
|
|
940
|
-
/* @__PURE__ */ N("div", { className: Vr({ stacked: Z }), children: [
|
|
941
|
-
b ? /* @__PURE__ */ t(
|
|
942
|
-
X,
|
|
943
|
-
{
|
|
944
|
-
size: "md",
|
|
945
|
-
intent: "outline",
|
|
946
|
-
className: _ && !Te ? `${bt} ${Za}` : bt,
|
|
947
|
-
icon: Te ? /* @__PURE__ */ t(Fn, { className: "ds:animate-spin ds:motion-reduce:animate-none" }) : _ ? /* @__PURE__ */ t($t, { className: "ds:fill-current" }) : /* @__PURE__ */ t(jn, {}),
|
|
948
|
-
"aria-pressed": _,
|
|
949
|
-
"aria-label": f(_ ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
950
|
-
onClick: ee
|
|
951
|
-
}
|
|
952
|
-
) : null,
|
|
953
|
-
/* @__PURE__ */ t(
|
|
954
|
-
X,
|
|
955
|
-
{
|
|
956
|
-
size: "md",
|
|
957
|
-
intent: "primary",
|
|
958
|
-
icon: I ? /* @__PURE__ */ t(Zn, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(Ai, {}),
|
|
959
|
-
className: `${bt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
|
|
960
|
-
disabled: I || !C.trim(),
|
|
961
|
-
"aria-busy": I || void 0,
|
|
962
|
-
"aria-label": f("editor.ai.generate"),
|
|
963
|
-
onClick: _e
|
|
964
|
-
}
|
|
965
|
-
)
|
|
966
|
-
] })
|
|
967
|
-
] }),
|
|
968
|
-
b ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: le }) : null,
|
|
969
|
-
P ? /* @__PURE__ */ t(co, { id: E }) : h ? /* @__PURE__ */ t("p", { className: Ya, children: h }) : null
|
|
970
|
-
] }) })
|
|
971
|
-
}
|
|
972
|
-
);
|
|
973
|
-
}
|
|
974
|
-
function uo(r, a) {
|
|
975
|
-
return r(a, { nsSeparator: !1, defaultValue: a });
|
|
976
|
-
}
|
|
977
|
-
const mo = {
|
|
978
|
-
// Redactor's own history. AI rewrites push onto it too (see
|
|
979
|
-
// `pushUndoState` in rich-text-editor.tsx), so Undo steps back over them.
|
|
980
|
-
undo: {
|
|
981
|
-
id: "undo",
|
|
982
|
-
icon: /* @__PURE__ */ t(Ii, {}),
|
|
983
|
-
label: ["editor.undo", "Undo"],
|
|
984
|
-
command: ["module.buffer.undo"]
|
|
985
|
-
},
|
|
986
|
-
redo: {
|
|
987
|
-
id: "redo",
|
|
988
|
-
icon: /* @__PURE__ */ t(La, {}),
|
|
989
|
-
label: ["editor.redo", "Redo"],
|
|
990
|
-
command: ["module.buffer.redo"]
|
|
991
|
-
},
|
|
992
|
-
bold: {
|
|
993
|
-
id: "bold",
|
|
994
|
-
icon: /* @__PURE__ */ t(Ui, {}),
|
|
995
|
-
label: ["editor.bold", "Bold"],
|
|
996
|
-
command: ["module.inline.format", { tag: "b" }],
|
|
997
|
-
toggle: "bold"
|
|
998
|
-
},
|
|
999
|
-
italic: {
|
|
1000
|
-
id: "italic",
|
|
1001
|
-
icon: /* @__PURE__ */ t(ia, {}),
|
|
1002
|
-
label: ["editor.italic", "Italic"],
|
|
1003
|
-
command: ["module.inline.format", { tag: "i" }],
|
|
1004
|
-
toggle: "italic"
|
|
1005
|
-
},
|
|
1006
|
-
underline: {
|
|
1007
|
-
id: "underline",
|
|
1008
|
-
icon: /* @__PURE__ */ t(Wa, {}),
|
|
1009
|
-
label: ["editor.underline", "Underline"],
|
|
1010
|
-
command: ["module.inline.format", { tag: "u" }],
|
|
1011
|
-
toggle: "underline"
|
|
1012
|
-
},
|
|
1013
|
-
strike: {
|
|
1014
|
-
id: "strike",
|
|
1015
|
-
icon: /* @__PURE__ */ t(Oa, {}),
|
|
1016
|
-
label: ["editor.strike", "Strikethrough"],
|
|
1017
|
-
command: ["module.inline.format", { tag: "del" }],
|
|
1018
|
-
toggle: "strike"
|
|
1019
|
-
},
|
|
1020
|
-
ul: {
|
|
1021
|
-
id: "ul",
|
|
1022
|
-
icon: /* @__PURE__ */ t(ua, {}),
|
|
1023
|
-
label: ["editor.list.bullet", "Bulleted list"],
|
|
1024
|
-
command: ["module.list.toggle", "ul"],
|
|
1025
|
-
toggle: "ul"
|
|
1026
|
-
},
|
|
1027
|
-
ol: {
|
|
1028
|
-
id: "ol",
|
|
1029
|
-
icon: /* @__PURE__ */ t(ca, {}),
|
|
1030
|
-
label: ["editor.list.ordered", "Numbered list"],
|
|
1031
|
-
command: ["module.list.toggle", "ol"],
|
|
1032
|
-
toggle: "ol"
|
|
1033
|
-
}
|
|
1034
|
-
}, Pn = [
|
|
1035
|
-
{
|
|
1036
|
-
id: "paragraph",
|
|
1037
|
-
tag: "p",
|
|
1038
|
-
icon: /* @__PURE__ */ t(Ra, {}),
|
|
1039
|
-
label: ["editor.paragraph", "Paragraph"]
|
|
1040
|
-
},
|
|
1041
|
-
{
|
|
1042
|
-
id: "h2",
|
|
1043
|
-
tag: "h2",
|
|
1044
|
-
icon: /* @__PURE__ */ t(ta, {}),
|
|
1045
|
-
label: ["editor.heading2", "Heading 2"]
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
id: "h3",
|
|
1049
|
-
tag: "h3",
|
|
1050
|
-
icon: /* @__PURE__ */ t(ra, {}),
|
|
1051
|
-
label: ["editor.heading3", "Heading 3"]
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
id: "quote",
|
|
1055
|
-
tag: "blockquote",
|
|
1056
|
-
icon: /* @__PURE__ */ t(Sa, {}),
|
|
1057
|
-
label: ["editor.quote", "Quote"]
|
|
1058
|
-
}
|
|
1059
|
-
], ln = [
|
|
1060
|
-
{
|
|
1061
|
-
id: "left",
|
|
1062
|
-
icon: /* @__PURE__ */ t(lo, {}),
|
|
1063
|
-
label: ["editor.align.left", "Align left"]
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
id: "center",
|
|
1067
|
-
icon: /* @__PURE__ */ t(ao, {}),
|
|
1068
|
-
label: ["editor.align.center", "Align centre"]
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
id: "right",
|
|
1072
|
-
icon: /* @__PURE__ */ t(so, {}),
|
|
1073
|
-
label: ["editor.align.right", "Align right"]
|
|
1074
|
-
},
|
|
1075
|
-
{
|
|
1076
|
-
id: "justify",
|
|
1077
|
-
icon: /* @__PURE__ */ t(ja, {}),
|
|
1078
|
-
label: ["editor.align.justify", "Justify"]
|
|
1079
|
-
}
|
|
1080
|
-
], Vn = [
|
|
1081
|
-
"p",
|
|
1082
|
-
"div",
|
|
1083
|
-
"blockquote",
|
|
1084
|
-
"pre",
|
|
1085
|
-
"h1",
|
|
1086
|
-
"h2",
|
|
1087
|
-
"h3",
|
|
1088
|
-
"h4",
|
|
1089
|
-
"h5",
|
|
1090
|
-
"h6",
|
|
1091
|
-
"li"
|
|
1092
|
-
], ns = {
|
|
1093
|
-
minimal: ["bold", "italic", "underline", "link"],
|
|
1094
|
-
standard: [
|
|
1095
|
-
"undo",
|
|
1096
|
-
"redo",
|
|
1097
|
-
"format",
|
|
1098
|
-
"bold",
|
|
1099
|
-
"italic",
|
|
1100
|
-
"underline",
|
|
1101
|
-
"strike",
|
|
1102
|
-
"align",
|
|
1103
|
-
"ul",
|
|
1104
|
-
"ol",
|
|
1105
|
-
"link"
|
|
1106
|
-
],
|
|
1107
|
-
full: [
|
|
1108
|
-
"undo",
|
|
1109
|
-
"redo",
|
|
1110
|
-
"format",
|
|
1111
|
-
"bold",
|
|
1112
|
-
"italic",
|
|
1113
|
-
"underline",
|
|
1114
|
-
"strike",
|
|
1115
|
-
"align",
|
|
1116
|
-
"ul",
|
|
1117
|
-
"ol",
|
|
1118
|
-
"link"
|
|
1119
|
-
]
|
|
1120
|
-
}, fo = [
|
|
1121
|
-
{
|
|
1122
|
-
id: "rowAbove",
|
|
1123
|
-
command: "plugin.table.addRowAbove",
|
|
1124
|
-
icon: /* @__PURE__ */ t(Fi, {}),
|
|
1125
|
-
label: ["editor.table.rowAbove", "Add row above"]
|
|
1126
|
-
},
|
|
1127
|
-
{
|
|
1128
|
-
id: "rowBelow",
|
|
1129
|
-
command: "plugin.table.addRowBelow",
|
|
1130
|
-
icon: /* @__PURE__ */ t(qi, {}),
|
|
1131
|
-
label: ["editor.table.rowBelow", "Add row below"]
|
|
1132
|
-
},
|
|
1133
|
-
{
|
|
1134
|
-
id: "colLeft",
|
|
1135
|
-
command: "plugin.table.addColumnLeft",
|
|
1136
|
-
icon: /* @__PURE__ */ t(Vi, {}),
|
|
1137
|
-
label: ["editor.table.columnLeft", "Add column left"]
|
|
1138
|
-
},
|
|
1139
|
-
{
|
|
1140
|
-
id: "colRight",
|
|
1141
|
-
command: "plugin.table.addColumnRight",
|
|
1142
|
-
icon: /* @__PURE__ */ t(Gi, {}),
|
|
1143
|
-
label: ["editor.table.columnRight", "Add column right"]
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
id: "addHead",
|
|
1147
|
-
command: "plugin.table.addHead",
|
|
1148
|
-
icon: /* @__PURE__ */ t(Na, {}),
|
|
1149
|
-
label: ["editor.table.addHeader", "Add header row"]
|
|
1150
|
-
},
|
|
1151
|
-
{
|
|
1152
|
-
id: "deleteHead",
|
|
1153
|
-
command: "plugin.table.deleteHead",
|
|
1154
|
-
icon: /* @__PURE__ */ t(Ca, {}),
|
|
1155
|
-
label: ["editor.table.deleteHeader", "Remove header row"]
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
id: "deleteRow",
|
|
1159
|
-
command: "plugin.table.deleteRow",
|
|
1160
|
-
icon: /* @__PURE__ */ t(Ia, {}),
|
|
1161
|
-
label: ["editor.table.deleteRow", "Delete row"]
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
id: "deleteColumn",
|
|
1165
|
-
command: "plugin.table.deleteColumn",
|
|
1166
|
-
icon: /* @__PURE__ */ t(Yi, {}),
|
|
1167
|
-
label: ["editor.table.deleteColumn", "Delete column"]
|
|
1168
|
-
},
|
|
1169
|
-
{
|
|
1170
|
-
id: "deleteTable",
|
|
1171
|
-
command: "plugin.table.deleteTable",
|
|
1172
|
-
icon: /* @__PURE__ */ t($i, {}),
|
|
1173
|
-
label: ["editor.table.deleteTable", "Delete table"]
|
|
1174
|
-
}
|
|
1175
|
-
], cn = 6, go = "ds:[&_[data-intent=ghost]:hover]:bg-[color-mix(in_srgb,var(--accent)_12%,transparent)] ds:[&_[data-intent=ghost]:hover]:text-[color:var(--accent)]", rs = wt(
|
|
1176
|
-
[
|
|
1177
|
-
"ds:@container/toolbar",
|
|
1178
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1179
|
-
"ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
|
|
1180
|
-
"ds:shadow-[var(--shadow-md)]",
|
|
1181
|
-
go
|
|
1182
|
-
].join(" ")
|
|
1183
|
-
), os = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", gn = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Ht = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
1184
|
-
function fn(r) {
|
|
1185
|
-
return r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1186
|
-
}
|
|
1187
|
-
function is(r) {
|
|
1188
|
-
const a = r.trim();
|
|
1189
|
-
return a && (/^([^\s/:@]+\.[^\s/:@]+|localhost):\d+([/?#]|$)/i.test(a) ? `https://${a}` : /^[a-z][a-z0-9+.-]*:/i.test(a) || /^[/#?]/.test(a) || a.startsWith("[[") ? a : /^[^\s@/]+@[^\s@/]+\.[^\s@/]+$/.test(a) ? `mailto:${a}` : `https://${a}`);
|
|
1190
|
-
}
|
|
1191
|
-
function as({
|
|
1192
|
-
variables: r,
|
|
1193
|
-
recentVariableTokens: a,
|
|
1194
|
-
insertVariable: u,
|
|
1195
|
-
saveSelection: c
|
|
1196
|
-
}) {
|
|
1197
|
-
const { t: p } = se("ui"), [h, b] = R(!1), [f, y] = R(""), E = x(null), C = x(!1), M = Ni(!0, {
|
|
1198
|
-
getAnchor: Ti,
|
|
1199
|
-
onReturnToTrigger: () => b(!1)
|
|
1200
|
-
}), I = r;
|
|
1201
|
-
return /* @__PURE__ */ N(
|
|
1202
|
-
sn.Root,
|
|
1203
|
-
{
|
|
1204
|
-
open: h,
|
|
1205
|
-
onOpenChange: (L) => {
|
|
1206
|
-
L && c(), b(L), L && y("");
|
|
1207
|
-
},
|
|
1208
|
-
children: [
|
|
1209
|
-
/* @__PURE__ */ t(sn.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1210
|
-
X,
|
|
1211
|
-
{
|
|
1212
|
-
ref: E,
|
|
1213
|
-
size: "sm",
|
|
1214
|
-
intent: "ghost",
|
|
1215
|
-
icon: /* @__PURE__ */ t(Qi, {}),
|
|
1216
|
-
"aria-label": p("editor.insertVariable", "Insert variable")
|
|
1217
|
-
}
|
|
1218
|
-
) }),
|
|
1219
|
-
/* @__PURE__ */ t(sn.Portal, { children: /* @__PURE__ */ t(
|
|
1220
|
-
sn.Content,
|
|
1221
|
-
{
|
|
1222
|
-
align: "start",
|
|
1223
|
-
sideOffset: 4,
|
|
1224
|
-
className: "ds:z-[var(--z-popover)]",
|
|
1225
|
-
onKeyDown: M,
|
|
1226
|
-
onCloseAutoFocus: (L) => {
|
|
1227
|
-
C.current && (L.preventDefault(), C.current = !1);
|
|
1228
|
-
},
|
|
1229
|
-
children: /* @__PURE__ */ t(
|
|
1230
|
-
io,
|
|
1231
|
-
{
|
|
1232
|
-
variables: I,
|
|
1233
|
-
recentTokens: a,
|
|
1234
|
-
query: f,
|
|
1235
|
-
onQueryChange: y,
|
|
1236
|
-
searchFocusable: !0,
|
|
1237
|
-
"aria-label": p("editor.insertVariable", "Insert variable"),
|
|
1238
|
-
onSelect: (L) => {
|
|
1239
|
-
C.current = !0, u(L.token), b(!1);
|
|
1240
|
-
},
|
|
1241
|
-
onClose: () => b(!1)
|
|
1242
|
-
}
|
|
1243
|
-
)
|
|
1244
|
-
}
|
|
1245
|
-
) })
|
|
1246
|
-
]
|
|
1247
|
-
}
|
|
1248
|
-
);
|
|
1249
|
-
}
|
|
1250
|
-
function ss({
|
|
1251
|
-
run: r,
|
|
1252
|
-
active: a,
|
|
1253
|
-
onTriggerDown: u
|
|
1254
|
-
}) {
|
|
1255
|
-
const { t: c } = se("ui"), p = Pn.find((h) => a.has(h.id)) ?? Pn[0];
|
|
1256
|
-
return /* @__PURE__ */ N(j.Root, { children: [
|
|
1257
|
-
/* @__PURE__ */ t(j.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1258
|
-
Se,
|
|
1259
|
-
{
|
|
1260
|
-
size: "sm",
|
|
1261
|
-
intent: "ghost",
|
|
1262
|
-
startIcon: p.icon,
|
|
1263
|
-
endIcon: /* @__PURE__ */ t(Yn, {}),
|
|
1264
|
-
"aria-label": `${c("editor.format", "Paragraph style")}: ${c(
|
|
1265
|
-
p.label[0],
|
|
1266
|
-
p.label[1]
|
|
1267
|
-
)}`,
|
|
1268
|
-
onMouseDown: u,
|
|
1269
|
-
children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: c(p.label[0], p.label[1]) })
|
|
1270
|
-
}
|
|
1271
|
-
) }),
|
|
1272
|
-
/* @__PURE__ */ t(j.Content, { align: "start", children: Pn.map((h) => /* @__PURE__ */ t(
|
|
1273
|
-
j.Item,
|
|
1274
|
-
{
|
|
1275
|
-
startIcon: h.icon,
|
|
1276
|
-
onSelect: () => r("module.block.format", { tag: h.tag }),
|
|
1277
|
-
children: c(h.label[0], h.label[1])
|
|
1278
|
-
},
|
|
1279
|
-
h.id
|
|
1280
|
-
)) })
|
|
1281
|
-
] });
|
|
1282
|
-
}
|
|
1283
|
-
function ls({
|
|
1284
|
-
run: r,
|
|
1285
|
-
active: a,
|
|
1286
|
-
onTriggerDown: u
|
|
1287
|
-
}) {
|
|
1288
|
-
const { t: c } = se("ui"), p = x(null), [h, b] = R(!1);
|
|
1289
|
-
si(() => {
|
|
1290
|
-
const M = p.current;
|
|
1291
|
-
M && b(getComputedStyle(M).direction === "rtl");
|
|
1292
|
-
}, []);
|
|
1293
|
-
const f = h ? "right" : "left", y = ln.find((M) => a.has(`align-${M.id}`)) ?? ln.find((M) => M.id === f) ?? ln[0], E = (M) => {
|
|
1294
|
-
M === f ? r("module.block.remove", { style: "text-align" }, Vn) : r("module.block.add", { style: { "text-align": M } }, Vn), M === f || M === "justify" ? r("module.block.remove", { style: "list-style-position" }, ["li"]) : r("module.block.add", { style: { "list-style-position": "inside" } }, [
|
|
1295
|
-
"li"
|
|
1296
|
-
]);
|
|
1297
|
-
}, C = `${c("editor.align.label", "Text alignment")}: ${c(
|
|
1298
|
-
y.label[0],
|
|
1299
|
-
y.label[1]
|
|
1300
|
-
)}`;
|
|
1301
|
-
return /* @__PURE__ */ N(j.Root, { children: [
|
|
1302
|
-
/* @__PURE__ */ t(j.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1303
|
-
Se,
|
|
1304
|
-
{
|
|
1305
|
-
ref: p,
|
|
1306
|
-
size: "sm",
|
|
1307
|
-
intent: "ghost",
|
|
1308
|
-
startIcon: y.icon,
|
|
1309
|
-
endIcon: /* @__PURE__ */ t(Yn, {}),
|
|
1310
|
-
"aria-label": C,
|
|
1311
|
-
onMouseDown: u
|
|
1312
|
-
}
|
|
1313
|
-
) }),
|
|
1314
|
-
/* @__PURE__ */ t(j.Content, { align: "start", children: /* @__PURE__ */ t(j.RadioGroup, { value: y.id, onValueChange: E, children: ln.map((M) => /* @__PURE__ */ t(j.RadioItem, { value: M.id, children: c(M.label[0], M.label[1]) }, M.id)) }) })
|
|
1315
|
-
] });
|
|
1316
|
-
}
|
|
1317
|
-
function cs({
|
|
1318
|
-
insertHtml: r,
|
|
1319
|
-
saveSelection: a,
|
|
1320
|
-
restoreSelection: u,
|
|
1321
|
-
getSelectedText: c
|
|
1322
|
-
}) {
|
|
1323
|
-
const { t: p } = se("ui"), [h, b] = R(!1), [f, y] = R(""), [E, C] = R(""), [M, I] = R(!1), L = Ge(), P = Ge(), g = () => {
|
|
1324
|
-
y(""), C(""), I(!1);
|
|
1325
|
-
}, m = () => {
|
|
1326
|
-
const v = f.trim();
|
|
1327
|
-
if (!v) return;
|
|
1328
|
-
const z = is(v), _ = E.trim() || v, D = M ? ' target="_blank" rel="noopener noreferrer"' : "", K = `<a href="${fn(z)}"${D}>${fn(_)}</a>`;
|
|
1329
|
-
b(!1), g(), window.requestAnimationFrame(() => {
|
|
1330
|
-
u(), r(K);
|
|
1331
|
-
});
|
|
1332
|
-
};
|
|
1333
|
-
return /* @__PURE__ */ N(de.Root, { open: h, onOpenChange: b, children: [
|
|
1334
|
-
/* @__PURE__ */ t(de.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1335
|
-
X,
|
|
1336
|
-
{
|
|
1337
|
-
size: "sm",
|
|
1338
|
-
intent: "ghost",
|
|
1339
|
-
icon: /* @__PURE__ */ t(sa, {}),
|
|
1340
|
-
"aria-label": p("editor.link.insert", "Insert link"),
|
|
1341
|
-
onMouseDown: () => {
|
|
1342
|
-
a(), C(c());
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
) }),
|
|
1346
|
-
/* @__PURE__ */ N(de.Content, { children: [
|
|
1347
|
-
/* @__PURE__ */ t(de.Header, { children: /* @__PURE__ */ t(de.Title, { children: p("editor.link.insert", "Insert link") }) }),
|
|
1348
|
-
/* @__PURE__ */ N(de.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1349
|
-
/* @__PURE__ */ N("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1350
|
-
/* @__PURE__ */ t("label", { htmlFor: L, className: Ht, children: p("editor.link.url", "URL") }),
|
|
1351
|
-
/* @__PURE__ */ t(
|
|
1352
|
-
mn,
|
|
1353
|
-
{
|
|
1354
|
-
id: L,
|
|
1355
|
-
type: "url",
|
|
1356
|
-
value: f,
|
|
1357
|
-
onChange: (v) => y(v.target.value),
|
|
1358
|
-
placeholder: "https://…"
|
|
1359
|
-
}
|
|
1360
|
-
)
|
|
1361
|
-
] }),
|
|
1362
|
-
/* @__PURE__ */ N("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1363
|
-
/* @__PURE__ */ t("label", { htmlFor: P, className: Ht, children: p("editor.link.text", "Text to display") }),
|
|
1364
|
-
/* @__PURE__ */ t(
|
|
1365
|
-
mn,
|
|
1366
|
-
{
|
|
1367
|
-
id: P,
|
|
1368
|
-
value: E,
|
|
1369
|
-
onChange: (v) => C(v.target.value),
|
|
1370
|
-
placeholder: p("editor.link.textPlaceholder", "Link text")
|
|
1371
|
-
}
|
|
1372
|
-
)
|
|
1373
|
-
] }),
|
|
1374
|
-
/* @__PURE__ */ t(
|
|
1375
|
-
Ei,
|
|
1376
|
-
{
|
|
1377
|
-
checked: M,
|
|
1378
|
-
onCheckedChange: (v) => I(v === !0),
|
|
1379
|
-
label: p("editor.link.newTab", "Open in new tab")
|
|
1380
|
-
}
|
|
1381
|
-
)
|
|
1382
|
-
] }),
|
|
1383
|
-
/* @__PURE__ */ N(de.Footer, { children: [
|
|
1384
|
-
/* @__PURE__ */ t(de.Close, { asChild: !0, children: /* @__PURE__ */ t(Se, { intent: "secondary", children: p("common.cancel") }) }),
|
|
1385
|
-
/* @__PURE__ */ t(Se, { onClick: m, disabled: !f.trim(), children: p("editor.link.insertAction", "Insert") })
|
|
1386
|
-
] })
|
|
1387
|
-
] })
|
|
1388
|
-
] });
|
|
1389
|
-
}
|
|
1390
|
-
function ds({
|
|
1391
|
-
insertHtml: r,
|
|
1392
|
-
saveSelection: a,
|
|
1393
|
-
restoreSelection: u,
|
|
1394
|
-
uploadImage: c
|
|
1395
|
-
}) {
|
|
1396
|
-
const { t: p } = se("ui"), [h, b] = R(!1), [f, y] = R(""), [E, C] = R(""), M = Ge(), I = Ge(), L = (g, m) => {
|
|
1397
|
-
const v = `<img src="${fn(g)}" alt="${fn(m)}" loading="lazy">`;
|
|
1398
|
-
b(!1), y(""), C(""), window.requestAnimationFrame(() => {
|
|
1399
|
-
u(), r(v);
|
|
1400
|
-
});
|
|
1401
|
-
}, P = () => {
|
|
1402
|
-
const g = f.trim();
|
|
1403
|
-
g && L(g, E.trim());
|
|
1404
|
-
};
|
|
1405
|
-
return /* @__PURE__ */ N(de.Root, { open: h, onOpenChange: b, children: [
|
|
1406
|
-
/* @__PURE__ */ t(de.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1407
|
-
X,
|
|
1408
|
-
{
|
|
1409
|
-
size: "sm",
|
|
1410
|
-
intent: "ghost",
|
|
1411
|
-
icon: /* @__PURE__ */ t(zi, {}),
|
|
1412
|
-
"aria-label": p("editor.image.insert", "Insert image"),
|
|
1413
|
-
onMouseDown: () => a()
|
|
1414
|
-
}
|
|
1415
|
-
) }),
|
|
1416
|
-
/* @__PURE__ */ N(de.Content, { children: [
|
|
1417
|
-
/* @__PURE__ */ t(de.Header, { children: /* @__PURE__ */ t(de.Title, { children: p("editor.image.insert", "Insert image") }) }),
|
|
1418
|
-
/* @__PURE__ */ N(de.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
1419
|
-
c ? /* @__PURE__ */ N("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1420
|
-
/* @__PURE__ */ t("span", { className: Ht, children: p("editor.image.upload", "Upload") }),
|
|
1421
|
-
/* @__PURE__ */ t(
|
|
1422
|
-
Ri,
|
|
1423
|
-
{
|
|
1424
|
-
variant: "dropzone",
|
|
1425
|
-
accept: {
|
|
1426
|
-
"image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
|
|
1427
|
-
},
|
|
1428
|
-
maxFiles: 1,
|
|
1429
|
-
onUpload: async (g, { signal: m }) => {
|
|
1430
|
-
const v = await c(g, m);
|
|
1431
|
-
L(v, g.name);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
),
|
|
1435
|
-
/* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: p("editor.image.orUrl", "Or paste an image URL") })
|
|
1436
|
-
] }) : null,
|
|
1437
|
-
/* @__PURE__ */ N("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1438
|
-
/* @__PURE__ */ t("label", { htmlFor: M, className: Ht, children: p("editor.image.url", "Image URL") }),
|
|
1439
|
-
/* @__PURE__ */ t(
|
|
1440
|
-
mn,
|
|
1441
|
-
{
|
|
1442
|
-
id: M,
|
|
1443
|
-
type: "url",
|
|
1444
|
-
value: f,
|
|
1445
|
-
onChange: (g) => y(g.target.value),
|
|
1446
|
-
placeholder: "https://…"
|
|
1447
|
-
}
|
|
1448
|
-
)
|
|
1449
|
-
] }),
|
|
1450
|
-
/* @__PURE__ */ N("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
1451
|
-
/* @__PURE__ */ t("label", { htmlFor: I, className: Ht, children: p("editor.image.alt", "Alt text") }),
|
|
1452
|
-
/* @__PURE__ */ t(
|
|
1453
|
-
mn,
|
|
1454
|
-
{
|
|
1455
|
-
id: I,
|
|
1456
|
-
value: E,
|
|
1457
|
-
onChange: (g) => C(g.target.value),
|
|
1458
|
-
placeholder: p(
|
|
1459
|
-
"editor.image.altPlaceholder",
|
|
1460
|
-
"Describe the image"
|
|
1461
|
-
)
|
|
1462
|
-
}
|
|
1463
|
-
)
|
|
1464
|
-
] })
|
|
1465
|
-
] }),
|
|
1466
|
-
/* @__PURE__ */ N(de.Footer, { children: [
|
|
1467
|
-
/* @__PURE__ */ t(de.Close, { asChild: !0, children: /* @__PURE__ */ t(Se, { intent: "secondary", children: p("common.cancel") }) }),
|
|
1468
|
-
/* @__PURE__ */ t(Se, { onClick: P, disabled: !f.trim(), children: p("editor.image.insertAction", "Insert") })
|
|
1469
|
-
] })
|
|
1470
|
-
] })
|
|
1471
|
-
] });
|
|
1472
|
-
}
|
|
1473
|
-
function us({
|
|
1474
|
-
run: r,
|
|
1475
|
-
saveSelection: a,
|
|
1476
|
-
restoreSelection: u
|
|
1477
|
-
}) {
|
|
1478
|
-
const { t: c } = se("ui"), [p, h] = R("#1f2a5c"), b = (y) => {
|
|
1479
|
-
h(y), u(), r("module.inline.format", {
|
|
1480
|
-
tag: "span",
|
|
1481
|
-
style: { color: y },
|
|
1482
|
-
type: "toggle"
|
|
1483
|
-
});
|
|
1484
|
-
}, f = () => {
|
|
1485
|
-
u(), r("module.inline.remove", { style: "color" });
|
|
1486
|
-
};
|
|
1487
|
-
return /* @__PURE__ */ N(ae, { onOpenChange: (y) => y && a(), children: [
|
|
1488
|
-
/* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1489
|
-
X,
|
|
1490
|
-
{
|
|
1491
|
-
size: "sm",
|
|
1492
|
-
intent: "ghost",
|
|
1493
|
-
icon: /* @__PURE__ */ t(ba, {}),
|
|
1494
|
-
"aria-label": c("editor.textColor", "Text colour"),
|
|
1495
|
-
onMouseDown: (y) => {
|
|
1496
|
-
y.preventDefault(), a();
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
) }),
|
|
1500
|
-
/* @__PURE__ */ N(ae.Content, { side: "bottom", align: "start", children: [
|
|
1501
|
-
/* @__PURE__ */ t(ae.Heading, { children: c("editor.textColor", "Text colour") }),
|
|
1502
|
-
/* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
|
|
1503
|
-
Jn,
|
|
1504
|
-
{
|
|
1505
|
-
variant: "inline",
|
|
1506
|
-
size: "sm",
|
|
1507
|
-
value: p,
|
|
1508
|
-
onChange: b
|
|
1509
|
-
}
|
|
1510
|
-
) }),
|
|
1511
|
-
/* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Se, { size: "sm", intent: "secondary", onClick: f, children: c("editor.color.remove", "Remove colour") }) })
|
|
1512
|
-
] })
|
|
1513
|
-
] });
|
|
1514
|
-
}
|
|
1515
|
-
function ms({
|
|
1516
|
-
run: r,
|
|
1517
|
-
saveSelection: a,
|
|
1518
|
-
restoreSelection: u
|
|
1519
|
-
}) {
|
|
1520
|
-
const { t: c } = se("ui"), [p, h] = R("#fff3a3"), b = (y) => {
|
|
1521
|
-
h(y), u(), r("module.inline.format", {
|
|
1522
|
-
tag: "span",
|
|
1523
|
-
style: { "background-color": y },
|
|
1524
|
-
type: "toggle"
|
|
1525
|
-
});
|
|
1526
|
-
}, f = () => {
|
|
1527
|
-
u(), r("module.inline.remove", { style: "background-color" });
|
|
1528
|
-
};
|
|
1529
|
-
return /* @__PURE__ */ N(ae, { onOpenChange: (y) => y && a(), children: [
|
|
1530
|
-
/* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1531
|
-
X,
|
|
1532
|
-
{
|
|
1533
|
-
size: "sm",
|
|
1534
|
-
intent: "ghost",
|
|
1535
|
-
icon: /* @__PURE__ */ t(Si, {}),
|
|
1536
|
-
"aria-label": c("editor.highlightColor", "Highlight"),
|
|
1537
|
-
onMouseDown: (y) => {
|
|
1538
|
-
y.preventDefault(), a();
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
) }),
|
|
1542
|
-
/* @__PURE__ */ N(ae.Content, { side: "bottom", align: "start", children: [
|
|
1543
|
-
/* @__PURE__ */ t(ae.Heading, { children: c("editor.highlightColor", "Highlight") }),
|
|
1544
|
-
/* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
|
|
1545
|
-
Jn,
|
|
1546
|
-
{
|
|
1547
|
-
variant: "inline",
|
|
1548
|
-
size: "sm",
|
|
1549
|
-
value: p,
|
|
1550
|
-
onChange: b
|
|
1551
|
-
}
|
|
1552
|
-
) }),
|
|
1553
|
-
/* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Se, { size: "sm", intent: "secondary", onClick: f, children: c("editor.highlight.remove", "Remove highlight") }) })
|
|
1554
|
-
] })
|
|
1555
|
-
] });
|
|
1556
|
-
}
|
|
1557
|
-
function fs(r, a) {
|
|
1558
|
-
const u = Array.from({ length: a }, () => "<td><br></td>").join("");
|
|
1559
|
-
return `<table><tbody>${Array.from({ length: r }, () => `<tr>${u}</tr>`).join("")}</tbody></table>`;
|
|
1560
|
-
}
|
|
1561
|
-
function gs({
|
|
1562
|
-
run: r,
|
|
1563
|
-
insertTable: a,
|
|
1564
|
-
active: u
|
|
1565
|
-
}) {
|
|
1566
|
-
const { t: c } = se("ui"), [p, h] = R({ r: 0, c: 0 }), [b, f] = R(!1), y = u.has("table") || b, E = /* @__PURE__ */ t(
|
|
1567
|
-
X,
|
|
1568
|
-
{
|
|
1569
|
-
size: "sm",
|
|
1570
|
-
intent: "ghost",
|
|
1571
|
-
icon: /* @__PURE__ */ t(Pa, {}),
|
|
1572
|
-
"aria-label": c("editor.table.insert", "Insert table"),
|
|
1573
|
-
onMouseDown: (C) => C.preventDefault()
|
|
1574
|
-
}
|
|
1575
|
-
);
|
|
1576
|
-
return y ? /* @__PURE__ */ N(j.Root, { open: b, onOpenChange: f, children: [
|
|
1577
|
-
/* @__PURE__ */ t(j.Trigger, { asChild: !0, children: E }),
|
|
1578
|
-
/* @__PURE__ */ t(j.Content, { side: "bottom", align: "start", children: fo.map((C) => /* @__PURE__ */ t(
|
|
1579
|
-
j.Item,
|
|
1580
|
-
{
|
|
1581
|
-
startIcon: C.icon,
|
|
1582
|
-
onSelect: () => r(C.command),
|
|
1583
|
-
children: c(C.label[0], C.label[1])
|
|
1584
|
-
},
|
|
1585
|
-
C.id
|
|
1586
|
-
)) })
|
|
1587
|
-
] }) : /* @__PURE__ */ N(ae, { onOpenChange: (C) => !C && h({ r: 0, c: 0 }), children: [
|
|
1588
|
-
/* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: E }),
|
|
1589
|
-
/* @__PURE__ */ N(ae.Content, { side: "bottom", align: "start", children: [
|
|
1590
|
-
/* @__PURE__ */ t(ae.Heading, { children: c("editor.table.insert", "Insert table") }),
|
|
1591
|
-
/* @__PURE__ */ t(
|
|
1592
|
-
"div",
|
|
1593
|
-
{
|
|
1594
|
-
role: "group",
|
|
1595
|
-
"aria-label": c("editor.table.sizePicker", "Table size"),
|
|
1596
|
-
className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
|
|
1597
|
-
onMouseLeave: () => h({ r: 0, c: 0 }),
|
|
1598
|
-
children: Array.from({ length: cn * cn }, (C, M) => {
|
|
1599
|
-
const I = Math.floor(M / cn) + 1, L = M % cn + 1, P = I <= p.r && L <= p.c;
|
|
1600
|
-
return /* @__PURE__ */ t(
|
|
1601
|
-
"button",
|
|
1602
|
-
{
|
|
1603
|
-
type: "button",
|
|
1604
|
-
"aria-label": c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1605
|
-
r: I,
|
|
1606
|
-
c: L
|
|
1607
|
-
}),
|
|
1608
|
-
onMouseEnter: () => h({ r: I, c: L }),
|
|
1609
|
-
onClick: () => a(fs(I, L)),
|
|
1610
|
-
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${P ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
|
|
1611
|
-
},
|
|
1612
|
-
M
|
|
1613
|
-
);
|
|
1614
|
-
})
|
|
1615
|
-
}
|
|
1616
|
-
),
|
|
1617
|
-
/* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: p.r > 0 ? c("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1618
|
-
r: p.r,
|
|
1619
|
-
c: p.c
|
|
1620
|
-
}) : c("editor.table.sizeHint", "Pick a size") })
|
|
1621
|
-
] })
|
|
1622
|
-
] });
|
|
1623
|
-
}
|
|
1624
|
-
const hs = Object.fromEntries(fo.map((r) => [r.id, r])), ps = [
|
|
1625
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1626
|
-
"ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
|
|
1627
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1628
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1629
|
-
].join(" "), bs = "#fde68a";
|
|
1630
|
-
function Ur({
|
|
1631
|
-
scope: r,
|
|
1632
|
-
icon: a,
|
|
1633
|
-
label: u,
|
|
1634
|
-
onOpenChange: c,
|
|
1635
|
-
saveTableCell: p,
|
|
1636
|
-
applyTableBackground: h
|
|
1637
|
-
}) {
|
|
1638
|
-
const { t: b } = se("ui"), [f, y] = R(bs);
|
|
1639
|
-
return /* @__PURE__ */ N(
|
|
1640
|
-
ae,
|
|
1641
|
-
{
|
|
1642
|
-
onOpenChange: (E) => {
|
|
1643
|
-
c(E), E && p();
|
|
1644
|
-
},
|
|
1645
|
-
children: [
|
|
1646
|
-
/* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1647
|
-
X,
|
|
1648
|
-
{
|
|
1649
|
-
size: "sm",
|
|
1650
|
-
intent: "ghost",
|
|
1651
|
-
icon: a,
|
|
1652
|
-
tooltip: u,
|
|
1653
|
-
onMouseDown: (E) => E.preventDefault()
|
|
1654
|
-
}
|
|
1655
|
-
) }),
|
|
1656
|
-
/* @__PURE__ */ N(ae.Content, { side: "bottom", align: "center", children: [
|
|
1657
|
-
/* @__PURE__ */ t(
|
|
1658
|
-
Jn,
|
|
1659
|
-
{
|
|
1660
|
-
variant: "inline",
|
|
1661
|
-
size: "sm",
|
|
1662
|
-
value: f,
|
|
1663
|
-
onChange: (E) => {
|
|
1664
|
-
y(E), h(r, E);
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
),
|
|
1668
|
-
/* @__PURE__ */ t(
|
|
1669
|
-
Se,
|
|
1670
|
-
{
|
|
1671
|
-
size: "sm",
|
|
1672
|
-
intent: "ghost",
|
|
1673
|
-
className: "ds:mt-[var(--spacing-xs)] ds:w-full",
|
|
1674
|
-
onClick: () => h(r, null),
|
|
1675
|
-
children: b("editor.table.clearColor", "Clear colour")
|
|
1676
|
-
}
|
|
1677
|
-
)
|
|
1678
|
-
] })
|
|
1679
|
-
]
|
|
1680
|
-
}
|
|
1681
|
-
);
|
|
1682
|
-
}
|
|
1683
|
-
function vs({
|
|
1684
|
-
active: r,
|
|
1685
|
-
run: a,
|
|
1686
|
-
areaRef: u,
|
|
1687
|
-
getActiveTableEl: c,
|
|
1688
|
-
enableColor: p = !1,
|
|
1689
|
-
saveTableCell: h,
|
|
1690
|
-
applyTableBackground: b
|
|
1691
|
-
}) {
|
|
1692
|
-
const { t: f } = se("ui"), y = r.has("table"), [E, C] = R(null), M = x(0), [I, L] = R(!1), P = w((m) => {
|
|
1693
|
-
M.current = Math.max(
|
|
1694
|
-
0,
|
|
1695
|
-
M.current + (m ? 1 : -1)
|
|
1696
|
-
), L(M.current > 0);
|
|
1697
|
-
}, []);
|
|
1698
|
-
if (H(() => {
|
|
1699
|
-
if (I) return;
|
|
1700
|
-
if (!y || typeof window > "u") {
|
|
1701
|
-
C(null);
|
|
1702
|
-
return;
|
|
1703
|
-
}
|
|
1704
|
-
const m = () => {
|
|
1705
|
-
const D = u.current, K = c();
|
|
1706
|
-
if (!D || !K) {
|
|
1707
|
-
C(null);
|
|
1708
|
-
return;
|
|
1709
|
-
}
|
|
1710
|
-
const G = D.getBoundingClientRect(), B = K.getBoundingClientRect(), k = getComputedStyle(D).direction === "rtl", le = Math.max(0, B.top - G.top - 44), F = k ? G.right - B.right + B.width / 2 : B.left - G.left + B.width / 2;
|
|
1711
|
-
C({ top: le, start: Math.max(0, F), rtl: k });
|
|
1712
|
-
};
|
|
1713
|
-
m();
|
|
1714
|
-
const v = new ResizeObserver(m), z = u.current, _ = c();
|
|
1715
|
-
return z && v.observe(z), _ && v.observe(_), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1716
|
-
v.disconnect(), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1717
|
-
};
|
|
1718
|
-
}, [y, I, u, c]), !y && !I || !E) return null;
|
|
1719
|
-
const g = [
|
|
1720
|
-
["rowAbove", "rowBelow"],
|
|
1721
|
-
["colLeft", "colRight"],
|
|
1722
|
-
["addHead"],
|
|
1723
|
-
...p ? ["colour"] : [],
|
|
1724
|
-
["deleteRow", "deleteColumn"],
|
|
1725
|
-
["deleteTable"]
|
|
1726
|
-
];
|
|
1727
|
-
return (
|
|
1728
|
-
// Tooltips disambiguate the icon-only ops on hover (and provide each
|
|
1729
|
-
// button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
|
|
1730
|
-
// needs a provider ancestor, so scope one to the bar.
|
|
1731
|
-
/* @__PURE__ */ t(Qn, { children: /* @__PURE__ */ t(
|
|
1732
|
-
"div",
|
|
1733
|
-
{
|
|
1734
|
-
role: "group",
|
|
1735
|
-
"aria-label": f("editor.table.toolbar", "Table tools"),
|
|
1736
|
-
className: `${ps} ${E.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1737
|
-
style: {
|
|
1738
|
-
"--rte-tt-top": `${E.top}px`,
|
|
1739
|
-
"--rte-tt-start": `${E.start}px`
|
|
1740
|
-
},
|
|
1741
|
-
children: g.map((m, v) => /* @__PURE__ */ N(yt, { children: [
|
|
1742
|
-
v > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: gn }) : null,
|
|
1743
|
-
m === "colour" ? /* @__PURE__ */ N(Be, { children: [
|
|
1744
|
-
/* @__PURE__ */ t(
|
|
1745
|
-
Ur,
|
|
1746
|
-
{
|
|
1747
|
-
scope: "cell",
|
|
1748
|
-
icon: /* @__PURE__ */ t(fa, {}),
|
|
1749
|
-
label: f("editor.table.cellColor", "Cell colour"),
|
|
1750
|
-
onOpenChange: P,
|
|
1751
|
-
saveTableCell: h,
|
|
1752
|
-
applyTableBackground: b
|
|
1753
|
-
}
|
|
1754
|
-
),
|
|
1755
|
-
/* @__PURE__ */ t(
|
|
1756
|
-
Ur,
|
|
1757
|
-
{
|
|
1758
|
-
scope: "row",
|
|
1759
|
-
icon: /* @__PURE__ */ t(ha, {}),
|
|
1760
|
-
label: f("editor.table.rowColor", "Row colour"),
|
|
1761
|
-
onOpenChange: P,
|
|
1762
|
-
saveTableCell: h,
|
|
1763
|
-
applyTableBackground: b
|
|
1764
|
-
}
|
|
1765
|
-
)
|
|
1766
|
-
] }) : m.map((z) => {
|
|
1767
|
-
const _ = hs[z];
|
|
1768
|
-
return /* @__PURE__ */ t(
|
|
1769
|
-
X,
|
|
1770
|
-
{
|
|
1771
|
-
size: "sm",
|
|
1772
|
-
intent: "ghost",
|
|
1773
|
-
icon: _.icon,
|
|
1774
|
-
tooltip: f(_.label[0], _.label[1]),
|
|
1775
|
-
onMouseDown: (D) => D.preventDefault(),
|
|
1776
|
-
onClick: () => a(_.command)
|
|
1777
|
-
},
|
|
1778
|
-
z
|
|
1779
|
-
);
|
|
1780
|
-
})
|
|
1781
|
-
] }, m === "colour" ? "colour" : m[0]))
|
|
1782
|
-
}
|
|
1783
|
-
) })
|
|
1784
|
-
);
|
|
1785
|
-
}
|
|
1786
|
-
const Wn = [
|
|
1787
|
-
"wysiwyg-img-inline",
|
|
1788
|
-
"wysiwyg-img-wrap-left",
|
|
1789
|
-
"wysiwyg-img-wrap-right"
|
|
1790
|
-
], ho = [
|
|
1791
|
-
"wysiwyg-img-align-left",
|
|
1792
|
-
"wysiwyg-img-align-center",
|
|
1793
|
-
"wysiwyg-img-align-right"
|
|
1794
|
-
];
|
|
1795
|
-
function Zr(r, a) {
|
|
1796
|
-
return a.find((u) => r.classList.contains(u)) ?? "";
|
|
1797
|
-
}
|
|
1798
|
-
function ys(r) {
|
|
1799
|
-
const a = r.closest(".redactor-in"), u = a instanceof HTMLElement ? a.clientWidth : 0, c = r.getBoundingClientRect().width;
|
|
1800
|
-
return u <= 0 || c <= 0 ? Ot : Math.round(Math.min(Ot, c / u * 100));
|
|
1801
|
-
}
|
|
1802
|
-
const Xn = 10, Ot = 100, ws = 5, ks = 10, Qr = (r) => Math.min(Ot, Math.max(Xn, Math.round(r))), xs = [
|
|
1803
|
-
{
|
|
1804
|
-
id: "wysiwyg-img-inline",
|
|
1805
|
-
icon: /* @__PURE__ */ t(Di, {}),
|
|
1806
|
-
label: ["editor.image.inline", "Inline with text"]
|
|
1807
|
-
},
|
|
1808
|
-
{
|
|
1809
|
-
id: "wysiwyg-img-wrap-left",
|
|
1810
|
-
icon: /* @__PURE__ */ t(ya, {}),
|
|
1811
|
-
label: ["editor.image.wrapLeft", "Wrap left"]
|
|
1812
|
-
},
|
|
1813
|
-
{
|
|
1814
|
-
id: "wysiwyg-img-wrap-right",
|
|
1815
|
-
icon: /* @__PURE__ */ t(ka, {}),
|
|
1816
|
-
label: ["editor.image.wrapRight", "Wrap right"]
|
|
1817
|
-
}
|
|
1818
|
-
], Cs = [
|
|
1819
|
-
{
|
|
1820
|
-
id: "wysiwyg-img-align-left",
|
|
1821
|
-
icon: /* @__PURE__ */ t(lo, {}),
|
|
1822
|
-
label: ["editor.image.alignLeft", "Align left"]
|
|
1823
|
-
},
|
|
1824
|
-
{
|
|
1825
|
-
id: "wysiwyg-img-align-center",
|
|
1826
|
-
icon: /* @__PURE__ */ t(ao, {}),
|
|
1827
|
-
label: ["editor.image.alignCenter", "Align centre"]
|
|
1828
|
-
},
|
|
1829
|
-
{
|
|
1830
|
-
id: "wysiwyg-img-align-right",
|
|
1831
|
-
icon: /* @__PURE__ */ t(so, {}),
|
|
1832
|
-
label: ["editor.image.alignRight", "Align right"]
|
|
1833
|
-
}
|
|
1834
|
-
], As = [
|
|
1835
|
-
{
|
|
1836
|
-
id: "tl",
|
|
1837
|
-
pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
|
|
1838
|
-
cursor: "ds:cursor-nwse-resize",
|
|
1839
|
-
sign: -1,
|
|
1840
|
-
labelKey: "editor.image.resizeTopStart",
|
|
1841
|
-
labelFallback: "Resize image, top-start corner"
|
|
1842
|
-
},
|
|
1843
|
-
{
|
|
1844
|
-
id: "tr",
|
|
1845
|
-
pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
|
|
1846
|
-
cursor: "ds:cursor-nesw-resize",
|
|
1847
|
-
sign: 1,
|
|
1848
|
-
labelKey: "editor.image.resizeTopEnd",
|
|
1849
|
-
labelFallback: "Resize image, top-end corner"
|
|
1850
|
-
},
|
|
1851
|
-
{
|
|
1852
|
-
id: "bl",
|
|
1853
|
-
pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
|
|
1854
|
-
cursor: "ds:cursor-nesw-resize",
|
|
1855
|
-
sign: -1,
|
|
1856
|
-
labelKey: "editor.image.resizeBottomStart",
|
|
1857
|
-
labelFallback: "Resize image, bottom-start corner"
|
|
1858
|
-
},
|
|
1859
|
-
{
|
|
1860
|
-
id: "br",
|
|
1861
|
-
pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
|
|
1862
|
-
cursor: "ds:cursor-nwse-resize",
|
|
1863
|
-
sign: 1,
|
|
1864
|
-
labelKey: "editor.image.resizeBottomEnd",
|
|
1865
|
-
labelFallback: "Resize image, bottom-end corner"
|
|
1866
|
-
}
|
|
1867
|
-
], Ns = [
|
|
1868
|
-
"ds:absolute ds:z-20 ds:pointer-events-none",
|
|
1869
|
-
"ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
|
|
1870
|
-
"ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
|
|
1871
|
-
"ds:rounded-[var(--radius-2xs)]",
|
|
1872
|
-
"ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
|
|
1873
|
-
"ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
|
|
1874
|
-
].join(" "), Ts = [
|
|
1875
|
-
"ds:absolute ds:pointer-events-auto ds:touch-none",
|
|
1876
|
-
"ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
|
|
1877
|
-
"ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
|
|
1878
|
-
"ds:bg-[var(--accent)] ds:border ds:border-[color:var(--background)]",
|
|
1879
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
1880
|
-
"ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
|
|
1881
|
-
"ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
|
|
1882
|
-
"ds:forced-colors:bg-[CanvasText]"
|
|
1883
|
-
].join(" "), Es = [
|
|
1884
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1885
|
-
"ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
|
|
1886
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1887
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1888
|
-
].join(" ");
|
|
1889
|
-
function Rs({
|
|
1890
|
-
areaRef: r,
|
|
1891
|
-
activeImageEl: a,
|
|
1892
|
-
applyImageClass: u,
|
|
1893
|
-
setImageWidth: c
|
|
1894
|
-
}) {
|
|
1895
|
-
const { t: p } = se("ui"), [h, b] = R(null), f = x(null);
|
|
1896
|
-
H(() => {
|
|
1897
|
-
if (!a || typeof window > "u") {
|
|
1898
|
-
b(null);
|
|
1899
|
-
return;
|
|
1900
|
-
}
|
|
1901
|
-
const g = () => {
|
|
1902
|
-
const D = r.current;
|
|
1903
|
-
if (!D) {
|
|
1904
|
-
b(null);
|
|
1905
|
-
return;
|
|
1906
|
-
}
|
|
1907
|
-
const K = D.getBoundingClientRect(), G = a.getBoundingClientRect(), B = getComputedStyle(D).direction === "rtl", k = G.top - K.top, le = B ? K.right - G.right : G.left - K.left, F = le + G.width / 2, U = Math.max(0, k - 44);
|
|
1908
|
-
b({
|
|
1909
|
-
top: k,
|
|
1910
|
-
start: Math.max(0, le),
|
|
1911
|
-
width: G.width,
|
|
1912
|
-
height: G.height,
|
|
1913
|
-
center: Math.max(0, F),
|
|
1914
|
-
barTop: U,
|
|
1915
|
-
pct: ys(a),
|
|
1916
|
-
rtl: B
|
|
1917
|
-
});
|
|
1918
|
-
};
|
|
1919
|
-
g();
|
|
1920
|
-
const m = new ResizeObserver(g);
|
|
1921
|
-
m.observe(a);
|
|
1922
|
-
const v = r.current;
|
|
1923
|
-
v && m.observe(v);
|
|
1924
|
-
const z = a.closest(".redactor-in");
|
|
1925
|
-
let _ = null;
|
|
1926
|
-
return z && (_ = new MutationObserver(g), _.observe(z, {
|
|
1927
|
-
subtree: !0,
|
|
1928
|
-
childList: !0,
|
|
1929
|
-
characterData: !0,
|
|
1930
|
-
attributes: !0,
|
|
1931
|
-
attributeFilter: ["class", "style", "width", "height", "src"]
|
|
1932
|
-
})), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
|
|
1933
|
-
m.disconnect(), _ == null || _.disconnect(), window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
|
|
1934
|
-
};
|
|
1935
|
-
}, [a, r]);
|
|
1936
|
-
const y = w(
|
|
1937
|
-
(g) => (m) => {
|
|
1938
|
-
!m.isPrimary || !h || (m.preventDefault(), m.currentTarget.setPointerCapture(m.pointerId), f.current = {
|
|
1939
|
-
pointerId: m.pointerId,
|
|
1940
|
-
startX: m.clientX,
|
|
1941
|
-
startPct: h.pct,
|
|
1942
|
-
sign: g.sign * (h.rtl ? -1 : 1)
|
|
1943
|
-
});
|
|
1944
|
-
},
|
|
1945
|
-
[h]
|
|
1946
|
-
), E = w(
|
|
1947
|
-
(g) => {
|
|
1948
|
-
const m = f.current;
|
|
1949
|
-
if (!m || g.pointerId !== m.pointerId || !a) return;
|
|
1950
|
-
const v = a.closest(".redactor-in"), z = v instanceof HTMLElement ? v.clientWidth : 0;
|
|
1951
|
-
if (z <= 0) return;
|
|
1952
|
-
const _ = m.sign * (g.clientX - m.startX) / z * 100;
|
|
1953
|
-
c(Qr(m.startPct + _));
|
|
1954
|
-
},
|
|
1955
|
-
[a, c]
|
|
1956
|
-
), C = w(
|
|
1957
|
-
(g) => {
|
|
1958
|
-
const m = f.current;
|
|
1959
|
-
!m || g.pointerId !== m.pointerId || (g.currentTarget.releasePointerCapture(g.pointerId), f.current = null);
|
|
1960
|
-
},
|
|
1961
|
-
[]
|
|
1962
|
-
), M = w(
|
|
1963
|
-
(g) => {
|
|
1964
|
-
if (!h) return;
|
|
1965
|
-
let m = null;
|
|
1966
|
-
const v = g.shiftKey ? ks : ws;
|
|
1967
|
-
switch (g.key) {
|
|
1968
|
-
// Up / right always grow; down / left always shrink — independent of
|
|
1969
|
-
// which corner has focus, so the gesture reads the same everywhere.
|
|
1970
|
-
case "ArrowRight":
|
|
1971
|
-
case "ArrowUp":
|
|
1972
|
-
m = h.pct + v;
|
|
1973
|
-
break;
|
|
1974
|
-
case "ArrowLeft":
|
|
1975
|
-
case "ArrowDown":
|
|
1976
|
-
m = h.pct - v;
|
|
1977
|
-
break;
|
|
1978
|
-
case "Home":
|
|
1979
|
-
m = Xn;
|
|
1980
|
-
break;
|
|
1981
|
-
case "End":
|
|
1982
|
-
m = Ot;
|
|
1983
|
-
break;
|
|
1984
|
-
default:
|
|
1985
|
-
return;
|
|
1986
|
-
}
|
|
1987
|
-
g.preventDefault(), c(Qr(m));
|
|
1988
|
-
},
|
|
1989
|
-
[h, c]
|
|
1990
|
-
);
|
|
1991
|
-
if (!a || !h) return null;
|
|
1992
|
-
const I = Zr(a, Wn), L = Zr(a, ho), P = p("editor.image.widthAnnounce", {
|
|
1993
|
-
width: h.pct,
|
|
1994
|
-
defaultValue: "{{width}} percent"
|
|
1995
|
-
});
|
|
1996
|
-
return /* @__PURE__ */ N(Be, { children: [
|
|
1997
|
-
/* @__PURE__ */ t(
|
|
1998
|
-
"div",
|
|
1999
|
-
{
|
|
2000
|
-
className: Ns,
|
|
2001
|
-
style: {
|
|
2002
|
-
"--rte-img-top": `${h.top}px`,
|
|
2003
|
-
"--rte-img-start": `${h.start}px`,
|
|
2004
|
-
"--rte-img-width": `${h.width}px`,
|
|
2005
|
-
"--rte-img-height": `${h.height}px`
|
|
2006
|
-
},
|
|
2007
|
-
children: As.map((g) => /* @__PURE__ */ t(
|
|
2008
|
-
"div",
|
|
2009
|
-
{
|
|
2010
|
-
role: "slider",
|
|
2011
|
-
tabIndex: 0,
|
|
2012
|
-
"aria-label": p(g.labelKey, g.labelFallback),
|
|
2013
|
-
"aria-orientation": "horizontal",
|
|
2014
|
-
"aria-valuemin": Xn,
|
|
2015
|
-
"aria-valuemax": Ot,
|
|
2016
|
-
"aria-valuenow": h.pct,
|
|
2017
|
-
"aria-valuetext": P,
|
|
2018
|
-
className: `${Ts} ${g.pos} ${g.cursor}`,
|
|
2019
|
-
onPointerDown: y(g),
|
|
2020
|
-
onPointerMove: E,
|
|
2021
|
-
onPointerUp: C,
|
|
2022
|
-
onPointerCancel: C,
|
|
2023
|
-
onKeyDown: M
|
|
2024
|
-
},
|
|
2025
|
-
g.id
|
|
2026
|
-
))
|
|
2027
|
-
}
|
|
2028
|
-
),
|
|
2029
|
-
/* @__PURE__ */ t(Qn, { children: /* @__PURE__ */ t(
|
|
2030
|
-
"div",
|
|
2031
|
-
{
|
|
2032
|
-
role: "group",
|
|
2033
|
-
"aria-label": p("editor.image.toolbar", "Image tools"),
|
|
2034
|
-
className: `${Es} ${h.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
2035
|
-
style: {
|
|
2036
|
-
"--rte-img-bar-top": `${h.barTop}px`,
|
|
2037
|
-
"--rte-img-center": `${h.center}px`
|
|
2038
|
-
},
|
|
2039
|
-
children: [xs, Cs].map((g, m) => /* @__PURE__ */ N(yt, { children: [
|
|
2040
|
-
m > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: gn }) : null,
|
|
2041
|
-
g.map((v) => {
|
|
2042
|
-
const z = m === 0 ? I === v.id : L === v.id;
|
|
2043
|
-
return /* @__PURE__ */ t(
|
|
2044
|
-
X,
|
|
2045
|
-
{
|
|
2046
|
-
size: "sm",
|
|
2047
|
-
intent: "ghost",
|
|
2048
|
-
icon: v.icon,
|
|
2049
|
-
"aria-pressed": z,
|
|
2050
|
-
tooltip: p(v.label[0], v.label[1]),
|
|
2051
|
-
onMouseDown: (_) => _.preventDefault(),
|
|
2052
|
-
onClick: () => u(v.id)
|
|
2053
|
-
},
|
|
2054
|
-
v.id
|
|
2055
|
-
);
|
|
2056
|
-
})
|
|
2057
|
-
] }, m === 0 ? "flow" : "align"))
|
|
2058
|
-
}
|
|
2059
|
-
) })
|
|
2060
|
-
] });
|
|
2061
|
-
}
|
|
2062
|
-
function Ms({
|
|
2063
|
-
templates: r,
|
|
2064
|
-
onPick: a,
|
|
2065
|
-
onManage: u,
|
|
2066
|
-
noteEmpty: c,
|
|
2067
|
-
onOpenChange: p,
|
|
2068
|
-
trigger: h,
|
|
2069
|
-
side: b = "top"
|
|
2070
|
-
}) {
|
|
2071
|
-
const { t: f } = se("ui"), y = Ge();
|
|
2072
|
-
return /* @__PURE__ */ N(j.Root, { onOpenChange: p, children: [
|
|
2073
|
-
/* @__PURE__ */ t(j.Trigger, { asChild: !0, children: h }),
|
|
2074
|
-
/* @__PURE__ */ N(j.Content, { side: b, align: "end", sideOffset: 8, children: [
|
|
2075
|
-
/* @__PURE__ */ t(j.Label, { children: r.length > 0 ? f("editor.ai.templatesGroup") : f("editor.ai.noTemplates") }),
|
|
2076
|
-
r.map((E) => /* @__PURE__ */ t(
|
|
2077
|
-
j.Item,
|
|
2078
|
-
{
|
|
2079
|
-
startIcon: /* @__PURE__ */ t(Gn, {}),
|
|
2080
|
-
description: E.description || void 0,
|
|
2081
|
-
"aria-disabled": c || void 0,
|
|
2082
|
-
"aria-describedby": c ? y : void 0,
|
|
2083
|
-
className: "ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed",
|
|
2084
|
-
onSelect: (C) => {
|
|
2085
|
-
if (c) {
|
|
2086
|
-
C.preventDefault();
|
|
2087
|
-
return;
|
|
2088
|
-
}
|
|
2089
|
-
a(E);
|
|
2090
|
-
},
|
|
2091
|
-
children: E.name
|
|
2092
|
-
},
|
|
2093
|
-
E.id
|
|
2094
|
-
)),
|
|
2095
|
-
c && r.length > 0 ? /* @__PURE__ */ t(
|
|
2096
|
-
"p",
|
|
2097
|
-
{
|
|
2098
|
-
id: y,
|
|
2099
|
-
className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]",
|
|
2100
|
-
children: f("editor.ai.templatesNoteEmpty")
|
|
2101
|
-
}
|
|
2102
|
-
) : null,
|
|
2103
|
-
u && r.length === 0 ? /* @__PURE__ */ t(
|
|
2104
|
-
j.Item,
|
|
2105
|
-
{
|
|
2106
|
-
startIcon: /* @__PURE__ */ t(Li, {}),
|
|
2107
|
-
onSelect: () => u("create"),
|
|
2108
|
-
children: f("editor.ai.createFirstTemplate")
|
|
2109
|
-
}
|
|
2110
|
-
) : null,
|
|
2111
|
-
u && r.length > 0 ? /* @__PURE__ */ N(Be, { children: [
|
|
2112
|
-
/* @__PURE__ */ t(j.Separator, {}),
|
|
2113
|
-
/* @__PURE__ */ t(
|
|
2114
|
-
j.Item,
|
|
2115
|
-
{
|
|
2116
|
-
startIcon: /* @__PURE__ */ t(_i, {}),
|
|
2117
|
-
onSelect: () => u("list"),
|
|
2118
|
-
children: f("editor.ai.manageTemplates")
|
|
2119
|
-
}
|
|
2120
|
-
)
|
|
2121
|
-
] }) : null
|
|
2122
|
-
] })
|
|
2123
|
-
] });
|
|
2124
|
-
}
|
|
2125
|
-
const Ss = [
|
|
2126
|
-
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
2127
|
-
"ds:[inset-block-start:var(--rte-sel-top)] ds:[inset-inline-start:var(--rte-sel-start)]",
|
|
2128
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
2129
|
-
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]",
|
|
2130
|
-
go
|
|
2131
|
-
].join(" "), zs = ["bold", "italic", "underline", "strike"];
|
|
2132
|
-
function Ls({
|
|
2133
|
-
active: r,
|
|
2134
|
-
run: a,
|
|
2135
|
-
areaRef: u,
|
|
2136
|
-
getEditorRoot: c,
|
|
2137
|
-
suppressed: p = !1,
|
|
2138
|
-
holdOpen: h = !1,
|
|
2139
|
-
children: b
|
|
2140
|
-
}) {
|
|
2141
|
-
const { t: f } = se("ui"), y = x(null), [E, C] = R(null), M = x(h);
|
|
2142
|
-
return H(() => {
|
|
2143
|
-
M.current = h;
|
|
2144
|
-
}, [h]), H(() => {
|
|
2145
|
-
if (p || typeof window > "u") {
|
|
2146
|
-
C(null);
|
|
2147
|
-
return;
|
|
2148
|
-
}
|
|
2149
|
-
let I = !1, L = 0, P = !1, g = !1;
|
|
2150
|
-
const m = () => {
|
|
2151
|
-
P = !1, C(null);
|
|
2152
|
-
}, v = () => {
|
|
2153
|
-
var Ne;
|
|
2154
|
-
if (M.current || I) return;
|
|
2155
|
-
if (g) {
|
|
2156
|
-
m();
|
|
2157
|
-
return;
|
|
2158
|
-
}
|
|
2159
|
-
const B = u.current, k = c(), le = window.getSelection();
|
|
2160
|
-
if (!B || !k || !le || le.rangeCount === 0 || le.isCollapsed || !B.contains(document.activeElement)) {
|
|
2161
|
-
m();
|
|
2162
|
-
return;
|
|
2163
|
-
}
|
|
2164
|
-
const F = le.getRangeAt(0);
|
|
2165
|
-
if (!k.contains(F.commonAncestorContainer)) {
|
|
2166
|
-
m();
|
|
2167
|
-
return;
|
|
2168
|
-
}
|
|
2169
|
-
if (!F.toString().trim()) {
|
|
2170
|
-
m();
|
|
2171
|
-
return;
|
|
2172
|
-
}
|
|
2173
|
-
const U = B.getBoundingClientRect(), re = F.getBoundingClientRect(), Y = getComputedStyle(B).direction === "rtl", ke = re.top - U.top - 48, ee = ke >= 0 ? ke : re.bottom - U.top + 8, _e = ((Ne = y.current) == null ? void 0 : Ne.offsetWidth) ?? 0, V = Y ? U.right - re.right + re.width / 2 : re.left - U.left + re.width / 2, oe = _e / 2, Z = Math.min(
|
|
2174
|
-
Math.max(V, oe),
|
|
2175
|
-
Math.max(oe, U.width - oe)
|
|
2176
|
-
);
|
|
2177
|
-
C({ top: ee, start: Z, rtl: Y }), _e === 0 && !P && (P = !0, L = requestAnimationFrame(v));
|
|
2178
|
-
}, z = () => {
|
|
2179
|
-
cancelAnimationFrame(L), L = requestAnimationFrame(v);
|
|
2180
|
-
}, _ = (B) => {
|
|
2181
|
-
const k = c();
|
|
2182
|
-
k && B.target instanceof Node && k.contains(B.target) && (I = !0, m());
|
|
2183
|
-
}, D = () => {
|
|
2184
|
-
I && (I = !1, z());
|
|
2185
|
-
}, K = (B) => {
|
|
2186
|
-
if (B.key !== "Escape") return;
|
|
2187
|
-
const k = u.current;
|
|
2188
|
-
!k || !k.contains(document.activeElement) || (g = !0, m());
|
|
2189
|
-
}, G = () => {
|
|
2190
|
-
g = !1, z();
|
|
2191
|
-
};
|
|
2192
|
-
return document.addEventListener("selectionchange", G), document.addEventListener("focusin", z), document.addEventListener("keydown", K, !0), document.addEventListener("pointerdown", _, !0), document.addEventListener("pointerup", D, !0), document.addEventListener("pointercancel", D, !0), window.addEventListener("scroll", z, !0), window.addEventListener("resize", z), z(), () => {
|
|
2193
|
-
cancelAnimationFrame(L), document.removeEventListener("selectionchange", G), document.removeEventListener("focusin", z), document.removeEventListener("keydown", K, !0), document.removeEventListener("pointerdown", _, !0), document.removeEventListener("pointerup", D, !0), document.removeEventListener("pointercancel", D, !0), window.removeEventListener("scroll", z, !0), window.removeEventListener("resize", z);
|
|
2194
|
-
};
|
|
2195
|
-
}, [p, u, c]), p || !E ? null : /* @__PURE__ */ t(Qn, { children: /* @__PURE__ */ N(
|
|
2196
|
-
"div",
|
|
2197
|
-
{
|
|
2198
|
-
ref: y,
|
|
2199
|
-
role: "group",
|
|
2200
|
-
"aria-label": f("editor.ai.selectionTools"),
|
|
2201
|
-
"data-component-part": "selection-toolbar",
|
|
2202
|
-
className: `${Ss} ${E.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
2203
|
-
style: {
|
|
2204
|
-
"--rte-sel-top": `${E.top}px`,
|
|
2205
|
-
"--rte-sel-start": `${E.start}px`
|
|
2206
|
-
},
|
|
2207
|
-
children: [
|
|
2208
|
-
zs.map((I) => {
|
|
2209
|
-
const L = mo[I];
|
|
2210
|
-
return /* @__PURE__ */ t(
|
|
2211
|
-
X,
|
|
2212
|
-
{
|
|
2213
|
-
size: "sm",
|
|
2214
|
-
intent: "ghost",
|
|
2215
|
-
icon: L.icon,
|
|
2216
|
-
tooltip: f(L.label[0], L.label[1]),
|
|
2217
|
-
"aria-pressed": L.toggle ? r.has(L.toggle) : void 0,
|
|
2218
|
-
onMouseDown: (P) => P.preventDefault(),
|
|
2219
|
-
onClick: () => a(...L.command)
|
|
2220
|
-
},
|
|
2221
|
-
I
|
|
2222
|
-
);
|
|
2223
|
-
}),
|
|
2224
|
-
b ? /* @__PURE__ */ N(Be, { children: [
|
|
2225
|
-
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: gn }),
|
|
2226
|
-
b
|
|
2227
|
-
] }) : null
|
|
2228
|
-
]
|
|
2229
|
-
}
|
|
2230
|
-
) });
|
|
2231
|
-
}
|
|
2232
|
-
function _s({
|
|
2233
|
-
run: r,
|
|
2234
|
-
active: a,
|
|
2235
|
-
preset: u,
|
|
2236
|
-
insertHtml: c,
|
|
2237
|
-
insertTable: p,
|
|
2238
|
-
saveSelection: h,
|
|
2239
|
-
restoreSelection: b,
|
|
2240
|
-
getSelectedText: f,
|
|
2241
|
-
uploadImage: y,
|
|
2242
|
-
enableColor: E = !1,
|
|
2243
|
-
enableImage: C = !1,
|
|
2244
|
-
enableTable: M = !1,
|
|
2245
|
-
showExtensions: I = !1,
|
|
2246
|
-
extensionControl: L,
|
|
2247
|
-
variables: P,
|
|
2248
|
-
recentVariableTokens: g,
|
|
2249
|
-
insertVariable: m
|
|
2250
|
-
}) {
|
|
2251
|
-
const { t: v } = se("ui"), z = (V) => V.preventDefault(), _ = (V) => ns[u].includes(V), D = (V) => {
|
|
2252
|
-
if (!_(V)) return null;
|
|
2253
|
-
const oe = mo[V];
|
|
2254
|
-
return /* @__PURE__ */ t(
|
|
2255
|
-
X,
|
|
2256
|
-
{
|
|
2257
|
-
size: "sm",
|
|
2258
|
-
intent: "ghost",
|
|
2259
|
-
icon: oe.icon,
|
|
2260
|
-
"aria-label": v(oe.label[0], oe.label[1]),
|
|
2261
|
-
"aria-pressed": oe.toggle ? a.has(oe.toggle) : void 0,
|
|
2262
|
-
onMouseDown: z,
|
|
2263
|
-
onClick: () => r(...oe.command)
|
|
2264
|
-
},
|
|
2265
|
-
oe.id
|
|
2266
|
-
);
|
|
2267
|
-
}, K = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: gn }), G = _("format"), B = [D("undo"), D("redo")].filter(Boolean), k = [
|
|
2268
|
-
D("bold"),
|
|
2269
|
-
D("italic"),
|
|
2270
|
-
D("underline"),
|
|
2271
|
-
D("strike"),
|
|
2272
|
-
E ? /* @__PURE__ */ t(
|
|
2273
|
-
us,
|
|
2274
|
-
{
|
|
2275
|
-
run: r,
|
|
2276
|
-
saveSelection: h,
|
|
2277
|
-
restoreSelection: b
|
|
2278
|
-
},
|
|
2279
|
-
"colour"
|
|
2280
|
-
) : null,
|
|
2281
|
-
E ? /* @__PURE__ */ t(
|
|
2282
|
-
ms,
|
|
2283
|
-
{
|
|
2284
|
-
run: r,
|
|
2285
|
-
saveSelection: h,
|
|
2286
|
-
restoreSelection: b
|
|
2287
|
-
},
|
|
2288
|
-
"highlight"
|
|
2289
|
-
) : null
|
|
2290
|
-
].filter(Boolean), le = B.length > 0 || G || k.length > 0, F = _("align") ? [
|
|
2291
|
-
/* @__PURE__ */ t(
|
|
2292
|
-
ls,
|
|
2293
|
-
{
|
|
2294
|
-
run: r,
|
|
2295
|
-
active: a,
|
|
2296
|
-
onTriggerDown: z
|
|
2297
|
-
},
|
|
2298
|
-
"align"
|
|
2299
|
-
)
|
|
2300
|
-
] : [], U = [D("ul"), D("ol")].filter(Boolean), re = [
|
|
2301
|
-
_("link") ? /* @__PURE__ */ t(
|
|
2302
|
-
cs,
|
|
2303
|
-
{
|
|
2304
|
-
insertHtml: c,
|
|
2305
|
-
saveSelection: h,
|
|
2306
|
-
restoreSelection: b,
|
|
2307
|
-
getSelectedText: f
|
|
2308
|
-
},
|
|
2309
|
-
"link"
|
|
2310
|
-
) : null,
|
|
2311
|
-
C ? /* @__PURE__ */ t(
|
|
2312
|
-
ds,
|
|
2313
|
-
{
|
|
2314
|
-
insertHtml: c,
|
|
2315
|
-
saveSelection: h,
|
|
2316
|
-
restoreSelection: b,
|
|
2317
|
-
uploadImage: y
|
|
2318
|
-
},
|
|
2319
|
-
"image"
|
|
2320
|
-
) : null,
|
|
2321
|
-
M ? /* @__PURE__ */ t(
|
|
2322
|
-
gs,
|
|
2323
|
-
{
|
|
2324
|
-
run: r,
|
|
2325
|
-
insertTable: p,
|
|
2326
|
-
active: a
|
|
2327
|
-
},
|
|
2328
|
-
"table"
|
|
2329
|
-
) : null,
|
|
2330
|
-
P && P.length > 0 && m ? /* @__PURE__ */ t(
|
|
2331
|
-
as,
|
|
2332
|
-
{
|
|
2333
|
-
variables: P,
|
|
2334
|
-
recentVariableTokens: g,
|
|
2335
|
-
insertVariable: m,
|
|
2336
|
-
saveSelection: h
|
|
2337
|
-
},
|
|
2338
|
-
"variables"
|
|
2339
|
-
) : null
|
|
2340
|
-
].filter(Boolean), Y = L ? [/* @__PURE__ */ t(yt, { children: L }, "extensions")] : I ? [
|
|
2341
|
-
/* @__PURE__ */ t(
|
|
2342
|
-
X,
|
|
2343
|
-
{
|
|
2344
|
-
size: "sm",
|
|
2345
|
-
intent: "ghost",
|
|
2346
|
-
icon: /* @__PURE__ */ t(Kn, {}),
|
|
2347
|
-
"aria-label": v("editor.extensions", "Editor extensions"),
|
|
2348
|
-
disabled: !0,
|
|
2349
|
-
onMouseDown: z
|
|
2350
|
-
},
|
|
2351
|
-
"extensions"
|
|
2352
|
-
)
|
|
2353
|
-
] : [], ke = [
|
|
2354
|
-
F,
|
|
2355
|
-
U,
|
|
2356
|
-
re,
|
|
2357
|
-
Y
|
|
2358
|
-
].filter((V) => V.length > 0), ee = ke.length > 0, _e = (V) => ke.map((oe, Z) => /* @__PURE__ */ N(yt, { children: [
|
|
2359
|
-
Z > 0 || V ? /* @__PURE__ */ t(K, {}) : null,
|
|
2360
|
-
oe
|
|
2361
|
-
] }, Z));
|
|
2362
|
-
return (
|
|
2363
|
-
// Outer element is the query container + visual chrome; the flex row is an
|
|
2364
|
-
// inner child so `container-type` never lands on the flex parent (which
|
|
2365
|
-
// would blockify the inline controls).
|
|
2366
|
-
/* @__PURE__ */ t("div", { className: rs(), "data-component": "editor-toolbar", children: /* @__PURE__ */ N(
|
|
2367
|
-
"div",
|
|
2368
|
-
{
|
|
2369
|
-
role: "group",
|
|
2370
|
-
"aria-label": v("editor.toolbarLabel"),
|
|
2371
|
-
className: os,
|
|
2372
|
-
children: [
|
|
2373
|
-
B,
|
|
2374
|
-
B.length > 0 && (G || k.length > 0) ? /* @__PURE__ */ t(K, {}) : null,
|
|
2375
|
-
G ? /* @__PURE__ */ t(ss, { run: r, active: a, onTriggerDown: z }) : null,
|
|
2376
|
-
G && k.length > 0 ? /* @__PURE__ */ t(K, {}) : null,
|
|
2377
|
-
k,
|
|
2378
|
-
ee ? /* @__PURE__ */ N(Be, { children: [
|
|
2379
|
-
/* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: _e(le) }),
|
|
2380
|
-
/* @__PURE__ */ N("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
|
|
2381
|
-
le ? /* @__PURE__ */ t(K, {}) : null,
|
|
2382
|
-
/* @__PURE__ */ N(ae, { children: [
|
|
2383
|
-
/* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2384
|
-
X,
|
|
2385
|
-
{
|
|
2386
|
-
size: "sm",
|
|
2387
|
-
intent: "ghost",
|
|
2388
|
-
icon: /* @__PURE__ */ t(Mi, {}),
|
|
2389
|
-
"aria-label": v("editor.more", "More options"),
|
|
2390
|
-
onMouseDown: z
|
|
2391
|
-
}
|
|
2392
|
-
) }),
|
|
2393
|
-
/* @__PURE__ */ t(ae.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: _e(!1) }) })
|
|
2394
|
-
] })
|
|
2395
|
-
] })
|
|
2396
|
-
] }) : null
|
|
2397
|
-
]
|
|
2398
|
-
}
|
|
2399
|
-
) })
|
|
2400
|
-
);
|
|
2401
|
-
}
|
|
2402
|
-
function Me(r) {
|
|
2403
|
-
return ui(r, "rich-text");
|
|
2404
|
-
}
|
|
2405
|
-
function dn(r = "") {
|
|
2406
|
-
const a = String(r).trim();
|
|
2407
|
-
if (a === "" || a === "<p><br></p>" || a === "<p> </p>")
|
|
2408
|
-
return "";
|
|
2409
|
-
const u = a.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
2410
|
-
return u === "" && /<img\b[^>]*>/i.test(a) ? a : u === "" ? "" : a;
|
|
2411
|
-
}
|
|
2412
|
-
function Jr(r) {
|
|
2413
|
-
return r.replace(
|
|
2414
|
-
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
2415
|
-
'<img loading="lazy"$1>'
|
|
2416
|
-
);
|
|
2417
|
-
}
|
|
2418
|
-
const Is = Vn.join(", "), $s = 10, qn = /^[A-Za-z0-9_]+$/, po = /\[\[([A-Za-z0-9_]+)\]\]/g, Un = "rte-variable-invalid", Hs = new RegExp(
|
|
2419
|
-
`\\s*\\b${Un}\\b`,
|
|
2420
|
-
"g"
|
|
2421
|
-
);
|
|
2422
|
-
function Yr(r) {
|
|
2423
|
-
const a = r.includes("data-rte-interim") ? r.replace(/<span\b[^>]*\bdata-rte-interim\b[^>]*>[^<]*<\/span>/g, "") : r;
|
|
2424
|
-
return a.includes('data-redactor-type="variable"') ? a.replace(
|
|
2425
|
-
/<span\b[^>]*data-redactor-type="variable"[^>]*>/g,
|
|
2426
|
-
(u) => u.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(Hs, "").replace(/\sclass=""/g, "")
|
|
2427
|
-
) : a;
|
|
2428
|
-
}
|
|
2429
|
-
function Os(r) {
|
|
2430
|
-
const a = r.replace(/<[^>]*>/g, " ");
|
|
2431
|
-
return Array.from(a.matchAll(po), (u) => u[1]);
|
|
2432
|
-
}
|
|
2433
|
-
function eo(r) {
|
|
2434
|
-
return typeof r == "object" && r !== null && "name" in r && r.name === "AiCreditsExhaustedError";
|
|
2435
|
-
}
|
|
2436
|
-
function Ds(r) {
|
|
2437
|
-
return typeof r == "object" && r !== null && "name" in r && r.name === "AbortError";
|
|
2438
|
-
}
|
|
2439
|
-
function Ps(r) {
|
|
2440
|
-
const a = document.createElement("template");
|
|
2441
|
-
return a.content.appendChild(r), a.innerHTML;
|
|
2442
|
-
}
|
|
2443
|
-
function to(r) {
|
|
2444
|
-
const a = document.createElement("template");
|
|
2445
|
-
return a.innerHTML = r, (a.content.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
2446
|
-
}
|
|
2447
|
-
function no(r) {
|
|
2448
|
-
return r.replace(/<[^>]*>/g, "").replace(/ /gi, "").replace(/[\s\u200B\uFEFF]+/g, "");
|
|
2449
|
-
}
|
|
2450
|
-
function qs(r) {
|
|
2451
|
-
const a = window.getSelection();
|
|
2452
|
-
if (!a || a.rangeCount === 0) return null;
|
|
2453
|
-
const u = a.getRangeAt(0);
|
|
2454
|
-
if (!r.contains(u.startContainer)) return null;
|
|
2455
|
-
const c = document.createRange();
|
|
2456
|
-
return c.selectNodeContents(r), c.setEnd(u.startContainer, u.startOffset), c.toString().length;
|
|
2457
|
-
}
|
|
2458
|
-
function Bs(r, a) {
|
|
2459
|
-
var h;
|
|
2460
|
-
const u = window.getSelection();
|
|
2461
|
-
if (!u) return;
|
|
2462
|
-
const c = document.createTreeWalker(r, NodeFilter.SHOW_TEXT);
|
|
2463
|
-
let p = 0;
|
|
2464
|
-
for (let b = c.nextNode(); b; b = c.nextNode()) {
|
|
2465
|
-
const f = b;
|
|
2466
|
-
if (p + f.data.length >= a) {
|
|
2467
|
-
const y = document.createRange(), E = (h = f.parentElement) == null ? void 0 : h.closest(
|
|
2468
|
-
'[data-redactor-type="variable"]'
|
|
2469
|
-
);
|
|
2470
|
-
E ? y.setStartAfter(E) : y.setStart(f, a - p), y.collapse(!0), u.removeAllRanges(), u.addRange(y);
|
|
2471
|
-
return;
|
|
2472
|
-
}
|
|
2473
|
-
p += f.data.length;
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
function ro(r) {
|
|
2477
|
-
return `<span data-redactor-type="variable">[[${r}]]</span>`;
|
|
2478
|
-
}
|
|
2479
|
-
function vt(r, a) {
|
|
2480
|
-
var b;
|
|
2481
|
-
if (a.size === 0 || !r.includes("[[") || typeof DOMParser > "u")
|
|
2482
|
-
return r;
|
|
2483
|
-
const u = new DOMParser().parseFromString(
|
|
2484
|
-
`<body>${r}</body>`,
|
|
2485
|
-
"text/html"
|
|
2486
|
-
), c = u.createTreeWalker(u.body, NodeFilter.SHOW_TEXT), p = [];
|
|
2487
|
-
for (let f = c.nextNode(); f; f = c.nextNode()) {
|
|
2488
|
-
const y = f;
|
|
2489
|
-
(b = y.parentElement) != null && b.closest('[data-redactor-type="variable"]') || y.data.includes("[[") && p.push(y);
|
|
2490
|
-
}
|
|
2491
|
-
let h = !1;
|
|
2492
|
-
for (const f of p) {
|
|
2493
|
-
const y = u.createDocumentFragment();
|
|
2494
|
-
let E = 0;
|
|
2495
|
-
for (const C of f.data.matchAll(po)) {
|
|
2496
|
-
const M = a.get(C[1].toLowerCase());
|
|
2497
|
-
if (!M || C.index === void 0) continue;
|
|
2498
|
-
y.append(f.data.slice(E, C.index));
|
|
2499
|
-
const I = u.createElement("span");
|
|
2500
|
-
I.setAttribute("data-redactor-type", "variable"), I.textContent = `[[${M}]]`, y.append(I), E = C.index + C[0].length;
|
|
2501
|
-
}
|
|
2502
|
-
E !== 0 && (y.append(f.data.slice(E)), f.replaceWith(y), h = !0);
|
|
2503
|
-
}
|
|
2504
|
-
return h ? u.body.innerHTML : r;
|
|
2505
|
-
}
|
|
2506
|
-
function Fs(r) {
|
|
2507
|
-
if (!r || typeof r != "object") return;
|
|
2508
|
-
const a = r, u = (c) => {
|
|
2509
|
-
if (c && typeof c == "object" && "url" in c) {
|
|
2510
|
-
const p = c.url;
|
|
2511
|
-
return typeof p == "string" ? p : void 0;
|
|
2512
|
-
}
|
|
2513
|
-
};
|
|
2514
|
-
return typeof a.url == "string" ? a.url : u(a.file) ?? u(a.data) ?? Object.values(a).map(u).find(Boolean);
|
|
2515
|
-
}
|
|
2516
|
-
function js(r) {
|
|
2517
|
-
if (r) return r;
|
|
2518
|
-
if (typeof window > "u") return null;
|
|
2519
|
-
const a = window;
|
|
2520
|
-
return a.$R ?? a.Redactor ?? null;
|
|
2521
|
-
}
|
|
2522
|
-
const Gs = {
|
|
2523
|
-
bold: ["module.inline.format", { tag: "b" }],
|
|
2524
|
-
italic: ["module.inline.format", { tag: "i" }],
|
|
2525
|
-
strikethrough: ["module.inline.format", { tag: "del" }],
|
|
2526
|
-
bulletedList: ["module.list.toggle", "ul"],
|
|
2527
|
-
numberedList: ["module.list.toggle", "ol"],
|
|
2528
|
-
heading: ["module.block.format", { tag: "h2" }],
|
|
2529
|
-
quote: ["module.block.format", { tag: "blockquote" }],
|
|
2530
|
-
paragraph: ["module.block.format", { tag: "p" }]
|
|
2531
|
-
}, Ks = {
|
|
2532
|
-
zh: "zh_cn",
|
|
2533
|
-
pt: "pt_br"
|
|
2534
|
-
};
|
|
2535
|
-
function Vs(r) {
|
|
2536
|
-
const a = r.split("-")[0];
|
|
2537
|
-
return Ks[a] ?? a ?? "en";
|
|
2538
|
-
}
|
|
2539
|
-
const Ws = wt(
|
|
2540
|
-
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
2541
|
-
), Xs = [
|
|
2542
|
-
"ds:absolute ds:z-30",
|
|
2543
|
-
"ds:[inset-inline-start:var(--rte-typeahead-x)] ds:[inset-block-start:var(--rte-typeahead-y)]"
|
|
2544
|
-
].join(" "), Us = wt(
|
|
2545
|
-
[
|
|
2546
|
-
"ds:block ds:[inline-size:100%]",
|
|
2547
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--control-border)]",
|
|
2548
|
-
"ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
2549
|
-
"ds:shadow-[var(--shadow-md)]",
|
|
2550
|
-
"ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
|
|
2551
|
-
"ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
|
|
2552
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
2553
|
-
"ds:focus-visible:outline-solid",
|
|
2554
|
-
"ds:focus-visible:outline-[var(--ring)]",
|
|
2555
|
-
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
2556
|
-
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
2557
|
-
].join(" ")
|
|
2558
|
-
), Zs = oo({ recording: !1 }), Qs = oo({ recording: !0 });
|
|
2559
|
-
function un(r, a) {
|
|
2560
|
-
return a ? { "aria-label": r } : { tooltip: r };
|
|
2561
|
-
}
|
|
2562
|
-
const bo = ["kit", "marketplace"];
|
|
2563
|
-
function Js({
|
|
2564
|
-
groupedExtensions: r,
|
|
2565
|
-
showExtensionGroups: a,
|
|
2566
|
-
extensionPending: u,
|
|
2567
|
-
extensionSession: c,
|
|
2568
|
-
extensionError: p,
|
|
2569
|
-
openExtension: h,
|
|
2570
|
-
closeExtension: b,
|
|
2571
|
-
saveSelection: f,
|
|
2572
|
-
closeSignal: y,
|
|
2573
|
-
restoreFocusOnCloseRef: E
|
|
2574
|
-
}) {
|
|
2575
|
-
const { t: C } = se("ui"), [M, I] = R(!1), L = x(null), P = x(!1);
|
|
2576
|
-
return H(() => {
|
|
2577
|
-
I(!1);
|
|
2578
|
-
}, [y]), H(() => {
|
|
2579
|
-
P.current && !c && (P.current = !1, E.current && window.requestAnimationFrame(() => {
|
|
2580
|
-
var g;
|
|
2581
|
-
return (g = L.current) == null ? void 0 : g.focus();
|
|
2582
|
-
}));
|
|
2583
|
-
}, [c, E]), /* @__PURE__ */ N(
|
|
2584
|
-
j.Root,
|
|
2585
|
-
{
|
|
2586
|
-
open: M,
|
|
2587
|
-
onOpenChange: (g) => {
|
|
2588
|
-
g ? (f(), I(!0)) : (I(!1), u && b());
|
|
2589
|
-
},
|
|
2590
|
-
children: [
|
|
2591
|
-
/* @__PURE__ */ t(j.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2592
|
-
X,
|
|
2593
|
-
{
|
|
2594
|
-
ref: L,
|
|
2595
|
-
"data-component-part": "extensions-trigger",
|
|
2596
|
-
size: "sm",
|
|
2597
|
-
intent: "ghost",
|
|
2598
|
-
icon: /* @__PURE__ */ t(Kn, {}),
|
|
2599
|
-
"aria-label": C("editor.extensions"),
|
|
2600
|
-
onPointerDown: () => f()
|
|
2601
|
-
}
|
|
2602
|
-
) }),
|
|
2603
|
-
/* @__PURE__ */ t(
|
|
2604
|
-
j.Content,
|
|
2605
|
-
{
|
|
2606
|
-
align: "end",
|
|
2607
|
-
onCloseAutoFocus: (g) => {
|
|
2608
|
-
(c == null ? void 0 : c.extension.kind) === "panel" && !p && g.preventDefault();
|
|
2609
|
-
},
|
|
2610
|
-
children: r.map(
|
|
2611
|
-
(g, m) => g.length > 0 ? /* @__PURE__ */ N(yt, { children: [
|
|
2612
|
-
a ? /* @__PURE__ */ t(j.Label, { children: C(
|
|
2613
|
-
m === 0 ? "editor.extensionsKit" : "editor.extensionsMarketplace"
|
|
2614
|
-
) }) : null,
|
|
2615
|
-
g.map((v) => {
|
|
2616
|
-
var z;
|
|
2617
|
-
return /* @__PURE__ */ N(
|
|
2618
|
-
j.Item,
|
|
2619
|
-
{
|
|
2620
|
-
"data-extension-id": v.id,
|
|
2621
|
-
disabled: u && (c == null ? void 0 : c.extension.id) !== v.id,
|
|
2622
|
-
"aria-busy": u && (c == null ? void 0 : c.extension.id) === v.id || void 0,
|
|
2623
|
-
onSelect: (_) => {
|
|
2624
|
-
v.kind === "action" && _.preventDefault(), P.current = !0, h(v);
|
|
2625
|
-
},
|
|
2626
|
-
children: [
|
|
2627
|
-
u && (c == null ? void 0 : c.extension.id) === v.id ? /* @__PURE__ */ t(Zn, { size: "sm" }) : v.icon ?? /* @__PURE__ */ t(Kn, {}),
|
|
2628
|
-
/* @__PURE__ */ N("span", { className: "ds:flex ds:min-w-0 ds:flex-col ds:text-start", children: [
|
|
2629
|
-
/* @__PURE__ */ t("span", { children: uo(C, v.label) }),
|
|
2630
|
-
v.description ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-muted-foreground", children: v.description }) : null,
|
|
2631
|
-
((z = v.source) == null ? void 0 : z.kind) === "marketplace" ? /* @__PURE__ */ N("span", { className: "type-meta ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-muted-foreground", children: [
|
|
2632
|
-
v.source.appIconUrl ? /* @__PURE__ */ t(
|
|
2633
|
-
"img",
|
|
2634
|
-
{
|
|
2635
|
-
src: v.source.appIconUrl,
|
|
2636
|
-
alt: "",
|
|
2637
|
-
className: "ds:size-[var(--spacing-md)]"
|
|
2638
|
-
}
|
|
2639
|
-
) : null,
|
|
2640
|
-
v.source.appName
|
|
2641
|
-
] }) : null
|
|
2642
|
-
] })
|
|
2643
|
-
]
|
|
2644
|
-
},
|
|
2645
|
-
v.id
|
|
2646
|
-
);
|
|
2647
|
-
})
|
|
2648
|
-
] }, bo[m]) : null
|
|
2649
|
-
)
|
|
2650
|
-
}
|
|
2651
|
-
)
|
|
2652
|
-
]
|
|
2653
|
-
}
|
|
2654
|
-
);
|
|
2655
|
-
}
|
|
2656
|
-
const Ys = li(
|
|
2657
|
-
({
|
|
2658
|
-
id: r,
|
|
2659
|
-
defaultValue: a,
|
|
2660
|
-
value: u,
|
|
2661
|
-
onChange: c,
|
|
2662
|
-
toolbar: p = "standard",
|
|
2663
|
-
placeholder: h,
|
|
2664
|
-
readOnly: b = !1,
|
|
2665
|
-
ariaLabel: f,
|
|
2666
|
-
minHeight: y,
|
|
2667
|
-
showExtensions: E,
|
|
2668
|
-
extensions: C,
|
|
2669
|
-
extensionContext: M,
|
|
2670
|
-
onExtensionRun: I,
|
|
2671
|
-
className: L,
|
|
2672
|
-
redactor: P,
|
|
2673
|
-
options: g,
|
|
2674
|
-
plugins: m,
|
|
2675
|
-
lang: v,
|
|
2676
|
-
imageUploadUrl: z,
|
|
2677
|
-
onUploadImage: _,
|
|
2678
|
-
onKeyDown: D,
|
|
2679
|
-
onRequestAiDraft: K,
|
|
2680
|
-
aiDraftFormat: G = "html",
|
|
2681
|
-
aiPrivacyNotice: B,
|
|
2682
|
-
aiConsent: k,
|
|
2683
|
-
aiConsentHeadingLevel: le,
|
|
2684
|
-
onDictate: F,
|
|
2685
|
-
onProofread: U,
|
|
2686
|
-
onAutoFormat: re,
|
|
2687
|
-
aiTemplates: Y,
|
|
2688
|
-
onAiApplied: ke,
|
|
2689
|
-
aiSparkle: ee = !0,
|
|
2690
|
-
selectionToolbar: _e,
|
|
2691
|
-
variables: V,
|
|
2692
|
-
recentVariableTokens: oe,
|
|
2693
|
-
onVariableInserted: Z,
|
|
2694
|
-
validateVariable: Ne,
|
|
2695
|
-
onVariableValidityChange: kt,
|
|
2696
|
-
renderHelpMeWrite: Te,
|
|
2697
|
-
onAiCreditsExhausted: xt,
|
|
2698
|
-
aiCreditsNotice: Dt
|
|
2699
|
-
}, W) => {
|
|
2700
|
-
var Dr, Pr;
|
|
2701
|
-
const { t: A, i18n: Ee } = se("ui"), ce = Ge(), ge = ht(
|
|
2702
|
-
() => `rte-${ce.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
2703
|
-
[ce]
|
|
2704
|
-
), $ = `#${ge}`, te = x(null), ie = x(null), Ie = x(null), hn = x(!1), Ct = x(b), Q = x(null), At = x(null), [he, er] = R(!1), [Nt, Fe] = R(!1), [xe, tr] = R(null), [pn, nr] = R(!1), [bn, vn] = R(!1), Tt = x(null), Pt = x(I);
|
|
2705
|
-
Pt.current = I;
|
|
2706
|
-
const Ke = x(null), [vo, yo] = R(0), rr = x(!0), yn = w((e = !0) => {
|
|
2707
|
-
rr.current = e, yo((n) => n + 1);
|
|
2708
|
-
}, []), wn = w(() => {
|
|
2709
|
-
var e, n;
|
|
2710
|
-
(e = Tt.current) == null || e.abort(), Tt.current = null, (n = Ke.current) == null || n.call(Ke, { status: "aborted" }), tr(null), vn(!1), nr(!1);
|
|
2711
|
-
}, []), $e = w(
|
|
2712
|
-
(e = !0) => {
|
|
2713
|
-
wn(), yn(e);
|
|
2714
|
-
},
|
|
2715
|
-
[wn, yn]
|
|
2716
|
-
);
|
|
2717
|
-
H(
|
|
2718
|
-
() => () => {
|
|
2719
|
-
var e, n;
|
|
2720
|
-
(e = Tt.current) == null || e.abort(), (n = Ke.current) == null || n.call(Ke, { status: "aborted" });
|
|
2721
|
-
},
|
|
2722
|
-
[]
|
|
2723
|
-
);
|
|
2724
|
-
const [wo, ko] = R(""), [xo, Co] = R(
|
|
2725
|
-
"document"
|
|
2726
|
-
), [Ao, kn] = R(!1), Ve = x(xt), xn = x(Te);
|
|
2727
|
-
H(() => {
|
|
2728
|
-
Ve.current = xt, xn.current = Te;
|
|
2729
|
-
}, [xt, Te]);
|
|
2730
|
-
const qt = x(null), pe = ht(
|
|
2731
|
-
() => new Map(
|
|
2732
|
-
(V ?? []).map((e) => e.token).filter((e) => qn.test(e)).map((e) => [e.toLowerCase(), e])
|
|
2733
|
-
),
|
|
2734
|
-
[V]
|
|
2735
|
-
), or = ht(
|
|
2736
|
-
() => new Map(
|
|
2737
|
-
(V ?? []).map(
|
|
2738
|
-
(e) => [e.token.toLowerCase(), e.label]
|
|
2739
|
-
)
|
|
2740
|
-
),
|
|
2741
|
-
[V]
|
|
2742
|
-
), ot = x(pe);
|
|
2743
|
-
H(() => {
|
|
2744
|
-
ot.current = pe;
|
|
2745
|
-
}, [pe]);
|
|
2746
|
-
const ir = ht(
|
|
2747
|
-
() => (V ?? []).filter((e) => qn.test(e.token)),
|
|
2748
|
-
[V]
|
|
2749
|
-
), Cn = x(Ne);
|
|
2750
|
-
H(() => {
|
|
2751
|
-
Cn.current = Ne;
|
|
2752
|
-
}, [Ne]);
|
|
2753
|
-
const An = Ne !== void 0, Nn = w(
|
|
2754
|
-
(e) => An && Cn.current ? Cn.current(e) : pe.has(e.toLowerCase()),
|
|
2755
|
-
[An, pe]
|
|
2756
|
-
), it = pe.size > 0 || An, [at, ar] = R([]), We = x(kt);
|
|
2757
|
-
H(() => {
|
|
2758
|
-
We.current = kt;
|
|
2759
|
-
}, [kt]);
|
|
2760
|
-
const He = x(() => {
|
|
2761
|
-
}), [Tn, No] = R(
|
|
2762
|
-
() => /* @__PURE__ */ new Set()
|
|
2763
|
-
), Bt = x(null), [To, Eo] = R(
|
|
2764
|
-
null
|
|
2765
|
-
), Ft = w((e) => {
|
|
2766
|
-
Bt.current = e, Eo(e);
|
|
2767
|
-
}, []), Et = x(null), jt = x(null), be = x(c), Gt = x(D);
|
|
2768
|
-
H(() => {
|
|
2769
|
-
be.current = c, Gt.current = D;
|
|
2770
|
-
}, [c, D]);
|
|
2771
|
-
const Ro = x(
|
|
2772
|
-
(() => {
|
|
2773
|
-
const e = u ?? a ?? "";
|
|
2774
|
-
return e ? Me(e) : "";
|
|
2775
|
-
})()
|
|
2776
|
-
), ue = w(() => {
|
|
2777
|
-
var n;
|
|
2778
|
-
const e = ie.current;
|
|
2779
|
-
if (e)
|
|
2780
|
-
try {
|
|
2781
|
-
const o = e($, "source.getCode");
|
|
2782
|
-
if (typeof o == "string") return Yr(o);
|
|
2783
|
-
} catch {
|
|
2784
|
-
}
|
|
2785
|
-
return ((n = te.current) == null ? void 0 : n.value) ?? "";
|
|
2786
|
-
}, [$]);
|
|
2787
|
-
H(() => {
|
|
2788
|
-
He.current = () => {
|
|
2789
|
-
var o;
|
|
2790
|
-
if (!it) {
|
|
2791
|
-
ar((i) => i.length ? [] : i);
|
|
2792
|
-
return;
|
|
2793
|
-
}
|
|
2794
|
-
const e = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in");
|
|
2795
|
-
e == null || e.querySelectorAll('[data-redactor-type="variable"]').forEach((i) => {
|
|
2796
|
-
const l = /^\[\[([A-Za-z0-9_]+)\]\]$/.exec(
|
|
2797
|
-
i.textContent ?? ""
|
|
2798
|
-
), s = !l || !Nn(l[1]);
|
|
2799
|
-
i.classList.contains(Un) !== s && i.classList.toggle(Un, s);
|
|
2800
|
-
const d = l ? or.get(l[1].toLowerCase()) ?? l[1] : i.textContent ?? "";
|
|
2801
|
-
i.getAttribute("data-label") !== d && i.setAttribute("data-label", d);
|
|
2802
|
-
const T = i.textContent ?? "";
|
|
2803
|
-
i.getAttribute("title") !== T && i.setAttribute("title", T);
|
|
2804
|
-
});
|
|
2805
|
-
const n = Array.from(
|
|
2806
|
-
new Set(
|
|
2807
|
-
Os(ue()).filter(
|
|
2808
|
-
(i) => !Nn(i)
|
|
2809
|
-
)
|
|
2810
|
-
)
|
|
2811
|
-
);
|
|
2812
|
-
ar(
|
|
2813
|
-
(i) => i.length === n.length && i.every((l, s) => l === n[s]) ? i : n
|
|
2814
|
-
);
|
|
2815
|
-
}, He.current();
|
|
2816
|
-
}, [it, Nn, or, ue]), H(() => {
|
|
2817
|
-
var o;
|
|
2818
|
-
const n = ((o = Q.current) == null ? void 0 : o.querySelector(".redactor-in")) ?? te.current;
|
|
2819
|
-
n && (at.length > 0 ? (n.setAttribute("aria-invalid", "true"), n.setAttribute("aria-describedby", `${ge}-variables-error`)) : (n.removeAttribute("aria-invalid"), n.removeAttribute("aria-describedby")));
|
|
2820
|
-
}, [at, ge, he]);
|
|
2821
|
-
const En = x(!1);
|
|
2822
|
-
H(() => {
|
|
2823
|
-
var e, n;
|
|
2824
|
-
it ? (En.current = !0, (e = We.current) == null || e.call(We, at)) : En.current && (En.current = !1, (n = We.current) == null || n.call(We, []));
|
|
2825
|
-
}, [at, it]), H(() => {
|
|
2826
|
-
Ne && He.current();
|
|
2827
|
-
}, [Ne]);
|
|
2828
|
-
const me = w(
|
|
2829
|
-
(e, ...n) => {
|
|
2830
|
-
const o = ie.current;
|
|
2831
|
-
if (!o) return !1;
|
|
2832
|
-
const i = Ct.current;
|
|
2833
|
-
if (i)
|
|
2834
|
-
try {
|
|
2835
|
-
o($, "disableReadOnly");
|
|
2836
|
-
} catch {
|
|
2837
|
-
}
|
|
2838
|
-
try {
|
|
2839
|
-
return o($, e, ...n), !0;
|
|
2840
|
-
} catch {
|
|
2841
|
-
return !1;
|
|
2842
|
-
} finally {
|
|
2843
|
-
if (i)
|
|
2844
|
-
try {
|
|
2845
|
-
o($, "enableReadOnly");
|
|
2846
|
-
} catch {
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
},
|
|
2850
|
-
[$]
|
|
2851
|
-
), fe = w(
|
|
2852
|
-
(e, n) => {
|
|
2853
|
-
var q;
|
|
2854
|
-
const o = (n == null ? void 0 : n.asHtml) ?? !0, i = o ? Me(e) : e;
|
|
2855
|
-
if (me(o ? "insertion.insertHtml" : "insertion.insertText", i)) return;
|
|
2856
|
-
const s = te.current;
|
|
2857
|
-
if (!s) return;
|
|
2858
|
-
const d = s.selectionStart ?? s.value.length, T = s.selectionEnd ?? s.value.length;
|
|
2859
|
-
s.value = s.value.slice(0, d) + i + s.value.slice(T);
|
|
2860
|
-
const S = d + i.length;
|
|
2861
|
-
try {
|
|
2862
|
-
s.setSelectionRange(S, S);
|
|
2863
|
-
} catch {
|
|
2864
|
-
}
|
|
2865
|
-
(q = be.current) == null || q.call(be, { html: Me(s.value), markdown: "" });
|
|
2866
|
-
},
|
|
2867
|
-
[me]
|
|
2868
|
-
), Ce = x(null), ve = w(() => {
|
|
2869
|
-
var i;
|
|
2870
|
-
const e = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in"), n = typeof window < "u" ? window.getSelection() : null, o = /* @__PURE__ */ new Set();
|
|
2871
|
-
if (e && n && n.anchorNode && e.contains(n.anchorNode) && typeof document.queryCommandState == "function") {
|
|
2872
|
-
n.rangeCount > 0 && (Ce.current = n.getRangeAt(0).cloneRange());
|
|
2873
|
-
try {
|
|
2874
|
-
document.queryCommandState("bold") && o.add("bold"), document.queryCommandState("italic") && o.add("italic"), document.queryCommandState("underline") && o.add("underline"), document.queryCommandState("strikeThrough") && o.add("strike"), document.queryCommandState("insertUnorderedList") && o.add("ul"), document.queryCommandState("insertOrderedList") && o.add("ol");
|
|
2875
|
-
const l = String(
|
|
2876
|
-
document.queryCommandValue("formatBlock") || ""
|
|
2877
|
-
).toLowerCase();
|
|
2878
|
-
/^h[1-6]$/.test(l) ? (o.add("heading"), o.add(l)) : l === "blockquote" ? o.add("quote") : o.add("paragraph");
|
|
2879
|
-
const s = n.anchorNode.nodeType === Node.TEXT_NODE ? n.anchorNode.parentElement : n.anchorNode;
|
|
2880
|
-
s && e.contains(s) && s.closest("table") && o.add("table");
|
|
2881
|
-
const d = s == null ? void 0 : s.closest(
|
|
2882
|
-
"p, div, blockquote, pre, h1, h2, h3, h4, h5, h6, li, td, th"
|
|
2883
|
-
);
|
|
2884
|
-
if (d && e.contains(d) && d !== e) {
|
|
2885
|
-
const T = getComputedStyle(d), S = T.direction === "rtl", q = T.textAlign.replace(/^-webkit-/, ""), ne = S ? "right" : "left", Re = S ? "left" : "right", J = ["left", "center", "right", "justify"].includes(q) ? q : q === "end" ? Re : ne;
|
|
2886
|
-
o.add(`align-${J}`);
|
|
2887
|
-
}
|
|
2888
|
-
} catch {
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
No(
|
|
2892
|
-
(l) => l.size === o.size && [...o].every((s) => l.has(s)) ? l : o
|
|
2893
|
-
);
|
|
2894
|
-
}, []), Xe = w(
|
|
2895
|
-
(e, ...n) => {
|
|
2896
|
-
me(e, ...n), typeof window < "u" ? window.requestAnimationFrame(() => ve()) : ve();
|
|
2897
|
-
},
|
|
2898
|
-
[me, ve]
|
|
2899
|
-
);
|
|
2900
|
-
H(() => {
|
|
2901
|
-
const e = Q.current;
|
|
2902
|
-
if (!e) return;
|
|
2903
|
-
const n = {
|
|
2904
|
-
b: ["module.inline.format", { tag: "b" }],
|
|
2905
|
-
i: ["module.inline.format", { tag: "i" }],
|
|
2906
|
-
u: ["module.inline.format", { tag: "u" }]
|
|
2907
|
-
}, o = (i) => {
|
|
2908
|
-
if (!(i.metaKey || i.ctrlKey) || i.altKey || i.shiftKey || i.isComposing) return;
|
|
2909
|
-
const l = n[i.key.toLowerCase()];
|
|
2910
|
-
if (!l) return;
|
|
2911
|
-
const s = e.querySelector(".redactor-in");
|
|
2912
|
-
!s || !(i.target instanceof Node) || !s.contains(i.target) || Ct.current || (i.preventDefault(), i.stopImmediatePropagation(), Xe(...l));
|
|
2913
|
-
};
|
|
2914
|
-
return e.addEventListener("keydown", o, !0), () => e.removeEventListener("keydown", o, !0);
|
|
2915
|
-
}, [Xe]), H(() => {
|
|
2916
|
-
const e = Q.current;
|
|
2917
|
-
if (!e) return;
|
|
2918
|
-
let n;
|
|
2919
|
-
const o = (l) => {
|
|
2920
|
-
var S;
|
|
2921
|
-
const s = (S = window.getSelection()) == null ? void 0 : S.anchorNode;
|
|
2922
|
-
if (!s) return null;
|
|
2923
|
-
const d = s.nodeType === Node.TEXT_NODE ? s.parentElement : s, T = (d == null ? void 0 : d.closest(Is)) ?? null;
|
|
2924
|
-
return T && T !== l && l.contains(T) ? T : null;
|
|
2925
|
-
}, i = (l) => {
|
|
2926
|
-
if (l.key !== "Enter" || l.shiftKey || l.isComposing)
|
|
2927
|
-
return;
|
|
2928
|
-
const s = e.querySelector(".redactor-in");
|
|
2929
|
-
if (!s || !(l.target instanceof Node) || !s.contains(l.target) || Ct.current)
|
|
2930
|
-
return;
|
|
2931
|
-
const d = o(s), T = d == null ? void 0 : d.style.textAlign;
|
|
2932
|
-
if (!d || !T) return;
|
|
2933
|
-
const S = d.tagName === "LI" ? d.style.listStylePosition : "";
|
|
2934
|
-
clearTimeout(n), n = setTimeout(() => {
|
|
2935
|
-
const q = o(s);
|
|
2936
|
-
if (!q || q === d || q.style.textAlign) return;
|
|
2937
|
-
q.style.textAlign = T, S && q.tagName === "LI" && (q.style.listStylePosition = S);
|
|
2938
|
-
const ne = ie.current;
|
|
2939
|
-
if (ne)
|
|
2940
|
-
try {
|
|
2941
|
-
ne($, "broadcast", "hardsync");
|
|
2942
|
-
} catch {
|
|
2943
|
-
}
|
|
2944
|
-
ve();
|
|
2945
|
-
}, $s);
|
|
2946
|
-
};
|
|
2947
|
-
return e.addEventListener("keydown", i, !0), () => {
|
|
2948
|
-
clearTimeout(n), e.removeEventListener("keydown", i, !0);
|
|
2949
|
-
};
|
|
2950
|
-
}, [$, ve]);
|
|
2951
|
-
const Ue = w(
|
|
2952
|
-
(e) => {
|
|
2953
|
-
fe(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ve());
|
|
2954
|
-
},
|
|
2955
|
-
[fe, ve]
|
|
2956
|
-
), [st, Rn] = R(null), Kt = x(null), Mn = `${ge}-variables`, sr = x(null), [Sn, Mo] = R(void 0), ze = w(() => {
|
|
2957
|
-
Kt.current = null, Rn(null);
|
|
2958
|
-
}, []), Vt = w(
|
|
2959
|
-
(e, n) => {
|
|
2960
|
-
const o = window.getSelection();
|
|
2961
|
-
if (!o) return;
|
|
2962
|
-
const i = document.createRange();
|
|
2963
|
-
i.setStart(n.node, n.start), i.setEnd(n.node, n.end), o.removeAllRanges(), o.addRange(i), Ue(ro(e)), window.requestAnimationFrame(() => He.current());
|
|
2964
|
-
},
|
|
2965
|
-
[Ue]
|
|
2966
|
-
);
|
|
2967
|
-
H(() => {
|
|
2968
|
-
const e = Q.current;
|
|
2969
|
-
if (!e || !it) return;
|
|
2970
|
-
const n = () => {
|
|
2971
|
-
var qe;
|
|
2972
|
-
const l = e.querySelector(".redactor-in"), s = window.getSelection();
|
|
2973
|
-
if (!l || !s || s.rangeCount === 0 || !s.isCollapsed) {
|
|
2974
|
-
ze();
|
|
2975
|
-
return;
|
|
2976
|
-
}
|
|
2977
|
-
const { startContainer: d, startOffset: T } = s.getRangeAt(0);
|
|
2978
|
-
if (d.nodeType !== Node.TEXT_NODE || !l.contains(d) || (((qe = d.parentElement) == null ? void 0 : qe.closest(
|
|
2979
|
-
'[data-redactor-type="variable"]'
|
|
2980
|
-
)) ?? null) !== null) {
|
|
2981
|
-
ze();
|
|
2982
|
-
return;
|
|
2983
|
-
}
|
|
2984
|
-
const S = d, q = S.data.slice(0, T), ne = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(q);
|
|
2985
|
-
if (ne) {
|
|
2986
|
-
ze(), Vt(
|
|
2987
|
-
pe.get(ne[1].toLowerCase()) ?? ne[1],
|
|
2988
|
-
{ node: S, start: T - ne[0].length, end: T }
|
|
2989
|
-
);
|
|
2990
|
-
return;
|
|
2991
|
-
}
|
|
2992
|
-
const Re = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(q), J = At.current;
|
|
2993
|
-
if (!Re || !J || (V ?? []).length === 0) {
|
|
2994
|
-
ze();
|
|
2995
|
-
return;
|
|
2996
|
-
}
|
|
2997
|
-
const Pe = {
|
|
2998
|
-
node: S,
|
|
2999
|
-
start: T - Re[0].length,
|
|
3000
|
-
end: T
|
|
3001
|
-
};
|
|
3002
|
-
Kt.current = Pe;
|
|
3003
|
-
const gt = document.createRange();
|
|
3004
|
-
gt.setStart(S, Pe.start), gt.setEnd(S, Pe.end);
|
|
3005
|
-
const rt = gt.getBoundingClientRect(), It = J.getBoundingClientRect(), Dn = getComputedStyle(J).direction === "rtl";
|
|
3006
|
-
Rn({
|
|
3007
|
-
query: Re[1],
|
|
3008
|
-
left: Dn ? It.right - rt.right : rt.left - It.left,
|
|
3009
|
-
top: rt.bottom - It.top + 4
|
|
3010
|
-
});
|
|
3011
|
-
}, o = (l) => {
|
|
3012
|
-
var d;
|
|
3013
|
-
if (!Kt.current || !["ArrowDown", "ArrowUp", "Home", "End", "Enter", "Escape"].includes(
|
|
3014
|
-
l.key
|
|
3015
|
-
))
|
|
3016
|
-
return;
|
|
3017
|
-
(((d = sr.current) == null ? void 0 : d.handleKeyDown(l)) ?? !1) && (l.preventDefault(), l.stopImmediatePropagation());
|
|
3018
|
-
}, i = () => ze();
|
|
3019
|
-
return e.addEventListener("input", n), e.addEventListener("keydown", o, !0), e.addEventListener("focusout", i), () => {
|
|
3020
|
-
e.removeEventListener("input", n), e.removeEventListener("keydown", o, !0), e.removeEventListener("focusout", i);
|
|
3021
|
-
};
|
|
3022
|
-
}, [
|
|
3023
|
-
it,
|
|
3024
|
-
pe,
|
|
3025
|
-
V,
|
|
3026
|
-
Vt,
|
|
3027
|
-
ze
|
|
3028
|
-
]), H(() => {
|
|
3029
|
-
var n;
|
|
3030
|
-
const e = (n = Q.current) == null ? void 0 : n.querySelector(".redactor-in");
|
|
3031
|
-
e && (st ? (e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", `${Mn}-list`), Sn ? e.setAttribute("aria-activedescendant", Sn) : e.removeAttribute("aria-activedescendant")) : (e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-activedescendant")));
|
|
3032
|
-
}, [st, Mn, Sn]);
|
|
3033
|
-
const So = w(
|
|
3034
|
-
(e) => {
|
|
3035
|
-
const n = Kt.current;
|
|
3036
|
-
ze(), n && Vt(e.token, n), Z == null || Z(e.token);
|
|
3037
|
-
},
|
|
3038
|
-
[ze, Vt, Z]
|
|
3039
|
-
), zo = w(() => {
|
|
3040
|
-
ze();
|
|
3041
|
-
}, [ze]), Lo = w((e) => {
|
|
3042
|
-
Rn((n) => n && { ...n, query: e });
|
|
3043
|
-
}, []), lt = w(() => {
|
|
3044
|
-
var n;
|
|
3045
|
-
if (typeof window < "u") {
|
|
3046
|
-
const o = (n = Q.current) == null ? void 0 : n.querySelector(".redactor-in"), i = window.getSelection();
|
|
3047
|
-
o && i && i.rangeCount > 0 && i.anchorNode && o.contains(i.anchorNode) && (Ce.current = i.getRangeAt(0).cloneRange());
|
|
3048
|
-
}
|
|
3049
|
-
const e = ie.current;
|
|
3050
|
-
if (e)
|
|
3051
|
-
try {
|
|
3052
|
-
e($, "selection.save");
|
|
3053
|
-
} catch {
|
|
3054
|
-
}
|
|
3055
|
-
}, [$]), we = w(() => {
|
|
3056
|
-
const e = ie.current;
|
|
3057
|
-
if (!e) return;
|
|
3058
|
-
const n = Ce.current;
|
|
3059
|
-
try {
|
|
3060
|
-
e($, "editor.focus");
|
|
3061
|
-
} catch {
|
|
3062
|
-
}
|
|
3063
|
-
if (n && typeof window < "u") {
|
|
3064
|
-
const o = window.getSelection();
|
|
3065
|
-
if (o)
|
|
3066
|
-
try {
|
|
3067
|
-
o.removeAllRanges(), o.addRange(n);
|
|
3068
|
-
return;
|
|
3069
|
-
} catch {
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
try {
|
|
3073
|
-
e($, "selection.restore");
|
|
3074
|
-
} catch {
|
|
3075
|
-
}
|
|
3076
|
-
}, [$]), _o = w(() => {
|
|
3077
|
-
var o;
|
|
3078
|
-
if (typeof window > "u") return "";
|
|
3079
|
-
const e = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), n = window.getSelection();
|
|
3080
|
-
return !e || !n || !n.anchorNode || !e.contains(n.anchorNode) ? "" : n.toString();
|
|
3081
|
-
}, []), Io = w(() => {
|
|
3082
|
-
var l;
|
|
3083
|
-
if (typeof window > "u") return null;
|
|
3084
|
-
const e = (l = Q.current) == null ? void 0 : l.querySelector(".redactor-in"), n = window.getSelection();
|
|
3085
|
-
if (!e || !n || n.rangeCount === 0) return null;
|
|
3086
|
-
const o = n.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
|
|
3087
|
-
return !i || !e.contains(i) ? null : i.closest("table");
|
|
3088
|
-
}, []), lr = x(null), Wt = w(() => {
|
|
3089
|
-
var l;
|
|
3090
|
-
if (typeof window > "u") return null;
|
|
3091
|
-
const e = (l = Q.current) == null ? void 0 : l.querySelector(".redactor-in"), n = window.getSelection();
|
|
3092
|
-
if (!e || !n || n.rangeCount === 0) return null;
|
|
3093
|
-
const o = n.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
|
|
3094
|
-
return !i || !e.contains(i) ? null : i.closest("td,th");
|
|
3095
|
-
}, []), $o = w(() => {
|
|
3096
|
-
lr.current = Wt();
|
|
3097
|
-
}, [Wt]), Ho = w(
|
|
3098
|
-
(e, n) => {
|
|
3099
|
-
var s;
|
|
3100
|
-
const o = lr.current ?? Wt();
|
|
3101
|
-
if (!o) return;
|
|
3102
|
-
const i = e === "row" ? Array.from(((s = o.closest("tr")) == null ? void 0 : s.children) ?? [o]).filter(
|
|
3103
|
-
(d) => d instanceof HTMLElement && (d.tagName === "TD" || d.tagName === "TH")
|
|
3104
|
-
) : [o], l = ie.current;
|
|
3105
|
-
if (l)
|
|
3106
|
-
try {
|
|
3107
|
-
l($, "module.buffer.trigger");
|
|
3108
|
-
} catch {
|
|
3109
|
-
}
|
|
3110
|
-
for (const d of i)
|
|
3111
|
-
n ? d.style.setProperty("background-color", n) : d.style.removeProperty("background-color");
|
|
3112
|
-
if (l)
|
|
3113
|
-
try {
|
|
3114
|
-
l($, "broadcast", "hardsync");
|
|
3115
|
-
} catch {
|
|
3116
|
-
}
|
|
3117
|
-
typeof window < "u" && window.requestAnimationFrame(() => ve());
|
|
3118
|
-
},
|
|
3119
|
-
[Wt, $, ve]
|
|
3120
|
-
);
|
|
3121
|
-
H(() => {
|
|
3122
|
-
const e = Q.current;
|
|
3123
|
-
if (typeof window > "u" || !e) return;
|
|
3124
|
-
const n = (l) => {
|
|
3125
|
-
const s = e.querySelector(".redactor-in"), d = l.target;
|
|
3126
|
-
if (!s || !(d instanceof Node) || !s.contains(d))
|
|
3127
|
-
return;
|
|
3128
|
-
const T = d instanceof Element ? d.closest("img") : null;
|
|
3129
|
-
Ft(T && s.contains(T) ? T : null);
|
|
3130
|
-
}, o = (l) => {
|
|
3131
|
-
l.key === "Escape" && Bt.current && Ft(null);
|
|
3132
|
-
}, i = (l) => {
|
|
3133
|
-
const s = l.relatedTarget;
|
|
3134
|
-
(!(s instanceof Node) || !e.contains(s)) && Ft(null);
|
|
3135
|
-
};
|
|
3136
|
-
return e.addEventListener("click", n), e.addEventListener("keydown", o), e.addEventListener("focusout", i), () => {
|
|
3137
|
-
e.removeEventListener("click", n), e.removeEventListener("keydown", o), e.removeEventListener("focusout", i);
|
|
3138
|
-
};
|
|
3139
|
-
}, [Ft]);
|
|
3140
|
-
const Oo = w(
|
|
3141
|
-
(e) => {
|
|
3142
|
-
const n = Bt.current;
|
|
3143
|
-
if (!n) return;
|
|
3144
|
-
const o = Wn.includes(
|
|
3145
|
-
e
|
|
3146
|
-
) ? Wn : ho, i = ie.current;
|
|
3147
|
-
if (i)
|
|
3148
|
-
try {
|
|
3149
|
-
i($, "module.buffer.trigger");
|
|
3150
|
-
} catch {
|
|
3151
|
-
}
|
|
3152
|
-
for (const l of o) n.classList.remove(l);
|
|
3153
|
-
if (n.classList.add(e), i)
|
|
3154
|
-
try {
|
|
3155
|
-
i($, "broadcast", "hardsync");
|
|
3156
|
-
} catch {
|
|
3157
|
-
}
|
|
3158
|
-
typeof window < "u" && window.requestAnimationFrame(() => ve());
|
|
3159
|
-
},
|
|
3160
|
-
[$, ve]
|
|
3161
|
-
), Do = w(
|
|
3162
|
-
(e) => {
|
|
3163
|
-
const n = Bt.current;
|
|
3164
|
-
if (!n) return;
|
|
3165
|
-
const o = ie.current;
|
|
3166
|
-
if (o)
|
|
3167
|
-
try {
|
|
3168
|
-
o($, "module.buffer.trigger");
|
|
3169
|
-
} catch {
|
|
3170
|
-
}
|
|
3171
|
-
if (n.style.setProperty("width", `${e}%`), o)
|
|
3172
|
-
try {
|
|
3173
|
-
o($, "broadcast", "hardsync");
|
|
3174
|
-
} catch {
|
|
3175
|
-
}
|
|
3176
|
-
typeof window < "u" && window.requestAnimationFrame(() => ve());
|
|
3177
|
-
},
|
|
3178
|
-
[$, ve]
|
|
3179
|
-
), Po = w(
|
|
3180
|
-
(e) => {
|
|
3181
|
-
var o;
|
|
3182
|
-
const n = ie.current;
|
|
3183
|
-
if (n && typeof window < "u") {
|
|
3184
|
-
const i = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), l = window.getSelection(), s = l == null ? void 0 : l.anchorNode, d = s && s.nodeType === Node.TEXT_NODE ? s.parentElement : s, T = d && (i != null && i.contains(d)) ? d.closest("ul,ol") : null;
|
|
3185
|
-
if (T)
|
|
3186
|
-
try {
|
|
3187
|
-
n($, "caret.setAfter", T);
|
|
3188
|
-
} catch {
|
|
3189
|
-
}
|
|
3190
|
-
}
|
|
3191
|
-
Ue(e), typeof window < "u" && window.requestAnimationFrame(() => {
|
|
3192
|
-
var l;
|
|
3193
|
-
const i = (l = Q.current) == null ? void 0 : l.querySelector(".redactor-in");
|
|
3194
|
-
i == null || i.querySelectorAll("table td, table th").forEach((s) => {
|
|
3195
|
-
let d = s.lastChild;
|
|
3196
|
-
for (; d && d.nodeType === Node.TEXT_NODE && !(d.textContent ?? "").trim(); ) {
|
|
3197
|
-
const T = d.previousSibling;
|
|
3198
|
-
s.removeChild(d), d = T;
|
|
3199
|
-
}
|
|
3200
|
-
});
|
|
3201
|
-
});
|
|
3202
|
-
},
|
|
3203
|
-
[Ue, $]
|
|
3204
|
-
), cr = w(
|
|
3205
|
-
async (e, n) => {
|
|
3206
|
-
if (_) return _(e, n);
|
|
3207
|
-
if (!z) throw new Error("No image upload URL configured.");
|
|
3208
|
-
const o = new FormData();
|
|
3209
|
-
o.append("file", e);
|
|
3210
|
-
const i = await fetch(z, {
|
|
3211
|
-
method: "POST",
|
|
3212
|
-
body: o,
|
|
3213
|
-
credentials: "same-origin",
|
|
3214
|
-
signal: n
|
|
3215
|
-
});
|
|
3216
|
-
if (!i.ok) throw new Error(`Image upload failed (${i.status}).`);
|
|
3217
|
-
const l = Fs(await i.json());
|
|
3218
|
-
if (!l) throw new Error("Image upload response contained no URL.");
|
|
3219
|
-
return l;
|
|
3220
|
-
},
|
|
3221
|
-
[z, _]
|
|
3222
|
-
), Ze = pi({ enabled: ee }), {
|
|
3223
|
-
start: ct,
|
|
3224
|
-
land: Oe,
|
|
3225
|
-
reset: dt
|
|
3226
|
-
} = Ze, Rt = x(null), ut = x(null), [ye, dr] = R(!1), [qo, ur] = R("listening"), [Bo, mr] = R(!1), [Fo, Mt] = R(""), mt = w(() => {
|
|
3227
|
-
const e = ut.current;
|
|
3228
|
-
e != null && e.parentNode && e.parentNode.removeChild(e), ut.current = null;
|
|
3229
|
-
}, []), ft = x(""), Xt = w((e) => {
|
|
3230
|
-
var s, d;
|
|
3231
|
-
const n = (s = Q.current) == null ? void 0 : s.querySelector(
|
|
3232
|
-
".redactor-in"
|
|
3233
|
-
);
|
|
3234
|
-
if (!n) return;
|
|
3235
|
-
let o = ut.current;
|
|
3236
|
-
if (!o || !n.contains(o)) {
|
|
3237
|
-
o = document.createElement("span"), o.setAttribute("data-rte-interim", ""), o.setAttribute("contenteditable", "false");
|
|
3238
|
-
const T = window.getSelection();
|
|
3239
|
-
if (T && T.rangeCount > 0 && n.contains(T.anchorNode)) {
|
|
3240
|
-
const S = T.getRangeAt(0).cloneRange();
|
|
3241
|
-
S.collapse(!1), S.insertNode(o);
|
|
3242
|
-
} else {
|
|
3243
|
-
const S = n.lastElementChild;
|
|
3244
|
-
S !== null && S.tagName === "P" && S === n.firstElementChild && (S.textContent ?? "").replace(/[\ufeff\s]/g, "") === "" && Array.from(S.children).every((ne) => ne.tagName === "BR") ? ((d = S.lastChild) == null ? void 0 : d.nodeName) === "BR" ? S.insertBefore(o, S.lastChild) : S.appendChild(o) : n.appendChild(o);
|
|
3245
|
-
}
|
|
3246
|
-
ut.current = o;
|
|
3247
|
-
}
|
|
3248
|
-
ft.current ? o.setAttribute("data-hint", ft.current) : o.removeAttribute("data-hint");
|
|
3249
|
-
const i = o.previousSibling, l = (i == null ? void 0 : i.nodeType) === Node.TEXT_NODE ? i.data.replace(/\ufeff/g, "").slice(-1) : "";
|
|
3250
|
-
o.toggleAttribute("data-gap", /\S/.test(l) && l !== " "), o.textContent = e;
|
|
3251
|
-
}, []), fr = w(
|
|
3252
|
-
(e) => {
|
|
3253
|
-
var n;
|
|
3254
|
-
ft.current = e, Xt(((n = ut.current) == null ? void 0 : n.textContent) ?? "");
|
|
3255
|
-
},
|
|
3256
|
-
[Xt]
|
|
3257
|
-
), Ut = x(null), Zt = w(
|
|
3258
|
-
(e = !1) => {
|
|
3259
|
-
var o;
|
|
3260
|
-
Ut.current && (Ut.current.keepLate = e), (o = Rt.current) == null || o.abort(), ft.current = "";
|
|
3261
|
-
const n = ut.current;
|
|
3262
|
-
n && !n.textContent ? mt() : n == null || n.removeAttribute("data-hint");
|
|
3263
|
-
},
|
|
3264
|
-
[mt]
|
|
3265
|
-
), gr = w(() => {
|
|
3266
|
-
var s;
|
|
3267
|
-
if (typeof window > "u") return !1;
|
|
3268
|
-
const e = window.getSelection(), n = (s = Q.current) == null ? void 0 : s.querySelector(".redactor-in");
|
|
3269
|
-
if (!e || e.rangeCount === 0 || !n) return !1;
|
|
3270
|
-
const { startContainer: o, startOffset: i } = e.getRangeAt(0);
|
|
3271
|
-
if (!n.contains(o) || o.nodeType !== Node.TEXT_NODE || i === 0)
|
|
3272
|
-
return !1;
|
|
3273
|
-
const l = o.data.charAt(i - 1);
|
|
3274
|
-
return /\S/.test(l) && l !== " ";
|
|
3275
|
-
}, []), Ae = k !== void 0 && !k.granted, Qt = x(null), Jt = w(() => {
|
|
3276
|
-
if (!F || Ae) return;
|
|
3277
|
-
const e = new AbortController();
|
|
3278
|
-
Rt.current = e;
|
|
3279
|
-
const n = { keepLate: !1 };
|
|
3280
|
-
Ut.current = n;
|
|
3281
|
-
let o = !1;
|
|
3282
|
-
const i = () => !o && (!e.signal.aborted || n.keepLate);
|
|
3283
|
-
mr(!1), dr(!0), ur("listening"), Mt(A("editor.ai.listening")), ee && ct(), mt();
|
|
3284
|
-
const l = (s) => {
|
|
3285
|
-
if (Qt.current) {
|
|
3286
|
-
ft.current = "";
|
|
3287
|
-
return;
|
|
3288
|
-
}
|
|
3289
|
-
fr(s);
|
|
3290
|
-
};
|
|
3291
|
-
l(A("editor.ai.listening")), F({
|
|
3292
|
-
signal: e.signal,
|
|
3293
|
-
onStatus: (s) => {
|
|
3294
|
-
if (!i()) return;
|
|
3295
|
-
const d = A(s === "connecting" ? "voiceControl.status.starting" : "editor.ai.listening");
|
|
3296
|
-
ur(s), Mt(d), l(d);
|
|
3297
|
-
},
|
|
3298
|
-
// Interim text shows live in the editor (grey + caret); each final
|
|
3299
|
-
// replaces it with committed text at the caret.
|
|
3300
|
-
onPartialTranscript: (s) => {
|
|
3301
|
-
i() && Xt(s);
|
|
3302
|
-
},
|
|
3303
|
-
onFinalTranscript: (s) => {
|
|
3304
|
-
if (!i()) return;
|
|
3305
|
-
mt();
|
|
3306
|
-
const d = s.trim();
|
|
3307
|
-
if (d) {
|
|
3308
|
-
const T = Qt.current;
|
|
3309
|
-
if (T) {
|
|
3310
|
-
Qt.current = null, Ce.current = T, we(), fe(`${d} `, { asHtml: !1 }), ee && Oe(), Mt(d);
|
|
3311
|
-
return;
|
|
3312
|
-
}
|
|
3313
|
-
if (gr()) {
|
|
3314
|
-
const S = window.getSelection(), q = S == null ? void 0 : S.getRangeAt(0);
|
|
3315
|
-
if (S && q) {
|
|
3316
|
-
const ne = q.startContainer, Re = q.startOffset;
|
|
3317
|
-
ne.insertData(Re, " ");
|
|
3318
|
-
const J = document.createRange();
|
|
3319
|
-
J.setStart(ne, Re + 1), J.collapse(!0), S.removeAllRanges(), S.addRange(J);
|
|
3320
|
-
}
|
|
3321
|
-
}
|
|
3322
|
-
fe(`${d} `, { asHtml: !1 }), ee && Oe(), Mt(d);
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
}).catch((s) => {
|
|
3326
|
-
var d;
|
|
3327
|
-
if (!(e.signal.aborted || s && typeof s == "object" && "name" in s && s.name === "AbortError")) {
|
|
3328
|
-
if (eo(s) && ((d = Ve.current) == null || d.call(Ve), xn.current)) {
|
|
3329
|
-
kn(!0), Fe(!0);
|
|
3330
|
-
return;
|
|
3331
|
-
}
|
|
3332
|
-
mr(!0);
|
|
3333
|
-
}
|
|
3334
|
-
}).finally(() => {
|
|
3335
|
-
o = !0, ft.current = "", mt(), Rt.current === e && (Rt.current = null, Ut.current = null, dr(!1), Mt(""), ee && !De.current && dt());
|
|
3336
|
-
});
|
|
3337
|
-
}, [
|
|
3338
|
-
F,
|
|
3339
|
-
Ae,
|
|
3340
|
-
fe,
|
|
3341
|
-
we,
|
|
3342
|
-
mt,
|
|
3343
|
-
Xt,
|
|
3344
|
-
fr,
|
|
3345
|
-
gr,
|
|
3346
|
-
ee,
|
|
3347
|
-
ct,
|
|
3348
|
-
Oe,
|
|
3349
|
-
dt,
|
|
3350
|
-
A
|
|
3351
|
-
]);
|
|
3352
|
-
H(() => () => {
|
|
3353
|
-
var e;
|
|
3354
|
-
return (e = Rt.current) == null ? void 0 : e.abort();
|
|
3355
|
-
}, []);
|
|
3356
|
-
const [Yt, St] = R(null), Qe = x(null), en = x(null), [jo, hr] = R(!1), Go = ((k == null ? void 0 : k.pending) ?? !1) || jo, tn = x(!1), zn = w(() => {
|
|
3357
|
-
Qe.current = null, en.current = null, tn.current = !1, St(null);
|
|
3358
|
-
}, []), Ko = w(() => {
|
|
3359
|
-
var n;
|
|
3360
|
-
tn.current = !0;
|
|
3361
|
-
const e = (n = k == null ? void 0 : k.onGrant) == null ? void 0 : n.call(k);
|
|
3362
|
-
e && typeof e.then == "function" && (hr(!0), Promise.resolve(e).catch(() => {
|
|
3363
|
-
}).finally(() => hr(!1)));
|
|
3364
|
-
}, [k]), pr = x((k == null ? void 0 : k.granted) ?? !0);
|
|
3365
|
-
H(() => {
|
|
3366
|
-
const e = pr.current;
|
|
3367
|
-
if (pr.current = (k == null ? void 0 : k.granted) ?? !0, !e && (k != null && k.granted) && Qe.current) {
|
|
3368
|
-
const n = Qe.current, o = tn.current;
|
|
3369
|
-
Qe.current = null, tn.current = !1, St(null);
|
|
3370
|
-
const i = en.current;
|
|
3371
|
-
if (en.current = null, !o) return;
|
|
3372
|
-
n === "write" ? Fe(!0) : n === "action" ? i == null || i() : (we(), Jt());
|
|
3373
|
-
}
|
|
3374
|
-
}, [k == null ? void 0 : k.granted, we, Jt]), H(() => {
|
|
3375
|
-
Ae && (Fe(!1), ye && Zt());
|
|
3376
|
-
}, [Ae, ye, Zt]);
|
|
3377
|
-
const br = w(
|
|
3378
|
-
(e = "document") => {
|
|
3379
|
-
if (ye) {
|
|
3380
|
-
Zt(!0);
|
|
3381
|
-
return;
|
|
3382
|
-
}
|
|
3383
|
-
lt();
|
|
3384
|
-
const n = Ce.current;
|
|
3385
|
-
if (Qt.current = e === "selection" && n && !n.collapsed ? n.cloneRange() : null, Ae) {
|
|
3386
|
-
Qe.current = "dictate", St("dictate");
|
|
3387
|
-
return;
|
|
3388
|
-
}
|
|
3389
|
-
Jt();
|
|
3390
|
-
},
|
|
3391
|
-
[ye, Zt, Ae, lt, Jt]
|
|
3392
|
-
), vr = w(
|
|
3393
|
-
(e = "document") => {
|
|
3394
|
-
lt();
|
|
3395
|
-
const n = Ce.current, o = n ? n.cloneRange() : null, i = e === "selection" && !!(o && !o.collapsed);
|
|
3396
|
-
if (o && !i && o.collapse(!1), qt.current = o, Co(i ? "selection" : "document"), ko(i && o ? o.toString() : ""), Ae) {
|
|
3397
|
-
Qe.current = "write", St("write");
|
|
3398
|
-
return;
|
|
3399
|
-
}
|
|
3400
|
-
Fe(!0);
|
|
3401
|
-
},
|
|
3402
|
-
[lt, Ae]
|
|
3403
|
-
), yr = ht(() => k != null && k.granted ? /* @__PURE__ */ N(Be, { children: [
|
|
3404
|
-
A(
|
|
3405
|
-
"editor.ai.consentRecorded",
|
|
3406
|
-
"AI assistance consent has been recorded."
|
|
3407
|
-
),
|
|
3408
|
-
B ? /* @__PURE__ */ N(Be, { children: [
|
|
3409
|
-
" ",
|
|
3410
|
-
B
|
|
3411
|
-
] }) : null
|
|
3412
|
-
] }) : B, [k, B, A]), [Je, Ln] = R(null), [Vo, nn] = R(!1), [wr, kr] = R(!1), [Wo, Ye] = R(""), xr = x(null), De = x(null), rn = x(ke);
|
|
3413
|
-
H(() => {
|
|
3414
|
-
rn.current = ke;
|
|
3415
|
-
}, [ke]), H(() => {
|
|
3416
|
-
ee && (!ye && Je === null || Ze.state === null && ct());
|
|
3417
|
-
}, [ee, ye, Je, Ze.state, ct]);
|
|
3418
|
-
const zt = (e) => e.preventDefault(), Cr = w(
|
|
3419
|
-
(e) => {
|
|
3420
|
-
var o;
|
|
3421
|
-
const n = ie.current;
|
|
3422
|
-
if (n)
|
|
3423
|
-
try {
|
|
3424
|
-
const i = n($);
|
|
3425
|
-
(o = i == null ? void 0 : i.broadcast) == null || o.call(i, "state", !1, e);
|
|
3426
|
-
} catch {
|
|
3427
|
-
}
|
|
3428
|
-
},
|
|
3429
|
-
[$]
|
|
3430
|
-
), Ar = x(!1), et = w(
|
|
3431
|
-
(e) => {
|
|
3432
|
-
const n = ie.current;
|
|
3433
|
-
if (!n || Ar.current === e) return;
|
|
3434
|
-
Ar.current = e;
|
|
3435
|
-
const o = e || b;
|
|
3436
|
-
Ct.current = o;
|
|
3437
|
-
try {
|
|
3438
|
-
n($, o ? "enableReadOnly" : "disableReadOnly");
|
|
3439
|
-
} catch {
|
|
3440
|
-
}
|
|
3441
|
-
},
|
|
3442
|
-
[$, b]
|
|
3443
|
-
), _n = w(
|
|
3444
|
-
(e) => {
|
|
3445
|
-
var o;
|
|
3446
|
-
const n = vt(
|
|
3447
|
-
Me(e),
|
|
3448
|
-
ot.current
|
|
3449
|
-
);
|
|
3450
|
-
!me("source.setCode", n) && te.current && (te.current.value = n), (o = be.current) == null || o.call(be, { html: n, markdown: "" });
|
|
3451
|
-
},
|
|
3452
|
-
[me]
|
|
3453
|
-
), tt = w(
|
|
3454
|
-
(e) => {
|
|
3455
|
-
var l;
|
|
3456
|
-
const n = (l = Q.current) == null ? void 0 : l.querySelector(".redactor-in"), o = typeof window < "u" ? window.getSelection() : null;
|
|
3457
|
-
if (e === "selection" && n && o && o.rangeCount > 0 && !o.isCollapsed) {
|
|
3458
|
-
const s = o.getRangeAt(0);
|
|
3459
|
-
if (n.contains(s.commonAncestorContainer)) {
|
|
3460
|
-
const d = s.toString();
|
|
3461
|
-
if (d.trim())
|
|
3462
|
-
return {
|
|
3463
|
-
scope: "selection",
|
|
3464
|
-
range: s.cloneRange(),
|
|
3465
|
-
html: Ps(s.cloneContents()),
|
|
3466
|
-
text: d
|
|
3467
|
-
};
|
|
3468
|
-
}
|
|
3469
|
-
}
|
|
3470
|
-
const i = ue();
|
|
3471
|
-
return { scope: "document", range: null, html: i, text: to(i) };
|
|
3472
|
-
},
|
|
3473
|
-
[ue]
|
|
3474
|
-
), In = w(
|
|
3475
|
-
(e, n, o, i) => {
|
|
3476
|
-
if (De.current || !o.text.trim()) return;
|
|
3477
|
-
const l = new AbortController();
|
|
3478
|
-
De.current = l, Ln(e), kr(!1), xr.current = e, Ye(A("editor.ai.generating")), nn(!1), ee && ct();
|
|
3479
|
-
const s = ue();
|
|
3480
|
-
et(!0), Promise.resolve(
|
|
3481
|
-
n({
|
|
3482
|
-
html: o.html,
|
|
3483
|
-
text: o.text,
|
|
3484
|
-
scope: o.scope,
|
|
3485
|
-
signal: l.signal
|
|
3486
|
-
})
|
|
3487
|
-
).then((d) => {
|
|
3488
|
-
var S;
|
|
3489
|
-
if (l.signal.aborted) return;
|
|
3490
|
-
et(!1);
|
|
3491
|
-
const T = String(d ?? "");
|
|
3492
|
-
if (ue() !== s) {
|
|
3493
|
-
kr(!0), Ye("");
|
|
3494
|
-
return;
|
|
3495
|
-
}
|
|
3496
|
-
if (!to(T)) {
|
|
3497
|
-
nn(!0), Ye("");
|
|
3498
|
-
return;
|
|
3499
|
-
}
|
|
3500
|
-
if (Cr(s), o.scope === "selection" && o.range) {
|
|
3501
|
-
if (!o.range.startContainer.isConnected) {
|
|
3502
|
-
nn(!0), Ye("");
|
|
3503
|
-
return;
|
|
3504
|
-
}
|
|
3505
|
-
Ce.current = o.range, we();
|
|
3506
|
-
const q = vt(
|
|
3507
|
-
Me(T),
|
|
3508
|
-
ot.current
|
|
3509
|
-
);
|
|
3510
|
-
me("insertion.insertHtml", q) || fe(T, { asHtml: !0 });
|
|
3511
|
-
} else
|
|
3512
|
-
_n(T);
|
|
3513
|
-
ee && Oe(), Ye(A("editor.ai.actionDone")), (S = rn.current) == null || S.call(rn, {
|
|
3514
|
-
action: e,
|
|
3515
|
-
template: i,
|
|
3516
|
-
scope: o.scope,
|
|
3517
|
-
previousHtml: s,
|
|
3518
|
-
undo: () => _n(s)
|
|
3519
|
-
});
|
|
3520
|
-
}).catch((d) => {
|
|
3521
|
-
var T;
|
|
3522
|
-
if (et(!1), !(l.signal.aborted || Ds(d))) {
|
|
3523
|
-
if (eo(d) && ((T = Ve.current) == null || T.call(Ve), xn.current)) {
|
|
3524
|
-
kn(!0), Fe(!0);
|
|
3525
|
-
return;
|
|
3526
|
-
}
|
|
3527
|
-
nn(!0), Ye("");
|
|
3528
|
-
}
|
|
3529
|
-
}).finally(() => {
|
|
3530
|
-
De.current === l && (De.current = null, et(!1), Ln(null), dt());
|
|
3531
|
-
});
|
|
3532
|
-
},
|
|
3533
|
-
[
|
|
3534
|
-
ee,
|
|
3535
|
-
ct,
|
|
3536
|
-
Oe,
|
|
3537
|
-
dt,
|
|
3538
|
-
et,
|
|
3539
|
-
ue,
|
|
3540
|
-
we,
|
|
3541
|
-
me,
|
|
3542
|
-
fe,
|
|
3543
|
-
_n,
|
|
3544
|
-
Cr,
|
|
3545
|
-
A
|
|
3546
|
-
]
|
|
3547
|
-
), Lt = w(
|
|
3548
|
-
(e, n, o, i) => {
|
|
3549
|
-
if (Ae) {
|
|
3550
|
-
en.current = () => In(e, n, o, i), Qe.current = "action", St("action");
|
|
3551
|
-
return;
|
|
3552
|
-
}
|
|
3553
|
-
In(e, n, o, i);
|
|
3554
|
-
},
|
|
3555
|
-
[Ae, In]
|
|
3556
|
-
), Nr = w(
|
|
3557
|
-
(e, n) => {
|
|
3558
|
-
const o = Y == null ? void 0 : Y.onRun;
|
|
3559
|
-
o && Lt(
|
|
3560
|
-
"template",
|
|
3561
|
-
(i) => o({ ...i, template: e }),
|
|
3562
|
-
n,
|
|
3563
|
-
e
|
|
3564
|
-
);
|
|
3565
|
-
},
|
|
3566
|
-
[Y, Lt]
|
|
3567
|
-
), Tr = w(() => {
|
|
3568
|
-
var e;
|
|
3569
|
-
(e = De.current) == null || e.abort(), De.current = null, et(!1), Ln(null), Ye(""), dt();
|
|
3570
|
-
}, [et, dt]), Er = x(null);
|
|
3571
|
-
H(() => {
|
|
3572
|
-
const e = Je ?? xr.current;
|
|
3573
|
-
if (!e) return;
|
|
3574
|
-
const n = e === "template" ? "ai-templates" : `ai-${e}`, o = requestAnimationFrame(() => {
|
|
3575
|
-
var l, s;
|
|
3576
|
-
const i = document.activeElement;
|
|
3577
|
-
i && i !== document.body && i.isConnected || (s = (l = Er.current) == null ? void 0 : l.querySelector(`[data-component-part="${n}"]`)) == null || s.focus();
|
|
3578
|
-
});
|
|
3579
|
-
return () => cancelAnimationFrame(o);
|
|
3580
|
-
}, [Je]), H(() => () => {
|
|
3581
|
-
var e;
|
|
3582
|
-
return (e = De.current) == null ? void 0 : e.abort();
|
|
3583
|
-
}, []), H(() => {
|
|
3584
|
-
const e = te.current;
|
|
3585
|
-
if (!e) return;
|
|
3586
|
-
e.value = Ro.current, He.current();
|
|
3587
|
-
const n = js(P);
|
|
3588
|
-
if (!n) {
|
|
3589
|
-
er(!0);
|
|
3590
|
-
return;
|
|
3591
|
-
}
|
|
3592
|
-
if (ie.current = n, e.value = vt(e.value, ot.current), v === void 0 && (g == null ? void 0 : g.lang) === void 0 && n.addLang && n.lang) {
|
|
3593
|
-
const d = `alfadocs-${ge}`;
|
|
3594
|
-
n.addLang(d, jr(A)), Ie.current = d;
|
|
3595
|
-
}
|
|
3596
|
-
const o = {
|
|
3597
|
-
lang: Ie.current ?? v ?? Vs(Ee.language || "en"),
|
|
3598
|
-
// The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
|
|
3599
|
-
// via the command API, so Redactor's native toolbar is suppressed.
|
|
3600
|
-
toolbar: !1,
|
|
3601
|
-
plugins: m ?? [],
|
|
3602
|
-
placeholder: h ?? A("editor.placeholder"),
|
|
3603
|
-
toolbarFixed: !1,
|
|
3604
|
-
// Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
|
|
3605
|
-
shortcodes: !1,
|
|
3606
|
-
// The kit owns image editing: ImageFloatingToolbar provides DS-native,
|
|
3607
|
-
// keyboard-accessible resize + wrap/align, so Redactor's own image
|
|
3608
|
-
// popup AND its single-handle drag-resizer are both disabled to avoid a
|
|
3609
|
-
// second, untokenised, mouse-only UI competing with ours.
|
|
3610
|
-
imageEditable: !1,
|
|
3611
|
-
imageResizable: !1
|
|
3612
|
-
}, i = z ? { imageUpload: z } : {}, l = (g == null ? void 0 : g.callbacks) ?? {}, s = {
|
|
3613
|
-
...o,
|
|
3614
|
-
...i,
|
|
3615
|
-
...g ?? {},
|
|
3616
|
-
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
3617
|
-
// the sanitising change handler or re-enable Redactor's native image UI
|
|
3618
|
-
// (the kit's ImageFloatingToolbar replaces both — see kitDefaults above).
|
|
3619
|
-
imageEditable: !1,
|
|
3620
|
-
imageResizable: !1,
|
|
3621
|
-
callbacks: {
|
|
3622
|
-
...l,
|
|
3623
|
-
changed(d) {
|
|
3624
|
-
He.current();
|
|
3625
|
-
const T = dn(
|
|
3626
|
-
Jr(Yr(d))
|
|
3627
|
-
), S = Me(T), q = Mr.current;
|
|
3628
|
-
if (q && Date.now() < q.until && no(S) === q.text) {
|
|
3629
|
-
jt.current = S;
|
|
3630
|
-
return;
|
|
3631
|
-
}
|
|
3632
|
-
S !== jt.current && (jt.current = S, hn.current = !0, be.current && (Et.current && clearTimeout(Et.current), Et.current = setTimeout(() => {
|
|
3633
|
-
var ne;
|
|
3634
|
-
(ne = be.current) == null || ne.call(be, { html: S, markdown: "" });
|
|
3635
|
-
}, 100)));
|
|
3636
|
-
},
|
|
3637
|
-
keydown(d) {
|
|
3638
|
-
var T;
|
|
3639
|
-
(T = Gt.current) == null || T.call(Gt, d);
|
|
3640
|
-
},
|
|
3641
|
-
observe() {
|
|
3642
|
-
ve();
|
|
3643
|
-
}
|
|
3644
|
-
}
|
|
3645
|
-
};
|
|
3646
|
-
try {
|
|
3647
|
-
if (n($, s), jt.current = Me(
|
|
3648
|
-
dn(Jr(ue()))
|
|
3649
|
-
), He.current(), b)
|
|
3650
|
-
try {
|
|
3651
|
-
n($, "enableReadOnly");
|
|
3652
|
-
} catch {
|
|
3653
|
-
}
|
|
3654
|
-
} catch {
|
|
3655
|
-
Ie.current && n.lang && delete n.lang[Ie.current], Ie.current = null, ie.current = null, er(!0);
|
|
3656
|
-
}
|
|
3657
|
-
return () => {
|
|
3658
|
-
Et.current && clearTimeout(Et.current);
|
|
3659
|
-
try {
|
|
3660
|
-
n($, "destroy");
|
|
3661
|
-
} catch {
|
|
3662
|
-
}
|
|
3663
|
-
Ie.current && n.lang && delete n.lang[Ie.current], Ie.current = null, ie.current = null;
|
|
3664
|
-
};
|
|
3665
|
-
}, []), H(() => {
|
|
3666
|
-
const e = ie.current, n = Ie.current;
|
|
3667
|
-
if (!(!(e != null && e.addLang) || !n)) {
|
|
3668
|
-
e.addLang(n, jr(A));
|
|
3669
|
-
try {
|
|
3670
|
-
e($, "lang.rebuild", n);
|
|
3671
|
-
} catch {
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
}, [A, Ee.language, $]);
|
|
3675
|
-
const Rr = x(pe), Mr = x(
|
|
3676
|
-
null
|
|
3677
|
-
);
|
|
3678
|
-
H(() => {
|
|
3679
|
-
var o, i;
|
|
3680
|
-
if (Rr.current === pe || (Rr.current = pe, !ie.current || pe.size === 0)) return;
|
|
3681
|
-
const e = ue(), n = vt(e, pe);
|
|
3682
|
-
if (n !== e) {
|
|
3683
|
-
const l = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), d = l != null && l.contains(document.activeElement) && l ? qs(l) : null;
|
|
3684
|
-
Mr.current = {
|
|
3685
|
-
text: no(e),
|
|
3686
|
-
until: Date.now() + 1e3
|
|
3687
|
-
}, me("source.setCode", n);
|
|
3688
|
-
const T = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in");
|
|
3689
|
-
d !== null && T && Bs(T, d);
|
|
3690
|
-
}
|
|
3691
|
-
window.requestAnimationFrame(() => He.current());
|
|
3692
|
-
}, [pe, ue, me]), H(() => {
|
|
3693
|
-
if (!ie.current || u === void 0) return;
|
|
3694
|
-
if (hn.current) {
|
|
3695
|
-
hn.current = !1;
|
|
3696
|
-
return;
|
|
3697
|
-
}
|
|
3698
|
-
const e = vt(
|
|
3699
|
-
Me(dn(u)),
|
|
3700
|
-
ot.current
|
|
3701
|
-
);
|
|
3702
|
-
dn(ue()) !== e && me("source.setCode", e);
|
|
3703
|
-
}, [u, ue, me]), H(() => {
|
|
3704
|
-
Ct.current = b;
|
|
3705
|
-
const e = ie.current;
|
|
3706
|
-
if (e)
|
|
3707
|
-
try {
|
|
3708
|
-
e($, b ? "enableReadOnly" : "disableReadOnly");
|
|
3709
|
-
} catch {
|
|
3710
|
-
}
|
|
3711
|
-
}, [b, $]), H(() => {
|
|
3712
|
-
if (!he || u === void 0) return;
|
|
3713
|
-
const e = te.current;
|
|
3714
|
-
if (!e) return;
|
|
3715
|
-
const n = Me(u);
|
|
3716
|
-
e.value !== n && document.activeElement !== e && (e.value = n);
|
|
3717
|
-
}, [he, u]);
|
|
3718
|
-
const je = ht(
|
|
3719
|
-
() => ({
|
|
3720
|
-
getHTML() {
|
|
3721
|
-
return ue();
|
|
3722
|
-
},
|
|
3723
|
-
getText() {
|
|
3724
|
-
return ue().replace(/<[^>]*>/g, " ").replace(/ /gi, " ").replace(/\s+/g, " ").trim();
|
|
3725
|
-
},
|
|
3726
|
-
getMarkdown() {
|
|
3727
|
-
return "";
|
|
3728
|
-
},
|
|
3729
|
-
isAiBusy() {
|
|
3730
|
-
return De.current !== null;
|
|
3731
|
-
},
|
|
3732
|
-
setContent(e) {
|
|
3733
|
-
const n = Me(e);
|
|
3734
|
-
me(
|
|
3735
|
-
"source.setCode",
|
|
3736
|
-
vt(n, ot.current)
|
|
3737
|
-
) || te.current && (te.current.value = n);
|
|
3738
|
-
},
|
|
3739
|
-
insertAtCursor: fe,
|
|
3740
|
-
applyFormat(e) {
|
|
3741
|
-
const n = Gs[e];
|
|
3742
|
-
n && Xe(...n);
|
|
3743
|
-
},
|
|
3744
|
-
focus() {
|
|
3745
|
-
var n;
|
|
3746
|
-
const e = ie.current;
|
|
3747
|
-
if (e)
|
|
3748
|
-
try {
|
|
3749
|
-
e($, "editor.focus");
|
|
3750
|
-
return;
|
|
3751
|
-
} catch {
|
|
3752
|
-
}
|
|
3753
|
-
(n = te.current) == null || n.focus();
|
|
3754
|
-
},
|
|
3755
|
-
clear() {
|
|
3756
|
-
me("source.setCode", "") || te.current && (te.current.value = "");
|
|
3757
|
-
}
|
|
3758
|
-
}),
|
|
3759
|
-
[$, ue, me, fe, Xe]
|
|
3760
|
-
);
|
|
3761
|
-
ci(W, () => je, [je]), hi(Ua, je, r);
|
|
3762
|
-
const Xo = w(
|
|
3763
|
-
(e) => {
|
|
3764
|
-
var n;
|
|
3765
|
-
He.current(), (n = be.current) == null || n.call(be, {
|
|
3766
|
-
html: Me(e.target.value),
|
|
3767
|
-
markdown: ""
|
|
3768
|
-
});
|
|
3769
|
-
},
|
|
3770
|
-
[]
|
|
3771
|
-
), on = f ?? A("editor.regionLabel"), $n = g == null ? void 0 : g.placeholder, _t = typeof $n == "string" || $n === !1 ? $n : h ?? A("editor.placeholder");
|
|
3772
|
-
H(() => {
|
|
3773
|
-
var i;
|
|
3774
|
-
if (he) return;
|
|
3775
|
-
const e = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in");
|
|
3776
|
-
if (!e) return;
|
|
3777
|
-
const n = () => {
|
|
3778
|
-
e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== on && e.setAttribute("aria-label", on), _t === !1 ? e.hasAttribute("placeholder") && e.removeAttribute("placeholder") : e.getAttribute("placeholder") !== _t && e.setAttribute("placeholder", _t), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
|
|
3779
|
-
};
|
|
3780
|
-
n();
|
|
3781
|
-
const o = new MutationObserver(n);
|
|
3782
|
-
return o.observe(e, {
|
|
3783
|
-
attributes: !0,
|
|
3784
|
-
attributeFilter: ["role", "aria-labelledby", "placeholder"]
|
|
3785
|
-
}), () => o.disconnect();
|
|
3786
|
-
}, [he, on, _t]);
|
|
3787
|
-
const an = Je !== null, Uo = w(
|
|
3788
|
-
(e) => {
|
|
3789
|
-
qn.test(e) && (he ? fe(`[[${e}]]`, { asHtml: !1 }) : (we(), Ue(ro(e))), Z == null || Z(e));
|
|
3790
|
-
},
|
|
3791
|
-
[
|
|
3792
|
-
he,
|
|
3793
|
-
fe,
|
|
3794
|
-
we,
|
|
3795
|
-
Ue,
|
|
3796
|
-
Z
|
|
3797
|
-
]
|
|
3798
|
-
), Hn = x(null), [Zo, Qo] = R(!1), [Jo, Yo] = R(!1), ei = w(
|
|
3799
|
-
(e, n) => {
|
|
3800
|
-
if (Yo(e), !e) return;
|
|
3801
|
-
const o = tt(n);
|
|
3802
|
-
Hn.current = o, Qo(!o.text.trim());
|
|
3803
|
-
},
|
|
3804
|
-
[tt]
|
|
3805
|
-
), ti = w(
|
|
3806
|
-
(e) => {
|
|
3807
|
-
const n = Hn.current ?? tt("document");
|
|
3808
|
-
Hn.current = null, Nr(e, n);
|
|
3809
|
-
},
|
|
3810
|
-
[tt, Nr]
|
|
3811
|
-
), Sr = (e, n) => {
|
|
3812
|
-
if (!n) return null;
|
|
3813
|
-
const o = Je === e;
|
|
3814
|
-
return {
|
|
3815
|
-
key: e,
|
|
3816
|
-
// While running, the segment becomes a Stop/Cancel button (progress
|
|
3817
|
-
// shows on the scrim spinner).
|
|
3818
|
-
icon: o ? /* @__PURE__ */ t($t, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : e === "proofread" ? /* @__PURE__ */ t(Br, { "aria-hidden": "true", className: "ds:size-5" }) : /* @__PURE__ */ t(Fr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
3819
|
-
label: o ? A("common.cancel") : e === "proofread" ? A("editor.ai.proofread", "Check spelling & grammar") : A("editor.ai.autoFormat", "Auto-format document"),
|
|
3820
|
-
onClick: o ? Tr : () => Lt(e, n, tt("document")),
|
|
3821
|
-
running: o
|
|
3822
|
-
};
|
|
3823
|
-
}, Le = Hi(Dt), On = ye && qo === "connecting", nt = [];
|
|
3824
|
-
if (F && nt.push({
|
|
3825
|
-
key: "dictate",
|
|
3826
|
-
// Connecting: a spinner, not yet the red recording look, so the
|
|
3827
|
-
// red means "speak now". Pressing it still stops the session.
|
|
3828
|
-
icon: On ? /* @__PURE__ */ t(
|
|
3829
|
-
Fn,
|
|
3830
|
-
{
|
|
3831
|
-
"aria-hidden": "true",
|
|
3832
|
-
className: "ds:size-5 ds:animate-spin ds:motion-reduce:animate-none"
|
|
3833
|
-
}
|
|
3834
|
-
) : ye ? /* @__PURE__ */ t($t, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(jn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
3835
|
-
label: A(ye ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
3836
|
-
onClick: () => br("document"),
|
|
3837
|
-
recording: ye && !On,
|
|
3838
|
-
// On from the first press, though not red until it listens.
|
|
3839
|
-
pressed: ye
|
|
3840
|
-
}), Y) {
|
|
3841
|
-
const e = Je === "template";
|
|
3842
|
-
nt.push({
|
|
3843
|
-
key: "templates",
|
|
3844
|
-
icon: e ? /* @__PURE__ */ t($t, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(Gn, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
3845
|
-
label: A(e ? "common.cancel" : "editor.ai.templates"),
|
|
3846
|
-
onClick: e ? Tr : void 0,
|
|
3847
|
-
running: e,
|
|
3848
|
-
menu: !e
|
|
3849
|
-
});
|
|
3850
|
-
}
|
|
3851
|
-
const zr = Sr("proofread", U);
|
|
3852
|
-
zr && nt.push(zr);
|
|
3853
|
-
const Lr = Sr("format", re);
|
|
3854
|
-
Lr && nt.push(Lr), (K || Te) && nt.push({
|
|
3855
|
-
key: "write",
|
|
3856
|
-
icon: /* @__PURE__ */ t(qr, { "aria-hidden": "true", className: "ds:size-5" }),
|
|
3857
|
-
label: A("editor.ai.helpMeWrite"),
|
|
3858
|
-
onClick: () => vr("document")
|
|
3859
|
-
});
|
|
3860
|
-
const _r = (e, n) => Y ? /* @__PURE__ */ t(
|
|
3861
|
-
Ms,
|
|
3862
|
-
{
|
|
3863
|
-
side: n === "document" ? "top" : "bottom",
|
|
3864
|
-
templates: Y.templates,
|
|
3865
|
-
onPick: ti,
|
|
3866
|
-
onManage: Y.onManage,
|
|
3867
|
-
noteEmpty: Zo,
|
|
3868
|
-
onOpenChange: (o) => ei(o, n),
|
|
3869
|
-
trigger: e
|
|
3870
|
-
}
|
|
3871
|
-
) : null, Ir = (C ?? []).filter(
|
|
3872
|
-
(e) => !e.contexts || M !== void 0 && e.contexts.includes(M)
|
|
3873
|
-
);
|
|
3874
|
-
H(() => {
|
|
3875
|
-
(Nt || Yt !== null || b) && $e(!1);
|
|
3876
|
-
}, [Nt, Yt, b, $e]), H(() => {
|
|
3877
|
-
xe && !(C ?? []).some(
|
|
3878
|
-
(e) => e.id === xe.extension.id && (!e.contexts || M !== void 0 && e.contexts.includes(M))
|
|
3879
|
-
) && $e();
|
|
3880
|
-
}, [C, M, xe, $e]);
|
|
3881
|
-
const ni = (e) => {
|
|
3882
|
-
var ne, Re;
|
|
3883
|
-
if (bn) return;
|
|
3884
|
-
wn(), Fe(!1), zn();
|
|
3885
|
-
const n = new AbortController();
|
|
3886
|
-
Tt.current = n;
|
|
3887
|
-
const o = (ne = Ce.current) == null ? void 0 : ne.cloneRange(), i = te.current ? [
|
|
3888
|
-
te.current.selectionStart,
|
|
3889
|
-
te.current.selectionEnd
|
|
3890
|
-
] : null, l = (o == null ? void 0 : o.toString()) ?? (i ? (((Re = te.current) == null ? void 0 : Re.value) ?? "").slice(...i) : "");
|
|
3891
|
-
let s = !1;
|
|
3892
|
-
const d = (J) => {
|
|
3893
|
-
var Pe;
|
|
3894
|
-
s || (s = !0, (Pe = Pt.current) == null || Pe.call(Pt, e.id, J));
|
|
3895
|
-
};
|
|
3896
|
-
Ke.current = d;
|
|
3897
|
-
const T = () => {
|
|
3898
|
-
n.signal.aborted || (d({ status: "error" }), n.abort(), vn(!1), nr(!0), yn());
|
|
3899
|
-
}, S = async (J) => {
|
|
3900
|
-
var gt;
|
|
3901
|
-
if (n.signal.aborted) return;
|
|
3902
|
-
let Pe = J.mode === "image" ? "" : J.html;
|
|
3903
|
-
if (J.mode !== "text") {
|
|
3904
|
-
const rt = await J.pngDataUri();
|
|
3905
|
-
if (n.signal.aborted) return;
|
|
3906
|
-
const It = await (await fetch(rt.dataUri, { signal: n.signal })).blob(), Dn = await cr(
|
|
3907
|
-
new File([It], "extension-result.png", { type: "image/png" }),
|
|
3908
|
-
n.signal
|
|
3909
|
-
);
|
|
3910
|
-
if (n.signal.aborted) return;
|
|
3911
|
-
const qe = document.createElement("img");
|
|
3912
|
-
qe.src = Dn, qe.alt = J.text, qe.width = rt.width, qe.height = rt.height, qe.loading = "lazy", Pe += qe.outerHTML;
|
|
3913
|
-
}
|
|
3914
|
-
n.signal.aborted || (o && (Ce.current = o.cloneRange()), i && ((gt = te.current) == null || gt.setSelectionRange(...i)), we(), fe(Pe, { asHtml: !0 }), d({ status: "success" }), $e());
|
|
3915
|
-
}, q = {
|
|
3916
|
-
html: je.getHTML(),
|
|
3917
|
-
text: je.getText(),
|
|
3918
|
-
selectionText: l,
|
|
3919
|
-
scope: l ? "selection" : "document",
|
|
3920
|
-
signal: n.signal,
|
|
3921
|
-
close: () => {
|
|
3922
|
-
Tt.current === n && $e();
|
|
3923
|
-
},
|
|
3924
|
-
insert: async (J) => {
|
|
3925
|
-
try {
|
|
3926
|
-
await S(J);
|
|
3927
|
-
} catch {
|
|
3928
|
-
T();
|
|
3929
|
-
}
|
|
3930
|
-
}
|
|
3931
|
-
};
|
|
3932
|
-
tr({ extension: e, context: q }), e.kind === "action" && (vn(!0), (async () => {
|
|
3933
|
-
try {
|
|
3934
|
-
if (!e.run) throw new Error("Missing extension run");
|
|
3935
|
-
const J = await e.run(q);
|
|
3936
|
-
if (n.signal.aborted) return;
|
|
3937
|
-
J ? await S(J) : (d({ status: "success" }), $e());
|
|
3938
|
-
} catch {
|
|
3939
|
-
T();
|
|
3940
|
-
}
|
|
3941
|
-
})());
|
|
3942
|
-
}, $r = bo.map(
|
|
3943
|
-
(e) => Ir.filter(
|
|
3944
|
-
(n) => {
|
|
3945
|
-
var o;
|
|
3946
|
-
return (((o = n.source) == null ? void 0 : o.kind) ?? "kit") === e;
|
|
3947
|
-
}
|
|
3948
|
-
)
|
|
3949
|
-
), ri = $r.every(
|
|
3950
|
-
(e) => e.length > 0
|
|
3951
|
-
), oi = Ir.length > 0 ? /* @__PURE__ */ t(
|
|
3952
|
-
Js,
|
|
3953
|
-
{
|
|
3954
|
-
groupedExtensions: $r,
|
|
3955
|
-
showExtensionGroups: ri,
|
|
3956
|
-
extensionPending: bn,
|
|
3957
|
-
extensionSession: xe,
|
|
3958
|
-
extensionError: pn,
|
|
3959
|
-
openExtension: ni,
|
|
3960
|
-
closeExtension: $e,
|
|
3961
|
-
saveSelection: lt,
|
|
3962
|
-
closeSignal: vo,
|
|
3963
|
-
restoreFocusOnCloseRef: rr
|
|
3964
|
-
}
|
|
3965
|
-
) : void 0, Hr = !!(K || Te), Or = !!(Y || U || re || Hr || F), ii = !he && !b && (_e ?? Or), ai = w(
|
|
3966
|
-
() => {
|
|
3967
|
-
var e;
|
|
3968
|
-
return ((e = Q.current) == null ? void 0 : e.querySelector(".redactor-in")) ?? null;
|
|
3969
|
-
},
|
|
3970
|
-
[]
|
|
3971
|
-
);
|
|
3972
|
-
return /* @__PURE__ */ N(
|
|
3973
|
-
"div",
|
|
3974
|
-
{
|
|
3975
|
-
ref: Q,
|
|
3976
|
-
className: [Ws(), L].filter(Boolean).join(" "),
|
|
3977
|
-
"data-component": "rich-text-editor",
|
|
3978
|
-
"data-component-id": r,
|
|
3979
|
-
"data-min-height": y,
|
|
3980
|
-
children: [
|
|
3981
|
-
!he && !b ? /* @__PURE__ */ t(
|
|
3982
|
-
_s,
|
|
3983
|
-
{
|
|
3984
|
-
run: Xe,
|
|
3985
|
-
active: Tn,
|
|
3986
|
-
preset: p,
|
|
3987
|
-
insertHtml: Ue,
|
|
3988
|
-
insertTable: Po,
|
|
3989
|
-
saveSelection: lt,
|
|
3990
|
-
restoreSelection: we,
|
|
3991
|
-
getSelectedText: _o,
|
|
3992
|
-
uploadImage: z || _ ? cr : void 0,
|
|
3993
|
-
enableColor: (m == null ? void 0 : m.includes("fontcolor")) ?? !1,
|
|
3994
|
-
enableImage: !!(z || _),
|
|
3995
|
-
enableTable: (m == null ? void 0 : m.includes("table")) ?? !1,
|
|
3996
|
-
showExtensions: E,
|
|
3997
|
-
extensionControl: oi,
|
|
3998
|
-
variables: ir,
|
|
3999
|
-
recentVariableTokens: oe,
|
|
4000
|
-
insertVariable: Uo
|
|
4001
|
-
}
|
|
4002
|
-
) : null,
|
|
4003
|
-
/* @__PURE__ */ N("div", { className: "ds:relative", ref: At, children: [
|
|
4004
|
-
/* @__PURE__ */ t(
|
|
4005
|
-
"textarea",
|
|
4006
|
-
{
|
|
4007
|
-
ref: te,
|
|
4008
|
-
id: ge,
|
|
4009
|
-
"aria-label": on,
|
|
4010
|
-
"aria-multiline": "true",
|
|
4011
|
-
"aria-busy": an || void 0,
|
|
4012
|
-
placeholder: _t || void 0,
|
|
4013
|
-
onChange: he ? Xo : void 0,
|
|
4014
|
-
readOnly: he ? b : void 0,
|
|
4015
|
-
className: he ? Us() : void 0
|
|
4016
|
-
}
|
|
4017
|
-
),
|
|
4018
|
-
an ? /* @__PURE__ */ t(
|
|
4019
|
-
"div",
|
|
4020
|
-
{
|
|
4021
|
-
"aria-hidden": "true",
|
|
4022
|
-
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)]",
|
|
4023
|
-
children: /* @__PURE__ */ t(Zn, { size: "lg", variant: "prism" })
|
|
4024
|
-
}
|
|
4025
|
-
) : null,
|
|
4026
|
-
/* @__PURE__ */ N("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
|
|
4027
|
-
nt.length > 0 ? /* @__PURE__ */ N(
|
|
4028
|
-
"div",
|
|
4029
|
-
{
|
|
4030
|
-
ref: Er,
|
|
4031
|
-
className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10",
|
|
4032
|
-
"data-ai-sparkle": Ze.props["data-ai-sparkle"],
|
|
4033
|
-
children: [
|
|
4034
|
-
/* @__PURE__ */ N("div", { className: mi, children: [
|
|
4035
|
-
nt.map((e, n) => {
|
|
4036
|
-
const o = /* @__PURE__ */ t(
|
|
4037
|
-
"button",
|
|
4038
|
-
{
|
|
4039
|
-
type: "button",
|
|
4040
|
-
onClick: e.onClick,
|
|
4041
|
-
"aria-pressed": (e.pressed ?? e.recording) || void 0,
|
|
4042
|
-
"aria-busy": e.running || void 0,
|
|
4043
|
-
"aria-haspopup": e.menu ? "menu" : void 0,
|
|
4044
|
-
"data-component-part": `ai-${e.key}`,
|
|
4045
|
-
disabled: an && !e.running || void 0,
|
|
4046
|
-
"aria-label": e.label,
|
|
4047
|
-
className: e.recording ? Qs : Zs,
|
|
4048
|
-
children: e.icon
|
|
4049
|
-
}
|
|
4050
|
-
);
|
|
4051
|
-
return /* @__PURE__ */ N(yt, { children: [
|
|
4052
|
-
n > 0 ? /* @__PURE__ */ t(
|
|
4053
|
-
"span",
|
|
4054
|
-
{
|
|
4055
|
-
"aria-hidden": "true",
|
|
4056
|
-
className: fi
|
|
4057
|
-
}
|
|
4058
|
-
) : null,
|
|
4059
|
-
pt(
|
|
4060
|
-
e.menu ? _r(o, "document") : o,
|
|
4061
|
-
Le
|
|
4062
|
-
)
|
|
4063
|
-
] }, e.key);
|
|
4064
|
-
}),
|
|
4065
|
-
Ze.state ? /* @__PURE__ */ t(
|
|
4066
|
-
"span",
|
|
4067
|
-
{
|
|
4068
|
-
"aria-hidden": "true",
|
|
4069
|
-
className: `${gi} ${Ze.props.className}`
|
|
4070
|
-
}
|
|
4071
|
-
) : null
|
|
4072
|
-
] }),
|
|
4073
|
-
/* @__PURE__ */ t(bi, { state: Ze.state })
|
|
4074
|
-
]
|
|
4075
|
-
}
|
|
4076
|
-
) : null,
|
|
4077
|
-
/* @__PURE__ */ t(
|
|
4078
|
-
Bn,
|
|
4079
|
-
{
|
|
4080
|
-
open: !!(xe && (!bn || pn)),
|
|
4081
|
-
onClose: $e,
|
|
4082
|
-
title: xe ? uo(A, xe.extension.label) : void 0,
|
|
4083
|
-
children: pn ? /* @__PURE__ */ t(co, {}) : /* @__PURE__ */ t("div", { className: "ds:overflow-y-auto ds:[max-block-size:min(60dvh,calc(var(--rich-text-editor-min-block-size)*3))]", children: (Pr = xe == null ? void 0 : (Dr = xe.extension).render) == null ? void 0 : Pr.call(
|
|
4084
|
-
Dr,
|
|
4085
|
-
xe.context
|
|
4086
|
-
) })
|
|
4087
|
-
}
|
|
4088
|
-
),
|
|
4089
|
-
Te ? Te({
|
|
4090
|
-
open: Nt && !Ae,
|
|
4091
|
-
onClose: () => {
|
|
4092
|
-
Fe(!1), kn(!1);
|
|
4093
|
-
},
|
|
4094
|
-
selectionText: wo,
|
|
4095
|
-
scope: xo,
|
|
4096
|
-
creditsExhausted: Ao,
|
|
4097
|
-
getHTML: je.getHTML,
|
|
4098
|
-
getText: je.getText,
|
|
4099
|
-
// All three write seams put AI output into the note, so
|
|
4100
|
-
// each one is an action landing and sparkles the pill.
|
|
4101
|
-
insertAtSelection: (e) => {
|
|
4102
|
-
qt.current && (Ce.current = qt.current.cloneRange()), we(), fe(e, { asHtml: !0 }), ee && Oe();
|
|
4103
|
-
},
|
|
4104
|
-
insertAfterSelection: (e) => {
|
|
4105
|
-
const n = qt.current ?? Ce.current;
|
|
4106
|
-
if (n) {
|
|
4107
|
-
const o = n.cloneRange();
|
|
4108
|
-
o.collapse(!1), Ce.current = o;
|
|
4109
|
-
}
|
|
4110
|
-
we(), fe(e, { asHtml: !0 }), ee && Oe();
|
|
4111
|
-
},
|
|
4112
|
-
setContent: (e) => {
|
|
4113
|
-
je.setContent(e), ee && Oe();
|
|
4114
|
-
},
|
|
4115
|
-
onDictate: F,
|
|
4116
|
-
privacyNotice: yr
|
|
4117
|
-
}) : K ? /* @__PURE__ */ t(
|
|
4118
|
-
ts,
|
|
4119
|
-
{
|
|
4120
|
-
open: Nt && !Ae,
|
|
4121
|
-
onClose: () => Fe(!1),
|
|
4122
|
-
onRequestAiDraft: K,
|
|
4123
|
-
onInsert: (e) => {
|
|
4124
|
-
we(), fe(e, { asHtml: G !== "text" }), ee && Oe();
|
|
4125
|
-
},
|
|
4126
|
-
previewAsHtml: G !== "text",
|
|
4127
|
-
privacyNotice: yr,
|
|
4128
|
-
onDictate: F
|
|
4129
|
-
}
|
|
4130
|
-
) : null,
|
|
4131
|
-
k ? /* @__PURE__ */ t(
|
|
4132
|
-
Bn,
|
|
4133
|
-
{
|
|
4134
|
-
open: Yt !== null,
|
|
4135
|
-
onClose: zn,
|
|
4136
|
-
ariaLabel: A(
|
|
4137
|
-
"editor.ai.consentRegionLabel",
|
|
4138
|
-
"AI assistance consent for this document"
|
|
4139
|
-
),
|
|
4140
|
-
footer: /* @__PURE__ */ t(Se, { intent: "ghost", size: "sm", onClick: zn, children: A("common.close") }),
|
|
4141
|
-
children: /* @__PURE__ */ t(
|
|
4142
|
-
vi,
|
|
4143
|
-
{
|
|
4144
|
-
granted: k.granted,
|
|
4145
|
-
grantedAt: k.grantedAt,
|
|
4146
|
-
grantedBy: k.grantedBy,
|
|
4147
|
-
canGrant: (k.canGrant ?? !0) && k.onGrant !== void 0,
|
|
4148
|
-
pending: Go,
|
|
4149
|
-
onGrantConsent: Ko,
|
|
4150
|
-
headingLevel: le,
|
|
4151
|
-
"aria-label": A(
|
|
4152
|
-
"editor.ai.consentRegionLabel",
|
|
4153
|
-
"AI assistance consent for this document"
|
|
4154
|
-
)
|
|
4155
|
-
}
|
|
4156
|
-
)
|
|
4157
|
-
}
|
|
4158
|
-
) : null
|
|
4159
|
-
] }),
|
|
4160
|
-
!he && !b && ((m == null ? void 0 : m.includes("table")) ?? !1) ? /* @__PURE__ */ t(
|
|
4161
|
-
vs,
|
|
4162
|
-
{
|
|
4163
|
-
active: Tn,
|
|
4164
|
-
run: Xe,
|
|
4165
|
-
areaRef: At,
|
|
4166
|
-
getActiveTableEl: Io,
|
|
4167
|
-
enableColor: (m == null ? void 0 : m.includes("fontcolor")) ?? !1,
|
|
4168
|
-
saveTableCell: $o,
|
|
4169
|
-
applyTableBackground: Ho
|
|
4170
|
-
}
|
|
4171
|
-
) : null,
|
|
4172
|
-
!he && !b ? /* @__PURE__ */ t(
|
|
4173
|
-
Rs,
|
|
4174
|
-
{
|
|
4175
|
-
areaRef: At,
|
|
4176
|
-
activeImageEl: To,
|
|
4177
|
-
applyImageClass: Oo,
|
|
4178
|
-
setImageWidth: Do
|
|
4179
|
-
}
|
|
4180
|
-
) : null,
|
|
4181
|
-
ii ? /* @__PURE__ */ t(
|
|
4182
|
-
Ls,
|
|
4183
|
-
{
|
|
4184
|
-
active: Tn,
|
|
4185
|
-
run: Xe,
|
|
4186
|
-
areaRef: At,
|
|
4187
|
-
getEditorRoot: ai,
|
|
4188
|
-
suppressed: an || Nt || Yt !== null || xe !== null,
|
|
4189
|
-
holdOpen: Jo,
|
|
4190
|
-
children: Or ? /* @__PURE__ */ N(Be, { children: [
|
|
4191
|
-
F ? pt(
|
|
4192
|
-
/* @__PURE__ */ t(
|
|
4193
|
-
X,
|
|
4194
|
-
{
|
|
4195
|
-
size: "sm",
|
|
4196
|
-
intent: "ghost",
|
|
4197
|
-
"data-component-part": "selection-ai-dictate",
|
|
4198
|
-
onMouseDown: zt,
|
|
4199
|
-
icon: On ? /* @__PURE__ */ t(Fn, { className: "ds:animate-spin ds:motion-reduce:animate-none" }) : ye ? /* @__PURE__ */ t($t, {}) : /* @__PURE__ */ t(jn, {}),
|
|
4200
|
-
"aria-pressed": ye,
|
|
4201
|
-
...un(
|
|
4202
|
-
A(ye ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
4203
|
-
!!Le
|
|
4204
|
-
),
|
|
4205
|
-
onClick: () => br("selection")
|
|
4206
|
-
}
|
|
4207
|
-
),
|
|
4208
|
-
Le
|
|
4209
|
-
) : null,
|
|
4210
|
-
Y ? pt(
|
|
4211
|
-
_r(
|
|
4212
|
-
/* @__PURE__ */ t(
|
|
4213
|
-
Se,
|
|
4214
|
-
{
|
|
4215
|
-
size: "sm",
|
|
4216
|
-
intent: "ghost",
|
|
4217
|
-
"data-component-part": "selection-ai-templates",
|
|
4218
|
-
onMouseDown: zt,
|
|
4219
|
-
startIcon: /* @__PURE__ */ t(Gn, {}),
|
|
4220
|
-
endIcon: /* @__PURE__ */ t(Yn, {}),
|
|
4221
|
-
children: A("editor.ai.templates")
|
|
4222
|
-
}
|
|
4223
|
-
),
|
|
4224
|
-
"selection"
|
|
4225
|
-
),
|
|
4226
|
-
Le
|
|
4227
|
-
) : null,
|
|
4228
|
-
U ? pt(
|
|
4229
|
-
/* @__PURE__ */ t(
|
|
4230
|
-
X,
|
|
4231
|
-
{
|
|
4232
|
-
size: "sm",
|
|
4233
|
-
intent: "ghost",
|
|
4234
|
-
"data-component-part": "selection-ai-proofread",
|
|
4235
|
-
onMouseDown: zt,
|
|
4236
|
-
icon: /* @__PURE__ */ t(Br, {}),
|
|
4237
|
-
...un(
|
|
4238
|
-
A("editor.ai.proofread"),
|
|
4239
|
-
!!Le
|
|
4240
|
-
),
|
|
4241
|
-
onClick: () => Lt(
|
|
4242
|
-
"proofread",
|
|
4243
|
-
U,
|
|
4244
|
-
tt("selection")
|
|
4245
|
-
)
|
|
4246
|
-
}
|
|
4247
|
-
),
|
|
4248
|
-
Le
|
|
4249
|
-
) : null,
|
|
4250
|
-
re ? pt(
|
|
4251
|
-
/* @__PURE__ */ t(
|
|
4252
|
-
X,
|
|
4253
|
-
{
|
|
4254
|
-
size: "sm",
|
|
4255
|
-
intent: "ghost",
|
|
4256
|
-
"data-component-part": "selection-ai-format",
|
|
4257
|
-
onMouseDown: zt,
|
|
4258
|
-
icon: /* @__PURE__ */ t(Fr, {}),
|
|
4259
|
-
...un(
|
|
4260
|
-
A("editor.ai.autoFormat"),
|
|
4261
|
-
!!Le
|
|
4262
|
-
),
|
|
4263
|
-
onClick: () => Lt(
|
|
4264
|
-
"format",
|
|
4265
|
-
re,
|
|
4266
|
-
tt("selection")
|
|
4267
|
-
)
|
|
4268
|
-
}
|
|
4269
|
-
),
|
|
4270
|
-
Le
|
|
4271
|
-
) : null,
|
|
4272
|
-
Hr ? pt(
|
|
4273
|
-
/* @__PURE__ */ t(
|
|
4274
|
-
X,
|
|
4275
|
-
{
|
|
4276
|
-
size: "sm",
|
|
4277
|
-
intent: "ghost",
|
|
4278
|
-
"data-component-part": "selection-ai-write",
|
|
4279
|
-
onMouseDown: zt,
|
|
4280
|
-
icon: /* @__PURE__ */ t(qr, {}),
|
|
4281
|
-
...un(
|
|
4282
|
-
A("editor.ai.helpMeWrite"),
|
|
4283
|
-
!!Le
|
|
4284
|
-
),
|
|
4285
|
-
onClick: () => vr("selection")
|
|
4286
|
-
}
|
|
4287
|
-
),
|
|
4288
|
-
Le
|
|
4289
|
-
) : null
|
|
4290
|
-
] }) : null
|
|
4291
|
-
}
|
|
4292
|
-
) : null,
|
|
4293
|
-
st ? /* @__PURE__ */ t(
|
|
4294
|
-
"div",
|
|
4295
|
-
{
|
|
4296
|
-
className: Xs,
|
|
4297
|
-
style: {
|
|
4298
|
-
"--rte-typeahead-x": `${st.left}px`,
|
|
4299
|
-
"--rte-typeahead-y": `${st.top}px`
|
|
4300
|
-
},
|
|
4301
|
-
children: /* @__PURE__ */ t(
|
|
4302
|
-
io,
|
|
4303
|
-
{
|
|
4304
|
-
ref: sr,
|
|
4305
|
-
id: Mn,
|
|
4306
|
-
variables: ir,
|
|
4307
|
-
recentTokens: oe,
|
|
4308
|
-
query: st.query,
|
|
4309
|
-
onQueryChange: Lo,
|
|
4310
|
-
onSelect: So,
|
|
4311
|
-
onClose: zo,
|
|
4312
|
-
searchFocusable: !1,
|
|
4313
|
-
onActiveDescendantChange: Mo
|
|
4314
|
-
}
|
|
4315
|
-
)
|
|
4316
|
-
}
|
|
4317
|
-
) : null
|
|
4318
|
-
] }),
|
|
4319
|
-
F ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Fo }) : null,
|
|
4320
|
-
at.length > 0 ? /* @__PURE__ */ t(
|
|
4321
|
-
"p",
|
|
4322
|
-
{
|
|
4323
|
-
id: `${ge}-variables-error`,
|
|
4324
|
-
role: "alert",
|
|
4325
|
-
className: "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
4326
|
-
children: A("editor.variableInvalid", {
|
|
4327
|
-
tokens: at.map((e) => `[[${e}]]`).join(", ")
|
|
4328
|
-
})
|
|
4329
|
-
}
|
|
4330
|
-
) : null,
|
|
4331
|
-
F && Bo ? /* @__PURE__ */ t(
|
|
4332
|
-
"p",
|
|
4333
|
-
{
|
|
4334
|
-
role: "alert",
|
|
4335
|
-
className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
4336
|
-
children: A("editor.ai.dictationError")
|
|
4337
|
-
}
|
|
4338
|
-
) : null,
|
|
4339
|
-
Y || U || re ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Wo }) : null,
|
|
4340
|
-
Vo || wr ? /* @__PURE__ */ t(
|
|
4341
|
-
"p",
|
|
4342
|
-
{
|
|
4343
|
-
role: "alert",
|
|
4344
|
-
className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
|
|
4345
|
-
children: A(wr ? "editor.ai.actionStale" : "editor.ai.actionError")
|
|
4346
|
-
}
|
|
4347
|
-
) : null
|
|
4348
|
-
]
|
|
4349
|
-
}
|
|
4350
|
-
);
|
|
4351
|
-
}
|
|
4352
|
-
);
|
|
4353
|
-
Ys.displayName = "RichTextEditor";
|
|
4354
|
-
export {
|
|
4355
|
-
Ys as R,
|
|
4356
|
-
Ua as r,
|
|
4357
|
-
Ws as w
|
|
4358
|
-
};
|
|
4359
|
-
//# sourceMappingURL=rich-text-editor-BAcJq1PO.js.map
|