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