@alfadocs/ui-kit 0.67.0 → 0.67.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ai-tools-rail-DfmewPUN.js → ai-tools-rail-CInA_1-E.js} +2 -2
- package/dist/_chunks/{appointment-tray-CQJ3Nbi5.js → appointment-tray-BMl89NPW.js} +2 -2
- package/dist/_chunks/{care-plan-card-CJei-nl9.js → care-plan-card-BwVUyUBb.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-EmfrbHu8.js → care-plan-entry-card-VzdQHcOL.js} +2 -2
- package/dist/_chunks/{color-picker-B7xsn6tX.js → color-picker-FXpItIaF.js} +171 -167
- package/dist/_chunks/{editable-currency-cell-renderer-BVJ04DkB.js → editable-currency-cell-renderer-D1ewvJKO.js} +358 -351
- package/dist/_chunks/{marketplace-app-shell-Bu-HD3fy.js → marketplace-app-shell-D4-T9Qzz.js} +2 -2
- package/dist/_chunks/{patient-shell-DrV_iekt.js → patient-shell-BfgufL_q.js} +2 -2
- package/dist/_chunks/{patient-summary-card-ByfIU8N0.js → patient-summary-card-hEmr4eTW.js} +2 -2
- package/dist/_chunks/{payment-request-card-yTjzKQCU.js → payment-request-card-CYE5vhZ0.js} +2 -2
- package/dist/_chunks/{rich-text-editor-BOQr5lHx.js → rich-text-editor-DAeCXiQG.js} +646 -643
- package/dist/_chunks/{scroll-area-eccd_Uf-.js → scroll-area-5wNK0Cyz.js} +3 -3
- package/dist/_chunks/{sidebar-CGjIk_FQ.js → sidebar-DaB4ulxH.js} +344 -340
- package/dist/_chunks/{transaction-chip-BrW8P50O.js → transaction-chip-DK84XCBU.js} +31 -18
- package/dist/agent-catalog.json +1 -1
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -1
- package/dist/i18n/locales/ar.js +5 -2
- package/dist/i18n/locales/de.d.ts +4 -1
- package/dist/i18n/locales/de.js +5 -2
- package/dist/i18n/locales/el.d.ts +4 -1
- package/dist/i18n/locales/el.js +5 -2
- package/dist/i18n/locales/en.d.ts +4 -1
- package/dist/i18n/locales/en.js +5 -2
- package/dist/i18n/locales/es.d.ts +4 -1
- package/dist/i18n/locales/es.js +5 -2
- package/dist/i18n/locales/fr.d.ts +4 -1
- package/dist/i18n/locales/fr.js +5 -2
- package/dist/i18n/locales/hi.d.ts +4 -1
- package/dist/i18n/locales/hi.js +5 -2
- package/dist/i18n/locales/it.d.ts +4 -1
- package/dist/i18n/locales/it.js +5 -2
- package/dist/i18n/locales/ja.d.ts +4 -1
- package/dist/i18n/locales/ja.js +5 -2
- package/dist/i18n/locales/nl.d.ts +4 -1
- package/dist/i18n/locales/nl.js +5 -2
- package/dist/i18n/locales/pl.d.ts +4 -1
- package/dist/i18n/locales/pl.js +5 -2
- package/dist/i18n/locales/pt.d.ts +4 -1
- package/dist/i18n/locales/pt.js +5 -2
- package/dist/i18n/locales/ro.d.ts +4 -1
- package/dist/i18n/locales/ro.js +5 -2
- package/dist/i18n/locales/ru.d.ts +4 -1
- package/dist/i18n/locales/ru.js +5 -2
- package/dist/i18n/locales/sq.d.ts +4 -1
- package/dist/i18n/locales/sq.js +5 -2
- package/dist/i18n/locales/sv.d.ts +4 -1
- package/dist/i18n/locales/sv.js +5 -2
- package/dist/i18n/locales/tr.d.ts +4 -1
- package/dist/i18n/locales/tr.js +5 -2
- package/dist/i18n/locales/zh.d.ts +4 -1
- package/dist/i18n/locales/zh.js +5 -2
- package/dist/index.js +14 -14
- package/dist/locales/ar.json +5 -2
- package/dist/locales/de.json +5 -2
- package/dist/locales/el.json +5 -2
- package/dist/locales/en.json +5 -2
- package/dist/locales/es.json +5 -2
- package/dist/locales/fr.json +5 -2
- package/dist/locales/hi.json +5 -2
- package/dist/locales/it.json +5 -2
- package/dist/locales/ja.json +5 -2
- package/dist/locales/nl.json +5 -2
- package/dist/locales/pl.json +5 -2
- package/dist/locales/pt.json +5 -2
- package/dist/locales/ro.json +5 -2
- package/dist/locales/ru.json +5 -2
- package/dist/locales/sq.json +5 -2
- package/dist/locales/sv.json +5 -2
- package/dist/locales/tr.json +5 -2
- package/dist/locales/zh.json +5 -2
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
import { jsx as e, jsxs as v, Fragment as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { SafeHtml as
|
|
6
|
-
import { u as
|
|
1
|
+
import { jsx as e, jsxs as v, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { useId as ie, useState as M, useRef as D, useCallback as z, useEffect as ee, Fragment as ft, forwardRef as gt, useMemo as Ge, useImperativeHandle as pt } from "react";
|
|
3
|
+
import { c as $e } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Q } from "react-i18next";
|
|
5
|
+
import { SafeHtml as bt, sanitiseHtml as vt } from "../safe-html/index.js";
|
|
6
|
+
import { u as yt } from "./registry-nPAVE19X.js";
|
|
7
7
|
import { I as q } from "./icon-button-LqoiKcUN.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { T as
|
|
10
|
-
import { E as
|
|
11
|
-
import { R as
|
|
12
|
-
import { C as
|
|
13
|
-
import { S as
|
|
14
|
-
import { M as
|
|
15
|
-
import { S as
|
|
16
|
-
import { S as
|
|
17
|
-
import { B as
|
|
18
|
-
import { a as
|
|
8
|
+
import { S as wt } from "./spinner-hbwuKwMf.js";
|
|
9
|
+
import { T as kt } from "./text-area-BIx0tZ05.js";
|
|
10
|
+
import { E as xt } from "./editor-overlay-wYm22wZK.js";
|
|
11
|
+
import { R as Ct } from "./rotate-ccw-BWANpitO.js";
|
|
12
|
+
import { C as Nt } from "./check-DPdL_Sm7.js";
|
|
13
|
+
import { S as Ae } from "./square-CZoGU14v.js";
|
|
14
|
+
import { M as Ee } from "./mic-B4Gog3Gi.js";
|
|
15
|
+
import { S as zt } from "./send-CySZIRPJ.js";
|
|
16
|
+
import { S as He } from "./sparkles-CuYXqQLg.js";
|
|
17
|
+
import { B as oe } from "./button-DD_0Xdmr.js";
|
|
18
|
+
import { a as Tt } from "./tooltip-DvmfrNvB.js";
|
|
19
19
|
import { P } from "./popover-DTbfAuR0.js";
|
|
20
|
-
import { D as
|
|
20
|
+
import { D as ke } from "./dropdown-menu-DwwPovMZ.js";
|
|
21
21
|
import { D as j } from "./dialog-DMGnSelc.js";
|
|
22
|
-
import { C as
|
|
23
|
-
import { T as
|
|
24
|
-
import { C as
|
|
25
|
-
import { F as
|
|
22
|
+
import { C as Le } from "./color-picker-FXpItIaF.js";
|
|
23
|
+
import { T as Ce } from "./text-input-BaClJL8Y.js";
|
|
24
|
+
import { C as Mt } from "./checkbox-DRcOdmXv.js";
|
|
25
|
+
import { F as Rt } from "./file-upload-BosbPDb1.js";
|
|
26
26
|
import { c as S } from "./createLucideIcon-CrFbzy84.js";
|
|
27
|
-
import { C as
|
|
28
|
-
import { I as
|
|
29
|
-
import { C as
|
|
30
|
-
import { T as
|
|
27
|
+
import { C as _t } from "./chevron-down-BX_NP2Yh.js";
|
|
28
|
+
import { I as St } from "./image-C6RM5hfF.js";
|
|
29
|
+
import { C as At } from "./columns-2-BTOBZbep.js";
|
|
30
|
+
import { T as Et } from "./trash-2-rPAKaRgB.js";
|
|
31
31
|
/**
|
|
32
32
|
* @license lucide-react v1.8.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
36
|
*/
|
|
37
|
-
const
|
|
37
|
+
const Ht = [
|
|
38
38
|
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
|
|
39
39
|
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
|
|
40
40
|
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
|
|
41
|
-
],
|
|
41
|
+
], It = S("between-horizontal-end", Ht);
|
|
42
42
|
/**
|
|
43
43
|
* @license lucide-react v1.8.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
48
|
+
const $t = [
|
|
49
49
|
["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
|
|
50
50
|
["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
|
|
51
51
|
["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
|
|
52
|
-
],
|
|
52
|
+
], Lt = S("between-horizontal-start", $t);
|
|
53
53
|
/**
|
|
54
54
|
* @license lucide-react v1.8.0 - ISC
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/
|
|
59
|
-
const
|
|
59
|
+
const Ot = [
|
|
60
60
|
["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
|
|
61
61
|
["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
|
|
62
62
|
["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
|
|
63
|
-
],
|
|
63
|
+
], Dt = S("between-vertical-end", Ot);
|
|
64
64
|
/**
|
|
65
65
|
* @license lucide-react v1.8.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
69
|
*/
|
|
70
|
-
const
|
|
70
|
+
const jt = [
|
|
71
71
|
["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
|
|
72
72
|
["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
|
|
73
73
|
["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
|
|
74
|
-
],
|
|
74
|
+
], qt = S("between-vertical-start", jt);
|
|
75
75
|
/**
|
|
76
76
|
* @license lucide-react v1.8.0 - ISC
|
|
77
77
|
*
|
|
78
78
|
* This source code is licensed under the ISC license.
|
|
79
79
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
80
|
*/
|
|
81
|
-
const
|
|
81
|
+
const Pt = [
|
|
82
82
|
[
|
|
83
83
|
"path",
|
|
84
84
|
{ 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" }
|
|
85
85
|
]
|
|
86
|
-
],
|
|
86
|
+
], Bt = S("bold", Pt);
|
|
87
87
|
/**
|
|
88
88
|
* @license lucide-react v1.8.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
92
|
*/
|
|
93
|
-
const
|
|
93
|
+
const Ft = [
|
|
94
94
|
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
95
95
|
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
96
96
|
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
97
97
|
["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
|
|
98
|
-
],
|
|
98
|
+
], Vt = S("heading-2", Ft);
|
|
99
99
|
/**
|
|
100
100
|
* @license lucide-react v1.8.0 - ISC
|
|
101
101
|
*
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
104
|
*/
|
|
105
|
-
const
|
|
105
|
+
const Gt = [
|
|
106
106
|
["path", { d: "M4 12h8", key: "17cfdx" }],
|
|
107
107
|
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
|
108
108
|
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
|
109
109
|
["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
|
|
110
110
|
["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
|
|
111
|
-
],
|
|
111
|
+
], Wt = S("heading-3", Gt);
|
|
112
112
|
/**
|
|
113
113
|
* @license lucide-react v1.8.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const Ut = [
|
|
119
119
|
["path", { d: "m9 11-6 6v3h9l3-3", key: "1a3l36" }],
|
|
120
120
|
["path", { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4", key: "14a9rk" }]
|
|
121
|
-
],
|
|
121
|
+
], Xt = S("highlighter", Ut);
|
|
122
122
|
/**
|
|
123
123
|
* @license lucide-react v1.8.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
127
|
*/
|
|
128
|
-
const
|
|
128
|
+
const Qt = [
|
|
129
129
|
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
130
130
|
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
131
131
|
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
132
|
-
],
|
|
132
|
+
], Yt = S("italic", Qt);
|
|
133
133
|
/**
|
|
134
134
|
* @license lucide-react v1.8.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
const
|
|
139
|
+
const Zt = [
|
|
140
140
|
["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" }],
|
|
141
141
|
["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" }]
|
|
142
|
-
],
|
|
142
|
+
], Jt = S("link", Zt);
|
|
143
143
|
/**
|
|
144
144
|
* @license lucide-react v1.8.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 Kt = [
|
|
150
150
|
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
151
151
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
152
152
|
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
153
153
|
["path", { d: "M4 4h1v5", key: "10yrso" }],
|
|
154
154
|
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
155
155
|
["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" }]
|
|
156
|
-
],
|
|
156
|
+
], er = S("list-ordered", Kt);
|
|
157
157
|
/**
|
|
158
158
|
* @license lucide-react v1.8.0 - ISC
|
|
159
159
|
*
|
|
160
160
|
* This source code is licensed under the ISC license.
|
|
161
161
|
* See the LICENSE file in the root directory of this source tree.
|
|
162
162
|
*/
|
|
163
|
-
const
|
|
163
|
+
const tr = [
|
|
164
164
|
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
165
165
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
166
166
|
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
167
167
|
["path", { d: "M8 5h13", key: "1pao27" }],
|
|
168
168
|
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
169
169
|
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
170
|
-
],
|
|
170
|
+
], rr = S("list", tr);
|
|
171
171
|
/**
|
|
172
172
|
* @license lucide-react v1.8.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
176
|
*/
|
|
177
|
-
const
|
|
177
|
+
const nr = [
|
|
178
178
|
["path", { d: "M11 7 6 2", key: "1jwth8" }],
|
|
179
179
|
["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
|
|
180
180
|
[
|
|
@@ -191,25 +191,25 @@ const tr = [
|
|
|
191
191
|
key: "1nk1rd"
|
|
192
192
|
}
|
|
193
193
|
]
|
|
194
|
-
],
|
|
194
|
+
], or = S("paint-bucket", nr);
|
|
195
195
|
/**
|
|
196
196
|
* @license lucide-react v1.8.0 - ISC
|
|
197
197
|
*
|
|
198
198
|
* This source code is licensed under the ISC license.
|
|
199
199
|
* See the LICENSE file in the root directory of this source tree.
|
|
200
200
|
*/
|
|
201
|
-
const
|
|
201
|
+
const ar = [
|
|
202
202
|
["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
|
|
203
203
|
["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" }],
|
|
204
204
|
["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
|
|
205
|
-
],
|
|
205
|
+
], ir = S("paint-roller", ar);
|
|
206
206
|
/**
|
|
207
207
|
* @license lucide-react v1.8.0 - ISC
|
|
208
208
|
*
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
211
|
*/
|
|
212
|
-
const
|
|
212
|
+
const sr = [
|
|
213
213
|
[
|
|
214
214
|
"path",
|
|
215
215
|
{
|
|
@@ -221,48 +221,48 @@ const ar = [
|
|
|
221
221
|
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
222
222
|
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
223
223
|
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
224
|
-
],
|
|
224
|
+
], lr = S("palette", sr);
|
|
225
225
|
/**
|
|
226
226
|
* @license lucide-react v1.8.0 - ISC
|
|
227
227
|
*
|
|
228
228
|
* This source code is licensed under the ISC license.
|
|
229
229
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
230
|
*/
|
|
231
|
-
const
|
|
231
|
+
const dr = [
|
|
232
232
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
233
233
|
["path", { d: "M14 9h1", key: "l0svgy" }],
|
|
234
234
|
["path", { d: "M19 9h2", key: "te2zfg" }],
|
|
235
235
|
["path", { d: "M3 9h2", key: "1h4ldw" }],
|
|
236
236
|
["path", { d: "M9 9h1", key: "15jzuz" }]
|
|
237
|
-
],
|
|
237
|
+
], cr = S("panel-top-dashed", dr);
|
|
238
238
|
/**
|
|
239
239
|
* @license lucide-react v1.8.0 - ISC
|
|
240
240
|
*
|
|
241
241
|
* This source code is licensed under the ISC license.
|
|
242
242
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
243
|
*/
|
|
244
|
-
const
|
|
244
|
+
const ur = [
|
|
245
245
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
246
246
|
["path", { d: "M3 9h18", key: "1pudct" }]
|
|
247
|
-
],
|
|
247
|
+
], mr = S("panel-top", ur);
|
|
248
248
|
/**
|
|
249
249
|
* @license lucide-react v1.8.0 - ISC
|
|
250
250
|
*
|
|
251
251
|
* This source code is licensed under the ISC license.
|
|
252
252
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
253
|
*/
|
|
254
|
-
const
|
|
254
|
+
const hr = [
|
|
255
255
|
["path", { d: "M13 4v16", key: "8vvj80" }],
|
|
256
256
|
["path", { d: "M17 4v16", key: "7dpous" }],
|
|
257
257
|
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
|
|
258
|
-
],
|
|
258
|
+
], fr = S("pilcrow", hr);
|
|
259
259
|
/**
|
|
260
260
|
* @license lucide-react v1.8.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 gr = [
|
|
266
266
|
[
|
|
267
267
|
"path",
|
|
268
268
|
{
|
|
@@ -277,57 +277,57 @@ const hr = [
|
|
|
277
277
|
key: "1ymkrd"
|
|
278
278
|
}
|
|
279
279
|
]
|
|
280
|
-
],
|
|
280
|
+
], pr = S("quote", gr);
|
|
281
281
|
/**
|
|
282
282
|
* @license lucide-react v1.8.0 - ISC
|
|
283
283
|
*
|
|
284
284
|
* This source code is licensed under the ISC license.
|
|
285
285
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
286
|
*/
|
|
287
|
-
const
|
|
287
|
+
const br = [
|
|
288
288
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
289
289
|
["path", { d: "M3 12h18", key: "1i2n21" }]
|
|
290
|
-
],
|
|
290
|
+
], vr = S("rows-2", br);
|
|
291
291
|
/**
|
|
292
292
|
* @license lucide-react v1.8.0 - ISC
|
|
293
293
|
*
|
|
294
294
|
* This source code is licensed under the ISC license.
|
|
295
295
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
296
|
*/
|
|
297
|
-
const
|
|
297
|
+
const yr = [
|
|
298
298
|
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
299
299
|
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
300
300
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
301
|
-
],
|
|
301
|
+
], wr = S("strikethrough", yr);
|
|
302
302
|
/**
|
|
303
303
|
* @license lucide-react v1.8.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 kr = [
|
|
309
309
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
310
310
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
311
311
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
312
312
|
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
313
|
-
],
|
|
313
|
+
], xr = S("table", kr);
|
|
314
314
|
/**
|
|
315
315
|
* @license lucide-react v1.8.0 - ISC
|
|
316
316
|
*
|
|
317
317
|
* This source code is licensed under the ISC license.
|
|
318
318
|
* See the LICENSE file in the root directory of this source tree.
|
|
319
319
|
*/
|
|
320
|
-
const
|
|
320
|
+
const Cr = [
|
|
321
321
|
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
|
|
322
322
|
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
|
|
323
|
-
],
|
|
323
|
+
], Nr = S("underline", Cr);
|
|
324
324
|
/**
|
|
325
325
|
* @license lucide-react v1.8.0 - ISC
|
|
326
326
|
*
|
|
327
327
|
* This source code is licensed under the ISC license.
|
|
328
328
|
* See the LICENSE file in the root directory of this source tree.
|
|
329
329
|
*/
|
|
330
|
-
const
|
|
330
|
+
const zr = [
|
|
331
331
|
[
|
|
332
332
|
"path",
|
|
333
333
|
{
|
|
@@ -335,7 +335,7 @@ const Cr = [
|
|
|
335
335
|
key: "1ngwbx"
|
|
336
336
|
}
|
|
337
337
|
]
|
|
338
|
-
],
|
|
338
|
+
], Tr = S("wrench", zr), Mr = {
|
|
339
339
|
id: "rich-text-editor",
|
|
340
340
|
capabilities: ["edit_inline"],
|
|
341
341
|
state: {
|
|
@@ -403,90 +403,90 @@ const Cr = [
|
|
|
403
403
|
description: "Sourced from the id prop."
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, Rr = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", _r = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Sr = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", We = [
|
|
407
407
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
408
408
|
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
409
409
|
"ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
|
|
410
410
|
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]"
|
|
411
411
|
].join(" ");
|
|
412
|
-
function
|
|
412
|
+
function Ue(n, a) {
|
|
413
413
|
return a ? n ? /\s$/.test(n) ? `${n}${a}` : `${n} ${a}` : a : n;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Ar({
|
|
416
416
|
open: n,
|
|
417
417
|
onClose: a,
|
|
418
418
|
onRequestAiDraft: c,
|
|
419
|
-
onInsert:
|
|
420
|
-
previewAsHtml:
|
|
419
|
+
onInsert: s,
|
|
420
|
+
previewAsHtml: l = !0,
|
|
421
421
|
privacyNotice: h,
|
|
422
|
-
onDictate:
|
|
422
|
+
onDictate: f
|
|
423
423
|
}) {
|
|
424
|
-
const { t:
|
|
425
|
-
var
|
|
426
|
-
(
|
|
427
|
-
}, []),
|
|
428
|
-
if (!
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
signal:
|
|
424
|
+
const { t: i } = Q(), p = ie(), y = ie(), [T, I] = M(""), [A, k] = M(!1), [$, u] = M(!1), [m, b] = M(null), H = D(null), [R, E] = M(!1), [J, C] = M(""), [L, Y] = M(""), G = D(null), x = z(() => {
|
|
425
|
+
var N;
|
|
426
|
+
(N = G.current) == null || N.abort();
|
|
427
|
+
}, []), B = z(() => {
|
|
428
|
+
if (!f) return;
|
|
429
|
+
const N = new AbortController();
|
|
430
|
+
G.current = N, E(!0), C(""), Y(i("editor.ai.listening")), f({
|
|
431
|
+
signal: N.signal,
|
|
432
432
|
onPartialTranscript: (O) => {
|
|
433
|
-
|
|
433
|
+
N.signal.aborted || C(O);
|
|
434
434
|
},
|
|
435
435
|
onFinalTranscript: (O) => {
|
|
436
|
-
if (
|
|
437
|
-
const
|
|
438
|
-
C(""),
|
|
436
|
+
if (N.signal.aborted) return;
|
|
437
|
+
const te = O.trim();
|
|
438
|
+
C(""), te && (I((V) => Ue(V, te)), Y(te));
|
|
439
439
|
}
|
|
440
440
|
}).catch(() => {
|
|
441
441
|
}).finally(() => {
|
|
442
|
-
C(""),
|
|
442
|
+
C(""), G.current === N && (G.current = null, E(!1), Y(""));
|
|
443
443
|
});
|
|
444
|
-
}, [
|
|
445
|
-
|
|
446
|
-
}, [
|
|
447
|
-
|
|
448
|
-
var
|
|
449
|
-
n ? (
|
|
450
|
-
}, [n]),
|
|
444
|
+
}, [f, i]), F = z(() => {
|
|
445
|
+
R ? x() : B();
|
|
446
|
+
}, [R, B, x]);
|
|
447
|
+
ee(() => {
|
|
448
|
+
var N, O;
|
|
449
|
+
n ? (I(""), k(!1), u(!1), b(null), C(""), Y("")) : ((N = H.current) == null || N.abort(), H.current = null, (O = G.current) == null || O.abort());
|
|
450
|
+
}, [n]), ee(
|
|
451
451
|
() => () => {
|
|
452
|
-
var
|
|
453
|
-
(
|
|
452
|
+
var N, O;
|
|
453
|
+
(N = H.current) == null || N.abort(), (O = G.current) == null || O.abort();
|
|
454
454
|
},
|
|
455
455
|
[]
|
|
456
456
|
);
|
|
457
|
-
const
|
|
458
|
-
var
|
|
459
|
-
const
|
|
460
|
-
if (!
|
|
461
|
-
|
|
457
|
+
const se = z(() => {
|
|
458
|
+
var te;
|
|
459
|
+
const N = T.trim();
|
|
460
|
+
if (!N || A) return;
|
|
461
|
+
x(), (te = H.current) == null || te.abort();
|
|
462
462
|
const O = new AbortController();
|
|
463
|
-
|
|
464
|
-
O.signal.aborted || (b(
|
|
465
|
-
}).catch((
|
|
466
|
-
O.signal.aborted ||
|
|
463
|
+
H.current = O, u(!1), k(!0), c({ prompt: N, signal: O.signal }).then((V) => {
|
|
464
|
+
O.signal.aborted || (b(V), k(!1));
|
|
465
|
+
}).catch((V) => {
|
|
466
|
+
O.signal.aborted || V && typeof V == "object" && "name" in V && V.name === "AbortError" || (u(!0), k(!1));
|
|
467
467
|
});
|
|
468
|
-
}, [T,
|
|
469
|
-
m != null && (
|
|
470
|
-
}, [m,
|
|
468
|
+
}, [T, A, c, x]), he = z(() => {
|
|
469
|
+
m != null && (s(m), a());
|
|
470
|
+
}, [m, s, a]), W = m != null, fe = R ? Ue(T, J) : T;
|
|
471
471
|
return /* @__PURE__ */ e(
|
|
472
|
-
|
|
472
|
+
xt,
|
|
473
473
|
{
|
|
474
474
|
open: n,
|
|
475
475
|
onClose: a,
|
|
476
476
|
title: /* @__PURE__ */ v("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
477
|
-
/* @__PURE__ */ e(
|
|
478
|
-
|
|
477
|
+
/* @__PURE__ */ e(He, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
478
|
+
i("editor.ai.dialogTitle")
|
|
479
479
|
] }),
|
|
480
|
-
ariaLabel:
|
|
481
|
-
children:
|
|
482
|
-
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children:
|
|
483
|
-
|
|
480
|
+
ariaLabel: i("editor.ai.dialogTitle"),
|
|
481
|
+
children: W ? /* @__PURE__ */ v("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-xs)]", children: [
|
|
482
|
+
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: l ? /* @__PURE__ */ e(
|
|
483
|
+
bt,
|
|
484
484
|
{
|
|
485
485
|
html: m,
|
|
486
486
|
profile: "rich-text",
|
|
487
|
-
className:
|
|
487
|
+
className: We,
|
|
488
488
|
tabIndex: 0,
|
|
489
|
-
"aria-label":
|
|
489
|
+
"aria-label": i("editor.ai.dialogTitle")
|
|
490
490
|
}
|
|
491
491
|
) : (
|
|
492
492
|
// Focusable so a keyboard user can scroll a long draft preview
|
|
@@ -494,7 +494,7 @@ function _r({
|
|
|
494
494
|
// tabIndex allowlist doesn't cover a scrollable, non-interactive
|
|
495
495
|
// text region.
|
|
496
496
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
497
|
-
/* @__PURE__ */ e("p", { className:
|
|
497
|
+
/* @__PURE__ */ e("p", { className: We, tabIndex: 0, children: m })
|
|
498
498
|
) }),
|
|
499
499
|
/* @__PURE__ */ e(
|
|
500
500
|
q,
|
|
@@ -502,8 +502,8 @@ function _r({
|
|
|
502
502
|
size: "sm",
|
|
503
503
|
intent: "ghost",
|
|
504
504
|
className: "ds:rounded-full",
|
|
505
|
-
icon: /* @__PURE__ */ e(
|
|
506
|
-
"aria-label":
|
|
505
|
+
icon: /* @__PURE__ */ e(Ct, {}),
|
|
506
|
+
"aria-label": i("editor.ai.retry"),
|
|
507
507
|
onClick: () => b(null)
|
|
508
508
|
}
|
|
509
509
|
),
|
|
@@ -513,40 +513,40 @@ function _r({
|
|
|
513
513
|
size: "sm",
|
|
514
514
|
intent: "primary",
|
|
515
515
|
className: "ds:rounded-full",
|
|
516
|
-
icon: /* @__PURE__ */ e(
|
|
517
|
-
"aria-label":
|
|
518
|
-
onClick:
|
|
516
|
+
icon: /* @__PURE__ */ e(Nt, {}),
|
|
517
|
+
"aria-label": i("common.confirm"),
|
|
518
|
+
onClick: he
|
|
519
519
|
}
|
|
520
520
|
)
|
|
521
|
-
] }) : /* @__PURE__ */ v(
|
|
521
|
+
] }) : /* @__PURE__ */ v(Ie, { children: [
|
|
522
522
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-xs)]", children: [
|
|
523
523
|
/* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
|
|
524
|
-
|
|
524
|
+
kt,
|
|
525
525
|
{
|
|
526
526
|
id: p,
|
|
527
527
|
size: "md",
|
|
528
|
-
value:
|
|
529
|
-
onChange: (
|
|
530
|
-
placeholder:
|
|
531
|
-
"aria-label":
|
|
528
|
+
value: fe,
|
|
529
|
+
onChange: (N) => I(N.target.value),
|
|
530
|
+
placeholder: i("editor.ai.promptPlaceholder"),
|
|
531
|
+
"aria-label": i("editor.ai.promptLabel"),
|
|
532
532
|
autoResize: !0,
|
|
533
533
|
minRows: 1,
|
|
534
534
|
maxRows: 3,
|
|
535
|
-
readOnly:
|
|
536
|
-
tone:
|
|
537
|
-
"aria-describedby":
|
|
535
|
+
readOnly: R,
|
|
536
|
+
tone: $ ? "error" : "default",
|
|
537
|
+
"aria-describedby": $ ? y : void 0
|
|
538
538
|
}
|
|
539
539
|
) }),
|
|
540
|
-
|
|
540
|
+
f ? /* @__PURE__ */ e(
|
|
541
541
|
q,
|
|
542
542
|
{
|
|
543
543
|
size: "sm",
|
|
544
544
|
intent: "ghost",
|
|
545
|
-
className:
|
|
546
|
-
icon:
|
|
547
|
-
"aria-pressed":
|
|
548
|
-
"aria-label":
|
|
549
|
-
onClick:
|
|
545
|
+
className: R ? Rr : void 0,
|
|
546
|
+
icon: R ? /* @__PURE__ */ e(Ae, { className: "ds:fill-current" }) : /* @__PURE__ */ e(Ee, {}),
|
|
547
|
+
"aria-pressed": R,
|
|
548
|
+
"aria-label": i(R ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
549
|
+
onClick: F
|
|
550
550
|
}
|
|
551
551
|
) : null,
|
|
552
552
|
/* @__PURE__ */ e(
|
|
@@ -554,89 +554,90 @@ function _r({
|
|
|
554
554
|
{
|
|
555
555
|
size: "sm",
|
|
556
556
|
intent: "primary",
|
|
557
|
-
icon:
|
|
557
|
+
icon: A ? /* @__PURE__ */ e(wt, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ e(zt, {}),
|
|
558
558
|
className: "ds:rounded-full",
|
|
559
|
-
disabled:
|
|
560
|
-
"aria-busy":
|
|
561
|
-
"aria-label":
|
|
562
|
-
onClick:
|
|
559
|
+
disabled: A || !T.trim(),
|
|
560
|
+
"aria-busy": A || void 0,
|
|
561
|
+
"aria-label": i("editor.ai.generate"),
|
|
562
|
+
onClick: se
|
|
563
563
|
}
|
|
564
564
|
)
|
|
565
565
|
] }),
|
|
566
|
-
|
|
566
|
+
f ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: L }) : null,
|
|
567
|
+
$ ? /* @__PURE__ */ e("p", { id: y, role: "alert", className: Sr, children: i("editor.ai.error") }) : h ? /* @__PURE__ */ e("p", { className: _r, children: h }) : null
|
|
567
568
|
] })
|
|
568
569
|
}
|
|
569
570
|
);
|
|
570
571
|
}
|
|
571
|
-
const
|
|
572
|
+
const Er = {
|
|
572
573
|
bold: {
|
|
573
574
|
id: "bold",
|
|
574
|
-
icon: /* @__PURE__ */ e(
|
|
575
|
+
icon: /* @__PURE__ */ e(Bt, {}),
|
|
575
576
|
label: ["editor.bold", "Bold"],
|
|
576
577
|
command: ["module.inline.format", { tag: "b" }],
|
|
577
578
|
toggle: "bold"
|
|
578
579
|
},
|
|
579
580
|
italic: {
|
|
580
581
|
id: "italic",
|
|
581
|
-
icon: /* @__PURE__ */ e(
|
|
582
|
+
icon: /* @__PURE__ */ e(Yt, {}),
|
|
582
583
|
label: ["editor.italic", "Italic"],
|
|
583
584
|
command: ["module.inline.format", { tag: "i" }],
|
|
584
585
|
toggle: "italic"
|
|
585
586
|
},
|
|
586
587
|
underline: {
|
|
587
588
|
id: "underline",
|
|
588
|
-
icon: /* @__PURE__ */ e(
|
|
589
|
+
icon: /* @__PURE__ */ e(Nr, {}),
|
|
589
590
|
label: ["editor.underline", "Underline"],
|
|
590
591
|
command: ["module.inline.format", { tag: "u" }],
|
|
591
592
|
toggle: "underline"
|
|
592
593
|
},
|
|
593
594
|
strike: {
|
|
594
595
|
id: "strike",
|
|
595
|
-
icon: /* @__PURE__ */ e(
|
|
596
|
+
icon: /* @__PURE__ */ e(wr, {}),
|
|
596
597
|
label: ["editor.strike", "Strikethrough"],
|
|
597
598
|
command: ["module.inline.format", { tag: "del" }],
|
|
598
599
|
toggle: "strike"
|
|
599
600
|
},
|
|
600
601
|
ul: {
|
|
601
602
|
id: "ul",
|
|
602
|
-
icon: /* @__PURE__ */ e(
|
|
603
|
+
icon: /* @__PURE__ */ e(rr, {}),
|
|
603
604
|
label: ["editor.list.bullet", "Bulleted list"],
|
|
604
605
|
command: ["module.list.toggle", "ul"],
|
|
605
606
|
toggle: "ul"
|
|
606
607
|
},
|
|
607
608
|
ol: {
|
|
608
609
|
id: "ol",
|
|
609
|
-
icon: /* @__PURE__ */ e(
|
|
610
|
+
icon: /* @__PURE__ */ e(er, {}),
|
|
610
611
|
label: ["editor.list.ordered", "Numbered list"],
|
|
611
612
|
command: ["module.list.toggle", "ol"],
|
|
612
613
|
toggle: "ol"
|
|
613
614
|
}
|
|
614
|
-
},
|
|
615
|
+
}, _e = [
|
|
615
616
|
{
|
|
616
617
|
id: "paragraph",
|
|
617
618
|
tag: "p",
|
|
618
|
-
icon: /* @__PURE__ */ e(
|
|
619
|
+
icon: /* @__PURE__ */ e(fr, {}),
|
|
619
620
|
label: ["editor.paragraph", "Paragraph"]
|
|
620
621
|
},
|
|
621
622
|
{
|
|
622
623
|
id: "h2",
|
|
623
624
|
tag: "h2",
|
|
624
|
-
icon: /* @__PURE__ */ e(
|
|
625
|
+
icon: /* @__PURE__ */ e(Vt, {}),
|
|
625
626
|
label: ["editor.heading2", "Heading 2"]
|
|
626
627
|
},
|
|
627
628
|
{
|
|
628
629
|
id: "h3",
|
|
629
630
|
tag: "h3",
|
|
630
|
-
icon: /* @__PURE__ */ e(
|
|
631
|
+
icon: /* @__PURE__ */ e(Wt, {}),
|
|
631
632
|
label: ["editor.heading3", "Heading 3"]
|
|
632
633
|
},
|
|
633
634
|
{
|
|
634
635
|
id: "quote",
|
|
635
636
|
tag: "blockquote",
|
|
636
|
-
icon: /* @__PURE__ */ e(
|
|
637
|
+
icon: /* @__PURE__ */ e(pr, {}),
|
|
637
638
|
label: ["editor.quote", "Quote"]
|
|
638
639
|
}
|
|
639
|
-
],
|
|
640
|
+
], Hr = {
|
|
640
641
|
minimal: ["bold", "italic", "link"],
|
|
641
642
|
standard: [
|
|
642
643
|
"format",
|
|
@@ -649,208 +650,208 @@ const Sr = {
|
|
|
649
650
|
"link"
|
|
650
651
|
],
|
|
651
652
|
full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
|
|
652
|
-
},
|
|
653
|
+
}, Ye = [
|
|
653
654
|
{
|
|
654
655
|
id: "rowAbove",
|
|
655
656
|
command: "plugin.table.addRowAbove",
|
|
656
|
-
icon: /* @__PURE__ */ e(
|
|
657
|
+
icon: /* @__PURE__ */ e(Lt, {}),
|
|
657
658
|
label: ["editor.table.rowAbove", "Add row above"]
|
|
658
659
|
},
|
|
659
660
|
{
|
|
660
661
|
id: "rowBelow",
|
|
661
662
|
command: "plugin.table.addRowBelow",
|
|
662
|
-
icon: /* @__PURE__ */ e(
|
|
663
|
+
icon: /* @__PURE__ */ e(It, {}),
|
|
663
664
|
label: ["editor.table.rowBelow", "Add row below"]
|
|
664
665
|
},
|
|
665
666
|
{
|
|
666
667
|
id: "colLeft",
|
|
667
668
|
command: "plugin.table.addColumnLeft",
|
|
668
|
-
icon: /* @__PURE__ */ e(
|
|
669
|
+
icon: /* @__PURE__ */ e(qt, {}),
|
|
669
670
|
label: ["editor.table.columnLeft", "Add column left"]
|
|
670
671
|
},
|
|
671
672
|
{
|
|
672
673
|
id: "colRight",
|
|
673
674
|
command: "plugin.table.addColumnRight",
|
|
674
|
-
icon: /* @__PURE__ */ e(
|
|
675
|
+
icon: /* @__PURE__ */ e(Dt, {}),
|
|
675
676
|
label: ["editor.table.columnRight", "Add column right"]
|
|
676
677
|
},
|
|
677
678
|
{
|
|
678
679
|
id: "addHead",
|
|
679
680
|
command: "plugin.table.addHead",
|
|
680
|
-
icon: /* @__PURE__ */ e(
|
|
681
|
+
icon: /* @__PURE__ */ e(mr, {}),
|
|
681
682
|
label: ["editor.table.addHeader", "Add header row"]
|
|
682
683
|
},
|
|
683
684
|
{
|
|
684
685
|
id: "deleteHead",
|
|
685
686
|
command: "plugin.table.deleteHead",
|
|
686
|
-
icon: /* @__PURE__ */ e(
|
|
687
|
+
icon: /* @__PURE__ */ e(cr, {}),
|
|
687
688
|
label: ["editor.table.deleteHeader", "Remove header row"]
|
|
688
689
|
},
|
|
689
690
|
{
|
|
690
691
|
id: "deleteRow",
|
|
691
692
|
command: "plugin.table.deleteRow",
|
|
692
|
-
icon: /* @__PURE__ */ e(
|
|
693
|
+
icon: /* @__PURE__ */ e(vr, {}),
|
|
693
694
|
label: ["editor.table.deleteRow", "Delete row"]
|
|
694
695
|
},
|
|
695
696
|
{
|
|
696
697
|
id: "deleteColumn",
|
|
697
698
|
command: "plugin.table.deleteColumn",
|
|
698
|
-
icon: /* @__PURE__ */ e(
|
|
699
|
+
icon: /* @__PURE__ */ e(At, {}),
|
|
699
700
|
label: ["editor.table.deleteColumn", "Delete column"]
|
|
700
701
|
},
|
|
701
702
|
{
|
|
702
703
|
id: "deleteTable",
|
|
703
704
|
command: "plugin.table.deleteTable",
|
|
704
|
-
icon: /* @__PURE__ */ e(
|
|
705
|
+
icon: /* @__PURE__ */ e(Et, {}),
|
|
705
706
|
label: ["editor.table.deleteTable", "Delete table"]
|
|
706
707
|
}
|
|
707
|
-
],
|
|
708
|
+
], xe = 6, Ir = $e(
|
|
708
709
|
[
|
|
709
710
|
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
710
711
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
711
712
|
"ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
|
|
712
713
|
"ds:shadow-[var(--shadow-md)]"
|
|
713
714
|
].join(" ")
|
|
714
|
-
),
|
|
715
|
-
function
|
|
715
|
+
), Ze = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", me = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
|
|
716
|
+
function Ne(n) {
|
|
716
717
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
717
718
|
}
|
|
718
|
-
function
|
|
719
|
+
function $r({
|
|
719
720
|
run: n,
|
|
720
721
|
active: a,
|
|
721
722
|
onTriggerDown: c
|
|
722
723
|
}) {
|
|
723
|
-
const { t:
|
|
724
|
-
return /* @__PURE__ */ v(
|
|
725
|
-
/* @__PURE__ */ e(
|
|
726
|
-
|
|
724
|
+
const { t: s } = Q(), l = _e.find((h) => a.has(h.id)) ?? _e[0];
|
|
725
|
+
return /* @__PURE__ */ v(ke.Root, { children: [
|
|
726
|
+
/* @__PURE__ */ e(ke.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
727
|
+
oe,
|
|
727
728
|
{
|
|
728
729
|
size: "sm",
|
|
729
730
|
intent: "ghost",
|
|
730
|
-
startIcon:
|
|
731
|
-
endIcon: /* @__PURE__ */ e(
|
|
732
|
-
"aria-label":
|
|
731
|
+
startIcon: l.icon,
|
|
732
|
+
endIcon: /* @__PURE__ */ e(_t, {}),
|
|
733
|
+
"aria-label": s("editor.format", "Paragraph style"),
|
|
733
734
|
onMouseDown: c,
|
|
734
|
-
children:
|
|
735
|
+
children: s(l.label[0], l.label[1])
|
|
735
736
|
}
|
|
736
737
|
) }),
|
|
737
|
-
/* @__PURE__ */ e(
|
|
738
|
-
|
|
738
|
+
/* @__PURE__ */ e(ke.Content, { align: "start", children: _e.map((h) => /* @__PURE__ */ e(
|
|
739
|
+
ke.Item,
|
|
739
740
|
{
|
|
740
741
|
startIcon: h.icon,
|
|
741
742
|
onSelect: () => n("module.block.format", { tag: h.tag }),
|
|
742
|
-
children:
|
|
743
|
+
children: s(h.label[0], h.label[1])
|
|
743
744
|
},
|
|
744
745
|
h.id
|
|
745
746
|
)) })
|
|
746
747
|
] });
|
|
747
748
|
}
|
|
748
|
-
function
|
|
749
|
+
function Lr({
|
|
749
750
|
insertHtml: n,
|
|
750
751
|
saveSelection: a,
|
|
751
752
|
restoreSelection: c,
|
|
752
|
-
getSelectedText:
|
|
753
|
+
getSelectedText: s
|
|
753
754
|
}) {
|
|
754
|
-
const { t:
|
|
755
|
-
p(""), T(""),
|
|
755
|
+
const { t: l } = Q(), [h, f] = M(!1), [i, p] = M(""), [y, T] = M(""), [I, A] = M(!1), k = ie(), $ = ie(), u = () => {
|
|
756
|
+
p(""), T(""), A(!1);
|
|
756
757
|
}, m = () => {
|
|
757
|
-
const b =
|
|
758
|
+
const b = i.trim();
|
|
758
759
|
if (!b) return;
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
c(), n(
|
|
760
|
+
const H = y.trim() || b, R = I ? ' target="_blank" rel="noopener noreferrer"' : "", E = `<a href="${Ne(b)}"${R}>${Ne(H)}</a>`;
|
|
761
|
+
f(!1), u(), window.requestAnimationFrame(() => {
|
|
762
|
+
c(), n(E);
|
|
762
763
|
});
|
|
763
764
|
};
|
|
764
|
-
return /* @__PURE__ */ v(j.Root, { open: h, onOpenChange:
|
|
765
|
+
return /* @__PURE__ */ v(j.Root, { open: h, onOpenChange: f, children: [
|
|
765
766
|
/* @__PURE__ */ e(j.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
766
767
|
q,
|
|
767
768
|
{
|
|
768
769
|
size: "sm",
|
|
769
770
|
intent: "ghost",
|
|
770
|
-
icon: /* @__PURE__ */ e(
|
|
771
|
-
"aria-label":
|
|
771
|
+
icon: /* @__PURE__ */ e(Jt, {}),
|
|
772
|
+
"aria-label": l("editor.link.insert", "Insert link"),
|
|
772
773
|
onMouseDown: () => {
|
|
773
|
-
a(), T(
|
|
774
|
+
a(), T(s());
|
|
774
775
|
}
|
|
775
776
|
}
|
|
776
777
|
) }),
|
|
777
778
|
/* @__PURE__ */ v(j.Content, { children: [
|
|
778
|
-
/* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children:
|
|
779
|
+
/* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children: l("editor.link.insert", "Insert link") }) }),
|
|
779
780
|
/* @__PURE__ */ v(j.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
780
781
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
781
|
-
/* @__PURE__ */ e("label", { htmlFor: k, className:
|
|
782
|
+
/* @__PURE__ */ e("label", { htmlFor: k, className: me, children: l("editor.link.url", "URL") }),
|
|
782
783
|
/* @__PURE__ */ e(
|
|
783
|
-
|
|
784
|
+
Ce,
|
|
784
785
|
{
|
|
785
786
|
id: k,
|
|
786
787
|
type: "url",
|
|
787
|
-
value:
|
|
788
|
+
value: i,
|
|
788
789
|
onChange: (b) => p(b.target.value),
|
|
789
790
|
placeholder: "https://…"
|
|
790
791
|
}
|
|
791
792
|
)
|
|
792
793
|
] }),
|
|
793
794
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
794
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
795
|
+
/* @__PURE__ */ e("label", { htmlFor: $, className: me, children: l("editor.link.text", "Text to display") }),
|
|
795
796
|
/* @__PURE__ */ e(
|
|
796
|
-
|
|
797
|
+
Ce,
|
|
797
798
|
{
|
|
798
|
-
id:
|
|
799
|
+
id: $,
|
|
799
800
|
value: y,
|
|
800
801
|
onChange: (b) => T(b.target.value),
|
|
801
|
-
placeholder:
|
|
802
|
+
placeholder: l("editor.link.textPlaceholder", "Link text")
|
|
802
803
|
}
|
|
803
804
|
)
|
|
804
805
|
] }),
|
|
805
806
|
/* @__PURE__ */ e(
|
|
806
|
-
|
|
807
|
+
Mt,
|
|
807
808
|
{
|
|
808
|
-
checked:
|
|
809
|
-
onCheckedChange: (b) =>
|
|
810
|
-
label:
|
|
809
|
+
checked: I,
|
|
810
|
+
onCheckedChange: (b) => A(b === !0),
|
|
811
|
+
label: l("editor.link.newTab", "Open in new tab")
|
|
811
812
|
}
|
|
812
813
|
)
|
|
813
814
|
] }),
|
|
814
815
|
/* @__PURE__ */ v(j.Footer, { children: [
|
|
815
|
-
/* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(
|
|
816
|
-
/* @__PURE__ */ e(
|
|
816
|
+
/* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: l("common.cancel") }) }),
|
|
817
|
+
/* @__PURE__ */ e(oe, { onClick: m, disabled: !i.trim(), children: l("editor.link.insertAction", "Insert") })
|
|
817
818
|
] })
|
|
818
819
|
] })
|
|
819
820
|
] });
|
|
820
821
|
}
|
|
821
|
-
function
|
|
822
|
+
function Or({
|
|
822
823
|
insertHtml: n,
|
|
823
824
|
saveSelection: a,
|
|
824
825
|
restoreSelection: c,
|
|
825
|
-
uploadImage:
|
|
826
|
+
uploadImage: s
|
|
826
827
|
}) {
|
|
827
|
-
const { t:
|
|
828
|
-
const b = `<img src="${
|
|
829
|
-
|
|
828
|
+
const { t: l } = Q(), [h, f] = M(!1), [i, p] = M(""), [y, T] = M(""), I = ie(), A = ie(), k = (u, m) => {
|
|
829
|
+
const b = `<img src="${Ne(u)}" alt="${Ne(m)}" loading="lazy">`;
|
|
830
|
+
f(!1), p(""), T(""), window.requestAnimationFrame(() => {
|
|
830
831
|
c(), n(b);
|
|
831
832
|
});
|
|
832
|
-
},
|
|
833
|
-
const u =
|
|
833
|
+
}, $ = () => {
|
|
834
|
+
const u = i.trim();
|
|
834
835
|
u && k(u, y.trim());
|
|
835
836
|
};
|
|
836
|
-
return /* @__PURE__ */ v(j.Root, { open: h, onOpenChange:
|
|
837
|
+
return /* @__PURE__ */ v(j.Root, { open: h, onOpenChange: f, children: [
|
|
837
838
|
/* @__PURE__ */ e(j.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
838
839
|
q,
|
|
839
840
|
{
|
|
840
841
|
size: "sm",
|
|
841
842
|
intent: "ghost",
|
|
842
|
-
icon: /* @__PURE__ */ e(
|
|
843
|
-
"aria-label":
|
|
843
|
+
icon: /* @__PURE__ */ e(St, {}),
|
|
844
|
+
"aria-label": l("editor.image.insert", "Insert image"),
|
|
844
845
|
onMouseDown: () => a()
|
|
845
846
|
}
|
|
846
847
|
) }),
|
|
847
848
|
/* @__PURE__ */ v(j.Content, { children: [
|
|
848
|
-
/* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children:
|
|
849
|
+
/* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children: l("editor.image.insert", "Insert image") }) }),
|
|
849
850
|
/* @__PURE__ */ v(j.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
850
|
-
|
|
851
|
-
/* @__PURE__ */ e("span", { className:
|
|
851
|
+
s ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
852
|
+
/* @__PURE__ */ e("span", { className: me, children: l("editor.image.upload", "Upload") }),
|
|
852
853
|
/* @__PURE__ */ e(
|
|
853
|
-
|
|
854
|
+
Rt,
|
|
854
855
|
{
|
|
855
856
|
variant: "dropzone",
|
|
856
857
|
accept: {
|
|
@@ -858,35 +859,35 @@ function $r({
|
|
|
858
859
|
},
|
|
859
860
|
maxFiles: 1,
|
|
860
861
|
onUpload: async (u, { signal: m }) => {
|
|
861
|
-
const b = await
|
|
862
|
+
const b = await s(u, m);
|
|
862
863
|
k(b, u.name);
|
|
863
864
|
}
|
|
864
865
|
}
|
|
865
866
|
),
|
|
866
|
-
/* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children:
|
|
867
|
+
/* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: l("editor.image.orUrl", "Or paste an image URL") })
|
|
867
868
|
] }) : null,
|
|
868
869
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
869
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
870
|
+
/* @__PURE__ */ e("label", { htmlFor: I, className: me, children: l("editor.image.url", "Image URL") }),
|
|
870
871
|
/* @__PURE__ */ e(
|
|
871
|
-
|
|
872
|
+
Ce,
|
|
872
873
|
{
|
|
873
|
-
id:
|
|
874
|
+
id: I,
|
|
874
875
|
type: "url",
|
|
875
|
-
value:
|
|
876
|
+
value: i,
|
|
876
877
|
onChange: (u) => p(u.target.value),
|
|
877
878
|
placeholder: "https://…"
|
|
878
879
|
}
|
|
879
880
|
)
|
|
880
881
|
] }),
|
|
881
882
|
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
882
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
883
|
+
/* @__PURE__ */ e("label", { htmlFor: A, className: me, children: l("editor.image.alt", "Alt text") }),
|
|
883
884
|
/* @__PURE__ */ e(
|
|
884
|
-
|
|
885
|
+
Ce,
|
|
885
886
|
{
|
|
886
|
-
id:
|
|
887
|
+
id: A,
|
|
887
888
|
value: y,
|
|
888
889
|
onChange: (u) => T(u.target.value),
|
|
889
|
-
placeholder:
|
|
890
|
+
placeholder: l(
|
|
890
891
|
"editor.image.altPlaceholder",
|
|
891
892
|
"Describe the image"
|
|
892
893
|
)
|
|
@@ -895,24 +896,24 @@ function $r({
|
|
|
895
896
|
] })
|
|
896
897
|
] }),
|
|
897
898
|
/* @__PURE__ */ v(j.Footer, { children: [
|
|
898
|
-
/* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(
|
|
899
|
-
/* @__PURE__ */ e(
|
|
899
|
+
/* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: l("common.cancel") }) }),
|
|
900
|
+
/* @__PURE__ */ e(oe, { onClick: $, disabled: !i.trim(), children: l("editor.image.insertAction", "Insert") })
|
|
900
901
|
] })
|
|
901
902
|
] })
|
|
902
903
|
] });
|
|
903
904
|
}
|
|
904
|
-
function
|
|
905
|
+
function Dr({
|
|
905
906
|
run: n,
|
|
906
907
|
saveSelection: a,
|
|
907
908
|
restoreSelection: c
|
|
908
909
|
}) {
|
|
909
|
-
const { t:
|
|
910
|
+
const { t: s } = Q(), [l, h] = M("#1f2a5c"), f = (p) => {
|
|
910
911
|
h(p), c(), n("module.inline.format", {
|
|
911
912
|
tag: "span",
|
|
912
913
|
style: { color: p },
|
|
913
914
|
type: "toggle"
|
|
914
915
|
});
|
|
915
|
-
},
|
|
916
|
+
}, i = () => {
|
|
916
917
|
c(), n("module.inline.remove", { style: "color" });
|
|
917
918
|
};
|
|
918
919
|
return /* @__PURE__ */ v(P, { onOpenChange: (p) => p && a(), children: [
|
|
@@ -921,40 +922,40 @@ function Lr({
|
|
|
921
922
|
{
|
|
922
923
|
size: "sm",
|
|
923
924
|
intent: "ghost",
|
|
924
|
-
icon: /* @__PURE__ */ e(
|
|
925
|
-
"aria-label":
|
|
925
|
+
icon: /* @__PURE__ */ e(lr, {}),
|
|
926
|
+
"aria-label": s("editor.textColor", "Text colour"),
|
|
926
927
|
onMouseDown: (p) => {
|
|
927
928
|
p.preventDefault(), a();
|
|
928
929
|
}
|
|
929
930
|
}
|
|
930
931
|
) }),
|
|
931
932
|
/* @__PURE__ */ v(P.Content, { side: "bottom", align: "start", children: [
|
|
932
|
-
/* @__PURE__ */ e(P.Heading, { children:
|
|
933
|
+
/* @__PURE__ */ e(P.Heading, { children: s("editor.textColor", "Text colour") }),
|
|
933
934
|
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
934
|
-
|
|
935
|
+
Le,
|
|
935
936
|
{
|
|
936
937
|
variant: "inline",
|
|
937
938
|
size: "sm",
|
|
938
|
-
value:
|
|
939
|
-
onChange:
|
|
939
|
+
value: l,
|
|
940
|
+
onChange: f
|
|
940
941
|
}
|
|
941
942
|
) }),
|
|
942
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(
|
|
943
|
+
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: i, children: s("editor.color.remove", "Remove colour") }) })
|
|
943
944
|
] })
|
|
944
945
|
] });
|
|
945
946
|
}
|
|
946
|
-
function
|
|
947
|
+
function jr({
|
|
947
948
|
run: n,
|
|
948
949
|
saveSelection: a,
|
|
949
950
|
restoreSelection: c
|
|
950
951
|
}) {
|
|
951
|
-
const { t:
|
|
952
|
+
const { t: s } = Q(), [l, h] = M("#fff3a3"), f = (p) => {
|
|
952
953
|
h(p), c(), n("module.inline.format", {
|
|
953
954
|
tag: "span",
|
|
954
955
|
style: { "background-color": p },
|
|
955
956
|
type: "toggle"
|
|
956
957
|
});
|
|
957
|
-
},
|
|
958
|
+
}, i = () => {
|
|
958
959
|
c(), n("module.inline.remove", { style: "background-color" });
|
|
959
960
|
};
|
|
960
961
|
return /* @__PURE__ */ v(P, { onOpenChange: (p) => p && a(), children: [
|
|
@@ -963,58 +964,58 @@ function Or({
|
|
|
963
964
|
{
|
|
964
965
|
size: "sm",
|
|
965
966
|
intent: "ghost",
|
|
966
|
-
icon: /* @__PURE__ */ e(
|
|
967
|
-
"aria-label":
|
|
967
|
+
icon: /* @__PURE__ */ e(Xt, {}),
|
|
968
|
+
"aria-label": s("editor.highlightColor", "Highlight"),
|
|
968
969
|
onMouseDown: (p) => {
|
|
969
970
|
p.preventDefault(), a();
|
|
970
971
|
}
|
|
971
972
|
}
|
|
972
973
|
) }),
|
|
973
974
|
/* @__PURE__ */ v(P.Content, { side: "bottom", align: "start", children: [
|
|
974
|
-
/* @__PURE__ */ e(P.Heading, { children:
|
|
975
|
+
/* @__PURE__ */ e(P.Heading, { children: s("editor.highlightColor", "Highlight") }),
|
|
975
976
|
/* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
|
|
976
|
-
|
|
977
|
+
Le,
|
|
977
978
|
{
|
|
978
979
|
variant: "inline",
|
|
979
980
|
size: "sm",
|
|
980
|
-
value:
|
|
981
|
-
onChange:
|
|
981
|
+
value: l,
|
|
982
|
+
onChange: f
|
|
982
983
|
}
|
|
983
984
|
) }),
|
|
984
|
-
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(
|
|
985
|
+
/* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: i, children: s("editor.highlight.remove", "Remove highlight") }) })
|
|
985
986
|
] })
|
|
986
987
|
] });
|
|
987
988
|
}
|
|
988
|
-
function
|
|
989
|
+
function qr(n, a) {
|
|
989
990
|
const c = Array.from({ length: a }, () => "<td><br></td>").join("");
|
|
990
991
|
return `<table><tbody>${Array.from({ length: n }, () => `<tr>${c}</tr>`).join("")}</tbody></table>`;
|
|
991
992
|
}
|
|
992
|
-
function
|
|
993
|
+
function Pr({
|
|
993
994
|
run: n,
|
|
994
995
|
insertTable: a,
|
|
995
996
|
active: c
|
|
996
997
|
}) {
|
|
997
|
-
const { t:
|
|
998
|
-
return /* @__PURE__ */ v(P, { onOpenChange: (
|
|
998
|
+
const { t: s } = Q(), [l, h] = M({ r: 0, c: 0 }), f = c.has("table");
|
|
999
|
+
return /* @__PURE__ */ v(P, { onOpenChange: (i) => !i && h({ r: 0, c: 0 }), children: [
|
|
999
1000
|
/* @__PURE__ */ e(P.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1000
1001
|
q,
|
|
1001
1002
|
{
|
|
1002
1003
|
size: "sm",
|
|
1003
1004
|
intent: "ghost",
|
|
1004
|
-
icon: /* @__PURE__ */ e(
|
|
1005
|
-
"aria-label":
|
|
1006
|
-
onMouseDown: (
|
|
1005
|
+
icon: /* @__PURE__ */ e(xr, {}),
|
|
1006
|
+
"aria-label": s("editor.table.insert", "Insert table"),
|
|
1007
|
+
onMouseDown: (i) => i.preventDefault()
|
|
1007
1008
|
}
|
|
1008
1009
|
) }),
|
|
1009
|
-
/* @__PURE__ */ e(P.Content, { side: "bottom", align: "start", children:
|
|
1010
|
+
/* @__PURE__ */ e(P.Content, { side: "bottom", align: "start", children: f ? (
|
|
1010
1011
|
// Caret is already inside a table — offer the manage ops only, never
|
|
1011
1012
|
// a nested-table insert (mirrors Redactor's native dropdown, which
|
|
1012
1013
|
// disables "insert table" while the caret is in a table).
|
|
1013
|
-
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children:
|
|
1014
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: Ye.map((i) => /* @__PURE__ */ v(
|
|
1014
1015
|
"button",
|
|
1015
1016
|
{
|
|
1016
1017
|
type: "button",
|
|
1017
|
-
onClick: () => n(
|
|
1018
|
+
onClick: () => n(i.command),
|
|
1018
1019
|
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)]",
|
|
1019
1020
|
children: [
|
|
1020
1021
|
/* @__PURE__ */ e(
|
|
@@ -1022,69 +1023,69 @@ function jr({
|
|
|
1022
1023
|
{
|
|
1023
1024
|
"aria-hidden": "true",
|
|
1024
1025
|
className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
|
|
1025
|
-
children:
|
|
1026
|
+
children: i.icon
|
|
1026
1027
|
}
|
|
1027
1028
|
),
|
|
1028
|
-
i
|
|
1029
|
+
s(i.label[0], i.label[1])
|
|
1029
1030
|
]
|
|
1030
1031
|
},
|
|
1031
|
-
|
|
1032
|
+
i.id
|
|
1032
1033
|
)) })
|
|
1033
|
-
) : /* @__PURE__ */ v(
|
|
1034
|
-
/* @__PURE__ */ e(P.Heading, { children:
|
|
1034
|
+
) : /* @__PURE__ */ v(Ie, { children: [
|
|
1035
|
+
/* @__PURE__ */ e(P.Heading, { children: s("editor.table.insert", "Insert table") }),
|
|
1035
1036
|
/* @__PURE__ */ e(
|
|
1036
1037
|
"div",
|
|
1037
1038
|
{
|
|
1038
1039
|
role: "group",
|
|
1039
|
-
"aria-label":
|
|
1040
|
+
"aria-label": s("editor.table.sizePicker", "Table size"),
|
|
1040
1041
|
className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
|
|
1041
1042
|
onMouseLeave: () => h({ r: 0, c: 0 }),
|
|
1042
|
-
children: Array.from({ length:
|
|
1043
|
-
const y = Math.floor(p /
|
|
1043
|
+
children: Array.from({ length: xe * xe }, (i, p) => {
|
|
1044
|
+
const y = Math.floor(p / xe) + 1, T = p % xe + 1, I = y <= l.r && T <= l.c;
|
|
1044
1045
|
return /* @__PURE__ */ e(
|
|
1045
1046
|
"button",
|
|
1046
1047
|
{
|
|
1047
1048
|
type: "button",
|
|
1048
|
-
"aria-label":
|
|
1049
|
+
"aria-label": s("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1049
1050
|
r: y,
|
|
1050
1051
|
c: T
|
|
1051
1052
|
}),
|
|
1052
1053
|
onMouseEnter: () => h({ r: y, c: T }),
|
|
1053
|
-
onClick: () => a(
|
|
1054
|
-
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${
|
|
1054
|
+
onClick: () => a(qr(y, T)),
|
|
1055
|
+
className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${I ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
|
|
1055
1056
|
},
|
|
1056
1057
|
p
|
|
1057
1058
|
);
|
|
1058
1059
|
})
|
|
1059
1060
|
}
|
|
1060
1061
|
),
|
|
1061
|
-
/* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children:
|
|
1062
|
-
r:
|
|
1063
|
-
c:
|
|
1064
|
-
}) :
|
|
1062
|
+
/* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: l.r > 0 ? s("editor.table.sizeCell", "{{r}}×{{c}}", {
|
|
1063
|
+
r: l.r,
|
|
1064
|
+
c: l.c
|
|
1065
|
+
}) : s("editor.table.sizeHint", "Pick a size") })
|
|
1065
1066
|
] }) })
|
|
1066
1067
|
] });
|
|
1067
1068
|
}
|
|
1068
|
-
const
|
|
1069
|
+
const Br = Object.fromEntries(Ye.map((n) => [n.id, n])), Fr = [
|
|
1069
1070
|
"ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
|
|
1070
1071
|
"ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
|
|
1071
1072
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
1072
1073
|
"ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
|
|
1073
|
-
].join(" "),
|
|
1074
|
-
function
|
|
1074
|
+
].join(" "), Vr = "#fde68a";
|
|
1075
|
+
function Xe({
|
|
1075
1076
|
scope: n,
|
|
1076
1077
|
icon: a,
|
|
1077
1078
|
label: c,
|
|
1078
|
-
onOpenChange:
|
|
1079
|
-
saveTableCell:
|
|
1079
|
+
onOpenChange: s,
|
|
1080
|
+
saveTableCell: l,
|
|
1080
1081
|
applyTableBackground: h
|
|
1081
1082
|
}) {
|
|
1082
|
-
const { t:
|
|
1083
|
+
const { t: f } = Q(), [i, p] = M(Vr);
|
|
1083
1084
|
return /* @__PURE__ */ v(
|
|
1084
1085
|
P,
|
|
1085
1086
|
{
|
|
1086
1087
|
onOpenChange: (y) => {
|
|
1087
|
-
|
|
1088
|
+
s(y), y && l();
|
|
1088
1089
|
},
|
|
1089
1090
|
children: [
|
|
1090
1091
|
/* @__PURE__ */ e(P.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
@@ -1099,24 +1100,24 @@ function We({
|
|
|
1099
1100
|
) }),
|
|
1100
1101
|
/* @__PURE__ */ v(P.Content, { side: "bottom", align: "center", children: [
|
|
1101
1102
|
/* @__PURE__ */ e(
|
|
1102
|
-
|
|
1103
|
+
Le,
|
|
1103
1104
|
{
|
|
1104
1105
|
variant: "inline",
|
|
1105
1106
|
size: "sm",
|
|
1106
|
-
value:
|
|
1107
|
+
value: i,
|
|
1107
1108
|
onChange: (y) => {
|
|
1108
1109
|
p(y), h(n, y);
|
|
1109
1110
|
}
|
|
1110
1111
|
}
|
|
1111
1112
|
),
|
|
1112
1113
|
/* @__PURE__ */ e(
|
|
1113
|
-
|
|
1114
|
+
oe,
|
|
1114
1115
|
{
|
|
1115
1116
|
size: "sm",
|
|
1116
1117
|
intent: "ghost",
|
|
1117
1118
|
className: "ds:mt-[var(--spacing-xs)] ds:w-full",
|
|
1118
1119
|
onClick: () => h(n, null),
|
|
1119
|
-
children:
|
|
1120
|
+
children: f("editor.table.clearColor", "Clear colour")
|
|
1120
1121
|
}
|
|
1121
1122
|
)
|
|
1122
1123
|
] })
|
|
@@ -1124,47 +1125,47 @@ function We({
|
|
|
1124
1125
|
}
|
|
1125
1126
|
);
|
|
1126
1127
|
}
|
|
1127
|
-
function
|
|
1128
|
+
function Gr({
|
|
1128
1129
|
active: n,
|
|
1129
1130
|
run: a,
|
|
1130
1131
|
areaRef: c,
|
|
1131
|
-
getActiveTableEl:
|
|
1132
|
-
enableColor:
|
|
1132
|
+
getActiveTableEl: s,
|
|
1133
|
+
enableColor: l = !1,
|
|
1133
1134
|
saveTableCell: h,
|
|
1134
|
-
applyTableBackground:
|
|
1135
|
+
applyTableBackground: f
|
|
1135
1136
|
}) {
|
|
1136
|
-
const { t:
|
|
1137
|
-
|
|
1137
|
+
const { t: i } = Q(), p = n.has("table"), [y, T] = M(null), I = D(0), [A, k] = M(!1), $ = z((m) => {
|
|
1138
|
+
I.current = Math.max(
|
|
1138
1139
|
0,
|
|
1139
|
-
|
|
1140
|
-
), k(
|
|
1140
|
+
I.current + (m ? 1 : -1)
|
|
1141
|
+
), k(I.current > 0);
|
|
1141
1142
|
}, []);
|
|
1142
|
-
if (
|
|
1143
|
-
if (
|
|
1143
|
+
if (ee(() => {
|
|
1144
|
+
if (A) return;
|
|
1144
1145
|
if (!p || typeof window > "u") {
|
|
1145
1146
|
T(null);
|
|
1146
1147
|
return;
|
|
1147
1148
|
}
|
|
1148
1149
|
const m = () => {
|
|
1149
|
-
const
|
|
1150
|
-
if (!
|
|
1150
|
+
const E = c.current, J = s();
|
|
1151
|
+
if (!E || !J) {
|
|
1151
1152
|
T(null);
|
|
1152
1153
|
return;
|
|
1153
1154
|
}
|
|
1154
|
-
const C =
|
|
1155
|
-
T({ top:
|
|
1155
|
+
const C = E.getBoundingClientRect(), L = J.getBoundingClientRect(), Y = getComputedStyle(E).direction === "rtl", G = Math.max(0, L.top - C.top - 44), x = Y ? C.right - L.right + L.width / 2 : L.left - C.left + L.width / 2;
|
|
1156
|
+
T({ top: G, start: Math.max(0, x), rtl: Y });
|
|
1156
1157
|
};
|
|
1157
1158
|
m();
|
|
1158
|
-
const b = new ResizeObserver(m),
|
|
1159
|
-
return
|
|
1159
|
+
const b = new ResizeObserver(m), H = c.current, R = s();
|
|
1160
|
+
return H && b.observe(H), R && b.observe(R), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1160
1161
|
b.disconnect(), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1161
1162
|
};
|
|
1162
|
-
}, [p,
|
|
1163
|
+
}, [p, A, c, s]), !p && !A || !y) return null;
|
|
1163
1164
|
const u = [
|
|
1164
1165
|
["rowAbove", "rowBelow"],
|
|
1165
1166
|
["colLeft", "colRight"],
|
|
1166
1167
|
["addHead"],
|
|
1167
|
-
...
|
|
1168
|
+
...l ? ["colour"] : [],
|
|
1168
1169
|
["deleteRow", "deleteColumn"],
|
|
1169
1170
|
["deleteTable"]
|
|
1170
1171
|
];
|
|
@@ -1172,54 +1173,54 @@ function Fr({
|
|
|
1172
1173
|
// Tooltips disambiguate the icon-only ops on hover (and provide each
|
|
1173
1174
|
// button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
|
|
1174
1175
|
// needs a provider ancestor, so scope one to the bar.
|
|
1175
|
-
/* @__PURE__ */ e(
|
|
1176
|
+
/* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(
|
|
1176
1177
|
"div",
|
|
1177
1178
|
{
|
|
1178
|
-
role: "
|
|
1179
|
-
"aria-label":
|
|
1180
|
-
className: `${
|
|
1179
|
+
role: "group",
|
|
1180
|
+
"aria-label": i("editor.table.toolbar", "Table tools"),
|
|
1181
|
+
className: `${Fr} ${y.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
|
|
1181
1182
|
style: {
|
|
1182
1183
|
"--rte-tt-top": `${y.top}px`,
|
|
1183
1184
|
"--rte-tt-start": `${y.start}px`
|
|
1184
1185
|
},
|
|
1185
|
-
children: u.map((m, b) => /* @__PURE__ */ v(
|
|
1186
|
-
b > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className:
|
|
1187
|
-
m === "colour" ? /* @__PURE__ */ v(
|
|
1186
|
+
children: u.map((m, b) => /* @__PURE__ */ v(ft, { children: [
|
|
1187
|
+
b > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: Ze }) : null,
|
|
1188
|
+
m === "colour" ? /* @__PURE__ */ v(Ie, { children: [
|
|
1188
1189
|
/* @__PURE__ */ e(
|
|
1189
|
-
|
|
1190
|
+
Xe,
|
|
1190
1191
|
{
|
|
1191
1192
|
scope: "cell",
|
|
1192
|
-
icon: /* @__PURE__ */ e(
|
|
1193
|
-
label:
|
|
1194
|
-
onOpenChange:
|
|
1193
|
+
icon: /* @__PURE__ */ e(or, {}),
|
|
1194
|
+
label: i("editor.table.cellColor", "Cell colour"),
|
|
1195
|
+
onOpenChange: $,
|
|
1195
1196
|
saveTableCell: h,
|
|
1196
|
-
applyTableBackground:
|
|
1197
|
+
applyTableBackground: f
|
|
1197
1198
|
}
|
|
1198
1199
|
),
|
|
1199
1200
|
/* @__PURE__ */ e(
|
|
1200
|
-
|
|
1201
|
+
Xe,
|
|
1201
1202
|
{
|
|
1202
1203
|
scope: "row",
|
|
1203
|
-
icon: /* @__PURE__ */ e(
|
|
1204
|
-
label:
|
|
1205
|
-
onOpenChange:
|
|
1204
|
+
icon: /* @__PURE__ */ e(ir, {}),
|
|
1205
|
+
label: i("editor.table.rowColor", "Row colour"),
|
|
1206
|
+
onOpenChange: $,
|
|
1206
1207
|
saveTableCell: h,
|
|
1207
|
-
applyTableBackground:
|
|
1208
|
+
applyTableBackground: f
|
|
1208
1209
|
}
|
|
1209
1210
|
)
|
|
1210
|
-
] }) : m.map((
|
|
1211
|
-
const
|
|
1211
|
+
] }) : m.map((H) => {
|
|
1212
|
+
const R = Br[H];
|
|
1212
1213
|
return /* @__PURE__ */ e(
|
|
1213
1214
|
q,
|
|
1214
1215
|
{
|
|
1215
1216
|
size: "sm",
|
|
1216
1217
|
intent: "ghost",
|
|
1217
|
-
icon:
|
|
1218
|
-
tooltip:
|
|
1219
|
-
onMouseDown: (
|
|
1220
|
-
onClick: () => a(
|
|
1218
|
+
icon: R.icon,
|
|
1219
|
+
tooltip: i(R.label[0], R.label[1]),
|
|
1220
|
+
onMouseDown: (E) => E.preventDefault(),
|
|
1221
|
+
onClick: () => a(R.command)
|
|
1221
1222
|
},
|
|
1222
|
-
|
|
1223
|
+
H
|
|
1223
1224
|
);
|
|
1224
1225
|
})
|
|
1225
1226
|
] }, m === "colour" ? "colour" : m[0]))
|
|
@@ -1227,139 +1228,140 @@ function Fr({
|
|
|
1227
1228
|
) })
|
|
1228
1229
|
);
|
|
1229
1230
|
}
|
|
1230
|
-
function
|
|
1231
|
+
function Wr({
|
|
1231
1232
|
run: n,
|
|
1232
1233
|
active: a,
|
|
1233
1234
|
preset: c,
|
|
1234
|
-
insertHtml:
|
|
1235
|
-
insertTable:
|
|
1235
|
+
insertHtml: s,
|
|
1236
|
+
insertTable: l,
|
|
1236
1237
|
saveSelection: h,
|
|
1237
|
-
restoreSelection:
|
|
1238
|
-
getSelectedText:
|
|
1238
|
+
restoreSelection: f,
|
|
1239
|
+
getSelectedText: i,
|
|
1239
1240
|
uploadImage: p,
|
|
1240
1241
|
enableColor: y = !1,
|
|
1241
1242
|
enableImage: T = !1,
|
|
1242
|
-
enableTable:
|
|
1243
|
-
showExtensions:
|
|
1243
|
+
enableTable: I = !1,
|
|
1244
|
+
showExtensions: A = !1
|
|
1244
1245
|
}) {
|
|
1245
|
-
const { t: k } =
|
|
1246
|
+
const { t: k } = Q(), $ = (C) => C.preventDefault(), u = (C) => Hr[c].includes(C), m = (C) => {
|
|
1246
1247
|
if (!u(C)) return null;
|
|
1247
|
-
const
|
|
1248
|
+
const L = Er[C];
|
|
1248
1249
|
return /* @__PURE__ */ e(
|
|
1249
1250
|
q,
|
|
1250
1251
|
{
|
|
1251
1252
|
size: "sm",
|
|
1252
1253
|
intent: "ghost",
|
|
1253
|
-
icon:
|
|
1254
|
-
"aria-label": k(
|
|
1255
|
-
"aria-pressed":
|
|
1256
|
-
onMouseDown:
|
|
1257
|
-
onClick: () => n(...
|
|
1254
|
+
icon: L.icon,
|
|
1255
|
+
"aria-label": k(L.label[0], L.label[1]),
|
|
1256
|
+
"aria-pressed": L.toggle ? a.has(L.toggle) : void 0,
|
|
1257
|
+
onMouseDown: $,
|
|
1258
|
+
onClick: () => n(...L.command)
|
|
1258
1259
|
},
|
|
1259
|
-
|
|
1260
|
+
L.id
|
|
1260
1261
|
);
|
|
1261
|
-
}, b = () => /* @__PURE__ */ e("span", { "aria-hidden": "true", className:
|
|
1262
|
+
}, b = () => /* @__PURE__ */ e("span", { "aria-hidden": "true", className: Ze }), H = u("format"), R = u("bold") || u("italic") || u("underline") || u("strike") || y, E = u("ul") || u("ol"), J = u("link") || T || I;
|
|
1262
1263
|
return /* @__PURE__ */ v(
|
|
1263
1264
|
"div",
|
|
1264
1265
|
{
|
|
1265
|
-
role: "
|
|
1266
|
+
role: "group",
|
|
1266
1267
|
"aria-label": k("editor.toolbarLabel"),
|
|
1267
|
-
className:
|
|
1268
|
+
className: Ir(),
|
|
1268
1269
|
"data-component": "editor-toolbar",
|
|
1269
1270
|
children: [
|
|
1270
|
-
|
|
1271
|
-
|
|
1271
|
+
H ? /* @__PURE__ */ e($r, { run: n, active: a, onTriggerDown: $ }) : null,
|
|
1272
|
+
H && R ? /* @__PURE__ */ e(b, {}) : null,
|
|
1272
1273
|
m("bold"),
|
|
1273
1274
|
m("italic"),
|
|
1274
1275
|
m("underline"),
|
|
1275
1276
|
m("strike"),
|
|
1276
1277
|
y ? /* @__PURE__ */ e(
|
|
1277
|
-
|
|
1278
|
+
Dr,
|
|
1278
1279
|
{
|
|
1279
1280
|
run: n,
|
|
1280
1281
|
saveSelection: h,
|
|
1281
|
-
restoreSelection:
|
|
1282
|
+
restoreSelection: f
|
|
1282
1283
|
}
|
|
1283
1284
|
) : null,
|
|
1284
1285
|
y ? /* @__PURE__ */ e(
|
|
1285
|
-
|
|
1286
|
+
jr,
|
|
1286
1287
|
{
|
|
1287
1288
|
run: n,
|
|
1288
1289
|
saveSelection: h,
|
|
1289
|
-
restoreSelection:
|
|
1290
|
+
restoreSelection: f
|
|
1290
1291
|
}
|
|
1291
1292
|
) : null,
|
|
1292
|
-
(
|
|
1293
|
+
(H || R) && E ? /* @__PURE__ */ e(b, {}) : null,
|
|
1293
1294
|
m("ul"),
|
|
1294
1295
|
m("ol"),
|
|
1295
|
-
(
|
|
1296
|
+
(H || R || E) && J ? /* @__PURE__ */ e(b, {}) : null,
|
|
1296
1297
|
u("link") ? /* @__PURE__ */ e(
|
|
1297
|
-
|
|
1298
|
+
Lr,
|
|
1298
1299
|
{
|
|
1299
|
-
insertHtml:
|
|
1300
|
+
insertHtml: s,
|
|
1300
1301
|
saveSelection: h,
|
|
1301
|
-
restoreSelection:
|
|
1302
|
-
getSelectedText:
|
|
1302
|
+
restoreSelection: f,
|
|
1303
|
+
getSelectedText: i
|
|
1303
1304
|
}
|
|
1304
1305
|
) : null,
|
|
1305
1306
|
T ? /* @__PURE__ */ e(
|
|
1306
|
-
|
|
1307
|
+
Or,
|
|
1307
1308
|
{
|
|
1308
|
-
insertHtml:
|
|
1309
|
+
insertHtml: s,
|
|
1309
1310
|
saveSelection: h,
|
|
1310
|
-
restoreSelection:
|
|
1311
|
+
restoreSelection: f,
|
|
1311
1312
|
uploadImage: p
|
|
1312
1313
|
}
|
|
1313
1314
|
) : null,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1315
|
+
I ? /* @__PURE__ */ e(Pr, { run: n, insertTable: l, active: a }) : null,
|
|
1316
|
+
A && (H || R || E || J) ? /* @__PURE__ */ e(b, {}) : null,
|
|
1317
|
+
A ? /* @__PURE__ */ e(
|
|
1317
1318
|
q,
|
|
1318
1319
|
{
|
|
1319
1320
|
size: "sm",
|
|
1320
1321
|
intent: "ghost",
|
|
1321
|
-
icon: /* @__PURE__ */ e(
|
|
1322
|
+
icon: /* @__PURE__ */ e(Tr, {}),
|
|
1322
1323
|
"aria-label": k("editor.extensions", "Editor extensions"),
|
|
1323
|
-
|
|
1324
|
+
disabled: !0,
|
|
1325
|
+
onMouseDown: $
|
|
1324
1326
|
}
|
|
1325
1327
|
) : null
|
|
1326
1328
|
]
|
|
1327
1329
|
}
|
|
1328
1330
|
);
|
|
1329
1331
|
}
|
|
1330
|
-
function
|
|
1331
|
-
return
|
|
1332
|
+
function ne(n) {
|
|
1333
|
+
return vt(n, "rich-text");
|
|
1332
1334
|
}
|
|
1333
|
-
function
|
|
1335
|
+
function Se(n = "") {
|
|
1334
1336
|
const a = String(n).trim();
|
|
1335
1337
|
if (a === "" || a === "<p><br></p>" || a === "<p> </p>")
|
|
1336
1338
|
return "";
|
|
1337
1339
|
const c = a.replace(/<br\s*\/?>/gi, "").replace(/ /gi, "").replace(/<[^>]+>/g, "").trim();
|
|
1338
1340
|
return c === "" && /<img\b[^>]*>/i.test(a) ? a : c === "" ? "" : a;
|
|
1339
1341
|
}
|
|
1340
|
-
function
|
|
1342
|
+
function Ur(n) {
|
|
1341
1343
|
return n.replace(
|
|
1342
1344
|
/<img(?![^>]*\sloading=)([^>]*)>/gi,
|
|
1343
1345
|
'<img loading="lazy"$1>'
|
|
1344
1346
|
);
|
|
1345
1347
|
}
|
|
1346
|
-
function
|
|
1348
|
+
function Xr(n) {
|
|
1347
1349
|
if (!n || typeof n != "object") return;
|
|
1348
|
-
const a = n, c = (
|
|
1349
|
-
if (
|
|
1350
|
-
const
|
|
1351
|
-
return typeof
|
|
1350
|
+
const a = n, c = (s) => {
|
|
1351
|
+
if (s && typeof s == "object" && "url" in s) {
|
|
1352
|
+
const l = s.url;
|
|
1353
|
+
return typeof l == "string" ? l : void 0;
|
|
1352
1354
|
}
|
|
1353
1355
|
};
|
|
1354
1356
|
return typeof a.url == "string" ? a.url : c(a.file) ?? c(a.data) ?? Object.values(a).map(c).find(Boolean);
|
|
1355
1357
|
}
|
|
1356
|
-
function
|
|
1358
|
+
function Qr(n) {
|
|
1357
1359
|
if (n) return n;
|
|
1358
1360
|
if (typeof window > "u") return null;
|
|
1359
1361
|
const a = window;
|
|
1360
1362
|
return a.$R ?? a.Redactor ?? null;
|
|
1361
1363
|
}
|
|
1362
|
-
const
|
|
1364
|
+
const Yr = {
|
|
1363
1365
|
bold: ["module.inline.format", { tag: "b" }],
|
|
1364
1366
|
italic: ["module.inline.format", { tag: "i" }],
|
|
1365
1367
|
strikethrough: ["module.inline.format", { tag: "del" }],
|
|
@@ -1368,17 +1370,17 @@ const Xr = {
|
|
|
1368
1370
|
heading: ["module.block.format", { tag: "h2" }],
|
|
1369
1371
|
quote: ["module.block.format", { tag: "blockquote" }],
|
|
1370
1372
|
paragraph: ["module.block.format", { tag: "p" }]
|
|
1371
|
-
},
|
|
1373
|
+
}, Zr = {
|
|
1372
1374
|
zh: "zh_cn",
|
|
1373
1375
|
pt: "pt_br"
|
|
1374
1376
|
};
|
|
1375
|
-
function
|
|
1377
|
+
function Jr(n) {
|
|
1376
1378
|
const a = n.split("-")[0];
|
|
1377
|
-
return
|
|
1379
|
+
return Zr[a] ?? a ?? "en";
|
|
1378
1380
|
}
|
|
1379
|
-
const
|
|
1381
|
+
const Kr = $e(
|
|
1380
1382
|
"redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
1381
|
-
),
|
|
1383
|
+
), en = $e(
|
|
1382
1384
|
[
|
|
1383
1385
|
"ds:block ds:[inline-size:100%]",
|
|
1384
1386
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
@@ -1392,7 +1394,7 @@ const Zr = He(
|
|
|
1392
1394
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1393
1395
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
1394
1396
|
].join(" ")
|
|
1395
|
-
),
|
|
1397
|
+
), Je = [
|
|
1396
1398
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
1397
1399
|
"ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
|
|
1398
1400
|
"ds:text-[color:var(--primary-foreground)]",
|
|
@@ -1401,141 +1403,141 @@ const Zr = He(
|
|
|
1401
1403
|
"ds:focus-visible:outline-solid",
|
|
1402
1404
|
"ds:focus-visible:outline-[var(--primary-foreground)]",
|
|
1403
1405
|
"ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
|
|
1404
|
-
].join(" "),
|
|
1406
|
+
].join(" "), Qe = `${Je} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, tn = `${Je} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, rn = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", nn = gt(
|
|
1405
1407
|
({
|
|
1406
1408
|
id: n,
|
|
1407
1409
|
defaultValue: a,
|
|
1408
1410
|
value: c,
|
|
1409
|
-
onChange:
|
|
1410
|
-
toolbar:
|
|
1411
|
+
onChange: s,
|
|
1412
|
+
toolbar: l = "standard",
|
|
1411
1413
|
placeholder: h,
|
|
1412
|
-
readOnly:
|
|
1413
|
-
ariaLabel:
|
|
1414
|
+
readOnly: f = !1,
|
|
1415
|
+
ariaLabel: i,
|
|
1414
1416
|
minHeight: p,
|
|
1415
1417
|
showExtensions: y,
|
|
1416
1418
|
className: T,
|
|
1417
|
-
redactor:
|
|
1418
|
-
options:
|
|
1419
|
+
redactor: I,
|
|
1420
|
+
options: A,
|
|
1419
1421
|
plugins: k,
|
|
1420
|
-
lang:
|
|
1422
|
+
lang: $,
|
|
1421
1423
|
imageUploadUrl: u,
|
|
1422
1424
|
onKeyDown: m,
|
|
1423
1425
|
onRequestAiDraft: b,
|
|
1424
|
-
aiDraftFormat:
|
|
1425
|
-
aiPrivacyNotice:
|
|
1426
|
-
onDictate:
|
|
1427
|
-
},
|
|
1428
|
-
const { t: C, i18n:
|
|
1429
|
-
() => `rte-${
|
|
1430
|
-
[
|
|
1431
|
-
),
|
|
1426
|
+
aiDraftFormat: H = "html",
|
|
1427
|
+
aiPrivacyNotice: R,
|
|
1428
|
+
onDictate: E
|
|
1429
|
+
}, J) => {
|
|
1430
|
+
const { t: C, i18n: L } = Q(), Y = ie(), G = Ge(
|
|
1431
|
+
() => `rte-${Y.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
1432
|
+
[Y]
|
|
1433
|
+
), x = `#${G}`, B = D(null), F = D(null), se = D(!1), he = D(f), W = D(null), fe = D(null), [N, O] = M(!1), [te, V] = M(!1), [Oe, Ke] = M(
|
|
1432
1434
|
() => /* @__PURE__ */ new Set()
|
|
1433
|
-
),
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
}, [
|
|
1437
|
-
const
|
|
1435
|
+
), le = D(null), U = D(s), ge = D(m);
|
|
1436
|
+
ee(() => {
|
|
1437
|
+
U.current = s, ge.current = m;
|
|
1438
|
+
}, [s, m]);
|
|
1439
|
+
const et = D(
|
|
1438
1440
|
(() => {
|
|
1439
1441
|
const t = c ?? a ?? "";
|
|
1440
|
-
return t ?
|
|
1442
|
+
return t ? ne(t) : "";
|
|
1441
1443
|
})()
|
|
1442
|
-
),
|
|
1444
|
+
), de = z(() => {
|
|
1443
1445
|
var r;
|
|
1444
|
-
const t =
|
|
1446
|
+
const t = F.current;
|
|
1445
1447
|
if (t)
|
|
1446
1448
|
try {
|
|
1447
|
-
const o = t(
|
|
1449
|
+
const o = t(x, "source.getCode");
|
|
1448
1450
|
if (typeof o == "string") return o;
|
|
1449
1451
|
} catch {
|
|
1450
1452
|
}
|
|
1451
|
-
return ((r =
|
|
1452
|
-
}, [
|
|
1453
|
+
return ((r = B.current) == null ? void 0 : r.value) ?? "";
|
|
1454
|
+
}, [x]), K = z(
|
|
1453
1455
|
(t, ...r) => {
|
|
1454
|
-
const o =
|
|
1456
|
+
const o = F.current;
|
|
1455
1457
|
if (!o) return !1;
|
|
1456
|
-
const d =
|
|
1458
|
+
const d = he.current;
|
|
1457
1459
|
if (d)
|
|
1458
1460
|
try {
|
|
1459
|
-
o(
|
|
1461
|
+
o(x, "disableReadOnly");
|
|
1460
1462
|
} catch {
|
|
1461
1463
|
}
|
|
1462
1464
|
try {
|
|
1463
|
-
return o(
|
|
1465
|
+
return o(x, t, ...r), !0;
|
|
1464
1466
|
} catch {
|
|
1465
1467
|
return !1;
|
|
1466
1468
|
} finally {
|
|
1467
1469
|
if (d)
|
|
1468
1470
|
try {
|
|
1469
|
-
o(
|
|
1471
|
+
o(x, "enableReadOnly");
|
|
1470
1472
|
} catch {
|
|
1471
1473
|
}
|
|
1472
1474
|
}
|
|
1473
1475
|
},
|
|
1474
|
-
[
|
|
1475
|
-
),
|
|
1476
|
+
[x]
|
|
1477
|
+
), ae = z(
|
|
1476
1478
|
(t, r) => {
|
|
1477
|
-
var
|
|
1478
|
-
const o = (r == null ? void 0 : r.asHtml) ?? !0, d = o ?
|
|
1479
|
-
if (
|
|
1480
|
-
const w =
|
|
1479
|
+
var ue;
|
|
1480
|
+
const o = (r == null ? void 0 : r.asHtml) ?? !0, d = o ? ne(t) : t;
|
|
1481
|
+
if (K(o ? "insertion.insertHtml" : "insertion.insertText", d)) return;
|
|
1482
|
+
const w = B.current;
|
|
1481
1483
|
if (!w) return;
|
|
1482
|
-
const
|
|
1483
|
-
w.value = w.value.slice(0,
|
|
1484
|
-
const
|
|
1484
|
+
const _ = w.selectionStart ?? w.value.length, X = w.selectionEnd ?? w.value.length;
|
|
1485
|
+
w.value = w.value.slice(0, _) + d + w.value.slice(X);
|
|
1486
|
+
const we = _ + d.length;
|
|
1485
1487
|
try {
|
|
1486
|
-
w.setSelectionRange(
|
|
1488
|
+
w.setSelectionRange(we, we);
|
|
1487
1489
|
} catch {
|
|
1488
1490
|
}
|
|
1489
|
-
(
|
|
1491
|
+
(ue = U.current) == null || ue.call(U, { html: ne(w.value), markdown: "" });
|
|
1490
1492
|
},
|
|
1491
|
-
[
|
|
1492
|
-
),
|
|
1493
|
+
[K]
|
|
1494
|
+
), ze = D(null), re = z(() => {
|
|
1493
1495
|
var d;
|
|
1494
|
-
const t = (d =
|
|
1496
|
+
const t = (d = W.current) == null ? void 0 : d.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, o = /* @__PURE__ */ new Set();
|
|
1495
1497
|
if (t && r && r.anchorNode && t.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
|
|
1496
|
-
r.rangeCount > 0 && (
|
|
1498
|
+
r.rangeCount > 0 && (ze.current = r.getRangeAt(0).cloneRange());
|
|
1497
1499
|
try {
|
|
1498
1500
|
document.queryCommandState("bold") && o.add("bold"), document.queryCommandState("italic") && o.add("italic"), document.queryCommandState("underline") && o.add("underline"), document.queryCommandState("strikeThrough") && o.add("strike"), document.queryCommandState("insertUnorderedList") && o.add("ul"), document.queryCommandState("insertOrderedList") && o.add("ol");
|
|
1499
|
-
const
|
|
1501
|
+
const g = String(
|
|
1500
1502
|
document.queryCommandValue("formatBlock") || ""
|
|
1501
1503
|
).toLowerCase();
|
|
1502
|
-
/^h[1-6]$/.test(
|
|
1504
|
+
/^h[1-6]$/.test(g) ? (o.add("heading"), o.add(g)) : g === "blockquote" ? o.add("quote") : o.add("paragraph");
|
|
1503
1505
|
const w = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
|
|
1504
1506
|
w && t.contains(w) && w.closest("table") && o.add("table");
|
|
1505
1507
|
} catch {
|
|
1506
1508
|
}
|
|
1507
1509
|
}
|
|
1508
|
-
|
|
1509
|
-
(
|
|
1510
|
+
Ke(
|
|
1511
|
+
(g) => g.size === o.size && [...o].every((w) => g.has(w)) ? g : o
|
|
1510
1512
|
);
|
|
1511
|
-
}, []),
|
|
1513
|
+
}, []), pe = z(
|
|
1512
1514
|
(t, ...r) => {
|
|
1513
|
-
|
|
1515
|
+
K(t, ...r), typeof window < "u" ? window.requestAnimationFrame(() => re()) : re();
|
|
1514
1516
|
},
|
|
1515
|
-
[
|
|
1516
|
-
),
|
|
1517
|
+
[K, re]
|
|
1518
|
+
), Te = z(
|
|
1517
1519
|
(t) => {
|
|
1518
|
-
|
|
1520
|
+
ae(t, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => re());
|
|
1519
1521
|
},
|
|
1520
|
-
[
|
|
1521
|
-
),
|
|
1522
|
+
[ae, re]
|
|
1523
|
+
), tt = z(() => {
|
|
1522
1524
|
var r;
|
|
1523
1525
|
if (typeof window < "u") {
|
|
1524
|
-
const o = (r =
|
|
1525
|
-
o && d && d.rangeCount > 0 && d.anchorNode && o.contains(d.anchorNode) && (
|
|
1526
|
+
const o = (r = W.current) == null ? void 0 : r.querySelector(".redactor-in"), d = window.getSelection();
|
|
1527
|
+
o && d && d.rangeCount > 0 && d.anchorNode && o.contains(d.anchorNode) && (ze.current = d.getRangeAt(0).cloneRange());
|
|
1526
1528
|
}
|
|
1527
|
-
const t =
|
|
1529
|
+
const t = F.current;
|
|
1528
1530
|
if (t)
|
|
1529
1531
|
try {
|
|
1530
|
-
t(
|
|
1532
|
+
t(x, "selection.save");
|
|
1531
1533
|
} catch {
|
|
1532
1534
|
}
|
|
1533
|
-
}, [
|
|
1534
|
-
const t =
|
|
1535
|
+
}, [x]), rt = z(() => {
|
|
1536
|
+
const t = F.current;
|
|
1535
1537
|
if (!t) return;
|
|
1536
|
-
const r =
|
|
1538
|
+
const r = ze.current;
|
|
1537
1539
|
try {
|
|
1538
|
-
t(
|
|
1540
|
+
t(x, "editor.focus");
|
|
1539
1541
|
} catch {
|
|
1540
1542
|
}
|
|
1541
1543
|
if (r && typeof window < "u") {
|
|
@@ -1548,79 +1550,79 @@ const Zr = He(
|
|
|
1548
1550
|
}
|
|
1549
1551
|
}
|
|
1550
1552
|
try {
|
|
1551
|
-
t(
|
|
1553
|
+
t(x, "selection.restore");
|
|
1552
1554
|
} catch {
|
|
1553
1555
|
}
|
|
1554
|
-
}, [
|
|
1556
|
+
}, [x]), nt = z(() => {
|
|
1555
1557
|
var o;
|
|
1556
1558
|
if (typeof window > "u") return "";
|
|
1557
|
-
const t = (o =
|
|
1559
|
+
const t = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in"), r = window.getSelection();
|
|
1558
1560
|
return !t || !r || !r.anchorNode || !t.contains(r.anchorNode) ? "" : r.toString();
|
|
1559
|
-
}, []),
|
|
1560
|
-
var
|
|
1561
|
+
}, []), ot = z(() => {
|
|
1562
|
+
var g;
|
|
1561
1563
|
if (typeof window > "u") return null;
|
|
1562
|
-
const t = (
|
|
1564
|
+
const t = (g = W.current) == null ? void 0 : g.querySelector(".redactor-in"), r = window.getSelection();
|
|
1563
1565
|
if (!t || !r || r.rangeCount === 0) return null;
|
|
1564
1566
|
const o = r.anchorNode, d = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
|
|
1565
1567
|
return !d || !t.contains(d) ? null : d.closest("table");
|
|
1566
|
-
}, []),
|
|
1567
|
-
var
|
|
1568
|
+
}, []), De = D(null), be = z(() => {
|
|
1569
|
+
var g;
|
|
1568
1570
|
if (typeof window > "u") return null;
|
|
1569
|
-
const t = (
|
|
1571
|
+
const t = (g = W.current) == null ? void 0 : g.querySelector(".redactor-in"), r = window.getSelection();
|
|
1570
1572
|
if (!t || !r || r.rangeCount === 0) return null;
|
|
1571
1573
|
const o = r.anchorNode, d = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
|
|
1572
1574
|
return !d || !t.contains(d) ? null : d.closest("td,th");
|
|
1573
|
-
}, []),
|
|
1574
|
-
|
|
1575
|
-
}, [
|
|
1575
|
+
}, []), at = z(() => {
|
|
1576
|
+
De.current = be();
|
|
1577
|
+
}, [be]), it = z(
|
|
1576
1578
|
(t, r) => {
|
|
1577
1579
|
var w;
|
|
1578
|
-
const o =
|
|
1580
|
+
const o = De.current ?? be();
|
|
1579
1581
|
if (!o) return;
|
|
1580
1582
|
const d = t === "row" ? Array.from(((w = o.closest("tr")) == null ? void 0 : w.children) ?? [o]).filter(
|
|
1581
|
-
(
|
|
1582
|
-
) : [o],
|
|
1583
|
-
if (
|
|
1583
|
+
(_) => _ instanceof HTMLElement && (_.tagName === "TD" || _.tagName === "TH")
|
|
1584
|
+
) : [o], g = F.current;
|
|
1585
|
+
if (g)
|
|
1584
1586
|
try {
|
|
1585
|
-
|
|
1587
|
+
g(x, "module.buffer.trigger");
|
|
1586
1588
|
} catch {
|
|
1587
1589
|
}
|
|
1588
|
-
for (const
|
|
1589
|
-
r ?
|
|
1590
|
-
if (
|
|
1590
|
+
for (const _ of d)
|
|
1591
|
+
r ? _.style.setProperty("background-color", r) : _.style.removeProperty("background-color");
|
|
1592
|
+
if (g)
|
|
1591
1593
|
try {
|
|
1592
|
-
|
|
1594
|
+
g(x, "broadcast", "hardsync");
|
|
1593
1595
|
} catch {
|
|
1594
1596
|
}
|
|
1595
|
-
typeof window < "u" && window.requestAnimationFrame(() =>
|
|
1597
|
+
typeof window < "u" && window.requestAnimationFrame(() => re());
|
|
1596
1598
|
},
|
|
1597
|
-
[
|
|
1598
|
-
),
|
|
1599
|
+
[be, x, re]
|
|
1600
|
+
), st = z(
|
|
1599
1601
|
(t) => {
|
|
1600
1602
|
var o;
|
|
1601
|
-
const r =
|
|
1603
|
+
const r = F.current;
|
|
1602
1604
|
if (r && typeof window < "u") {
|
|
1603
|
-
const d = (o =
|
|
1604
|
-
if (
|
|
1605
|
+
const d = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in"), g = window.getSelection(), w = g == null ? void 0 : g.anchorNode, _ = w && w.nodeType === Node.TEXT_NODE ? w.parentElement : w, X = _ && (d != null && d.contains(_)) ? _.closest("ul,ol") : null;
|
|
1606
|
+
if (X)
|
|
1605
1607
|
try {
|
|
1606
|
-
r(
|
|
1608
|
+
r(x, "caret.setAfter", X);
|
|
1607
1609
|
} catch {
|
|
1608
1610
|
}
|
|
1609
1611
|
}
|
|
1610
|
-
|
|
1611
|
-
var
|
|
1612
|
-
const d = (
|
|
1612
|
+
Te(t), typeof window < "u" && window.requestAnimationFrame(() => {
|
|
1613
|
+
var g;
|
|
1614
|
+
const d = (g = W.current) == null ? void 0 : g.querySelector(".redactor-in");
|
|
1613
1615
|
d == null || d.querySelectorAll("table td, table th").forEach((w) => {
|
|
1614
|
-
let
|
|
1615
|
-
for (;
|
|
1616
|
-
const
|
|
1617
|
-
w.removeChild(
|
|
1616
|
+
let _ = w.lastChild;
|
|
1617
|
+
for (; _ && _.nodeType === Node.TEXT_NODE && !(_.textContent ?? "").trim(); ) {
|
|
1618
|
+
const X = _.previousSibling;
|
|
1619
|
+
w.removeChild(_), _ = X;
|
|
1618
1620
|
}
|
|
1619
1621
|
});
|
|
1620
1622
|
});
|
|
1621
1623
|
},
|
|
1622
|
-
[
|
|
1623
|
-
),
|
|
1624
|
+
[Te, x]
|
|
1625
|
+
), lt = z(
|
|
1624
1626
|
async (t, r) => {
|
|
1625
1627
|
if (!u) throw new Error("No image upload URL configured.");
|
|
1626
1628
|
const o = new FormData();
|
|
@@ -1632,74 +1634,74 @@ const Zr = He(
|
|
|
1632
1634
|
signal: r
|
|
1633
1635
|
});
|
|
1634
1636
|
if (!d.ok) throw new Error(`Image upload failed (${d.status}).`);
|
|
1635
|
-
const
|
|
1636
|
-
if (!
|
|
1637
|
-
return
|
|
1637
|
+
const g = Xr(await d.json());
|
|
1638
|
+
if (!g) throw new Error("Image upload response contained no URL.");
|
|
1639
|
+
return g;
|
|
1638
1640
|
},
|
|
1639
1641
|
[u]
|
|
1640
|
-
),
|
|
1641
|
-
const t =
|
|
1642
|
-
t != null && t.parentNode && t.parentNode.removeChild(t),
|
|
1643
|
-
}, []),
|
|
1642
|
+
), ce = D(null), ve = D(null), [Z, je] = M(!1), [dt, qe] = M(!1), [ct, Me] = M(""), ye = z(() => {
|
|
1643
|
+
const t = ve.current;
|
|
1644
|
+
t != null && t.parentNode && t.parentNode.removeChild(t), ve.current = null;
|
|
1645
|
+
}, []), Pe = z((t) => {
|
|
1644
1646
|
var d;
|
|
1645
|
-
const r = (d =
|
|
1647
|
+
const r = (d = W.current) == null ? void 0 : d.querySelector(
|
|
1646
1648
|
".redactor-in"
|
|
1647
1649
|
);
|
|
1648
1650
|
if (!r) return;
|
|
1649
|
-
let o =
|
|
1651
|
+
let o = ve.current;
|
|
1650
1652
|
if (!o || !r.contains(o)) {
|
|
1651
1653
|
o = document.createElement("span"), o.setAttribute("data-rte-interim", ""), o.setAttribute("contenteditable", "false");
|
|
1652
|
-
const
|
|
1653
|
-
if (
|
|
1654
|
-
const w =
|
|
1654
|
+
const g = window.getSelection();
|
|
1655
|
+
if (g && g.rangeCount > 0 && r.contains(g.anchorNode)) {
|
|
1656
|
+
const w = g.getRangeAt(0);
|
|
1655
1657
|
w.collapse(!1), w.insertNode(o);
|
|
1656
1658
|
} else
|
|
1657
1659
|
r.appendChild(o);
|
|
1658
|
-
|
|
1660
|
+
ve.current = o;
|
|
1659
1661
|
}
|
|
1660
1662
|
o.textContent = t;
|
|
1661
|
-
}, []),
|
|
1663
|
+
}, []), Be = z(() => {
|
|
1662
1664
|
var t;
|
|
1663
|
-
(t =
|
|
1664
|
-
}, []),
|
|
1665
|
-
if (!
|
|
1665
|
+
(t = ce.current) == null || t.abort();
|
|
1666
|
+
}, []), Fe = z(() => {
|
|
1667
|
+
if (!E) return;
|
|
1666
1668
|
const t = new AbortController();
|
|
1667
|
-
|
|
1669
|
+
ce.current = t, qe(!1), je(!0), Me(C("editor.ai.listening")), ye(), E({
|
|
1668
1670
|
signal: t.signal,
|
|
1669
1671
|
// Interim text shows live in the editor (grey + caret); each final
|
|
1670
1672
|
// replaces it with committed text at the caret.
|
|
1671
1673
|
onPartialTranscript: (r) => {
|
|
1672
|
-
t.signal.aborted ||
|
|
1674
|
+
t.signal.aborted || Pe(r);
|
|
1673
1675
|
},
|
|
1674
1676
|
onFinalTranscript: (r) => {
|
|
1675
1677
|
if (t.signal.aborted) return;
|
|
1676
|
-
|
|
1678
|
+
ye();
|
|
1677
1679
|
const o = r.trim();
|
|
1678
|
-
o &&
|
|
1680
|
+
o && (ae(`${o} `, { asHtml: !1 }), Me(o));
|
|
1679
1681
|
}
|
|
1680
1682
|
}).catch((r) => {
|
|
1681
|
-
t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" ||
|
|
1683
|
+
t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" || qe(!0);
|
|
1682
1684
|
}).finally(() => {
|
|
1683
|
-
|
|
1685
|
+
ye(), ce.current === t && (ce.current = null, je(!1), Me(""));
|
|
1684
1686
|
});
|
|
1685
|
-
}, [
|
|
1686
|
-
|
|
1687
|
-
}, [
|
|
1688
|
-
|
|
1687
|
+
}, [E, ae, ye, Pe, C]), Ve = z(() => {
|
|
1688
|
+
Z ? Be() : Fe();
|
|
1689
|
+
}, [Z, Fe, Be]);
|
|
1690
|
+
ee(() => () => {
|
|
1689
1691
|
var t;
|
|
1690
|
-
return (t =
|
|
1691
|
-
}, []),
|
|
1692
|
-
const t =
|
|
1692
|
+
return (t = ce.current) == null ? void 0 : t.abort();
|
|
1693
|
+
}, []), ee(() => {
|
|
1694
|
+
const t = B.current;
|
|
1693
1695
|
if (!t) return;
|
|
1694
|
-
t.value =
|
|
1695
|
-
const r =
|
|
1696
|
+
t.value = et.current;
|
|
1697
|
+
const r = Qr(I);
|
|
1696
1698
|
if (!r) {
|
|
1697
|
-
|
|
1699
|
+
O(!0);
|
|
1698
1700
|
return;
|
|
1699
1701
|
}
|
|
1700
|
-
|
|
1702
|
+
F.current = r;
|
|
1701
1703
|
const o = {
|
|
1702
|
-
lang:
|
|
1704
|
+
lang: $ ?? Jr(L.language || "en"),
|
|
1703
1705
|
// The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
|
|
1704
1706
|
// via the command API, so Redactor's native toolbar is suppressed.
|
|
1705
1707
|
toolbar: !1,
|
|
@@ -1710,178 +1712,178 @@ const Zr = He(
|
|
|
1710
1712
|
shortcodes: !1,
|
|
1711
1713
|
imageEditable: !1,
|
|
1712
1714
|
imageResizable: !0
|
|
1713
|
-
}, d = u ? { imageUpload: u } : {},
|
|
1715
|
+
}, d = u ? { imageUpload: u } : {}, g = (A == null ? void 0 : A.callbacks) ?? {}, w = {
|
|
1714
1716
|
...o,
|
|
1715
1717
|
...d,
|
|
1716
|
-
...
|
|
1718
|
+
...A ?? {},
|
|
1717
1719
|
// Re-pin safety-critical keys LAST so consumer `options` can't override
|
|
1718
1720
|
// the sanitising change handler, re-enable image editing, or turn off
|
|
1719
1721
|
// drag-resize (platform re-pins both image flags — RedactorWysiwyg.js:115-116).
|
|
1720
1722
|
imageEditable: !1,
|
|
1721
1723
|
imageResizable: !0,
|
|
1722
1724
|
callbacks: {
|
|
1723
|
-
...
|
|
1724
|
-
changed(
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
var
|
|
1728
|
-
(
|
|
1725
|
+
...g,
|
|
1726
|
+
changed(_) {
|
|
1727
|
+
const X = Se(Ur(_)), we = ne(X);
|
|
1728
|
+
se.current = !0, U.current && (le.current && clearTimeout(le.current), le.current = setTimeout(() => {
|
|
1729
|
+
var ue;
|
|
1730
|
+
(ue = U.current) == null || ue.call(U, { html: we, markdown: "" });
|
|
1729
1731
|
}, 100));
|
|
1730
1732
|
},
|
|
1731
|
-
keydown(
|
|
1732
|
-
var
|
|
1733
|
-
(
|
|
1733
|
+
keydown(_) {
|
|
1734
|
+
var X;
|
|
1735
|
+
(X = ge.current) == null || X.call(ge, _);
|
|
1734
1736
|
},
|
|
1735
1737
|
observe() {
|
|
1736
|
-
|
|
1738
|
+
re();
|
|
1737
1739
|
}
|
|
1738
1740
|
}
|
|
1739
1741
|
};
|
|
1740
1742
|
try {
|
|
1741
|
-
if (r(
|
|
1743
|
+
if (r(x, w), f)
|
|
1742
1744
|
try {
|
|
1743
|
-
r(
|
|
1745
|
+
r(x, "enableReadOnly");
|
|
1744
1746
|
} catch {
|
|
1745
1747
|
}
|
|
1746
1748
|
} catch {
|
|
1747
|
-
|
|
1749
|
+
O(!0);
|
|
1748
1750
|
}
|
|
1749
1751
|
return () => {
|
|
1750
|
-
|
|
1752
|
+
le.current && clearTimeout(le.current);
|
|
1751
1753
|
try {
|
|
1752
|
-
r(
|
|
1754
|
+
r(x, "destroy");
|
|
1753
1755
|
} catch {
|
|
1754
1756
|
}
|
|
1755
|
-
|
|
1757
|
+
F.current = null;
|
|
1756
1758
|
};
|
|
1757
|
-
}, []),
|
|
1758
|
-
if (!
|
|
1759
|
-
if (
|
|
1760
|
-
|
|
1759
|
+
}, []), ee(() => {
|
|
1760
|
+
if (!F.current || c === void 0) return;
|
|
1761
|
+
if (se.current) {
|
|
1762
|
+
se.current = !1;
|
|
1761
1763
|
return;
|
|
1762
1764
|
}
|
|
1763
|
-
const t =
|
|
1764
|
-
|
|
1765
|
-
}, [c,
|
|
1766
|
-
|
|
1767
|
-
const t =
|
|
1765
|
+
const t = ne(Se(c));
|
|
1766
|
+
Se(de()) !== t && K("source.setCode", t);
|
|
1767
|
+
}, [c, de, K]), ee(() => {
|
|
1768
|
+
he.current = f;
|
|
1769
|
+
const t = F.current;
|
|
1768
1770
|
if (t)
|
|
1769
1771
|
try {
|
|
1770
|
-
t(
|
|
1772
|
+
t(x, f ? "enableReadOnly" : "disableReadOnly");
|
|
1771
1773
|
} catch {
|
|
1772
1774
|
}
|
|
1773
|
-
}, [
|
|
1774
|
-
if (!
|
|
1775
|
-
const t =
|
|
1775
|
+
}, [f, x]), ee(() => {
|
|
1776
|
+
if (!N || c === void 0) return;
|
|
1777
|
+
const t = B.current;
|
|
1776
1778
|
if (!t) return;
|
|
1777
|
-
const r =
|
|
1779
|
+
const r = ne(c);
|
|
1778
1780
|
t.value !== r && document.activeElement !== t && (t.value = r);
|
|
1779
|
-
}, [
|
|
1780
|
-
const
|
|
1781
|
+
}, [N, c]);
|
|
1782
|
+
const Re = Ge(
|
|
1781
1783
|
() => ({
|
|
1782
1784
|
getHTML() {
|
|
1783
|
-
return
|
|
1785
|
+
return de();
|
|
1784
1786
|
},
|
|
1785
1787
|
getText() {
|
|
1786
|
-
return
|
|
1788
|
+
return de().replace(/<[^>]*>/g, " ").replace(/ /gi, " ").replace(/\s+/g, " ").trim();
|
|
1787
1789
|
},
|
|
1788
1790
|
getMarkdown() {
|
|
1789
1791
|
return "";
|
|
1790
1792
|
},
|
|
1791
1793
|
setContent(t) {
|
|
1792
|
-
const r =
|
|
1793
|
-
|
|
1794
|
+
const r = ne(t);
|
|
1795
|
+
K("source.setCode", r) || B.current && (B.current.value = r);
|
|
1794
1796
|
},
|
|
1795
|
-
insertAtCursor:
|
|
1797
|
+
insertAtCursor: ae,
|
|
1796
1798
|
applyFormat(t) {
|
|
1797
|
-
const r =
|
|
1798
|
-
r &&
|
|
1799
|
+
const r = Yr[t];
|
|
1800
|
+
r && pe(...r);
|
|
1799
1801
|
},
|
|
1800
1802
|
focus() {
|
|
1801
1803
|
var r;
|
|
1802
|
-
const t =
|
|
1804
|
+
const t = F.current;
|
|
1803
1805
|
if (t)
|
|
1804
1806
|
try {
|
|
1805
|
-
t(
|
|
1807
|
+
t(x, "editor.focus");
|
|
1806
1808
|
return;
|
|
1807
1809
|
} catch {
|
|
1808
1810
|
}
|
|
1809
|
-
(r =
|
|
1811
|
+
(r = B.current) == null || r.focus();
|
|
1810
1812
|
},
|
|
1811
1813
|
clear() {
|
|
1812
|
-
|
|
1814
|
+
K("source.setCode", "") || B.current && (B.current.value = "");
|
|
1813
1815
|
}
|
|
1814
1816
|
}),
|
|
1815
|
-
[
|
|
1817
|
+
[x, de, K, ae, pe]
|
|
1816
1818
|
);
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1819
|
+
pt(J, () => Re, [Re]), yt(Mr, Re, n);
|
|
1820
|
+
const ut = z(
|
|
1819
1821
|
(t) => {
|
|
1820
1822
|
var r;
|
|
1821
|
-
(r =
|
|
1822
|
-
html:
|
|
1823
|
+
(r = U.current) == null || r.call(U, {
|
|
1824
|
+
html: ne(t.target.value),
|
|
1823
1825
|
markdown: ""
|
|
1824
1826
|
});
|
|
1825
1827
|
},
|
|
1826
1828
|
[]
|
|
1827
|
-
),
|
|
1829
|
+
), mt = i ?? C("editor.regionLabel"), ht = h ?? C("editor.placeholder");
|
|
1828
1830
|
return /* @__PURE__ */ v(
|
|
1829
1831
|
"div",
|
|
1830
1832
|
{
|
|
1831
|
-
ref:
|
|
1832
|
-
className: [
|
|
1833
|
+
ref: W,
|
|
1834
|
+
className: [Kr(), T].filter(Boolean).join(" "),
|
|
1833
1835
|
"data-component": "rich-text-editor",
|
|
1834
1836
|
"data-component-id": n,
|
|
1835
1837
|
"data-min-height": p,
|
|
1836
1838
|
children: [
|
|
1837
|
-
!
|
|
1838
|
-
|
|
1839
|
+
!N && !f ? /* @__PURE__ */ e(
|
|
1840
|
+
Wr,
|
|
1839
1841
|
{
|
|
1840
|
-
run:
|
|
1841
|
-
active:
|
|
1842
|
-
preset:
|
|
1843
|
-
insertHtml:
|
|
1844
|
-
insertTable:
|
|
1845
|
-
saveSelection:
|
|
1846
|
-
restoreSelection:
|
|
1847
|
-
getSelectedText:
|
|
1848
|
-
uploadImage: u ?
|
|
1842
|
+
run: pe,
|
|
1843
|
+
active: Oe,
|
|
1844
|
+
preset: l,
|
|
1845
|
+
insertHtml: Te,
|
|
1846
|
+
insertTable: st,
|
|
1847
|
+
saveSelection: tt,
|
|
1848
|
+
restoreSelection: rt,
|
|
1849
|
+
getSelectedText: nt,
|
|
1850
|
+
uploadImage: u ? lt : void 0,
|
|
1849
1851
|
enableColor: (k == null ? void 0 : k.includes("fontcolor")) ?? !1,
|
|
1850
1852
|
enableImage: !!u,
|
|
1851
1853
|
enableTable: (k == null ? void 0 : k.includes("table")) ?? !1,
|
|
1852
1854
|
showExtensions: y
|
|
1853
1855
|
}
|
|
1854
1856
|
) : null,
|
|
1855
|
-
/* @__PURE__ */ v("div", { className: "ds:relative", ref:
|
|
1857
|
+
/* @__PURE__ */ v("div", { className: "ds:relative", ref: fe, children: [
|
|
1856
1858
|
/* @__PURE__ */ e(
|
|
1857
1859
|
"textarea",
|
|
1858
1860
|
{
|
|
1859
|
-
ref:
|
|
1860
|
-
id:
|
|
1861
|
-
"aria-label":
|
|
1861
|
+
ref: B,
|
|
1862
|
+
id: G,
|
|
1863
|
+
"aria-label": mt,
|
|
1862
1864
|
"aria-multiline": "true",
|
|
1863
|
-
placeholder:
|
|
1864
|
-
onChange:
|
|
1865
|
-
readOnly:
|
|
1866
|
-
className:
|
|
1865
|
+
placeholder: ht,
|
|
1866
|
+
onChange: N ? ut : void 0,
|
|
1867
|
+
readOnly: N ? f : void 0,
|
|
1868
|
+
className: N ? en() : void 0
|
|
1867
1869
|
}
|
|
1868
1870
|
),
|
|
1869
|
-
b &&
|
|
1871
|
+
b && E ? /* @__PURE__ */ v("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:shadow-[var(--shadow-lg)]", children: [
|
|
1870
1872
|
/* @__PURE__ */ e(
|
|
1871
1873
|
"button",
|
|
1872
1874
|
{
|
|
1873
1875
|
type: "button",
|
|
1874
|
-
onClick:
|
|
1875
|
-
"aria-pressed":
|
|
1876
|
-
"aria-label": C(
|
|
1877
|
-
className:
|
|
1878
|
-
children:
|
|
1879
|
-
|
|
1876
|
+
onClick: Ve,
|
|
1877
|
+
"aria-pressed": Z,
|
|
1878
|
+
"aria-label": C(Z ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
1879
|
+
className: Z ? tn : Qe,
|
|
1880
|
+
children: Z ? /* @__PURE__ */ e(
|
|
1881
|
+
Ae,
|
|
1880
1882
|
{
|
|
1881
1883
|
"aria-hidden": "true",
|
|
1882
1884
|
className: "ds:size-5 ds:fill-current"
|
|
1883
1885
|
}
|
|
1884
|
-
) : /* @__PURE__ */ e(
|
|
1886
|
+
) : /* @__PURE__ */ e(Ee, { "aria-hidden": "true", className: "ds:size-5" })
|
|
1885
1887
|
}
|
|
1886
1888
|
),
|
|
1887
1889
|
/* @__PURE__ */ e(
|
|
@@ -1895,60 +1897,61 @@ const Zr = He(
|
|
|
1895
1897
|
"button",
|
|
1896
1898
|
{
|
|
1897
1899
|
type: "button",
|
|
1898
|
-
onClick: () =>
|
|
1900
|
+
onClick: () => V(!0),
|
|
1899
1901
|
"aria-label": C("editor.ai.helpMeWrite"),
|
|
1900
|
-
className:
|
|
1901
|
-
children: /* @__PURE__ */ e(
|
|
1902
|
+
className: Qe,
|
|
1903
|
+
children: /* @__PURE__ */ e(He, { "aria-hidden": "true", className: "ds:size-5" })
|
|
1902
1904
|
}
|
|
1903
1905
|
)
|
|
1904
|
-
] }) :
|
|
1906
|
+
] }) : E ? /* @__PURE__ */ e("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10", children: /* @__PURE__ */ e(
|
|
1905
1907
|
q,
|
|
1906
1908
|
{
|
|
1907
1909
|
size: "lg",
|
|
1908
1910
|
intent: "primary",
|
|
1909
|
-
icon:
|
|
1910
|
-
"aria-pressed":
|
|
1911
|
-
"aria-label": C(
|
|
1912
|
-
onClick:
|
|
1913
|
-
className:
|
|
1911
|
+
icon: Z ? /* @__PURE__ */ e(Ae, { className: "ds:fill-current" }) : /* @__PURE__ */ e(Ee, {}),
|
|
1912
|
+
"aria-pressed": Z,
|
|
1913
|
+
"aria-label": C(Z ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
|
|
1914
|
+
onClick: Ve,
|
|
1915
|
+
className: Z ? `${rn} ds:rounded-full ds:shadow-[var(--shadow-lg)]` : "ds:rounded-full ds:shadow-[var(--shadow-lg)]"
|
|
1914
1916
|
}
|
|
1915
1917
|
) }) : b ? /* @__PURE__ */ e("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10", children: /* @__PURE__ */ e(
|
|
1916
1918
|
q,
|
|
1917
1919
|
{
|
|
1918
1920
|
size: "lg",
|
|
1919
1921
|
intent: "primary",
|
|
1920
|
-
icon: /* @__PURE__ */ e(
|
|
1922
|
+
icon: /* @__PURE__ */ e(He, {}),
|
|
1921
1923
|
"aria-label": C("editor.ai.helpMeWrite"),
|
|
1922
|
-
onClick: () =>
|
|
1924
|
+
onClick: () => V(!0),
|
|
1923
1925
|
className: "ds:rounded-full ds:shadow-[var(--shadow-lg)]"
|
|
1924
1926
|
}
|
|
1925
1927
|
) }) : null,
|
|
1926
1928
|
b ? /* @__PURE__ */ e(
|
|
1927
|
-
|
|
1929
|
+
Ar,
|
|
1928
1930
|
{
|
|
1929
|
-
open:
|
|
1930
|
-
onClose: () =>
|
|
1931
|
+
open: te,
|
|
1932
|
+
onClose: () => V(!1),
|
|
1931
1933
|
onRequestAiDraft: b,
|
|
1932
|
-
onInsert: (t) =>
|
|
1933
|
-
previewAsHtml:
|
|
1934
|
-
privacyNotice:
|
|
1935
|
-
onDictate:
|
|
1934
|
+
onInsert: (t) => ae(t, { asHtml: H !== "text" }),
|
|
1935
|
+
previewAsHtml: H !== "text",
|
|
1936
|
+
privacyNotice: R,
|
|
1937
|
+
onDictate: E
|
|
1936
1938
|
}
|
|
1937
1939
|
) : null,
|
|
1938
|
-
!
|
|
1939
|
-
|
|
1940
|
+
!N && !f && ((k == null ? void 0 : k.includes("table")) ?? !1) ? /* @__PURE__ */ e(
|
|
1941
|
+
Gr,
|
|
1940
1942
|
{
|
|
1941
|
-
active:
|
|
1942
|
-
run:
|
|
1943
|
-
areaRef:
|
|
1944
|
-
getActiveTableEl:
|
|
1943
|
+
active: Oe,
|
|
1944
|
+
run: pe,
|
|
1945
|
+
areaRef: fe,
|
|
1946
|
+
getActiveTableEl: ot,
|
|
1945
1947
|
enableColor: (k == null ? void 0 : k.includes("fontcolor")) ?? !1,
|
|
1946
|
-
saveTableCell:
|
|
1947
|
-
applyTableBackground:
|
|
1948
|
+
saveTableCell: at,
|
|
1949
|
+
applyTableBackground: it
|
|
1948
1950
|
}
|
|
1949
1951
|
) : null
|
|
1950
1952
|
] }),
|
|
1951
|
-
|
|
1953
|
+
E ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: ct }) : null,
|
|
1954
|
+
E && dt ? /* @__PURE__ */ e(
|
|
1952
1955
|
"p",
|
|
1953
1956
|
{
|
|
1954
1957
|
role: "alert",
|
|
@@ -1961,10 +1964,10 @@ const Zr = He(
|
|
|
1961
1964
|
);
|
|
1962
1965
|
}
|
|
1963
1966
|
);
|
|
1964
|
-
|
|
1967
|
+
nn.displayName = "RichTextEditor";
|
|
1965
1968
|
export {
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
+
nn as R,
|
|
1970
|
+
Mr as r,
|
|
1971
|
+
Kr as w
|
|
1969
1972
|
};
|
|
1970
|
-
//# sourceMappingURL=rich-text-editor-
|
|
1973
|
+
//# sourceMappingURL=rich-text-editor-DAeCXiQG.js.map
|