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