@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,295 @@
1
+ const u = '.rte-page-break[data-type="page-break"]', g = ".rte-content, .editora-content";
2
+ let p = null, m = !1;
3
+ const v = /* @__PURE__ */ new Set([
4
+ "DIV",
5
+ "P",
6
+ "BLOCKQUOTE",
7
+ "PRE",
8
+ "H1",
9
+ "H2",
10
+ "H3",
11
+ "H4",
12
+ "H5",
13
+ "H6",
14
+ "LI",
15
+ "TD",
16
+ "TH"
17
+ ]), x = () => {
18
+ p || typeof document > "u" || (p = document.createElement("style"), p.textContent = `
19
+ .rte-page-break {
20
+ display: block;
21
+ position: relative;
22
+ height: 12px;
23
+ margin: 8px 0;
24
+ background: linear-gradient(90deg, #ccc 0%, transparent 100%);
25
+ border-top: 2px dashed #999;
26
+ border-bottom: none;
27
+ cursor: pointer;
28
+ user-select: none;
29
+ transition: all 0.2s ease;
30
+ outline: none;
31
+ -webkit-user-select: none;
32
+ -moz-user-select: none;
33
+ -ms-user-select: none;
34
+ }
35
+
36
+ .rte-page-break::before {
37
+ content: '⎙ PAGE BREAK';
38
+ position: absolute;
39
+ top: -12px;
40
+ left: 0;
41
+ font-size: 10px;
42
+ font-weight: bold;
43
+ color: #666;
44
+ background: white;
45
+ padding: 2px 6px;
46
+ letter-spacing: 0.5px;
47
+ opacity: 0.7;
48
+ pointer-events: none;
49
+ }
50
+
51
+ .rte-page-break:hover {
52
+ background: linear-gradient(90deg, #999 0%, transparent 100%);
53
+ border-top-color: #666;
54
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
55
+ }
56
+
57
+ .rte-page-break:hover::before {
58
+ opacity: 1;
59
+ color: #333;
60
+ }
61
+
62
+ .rte-page-break:focus,
63
+ .rte-page-break:focus-visible,
64
+ .rte-page-break-selected {
65
+ outline: 2px solid #0066cc;
66
+ outline-offset: -2px;
67
+ border-top-color: #0066cc;
68
+ background: linear-gradient(90deg, #0066cc 0%, transparent 100%);
69
+ }
70
+
71
+ .rte-page-break * {
72
+ user-select: none;
73
+ }
74
+
75
+ @media print {
76
+ .rte-page-break {
77
+ display: block;
78
+ height: 0;
79
+ margin: 0;
80
+ background: none;
81
+ border: none;
82
+ page-break-after: always;
83
+ }
84
+
85
+ .rte-page-break::before {
86
+ display: none;
87
+ }
88
+ }
89
+ `, document.head.appendChild(p));
90
+ }, N = () => {
91
+ const e = window.getSelection();
92
+ if (!e || e.rangeCount === 0) return null;
93
+ const n = e.getRangeAt(0);
94
+ return (n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement)?.closest(g) || null;
95
+ }, h = () => {
96
+ const e = N();
97
+ if (e) return e;
98
+ const t = document.activeElement?.closest(g);
99
+ return t || document.querySelector(g);
100
+ }, C = (e, n) => {
101
+ let t = e;
102
+ for (; t && t !== n; ) {
103
+ if (t.nodeType === Node.ELEMENT_NODE) {
104
+ const r = t;
105
+ if (v.has(r.tagName))
106
+ return r;
107
+ }
108
+ t = t.parentNode;
109
+ }
110
+ return null;
111
+ }, w = () => {
112
+ const e = document.createElement("div");
113
+ return e.className = "rte-page-break", e.setAttribute("data-page-break", "true"), e.setAttribute("data-type", "page-break"), e.setAttribute("contenteditable", "false"), e.setAttribute("tabindex", "0"), e.setAttribute("role", "separator"), e.setAttribute("aria-label", "Page break"), e;
114
+ }, S = (e) => {
115
+ let n = e.nextElementSibling;
116
+ for (; n && n.matches(u); ) {
117
+ const r = n;
118
+ n = n.nextElementSibling, r.remove();
119
+ }
120
+ let t = e.previousElementSibling;
121
+ for (; t && t.matches(u); ) {
122
+ const r = t;
123
+ t = t.previousElementSibling, r.remove();
124
+ }
125
+ }, k = (e) => {
126
+ const n = e.nextElementSibling;
127
+ if (n && !n.matches(u))
128
+ return n;
129
+ const t = document.createElement("p");
130
+ return t.innerHTML = "<br>", e.parentNode?.insertBefore(t, e.nextSibling), t;
131
+ }, d = (e) => {
132
+ const n = window.getSelection();
133
+ if (!n) return;
134
+ const t = document.createRange();
135
+ e.nodeType, Node.TEXT_NODE, t.setStart(e, 0), t.collapse(!0), n.removeAllRanges(), n.addRange(t);
136
+ }, b = (e) => {
137
+ const n = window.getSelection();
138
+ if (!n) return;
139
+ const t = document.createRange();
140
+ if (e.nodeType === Node.TEXT_NODE) {
141
+ const r = e;
142
+ t.setStart(r, r.data.length);
143
+ } else
144
+ t.selectNodeContents(e), t.collapse(!1);
145
+ n.removeAllRanges(), n.addRange(t);
146
+ }, f = (e, n) => {
147
+ let t = e;
148
+ for (; t; ) {
149
+ if (!(t instanceof HTMLElement && t.matches(u)))
150
+ return t;
151
+ t = n === "previous" ? t.previousSibling : t.nextSibling;
152
+ }
153
+ return null;
154
+ }, A = (e) => {
155
+ const n = window.getSelection();
156
+ if (!n || !e.parentNode) return;
157
+ const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
158
+ if (r < 0) return;
159
+ const o = document.createRange();
160
+ o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
161
+ }, L = (e) => {
162
+ if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
163
+ const n = e.startContainer.childNodes[e.startOffset];
164
+ return n instanceof HTMLElement && n.matches(u) ? n : null;
165
+ }, T = (e, n, t) => {
166
+ if (!e.collapsed) return null;
167
+ const { startContainer: r, startOffset: o } = e, i = (a) => a instanceof HTMLElement && a.matches(u) ? a : null, s = (a) => {
168
+ if (r.nodeType === Node.ELEMENT_NODE) {
169
+ const c = r;
170
+ if (a === "previous") {
171
+ if (o > 0)
172
+ return c.childNodes[o - 1] || null;
173
+ } else if (o < c.childNodes.length)
174
+ return c.childNodes[o] || null;
175
+ }
176
+ if (r.nodeType === Node.TEXT_NODE && (a === "previous" && o < r.data.length || a === "next" && o > 0))
177
+ return null;
178
+ let l = r;
179
+ for (; l && l !== n; ) {
180
+ const c = a === "previous" ? l.previousSibling : l.nextSibling;
181
+ if (c) return c;
182
+ l = l.parentNode;
183
+ }
184
+ return null;
185
+ };
186
+ if (r.nodeType === Node.ELEMENT_NODE) {
187
+ const a = r;
188
+ return t === "Backspace" && o > 0 ? i(a.childNodes[o - 1] || null) : t === "Delete" ? i(a.childNodes[o] || null) : null;
189
+ }
190
+ if (r.nodeType === Node.TEXT_NODE) {
191
+ const a = r;
192
+ if (t === "Backspace" && o === 0) {
193
+ const l = i(a.previousSibling);
194
+ return l || i(s("previous"));
195
+ }
196
+ if (t === "Delete" && o === a.data.length) {
197
+ const l = i(a.nextSibling);
198
+ return l || i(s("next"));
199
+ }
200
+ }
201
+ return i(s(t === "Backspace" ? "previous" : "next"));
202
+ }, E = (e, n) => {
203
+ const t = e.closest(g), r = e.previousSibling, o = e.nextSibling;
204
+ e.remove();
205
+ const i = f(r, "previous"), s = f(o, "next");
206
+ if (n === "Backspace") {
207
+ if (i)
208
+ b(i);
209
+ else if (s)
210
+ d(s);
211
+ else if (t) {
212
+ const a = document.createElement("p");
213
+ a.innerHTML = "<br>", t.appendChild(a), d(a);
214
+ }
215
+ } else if (s)
216
+ d(s);
217
+ else if (i)
218
+ b(i);
219
+ else if (t) {
220
+ const a = document.createElement("p");
221
+ a.innerHTML = "<br>", t.appendChild(a), d(a);
222
+ }
223
+ return t && t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
224
+ }, R = () => {
225
+ const e = h();
226
+ if (!e) return !1;
227
+ const n = window.getSelection();
228
+ if (!n) return !1;
229
+ let t;
230
+ n.rangeCount > 0 && e.contains(n.getRangeAt(0).commonAncestorContainer) ? t = n.getRangeAt(0) : (t = document.createRange(), t.selectNodeContents(e), t.collapse(!1), n.removeAllRanges(), n.addRange(t));
231
+ const r = C(t.endContainer, e) || C(t.startContainer, e), o = w();
232
+ r && r.parentNode ? r.parentNode.insertBefore(o, r.nextSibling) : e.appendChild(o), S(o);
233
+ const i = k(o);
234
+ return d(i), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
235
+ }, B = () => {
236
+ m || typeof document > "u" || (m = !0, document.addEventListener("click", (e) => {
237
+ const t = e.target?.closest(u);
238
+ t && (e.preventDefault(), e.stopPropagation(), A(t));
239
+ }), document.addEventListener("keydown", (e) => {
240
+ const n = e.key;
241
+ if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
242
+ return;
243
+ const t = window.getSelection();
244
+ if (!t || t.rangeCount === 0) return;
245
+ const r = t.getRangeAt(0), o = h();
246
+ if (!o || !o.contains(r.commonAncestorContainer)) return;
247
+ const i = L(r);
248
+ if (i) {
249
+ if (n === "Backspace" || n === "Delete") {
250
+ e.preventDefault(), e.stopPropagation(), E(i, n);
251
+ return;
252
+ }
253
+ if (n === "ArrowRight" || n === "ArrowDown") {
254
+ e.preventDefault();
255
+ const s = f(i.nextSibling, "next") || k(i);
256
+ d(s);
257
+ return;
258
+ }
259
+ if (n === "ArrowLeft" || n === "ArrowUp") {
260
+ e.preventDefault();
261
+ const s = f(i.previousSibling, "previous");
262
+ s ? b(s) : d(o);
263
+ return;
264
+ }
265
+ }
266
+ if (n === "Backspace" || n === "Delete") {
267
+ const s = T(
268
+ r,
269
+ o,
270
+ n
271
+ );
272
+ if (!s) return;
273
+ e.preventDefault(), e.stopPropagation(), E(s, n);
274
+ }
275
+ }));
276
+ }, D = () => (x(), B(), {
277
+ name: "pageBreak",
278
+ toolbar: [
279
+ {
280
+ label: "Page Break",
281
+ command: "insertPageBreak",
282
+ icon: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 14 14" 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="M1,6 L3,6 C3.55228475,6 4,6.44771525 4,7 C4,7.55228475 3.55228475,8 3,8 L1,8 C0.44771525,8 0,7.55228475 0,7 C0,6.44771525 0.44771525,6 1,6 Z M11,6 L13,6 C13.5522847,6 14,6.44771525 14,7 C14,7.55228475 13.5522847,8 13,8 L11,8 C10.4477153,8 10,7.55228475 10,7 C10,6.44771525 10.4477153,6 11,6 Z M6,6 L8,6 C8.55228475,6 9,6.44771525 9,7 C9,7.55228475 8.55228475,8 8,8 L6,8 C5.44771525,8 5,7.55228475 5,7 C5,6.44771525 5.44771525,6 6,6 Z M0,1 C0,0.44771525 0.44771525,-2.26485497e-13 1,-2.26485497e-13 C1.55228475,-2.26485497e-13 2,0.44771525 2,1 L2,3.0142458 L12,3.0142458 L12,1 C12,0.44771525 12.4477153,-2.26485497e-13 13,-2.26485497e-13 C13.5522847,-2.26485497e-13 14,0.44771525 14,1 L14,3.0142458 C14,4.1188153 13.1045695,5.0142458 12,5.0142458 L2,5.0142458 C0.8954305,5.0142458 0,4.1188153 0,3.0142458 L0,1 Z M0,13.0142458 L0,11 C0,9.8954305 0.8954305,9 2,9 L12,9 C13.1045695,9 14,9.8954305 14,11 L14,13.0142458 C14,13.5665305 13.5522847,14.0142458 13,14.0142458 C12.4477153,14.0142458 12,13.5665305 12,13.0142458 L12,11 L2,11 L2,13.0142458 C2,13.5665305 1.55228475,14.0142458 1,14.0142458 C0.44771525,14.0142458 0,13.5665305 0,13.0142458 Z"></path></g></svg>',
283
+ shortcut: "Mod-Enter"
284
+ }
285
+ ],
286
+ commands: {
287
+ insertPageBreak: R
288
+ },
289
+ keymap: {
290
+ "Mod-Enter": "insertPageBreak"
291
+ }
292
+ });
293
+ export {
294
+ D as PageBreakPlugin
295
+ };
package/dist/plugins.css CHANGED
@@ -1 +1 @@
1
- .rte-table,table{border-collapse:collapse;width:100%;margin:1rem 0;border:1px solid #ddd;font-size:14px;line-height:1.4;position:relative}.rte-table td,.rte-table th,table td,table th{border:1px solid #ddd;padding:8px 12px;min-width:80px;vertical-align:top;position:relative;-webkit-user-select:none;user-select:none}.rte-table td:focus,.rte-table th:focus,table td:focus,table th:focus{outline:2px solid #007acc;outline-offset:-2px}.rte-table th,table th{background-color:#f8f9fa;font-weight:600;text-align:left}.rte-table td p,table td p{margin:0;padding:0}.rte-table td p:empty:before,table td p:empty:before{content:"​";display:inline-block}.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before{content:"Type here...";color:#999;font-style:italic;pointer-events:none}.rte-table tr:hover,table tr:hover{background-color:#f8f9fa}.rte-table td.selected,table td.selected{background-color:#e3f2fd;border-color:#2196f3}.table-toolbar{background:#fff;border:1px solid #d0d0d0;border-radius:4px;box-shadow:0 2px 8px #0000001a;padding:4px;display:flex;align-items:center;gap:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;min-width:max-content}.toolbar-section{display:flex;align-items:center;gap:2px}.toolbar-divider{width:1px;height:20px;background:#e0e0e0;margin:0 4px}.toolbar-icon-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;background:transparent;cursor:pointer;color:#333;border-radius:3px;transition:all .2s ease;flex-shrink:0;font-size:14px;line-height:1}.toolbar-icon-btn svg{width:16px;height:16px}.toolbar-icon-btn:hover:not(:disabled){background:#f0f0f0;border-color:#d0d0d0;color:#06c}.toolbar-icon-btn:active:not(:disabled){background:#e8f0ff;border-color:#06c;transform:scale(.95)}.toolbar-icon-btn:disabled{opacity:.4;cursor:not-allowed;color:#ccc}.toolbar-icon-btn-danger{color:#d32f2f}.toolbar-icon-btn-danger:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-danger:active:not(:disabled){background:#ffebee}.toolbar-icon-btn-delete{color:#d32f2f}.toolbar-icon-btn-delete:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-delete:active:not(:disabled){background:#ffebee}.resize-handle{opacity:0;transition:all .15s ease}.resize-handle:hover{opacity:1}td:hover>.resize-handle,th:hover>.resize-handle{opacity:1}.table-resize-handle{position:absolute;bottom:-4px;right:-4px;width:12px;height:12px;background:transparent;cursor:nwse-resize;z-index:10;transition:background .15s ease}.table-resize-handle:after{content:"";position:absolute;bottom:0;right:0;width:8px;height:8px;background:#0066cc4d;border-bottom:2px solid #0066cc;border-right:2px solid #0066cc;border-radius:0 0 2px;opacity:0;transition:opacity .15s ease}.table-resize-handle:hover:after{opacity:1}.rte-table:hover .table-resize-handle:after,table:hover .table-resize-handle:after{opacity:1}@media(max-width:768px){.rte-table,table{font-size:12px}.rte-table td,.rte-table th,table td,table th{padding:4px 6px;min-width:60px}.table-toolbar{padding:3px;gap:0;max-width:90vw;overflow-x:auto}.toolbar-icon-btn{width:26px;height:26px}.toolbar-divider{height:18px}}@media print{.rte-table,table{border:1px solid #000}.rte-table td,.rte-table th,table td,table th{border:1px solid #000;padding:4px}.table-toolbar{display:none}}
1
+ .rte-table,table{border-collapse:collapse;width:100%;margin:1rem 0;border:1px solid #ddd;font-size:14px;line-height:1.4;position:relative}.rte-table td,.rte-table th,table td,table th{border:1px solid #ddd;padding:8px 12px;min-width:80px;vertical-align:top;position:relative;-webkit-user-select:none;user-select:none}.rte-table td:focus,.rte-table th:focus,table td:focus,table th:focus{outline:2px solid #007acc;outline-offset:-2px}.rte-table th,table th{background-color:#f8f9fa;font-weight:600;text-align:left}.rte-table td p,table td p{margin:0;padding:0}.rte-table td p:empty:before,table td p:empty:before{content:"​";display:inline-block}.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before{content:"Type here...";color:#999;font-style:italic;pointer-events:none}.rte-table tr:hover,table tr:hover{background-color:#f8f9fa}.rte-table td.selected,table td.selected{background-color:#e3f2fd;border-color:#2196f3}.table-toolbar{background:#fff;border:1px solid #d0d0d0;border-radius:4px;box-shadow:0 2px 8px #0000001a;padding:4px;display:flex;align-items:center;gap:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;min-width:max-content}.toolbar-section{display:flex;align-items:center;gap:2px}.toolbar-divider{width:1px;height:20px;background:#e0e0e0;margin:0 4px}.toolbar-icon-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;background:transparent;cursor:pointer;color:#333;border-radius:3px;transition:all .2s ease;flex-shrink:0;font-size:14px;line-height:1}.toolbar-icon-btn svg{width:16px;height:16px}.toolbar-icon-btn:hover:not(:disabled){background:#f0f0f0;border-color:#d0d0d0;color:#06c}.toolbar-icon-btn:active:not(:disabled){background:#e8f0ff;border-color:#06c;transform:scale(.95)}.toolbar-icon-btn:disabled{opacity:.4;cursor:not-allowed;color:#ccc}.toolbar-icon-btn-danger{color:#d32f2f}.toolbar-icon-btn-danger:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-danger:active:not(:disabled){background:#ffebee}.toolbar-icon-btn-delete{color:#d32f2f}.toolbar-icon-btn-delete:hover:not(:disabled){background:#fff3f3;border-color:#fcc;color:#d32f2f}.toolbar-icon-btn-delete:active:not(:disabled){background:#ffebee}.resize-handle{opacity:0;transition:all .15s ease}.resize-handle:hover{opacity:1}td:hover>.resize-handle,th:hover>.resize-handle{opacity:1}.table-resize-handle{position:absolute;bottom:-4px;right:-4px;width:12px;height:12px;background:transparent;cursor:nwse-resize;z-index:10;transition:background .15s ease}.table-resize-handle:after{content:"";position:absolute;bottom:0;right:0;width:8px;height:8px;background:#0066cc4d;border-bottom:2px solid #0066cc;border-right:2px solid #0066cc;border-radius:0 0 2px;opacity:0;transition:opacity .15s ease}.table-resize-handle:hover:after{opacity:1}.rte-table:hover .table-resize-handle:after,table:hover .table-resize-handle:after{opacity:1}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table,table){border-color:#607088;background:#24303c;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td,.rte-table th,table td,table th){border-color:#607088;color:#e6eefb}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table th,table th){background:linear-gradient(180deg,#3b4553,#333d4a);color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table tr:hover,table tr:hover){background-color:#58a6ff1f}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td.selected,table td.selected){background-color:#58a6ff47;border-color:#79beff}:is([data-theme=dark],.dark,.editora-theme-dark) :is(.rte-table td[contenteditable]:empty:before,table td[contenteditable]:empty:before){color:#94a3b8}:is([data-theme=dark],.dark,.editora-theme-dark) .table-toolbar{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}.table-toolbar.rte-theme-dark{background:linear-gradient(180deg,#2f3844,#2a323c);border-color:#4d596b;box-shadow:0 8px 20px #00000073}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-divider{background:#4d596b}.table-toolbar.rte-theme-dark .toolbar-divider{background:#4d596b}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn{color:#d7deea;border-color:transparent}.table-toolbar.rte-theme-dark .toolbar-icon-btn{color:#d7deea;border-color:transparent}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg{color:currentColor;fill:currentColor}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg{color:currentColor;fill:currentColor}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [stroke=black i]{stroke:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill="#000000" i],:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill="#000000" i],.table-toolbar.rte-theme-dark .toolbar-icon-btn svg [fill=black i]{fill:currentColor!important}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}.table-toolbar.rte-theme-dark .toolbar-icon-btn:hover:not(:disabled){background:#3a4554;border-color:#607088;color:#f3f8ff}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}.table-toolbar.rte-theme-dark .toolbar-icon-btn:active:not(:disabled){background:#4a95de;border-color:#67adf4;color:#0f1b2a}:is([data-theme=dark],.dark,.editora-theme-dark) .toolbar-icon-btn:disabled{color:#7f8ca1}.table-toolbar.rte-theme-dark .toolbar-icon-btn:disabled{color:#7f8ca1}@media(max-width:768px){.rte-table,table{font-size:12px}.rte-table td,.rte-table th,table td,table th{padding:4px 6px;min-width:60px}.table-toolbar{padding:3px;gap:0;max-width:90vw;overflow-x:auto}.toolbar-icon-btn{width:26px;height:26px}.toolbar-divider{height:18px}}@media print{.rte-table,table{border:1px solid #000}.rte-table td,.rte-table th,table td,table th{border:1px solid #000;padding:4px}.table-toolbar{display:none}}
@@ -0,0 +1,230 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=!1;const g=()=>{if(typeof document>"u")return;const r="rte-preview-plugin-styles";if(document.getElementById(r))return;const t=document.createElement("style");t.id=r,t.textContent=`
2
+ /* Preview Editor Dialog Styles */
3
+ .rte-preview-editor-overlay {
4
+ position: fixed !important;
5
+ top: 0 !important;
6
+ left: 0 !important;
7
+ right: 0 !important;
8
+ bottom: 0 !important;
9
+ width: 100vw !important;
10
+ height: 100vh !important;
11
+ background-color: rgba(0, 0, 0, 0.6) !important;
12
+ display: flex !important;
13
+ align-items: center !important;
14
+ justify-content: center !important;
15
+ z-index: 10000 !important;
16
+ padding: 20px !important;
17
+ box-sizing: border-box !important;
18
+ margin: 0 !important;
19
+ }
20
+
21
+ .rte-preview-editor-modal {
22
+ background: white;
23
+ border-radius: 8px;
24
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
25
+ width: 100%;
26
+ max-width: 1200px;
27
+ max-height: 90vh;
28
+ display: flex;
29
+ flex-direction: column;
30
+ overflow: hidden;
31
+ position: relative;
32
+ }
33
+
34
+ .rte-preview-editor-header {
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: space-between;
38
+ padding: 16px 20px;
39
+ border-bottom: 1px solid #e1e5e9;
40
+ background: #f8f9fa;
41
+ border-radius: 8px 8px 0 0;
42
+ }
43
+
44
+ .rte-preview-editor-header h2 {
45
+ margin: 0;
46
+ font-size: 18px;
47
+ font-weight: 600;
48
+ color: #1a1a1a;
49
+ }
50
+
51
+ .rte-preview-editor-header-actions {
52
+ display: flex;
53
+ gap: 8px;
54
+ }
55
+
56
+ .rte-preview-editor-close-btn {
57
+ background: none;
58
+ border: none;
59
+ cursor: pointer;
60
+ padding: 4px;
61
+ border-radius: 4px;
62
+ color: #666;
63
+ font-size: 16px;
64
+ line-height: 1;
65
+ transition: all 0.2s ease;
66
+ }
67
+
68
+ .rte-preview-editor-close-btn:hover {
69
+ background: #e1e5e9;
70
+ color: #1a1a1a;
71
+ }
72
+
73
+ .rte-preview-editor-body {
74
+ flex: 1;
75
+ overflow: auto;
76
+ display: flex;
77
+ flex-direction: column;
78
+ padding: 25px;
79
+ }
80
+
81
+ .rte-preview-editor-content {
82
+ flex: 1;
83
+ display: flex;
84
+ flex-direction: column;
85
+ }
86
+
87
+ .rte-preview-editor-light-editor {
88
+ flex: 1;
89
+ overflow: auto;
90
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
91
+ font-size: 16px;
92
+ line-height: 1.6;
93
+ color: #1a1a1a;
94
+ padding: 20px;
95
+ background: #fafafa;
96
+ border: 1px solid #e1e5e9;
97
+ border-radius: 4px;
98
+ min-height: 400px;
99
+ }
100
+
101
+ .rte-preview-editor-light-editor h1,
102
+ .rte-preview-editor-light-editor h2,
103
+ .rte-preview-editor-light-editor h3,
104
+ .rte-preview-editor-light-editor h4,
105
+ .rte-preview-editor-light-editor h5,
106
+ .rte-preview-editor-light-editor h6 {
107
+ margin-top: 1.5em;
108
+ margin-bottom: 0.5em;
109
+ font-weight: 600;
110
+ }
111
+
112
+ .rte-preview-editor-light-editor h1 {
113
+ font-size: 2em;
114
+ }
115
+
116
+ .rte-preview-editor-light-editor h2 {
117
+ font-size: 1.5em;
118
+ }
119
+
120
+ .rte-preview-editor-light-editor h3 {
121
+ font-size: 1.25em;
122
+ }
123
+
124
+ .rte-preview-editor-light-editor p {
125
+ margin: 1em 0;
126
+ }
127
+
128
+ .rte-preview-editor-light-editor ul,
129
+ .rte-preview-editor-light-editor ol {
130
+ padding-left: 2em;
131
+ margin: 1em 0;
132
+ }
133
+
134
+ .rte-preview-editor-light-editor li {
135
+ margin: 0.5em 0;
136
+ }
137
+
138
+ .rte-preview-editor-light-editor table {
139
+ border-collapse: collapse;
140
+ width: 100%;
141
+ margin: 1em 0;
142
+ }
143
+
144
+ .rte-preview-editor-light-editor table td,
145
+ .rte-preview-editor-light-editor table th {
146
+ border: 1px solid #ddd;
147
+ padding: 0.5em;
148
+ }
149
+
150
+ .rte-preview-editor-light-editor table th {
151
+ background: #f5f5f5;
152
+ font-weight: 600;
153
+ }
154
+
155
+ .rte-preview-editor-light-editor blockquote {
156
+ border-left: 4px solid #ddd;
157
+ margin: 1em 0;
158
+ padding-left: 1em;
159
+ color: #666;
160
+ }
161
+
162
+ .rte-preview-editor-light-editor code {
163
+ background: #f5f5f5;
164
+ padding: 2px 6px;
165
+ border-radius: 3px;
166
+ font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
167
+ font-size: 0.9em;
168
+ }
169
+
170
+ .rte-preview-editor-light-editor pre {
171
+ background: #f5f5f5;
172
+ padding: 1em;
173
+ border-radius: 4px;
174
+ overflow-x: auto;
175
+ margin: 1em 0;
176
+ }
177
+
178
+ .rte-preview-editor-light-editor pre code {
179
+ background: none;
180
+ padding: 0;
181
+ }
182
+
183
+ .rte-preview-editor-light-editor img {
184
+ max-width: 100%;
185
+ height: auto;
186
+ }
187
+
188
+ .rte-preview-editor-light-editor a {
189
+ color: #007acc;
190
+ text-decoration: underline;
191
+ }
192
+
193
+ .rte-preview-editor-light-editor a:hover {
194
+ color: #0056b3;
195
+ }
196
+
197
+ /* Responsive design */
198
+ @media (max-width: 768px) {
199
+ .rte-preview-editor-overlay {
200
+ padding: 10px;
201
+ }
202
+
203
+ .rte-preview-editor-modal {
204
+ max-height: 95vh;
205
+ }
206
+
207
+ .rte-preview-editor-header {
208
+ padding: 12px 16px;
209
+ }
210
+
211
+ .rte-preview-editor-body {
212
+ padding: 16px;
213
+ }
214
+
215
+ .rte-preview-editor-light-editor {
216
+ padding: 12px;
217
+ font-size: 14px;
218
+ }
219
+ }
220
+ `,document.head.appendChild(t)},v=()=>{const r=window.getSelection();if(r&&r.rangeCount>0){let e=r.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const o=e;if(o.getAttribute("contenteditable")==="true")return o}e=e.parentNode}}const t=document.activeElement;if(t){if(t.getAttribute("contenteditable")==="true")return t;const e=t.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},h=()=>{const r=v();if(!r)return"";const t=r.cloneNode(!0);return[".rte-floating-toolbar",".rte-selection-marker",".rte-toolbar",".rte-resize-handle","[data-rte-internal]"].forEach(o=>{t.querySelectorAll(o).forEach(i=>i.remove())}),t.innerHTML},w=r=>{const t=document.createElement("div");return t.innerHTML=r,t.querySelectorAll('script, iframe[src^="javascript:"], object, embed, form[action^="javascript:"]').forEach(i=>i.remove()),t.querySelectorAll("*").forEach(i=>{Array.from(i.attributes).forEach(n=>{n.name.startsWith("on")&&i.removeAttribute(n.name),(n.name==="href"||n.name==="src")&&n.value.startsWith("javascript:")&&i.removeAttribute(n.name)})}),t.innerHTML},u=()=>{if(typeof window>"u"||c)return;c=!0,g();const r=h(),t=w(r),e=document.createElement("div");e.className="rte-preview-editor-overlay",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-labelledby","preview-editor-title");const o=document.createElement("div");o.className="rte-preview-editor-modal";const i=document.createElement("div");i.className="rte-preview-editor-header",i.innerHTML=`
221
+ <h2 id="preview-editor-title">Preview Editor</h2>
222
+ <div class="rte-preview-editor-header-actions">
223
+ <button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
224
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
225
+ <line x1="18" y1="6" x2="6" y2="18" />
226
+ <line x1="6" y1="6" x2="18" y2="18" />
227
+ </svg>
228
+ </button>
229
+ </div>
230
+ `;const n=document.createElement("div");n.className="rte-preview-editor-body";const a=document.createElement("div");a.className="rte-preview-editor-content";const l=document.createElement("div");l.className="rte-preview-editor-light-editor",l.innerHTML=t,a.appendChild(l),n.appendChild(a),o.appendChild(i),o.appendChild(n),e.appendChild(o);const p=()=>{e.parentNode&&e.parentNode.removeChild(e),c=!1,document.removeEventListener("keydown",s)},s=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),p())},m=i.querySelector(".rte-preview-editor-close-btn");m&&m.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),p()}),e.addEventListener("click",d=>{d.target===e&&p()}),document.addEventListener("keydown",s),document.body.appendChild(e)},f=()=>({name:"preview",toolbar:[{label:"Preview",command:"togglePreview",icon:'<svg fill="#000000" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 92 92" enable-background="new 0 0 92 92" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path id="XMLID_1239_" d="M91.3,43.8C90.6,42.8,74.4,19,46,19C17.6,19,1.4,42.8,0.7,43.8c-0.9,1.3-0.9,3.1,0,4.5 C1.4,49.2,17.6,73,46,73c28.4,0,44.6-23.8,45.3-24.8C92.2,46.9,92.2,45.1,91.3,43.8z M46,65C26.7,65,13.5,51.4,9,46 c4.5-5.5,17.6-19,37-19c19.3,0,32.5,13.6,37,19C78.4,51.5,65.3,65,46,65z M48.3,29.6c-4.4-0.6-8.7,0.5-12.3,3.2c0,0,0,0,0,0 c-7.3,5.5-8.8,15.9-3.3,23.2c2.7,3.6,6.5,5.8,10.9,6.5c0.8,0.1,1.6,0.2,2.3,0.2c3.6,0,7-1.2,9.9-3.3c7.3-5.5,8.8-15.9,3.3-23.2 C56.6,32.5,52.7,30.2,48.3,29.6z M52.3,54.5c-2.2,1.7-5,2.4-7.8,2c-2.8-0.4-5.3-1.9-7-4.1C34.1,47.7,35,41,39.7,37.5 c2.2-1.7,5-2.4,7.8-2c2.8,0.4,5.3,1.9,7,4.1C57.9,44.3,57,51,52.3,54.5z M51.9,40c0.8,0.7,1.2,1.8,1.2,2.8c0,1-0.4,2.1-1.2,2.8 c-0.7,0.7-1.8,1.2-2.8,1.2c-1.1,0-2.1-0.4-2.8-1.2c-0.8-0.8-1.2-1.8-1.2-2.8c0-1.1,0.4-2.1,1.2-2.8c0.7-0.8,1.8-1.2,2.8-1.2 C50.2,38.9,51.2,39.3,51.9,40z"></path> </g></svg>'}],commands:{togglePreview:()=>(u(),!0)},keymap:{}});exports.PreviewPlugin=f;