@editora/core 1.0.9 → 1.0.10

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 (99) hide show
  1. package/README.md +1 -1
  2. package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
  3. package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
  4. package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
  5. package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
  6. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  7. package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
  8. package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  9. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  10. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  11. package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
  12. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  13. package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
  14. package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
  15. package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
  16. package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
  17. package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
  18. package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
  19. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  20. package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
  21. package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
  22. package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
  23. package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
  24. package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
  25. package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
  26. package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
  27. package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
  28. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  29. package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
  30. package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
  31. package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  32. package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
  33. package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
  34. package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
  35. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  36. package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
  37. package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
  38. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  39. package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
  40. package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
  41. package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
  42. package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
  43. package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
  44. package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
  45. package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
  46. package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
  47. package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
  48. package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
  49. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  50. package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
  51. package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
  52. package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
  53. package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
  54. package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  55. package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
  56. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  57. package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
  58. package/dist/core.css +1 -0
  59. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  60. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
  61. package/dist/editora.min.js +13 -14
  62. package/dist/editora.umd.js +13 -14
  63. package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
  64. package/dist/index-BslAFzmv.mjs +16544 -0
  65. package/dist/index-CPMGUZfB.js +10 -0
  66. package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.es-BYD2KEo6.mjs +6666 -0
  69. package/dist/index.esm.js +7 -12
  70. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  71. package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
  72. package/dist/plugin-loader.js +67 -67
  73. package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
  74. package/dist/webcomponent-core.js +131 -168
  75. package/dist/webcomponent-core.min.css +1 -1
  76. package/dist/webcomponent-core.min.js +139 -63
  77. package/dist/webcomponent.cjs.js +1 -1
  78. package/dist/webcomponent.esm.js +1 -1
  79. package/dist/webcomponent.js +191 -228
  80. package/dist/webcomponent.min.css +1 -1
  81. package/dist/webcomponent.min.js +1240 -1344
  82. package/package.json +1 -1
  83. package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
  84. package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
  85. package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
  86. package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
  87. package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
  88. package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
  89. package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
  90. package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
  91. package/dist/MathPlugin.native-735bbac2.mjs +0 -296
  92. package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
  93. package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
  94. package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
  95. package/dist/documentManager-8327fb6e.mjs +0 -9166
  96. package/dist/index-072ef022.js +0 -11
  97. package/dist/index-49d31221.mjs +0 -16860
  98. package/dist/index.es-b47a189f.mjs +0 -5782
  99. package/dist/style.css +0 -1
@@ -16,19 +16,16 @@ const T = () => {
16
16
  if (l.getAttribute("contenteditable") === "true")
17
17
  return l;
18
18
  const t = l.closest('[contenteditable="true"]');
19
- if (t)
20
- return t;
19
+ if (t) return t;
21
20
  }
22
21
  return document.querySelector('[contenteditable="true"]');
23
22
  }, k = '[data-theme="dark"], .dark, .editora-theme-dark', A = () => {
24
23
  const d = T();
25
- if (d != null && d.closest(k))
26
- return !0;
24
+ if (d != null && d.closest(k)) return !0;
27
25
  const l = window.getSelection();
28
26
  if (l && l.rangeCount > 0) {
29
27
  const a = l.getRangeAt(0).startContainer, i = a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement;
30
- if (i != null && i.closest(k))
31
- return !0;
28
+ if (i != null && i.closest(k)) return !0;
32
29
  }
33
30
  const t = document.activeElement;
34
31
  return t != null && t.closest(k) ? !0 : document.body.matches(k) || document.documentElement.matches(k);
@@ -255,20 +252,16 @@ function $(d, l, t, a) {
255
252
  return document.body.appendChild(c), setTimeout(() => E.focus(), 100), c;
256
253
  }
257
254
  function R() {
258
- if (!T())
259
- return;
255
+ if (!T()) return;
260
256
  let l = null;
261
257
  const t = window.getSelection();
262
258
  t && t.rangeCount > 0 && (l = t.getRangeAt(0).cloneRange()), $((a, i) => {
263
259
  const n = window.getSelection();
264
- if (l && (n == null || n.removeAllRanges(), n == null || n.addRange(l)), !n || n.rangeCount === 0)
265
- return;
260
+ if (l && (n == null || n.removeAllRanges(), n == null || n.addRange(l)), !n || n.rangeCount === 0) return;
266
261
  const f = T();
267
- if (!f)
268
- return;
262
+ if (!f) return;
269
263
  const p = n.anchorNode;
270
- if (!p || !f.contains(p))
271
- return;
264
+ if (!p || !f.contains(p)) return;
272
265
  const e = n.getRangeAt(0), c = `code-block-${Date.now()}`, o = document.createElement("pre");
273
266
  o.className = "rte-code-block", o.id = c, o.setAttribute("data-type", "code-block"), o.setAttribute("data-lang", i), o.setAttribute("data-code-id", c), o.setAttribute("contenteditable", "false"), o.style.cssText = `
274
267
  display: block;
@@ -347,11 +340,9 @@ function R() {
347
340
  }
348
341
  function z(d) {
349
342
  const l = T();
350
- if (!l)
351
- return;
343
+ if (!l) return;
352
344
  const t = l.querySelector(`#${d}`);
353
- if (!t)
354
- return;
345
+ if (!t) return;
355
346
  const a = S.get(d);
356
347
  a && $(
357
348
  (i, n) => {
@@ -390,4 +381,4 @@ const H = () => ({
390
381
  export {
391
382
  H as CodeSamplePlugin
392
383
  };
393
- //# sourceMappingURL=CodeSamplePlugin.native-6cc0148e.mjs.map
384
+ //# sourceMappingURL=CodeSamplePlugin.native-CgGoH-X4.mjs.map
@@ -5,15 +5,13 @@ function v(e) {
5
5
  return k += 1, `${e}-${Date.now()}-${k}`;
6
6
  }
7
7
  function y(e) {
8
- if (!e)
9
- return null;
8
+ if (!e) return null;
10
9
  const t = e instanceof Element ? e : e.parentElement;
11
10
  return t ? t.closest("[data-editora-editor]") || t.closest(".rte-editor") || t.closest(".editora-editor") : null;
12
11
  }
13
12
  function A(e) {
14
13
  const t = (e == null ? void 0 : e.editorElement) || (e == null ? void 0 : e.contentElement) || null;
15
- if (!(t instanceof HTMLElement))
16
- return;
14
+ if (!(t instanceof HTMLElement)) return;
17
15
  const r = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
18
16
  r && (x = r);
19
17
  }
@@ -30,22 +28,19 @@ function $() {
30
28
  }
31
29
  }
32
30
  const e = document.activeElement, t = e ? y(e) : null;
33
- if (t)
34
- return t;
31
+ if (t) return t;
35
32
  const r = window.getSelection();
36
33
  if (r && r.rangeCount > 0) {
37
34
  const o = y(
38
35
  r.getRangeAt(0).commonAncestorContainer
39
36
  );
40
- if (o)
41
- return o;
37
+ if (o) return o;
42
38
  }
43
39
  return x;
44
40
  }
45
41
  function q(e) {
46
42
  const t = C.get(e);
47
- if (t)
48
- return t;
43
+ if (t) return t;
49
44
  const r = {
50
45
  root: e,
51
46
  comments: /* @__PURE__ */ new Map(),
@@ -65,21 +60,18 @@ function u() {
65
60
  }
66
61
  function R(e) {
67
62
  const t = window.getSelection();
68
- if (!t || t.rangeCount === 0 || t.isCollapsed)
69
- return null;
63
+ if (!t || t.rangeCount === 0 || t.isCollapsed) return null;
70
64
  const r = t.getRangeAt(0);
71
65
  return w(r, e) ? r.cloneRange() : null;
72
66
  }
73
67
  function I(e, t) {
74
- if (!t.anchorId)
75
- return;
68
+ if (!t.anchorId) return;
76
69
  const r = e.root.querySelector(`#${t.anchorId}`);
77
70
  r && r.classList.toggle("rte-comment-anchor-resolved", t.resolved);
78
71
  }
79
72
  function b(e, t, r) {
80
73
  const o = e.comments.get(t);
81
- if (!o || !o.anchorId)
82
- return;
74
+ if (!o || !o.anchorId) return;
83
75
  const a = e.root.querySelector(`#${o.anchorId}`);
84
76
  a && a.classList.toggle("highlighted", r);
85
77
  }
@@ -104,16 +96,14 @@ function h(e, t) {
104
96
  e.root.removeAttribute("data-rte-comments-open"), M(e), e.panelElement && (e.panelElement.remove(), e.panelElement = null);
105
97
  }
106
98
  function V(e) {
107
- if (e.panelElement)
108
- return;
99
+ if (e.panelElement) return;
109
100
  const t = document.createElement("aside");
110
101
  t.className = "rte-comments-panel", t.setAttribute("role", "complementary"), t.setAttribute("aria-label", "Comments"), t.setAttribute("aria-hidden", "true"), window.getComputedStyle(e.root).position === "static" && (e.root.style.position = "relative"), e.root.appendChild(t), e.panelElement = t;
111
102
  }
112
103
  function B(e) {
113
104
  e.selectionChangeListener || (e.selectionChangeListener = () => {
114
105
  const t = window.getSelection();
115
- if (!t || t.rangeCount === 0 || t.isCollapsed)
116
- return;
106
+ if (!t || t.rangeCount === 0 || t.isCollapsed) return;
117
107
  const r = t.getRangeAt(0);
118
108
  w(r, e.root) && (e.savedSelection = r.cloneRange(), x = e.root);
119
109
  }, document.addEventListener("selectionchange", e.selectionChangeListener));
@@ -216,8 +206,7 @@ function D(e, t) {
216
206
  }
217
207
  function m(e) {
218
208
  const t = e || u();
219
- if (!(t != null && t.panelElement))
220
- return;
209
+ if (!(t != null && t.panelElement)) return;
221
210
  const r = H(t);
222
211
  t.panelElement.innerHTML = `
223
212
  <div class="rte-comments-header">
@@ -256,8 +245,7 @@ function m(e) {
256
245
  (c.ctrlKey || c.metaKey) && c.key === "Enter" && (c.preventDefault(), i.click());
257
246
  }), i.addEventListener("click", () => {
258
247
  const c = a.value.trim();
259
- if (!c)
260
- return;
248
+ if (!c) return;
261
249
  const n = !!t.savedSelection;
262
250
  O(E, c, !n), t.newCommentText = "", m(t);
263
251
  });
@@ -273,19 +261,16 @@ function T() {
273
261
  t && (x = t);
274
262
  }), document.addEventListener("selectionchange", () => {
275
263
  const e = window.getSelection();
276
- if (!e || e.rangeCount === 0)
277
- return;
264
+ if (!e || e.rangeCount === 0) return;
278
265
  const t = e.getRangeAt(0), r = y(t.commonAncestorContainer);
279
- if (!r)
280
- return;
266
+ if (!r) return;
281
267
  x = r;
282
268
  const o = C.get(r);
283
269
  !o || e.isCollapsed || w(t, r) && (o.savedSelection = t.cloneRange());
284
270
  }), document.addEventListener(
285
271
  "keydown",
286
272
  (e) => {
287
- if (e.key !== "Escape")
288
- return;
273
+ if (e.key !== "Escape") return;
289
274
  const t = u();
290
275
  !t || !t.panelVisible || (e.preventDefault(), e.stopPropagation(), h(t, !1));
291
276
  },
@@ -299,11 +284,9 @@ function K() {
299
284
  function O(e, t, r = !1) {
300
285
  var p;
301
286
  const o = u();
302
- if (!o)
303
- return "";
287
+ if (!o) return "";
304
288
  const a = t.trim();
305
- if (!a)
306
- return "";
289
+ if (!a) return "";
307
290
  if (r) {
308
291
  const d = v("comment");
309
292
  return o.comments.set(d, {
@@ -318,17 +301,14 @@ function O(e, t, r = !1) {
318
301
  }), m(o), d;
319
302
  }
320
303
  const i = o.savedSelection || R(o.root);
321
- if (!i || !w(i, o.root))
322
- return "";
304
+ if (!i || !w(i, o.root)) return "";
323
305
  const f = i.toString().trim();
324
- if (!f)
325
- return "";
306
+ if (!f) return "";
326
307
  const l = v("comment"), c = v("comment-anchor"), n = document.createElement("span");
327
308
  n.id = c, n.className = "rte-comment-anchor", n.setAttribute("data-comment-id", l), n.setAttribute("title", "Commented text");
328
309
  try {
329
310
  const d = i.cloneRange(), g = d.extractContents();
330
- if (!((p = g.textContent) != null && p.trim()))
331
- return "";
311
+ if (!((p = g.textContent) != null && p.trim())) return "";
332
312
  n.appendChild(g), d.insertNode(n);
333
313
  } catch (d) {
334
314
  return "";
@@ -348,22 +328,19 @@ function O(e, t, r = !1) {
348
328
  }
349
329
  function P(e, t) {
350
330
  const r = u();
351
- if (!r)
352
- return;
331
+ if (!r) return;
353
332
  const o = r.comments.get(e);
354
333
  o && (o.resolved = !0, o.resolvedBy = t, o.resolvedAt = (/* @__PURE__ */ new Date()).toISOString(), I(r, o), m(r));
355
334
  }
356
335
  function _(e) {
357
336
  const t = u();
358
- if (!t)
359
- return;
337
+ if (!t) return;
360
338
  const r = t.comments.get(e);
361
339
  r && (r.resolved = !1, r.resolvedBy = void 0, r.resolvedAt = void 0, I(t, r), m(t));
362
340
  }
363
341
  function j(e) {
364
342
  const t = u();
365
- if (!t)
366
- return;
343
+ if (!t) return;
367
344
  const r = t.comments.get(e);
368
345
  if (r) {
369
346
  if (r.anchorId) {
@@ -375,11 +352,9 @@ function j(e) {
375
352
  }
376
353
  function F(e, t, r) {
377
354
  const o = u();
378
- if (!o)
379
- return;
355
+ if (!o) return;
380
356
  const a = o.comments.get(e);
381
- if (!a)
382
- return;
357
+ if (!a) return;
383
358
  const i = r.trim();
384
359
  i && (a.replies.push({
385
360
  id: v("reply"),
@@ -393,8 +368,7 @@ function U(e, t) {
393
368
  r && b(r, e, t);
394
369
  }
395
370
  function Z() {
396
- if (document.getElementById("rte-comments-panel-styles"))
397
- return;
371
+ if (document.getElementById("rte-comments-panel-styles")) return;
398
372
  const e = document.createElement("style");
399
373
  e.id = "rte-comments-panel-styles", e.textContent = `
400
374
  .rte-comments-panel {
@@ -735,8 +709,7 @@ const X = () => ({
735
709
  var a;
736
710
  A(t), T();
737
711
  const r = u();
738
- if (!r)
739
- return !1;
712
+ if (!r) return !1;
740
713
  if (r.savedSelection = R(r.root), r.savedSelection) {
741
714
  const i = window.getSelection();
742
715
  i == null || i.removeAllRanges();
@@ -765,4 +738,4 @@ export {
765
738
  F as replyToComment,
766
739
  P as resolveComment
767
740
  };
768
- //# sourceMappingURL=CommentsPlugin.native-03659874.mjs.map
741
+ //# sourceMappingURL=CommentsPlugin.native-DPSqTkiv.mjs.map