@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.
Files changed (105) hide show
  1. package/README.md +30 -5
  2. package/dist/a11y-checker.cjs.js +109 -0
  3. package/dist/a11y-checker.esm.js +509 -0
  4. package/dist/anchor.cjs.js +176 -0
  5. package/dist/anchor.esm.js +400 -0
  6. package/dist/background-color.cjs.js +218 -0
  7. package/dist/background-color.esm.js +482 -0
  8. package/dist/blockquote.cjs.js +1 -0
  9. package/dist/blockquote.esm.js +47 -0
  10. package/dist/bold.cjs.js +1 -0
  11. package/dist/bold.esm.js +44 -0
  12. package/dist/capitalization.cjs.js +1 -0
  13. package/dist/capitalization.esm.js +78 -0
  14. package/dist/checklist.cjs.js +1 -0
  15. package/dist/checklist.esm.js +305 -0
  16. package/dist/clear-formatting.cjs.js +1 -0
  17. package/dist/clear-formatting.esm.js +138 -0
  18. package/dist/code-sample.cjs.js +161 -0
  19. package/dist/code-sample.esm.js +381 -0
  20. package/dist/code.cjs.js +598 -0
  21. package/dist/code.esm.js +2034 -0
  22. package/dist/colorSelectionApply-C0iOfMWb.js +1 -0
  23. package/dist/colorSelectionApply-D8r_gV32.mjs +63 -0
  24. package/dist/comments.cjs.js +354 -0
  25. package/dist/comments.esm.js +692 -0
  26. package/dist/direction.cjs.js +1 -0
  27. package/dist/direction.esm.js +129 -0
  28. package/dist/document-manager.cjs.js +1 -0
  29. package/dist/document-manager.esm.js +6 -0
  30. package/dist/{documentManager-CYC9totK.mjs → documentManager-DRUc1-Cs.mjs} +3 -3
  31. package/dist/{documentManager-BGlu3WRB.js → documentManager-_tQQfQi9.js} +3 -3
  32. package/dist/editorContainerHelpers-C7kdWnS0.mjs +26 -0
  33. package/dist/editorContainerHelpers-CFbfiOJI.js +1 -0
  34. package/dist/embed-iframe.cjs.js +361 -0
  35. package/dist/embed-iframe.esm.js +556 -0
  36. package/dist/emojis.cjs.js +284 -0
  37. package/dist/emojis.esm.js +1080 -0
  38. package/dist/font-family.cjs.js +1 -0
  39. package/dist/font-family.esm.js +152 -0
  40. package/dist/font-size.cjs.js +1 -0
  41. package/dist/font-size.esm.js +278 -0
  42. package/dist/footnote.cjs.js +85 -0
  43. package/dist/footnote.esm.js +397 -0
  44. package/dist/fullscreen.cjs.js +1 -0
  45. package/dist/fullscreen.esm.js +73 -0
  46. package/dist/heading.cjs.js +1 -0
  47. package/dist/heading.esm.js +63 -0
  48. package/dist/history.cjs.js +1 -0
  49. package/dist/history.esm.js +246 -0
  50. package/dist/indent.cjs.js +1 -0
  51. package/dist/indent.esm.js +146 -0
  52. package/dist/index-Bskk414V.mjs +145 -0
  53. package/dist/index-D3pJyAsj.js +1 -0
  54. package/dist/index.cjs.js +1 -1
  55. package/dist/{index.es-B-to-4j4.js → index.es-Cz1qItab.js} +1 -1
  56. package/dist/{index.es-BbXJ7tyO.mjs → index.es-DEcRmSTY.mjs} +1 -1
  57. package/dist/index.esm.js +89 -49
  58. package/dist/italic.cjs.js +1 -0
  59. package/dist/italic.esm.js +40 -0
  60. package/dist/line-height.cjs.js +1 -0
  61. package/dist/line-height.esm.js +145 -0
  62. package/dist/link.cjs.js +138 -0
  63. package/dist/link.esm.js +276 -0
  64. package/dist/list.cjs.js +1 -0
  65. package/dist/list.esm.js +102 -0
  66. package/dist/lite.cjs.js +1 -0
  67. package/dist/lite.esm.js +61 -0
  68. package/dist/math.cjs.js +45 -0
  69. package/dist/math.esm.js +249 -0
  70. package/dist/media-manager.cjs.js +619 -0
  71. package/dist/media-manager.esm.js +994 -0
  72. package/dist/merge-tag.cjs.js +93 -0
  73. package/dist/merge-tag.esm.js +412 -0
  74. package/dist/page-break.cjs.js +72 -0
  75. package/dist/page-break.esm.js +295 -0
  76. package/dist/plugins.css +1 -1
  77. package/dist/preview.cjs.js +230 -0
  78. package/dist/preview.esm.js +321 -0
  79. package/dist/print.cjs.js +254 -0
  80. package/dist/print.esm.js +309 -0
  81. package/dist/purify.es-DHhaBdbu.mjs +470 -0
  82. package/dist/purify.es-T2a3nLiC.js +3 -0
  83. package/dist/shared-config.cjs.js +1 -0
  84. package/dist/shared-config.esm.js +30 -0
  85. package/dist/special-characters.cjs.js +257 -0
  86. package/dist/special-characters.esm.js +772 -0
  87. package/dist/spell-check.cjs.js +512 -0
  88. package/dist/spell-check.esm.js +1013 -0
  89. package/dist/strikethrough.cjs.js +1 -0
  90. package/dist/strikethrough.esm.js +71 -0
  91. package/dist/table.cjs.js +35 -0
  92. package/dist/table.esm.js +477 -0
  93. package/dist/template.cjs.js +356 -0
  94. package/dist/template.esm.js +560 -0
  95. package/dist/text-alignment.cjs.js +1 -0
  96. package/dist/text-alignment.esm.js +105 -0
  97. package/dist/text-color.cjs.js +300 -0
  98. package/dist/text-color.esm.js +507 -0
  99. package/dist/underline.cjs.js +1 -0
  100. package/dist/underline.esm.js +34 -0
  101. package/index.d.ts +62 -0
  102. package/package.json +218 -6
  103. package/LICENSE +0 -21
  104. package/dist/index-BbORIHoM.mjs +0 -11763
  105. package/dist/index-C-OCBS_6.js +0 -3753
@@ -0,0 +1,507 @@
1
+ import { a as h } from "./colorSelectionApply-D8r_gV32.mjs";
2
+ let o = null, p = null, f = null, i = "#000000";
3
+ const s = '[data-theme="dark"], .dark, .editora-theme-dark', k = [
4
+ "#000000",
5
+ "#ffffff",
6
+ "#808080",
7
+ "#ff0000",
8
+ "#00ff00",
9
+ "#0000ff",
10
+ "#ffff00",
11
+ "#ff00ff",
12
+ "#00ffff",
13
+ "#ffa500",
14
+ "#800080",
15
+ "#ffc0cb"
16
+ ];
17
+ function m() {
18
+ const e = window.getSelection();
19
+ if (e && e.rangeCount > 0) {
20
+ const l = e.getRangeAt(0).startContainer, c = l.nodeType === Node.ELEMENT_NODE ? l : l.parentElement;
21
+ if (c) {
22
+ const n = c.closest(
23
+ '[data-editora-editor="true"], .rte-editor, .editora-editor'
24
+ );
25
+ if (n) return n;
26
+ }
27
+ }
28
+ const t = document.activeElement;
29
+ return t ? t.closest(
30
+ '[data-editora-editor="true"], .rte-editor, .editora-editor'
31
+ ) : null;
32
+ }
33
+ function v(e) {
34
+ const t = m();
35
+ if (t) {
36
+ const r = t.querySelector(
37
+ `[data-command="${e}"]`
38
+ );
39
+ if (r) return r;
40
+ }
41
+ return document.querySelector(`[data-command="${e}"]`);
42
+ }
43
+ function y(e) {
44
+ if (e?.closest(s)) return !0;
45
+ const t = window.getSelection();
46
+ if (t && t.rangeCount > 0) {
47
+ const l = t.getRangeAt(0).startContainer;
48
+ if ((l.nodeType === Node.ELEMENT_NODE ? l : l.parentElement)?.closest(s)) return !0;
49
+ }
50
+ return document.activeElement?.closest(s) ? !0 : document.body.matches(s) || document.documentElement.matches(s);
51
+ }
52
+ function d(e) {
53
+ return h({
54
+ color: e,
55
+ className: "rte-text-color",
56
+ styleProperty: "color",
57
+ commands: ["foreColor"],
58
+ savedRange: f,
59
+ getActiveEditorRoot: m,
60
+ warnMessage: "[TextColor] Could not apply color for current selection"
61
+ });
62
+ }
63
+ function w() {
64
+ const e = window.getSelection();
65
+ if (!e || e.rangeCount === 0) return "#000000";
66
+ let r = e.getRangeAt(0).startContainer;
67
+ for (; r && r !== document.body; ) {
68
+ if (r.nodeType === Node.ELEMENT_NODE) {
69
+ const l = r, c = l.style.color || window.getComputedStyle(l).color;
70
+ if (c && c !== "rgb(0, 0, 0)")
71
+ return C(c);
72
+ }
73
+ r = r.parentNode;
74
+ }
75
+ return "#000000";
76
+ }
77
+ function C(e) {
78
+ if (e.startsWith("#")) return e;
79
+ const t = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
80
+ if (!t) return "#000000";
81
+ const r = parseInt(t[1]), l = parseInt(t[2]), c = parseInt(t[3]);
82
+ return "#" + [r, l, c].map((n) => {
83
+ const u = n.toString(16);
84
+ return u.length === 1 ? "0" + u : u;
85
+ }).join("");
86
+ }
87
+ function E(e) {
88
+ const t = window.getSelection();
89
+ t && t.rangeCount > 0 && (f = t.getRangeAt(0).cloneRange()), i = w(), o = document.createElement("div"), o.className = "rte-inline-color-picker", y(e) && o.classList.add("rte-theme-dark"), o.addEventListener("click", (l) => l.stopPropagation()), o.innerHTML = `
90
+ <div class="rte-color-picker-header">
91
+ <span class="rte-color-picker-title">Text Color</span>
92
+ <button class="rte-color-picker-close" aria-label="Close">×</button>
93
+ </div>
94
+
95
+ <div class="rte-color-picker-body">
96
+ <!-- Current Color Preview -->
97
+ <div class="rte-color-preview-section">
98
+ <div class="rte-color-preview-box" style="background-color: ${i}; ${i === "#ffffff" ? "border: 1px solid #ccc;" : ""}"></div>
99
+ <span class="rte-color-preview-label">${i.toUpperCase()}</span>
100
+ </div>
101
+
102
+ <!-- Preset Colors -->
103
+ <div class="rte-color-section">
104
+ <label class="rte-color-section-label">Colors</label>
105
+ <div class="rte-color-palette">
106
+ ${k.map((l) => `
107
+ <button
108
+ class="rte-color-swatch ${i === l ? "selected" : ""}"
109
+ style="background-color: ${l}; ${l === "#ffffff" ? "border: 1px solid #ccc;" : ""}"
110
+ data-color="${l}"
111
+ title="${l.toUpperCase()}"
112
+ aria-label="${l.toUpperCase()}"
113
+ ></button>
114
+ `).join("")}
115
+ </div>
116
+ </div>
117
+
118
+ <!-- Custom Color -->
119
+ <div class="rte-color-section">
120
+ <label class="rte-color-section-label">Custom</label>
121
+ <div class="rte-custom-color-inputs">
122
+ <input
123
+ type="color"
124
+ value="${i}"
125
+ class="rte-color-input-native"
126
+ aria-label="Color picker"
127
+ />
128
+ <input
129
+ type="text"
130
+ value="${i}"
131
+ placeholder="#000000"
132
+ pattern="^#[0-9A-Fa-f]{6}$"
133
+ class="rte-color-input-text"
134
+ aria-label="Hex color input"
135
+ />
136
+ </div>
137
+ </div>
138
+ </div>
139
+ `;
140
+ const r = e.getBoundingClientRect();
141
+ o.style.position = "absolute", o.style.top = `${r.bottom + window.scrollY + 4}px`, o.style.left = `${r.left + window.scrollX}px`, o.style.zIndex = "10000", document.body.appendChild(o), p = e, T();
142
+ }
143
+ function T() {
144
+ if (!o) return;
145
+ o.querySelector(".rte-color-picker-close")?.addEventListener("click", () => a()), o.querySelectorAll(".rte-color-swatch").forEach((c) => {
146
+ c.addEventListener("click", () => {
147
+ const n = c.getAttribute("data-color");
148
+ n && (i = n, d(n), a());
149
+ });
150
+ });
151
+ const r = o.querySelector(".rte-color-input-native");
152
+ r?.addEventListener("change", (c) => {
153
+ const n = c.target.value;
154
+ i = n, d(n), a();
155
+ });
156
+ const l = o.querySelector(".rte-color-input-text");
157
+ l?.addEventListener("change", (c) => {
158
+ const n = c.target.value;
159
+ /^#[0-9A-Fa-f]{6}$/.test(n) && (i = n, d(n), a());
160
+ }), r?.addEventListener("input", (c) => {
161
+ const n = c.target.value;
162
+ i = n, x(n), b(n), L(n);
163
+ }), l?.addEventListener("input", (c) => {
164
+ const n = c.target.value;
165
+ /^#[0-9A-Fa-f]{6}$/.test(n) && (i = n, x(n), b(n), S(n));
166
+ });
167
+ }
168
+ function x(e) {
169
+ if (!o) return;
170
+ const t = o.querySelector(".rte-color-preview-box"), r = o.querySelector(".rte-color-preview-label");
171
+ t && (t.style.backgroundColor = e, t.style.border = e === "#ffffff" ? "1px solid #ccc" : "none"), r && (r.textContent = e.toUpperCase());
172
+ }
173
+ function b(e) {
174
+ if (!o) return;
175
+ o.querySelectorAll(".rte-color-swatch").forEach((r) => {
176
+ r.getAttribute("data-color") === e ? r.classList.add("selected") : r.classList.remove("selected");
177
+ });
178
+ }
179
+ function S(e) {
180
+ if (!o) return;
181
+ const t = o.querySelector(".rte-color-input-native");
182
+ t && (t.value = e);
183
+ }
184
+ function L(e) {
185
+ if (!o) return;
186
+ const t = o.querySelector(".rte-color-input-text");
187
+ t && (t.value = e);
188
+ }
189
+ function a() {
190
+ o && (o.remove(), o = null), p = null, f = null;
191
+ }
192
+ function $() {
193
+ if (o)
194
+ return a(), !0;
195
+ const e = v("openTextColorPicker");
196
+ return e ? (E(e), !0) : !1;
197
+ }
198
+ function g() {
199
+ if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, document.addEventListener("click", (e) => {
200
+ if (o && p) {
201
+ const t = e.target;
202
+ !o.contains(t) && !p.contains(t) && a();
203
+ }
204
+ }), !document.getElementById("text-color-plugin-styles"))) {
205
+ const e = document.createElement("style");
206
+ e.id = "text-color-plugin-styles", e.textContent = `
207
+ .rte-inline-color-picker {
208
+ background: white;
209
+ border-radius: 8px;
210
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
211
+ width: 220px;
212
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
213
+ }
214
+
215
+ .rte-color-picker-header {
216
+ padding: 12px 16px;
217
+ border-bottom: 1px solid #eee;
218
+ display: flex;
219
+ justify-content: space-between;
220
+ align-items: center;
221
+ }
222
+
223
+ .rte-color-picker-title {
224
+ font-size: 14px;
225
+ font-weight: 600;
226
+ color: #333;
227
+ }
228
+
229
+ .rte-color-picker-close {
230
+ background: none;
231
+ border: none;
232
+ font-size: 24px;
233
+ cursor: pointer;
234
+ color: #999;
235
+ padding: 0;
236
+ width: 24px;
237
+ height: 24px;
238
+ display: flex;
239
+ align-items: center;
240
+ justify-content: center;
241
+ line-height: 1;
242
+ }
243
+
244
+ .rte-color-picker-close:hover {
245
+ color: #333;
246
+ }
247
+
248
+ .rte-color-picker-body {
249
+ padding: 8px;
250
+ }
251
+
252
+ .rte-color-preview-section {
253
+ display: flex;
254
+ align-items: center;
255
+ gap: 12px;
256
+ margin-bottom: 8px;
257
+ padding: 6px;
258
+ background-color: #f8f9fa;
259
+ border-radius: 6px;
260
+ border: 1px solid #e0e0e0;
261
+ }
262
+
263
+ .rte-color-preview-box {
264
+ width: 24px;
265
+ height: 24px;
266
+ border-radius: 4px;
267
+ flex-shrink: 0;
268
+ }
269
+
270
+ .rte-color-preview-label {
271
+ font-size: 13px;
272
+ font-weight: 500;
273
+ color: #666;
274
+ font-family: monospace;
275
+ }
276
+
277
+ .rte-color-section {
278
+ margin-bottom: 16px;
279
+ }
280
+
281
+ .rte-color-section:last-child {
282
+ margin-bottom: 0;
283
+ }
284
+
285
+ .rte-color-section-label {
286
+ display: block;
287
+ font-size: 12px;
288
+ font-weight: 600;
289
+ color: #666;
290
+ margin-bottom: 8px;
291
+ text-transform: uppercase;
292
+ letter-spacing: 0.5px;
293
+ }
294
+
295
+ .rte-color-palette {
296
+ display: grid;
297
+ grid-template-columns: repeat(7, 1fr);
298
+ gap: 6px;
299
+ max-width: 180px;
300
+ }
301
+
302
+ .rte-color-swatch {
303
+ width: 100%;
304
+ aspect-ratio: 1;
305
+ border: 1px solid #e0e0e0;
306
+ border-radius: 3px;
307
+ cursor: pointer;
308
+ transition: all 0.15s ease;
309
+ padding: 0;
310
+ min-height: 20px;
311
+ }
312
+
313
+ .rte-color-swatch:hover {
314
+ transform: scale(1.05);
315
+ border-color: #ccc;
316
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
317
+ }
318
+
319
+ .rte-color-swatch.selected {
320
+ border-color: #1976d2;
321
+ box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.3);
322
+ }
323
+
324
+ .rte-custom-color-inputs {
325
+ display: flex;
326
+ gap: 8px;
327
+ }
328
+
329
+ .rte-color-input-native {
330
+ width: 50px;
331
+ height: 26px;
332
+ border: 1px solid #ddd;
333
+ border-radius: 4px;
334
+ cursor: pointer;
335
+ padding: 2px;
336
+ }
337
+
338
+ .rte-color-input-text {
339
+ flex: 1;
340
+ height: 26px;
341
+ width: 50px;
342
+ border: 1px solid #ddd;
343
+ border-radius: 4px;
344
+ padding: 0 12px;
345
+ font-size: 13px;
346
+ font-family: monospace;
347
+ }
348
+
349
+ .rte-color-input-text:focus {
350
+ outline: none;
351
+ border-color: #1976d2;
352
+ }
353
+
354
+ .rte-color-picker-footer {
355
+ padding: 12px 16px;
356
+ border-top: 1px solid #eee;
357
+ display: flex;
358
+ gap: 8px;
359
+ justify-content: flex-end;
360
+ }
361
+
362
+ .rte-btn-primary,
363
+ .rte-btn-secondary {
364
+ padding: 6px 16px;
365
+ border-radius: 4px;
366
+ font-size: 13px;
367
+ font-weight: 500;
368
+ cursor: pointer;
369
+ transition: all 0.2s;
370
+ border: none;
371
+ }
372
+
373
+ .rte-btn-primary {
374
+ background-color: #1976d2;
375
+ color: white;
376
+ }
377
+
378
+ .rte-btn-primary:hover {
379
+ background-color: #1565c0;
380
+ }
381
+
382
+ .rte-btn-secondary {
383
+ background-color: #f5f5f5;
384
+ color: #333;
385
+ border: 1px solid #ddd;
386
+ }
387
+
388
+ .rte-btn-secondary:hover {
389
+ background-color: #eeeeee;
390
+ }
391
+
392
+ .rte-inline-color-picker.rte-theme-dark {
393
+ background: #1f2937;
394
+ border: 1px solid #4b5563;
395
+ box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
396
+ }
397
+
398
+ .rte-inline-color-picker.rte-theme-dark .rte-color-picker-header {
399
+ border-bottom-color: #3b4657;
400
+ }
401
+
402
+ .rte-inline-color-picker.rte-theme-dark .rte-color-picker-title {
403
+ color: #e2e8f0;
404
+ }
405
+
406
+ .rte-inline-color-picker.rte-theme-dark .rte-color-picker-close {
407
+ color: #94a3b8;
408
+ }
409
+
410
+ .rte-inline-color-picker.rte-theme-dark .rte-color-picker-close:hover {
411
+ color: #f8fafc;
412
+ }
413
+
414
+ .rte-inline-color-picker.rte-theme-dark .rte-color-preview-section {
415
+ background-color: #111827;
416
+ border-color: #4b5563;
417
+ }
418
+
419
+ .rte-inline-color-picker.rte-theme-dark .rte-color-preview-label {
420
+ color: #cbd5e1;
421
+ }
422
+
423
+ .rte-inline-color-picker.rte-theme-dark .rte-color-section-label {
424
+ color: #9fb0c6;
425
+ }
426
+
427
+ .rte-inline-color-picker.rte-theme-dark .rte-color-swatch {
428
+ border-color: #4b5563;
429
+ }
430
+
431
+ .rte-inline-color-picker.rte-theme-dark .rte-color-swatch:hover {
432
+ border-color: #7a8ba5;
433
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
434
+ }
435
+
436
+ .rte-inline-color-picker.rte-theme-dark .rte-color-swatch.selected {
437
+ border-color: #58a6ff;
438
+ box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.4);
439
+ }
440
+
441
+ .rte-inline-color-picker.rte-theme-dark .rte-color-input-native,
442
+ .rte-inline-color-picker.rte-theme-dark .rte-color-input-text {
443
+ background: #111827;
444
+ border-color: #4b5563;
445
+ color: #e2e8f0;
446
+ }
447
+
448
+ .rte-inline-color-picker.rte-theme-dark .rte-color-input-text::placeholder {
449
+ color: #94a3b8;
450
+ }
451
+
452
+ .rte-inline-color-picker.rte-theme-dark .rte-color-input-text:focus {
453
+ border-color: #58a6ff;
454
+ }
455
+ `, document.head.appendChild(e);
456
+ }
457
+ }
458
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", g) : setTimeout(g, 100);
459
+ const A = () => ({
460
+ name: "textColor",
461
+ marks: {
462
+ textColor: {
463
+ attrs: {
464
+ color: { default: "#000000" }
465
+ },
466
+ parseDOM: [
467
+ {
468
+ tag: "span[style*=color]",
469
+ getAttrs: (e) => {
470
+ const r = (e.getAttribute("style") || "").match(/color:\s*([^;]+)/);
471
+ return r ? { color: r[1] } : null;
472
+ }
473
+ },
474
+ {
475
+ tag: "font[color]",
476
+ getAttrs: (e) => {
477
+ const t = e.getAttribute("color");
478
+ return t ? { color: t } : null;
479
+ }
480
+ }
481
+ ],
482
+ toDOM: (e) => [
483
+ "span",
484
+ {
485
+ style: `color: ${e.attrs?.color || "#000000"}`,
486
+ class: "rte-text-color"
487
+ },
488
+ 0
489
+ ]
490
+ }
491
+ },
492
+ toolbar: [
493
+ {
494
+ label: "Text Color",
495
+ command: "openTextColorPicker",
496
+ icon: '<svg width="24" height="24" focusable="false"><g fill-rule="evenodd"><path class="tox-icon-text-color__color" d="M3 18h18v3H3z" fill="currentColor"></path><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"></path></g></svg>'
497
+ }
498
+ ],
499
+ commands: {
500
+ openTextColorPicker: () => $(),
501
+ setTextColor: (e) => e ? d(e) : !1
502
+ },
503
+ keymap: {}
504
+ });
505
+ export {
506
+ A as TextColorPlugin
507
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=()=>({name:"underline",marks:{underline:{parseDOM:[{tag:"u"}],toDOM:()=>["u",{},0]}},toolbar:[{label:"Underline",command:"toggleUnderline",icon:'<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-u"}],commands:{toggleUnderline:()=>(document.execCommand("underline",!1),!0)},keymap:{"Mod-u":"toggleUnderline","Mod-U":"toggleUnderline"}});exports.UnderlinePlugin=e;
@@ -0,0 +1,34 @@
1
+ const e = () => ({
2
+ name: "underline",
3
+ // Schema definition for underline mark
4
+ marks: {
5
+ underline: {
6
+ parseDOM: [{ tag: "u" }],
7
+ toDOM: () => ["u", {}, 0]
8
+ }
9
+ },
10
+ // Toolbar button configuration (matching React version exactly)
11
+ toolbar: [
12
+ {
13
+ label: "Underline",
14
+ command: "toggleUnderline",
15
+ icon: '<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',
16
+ shortcut: "Mod-u"
17
+ }
18
+ ],
19
+ // Native command implementations
20
+ commands: {
21
+ /**
22
+ * Toggle underline formatting on current selection
23
+ */
24
+ toggleUnderline: () => (document.execCommand("underline", !1), !0)
25
+ },
26
+ // Keyboard shortcuts
27
+ keymap: {
28
+ "Mod-u": "toggleUnderline",
29
+ "Mod-U": "toggleUnderline"
30
+ }
31
+ });
32
+ export {
33
+ e as UnderlinePlugin
34
+ };
package/index.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ import type { Plugin } from "@editora/core";
2
+
3
+ export interface ApiConfig {
4
+ apiUrl: string;
5
+ headers?: Record<string, string>;
6
+ }
7
+
8
+ export type MediaManagerConfig = Record<string, unknown>;
9
+ export type DocumentManagerConfig = Record<string, unknown>;
10
+
11
+ export function HeadingPlugin(): Plugin;
12
+ export function BoldPlugin(): Plugin;
13
+ export function ItalicPlugin(): Plugin;
14
+ export function UnderlinePlugin(): Plugin;
15
+ export function StrikethroughPlugin(): Plugin;
16
+ export function ListPlugin(): Plugin;
17
+ export function ChecklistPlugin(): Plugin;
18
+ export function HistoryPlugin(): Plugin;
19
+ export function LinkPlugin(): Plugin;
20
+ export function BlockquotePlugin(): Plugin;
21
+ export function ClearFormattingPlugin(): Plugin;
22
+ export function CodePlugin(): Plugin;
23
+ export function TablePlugin(): Plugin;
24
+ export function FontSizePlugin(): Plugin;
25
+ export function FontFamilyPlugin(): Plugin;
26
+ export function TextAlignmentPlugin(): Plugin;
27
+ export function TextColorPlugin(): Plugin;
28
+ export function BackgroundColorPlugin(): Plugin;
29
+ export function LineHeightPlugin(): Plugin;
30
+ export function IndentPlugin(): Plugin;
31
+ export function DirectionPlugin(): Plugin;
32
+ export function CapitalizationPlugin(): Plugin;
33
+ export function MathPlugin(): Plugin;
34
+ export function SpecialCharactersPlugin(): Plugin;
35
+ export function EmojisPlugin(): Plugin;
36
+ export function EmbedIframePlugin(): Plugin;
37
+ export function AnchorPlugin(): Plugin;
38
+
39
+ export function MediaManagerPlugin(): Plugin;
40
+ export function setMediaManagerConfig(config: Partial<MediaManagerConfig>): void;
41
+ export function getMediaManagerConfig(): MediaManagerConfig;
42
+
43
+ export function DocumentManagerPlugin(): Plugin;
44
+ export function setDocumentManagerConfig(config: Partial<DocumentManagerConfig>): void;
45
+ export function getDocumentManagerConfig(): DocumentManagerConfig;
46
+
47
+ export function PreviewPlugin(): Plugin;
48
+ export function FullscreenPlugin(): Plugin;
49
+ export function PrintPlugin(): Plugin;
50
+ export function PageBreakPlugin(): Plugin;
51
+ export function FootnotePlugin(): Plugin;
52
+ export function CodeSamplePlugin(): Plugin;
53
+ export function MergeTagPlugin(): Plugin;
54
+ export function TemplatePlugin(): Plugin;
55
+ export function CommentsPlugin(): Plugin;
56
+ export function SpellCheckPlugin(): Plugin;
57
+ export function A11yCheckerPlugin(): Plugin;
58
+
59
+ export function setGlobalApiConfig(config: Partial<ApiConfig>): void;
60
+ export function getGlobalApiConfig(): ApiConfig;
61
+ export function getGlobalApiHeaders(): Record<string, string>;
62
+ export function buildApiUrl(baseUrl: string, path: string): string;