@editora/core 1.0.23 → 1.0.25

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 (67) hide show
  1. package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
  2. package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
  3. package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
  4. package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
  5. package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
  6. package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
  7. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  8. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-CRpX2G93.mjs} +167 -113
  9. package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
  10. package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
  11. package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
  12. package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
  13. package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
  14. package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-CaBqCH-p.mjs} +21 -20
  15. package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
  16. package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
  17. package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
  18. package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
  19. package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
  20. package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
  21. package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
  22. package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
  23. package/dist/MediaManagerPlugin.native-0YFHZfsb.mjs +4823 -0
  24. package/dist/MediaManagerPlugin.native-mXWWARRX.mjs +4908 -0
  25. package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
  26. package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
  27. package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
  28. package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
  29. package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
  30. package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
  31. package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
  32. package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
  33. package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
  34. package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
  35. package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
  36. package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
  37. package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
  38. package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
  39. package/dist/confirmDialog-CNqPHT5x.mjs +92 -0
  40. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  41. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-DHLCoWzw.mjs} +1963 -1969
  42. package/dist/editora.min.js +21 -21
  43. package/dist/editora.umd.js +10 -10
  44. package/dist/index-DHPPVQwx.js +12 -0
  45. package/dist/{index-DGMYWPLx.mjs → index-gI4djib2.mjs} +407 -327
  46. package/dist/index.cjs.js +1 -1
  47. package/dist/index.esm.js +2 -2
  48. package/dist/katex-DLIObQUm.mjs +11683 -0
  49. package/dist/katex.min--Ws3c9be.mjs +6 -0
  50. package/dist/notify-DCQGpmq-.mjs +60 -0
  51. package/dist/plugin-loader.js +54 -54
  52. package/dist/shared-config-DuA34Iii.mjs +26 -0
  53. package/dist/webcomponent-core.js +315 -235
  54. package/dist/webcomponent-core.min.css +1 -1
  55. package/dist/webcomponent-core.min.js +153 -80
  56. package/dist/webcomponent.cjs.js +1 -1
  57. package/dist/webcomponent.esm.js +1 -1
  58. package/dist/webcomponent.js +672 -592
  59. package/dist/webcomponent.min.css +1 -1
  60. package/dist/webcomponent.min.js +3099 -1532
  61. package/package.json +1 -1
  62. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  63. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  64. package/dist/MediaManagerPlugin.native-BT1NZIJS.mjs +0 -998
  65. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  66. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
  67. package/dist/index-C1sO7DAC.js +0 -12
@@ -1,5 +1,5 @@
1
1
  import { e as z } from "./escapeHtml-CX8RelZ1.mjs";
2
- import { i as F } from "./dialogHelpers-DBf7WqYH.mjs";
2
+ import { i as F } from "./dialogHelpers-Dzn8DHoF.mjs";
3
3
  import { p as I } from "./purify.es-BHa5gZB7.mjs";
4
4
  let n = null, d = null, f = null, o = null, h = "", v = "", T = "insert", E = null, c = null, b = null;
5
5
  function M(t, e) {
@@ -371,6 +371,7 @@ function ee() {
371
371
  --rte-tmpl-subtle-hover: #eef2f7;
372
372
  --rte-tmpl-muted-text: #5f6b7d;
373
373
  --rte-tmpl-accent: #1976d2;
374
+ --rte-tmpl-accent-fill: #1976d2;
374
375
  --rte-tmpl-accent-strong: #1565c0;
375
376
  --rte-tmpl-ring: rgba(31, 117, 254, 0.18);
376
377
  position: fixed;
@@ -396,7 +397,8 @@ function ee() {
396
397
  --rte-tmpl-subtle-hover: #344256;
397
398
  --rte-tmpl-muted-text: #a5b1c5;
398
399
  --rte-tmpl-accent: #58a6ff;
399
- --rte-tmpl-accent-strong: #4598f4;
400
+ --rte-tmpl-accent-fill: #1f6feb;
401
+ --rte-tmpl-accent-strong: #1a5fd0;
400
402
  --rte-tmpl-ring: rgba(88, 166, 255, 0.22);
401
403
  }
402
404
  .rte-template-dialog {
@@ -574,7 +576,7 @@ function ee() {
574
576
  border-radius: 4px;
575
577
  font-size: 14px;
576
578
  cursor: pointer;
577
- background-color: var(--rte-tmpl-accent);
579
+ background-color: var(--rte-tmpl-accent-fill);
578
580
  color: white;
579
581
  transition: all 0.2s;
580
582
  }
@@ -625,4 +627,4 @@ export {
625
627
  O as searchTemplates,
626
628
  le as validateTemplate
627
629
  };
628
- //# sourceMappingURL=TemplatePlugin.native-Dwk8TgxI.mjs.map
630
+ //# sourceMappingURL=TemplatePlugin.native-OD8Wc1R7.mjs.map
@@ -1,6 +1,7 @@
1
- import { a as v, b as w } from "./anchoredPopover-DJFD2oAP.mjs";
2
- let l = null, d = null, x = null, i = "#000000";
3
- const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
1
+ import { a as v, b as w } from "./anchoredPopover-QN4jNbW1.mjs";
2
+ import { r as C } from "./dialogHelpers-Dzn8DHoF.mjs";
3
+ let n = null, d = null, b = null, i = "#000000";
4
+ const u = '[data-theme="dark"], .dark, .editora-theme-dark', E = [
4
5
  "#000000",
5
6
  "#ffffff",
6
7
  "#808080",
@@ -14,12 +15,12 @@ const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
14
15
  "#800080",
15
16
  "#ffc0cb"
16
17
  ];
17
- function y() {
18
+ function m() {
18
19
  const e = window.getSelection();
19
20
  if (e && e.rangeCount > 0) {
20
- const c = e.getRangeAt(0).startContainer, n = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
21
- if (n) {
22
- const r = n.closest(
21
+ const c = e.getRangeAt(0).startContainer, l = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
22
+ if (l) {
23
+ const r = l.closest(
23
24
  '[data-editora-editor="true"], .rte-editor, .editora-editor'
24
25
  );
25
26
  if (r) return r;
@@ -30,7 +31,7 @@ function y() {
30
31
  '[data-editora-editor="true"], .rte-editor, .editora-editor'
31
32
  ) : null;
32
33
  }
33
- function E(e) {
34
+ function T(e) {
34
35
  const o = window.__editoraLastCommand, t = window.__editoraLastCommandButton;
35
36
  if (o === e && t && t.isConnected) {
36
37
  const a = window.getComputedStyle(t), s = t.getBoundingClientRect();
@@ -39,15 +40,15 @@ function E(e) {
39
40
  }
40
41
  const c = (a) => {
41
42
  for (const s of a) {
42
- const b = window.getComputedStyle(s), m = s.getBoundingClientRect();
43
- if (!(b.display === "none" || b.visibility === "hidden" || b.pointerEvents === "none") && !(m.width === 0 && m.height === 0))
43
+ const g = window.getComputedStyle(s), h = s.getBoundingClientRect();
44
+ if (!(g.display === "none" || g.visibility === "hidden" || g.pointerEvents === "none") && !(h.width === 0 && h.height === 0))
44
45
  return s;
45
46
  }
46
47
  return null;
47
- }, n = y();
48
- if (n) {
48
+ }, l = m();
49
+ if (l) {
49
50
  const a = Array.from(
50
- n.querySelectorAll(`[data-command="${e}"]`)
51
+ l.querySelectorAll(`[data-command="${e}"]`)
51
52
  ), s = c(a);
52
53
  if (s) return s;
53
54
  }
@@ -60,8 +61,8 @@ function S(e) {
60
61
  if (e != null && e.closest(u)) return !0;
61
62
  const o = window.getSelection();
62
63
  if (o && o.rangeCount > 0) {
63
- const c = o.getRangeAt(0).startContainer, n = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
64
- if (n != null && n.closest(u)) return !0;
64
+ const c = o.getRangeAt(0).startContainer, l = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
65
+ if (l != null && l.closest(u)) return !0;
65
66
  }
66
67
  const t = document.activeElement;
67
68
  return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
@@ -72,38 +73,38 @@ function f(e) {
72
73
  className: "rte-text-color",
73
74
  styleProperty: "color",
74
75
  commands: ["foreColor"],
75
- savedRange: x,
76
- getActiveEditorRoot: y,
76
+ savedRange: b,
77
+ getActiveEditorRoot: m,
77
78
  warnMessage: "[TextColor] Could not apply color for current selection"
78
79
  });
79
80
  }
80
- function T() {
81
+ function A() {
81
82
  const e = window.getSelection();
82
83
  if (!e || e.rangeCount === 0) return "#000000";
83
84
  let t = e.getRangeAt(0).startContainer;
84
85
  for (; t && t !== document.body; ) {
85
86
  if (t.nodeType === Node.ELEMENT_NODE) {
86
- const c = t, n = c.style.color || window.getComputedStyle(c).color;
87
- if (n && n !== "rgb(0, 0, 0)")
88
- return A(n);
87
+ const c = t, l = c.style.color || window.getComputedStyle(c).color;
88
+ if (l && l !== "rgb(0, 0, 0)")
89
+ return L(l);
89
90
  }
90
91
  t = t.parentNode;
91
92
  }
92
93
  return "#000000";
93
94
  }
94
- function A(e) {
95
+ function L(e) {
95
96
  if (e.startsWith("#")) return e;
96
97
  const o = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
97
98
  if (!o) return "#000000";
98
- const t = parseInt(o[1]), c = parseInt(o[2]), n = parseInt(o[3]);
99
- return "#" + [t, c, n].map((r) => {
99
+ const t = parseInt(o[1]), c = parseInt(o[2]), l = parseInt(o[3]);
100
+ return "#" + [t, c, l].map((r) => {
100
101
  const a = r.toString(16);
101
102
  return a.length === 1 ? "0" + a : a;
102
103
  }).join("");
103
104
  }
104
- function L(e) {
105
+ function P(e) {
105
106
  const o = window.getSelection();
106
- o && o.rangeCount > 0 && (x = o.getRangeAt(0).cloneRange()), i = T(), l = document.createElement("div"), l.className = "rte-inline-color-picker", S(e) && l.classList.add("rte-theme-dark"), l.addEventListener("click", (t) => t.stopPropagation()), l.innerHTML = `
107
+ o && o.rangeCount > 0 && (b = o.getRangeAt(0).cloneRange()), i = A(), n = document.createElement("div"), n.className = "rte-inline-color-picker", S(e) && n.classList.add("rte-theme-dark"), n.addEventListener("click", (t) => t.stopPropagation()), n.innerHTML = `
107
108
  <div class="rte-color-picker-header">
108
109
  <span class="rte-color-picker-title">Text Color</span>
109
110
  <button class="rte-color-picker-close" aria-label="Close">×</button>
@@ -120,7 +121,7 @@ function L(e) {
120
121
  <div class="rte-color-section">
121
122
  <label class="rte-color-section-label">Colors</label>
122
123
  <div class="rte-color-palette">
123
- ${C.map((t) => `
124
+ ${E.map((t) => `
124
125
  <button
125
126
  class="rte-color-swatch ${i === t ? "selected" : ""}"
126
127
  style="background-color: ${t}; ${t === "#ffffff" ? "border: 1px solid #ccc;" : ""}"
@@ -153,72 +154,75 @@ function L(e) {
153
154
  </div>
154
155
  </div>
155
156
  </div>
156
- `, document.body.appendChild(l), d && (d.destroy(), d = null), d = w({
157
- popover: l,
157
+ `, document.body.appendChild(n), d && (d.destroy(), d = null), d = w({
158
+ popover: n,
158
159
  anchor: e,
159
160
  onClose: p,
160
161
  gap: 4,
161
162
  margin: 8,
162
- zIndex: 1e4
163
- }), P();
163
+ zIndex: 1e4,
164
+ label: "Text color",
165
+ initialFocus: ".rte-color-swatch.selected, .rte-color-swatch"
166
+ }), $();
164
167
  }
165
- function P() {
166
- if (!l) return;
167
- const e = l.querySelector(".rte-color-picker-close");
168
- e == null || e.addEventListener("click", () => p()), l.querySelectorAll(".rte-color-swatch").forEach((n) => {
169
- n.addEventListener("click", () => {
170
- const r = n.getAttribute("data-color");
168
+ function $() {
169
+ if (!n) return;
170
+ const e = n.querySelector(".rte-color-picker-close");
171
+ e == null || e.addEventListener("click", () => p()), n.querySelectorAll(".rte-color-swatch").forEach((l) => {
172
+ l.addEventListener("click", () => {
173
+ const r = l.getAttribute("data-color");
171
174
  r && (i = r, f(r), p());
172
175
  });
173
176
  });
174
- const t = l.querySelector(".rte-color-input-native");
175
- t == null || t.addEventListener("change", (n) => {
176
- const r = n.target.value;
177
+ const t = n.querySelector(".rte-color-input-native");
178
+ t == null || t.addEventListener("change", (l) => {
179
+ const r = l.target.value;
177
180
  i = r, f(r), p();
178
181
  });
179
- const c = l.querySelector(".rte-color-input-text");
180
- c == null || c.addEventListener("change", (n) => {
181
- const r = n.target.value;
182
+ const c = n.querySelector(".rte-color-input-text");
183
+ c == null || c.addEventListener("change", (l) => {
184
+ const r = l.target.value;
182
185
  /^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, f(r), p());
183
- }), t == null || t.addEventListener("input", (n) => {
184
- const r = n.target.value;
185
- i = r, h(r), k(r), _(r);
186
- }), c == null || c.addEventListener("input", (n) => {
187
- const r = n.target.value;
188
- /^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, h(r), k(r), $(r));
186
+ }), t == null || t.addEventListener("input", (l) => {
187
+ const r = l.target.value;
188
+ i = r, k(r), y(r), _(r);
189
+ }), c == null || c.addEventListener("input", (l) => {
190
+ const r = l.target.value;
191
+ /^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, k(r), y(r), R(r));
189
192
  });
190
193
  }
191
- function h(e) {
192
- if (!l) return;
193
- const o = l.querySelector(".rte-color-preview-box"), t = l.querySelector(".rte-color-preview-label");
194
+ function k(e) {
195
+ if (!n) return;
196
+ const o = n.querySelector(".rte-color-preview-box"), t = n.querySelector(".rte-color-preview-label");
194
197
  o && (o.style.backgroundColor = e, o.style.border = e === "#ffffff" ? "1px solid #ccc" : "none"), t && (t.textContent = e.toUpperCase());
195
198
  }
196
- function k(e) {
197
- if (!l) return;
198
- l.querySelectorAll(".rte-color-swatch").forEach((t) => {
199
+ function y(e) {
200
+ if (!n) return;
201
+ n.querySelectorAll(".rte-color-swatch").forEach((t) => {
199
202
  t.getAttribute("data-color") === e ? t.classList.add("selected") : t.classList.remove("selected");
200
203
  });
201
204
  }
202
- function $(e) {
203
- if (!l) return;
204
- const o = l.querySelector(".rte-color-input-native");
205
+ function R(e) {
206
+ if (!n) return;
207
+ const o = n.querySelector(".rte-color-input-native");
205
208
  o && (o.value = e);
206
209
  }
207
210
  function _(e) {
208
- if (!l) return;
209
- const o = l.querySelector(".rte-color-input-text");
211
+ if (!n) return;
212
+ const o = n.querySelector(".rte-color-input-text");
210
213
  o && (o.value = e);
211
214
  }
212
215
  function p() {
213
- d && (d.destroy(), d = null), l && (l.remove(), l = null), x = null;
216
+ const e = !!n && n.contains(document.activeElement), o = b, t = e ? m() : null;
217
+ d && (d.destroy(), d = null), n && (n.remove(), n = null), b = null, e && C(t, o);
214
218
  }
215
- function R() {
216
- if (g(), l)
219
+ function N() {
220
+ if (x(), n)
217
221
  return p(), !0;
218
- const e = E("openTextColorPicker");
219
- return e ? (L(e), !0) : !1;
222
+ const e = T("openTextColorPicker");
223
+ return e ? (P(e), !0) : !1;
220
224
  }
221
- function g() {
225
+ function x() {
222
226
  if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, !document.getElementById("text-color-plugin-styles"))) {
223
227
  const e = document.createElement("style");
224
228
  e.id = "text-color-plugin-styles", e.textContent = `
@@ -473,8 +477,8 @@ function g() {
473
477
  `, document.head.appendChild(e);
474
478
  }
475
479
  }
476
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", g) : setTimeout(g, 100);
477
- const M = () => ({
480
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", x) : setTimeout(x, 100);
481
+ const z = () => ({
478
482
  name: "textColor",
479
483
  marks: {
480
484
  textColor: {
@@ -518,12 +522,12 @@ const M = () => ({
518
522
  }
519
523
  ],
520
524
  commands: {
521
- openTextColorPicker: () => R(),
525
+ openTextColorPicker: () => N(),
522
526
  setTextColor: (e) => e ? f(e) : !1
523
527
  },
524
528
  keymap: {}
525
529
  });
526
530
  export {
527
- M as TextColorPlugin
531
+ z as TextColorPlugin
528
532
  };
529
- //# sourceMappingURL=TextColorPlugin.native-KMZ2uzlq.mjs.map
533
+ //# sourceMappingURL=TextColorPlugin.native-C2IjioNM.mjs.map