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