@editora/core 1.0.8 → 1.0.9

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