@editora/core 1.0.14 → 1.0.16

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 (73) hide show
  1. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
  2. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
  3. package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
  4. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
  5. package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
  6. package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
  7. package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
  8. package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
  9. package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
  10. package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
  11. package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
  12. package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
  13. package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
  14. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
  15. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
  16. package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
  17. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
  18. package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
  19. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
  20. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
  21. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
  22. package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
  23. package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
  24. package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
  25. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
  26. package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
  27. package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
  28. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
  29. package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
  30. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
  31. package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
  32. package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
  33. package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
  34. package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
  35. package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
  36. package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
  37. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
  38. package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
  39. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
  40. package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
  41. package/dist/core.css +1 -1
  42. package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
  43. package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
  44. package/dist/editora.min.js +26 -24
  45. package/dist/editora.umd.js +26 -24
  46. package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
  47. package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
  48. package/dist/index-B1_vtXRz.mjs +3910 -0
  49. package/dist/index-C6BoNR2t.js +12 -0
  50. package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
  51. package/dist/index.cjs.js +3 -3
  52. package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
  53. package/dist/index.esm.js +17 -14
  54. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
  55. package/dist/plugin-loader.js +53 -52
  56. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
  57. package/dist/webcomponent-core.js +2039 -473
  58. package/dist/webcomponent-core.min.css +1 -1
  59. package/dist/webcomponent-core.min.js +100 -70
  60. package/dist/webcomponent.cjs.js +1 -1
  61. package/dist/webcomponent.esm.js +1 -1
  62. package/dist/webcomponent.js +2208 -641
  63. package/dist/webcomponent.min.css +1 -1
  64. package/dist/webcomponent.min.js +1575 -1209
  65. package/index.d.ts +32 -0
  66. package/package.json +10 -3
  67. package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
  68. package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
  69. package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
  70. package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
  71. package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
  72. package/dist/index-B9MPiUAR.mjs +0 -2341
  73. package/dist/index-BLm1MtzH.js +0 -10
@@ -1,4 +1,5 @@
1
- const T = () => ({
1
+ import { r as u } from "./historyHelpers-B0-4mq1E.mjs";
2
+ const S = () => ({
2
3
  name: "clearFormatting",
3
4
  // Toolbar button configuration
4
5
  toolbar: [
@@ -15,21 +16,21 @@ const T = () => ({
15
16
  * Remove all formatting from current selection
16
17
  */
17
18
  clearFormatting: () => {
18
- const t = h();
19
+ const t = m();
19
20
  if (!t) return !1;
20
21
  const e = window.getSelection();
21
22
  if (!e || e.rangeCount === 0) return !1;
22
23
  const n = e.getRangeAt(0);
23
24
  if (!t.contains(n.commonAncestorContainer)) return !1;
24
- const r = n.cloneRange();
25
- return t.focus({ preventScroll: !0 }), C(t, r), y(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
25
+ const r = n.cloneRange(), o = t.innerHTML;
26
+ return t.focus({ preventScroll: !0 }), C(t, r), T(t, r), u(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
26
27
  }
27
28
  },
28
29
  // Keyboard shortcuts
29
30
  keymap: {
30
31
  "Mod-\\": "clearFormatting"
31
32
  }
32
- }), u = /* @__PURE__ */ new Set([
33
+ }), d = /* @__PURE__ */ new Set([
33
34
  "A",
34
35
  "B",
35
36
  "STRONG",
@@ -44,7 +45,7 @@ const T = () => ({
44
45
  "CODE",
45
46
  "SUB",
46
47
  "SUP"
47
- ]), d = /* @__PURE__ */ new Set([
48
+ ]), g = /* @__PURE__ */ new Set([
48
49
  "H1",
49
50
  "H2",
50
51
  "H3",
@@ -53,7 +54,7 @@ const T = () => ({
53
54
  "H6",
54
55
  "BLOCKQUOTE",
55
56
  "PRE"
56
- ]), g = [
57
+ ]), h = [
57
58
  "color",
58
59
  "background-color",
59
60
  "font-size",
@@ -69,7 +70,7 @@ const T = () => ({
69
70
  "text-align",
70
71
  "padding-left"
71
72
  ];
72
- function h() {
73
+ function m() {
73
74
  const t = window.getSelection();
74
75
  if (t && t.rangeCount > 0) {
75
76
  const n = t.getRangeAt(0).startContainer, r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, o = r == null ? void 0 : r.closest('[contenteditable="true"], .rte-content, .editora-content');
@@ -93,8 +94,8 @@ function a(t) {
93
94
  e += 1, n = n.parentNode;
94
95
  return e;
95
96
  }
96
- function m(t) {
97
- g.forEach((e) => {
97
+ function E(t) {
98
+ h.forEach((e) => {
98
99
  t.style.removeProperty(e);
99
100
  }), (!t.getAttribute("style") || t.style.length === 0) && t.removeAttribute("style"), t.classList.contains("rte-text-color") && t.classList.remove("rte-text-color"), t.classList.contains("rte-bg-color") && t.classList.remove("rte-bg-color"), t.classList.contains("rte-format-painted") && t.classList.remove("rte-format-painted"), t.classList.length === 0 && t.removeAttribute("class");
100
101
  }
@@ -106,12 +107,12 @@ function i(t) {
106
107
  e.removeChild(t);
107
108
  }
108
109
  }
109
- function E(t) {
110
+ function p(t) {
110
111
  return t.tagName !== "P" || t.attributes.length > 0 || (t.textContent || "").trim() !== "" ? !1 : !t.querySelector("img, video, table, iframe, hr, pre, ul, ol");
111
112
  }
112
113
  function l(t) {
113
114
  Array.from(t.children).forEach((e) => {
114
- E(e) && e.remove();
115
+ p(e) && e.remove();
115
116
  });
116
117
  }
117
118
  function s(t) {
@@ -126,17 +127,17 @@ function f(t) {
126
127
  e.appendChild(t.firstChild);
127
128
  e.innerHTML.trim() || (e.innerHTML = "<br>"), (n = t.parentNode) == null || n.replaceChild(e, t);
128
129
  }
129
- function p(t) {
130
+ function N(t) {
130
131
  return !/^(A|B|STRONG|I|EM|U|S|STRIKE|DEL|FONT|MARK|CODE|SUB|SUP|SPAN)$/.test(t.tagName) || (t.textContent || "").trim() !== "" ? !1 : !t.querySelector("img, video, table, iframe, hr, svg, math");
131
132
  }
132
- function N(t) {
133
+ function A(t) {
133
134
  Array.from(
134
135
  t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span")
135
136
  ).sort((n, r) => a(r) - a(n)).forEach((n) => {
136
- n.isConnected && p(n) && n.remove();
137
+ n.isConnected && N(n) && n.remove();
137
138
  });
138
139
  }
139
- function A(t) {
140
+ function y(t) {
140
141
  if (l(t), t.parentElement instanceof HTMLLIElement) {
141
142
  s(t);
142
143
  return;
@@ -147,13 +148,13 @@ function A(t) {
147
148
  }
148
149
  f(t);
149
150
  }
150
- function y(t, e) {
151
+ function T(t, e) {
151
152
  Array.from(
152
153
  t.querySelectorAll("h1,h2,h3,h4,h5,h6,blockquote,pre")
153
154
  ).forEach((r) => {
154
- if (c(e, r) && d.has(r.tagName)) {
155
+ if (c(e, r) && g.has(r.tagName)) {
155
156
  if (r.tagName === "BLOCKQUOTE") {
156
- A(r);
157
+ y(r);
157
158
  return;
158
159
  }
159
160
  f(r);
@@ -168,15 +169,15 @@ function C(t, e) {
168
169
  );
169
170
  n.sort((r, o) => a(o) - a(r)), n.forEach((r) => {
170
171
  if (r.isConnected && c(e, r) && !(r.getAttribute("contenteditable") === "false" || r.closest('[contenteditable="false"]'))) {
171
- if (m(r), u.has(r.tagName)) {
172
+ if (E(r), d.has(r.tagName)) {
172
173
  i(r);
173
174
  return;
174
175
  }
175
176
  r.tagName === "SPAN" && r.attributes.length === 0 && i(r);
176
177
  }
177
- }), N(t);
178
+ }), A(t);
178
179
  }
179
180
  export {
180
- T as ClearFormattingPlugin
181
+ S as ClearFormattingPlugin
181
182
  };
182
- //# sourceMappingURL=ClearFormattingPlugin.native-B6ro3a1h.mjs.map
183
+ //# sourceMappingURL=ClearFormattingPlugin.native-Pp0O-SBf.mjs.map