@editora/core 1.0.5 → 1.0.7

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 (43) hide show
  1. package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
  2. package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
  3. package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
  4. package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
  5. package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
  6. package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
  7. package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
  8. package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
  9. package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
  10. package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
  11. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
  12. package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-CXdX5fAv.mjs} +77 -68
  13. package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
  14. package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
  15. package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
  16. package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
  17. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  18. package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
  19. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  20. package/dist/editora.min.js +10 -10
  21. package/dist/editora.umd.js +10 -10
  22. package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
  23. package/dist/{index-CqWQFb3D.js → index-BpE6GFbz.js} +4 -4
  24. package/dist/index-BslAFzmv.mjs +16544 -0
  25. package/dist/{index-OwnkG39N.mjs → index-yzU4NdPT.mjs} +200 -183
  26. package/dist/index.cjs.js +1 -1
  27. package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
  28. package/dist/index.esm.js +2 -2
  29. package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
  30. package/dist/plugin-loader.js +15 -15
  31. package/dist/webcomponent-core.js +241 -224
  32. package/dist/webcomponent-core.min.css +1 -1
  33. package/dist/webcomponent-core.min.js +86 -106
  34. package/dist/webcomponent.cjs.js +1 -1
  35. package/dist/webcomponent.esm.js +1 -1
  36. package/dist/webcomponent.js +205 -188
  37. package/dist/webcomponent.min.css +1 -1
  38. package/dist/webcomponent.min.js +477 -402
  39. package/package.json +16 -10
  40. package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
  41. package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
  42. package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
  43. package/dist/documentManager-irzj9n3V.mjs +0 -37627
@@ -1,6 +1,14 @@
1
1
  const u = '.rte-page-break[data-type="page-break"]', g = ".rte-content, .editora-content";
2
2
  let p = null, m = !1;
3
- const v = /* @__PURE__ */ new Set([
3
+ const h = (e, n) => {
4
+ if (n === e.innerHTML) return;
5
+ const t = window.execEditorCommand || window.executeEditorCommand;
6
+ if (typeof t == "function")
7
+ try {
8
+ t("recordDomTransaction", e, n, e.innerHTML);
9
+ } catch (r) {
10
+ }
11
+ }, v = /* @__PURE__ */ new Set([
4
12
  "DIV",
5
13
  "P",
6
14
  "BLOCKQUOTE",
@@ -14,7 +22,7 @@ const v = /* @__PURE__ */ new Set([
14
22
  "LI",
15
23
  "TD",
16
24
  "TH"
17
- ]), x = () => {
25
+ ]), w = () => {
18
26
  p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
19
27
  .rte-page-break {
20
28
  display: block;
@@ -92,12 +100,12 @@ const v = /* @__PURE__ */ new Set([
92
100
  if (!e || e.rangeCount === 0) return null;
93
101
  const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
94
102
  return (t == null ? void 0 : t.closest(g)) || null;
95
- }, h = () => {
103
+ }, k = () => {
96
104
  const e = N();
97
105
  if (e) return e;
98
106
  const n = document.activeElement, t = n == null ? void 0 : n.closest(g);
99
107
  return t || document.querySelector(g);
100
- }, C = (e, n) => {
108
+ }, E = (e, n) => {
101
109
  let t = e;
102
110
  for (; t && t !== n; ) {
103
111
  if (t.nodeType === Node.ELEMENT_NODE) {
@@ -108,7 +116,7 @@ const v = /* @__PURE__ */ new Set([
108
116
  t = t.parentNode;
109
117
  }
110
118
  return null;
111
- }, w = () => {
119
+ }, T = () => {
112
120
  const e = document.createElement("div");
113
121
  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
122
  }, S = (e) => {
@@ -122,7 +130,7 @@ const v = /* @__PURE__ */ new Set([
122
130
  const r = t;
123
131
  t = t.previousElementSibling, r.remove();
124
132
  }
125
- }, k = (e) => {
133
+ }, x = (e) => {
126
134
  var r;
127
135
  const n = e.nextElementSibling;
128
136
  if (n && !n.matches(u))
@@ -152,129 +160,130 @@ const v = /* @__PURE__ */ new Set([
152
160
  t = n === "previous" ? t.previousSibling : t.nextSibling;
153
161
  }
154
162
  return null;
155
- }, A = (e) => {
163
+ }, L = (e) => {
156
164
  const n = window.getSelection();
157
165
  if (!n || !e.parentNode) return;
158
166
  const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
159
167
  if (r < 0) return;
160
168
  const o = document.createRange();
161
169
  o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
162
- }, L = (e) => {
170
+ }, A = (e) => {
163
171
  if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
164
172
  const n = e.startContainer.childNodes[e.startOffset];
165
173
  return n instanceof HTMLElement && n.matches(u) ? n : null;
166
- }, T = (e, n, t) => {
174
+ }, R = (e, n, t) => {
167
175
  if (!e.collapsed) return null;
168
- const { startContainer: r, startOffset: o } = e, i = (a) => a instanceof HTMLElement && a.matches(u) ? a : null, s = (a) => {
176
+ const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
169
177
  if (r.nodeType === Node.ELEMENT_NODE) {
170
- const c = r;
171
- if (a === "previous") {
178
+ const l = r;
179
+ if (i === "previous") {
172
180
  if (o > 0)
173
- return c.childNodes[o - 1] || null;
174
- } else if (o < c.childNodes.length)
175
- return c.childNodes[o] || null;
181
+ return l.childNodes[o - 1] || null;
182
+ } else if (o < l.childNodes.length)
183
+ return l.childNodes[o] || null;
176
184
  }
177
- if (r.nodeType === Node.TEXT_NODE && (a === "previous" && o < r.data.length || a === "next" && o > 0))
185
+ if (r.nodeType === Node.TEXT_NODE && (i === "previous" && o < r.data.length || i === "next" && o > 0))
178
186
  return null;
179
- let l = r;
180
- for (; l && l !== n; ) {
181
- const c = a === "previous" ? l.previousSibling : l.nextSibling;
182
- if (c) return c;
183
- l = l.parentNode;
187
+ let c = r;
188
+ for (; c && c !== n; ) {
189
+ const l = i === "previous" ? c.previousSibling : c.nextSibling;
190
+ if (l) return l;
191
+ c = c.parentNode;
184
192
  }
185
193
  return null;
186
194
  };
187
195
  if (r.nodeType === Node.ELEMENT_NODE) {
188
- const a = r;
189
- return t === "Backspace" && o > 0 ? i(a.childNodes[o - 1] || null) : t === "Delete" ? i(a.childNodes[o] || null) : null;
196
+ const i = r;
197
+ return t === "Backspace" && o > 0 ? a(i.childNodes[o - 1] || null) : t === "Delete" ? a(i.childNodes[o] || null) : null;
190
198
  }
191
199
  if (r.nodeType === Node.TEXT_NODE) {
192
- const a = r;
200
+ const i = r;
193
201
  if (t === "Backspace" && o === 0) {
194
- const l = i(a.previousSibling);
195
- return l || i(s("previous"));
202
+ const c = a(i.previousSibling);
203
+ return c || a(s("previous"));
196
204
  }
197
- if (t === "Delete" && o === a.data.length) {
198
- const l = i(a.nextSibling);
199
- return l || i(s("next"));
205
+ if (t === "Delete" && o === i.data.length) {
206
+ const c = a(i.nextSibling);
207
+ return c || a(s("next"));
200
208
  }
201
209
  }
202
- return i(s(t === "Backspace" ? "previous" : "next"));
203
- }, E = (e, n) => {
204
- const t = e.closest(g), r = e.previousSibling, o = e.nextSibling;
210
+ return a(s(t === "Backspace" ? "previous" : "next"));
211
+ }, C = (e, n) => {
212
+ var c;
213
+ const t = e.closest(g), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
205
214
  e.remove();
206
- const i = f(r, "previous"), s = f(o, "next");
215
+ const s = f(o, "previous"), i = f(a, "next");
207
216
  if (n === "Backspace") {
208
- if (i)
209
- b(i);
210
- else if (s)
211
- d(s);
217
+ if (s)
218
+ b(s);
219
+ else if (i)
220
+ d(i);
212
221
  else if (t) {
213
- const a = document.createElement("p");
214
- a.innerHTML = "<br>", t.appendChild(a), d(a);
222
+ const l = document.createElement("p");
223
+ l.innerHTML = "<br>", t.appendChild(l), d(l);
215
224
  }
216
- } else if (s)
217
- d(s);
218
- else if (i)
219
- b(i);
225
+ } else if (i)
226
+ d(i);
227
+ else if (s)
228
+ b(s);
220
229
  else if (t) {
221
- const a = document.createElement("p");
222
- a.innerHTML = "<br>", t.appendChild(a), d(a);
230
+ const l = document.createElement("p");
231
+ l.innerHTML = "<br>", t.appendChild(l), d(l);
223
232
  }
224
- return t && t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
225
- }, R = () => {
226
- const e = h();
233
+ return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
234
+ }, y = () => {
235
+ const e = k();
227
236
  if (!e) return !1;
228
- const n = window.getSelection();
229
- if (!n) return !1;
230
- let t;
231
- 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));
232
- const r = C(t.endContainer, e) || C(t.startContainer, e), o = w();
233
- r && r.parentNode ? r.parentNode.insertBefore(o, r.nextSibling) : e.appendChild(o), S(o);
234
- const i = k(o);
235
- return d(i), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
237
+ const n = e.innerHTML, t = window.getSelection();
238
+ if (!t) return !1;
239
+ let r;
240
+ t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
241
+ const o = E(r.endContainer, e) || E(r.startContainer, e), a = T();
242
+ o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
243
+ const s = x(a);
244
+ return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
236
245
  }, B = () => {
237
246
  m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
238
247
  const n = e.target, t = n == null ? void 0 : n.closest(u);
239
- t && (e.preventDefault(), e.stopPropagation(), A(t));
248
+ t && (e.preventDefault(), e.stopPropagation(), L(t));
240
249
  }), document.addEventListener("keydown", (e) => {
241
250
  const n = e.key;
242
251
  if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
243
252
  return;
244
253
  const t = window.getSelection();
245
254
  if (!t || t.rangeCount === 0) return;
246
- const r = t.getRangeAt(0), o = h();
255
+ const r = t.getRangeAt(0), o = k();
247
256
  if (!o || !o.contains(r.commonAncestorContainer)) return;
248
- const i = L(r);
249
- if (i) {
257
+ const a = A(r);
258
+ if (a) {
250
259
  if (n === "Backspace" || n === "Delete") {
251
- e.preventDefault(), e.stopPropagation(), E(i, n);
260
+ e.preventDefault(), e.stopPropagation(), C(a, n);
252
261
  return;
253
262
  }
254
263
  if (n === "ArrowRight" || n === "ArrowDown") {
255
264
  e.preventDefault();
256
- const s = f(i.nextSibling, "next") || k(i);
265
+ const s = f(a.nextSibling, "next") || x(a);
257
266
  d(s);
258
267
  return;
259
268
  }
260
269
  if (n === "ArrowLeft" || n === "ArrowUp") {
261
270
  e.preventDefault();
262
- const s = f(i.previousSibling, "previous");
271
+ const s = f(a.previousSibling, "previous");
263
272
  s ? b(s) : d(o);
264
273
  return;
265
274
  }
266
275
  }
267
276
  if (n === "Backspace" || n === "Delete") {
268
- const s = T(
277
+ const s = R(
269
278
  r,
270
279
  o,
271
280
  n
272
281
  );
273
282
  if (!s) return;
274
- e.preventDefault(), e.stopPropagation(), E(s, n);
283
+ e.preventDefault(), e.stopPropagation(), C(s, n);
275
284
  }
276
285
  }));
277
- }, D = () => (x(), B(), {
286
+ }, D = () => (w(), B(), {
278
287
  name: "pageBreak",
279
288
  toolbar: [
280
289
  {
@@ -285,7 +294,7 @@ const v = /* @__PURE__ */ new Set([
285
294
  }
286
295
  ],
287
296
  commands: {
288
- insertPageBreak: R
297
+ insertPageBreak: y
289
298
  },
290
299
  keymap: {
291
300
  "Mod-Enter": "insertPageBreak"
@@ -294,4 +303,4 @@ const v = /* @__PURE__ */ new Set([
294
303
  export {
295
304
  D as PageBreakPlugin
296
305
  };
297
- //# sourceMappingURL=PageBreakPlugin.native-CGiQxXqR.mjs.map
306
+ //# sourceMappingURL=PageBreakPlugin.native-CXdX5fAv.mjs.map
@@ -1,4 +1,4 @@
1
- const u = {
1
+ const m = {
2
2
  all: {
3
3
  name: "All",
4
4
  characters: [
@@ -389,7 +389,7 @@ const u = {
389
389
  name: "Arrows",
390
390
  characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
391
391
  }
392
- }, f = {
392
+ }, k = {
393
393
  "€": "euro",
394
394
  "£": "pound",
395
395
  "¥": "yen",
@@ -438,16 +438,16 @@ const u = {
438
438
  "↓": "down arrow",
439
439
  "↔": "left right arrow"
440
440
  };
441
- let g = !1;
442
- const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
441
+ let v = !1;
442
+ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
443
443
  const a = window.getSelection();
444
444
  if (!a || a.rangeCount === 0) return null;
445
- const e = a.anchorNode, r = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
446
- return (r == null ? void 0 : r.closest(".rte-content, .editora-content")) || null;
447
- }, v = (a) => {
448
- const e = a || m();
449
- return e ? !!e.closest(x) : !1;
450
- }, y = () => {
445
+ const e = a.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
446
+ return (t == null ? void 0 : t.closest(".rte-content, .editora-content")) || null;
447
+ }, z = (a) => {
448
+ const e = a || w();
449
+ return e ? !!e.closest(E) : !1;
450
+ }, C = () => {
451
451
  if (typeof document == "undefined") return;
452
452
  const a = "special-characters-plugin-styles";
453
453
  if (document.getElementById(a)) return;
@@ -464,6 +464,26 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
464
464
  --rte-sc-accent: #1f75fe;
465
465
  --rte-sc-accent-strong: #165fd6;
466
466
  --rte-sc-ring: rgba(31, 117, 254, 0.18);
467
+ --rte-picker-dialog-width: min(640px, 96vw);
468
+ --rte-picker-dialog-max-height: min(560px, 86vh);
469
+ --rte-picker-dialog-radius: 12px;
470
+ --rte-picker-search-wrap-padding: 12px;
471
+ --rte-picker-search-height: 38px;
472
+ --rte-picker-search-font-size: 13px;
473
+ --rte-picker-search-radius: 8px;
474
+ --rte-picker-tabs-width: 156px;
475
+ --rte-picker-tab-padding-y: 10px;
476
+ --rte-picker-tab-padding-x: 12px;
477
+ --rte-picker-tab-font-size: 13px;
478
+ --rte-picker-grid-padding: 12px;
479
+ --rte-picker-grid-gap: 6px;
480
+ --rte-picker-cell-size: 34px;
481
+ --rte-picker-cell-font-size: 17px;
482
+ --rte-picker-cell-radius: 7px;
483
+ --rte-picker-mobile-tab-min-width: 82px;
484
+ --rte-picker-mobile-cell-size: 32px;
485
+ --rte-picker-mobile-grid-gap: 5px;
486
+ --rte-picker-mobile-dialog-max-height: 88vh;
467
487
  position: fixed;
468
488
  top: 0;
469
489
  left: 0;
@@ -496,11 +516,10 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
496
516
  background: var(--rte-sc-dialog-bg);
497
517
  color: var(--rte-sc-dialog-text);
498
518
  border: 1px solid var(--rte-sc-border);
499
- border-radius: 12px;
519
+ border-radius: var(--rte-picker-dialog-radius);
500
520
  box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
501
- max-width: 800px;
502
- width: 90%;
503
- max-height: 80vh;
521
+ width: var(--rte-picker-dialog-width);
522
+ max-height: var(--rte-picker-dialog-max-height);
504
523
  display: flex;
505
524
  flex-direction: column;
506
525
  overflow: hidden;
@@ -554,18 +573,20 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
554
573
  display: flex;
555
574
  flex-direction: column;
556
575
  overflow: hidden;
576
+ min-width: 0;
557
577
  }
558
578
 
559
579
  .special-characters-search {
560
- padding: 16px 16px 0 16px;
580
+ padding: var(--rte-picker-search-wrap-padding) var(--rte-picker-search-wrap-padding) 0 var(--rte-picker-search-wrap-padding);
561
581
  }
562
582
 
563
583
  .special-characters-search-input {
564
584
  width: 100%;
565
- padding: 10px 12px;
585
+ height: var(--rte-picker-search-height);
586
+ padding: 8px 12px;
566
587
  border: 1px solid var(--rte-sc-border);
567
- border-radius: 8px;
568
- font-size: 14px;
588
+ border-radius: var(--rte-picker-search-radius);
589
+ font-size: var(--rte-picker-search-font-size);
569
590
  color: var(--rte-sc-dialog-text);
570
591
  background-color: var(--rte-sc-subtle-bg);
571
592
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
@@ -585,21 +606,23 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
585
606
  .special-characters-tabs {
586
607
  display: flex;
587
608
  flex-direction: column;
588
- width: 180px;
609
+ width: var(--rte-picker-tabs-width);
589
610
  border-right: 1px solid var(--rte-sc-border);
590
611
  background-color: var(--rte-sc-subtle-bg);
612
+ overflow-y: auto;
591
613
  }
592
614
 
593
615
  .special-characters-tab {
594
- padding: 12px 16px;
616
+ padding: var(--rte-picker-tab-padding-y) var(--rte-picker-tab-padding-x);
595
617
  border: none;
596
618
  background: none;
597
619
  text-align: left;
598
620
  cursor: pointer;
599
- font-size: 14px;
621
+ font-size: var(--rte-picker-tab-font-size);
600
622
  color: var(--rte-sc-muted-text);
601
623
  border-bottom: 1px solid var(--rte-sc-border);
602
624
  transition: all 0.2s ease;
625
+ line-height: 1.25;
603
626
  }
604
627
 
605
628
  .special-characters-tab:hover {
@@ -614,24 +637,25 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
614
637
  }
615
638
 
616
639
  .special-characters-grid {
617
- padding: 16px;
640
+ padding: var(--rte-picker-grid-padding);
618
641
  overflow-y: auto;
619
642
  display: grid;
620
- grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
621
- gap: 8px;
643
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-cell-size), 1fr));
644
+ gap: var(--rte-picker-grid-gap);
645
+ contain: content;
622
646
  }
623
647
 
624
648
  .special-characters-item {
625
- width: 40px;
626
- height: 40px;
649
+ width: var(--rte-picker-cell-size);
650
+ height: var(--rte-picker-cell-size);
627
651
  display: flex;
628
652
  align-items: center;
629
653
  justify-content: center;
630
654
  border: 1px solid var(--rte-sc-border);
631
655
  background: var(--rte-sc-subtle-bg);
632
- border-radius: 8px;
656
+ border-radius: var(--rte-picker-cell-radius);
633
657
  cursor: pointer;
634
- font-size: 18px;
658
+ font-size: var(--rte-picker-cell-font-size);
635
659
  transition: all 0.2s ease;
636
660
  color: var(--rte-sc-dialog-text);
637
661
  }
@@ -660,8 +684,8 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
660
684
 
661
685
  @media (max-width: 768px) {
662
686
  .special-characters-dialog {
663
- width: 95%;
664
- max-height: 90vh;
687
+ width: 96%;
688
+ max-height: var(--rte-picker-mobile-dialog-max-height);
665
689
  }
666
690
 
667
691
  .special-characters-content {
@@ -680,83 +704,104 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
680
704
  border-bottom: none;
681
705
  border-right: 1px solid var(--rte-sc-border);
682
706
  white-space: nowrap;
707
+ min-width: var(--rte-picker-mobile-tab-min-width);
708
+ }
709
+
710
+ .special-characters-grid {
711
+ grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-mobile-cell-size), 1fr));
712
+ gap: var(--rte-picker-mobile-grid-gap);
713
+ }
714
+
715
+ .special-characters-item {
716
+ width: var(--rte-picker-mobile-cell-size);
717
+ height: var(--rte-picker-mobile-cell-size);
718
+ font-size: 16px;
683
719
  }
684
720
  }
685
721
  `, document.head.appendChild(e);
686
- }, w = (a) => {
722
+ }, L = (a) => {
687
723
  const e = window.getSelection();
688
724
  if (e && e.rangeCount > 0) {
689
- const r = e.getRangeAt(0);
690
- r.deleteContents();
725
+ const t = e.getRangeAt(0);
726
+ t.deleteContents();
691
727
  const c = document.createTextNode(a);
692
- r.insertNode(c), r.setStartAfter(c), r.setEndAfter(c), e.removeAllRanges(), e.addRange(r);
728
+ t.insertNode(c), t.setStartAfter(c), t.setEndAfter(c), e.removeAllRanges(), e.addRange(t);
693
729
  }
694
- }, k = (a) => {
695
- if (typeof window == "undefined" || g) return;
696
- g = !0, y();
697
- let e = "all", r = "";
698
- const c = document.createElement("div");
699
- c.className = "special-characters-overlay", v(a) && c.classList.add("rte-ui-theme-dark");
730
+ }, S = (a) => {
731
+ if (typeof window == "undefined" || v) return;
732
+ v = !0, C();
733
+ let e = "all", t = "", c = null;
734
+ const i = document.createElement("div");
735
+ i.className = "special-characters-overlay", z(a) && i.classList.add("rte-ui-theme-dark");
700
736
  const s = document.createElement("div");
701
- s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true");
702
- const d = () => {
703
- const o = u[e].characters.filter((t) => {
704
- if (!r.trim()) return !0;
705
- const i = r.toLowerCase();
706
- return t.toLowerCase().includes(i) || (f[t] || "").toLowerCase().includes(i);
707
- });
708
- s.innerHTML = `
709
- <div class="special-characters-header">
710
- <h2>Insert Special Characters</h2>
711
- <button class="special-characters-close">×</button>
737
+ s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
738
+ <div class="special-characters-header">
739
+ <h2>Insert Special Characters</h2>
740
+ <button class="special-characters-close">×</button>
741
+ </div>
742
+ <div class="special-characters-content">
743
+ <div class="special-characters-tabs">
744
+ ${Object.keys(m).map((r) => `
745
+ <button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
746
+ ${m[r].name}
747
+ </button>
748
+ `).join("")}
712
749
  </div>
713
- <div class="special-characters-content">
714
- <div class="special-characters-tabs">
715
- ${Object.keys(u).map((t) => `
716
- <button class="special-characters-tab ${e === t ? "active" : ""}" data-category="${t}">
717
- ${u[t].name}
718
- </button>
719
- `).join("")}
720
- </div>
721
- <div class="special-characters-main-content">
722
- <div class="special-characters-search">
723
- <input type="text" placeholder="Search characters..." value="${r}" class="special-characters-search-input">
724
- </div>
725
- <div class="special-characters-grid">
726
- ${o.length > 0 ? o.map((t) => `
727
- <button class="special-characters-item" data-char="${t}" title="${f[t] || t}">
728
- ${t}
729
- </button>
730
- `).join("") : `<div class="special-characters-no-results">No characters found for "${r}"</div>`}
731
- </div>
750
+ <div class="special-characters-main-content">
751
+ <div class="special-characters-search">
752
+ <input
753
+ type="text"
754
+ placeholder="Search characters..."
755
+ class="special-characters-search-input"
756
+ >
732
757
  </div>
758
+ <div class="special-characters-grid"></div>
733
759
  </div>
734
- `;
735
- const p = s.querySelector(".special-characters-close");
736
- p == null || p.addEventListener("click", l), s.querySelectorAll(".special-characters-tab").forEach((t) => {
737
- t.addEventListener("click", (i) => {
738
- const n = i.target.getAttribute("data-category");
739
- n && (e = n, d());
740
- });
741
- });
742
- const h = s.querySelector(".special-characters-search-input");
743
- h == null || h.addEventListener("input", (t) => {
744
- r = t.target.value, d();
745
- }), s.querySelectorAll(".special-characters-item").forEach((t) => {
746
- t.addEventListener("click", (i) => {
747
- const n = i.target.getAttribute("data-char");
748
- n && (w(n), l());
749
- });
760
+ </div>
761
+ `;
762
+ const l = s.querySelector(".special-characters-tabs"), n = s.querySelector(".special-characters-grid"), d = s.querySelector(".special-characters-search-input"), u = s.querySelector(".special-characters-close"), y = () => m[e].characters.filter((r) => {
763
+ if (!t.trim()) return !0;
764
+ const o = t.toLowerCase();
765
+ return r.toLowerCase().includes(o) || (k[r] || "").toLowerCase().includes(o);
766
+ }), f = () => {
767
+ l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
768
+ r.classList.toggle("active", r.getAttribute("data-category") === e);
750
769
  });
751
- }, l = () => {
752
- c.parentNode && c.parentNode.removeChild(c), g = !1, document.removeEventListener("keydown", b);
753
- }, b = (o) => {
754
- o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), l());
770
+ }, b = () => {
771
+ if (!n) return;
772
+ const r = y();
773
+ if (r.length === 0) {
774
+ n.innerHTML = `<div class="special-characters-no-results">No characters found for "${t}"</div>`;
775
+ return;
776
+ }
777
+ n.innerHTML = r.map((o) => `
778
+ <button class="special-characters-item" data-char="${o}" title="${k[o] || o}">
779
+ ${o}
780
+ </button>
781
+ `).join("");
782
+ }, g = () => {
783
+ c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", x, !0);
784
+ }, x = (r) => {
785
+ r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
755
786
  };
756
- c.addEventListener("click", (o) => {
757
- o.target === c && l();
758
- }), document.addEventListener("keydown", b), d(), c.appendChild(s), document.body.appendChild(c);
759
- }, C = () => ({
787
+ u == null || u.addEventListener("click", g), l == null || l.addEventListener("click", (r) => {
788
+ const h = r.target.closest(".special-characters-tab");
789
+ if (!h) return;
790
+ const p = h.getAttribute("data-category");
791
+ !p || e === p || (e = p, f(), b());
792
+ }), d == null || d.addEventListener("input", (r) => {
793
+ t = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
794
+ c = null, b();
795
+ }, 90);
796
+ }), n == null || n.addEventListener("click", (r) => {
797
+ const h = r.target.closest(".special-characters-item");
798
+ if (!h) return;
799
+ const p = h.getAttribute("data-char");
800
+ p && (L(p), g());
801
+ }), i.addEventListener("click", (r) => {
802
+ r.target === i && g();
803
+ }), document.addEventListener("keydown", x, !0), f(), b(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => d == null ? void 0 : d.focus());
804
+ }, q = () => ({
760
805
  name: "specialCharacters",
761
806
  toolbar: [{
762
807
  label: "Special Characters",
@@ -765,13 +810,13 @@ const x = '[data-theme="dark"], .dark, .editora-theme-dark', m = () => {
765
810
  }],
766
811
  commands: {
767
812
  insertSpecialCharacter: (a, e) => {
768
- const r = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : m();
769
- return k(r), !0;
813
+ const t = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : w();
814
+ return S(t), !0;
770
815
  }
771
816
  },
772
817
  keymap: {}
773
818
  });
774
819
  export {
775
- C as SpecialCharactersPlugin
820
+ q as SpecialCharactersPlugin
776
821
  };
777
- //# sourceMappingURL=SpecialCharactersPlugin.native-DANrbExJ.mjs.map
822
+ //# sourceMappingURL=SpecialCharactersPlugin.native-CZDato89.mjs.map