@editora/core 1.0.14 → 1.0.16
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/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-B1_vtXRz.mjs +3910 -0
- package/dist/index-C6BoNR2t.js +12 -0
- package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
- package/dist/index.cjs.js +3 -3
- package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
- package/dist/index.esm.js +17 -14
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
- package/dist/plugin-loader.js +53 -52
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
- package/dist/webcomponent-core.js +2039 -473
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +100 -70
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2208 -641
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1575 -1209
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-B9MPiUAR.mjs +0 -2341
- package/dist/index-BLm1MtzH.js +0 -10
|
@@ -1,1039 +0,0 @@
|
|
|
1
|
-
const j = /* @__PURE__ */ new Set([
|
|
2
|
-
"the",
|
|
3
|
-
"a",
|
|
4
|
-
"an",
|
|
5
|
-
"and",
|
|
6
|
-
"or",
|
|
7
|
-
"but",
|
|
8
|
-
"in",
|
|
9
|
-
"on",
|
|
10
|
-
"at",
|
|
11
|
-
"to",
|
|
12
|
-
"for",
|
|
13
|
-
"of",
|
|
14
|
-
"with",
|
|
15
|
-
"by",
|
|
16
|
-
"from",
|
|
17
|
-
"is",
|
|
18
|
-
"are",
|
|
19
|
-
"be",
|
|
20
|
-
"was",
|
|
21
|
-
"were",
|
|
22
|
-
"have",
|
|
23
|
-
"has",
|
|
24
|
-
"had",
|
|
25
|
-
"do",
|
|
26
|
-
"does",
|
|
27
|
-
"did",
|
|
28
|
-
"will",
|
|
29
|
-
"would",
|
|
30
|
-
"could",
|
|
31
|
-
"should",
|
|
32
|
-
"may",
|
|
33
|
-
"might",
|
|
34
|
-
"must",
|
|
35
|
-
"can",
|
|
36
|
-
"this",
|
|
37
|
-
"that",
|
|
38
|
-
"these",
|
|
39
|
-
"those",
|
|
40
|
-
"what",
|
|
41
|
-
"which",
|
|
42
|
-
"who",
|
|
43
|
-
"whom",
|
|
44
|
-
"where",
|
|
45
|
-
"when",
|
|
46
|
-
"why",
|
|
47
|
-
"how",
|
|
48
|
-
"all",
|
|
49
|
-
"each",
|
|
50
|
-
"every",
|
|
51
|
-
"both",
|
|
52
|
-
"few",
|
|
53
|
-
"more",
|
|
54
|
-
"most",
|
|
55
|
-
"other",
|
|
56
|
-
"same",
|
|
57
|
-
"such",
|
|
58
|
-
"no",
|
|
59
|
-
"nor",
|
|
60
|
-
"not",
|
|
61
|
-
"only",
|
|
62
|
-
"own",
|
|
63
|
-
"so",
|
|
64
|
-
"than",
|
|
65
|
-
"too",
|
|
66
|
-
"very",
|
|
67
|
-
"just",
|
|
68
|
-
"as",
|
|
69
|
-
"if",
|
|
70
|
-
"because",
|
|
71
|
-
"while",
|
|
72
|
-
"although",
|
|
73
|
-
"though",
|
|
74
|
-
"it",
|
|
75
|
-
"its",
|
|
76
|
-
"their",
|
|
77
|
-
"them",
|
|
78
|
-
"they",
|
|
79
|
-
"you",
|
|
80
|
-
"he",
|
|
81
|
-
"she",
|
|
82
|
-
"we",
|
|
83
|
-
"me",
|
|
84
|
-
"him",
|
|
85
|
-
"her",
|
|
86
|
-
"us",
|
|
87
|
-
"our",
|
|
88
|
-
"i",
|
|
89
|
-
"my",
|
|
90
|
-
"your",
|
|
91
|
-
"his",
|
|
92
|
-
"hers",
|
|
93
|
-
"ours",
|
|
94
|
-
"yours",
|
|
95
|
-
"theirs",
|
|
96
|
-
"editor",
|
|
97
|
-
"document",
|
|
98
|
-
"text",
|
|
99
|
-
"word",
|
|
100
|
-
"paragraph",
|
|
101
|
-
"line",
|
|
102
|
-
"page",
|
|
103
|
-
"content",
|
|
104
|
-
"hello",
|
|
105
|
-
"world",
|
|
106
|
-
"test",
|
|
107
|
-
"example",
|
|
108
|
-
"sample",
|
|
109
|
-
"demo",
|
|
110
|
-
"lorem",
|
|
111
|
-
"ipsum"
|
|
112
|
-
]), C = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set();
|
|
113
|
-
let u = !1, d = null, f = null, a = null, s = null, x = null, y = !1, h = null, _ = !1, b = 0, g = null;
|
|
114
|
-
const B = {
|
|
115
|
-
characterData: !0,
|
|
116
|
-
childList: !0,
|
|
117
|
-
subtree: !0
|
|
118
|
-
}, H = "rte-spellcheck-styles", R = "__editoraCommandEditorRoot";
|
|
119
|
-
function K(e) {
|
|
120
|
-
var l;
|
|
121
|
-
const t = (e == null ? void 0 : e.contentElement) || (e == null ? void 0 : e.editorElement) || null;
|
|
122
|
-
if (!(t instanceof HTMLElement)) return;
|
|
123
|
-
const r = t.getAttribute("contenteditable") === "true" ? t : (l = t.querySelector) == null ? void 0 : l.call(t, '[contenteditable="true"]');
|
|
124
|
-
if (r instanceof HTMLElement) {
|
|
125
|
-
s = r, h = r;
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const n = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null), o = A(n);
|
|
129
|
-
o && (s = o, h = o);
|
|
130
|
-
}
|
|
131
|
-
function P() {
|
|
132
|
-
if (typeof window == "undefined") return null;
|
|
133
|
-
const e = window[R];
|
|
134
|
-
if (!(e instanceof HTMLElement)) return null;
|
|
135
|
-
window[R] = null;
|
|
136
|
-
const t = e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? e : null);
|
|
137
|
-
if (t) {
|
|
138
|
-
const n = A(t);
|
|
139
|
-
if (n) return n;
|
|
140
|
-
if (t.getAttribute("contenteditable") === "true") return t;
|
|
141
|
-
}
|
|
142
|
-
if (e.getAttribute("contenteditable") === "true")
|
|
143
|
-
return e;
|
|
144
|
-
const r = e.closest('[contenteditable="true"]');
|
|
145
|
-
return r instanceof HTMLElement ? r : null;
|
|
146
|
-
}
|
|
147
|
-
function T() {
|
|
148
|
-
let e = document.getElementById(H);
|
|
149
|
-
e || (e = document.createElement("style"), e.id = H, document.head.appendChild(e)), e.textContent = `
|
|
150
|
-
.rte-spell-check-panel {
|
|
151
|
-
position: absolute;
|
|
152
|
-
top: 12px;
|
|
153
|
-
right: 12px;
|
|
154
|
-
width: min(360px, calc(100% - 24px));
|
|
155
|
-
max-height: min(560px, calc(100% - 24px));
|
|
156
|
-
overflow: hidden;
|
|
157
|
-
display: flex;
|
|
158
|
-
flex-direction: column;
|
|
159
|
-
border-radius: 12px;
|
|
160
|
-
border: 1px solid #d7dbe3;
|
|
161
|
-
background: #ffffff;
|
|
162
|
-
color: #1f2937;
|
|
163
|
-
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
|
|
164
|
-
z-index: 1200;
|
|
165
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.rte-spell-check-panel,
|
|
169
|
-
.rte-spell-check-panel * {
|
|
170
|
-
box-sizing: border-box;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.editora-theme-dark .rte-spell-check-panel {
|
|
174
|
-
border-color: #4b5563;
|
|
175
|
-
background: #1f2937;
|
|
176
|
-
color: #e5e7eb;
|
|
177
|
-
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.rte-spellcheck-header {
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
justify-content: space-between;
|
|
184
|
-
gap: 12px;
|
|
185
|
-
padding: 14px 16px 12px;
|
|
186
|
-
border-bottom: 1px solid #eceff5;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.editora-theme-dark .rte-spellcheck-header {
|
|
190
|
-
border-bottom-color: #374151;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.rte-spellcheck-title {
|
|
194
|
-
margin: 0;
|
|
195
|
-
font-size: 15px;
|
|
196
|
-
font-weight: 650;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.rte-spellcheck-subtitle {
|
|
200
|
-
margin: 2px 0 0;
|
|
201
|
-
font-size: 12px;
|
|
202
|
-
color: #64748b;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.editora-theme-dark .rte-spellcheck-subtitle {
|
|
206
|
-
color: #9ca3af;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.rte-spellcheck-close {
|
|
210
|
-
appearance: none;
|
|
211
|
-
border: none;
|
|
212
|
-
background: transparent;
|
|
213
|
-
font-size: 20px;
|
|
214
|
-
line-height: 1;
|
|
215
|
-
color: #6b7280;
|
|
216
|
-
cursor: pointer;
|
|
217
|
-
border-radius: 8px;
|
|
218
|
-
width: 30px;
|
|
219
|
-
height: 30px;
|
|
220
|
-
display: grid;
|
|
221
|
-
place-items: center;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.rte-spellcheck-close:hover {
|
|
225
|
-
background: rgba(15, 23, 42, 0.06);
|
|
226
|
-
color: #0f172a;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.editora-theme-dark .rte-spellcheck-close {
|
|
230
|
-
color: #9ca3af;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.editora-theme-dark .rte-spellcheck-close:hover {
|
|
234
|
-
background: rgba(255, 255, 255, 0.08);
|
|
235
|
-
color: #f3f4f6;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.rte-spellcheck-stats {
|
|
239
|
-
display: grid;
|
|
240
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
241
|
-
gap: 8px;
|
|
242
|
-
padding: 12px 16px;
|
|
243
|
-
border-bottom: 1px solid #eceff5;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.editora-theme-dark .rte-spellcheck-stats {
|
|
247
|
-
border-bottom-color: #374151;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.rte-spellcheck-stat {
|
|
251
|
-
border-radius: 10px;
|
|
252
|
-
background: #f8fafc;
|
|
253
|
-
border: 1px solid #e5e7eb;
|
|
254
|
-
padding: 8px 10px;
|
|
255
|
-
display: grid;
|
|
256
|
-
gap: 2px;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.editora-theme-dark .rte-spellcheck-stat {
|
|
260
|
-
background: #111827;
|
|
261
|
-
border-color: #374151;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.rte-spellcheck-stat-label {
|
|
265
|
-
font-size: 11px;
|
|
266
|
-
color: #64748b;
|
|
267
|
-
text-transform: uppercase;
|
|
268
|
-
letter-spacing: 0.04em;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.editora-theme-dark .rte-spellcheck-stat-label {
|
|
272
|
-
color: #9ca3af;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.rte-spellcheck-stat-value {
|
|
276
|
-
font-size: 16px;
|
|
277
|
-
font-weight: 700;
|
|
278
|
-
color: #111827;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.editora-theme-dark .rte-spellcheck-stat-value {
|
|
282
|
-
color: #f3f4f6;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.rte-spellcheck-list {
|
|
286
|
-
flex: 1 1 auto;
|
|
287
|
-
min-height: 0;
|
|
288
|
-
max-height: 100%;
|
|
289
|
-
overflow-y: auto;
|
|
290
|
-
overflow-x: hidden;
|
|
291
|
-
overscroll-behavior: contain;
|
|
292
|
-
padding: 10px 12px 12px;
|
|
293
|
-
display: grid;
|
|
294
|
-
gap: 8px;
|
|
295
|
-
scrollbar-width: thin;
|
|
296
|
-
scrollbar-color: #cbd5e1 #f1f5f9;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.rte-spellcheck-list::-webkit-scrollbar {
|
|
300
|
-
width: 10px;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.rte-spellcheck-list::-webkit-scrollbar-track {
|
|
304
|
-
background: #f1f5f9;
|
|
305
|
-
border-radius: 999px;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
309
|
-
background: #cbd5e1;
|
|
310
|
-
border-radius: 999px;
|
|
311
|
-
border: 2px solid #f1f5f9;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
315
|
-
background: #94a3b8;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.rte-spellcheck-empty {
|
|
319
|
-
padding: 18px 14px;
|
|
320
|
-
text-align: center;
|
|
321
|
-
color: #64748b;
|
|
322
|
-
font-size: 13px;
|
|
323
|
-
border-radius: 10px;
|
|
324
|
-
border: 1px dashed #d1d5db;
|
|
325
|
-
background: #f8fafc;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.editora-theme-dark .rte-spellcheck-empty {
|
|
329
|
-
color: #9ca3af;
|
|
330
|
-
border-color: #4b5563;
|
|
331
|
-
background: #111827;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.editora-theme-dark .rte-spellcheck-list {
|
|
335
|
-
scrollbar-color: #4b5563 #1f2937;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-track {
|
|
339
|
-
background: #1f2937;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
343
|
-
background: #4b5563;
|
|
344
|
-
border-color: #1f2937;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
348
|
-
background: #64748b;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.rte-spellcheck-item {
|
|
352
|
-
border-radius: 10px;
|
|
353
|
-
border: 1px solid #e5e7eb;
|
|
354
|
-
background: #f8fafc;
|
|
355
|
-
overflow: visible;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.editora-theme-dark .rte-spellcheck-item {
|
|
359
|
-
border-color: #4b5563;
|
|
360
|
-
background: #111827;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.rte-spell-check-panel .rte-spellcheck-word-header {
|
|
364
|
-
all: unset;
|
|
365
|
-
width: 100%;
|
|
366
|
-
padding: 10px 11px;
|
|
367
|
-
display: flex;
|
|
368
|
-
align-items: center;
|
|
369
|
-
justify-content: space-between;
|
|
370
|
-
gap: 8px;
|
|
371
|
-
cursor: pointer;
|
|
372
|
-
text-align: left;
|
|
373
|
-
color: #111827;
|
|
374
|
-
font-size: 14px;
|
|
375
|
-
line-height: 1.35;
|
|
376
|
-
user-select: none;
|
|
377
|
-
opacity: 1;
|
|
378
|
-
visibility: visible;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.rte-spell-check-panel .rte-spellcheck-word {
|
|
382
|
-
font-weight: 700;
|
|
383
|
-
color: #c62828;
|
|
384
|
-
word-break: break-word;
|
|
385
|
-
flex: 1;
|
|
386
|
-
opacity: 1;
|
|
387
|
-
visibility: visible;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-word-header {
|
|
391
|
-
color: #e5e7eb !important;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-word {
|
|
395
|
-
color: #f87171 !important;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.rte-spell-check-panel .rte-spellcheck-caret {
|
|
399
|
-
color: #64748b;
|
|
400
|
-
font-size: 12px;
|
|
401
|
-
min-width: 12px;
|
|
402
|
-
text-align: right;
|
|
403
|
-
opacity: 1;
|
|
404
|
-
visibility: visible;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
408
|
-
display: none;
|
|
409
|
-
border-top: 1px solid #e5e7eb;
|
|
410
|
-
padding: 9px 11px 11px;
|
|
411
|
-
color: #334155;
|
|
412
|
-
font-size: 12px;
|
|
413
|
-
line-height: 1.4;
|
|
414
|
-
opacity: 1;
|
|
415
|
-
visibility: visible;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
419
|
-
border-top-color: #374151;
|
|
420
|
-
color: #d1d5db !important;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.rte-spell-check-panel .rte-spellcheck-suggestions.show {
|
|
424
|
-
display: block;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.rte-spell-check-panel .rte-spellcheck-actions {
|
|
428
|
-
margin-top: 8px;
|
|
429
|
-
display: flex;
|
|
430
|
-
flex-wrap: wrap;
|
|
431
|
-
gap: 6px;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.rte-spell-check-panel .rte-spellcheck-btn {
|
|
435
|
-
all: unset;
|
|
436
|
-
border-radius: 8px;
|
|
437
|
-
border: 1px solid #d1d5db;
|
|
438
|
-
background: #fff;
|
|
439
|
-
color: #1f2937;
|
|
440
|
-
font-size: 12px;
|
|
441
|
-
font-weight: 550;
|
|
442
|
-
padding: 5px 8px;
|
|
443
|
-
cursor: pointer;
|
|
444
|
-
transition: all 0.15s ease;
|
|
445
|
-
display: inline-flex;
|
|
446
|
-
align-items: center;
|
|
447
|
-
justify-content: center;
|
|
448
|
-
opacity: 1;
|
|
449
|
-
visibility: visible;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
453
|
-
background: #f3f4f6;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
457
|
-
border-color: #2563eb;
|
|
458
|
-
background: #2563eb;
|
|
459
|
-
color: #fff;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
.rte-spell-check-panel .rte-spellcheck-btn.primary:hover {
|
|
463
|
-
background: #1d4ed8;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn {
|
|
467
|
-
border-color: #4b5563;
|
|
468
|
-
background: #1f2937;
|
|
469
|
-
color: #f3f4f6 !important;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
473
|
-
background: #374151;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
477
|
-
border-color: #60a5fa;
|
|
478
|
-
background: #2563eb;
|
|
479
|
-
color: #fff;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.rte-spellcheck-menu {
|
|
483
|
-
position: fixed;
|
|
484
|
-
background: #ffffff;
|
|
485
|
-
border: 1px solid #d1d5db;
|
|
486
|
-
border-radius: 10px;
|
|
487
|
-
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
|
|
488
|
-
z-index: 1300;
|
|
489
|
-
padding: 6px 0;
|
|
490
|
-
min-width: 180px;
|
|
491
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
492
|
-
font-size: 13px;
|
|
493
|
-
color: #111827;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
.rte-spellcheck-menu-item {
|
|
497
|
-
padding: 8px 14px;
|
|
498
|
-
cursor: pointer;
|
|
499
|
-
transition: background 0.15s ease;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.rte-spellcheck-menu-item:hover {
|
|
503
|
-
background: #f3f4f6;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.rte-spellcheck-menu-item.meta {
|
|
507
|
-
color: #64748b;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.rte-spellcheck-menu-item.positive {
|
|
511
|
-
color: #1d4ed8;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.editora-theme-dark .rte-spellcheck-menu {
|
|
515
|
-
background: #1f2937;
|
|
516
|
-
border-color: #4b5563;
|
|
517
|
-
color: #e5e7eb;
|
|
518
|
-
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
.editora-theme-dark .rte-spellcheck-menu-item:hover {
|
|
522
|
-
background: #374151;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
.editora-theme-dark .rte-spellcheck-menu-item.meta {
|
|
526
|
-
color: #9ca3af;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
.editora-theme-dark .rte-spellcheck-menu-item.positive {
|
|
530
|
-
color: #93c5fd;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel {
|
|
534
|
-
border-color: #4b5563;
|
|
535
|
-
background: #1f2937;
|
|
536
|
-
color: #e5e7eb;
|
|
537
|
-
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-header {
|
|
541
|
-
border-bottom-color: #374151;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-subtitle {
|
|
545
|
-
color: #9ca3af;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-item {
|
|
549
|
-
border-color: #4b5563;
|
|
550
|
-
background: #111827;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list {
|
|
554
|
-
scrollbar-color: #4b5563 #1f2937;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-track {
|
|
558
|
-
background: #1f2937;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
562
|
-
background: #4b5563;
|
|
563
|
-
border-color: #1f2937;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
567
|
-
background: #64748b;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-word-header {
|
|
571
|
-
color: #e5e7eb !important;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-word {
|
|
575
|
-
color: #f87171 !important;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
579
|
-
border-top-color: #374151;
|
|
580
|
-
color: #d1d5db !important;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn {
|
|
584
|
-
border-color: #4b5563;
|
|
585
|
-
background: #1f2937;
|
|
586
|
-
color: #f3f4f6 !important;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
590
|
-
background: #374151;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
594
|
-
border-color: #60a5fa;
|
|
595
|
-
background: #2563eb;
|
|
596
|
-
color: #fff;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu {
|
|
600
|
-
background: #1f2937;
|
|
601
|
-
border-color: #4b5563;
|
|
602
|
-
color: #e5e7eb;
|
|
603
|
-
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item:hover {
|
|
607
|
-
background: #374151;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.meta {
|
|
611
|
-
color: #9ca3af;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.positive {
|
|
615
|
-
color: #93c5fd;
|
|
616
|
-
}
|
|
617
|
-
`;
|
|
618
|
-
}
|
|
619
|
-
function k() {
|
|
620
|
-
if (s && document.contains(s))
|
|
621
|
-
return s;
|
|
622
|
-
const e = V();
|
|
623
|
-
return e && (s = e), e;
|
|
624
|
-
}
|
|
625
|
-
function W(e) {
|
|
626
|
-
if (!e) return;
|
|
627
|
-
const t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, r = t == null ? void 0 : t.closest('[contenteditable="true"]');
|
|
628
|
-
r && (s = r);
|
|
629
|
-
}
|
|
630
|
-
function A(e) {
|
|
631
|
-
if (!e) return null;
|
|
632
|
-
const t = e.querySelector('[contenteditable="true"]');
|
|
633
|
-
return t instanceof HTMLElement ? t : null;
|
|
634
|
-
}
|
|
635
|
-
function Q() {
|
|
636
|
-
if (_) return;
|
|
637
|
-
const e = (t) => {
|
|
638
|
-
const r = t.target;
|
|
639
|
-
if (!r) return;
|
|
640
|
-
const n = r.closest(
|
|
641
|
-
'.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]'
|
|
642
|
-
);
|
|
643
|
-
if (!n) return;
|
|
644
|
-
const o = n.closest("[data-editora-editor]"), l = A(o);
|
|
645
|
-
l && (h = l, s = l);
|
|
646
|
-
};
|
|
647
|
-
document.addEventListener("pointerdown", e, !0), _ = !0;
|
|
648
|
-
}
|
|
649
|
-
function ee() {
|
|
650
|
-
const e = P();
|
|
651
|
-
if (e && document.contains(e))
|
|
652
|
-
return s = e, h = null, e;
|
|
653
|
-
if (h && document.contains(h)) {
|
|
654
|
-
const t = h;
|
|
655
|
-
return h = null, s = t, t;
|
|
656
|
-
}
|
|
657
|
-
return V();
|
|
658
|
-
}
|
|
659
|
-
function te() {
|
|
660
|
-
b += 1, b === 1 && d && d.disconnect();
|
|
661
|
-
}
|
|
662
|
-
function re() {
|
|
663
|
-
if (b === 0 || (b -= 1, b > 0) || !d) return;
|
|
664
|
-
const e = k();
|
|
665
|
-
e && d.observe(e, B);
|
|
666
|
-
}
|
|
667
|
-
function N(e) {
|
|
668
|
-
te();
|
|
669
|
-
try {
|
|
670
|
-
return e();
|
|
671
|
-
} finally {
|
|
672
|
-
re();
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
const oe = () => {
|
|
676
|
-
try {
|
|
677
|
-
const e = localStorage.getItem("rte-custom-dictionary");
|
|
678
|
-
e && JSON.parse(e).forEach((r) => C.add(r.toLowerCase()));
|
|
679
|
-
} catch (e) {
|
|
680
|
-
console.warn("Failed to load custom dictionary:", e);
|
|
681
|
-
}
|
|
682
|
-
}, le = () => {
|
|
683
|
-
try {
|
|
684
|
-
const e = Array.from(C);
|
|
685
|
-
localStorage.setItem("rte-custom-dictionary", JSON.stringify(e));
|
|
686
|
-
} catch (e) {
|
|
687
|
-
console.warn("Failed to save custom dictionary:", e);
|
|
688
|
-
}
|
|
689
|
-
};
|
|
690
|
-
function ne(e, t) {
|
|
691
|
-
const r = [];
|
|
692
|
-
for (let n = 0; n <= t.length; n++) r[n] = [n];
|
|
693
|
-
for (let n = 0; n <= e.length; n++) r[0][n] = n;
|
|
694
|
-
for (let n = 1; n <= t.length; n++)
|
|
695
|
-
for (let o = 1; o <= e.length; o++)
|
|
696
|
-
t.charAt(n - 1) === e.charAt(o - 1) ? r[n][o] = r[n - 1][o - 1] : r[n][o] = Math.min(
|
|
697
|
-
r[n - 1][o - 1] + 1,
|
|
698
|
-
// substitution
|
|
699
|
-
r[n][o - 1] + 1,
|
|
700
|
-
// insertion
|
|
701
|
-
r[n - 1][o] + 1
|
|
702
|
-
// deletion
|
|
703
|
-
);
|
|
704
|
-
return r[t.length][e.length];
|
|
705
|
-
}
|
|
706
|
-
function ce(e) {
|
|
707
|
-
const t = e.toLowerCase();
|
|
708
|
-
return j.has(t) || C.has(t) || S.has(t);
|
|
709
|
-
}
|
|
710
|
-
function ae(e, t = 5) {
|
|
711
|
-
const r = e.toLowerCase(), o = Array.from(j).map((l) => ({ word: l, distance: ne(r, l) }));
|
|
712
|
-
return o.sort((l, c) => l.distance - c.distance), o.filter((l) => l.distance <= 3).slice(0, t).map((l) => l.word);
|
|
713
|
-
}
|
|
714
|
-
function se(e) {
|
|
715
|
-
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
716
|
-
const t = e;
|
|
717
|
-
return !!(t.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag') || t.hasAttribute("data-comment-id") || t.hasAttribute("data-template") || t.hasAttribute("data-merge-tag"));
|
|
718
|
-
}
|
|
719
|
-
function ie(e) {
|
|
720
|
-
const t = [], r = /([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;
|
|
721
|
-
let n;
|
|
722
|
-
for (; (n = r.exec(e.data)) !== null; ) {
|
|
723
|
-
const o = n[0], l = n.index, c = l + o.length;
|
|
724
|
-
/https?:\/\//.test(o) || /@/.test(o) || /\{\{.*\}\}/.test(o) || /^\d+$/.test(o) || ce(o) || /[a-z][A-Z]/.test(o) || /-/.test(o) || o[0] === o[0].toUpperCase() && o.length > 1 || t.push({
|
|
725
|
-
id: `${o}-${l}`,
|
|
726
|
-
node: e,
|
|
727
|
-
startOffset: l,
|
|
728
|
-
endOffset: c,
|
|
729
|
-
word: o,
|
|
730
|
-
suggestions: ae(o),
|
|
731
|
-
ignored: !1
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
return t;
|
|
735
|
-
}
|
|
736
|
-
const V = () => {
|
|
737
|
-
const e = P();
|
|
738
|
-
if (e && document.contains(e))
|
|
739
|
-
return s = e, e;
|
|
740
|
-
const t = window.getSelection();
|
|
741
|
-
if (t && t.rangeCount > 0) {
|
|
742
|
-
let n = t.getRangeAt(0).startContainer;
|
|
743
|
-
for (; n && n !== document.body; ) {
|
|
744
|
-
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
745
|
-
const o = n;
|
|
746
|
-
if (o.getAttribute("contenteditable") === "true")
|
|
747
|
-
return o;
|
|
748
|
-
}
|
|
749
|
-
n = n.parentNode;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
const r = document.activeElement;
|
|
753
|
-
if (r) {
|
|
754
|
-
if (r.getAttribute("contenteditable") === "true")
|
|
755
|
-
return r;
|
|
756
|
-
const n = r.closest('[contenteditable="true"]');
|
|
757
|
-
if (n) return n;
|
|
758
|
-
const o = r.closest("[data-editora-editor]");
|
|
759
|
-
if (o) {
|
|
760
|
-
const l = o.querySelector('[contenteditable="true"]');
|
|
761
|
-
if (l) return l;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
return document.querySelector('[contenteditable="true"]');
|
|
765
|
-
};
|
|
766
|
-
function M() {
|
|
767
|
-
const e = k();
|
|
768
|
-
if (!e) return [];
|
|
769
|
-
const t = [], r = document.createTreeWalker(
|
|
770
|
-
e,
|
|
771
|
-
NodeFilter.SHOW_TEXT,
|
|
772
|
-
{
|
|
773
|
-
acceptNode: (o) => {
|
|
774
|
-
var l;
|
|
775
|
-
return !((l = o.textContent) != null && l.trim()) || o.parentNode && se(o.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
);
|
|
779
|
-
let n = r.nextNode();
|
|
780
|
-
for (; n; )
|
|
781
|
-
t.push(...ie(n)), n = r.nextNode();
|
|
782
|
-
return t;
|
|
783
|
-
}
|
|
784
|
-
function m(e) {
|
|
785
|
-
const t = k();
|
|
786
|
-
t && (e || (e = M()), N(() => {
|
|
787
|
-
t.querySelectorAll(".rte-misspelled").forEach((r) => {
|
|
788
|
-
const n = r.parentNode;
|
|
789
|
-
if (n) {
|
|
790
|
-
for (; r.firstChild; )
|
|
791
|
-
n.insertBefore(r.firstChild, r);
|
|
792
|
-
n.removeChild(r);
|
|
793
|
-
}
|
|
794
|
-
}), e.forEach((r) => {
|
|
795
|
-
if (S.has(r.word.toLowerCase())) return;
|
|
796
|
-
const n = r.node.data.length;
|
|
797
|
-
if (!(r.startOffset < 0 || r.endOffset > n || r.startOffset >= r.endOffset))
|
|
798
|
-
try {
|
|
799
|
-
const o = document.createRange();
|
|
800
|
-
o.setStart(r.node, r.startOffset), o.setEnd(r.node, r.endOffset);
|
|
801
|
-
const l = document.createElement("span");
|
|
802
|
-
l.className = "rte-misspelled", l.setAttribute("data-word", r.word), l.setAttribute("data-suggestions", r.suggestions.join(",")), l.setAttribute("title", `Suggestions: ${r.suggestions.join(", ")}`), l.style.borderBottom = "2px wavy red", l.style.cursor = "pointer", o.surroundContents(l);
|
|
803
|
-
} catch (o) {
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
}), E(e));
|
|
807
|
-
}
|
|
808
|
-
function L() {
|
|
809
|
-
const e = k();
|
|
810
|
-
e && N(() => {
|
|
811
|
-
e.querySelectorAll(".rte-misspelled").forEach((t) => {
|
|
812
|
-
const r = t.parentNode;
|
|
813
|
-
if (r) {
|
|
814
|
-
for (; t.firstChild; )
|
|
815
|
-
r.insertBefore(t.firstChild, t);
|
|
816
|
-
r.removeChild(t);
|
|
817
|
-
}
|
|
818
|
-
});
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
function de(e, t) {
|
|
822
|
-
N(() => {
|
|
823
|
-
const r = document.createRange();
|
|
824
|
-
r.setStart(e.node, e.startOffset), r.setEnd(e.node, e.endOffset);
|
|
825
|
-
const n = document.createTextNode(t);
|
|
826
|
-
r.deleteContents(), r.insertNode(n);
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
function G(e) {
|
|
830
|
-
S.add(e.toLowerCase()), L(), m();
|
|
831
|
-
}
|
|
832
|
-
function J(e) {
|
|
833
|
-
C.add(e.toLowerCase()), le(), L(), m();
|
|
834
|
-
}
|
|
835
|
-
function pe(e) {
|
|
836
|
-
const t = k();
|
|
837
|
-
if (!t) return { total: 0, misspelled: 0, accuracy: 100 };
|
|
838
|
-
e || (e = M());
|
|
839
|
-
const r = e.filter((c) => !S.has(c.word.toLowerCase())).length, l = ((t.textContent || "").match(/[\p{L}\p{M}\p{N}]+/gu) || []).length;
|
|
840
|
-
return {
|
|
841
|
-
total: l,
|
|
842
|
-
misspelled: r,
|
|
843
|
-
accuracy: l > 0 ? (l - r) / l * 100 : 100
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
function he(e, t) {
|
|
847
|
-
const r = document.createTextNode(t);
|
|
848
|
-
e.replaceWith(r);
|
|
849
|
-
}
|
|
850
|
-
function ue(e) {
|
|
851
|
-
e.classList.remove("rte-misspelled"), e.removeAttribute("data-word"), e.removeAttribute("data-suggestions"), e.removeAttribute("title"), e.style.borderBottom = "", e.style.cursor = "";
|
|
852
|
-
}
|
|
853
|
-
function me(e, t, r, n, o) {
|
|
854
|
-
W(o), document.querySelectorAll(".rte-spellcheck-menu").forEach((p) => p.remove());
|
|
855
|
-
const l = document.createElement("div");
|
|
856
|
-
if (l.className = "rte-spellcheck-menu", n.slice(0, 5).forEach((p) => {
|
|
857
|
-
const v = document.createElement("div");
|
|
858
|
-
v.className = "rte-spellcheck-menu-item", v.textContent = p, v.onclick = () => {
|
|
859
|
-
he(o, p), window.setTimeout(() => {
|
|
860
|
-
u && (m(), E());
|
|
861
|
-
}, 0), l.remove();
|
|
862
|
-
}, l.appendChild(v);
|
|
863
|
-
}), n.length > 0) {
|
|
864
|
-
const p = document.createElement("div");
|
|
865
|
-
p.style.cssText = "height: 1px; background: #ddd; margin: 4px 0;", l.appendChild(p);
|
|
866
|
-
}
|
|
867
|
-
const c = document.createElement("div");
|
|
868
|
-
c.className = "rte-spellcheck-menu-item meta", c.textContent = "Ignore Once", c.onclick = () => {
|
|
869
|
-
ue(o), l.remove();
|
|
870
|
-
}, l.appendChild(c);
|
|
871
|
-
const i = document.createElement("div");
|
|
872
|
-
i.className = "rte-spellcheck-menu-item meta", i.textContent = "Ignore All", i.onclick = () => {
|
|
873
|
-
G(r), l.remove();
|
|
874
|
-
}, l.appendChild(i);
|
|
875
|
-
const w = document.createElement("div");
|
|
876
|
-
w.className = "rte-spellcheck-menu-item positive", w.textContent = "Add to Dictionary", w.onclick = () => {
|
|
877
|
-
J(r), l.remove();
|
|
878
|
-
}, l.appendChild(w), document.body.appendChild(l);
|
|
879
|
-
const D = l.getBoundingClientRect(), X = window.innerWidth - D.width - 8, Z = window.innerHeight - D.height - 8;
|
|
880
|
-
l.style.left = `${Math.max(8, Math.min(e, X))}px`, l.style.top = `${Math.max(8, Math.min(t, Z))}px`;
|
|
881
|
-
const F = (p) => {
|
|
882
|
-
l.contains(p.target) || (l.remove(), document.removeEventListener("mousedown", F));
|
|
883
|
-
};
|
|
884
|
-
setTimeout(() => document.addEventListener("mousedown", F), 0);
|
|
885
|
-
}
|
|
886
|
-
function I() {
|
|
887
|
-
y || (x = (e) => {
|
|
888
|
-
const t = e.target;
|
|
889
|
-
if (t && t.classList.contains("rte-misspelled")) {
|
|
890
|
-
e.preventDefault(), W(t);
|
|
891
|
-
const r = t.getAttribute("data-word"), n = (t.getAttribute("data-suggestions") || "").split(",").filter((o) => o);
|
|
892
|
-
me(e.clientX, e.clientY, r, n, t);
|
|
893
|
-
}
|
|
894
|
-
}, document.addEventListener("contextmenu", x), y = !0);
|
|
895
|
-
}
|
|
896
|
-
function ke() {
|
|
897
|
-
!y || !x || (document.removeEventListener("contextmenu", x), x = null, y = !1);
|
|
898
|
-
}
|
|
899
|
-
function fe(e) {
|
|
900
|
-
return e.closest("[data-editora-editor]") || e.parentElement || e;
|
|
901
|
-
}
|
|
902
|
-
function q() {
|
|
903
|
-
const e = k();
|
|
904
|
-
if (!e)
|
|
905
|
-
throw new Error("Spell check panel requested without active editor");
|
|
906
|
-
const t = fe(e);
|
|
907
|
-
T();
|
|
908
|
-
const r = document.createElement("div");
|
|
909
|
-
return r.className = "rte-spell-check-panel", window.getComputedStyle(t).position === "static" && (t.style.position = "relative"), t.appendChild(r), r;
|
|
910
|
-
}
|
|
911
|
-
function E(e) {
|
|
912
|
-
if (!a) return;
|
|
913
|
-
const t = e || M(), r = pe(t);
|
|
914
|
-
a.innerHTML = `
|
|
915
|
-
<div class="rte-spellcheck-header">
|
|
916
|
-
<div>
|
|
917
|
-
<h3 class="rte-spellcheck-title">Spell Check</h3>
|
|
918
|
-
<p class="rte-spellcheck-subtitle">Review suggestions and resolve issues quickly</p>
|
|
919
|
-
</div>
|
|
920
|
-
<button class="rte-spellcheck-close" aria-label="Close spell check panel">✕</button>
|
|
921
|
-
</div>
|
|
922
|
-
|
|
923
|
-
<div class="rte-spellcheck-stats">
|
|
924
|
-
<div class="rte-spellcheck-stat">
|
|
925
|
-
<span class="rte-spellcheck-stat-label">Total</span>
|
|
926
|
-
<strong class="rte-spellcheck-stat-value">${r.total}</strong>
|
|
927
|
-
</div>
|
|
928
|
-
<div class="rte-spellcheck-stat">
|
|
929
|
-
<span class="rte-spellcheck-stat-label">Misspelled</span>
|
|
930
|
-
<strong class="rte-spellcheck-stat-value">${r.misspelled}</strong>
|
|
931
|
-
</div>
|
|
932
|
-
<div class="rte-spellcheck-stat">
|
|
933
|
-
<span class="rte-spellcheck-stat-label">Accuracy</span>
|
|
934
|
-
<strong class="rte-spellcheck-stat-value">${r.accuracy.toFixed(1)}%</strong>
|
|
935
|
-
</div>
|
|
936
|
-
</div>
|
|
937
|
-
|
|
938
|
-
<div class="rte-spellcheck-list">
|
|
939
|
-
${t.length === 0 ? '<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>' : t.map((o, l) => `
|
|
940
|
-
<div class="rte-spellcheck-item" data-word="${o.word}" data-index="${l}">
|
|
941
|
-
<button class="rte-spellcheck-word-header" type="button">
|
|
942
|
-
<span class="rte-spellcheck-word">${o.word}</span>
|
|
943
|
-
<span class="rte-spellcheck-caret">▶</span>
|
|
944
|
-
</button>
|
|
945
|
-
<div class="rte-spellcheck-suggestions">
|
|
946
|
-
${o.suggestions.length > 0 ? `<div class="rte-spellcheck-actions">
|
|
947
|
-
${o.suggestions.map((c) => `<button class="rte-spellcheck-btn primary suggestion-btn" data-suggestion="${c}" type="button">${c}</button>`).join("")}
|
|
948
|
-
</div>` : '<div class="rte-spellcheck-subtitle">No suggestions available</div>'}
|
|
949
|
-
<div class="rte-spellcheck-actions">
|
|
950
|
-
<button class="rte-spellcheck-btn ignore-btn" type="button">Ignore</button>
|
|
951
|
-
<button class="rte-spellcheck-btn add-btn" type="button">Add to Dictionary</button>
|
|
952
|
-
</div>
|
|
953
|
-
</div>
|
|
954
|
-
</div>
|
|
955
|
-
`).join("")}
|
|
956
|
-
</div>
|
|
957
|
-
`;
|
|
958
|
-
const n = a.querySelector(".rte-spellcheck-close");
|
|
959
|
-
n == null || n.addEventListener("click", (o) => {
|
|
960
|
-
o.preventDefault(), o.stopPropagation(), O();
|
|
961
|
-
}), a.querySelectorAll(".rte-spellcheck-word-header").forEach((o) => {
|
|
962
|
-
o.addEventListener("click", () => {
|
|
963
|
-
const l = o.closest(".rte-spellcheck-item"), c = l == null ? void 0 : l.querySelector(".rte-spellcheck-suggestions"), i = o.querySelector(".rte-spellcheck-caret");
|
|
964
|
-
c && i && (c.classList.contains("show") ? (c.classList.remove("show"), i.textContent = "▶") : (c.classList.add("show"), i.textContent = "▼"));
|
|
965
|
-
});
|
|
966
|
-
}), a.querySelectorAll(".suggestion-btn").forEach((o) => {
|
|
967
|
-
o.addEventListener("click", () => {
|
|
968
|
-
const l = o.getAttribute("data-suggestion"), c = o.closest(".rte-spellcheck-item");
|
|
969
|
-
c == null || c.getAttribute("data-word");
|
|
970
|
-
const i = parseInt((c == null ? void 0 : c.getAttribute("data-index")) || "0");
|
|
971
|
-
t[i] && (de(t[i], l), m());
|
|
972
|
-
});
|
|
973
|
-
}), a.querySelectorAll(".ignore-btn").forEach((o) => {
|
|
974
|
-
o.addEventListener("click", () => {
|
|
975
|
-
const l = o.closest(".rte-spellcheck-item"), c = l == null ? void 0 : l.getAttribute("data-word");
|
|
976
|
-
G(c);
|
|
977
|
-
});
|
|
978
|
-
}), a.querySelectorAll(".add-btn").forEach((o) => {
|
|
979
|
-
o.addEventListener("click", () => {
|
|
980
|
-
const l = o.closest(".rte-spellcheck-item"), c = l == null ? void 0 : l.getAttribute("data-word");
|
|
981
|
-
J(c);
|
|
982
|
-
});
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
function $() {
|
|
986
|
-
const e = k();
|
|
987
|
-
e && (d && d.disconnect(), d = new MutationObserver((t) => {
|
|
988
|
-
b > 0 || t.some((r) => r.type === "characterData" || r.type === "childList") && (f && clearTimeout(f), f = window.setTimeout(() => {
|
|
989
|
-
u && m();
|
|
990
|
-
}, 350));
|
|
991
|
-
}), d.observe(e, {
|
|
992
|
-
...B
|
|
993
|
-
}));
|
|
994
|
-
}
|
|
995
|
-
function U() {
|
|
996
|
-
d && (d.disconnect(), d = null), f && (clearTimeout(f), f = null);
|
|
997
|
-
}
|
|
998
|
-
function Y() {
|
|
999
|
-
document.querySelectorAll(".rte-spellcheck-menu").forEach((e) => e.remove());
|
|
1000
|
-
}
|
|
1001
|
-
function z() {
|
|
1002
|
-
g || (g = (e) => {
|
|
1003
|
-
e.key !== "Escape" || !u || (e.preventDefault(), e.stopPropagation(), O());
|
|
1004
|
-
}, document.addEventListener("keydown", g, !0));
|
|
1005
|
-
}
|
|
1006
|
-
function be() {
|
|
1007
|
-
g && (document.removeEventListener("keydown", g, !0), g = null);
|
|
1008
|
-
}
|
|
1009
|
-
function O() {
|
|
1010
|
-
return u && (L(), U(), ke(), Y(), a && (a.remove(), a = null), s = null, h = null, u = !1, be()), !1;
|
|
1011
|
-
}
|
|
1012
|
-
function ge() {
|
|
1013
|
-
const e = ee();
|
|
1014
|
-
return e ? u && s && s !== e ? (L(), U(), Y(), a && (a.remove(), a = null), s = e, T(), I(), z(), m(), $(), a = q(), E(), !0) : u ? O() : (s = e, u = !0, T(), I(), z(), m(), $(), a && (a.remove(), a = null), a = q(), E(), !0) : !1;
|
|
1015
|
-
}
|
|
1016
|
-
const xe = () => ({
|
|
1017
|
-
name: "spellCheck",
|
|
1018
|
-
init: () => {
|
|
1019
|
-
oe(), Q();
|
|
1020
|
-
},
|
|
1021
|
-
toolbar: [
|
|
1022
|
-
{
|
|
1023
|
-
label: "Spell Check",
|
|
1024
|
-
command: "toggleSpellCheck",
|
|
1025
|
-
icon: '<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 12.5L3.84375 9.5M3.84375 9.5L5 5.38889C5 5.38889 5.25 4.5 6 4.5C6.75 4.5 7 5.38889 7 5.38889L8.15625 9.5M3.84375 9.5H8.15625M9 12.5L8.15625 9.5M13 16.8333L15.4615 19.5L21 13.5M12 8.5H15C16.1046 8.5 17 7.60457 17 6.5C17 5.39543 16.1046 4.5 15 4.5H12V8.5ZM12 8.5H16C17.1046 8.5 18 9.39543 18 10.5C18 11.6046 17.1046 12.5 16 12.5H12V8.5Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
|
|
1026
|
-
shortcut: "F7"
|
|
1027
|
-
}
|
|
1028
|
-
],
|
|
1029
|
-
commands: {
|
|
1030
|
-
toggleSpellCheck: (e, t) => (K(t), ge(), !0)
|
|
1031
|
-
},
|
|
1032
|
-
keymap: {
|
|
1033
|
-
F7: "toggleSpellCheck"
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
export {
|
|
1037
|
-
xe as SpellCheckPlugin
|
|
1038
|
-
};
|
|
1039
|
-
//# sourceMappingURL=SpellCheckPlugin.native-BZB9AewP.mjs.map
|