@editora/plugins 1.0.2 → 1.0.4
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/README.md +30 -5
- package/dist/a11y-checker.cjs.js +109 -0
- package/dist/a11y-checker.esm.js +509 -0
- package/dist/anchor.cjs.js +176 -0
- package/dist/anchor.esm.js +400 -0
- package/dist/background-color.cjs.js +218 -0
- package/dist/background-color.esm.js +482 -0
- package/dist/blockquote.cjs.js +1 -0
- package/dist/blockquote.esm.js +47 -0
- package/dist/bold.cjs.js +1 -0
- package/dist/bold.esm.js +44 -0
- package/dist/capitalization.cjs.js +1 -0
- package/dist/capitalization.esm.js +78 -0
- package/dist/checklist.cjs.js +1 -0
- package/dist/checklist.esm.js +305 -0
- package/dist/clear-formatting.cjs.js +1 -0
- package/dist/clear-formatting.esm.js +138 -0
- package/dist/code-sample.cjs.js +161 -0
- package/dist/code-sample.esm.js +381 -0
- package/dist/code.cjs.js +598 -0
- package/dist/code.esm.js +2034 -0
- package/dist/colorSelectionApply-C0iOfMWb.js +1 -0
- package/dist/colorSelectionApply-D8r_gV32.mjs +63 -0
- package/dist/comments.cjs.js +354 -0
- package/dist/comments.esm.js +692 -0
- package/dist/direction.cjs.js +1 -0
- package/dist/direction.esm.js +129 -0
- package/dist/document-manager.cjs.js +1 -0
- package/dist/document-manager.esm.js +6 -0
- package/dist/{documentManager-CYC9totK.mjs → documentManager-DRUc1-Cs.mjs} +3 -3
- package/dist/{documentManager-BGlu3WRB.js → documentManager-_tQQfQi9.js} +3 -3
- package/dist/editorContainerHelpers-C7kdWnS0.mjs +26 -0
- package/dist/editorContainerHelpers-CFbfiOJI.js +1 -0
- package/dist/embed-iframe.cjs.js +361 -0
- package/dist/embed-iframe.esm.js +556 -0
- package/dist/emojis.cjs.js +284 -0
- package/dist/emojis.esm.js +1080 -0
- package/dist/font-family.cjs.js +1 -0
- package/dist/font-family.esm.js +152 -0
- package/dist/font-size.cjs.js +1 -0
- package/dist/font-size.esm.js +278 -0
- package/dist/footnote.cjs.js +85 -0
- package/dist/footnote.esm.js +397 -0
- package/dist/fullscreen.cjs.js +1 -0
- package/dist/fullscreen.esm.js +73 -0
- package/dist/heading.cjs.js +1 -0
- package/dist/heading.esm.js +63 -0
- package/dist/history.cjs.js +1 -0
- package/dist/history.esm.js +246 -0
- package/dist/indent.cjs.js +1 -0
- package/dist/indent.esm.js +146 -0
- package/dist/index-Bskk414V.mjs +145 -0
- package/dist/index-D3pJyAsj.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-B-to-4j4.js → index.es-Cz1qItab.js} +1 -1
- package/dist/{index.es-BbXJ7tyO.mjs → index.es-DEcRmSTY.mjs} +1 -1
- package/dist/index.esm.js +89 -49
- package/dist/italic.cjs.js +1 -0
- package/dist/italic.esm.js +40 -0
- package/dist/line-height.cjs.js +1 -0
- package/dist/line-height.esm.js +145 -0
- package/dist/link.cjs.js +138 -0
- package/dist/link.esm.js +276 -0
- package/dist/list.cjs.js +1 -0
- package/dist/list.esm.js +102 -0
- package/dist/lite.cjs.js +1 -0
- package/dist/lite.esm.js +61 -0
- package/dist/math.cjs.js +45 -0
- package/dist/math.esm.js +249 -0
- package/dist/media-manager.cjs.js +619 -0
- package/dist/media-manager.esm.js +994 -0
- package/dist/merge-tag.cjs.js +93 -0
- package/dist/merge-tag.esm.js +412 -0
- package/dist/page-break.cjs.js +72 -0
- package/dist/page-break.esm.js +295 -0
- package/dist/plugins.css +1 -1
- package/dist/preview.cjs.js +230 -0
- package/dist/preview.esm.js +321 -0
- package/dist/print.cjs.js +254 -0
- package/dist/print.esm.js +309 -0
- package/dist/purify.es-DHhaBdbu.mjs +470 -0
- package/dist/purify.es-T2a3nLiC.js +3 -0
- package/dist/shared-config.cjs.js +1 -0
- package/dist/shared-config.esm.js +30 -0
- package/dist/special-characters.cjs.js +257 -0
- package/dist/special-characters.esm.js +772 -0
- package/dist/spell-check.cjs.js +512 -0
- package/dist/spell-check.esm.js +1013 -0
- package/dist/strikethrough.cjs.js +1 -0
- package/dist/strikethrough.esm.js +71 -0
- package/dist/table.cjs.js +35 -0
- package/dist/table.esm.js +477 -0
- package/dist/template.cjs.js +356 -0
- package/dist/template.esm.js +560 -0
- package/dist/text-alignment.cjs.js +1 -0
- package/dist/text-alignment.esm.js +105 -0
- package/dist/text-color.cjs.js +300 -0
- package/dist/text-color.esm.js +507 -0
- package/dist/underline.cjs.js +1 -0
- package/dist/underline.esm.js +34 -0
- package/index.d.ts +62 -0
- package/package.json +218 -6
- package/LICENSE +0 -21
- package/dist/index-BbORIHoM.mjs +0 -11763
- package/dist/index-C-OCBS_6.js +0 -3753
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","are","be","was","were","have","has","had","do","does","did","will","would","could","should","may","might","must","can","this","that","these","those","what","which","who","whom","where","when","why","how","all","each","every","both","few","more","most","other","same","such","no","nor","not","only","own","so","than","too","very","just","as","if","because","while","although","though","it","its","their","them","they","you","he","she","we","me","him","her","us","our","i","my","your","his","hers","ours","yours","theirs","editor","document","text","word","paragraph","line","page","content","hello","world","test","example","sample","demo","lorem","ipsum"]),E=new Set,C=new Set;let u=!1,d=null,f=null,a=null,s=null,g=null,v=!1,h=null,O=!1,b=0;const $={characterData:!0,childList:!0,subtree:!0},D="rte-spellcheck-styles",F="__editoraCommandEditorRoot";function q(){if(typeof window>"u")return null;const e=window[F];if(!(e instanceof HTMLElement))return null;window[F]=null;const r=e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?e:null);if(r){const l=j(r);if(l)return l;if(r.getAttribute("contenteditable")==="true")return r}if(e.getAttribute("contenteditable")==="true")return e;const t=e.closest('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function T(){let e=document.getElementById(D);e||(e=document.createElement("style"),e.id=D,document.head.appendChild(e)),e.textContent=`
|
|
2
|
+
.rte-spell-check-panel {
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 12px;
|
|
5
|
+
right: 12px;
|
|
6
|
+
width: min(360px, calc(100% - 24px));
|
|
7
|
+
max-height: min(560px, calc(100% - 24px));
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
border-radius: 12px;
|
|
12
|
+
border: 1px solid #d7dbe3;
|
|
13
|
+
background: #ffffff;
|
|
14
|
+
color: #1f2937;
|
|
15
|
+
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
|
|
16
|
+
z-index: 1200;
|
|
17
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rte-spell-check-panel,
|
|
21
|
+
.rte-spell-check-panel * {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.editora-theme-dark .rte-spell-check-panel {
|
|
26
|
+
border-color: #4b5563;
|
|
27
|
+
background: #1f2937;
|
|
28
|
+
color: #e5e7eb;
|
|
29
|
+
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rte-spellcheck-header {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
gap: 12px;
|
|
37
|
+
padding: 14px 16px 12px;
|
|
38
|
+
border-bottom: 1px solid #eceff5;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.editora-theme-dark .rte-spellcheck-header {
|
|
42
|
+
border-bottom-color: #374151;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.rte-spellcheck-title {
|
|
46
|
+
margin: 0;
|
|
47
|
+
font-size: 15px;
|
|
48
|
+
font-weight: 650;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.rte-spellcheck-subtitle {
|
|
52
|
+
margin: 2px 0 0;
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
color: #64748b;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.editora-theme-dark .rte-spellcheck-subtitle {
|
|
58
|
+
color: #9ca3af;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.rte-spellcheck-close {
|
|
62
|
+
appearance: none;
|
|
63
|
+
border: none;
|
|
64
|
+
background: transparent;
|
|
65
|
+
font-size: 20px;
|
|
66
|
+
line-height: 1;
|
|
67
|
+
color: #6b7280;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
width: 30px;
|
|
71
|
+
height: 30px;
|
|
72
|
+
display: grid;
|
|
73
|
+
place-items: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.rte-spellcheck-close:hover {
|
|
77
|
+
background: rgba(15, 23, 42, 0.06);
|
|
78
|
+
color: #0f172a;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.editora-theme-dark .rte-spellcheck-close {
|
|
82
|
+
color: #9ca3af;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.editora-theme-dark .rte-spellcheck-close:hover {
|
|
86
|
+
background: rgba(255, 255, 255, 0.08);
|
|
87
|
+
color: #f3f4f6;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.rte-spellcheck-stats {
|
|
91
|
+
display: grid;
|
|
92
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
93
|
+
gap: 8px;
|
|
94
|
+
padding: 12px 16px;
|
|
95
|
+
border-bottom: 1px solid #eceff5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.editora-theme-dark .rte-spellcheck-stats {
|
|
99
|
+
border-bottom-color: #374151;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.rte-spellcheck-stat {
|
|
103
|
+
border-radius: 10px;
|
|
104
|
+
background: #f8fafc;
|
|
105
|
+
border: 1px solid #e5e7eb;
|
|
106
|
+
padding: 8px 10px;
|
|
107
|
+
display: grid;
|
|
108
|
+
gap: 2px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.editora-theme-dark .rte-spellcheck-stat {
|
|
112
|
+
background: #111827;
|
|
113
|
+
border-color: #374151;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.rte-spellcheck-stat-label {
|
|
117
|
+
font-size: 11px;
|
|
118
|
+
color: #64748b;
|
|
119
|
+
text-transform: uppercase;
|
|
120
|
+
letter-spacing: 0.04em;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.editora-theme-dark .rte-spellcheck-stat-label {
|
|
124
|
+
color: #9ca3af;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rte-spellcheck-stat-value {
|
|
128
|
+
font-size: 16px;
|
|
129
|
+
font-weight: 700;
|
|
130
|
+
color: #111827;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.editora-theme-dark .rte-spellcheck-stat-value {
|
|
134
|
+
color: #f3f4f6;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.rte-spellcheck-list {
|
|
138
|
+
flex: 1 1 auto;
|
|
139
|
+
min-height: 0;
|
|
140
|
+
max-height: 100%;
|
|
141
|
+
overflow-y: auto;
|
|
142
|
+
overflow-x: hidden;
|
|
143
|
+
overscroll-behavior: contain;
|
|
144
|
+
padding: 10px 12px 12px;
|
|
145
|
+
display: grid;
|
|
146
|
+
gap: 8px;
|
|
147
|
+
scrollbar-width: thin;
|
|
148
|
+
scrollbar-color: #cbd5e1 #f1f5f9;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.rte-spellcheck-list::-webkit-scrollbar {
|
|
152
|
+
width: 10px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rte-spellcheck-list::-webkit-scrollbar-track {
|
|
156
|
+
background: #f1f5f9;
|
|
157
|
+
border-radius: 999px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
161
|
+
background: #cbd5e1;
|
|
162
|
+
border-radius: 999px;
|
|
163
|
+
border: 2px solid #f1f5f9;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
167
|
+
background: #94a3b8;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.rte-spellcheck-empty {
|
|
171
|
+
padding: 18px 14px;
|
|
172
|
+
text-align: center;
|
|
173
|
+
color: #64748b;
|
|
174
|
+
font-size: 13px;
|
|
175
|
+
border-radius: 10px;
|
|
176
|
+
border: 1px dashed #d1d5db;
|
|
177
|
+
background: #f8fafc;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.editora-theme-dark .rte-spellcheck-empty {
|
|
181
|
+
color: #9ca3af;
|
|
182
|
+
border-color: #4b5563;
|
|
183
|
+
background: #111827;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.editora-theme-dark .rte-spellcheck-list {
|
|
187
|
+
scrollbar-color: #4b5563 #1f2937;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-track {
|
|
191
|
+
background: #1f2937;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
195
|
+
background: #4b5563;
|
|
196
|
+
border-color: #1f2937;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.editora-theme-dark .rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
200
|
+
background: #64748b;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.rte-spellcheck-item {
|
|
204
|
+
border-radius: 10px;
|
|
205
|
+
border: 1px solid #e5e7eb;
|
|
206
|
+
background: #f8fafc;
|
|
207
|
+
overflow: visible;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.editora-theme-dark .rte-spellcheck-item {
|
|
211
|
+
border-color: #4b5563;
|
|
212
|
+
background: #111827;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.rte-spell-check-panel .rte-spellcheck-word-header {
|
|
216
|
+
all: unset;
|
|
217
|
+
width: 100%;
|
|
218
|
+
padding: 10px 11px;
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: space-between;
|
|
222
|
+
gap: 8px;
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
text-align: left;
|
|
225
|
+
color: #111827;
|
|
226
|
+
font-size: 14px;
|
|
227
|
+
line-height: 1.35;
|
|
228
|
+
user-select: none;
|
|
229
|
+
opacity: 1;
|
|
230
|
+
visibility: visible;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.rte-spell-check-panel .rte-spellcheck-word {
|
|
234
|
+
font-weight: 700;
|
|
235
|
+
color: #c62828;
|
|
236
|
+
word-break: break-word;
|
|
237
|
+
flex: 1;
|
|
238
|
+
opacity: 1;
|
|
239
|
+
visibility: visible;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-word-header {
|
|
243
|
+
color: #e5e7eb !important;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-word {
|
|
247
|
+
color: #f87171 !important;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.rte-spell-check-panel .rte-spellcheck-caret {
|
|
251
|
+
color: #64748b;
|
|
252
|
+
font-size: 12px;
|
|
253
|
+
min-width: 12px;
|
|
254
|
+
text-align: right;
|
|
255
|
+
opacity: 1;
|
|
256
|
+
visibility: visible;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
260
|
+
display: none;
|
|
261
|
+
border-top: 1px solid #e5e7eb;
|
|
262
|
+
padding: 9px 11px 11px;
|
|
263
|
+
color: #334155;
|
|
264
|
+
font-size: 12px;
|
|
265
|
+
line-height: 1.4;
|
|
266
|
+
opacity: 1;
|
|
267
|
+
visibility: visible;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
271
|
+
border-top-color: #374151;
|
|
272
|
+
color: #d1d5db !important;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.rte-spell-check-panel .rte-spellcheck-suggestions.show {
|
|
276
|
+
display: block;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.rte-spell-check-panel .rte-spellcheck-actions {
|
|
280
|
+
margin-top: 8px;
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-wrap: wrap;
|
|
283
|
+
gap: 6px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.rte-spell-check-panel .rte-spellcheck-btn {
|
|
287
|
+
all: unset;
|
|
288
|
+
border-radius: 8px;
|
|
289
|
+
border: 1px solid #d1d5db;
|
|
290
|
+
background: #fff;
|
|
291
|
+
color: #1f2937;
|
|
292
|
+
font-size: 12px;
|
|
293
|
+
font-weight: 550;
|
|
294
|
+
padding: 5px 8px;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
transition: all 0.15s ease;
|
|
297
|
+
display: inline-flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
opacity: 1;
|
|
301
|
+
visibility: visible;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
305
|
+
background: #f3f4f6;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
309
|
+
border-color: #2563eb;
|
|
310
|
+
background: #2563eb;
|
|
311
|
+
color: #fff;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.rte-spell-check-panel .rte-spellcheck-btn.primary:hover {
|
|
315
|
+
background: #1d4ed8;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn {
|
|
319
|
+
border-color: #4b5563;
|
|
320
|
+
background: #1f2937;
|
|
321
|
+
color: #f3f4f6 !important;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
325
|
+
background: #374151;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.editora-theme-dark .rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
329
|
+
border-color: #60a5fa;
|
|
330
|
+
background: #2563eb;
|
|
331
|
+
color: #fff;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.rte-spellcheck-menu {
|
|
335
|
+
position: fixed;
|
|
336
|
+
background: #ffffff;
|
|
337
|
+
border: 1px solid #d1d5db;
|
|
338
|
+
border-radius: 10px;
|
|
339
|
+
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
|
|
340
|
+
z-index: 1300;
|
|
341
|
+
padding: 6px 0;
|
|
342
|
+
min-width: 180px;
|
|
343
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
344
|
+
font-size: 13px;
|
|
345
|
+
color: #111827;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.rte-spellcheck-menu-item {
|
|
349
|
+
padding: 8px 14px;
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
transition: background 0.15s ease;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.rte-spellcheck-menu-item:hover {
|
|
355
|
+
background: #f3f4f6;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.rte-spellcheck-menu-item.meta {
|
|
359
|
+
color: #64748b;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.rte-spellcheck-menu-item.positive {
|
|
363
|
+
color: #1d4ed8;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.editora-theme-dark .rte-spellcheck-menu {
|
|
367
|
+
background: #1f2937;
|
|
368
|
+
border-color: #4b5563;
|
|
369
|
+
color: #e5e7eb;
|
|
370
|
+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.editora-theme-dark .rte-spellcheck-menu-item:hover {
|
|
374
|
+
background: #374151;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.editora-theme-dark .rte-spellcheck-menu-item.meta {
|
|
378
|
+
color: #9ca3af;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.editora-theme-dark .rte-spellcheck-menu-item.positive {
|
|
382
|
+
color: #93c5fd;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel {
|
|
386
|
+
border-color: #4b5563;
|
|
387
|
+
background: #1f2937;
|
|
388
|
+
color: #e5e7eb;
|
|
389
|
+
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-header {
|
|
393
|
+
border-bottom-color: #374151;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-subtitle {
|
|
397
|
+
color: #9ca3af;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-item {
|
|
401
|
+
border-color: #4b5563;
|
|
402
|
+
background: #111827;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list {
|
|
406
|
+
scrollbar-color: #4b5563 #1f2937;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-track {
|
|
410
|
+
background: #1f2937;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-thumb {
|
|
414
|
+
background: #4b5563;
|
|
415
|
+
border-color: #1f2937;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-list::-webkit-scrollbar-thumb:hover {
|
|
419
|
+
background: #64748b;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-word-header {
|
|
423
|
+
color: #e5e7eb !important;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-word {
|
|
427
|
+
color: #f87171 !important;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-suggestions {
|
|
431
|
+
border-top-color: #374151;
|
|
432
|
+
color: #d1d5db !important;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn {
|
|
436
|
+
border-color: #4b5563;
|
|
437
|
+
background: #1f2937;
|
|
438
|
+
color: #f3f4f6 !important;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn:hover {
|
|
442
|
+
background: #374151;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spell-check-panel .rte-spellcheck-btn.primary {
|
|
446
|
+
border-color: #60a5fa;
|
|
447
|
+
background: #2563eb;
|
|
448
|
+
color: #fff;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu {
|
|
452
|
+
background: #1f2937;
|
|
453
|
+
border-color: #4b5563;
|
|
454
|
+
color: #e5e7eb;
|
|
455
|
+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item:hover {
|
|
459
|
+
background: #374151;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.meta {
|
|
463
|
+
color: #9ca3af;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
:is([theme="dark"], [data-theme="dark"], .dark, .editora-theme-dark) .rte-spellcheck-menu-item.positive {
|
|
467
|
+
color: #93c5fd;
|
|
468
|
+
}
|
|
469
|
+
`}function k(){if(s&&document.contains(s))return s;const e=B();return e&&(s=e),e}function z(e){if(!e)return;const t=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]');t&&(s=t)}function j(e){if(!e)return null;const r=e.querySelector('[contenteditable="true"]');return r instanceof HTMLElement?r:null}function X(){if(O)return;const e=r=>{const t=r.target;if(!t)return;const l=t.closest('.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]');if(!l)return;const o=l.closest("[data-editora-editor]"),c=j(o);c&&(h=c,s=c)};document.addEventListener("pointerdown",e,!0),O=!0}function Z(){const e=q();if(e&&document.contains(e))return s=e,h=null,e;if(h&&document.contains(h)){const r=h;return h=null,s=r,r}return B()}function K(){b+=1,b===1&&d&&d.disconnect()}function Q(){if(b===0||(b-=1,b>0)||!d)return;const e=k();e&&d.observe(e,$)}function L(e){K();try{return e()}finally{Q()}}const ee=()=>{try{const e=localStorage.getItem("rte-custom-dictionary");e&&JSON.parse(e).forEach(t=>E.add(t.toLowerCase()))}catch(e){console.warn("Failed to load custom dictionary:",e)}},te=()=>{try{const e=Array.from(E);localStorage.setItem("rte-custom-dictionary",JSON.stringify(e))}catch(e){console.warn("Failed to save custom dictionary:",e)}};function re(e,r){const t=[];for(let l=0;l<=r.length;l++)t[l]=[l];for(let l=0;l<=e.length;l++)t[0][l]=l;for(let l=1;l<=r.length;l++)for(let o=1;o<=e.length;o++)r.charAt(l-1)===e.charAt(o-1)?t[l][o]=t[l-1][o-1]:t[l][o]=Math.min(t[l-1][o-1]+1,t[l][o-1]+1,t[l-1][o]+1);return t[r.length][e.length]}function oe(e){const r=e.toLowerCase();return H.has(r)||E.has(r)||C.has(r)}function le(e,r=5){const t=e.toLowerCase(),o=Array.from(H).map(c=>({word:c,distance:re(t,c)}));return o.sort((c,n)=>c.distance-n.distance),o.filter(c=>c.distance<=3).slice(0,r).map(c=>c.word)}function ce(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;const r=e;return!!(r.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag')||r.hasAttribute("data-comment-id")||r.hasAttribute("data-template")||r.hasAttribute("data-merge-tag"))}function ne(e){const r=[],t=/([\p{L}\p{M}\p{N}\p{Emoji_Presentation}\u200d'-]+|[\uD800-\uDBFF][\uDC00-\uDFFF])/gu;let l;for(;(l=t.exec(e.data))!==null;){const o=l[0],c=l.index,n=c+o.length;/https?:\/\//.test(o)||/@/.test(o)||/\{\{.*\}\}/.test(o)||/^\d+$/.test(o)||oe(o)||/[a-z][A-Z]/.test(o)||/-/.test(o)||o[0]===o[0].toUpperCase()&&o.length>1||r.push({id:`${o}-${c}`,node:e,startOffset:c,endOffset:n,word:o,suggestions:le(o),ignored:!1})}return r}const B=()=>{const e=q();if(e&&document.contains(e))return s=e,e;const r=window.getSelection();if(r&&r.rangeCount>0){let l=r.getRangeAt(0).startContainer;for(;l&&l!==document.body;){if(l.nodeType===Node.ELEMENT_NODE){const o=l;if(o.getAttribute("contenteditable")==="true")return o}l=l.parentNode}}const t=document.activeElement;if(t){if(t.getAttribute("contenteditable")==="true")return t;const l=t.closest('[contenteditable="true"]');if(l)return l;const o=t.closest("[data-editora-editor]");if(o){const c=o.querySelector('[contenteditable="true"]');if(c)return c}}return document.querySelector('[contenteditable="true"]')};function N(){const e=k();if(!e)return[];const r=[],t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>!o.textContent?.trim()||o.parentNode&&ce(o.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l=t.nextNode();for(;l;)r.push(...ne(l)),l=t.nextNode();return r}function m(e){const r=k();r&&(e||(e=N()),L(()=>{r.querySelectorAll(".rte-misspelled").forEach(t=>{const l=t.parentNode;if(l){for(;t.firstChild;)l.insertBefore(t.firstChild,t);l.removeChild(t)}}),e.forEach(t=>{if(C.has(t.word.toLowerCase()))return;const l=t.node.data.length;if(!(t.startOffset<0||t.endOffset>l||t.startOffset>=t.endOffset))try{const o=document.createRange();o.setStart(t.node,t.startOffset),o.setEnd(t.node,t.endOffset);const c=document.createElement("span");c.className="rte-misspelled",c.setAttribute("data-word",t.word),c.setAttribute("data-suggestions",t.suggestions.join(",")),c.setAttribute("title",`Suggestions: ${t.suggestions.join(", ")}`),c.style.borderBottom="2px wavy red",c.style.cursor="pointer",o.surroundContents(c)}catch{}})}),y(e))}function S(){const e=k();e&&L(()=>{e.querySelectorAll(".rte-misspelled").forEach(r=>{const t=r.parentNode;if(t){for(;r.firstChild;)t.insertBefore(r.firstChild,r);t.removeChild(r)}})})}function ae(e,r){L(()=>{const t=document.createRange();t.setStart(e.node,e.startOffset),t.setEnd(e.node,e.endOffset);const l=document.createTextNode(r);t.deleteContents(),t.insertNode(l)})}function P(e){C.add(e.toLowerCase()),S(),m()}function W(e){E.add(e.toLowerCase()),te(),S(),m()}function se(e){const r=k();if(!r)return{total:0,misspelled:0,accuracy:100};e||(e=N());const t=e.filter(n=>!C.has(n.word.toLowerCase())).length,c=((r.textContent||"").match(/[\p{L}\p{M}\p{N}]+/gu)||[]).length;return{total:c,misspelled:t,accuracy:c>0?(c-t)/c*100:100}}function ie(e,r){const t=document.createTextNode(r);e.replaceWith(t)}function de(e){e.classList.remove("rte-misspelled"),e.removeAttribute("data-word"),e.removeAttribute("data-suggestions"),e.removeAttribute("title"),e.style.borderBottom="",e.style.cursor=""}function pe(e,r,t,l,o){z(o),document.querySelectorAll(".rte-spellcheck-menu").forEach(p=>p.remove());const c=document.createElement("div");if(c.className="rte-spellcheck-menu",l.slice(0,5).forEach(p=>{const w=document.createElement("div");w.className="rte-spellcheck-menu-item",w.textContent=p,w.onclick=()=>{ie(o,p),window.setTimeout(()=>{u&&(m(),y())},0),c.remove()},c.appendChild(w)}),l.length>0){const p=document.createElement("div");p.style.cssText="height: 1px; background: #ddd; margin: 4px 0;",c.appendChild(p)}const n=document.createElement("div");n.className="rte-spellcheck-menu-item meta",n.textContent="Ignore Once",n.onclick=()=>{de(o),c.remove()},c.appendChild(n);const i=document.createElement("div");i.className="rte-spellcheck-menu-item meta",i.textContent="Ignore All",i.onclick=()=>{P(t),c.remove()},c.appendChild(i);const x=document.createElement("div");x.className="rte-spellcheck-menu-item positive",x.textContent="Add to Dictionary",x.onclick=()=>{W(t),c.remove()},c.appendChild(x),document.body.appendChild(c);const A=c.getBoundingClientRect(),U=window.innerWidth-A.width-8,Y=window.innerHeight-A.height-8;c.style.left=`${Math.max(8,Math.min(e,U))}px`,c.style.top=`${Math.max(8,Math.min(r,Y))}px`;const M=p=>{c.contains(p.target)||(c.remove(),document.removeEventListener("mousedown",M))};setTimeout(()=>document.addEventListener("mousedown",M),0)}function _(){v||(g=e=>{const r=e.target;if(r&&r.classList.contains("rte-misspelled")){e.preventDefault(),z(r);const t=r.getAttribute("data-word"),l=(r.getAttribute("data-suggestions")||"").split(",").filter(o=>o);pe(e.clientX,e.clientY,t,l,r)}},document.addEventListener("contextmenu",g),v=!0)}function he(){!v||!g||(document.removeEventListener("contextmenu",g),g=null,v=!1)}function ue(e){return e.closest("[data-editora-editor]")||e.parentElement||e}function I(){const e=k();if(!e)throw new Error("Spell check panel requested without active editor");const r=ue(e);T();const t=document.createElement("div");return t.className="rte-spell-check-panel",window.getComputedStyle(r).position==="static"&&(r.style.position="relative"),r.appendChild(t),t}function y(e){if(!a)return;const r=e||N(),t=se(r);a.innerHTML=`
|
|
470
|
+
<div class="rte-spellcheck-header">
|
|
471
|
+
<div>
|
|
472
|
+
<h3 class="rte-spellcheck-title">Spell Check</h3>
|
|
473
|
+
<p class="rte-spellcheck-subtitle">Review suggestions and resolve issues quickly</p>
|
|
474
|
+
</div>
|
|
475
|
+
<button class="rte-spellcheck-close" aria-label="Close spell check panel">✕</button>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
<div class="rte-spellcheck-stats">
|
|
479
|
+
<div class="rte-spellcheck-stat">
|
|
480
|
+
<span class="rte-spellcheck-stat-label">Total</span>
|
|
481
|
+
<strong class="rte-spellcheck-stat-value">${t.total}</strong>
|
|
482
|
+
</div>
|
|
483
|
+
<div class="rte-spellcheck-stat">
|
|
484
|
+
<span class="rte-spellcheck-stat-label">Misspelled</span>
|
|
485
|
+
<strong class="rte-spellcheck-stat-value">${t.misspelled}</strong>
|
|
486
|
+
</div>
|
|
487
|
+
<div class="rte-spellcheck-stat">
|
|
488
|
+
<span class="rte-spellcheck-stat-label">Accuracy</span>
|
|
489
|
+
<strong class="rte-spellcheck-stat-value">${t.accuracy.toFixed(1)}%</strong>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
492
|
+
|
|
493
|
+
<div class="rte-spellcheck-list">
|
|
494
|
+
${r.length===0?'<div class="rte-spellcheck-empty">No spelling errors found in this editor.</div>':r.map((o,c)=>`
|
|
495
|
+
<div class="rte-spellcheck-item" data-word="${o.word}" data-index="${c}">
|
|
496
|
+
<button class="rte-spellcheck-word-header" type="button">
|
|
497
|
+
<span class="rte-spellcheck-word">${o.word}</span>
|
|
498
|
+
<span class="rte-spellcheck-caret">▶</span>
|
|
499
|
+
</button>
|
|
500
|
+
<div class="rte-spellcheck-suggestions">
|
|
501
|
+
${o.suggestions.length>0?`<div class="rte-spellcheck-actions">
|
|
502
|
+
${o.suggestions.map(n=>`<button class="rte-spellcheck-btn primary suggestion-btn" data-suggestion="${n}" type="button">${n}</button>`).join("")}
|
|
503
|
+
</div>`:'<div class="rte-spellcheck-subtitle">No suggestions available</div>'}
|
|
504
|
+
<div class="rte-spellcheck-actions">
|
|
505
|
+
<button class="rte-spellcheck-btn ignore-btn" type="button">Ignore</button>
|
|
506
|
+
<button class="rte-spellcheck-btn add-btn" type="button">Add to Dictionary</button>
|
|
507
|
+
</div>
|
|
508
|
+
</div>
|
|
509
|
+
</div>
|
|
510
|
+
`).join("")}
|
|
511
|
+
</div>
|
|
512
|
+
`,a.querySelector(".rte-spellcheck-close")?.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),J()}),a.querySelectorAll(".rte-spellcheck-word-header").forEach(o=>{o.addEventListener("click",()=>{const n=o.closest(".rte-spellcheck-item")?.querySelector(".rte-spellcheck-suggestions"),i=o.querySelector(".rte-spellcheck-caret");n&&i&&(n.classList.contains("show")?(n.classList.remove("show"),i.textContent="▶"):(n.classList.add("show"),i.textContent="▼"))})}),a.querySelectorAll(".suggestion-btn").forEach(o=>{o.addEventListener("click",()=>{const c=o.getAttribute("data-suggestion"),n=o.closest(".rte-spellcheck-item");n?.getAttribute("data-word");const i=parseInt(n?.getAttribute("data-index")||"0");r[i]&&(ae(r[i],c),m())})}),a.querySelectorAll(".ignore-btn").forEach(o=>{o.addEventListener("click",()=>{const n=o.closest(".rte-spellcheck-item")?.getAttribute("data-word");P(n)})}),a.querySelectorAll(".add-btn").forEach(o=>{o.addEventListener("click",()=>{const n=o.closest(".rte-spellcheck-item")?.getAttribute("data-word");W(n)})})}function R(){const e=k();e&&(d&&d.disconnect(),d=new MutationObserver(r=>{b>0||r.some(t=>t.type==="characterData"||t.type==="childList")&&(f&&clearTimeout(f),f=window.setTimeout(()=>{u&&m()},350))}),d.observe(e,{...$}))}function V(){d&&(d.disconnect(),d=null),f&&(clearTimeout(f),f=null)}function G(){document.querySelectorAll(".rte-spellcheck-menu").forEach(e=>e.remove())}function J(){return u&&(S(),V(),he(),G(),a&&(a.remove(),a=null),s=null,h=null,u=!1),!1}function me(){const e=Z();return e?u&&s&&s!==e?(S(),V(),G(),a&&(a.remove(),a=null),s=e,T(),_(),m(),R(),a=I(),y(),!0):u?J():(s=e,u=!0,T(),_(),m(),R(),a&&(a.remove(),a=null),a=I(),y(),!0):!1}const ke=()=>({name:"spellCheck",init:()=>{ee(),X()},toolbar:[{label:"Spell Check",command:"toggleSpellCheck",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>',shortcut:"F7"}],commands:{toggleSpellCheck:()=>(me(),!0)},keymap:{F7:"toggleSpellCheck"}});exports.SpellCheckPlugin=ke;
|