@editora/core 1.0.23 → 1.0.24

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 (64) 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-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
  8. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  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-tZqIa9o5.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-BjrEarV6.mjs +1161 -0
  24. package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
  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-BP8hZPpX.mjs +112 -0
  40. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  41. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
  42. package/dist/editora.min.js +21 -21
  43. package/dist/editora.umd.js +10 -10
  44. package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
  45. package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
  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/webcomponent-core.js +305 -234
  53. package/dist/webcomponent-core.min.css +1 -1
  54. package/dist/webcomponent-core.min.js +153 -80
  55. package/dist/webcomponent.cjs.js +1 -1
  56. package/dist/webcomponent.esm.js +1 -1
  57. package/dist/webcomponent.js +631 -560
  58. package/dist/webcomponent.min.css +1 -1
  59. package/dist/webcomponent.min.js +1677 -1328
  60. package/package.json +1 -1
  61. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  62. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  63. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  64. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editora/core",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Framework-agnostic rich text editor core for React and web apps, built for enterprise editing workflows.",
5
5
  "author": "Ajay Kumar <ajaykr089@gmail.com>",
6
6
  "license": "MIT",
@@ -1,246 +0,0 @@
1
- const S = ".rte-content, .editora-content";
2
- const y = "__editoraCommandEditorRoot", d = /* @__PURE__ */ new Map(), m = {};
3
- let T = !1, c = null;
4
- function R(t) {
5
- if (!t) return null;
6
- const e = t.querySelector('[contenteditable="true"]');
7
- return e instanceof HTMLElement ? e : null;
8
- }
9
- function I() {
10
- if (typeof window == "undefined") return null;
11
- const t = window[y];
12
- if (!(t instanceof HTMLElement)) return null;
13
- window[y] = null;
14
- const e = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
15
- if (e) {
16
- const o = R(e);
17
- if (o) return o;
18
- if (e.getAttribute("contenteditable") === "true") return e;
19
- }
20
- if (t.getAttribute("contenteditable") === "true")
21
- return t;
22
- const n = t.closest('[contenteditable="true"]');
23
- return n instanceof HTMLElement ? n : null;
24
- }
25
- function N(t) {
26
- return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
27
- }
28
- function s(t) {
29
- const e = N(t);
30
- if (!e) return null;
31
- const n = e.closest(S);
32
- if (n) return n;
33
- const o = e.closest('[contenteditable="true"]');
34
- if (!o) return null;
35
- let r = o, i = r.parentElement;
36
- for (; i; )
37
- i.getAttribute("contenteditable") === "true" && (r = i), i = i.parentElement;
38
- return r;
39
- }
40
- function M() {
41
- const t = I();
42
- if (t && document.contains(t))
43
- return t;
44
- const e = window.getSelection();
45
- if (e && e.rangeCount > 0) {
46
- const i = s(e.getRangeAt(0).startContainer);
47
- if (i) return i;
48
- }
49
- const n = document.activeElement;
50
- if (n) {
51
- const i = s(n);
52
- if (i) return i;
53
- }
54
- if (c != null && c.isConnected) return c;
55
- const o = Array.from(d.keys()).find((i) => i.isConnected);
56
- if (o) return o;
57
- const r = document.querySelector(S);
58
- return r || document.querySelector('[contenteditable="true"]');
59
- }
60
- function A() {
61
- for (const t of d.keys())
62
- t.isConnected || (d.delete(t), c === t && (c = null));
63
- }
64
- function f(t) {
65
- A();
66
- let e = d.get(t);
67
- return e || (e = { undoStack: [], redoStack: [] }, d.set(t, e)), e;
68
- }
69
- function a(t) {
70
- t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
71
- }
72
- function l(t, e) {
73
- if (!t) return;
74
- const n = f(t);
75
- n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
76
- }
77
- function h(t, e = "undo") {
78
- if (A(), t != null && t.isConnected)
79
- return t;
80
- const n = M();
81
- if (n != null && n.isConnected)
82
- return n;
83
- if (c != null && c.isConnected)
84
- return c;
85
- const o = (r) => e === "undo" ? r.undoStack.length > 0 : r.redoStack.length > 0;
86
- for (const [r, i] of d.entries())
87
- if (r.isConnected && o(i))
88
- return r;
89
- return null;
90
- }
91
- function g(t) {
92
- const e = {};
93
- for (const r of t.getAttributeNames()) {
94
- const i = t.getAttribute(r);
95
- i !== null && (e[r] = i);
96
- }
97
- const n = t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement, o = t instanceof HTMLInputElement;
98
- return {
99
- attributes: e,
100
- innerHTML: t.innerHTML,
101
- value: n ? t.value : null,
102
- checked: o ? t.checked : null
103
- };
104
- }
105
- function w(t, e) {
106
- const n = new Set(t.getAttributeNames());
107
- Object.keys(e.attributes).forEach((o) => n.delete(o)), n.forEach((o) => t.removeAttribute(o)), Object.entries(e.attributes).forEach(([o, r]) => {
108
- t.setAttribute(o, r);
109
- }), t.innerHTML !== e.innerHTML && (t.innerHTML = e.innerHTML), e.value !== null && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && (t.value = e.value), e.checked !== null && t instanceof HTMLInputElement && (t.checked = e.checked);
110
- }
111
- function u(t, e) {
112
- if (m[t] = e, typeof window == "undefined") return;
113
- const n = window.registerEditorCommand;
114
- typeof n == "function" ? n(t, e) : (window.registerEditorCommand = (o, r) => {
115
- m[o] = r;
116
- }, window.registerEditorCommand(t, e));
117
- }
118
- const H = (t, ...e) => {
119
- const n = m[t];
120
- return n ? n(...e) : !1;
121
- };
122
- function E() {
123
- T || typeof window == "undefined" || (T = !0, window.execEditorCommand || (window.execEditorCommand = H), window.executeEditorCommand || (window.executeEditorCommand = H), u("undo", L), u("redo", k), u("setAttribute", x), u("setText", v), u("autoFixA11y", O), u("recordDomTransaction", D), u("undoDom", C), u("redoDom", b));
124
- }
125
- const L = () => {
126
- const t = M();
127
- return C(t != null ? t : void 0);
128
- }, k = () => {
129
- const t = M();
130
- return b(t != null ? t : void 0);
131
- }, x = (t, e, n) => {
132
- if (!(t instanceof HTMLElement)) return;
133
- const o = s(t), r = t.hasAttribute(e), i = t.getAttribute(e);
134
- t.setAttribute(e, n), l(o, {
135
- undo: () => {
136
- t.isConnected && (r && i !== null ? t.setAttribute(e, i) : t.removeAttribute(e));
137
- },
138
- redo: () => {
139
- t.isConnected && t.setAttribute(e, n);
140
- }
141
- }), a(o);
142
- }, v = (t, e) => {
143
- var r;
144
- if (!(t instanceof HTMLElement)) return;
145
- const n = s(t), o = (r = t.textContent) != null ? r : "";
146
- t.textContent = e, l(n, {
147
- undo: () => {
148
- t.isConnected && (t.textContent = o);
149
- },
150
- redo: () => {
151
- t.isConnected && (t.textContent = e);
152
- }
153
- }), a(n);
154
- }, O = (t) => {
155
- var p;
156
- const e = t == null ? void 0 : t.element;
157
- if (!(e instanceof HTMLElement)) return;
158
- const n = s(e), o = (p = window.a11yRuleRegistry) == null ? void 0 : p.find((_) => _.id === t.rule);
159
- if (!o || typeof o.fix != "function") return;
160
- const r = g(e);
161
- o.fix(t);
162
- const i = g(e);
163
- l(n, {
164
- undo: () => {
165
- e.isConnected && w(e, r);
166
- },
167
- redo: () => {
168
- e.isConnected && w(e, i);
169
- }
170
- }), a(n);
171
- }, D = (t, e, n) => {
172
- if (!(t instanceof HTMLElement)) return !1;
173
- const o = typeof n == "string" ? n : t.innerHTML;
174
- if (e === o) return !1;
175
- const r = f(t).undoStack.slice(-1)[0];
176
- return r && r.beforeHTML === e && r.afterHTML === o ? !1 : (l(t, {
177
- beforeHTML: e,
178
- afterHTML: o,
179
- undo: () => {
180
- t.isConnected && (t.innerHTML = e);
181
- },
182
- redo: () => {
183
- t.isConnected && (t.innerHTML = o);
184
- }
185
- }), !0);
186
- }, C = (t) => {
187
- const e = h(t, "undo");
188
- if (!e) return !1;
189
- const n = f(e), o = n.undoStack.pop();
190
- return o ? (o.undo(), n.redoStack.push(o), c = e, a(e), !0) : !1;
191
- }, b = (t) => {
192
- const e = h(t, "redo");
193
- if (!e) return !1;
194
- const n = f(e), o = n.redoStack.pop();
195
- return o ? (o.redo(), n.undoStack.push(o), c = e, a(e), !0) : !1;
196
- };
197
- typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", E, { once: !0 }) : E());
198
- const z = () => (E(), {
199
- name: "history",
200
- toolbar: [
201
- {
202
- label: "Undo",
203
- command: "undo",
204
- type: "button",
205
- icon: '<svg width="24" height="24" focusable="false"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"></path></svg>',
206
- shortcut: "Mod-z"
207
- },
208
- {
209
- label: "Redo",
210
- command: "redo",
211
- type: "button",
212
- icon: '<svg width="24" height="24" focusable="false"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"></path></svg>',
213
- shortcut: "Mod-y"
214
- }
215
- ],
216
- commands: {
217
- undo: L,
218
- redo: k,
219
- setAttribute: x,
220
- setText: v,
221
- autoFixA11y: O,
222
- recordDomTransaction: D,
223
- undoDom: C,
224
- redoDom: b
225
- },
226
- keymap: {
227
- "Mod-z": "undo",
228
- "Mod-Z": "undo",
229
- "Mod-y": "redo",
230
- "Mod-Y": "redo",
231
- "Mod-Shift-z": "redo",
232
- "Mod-Shift-Z": "redo"
233
- }
234
- });
235
- export {
236
- z as HistoryPlugin,
237
- O as autoFixA11y,
238
- D as recordDomTransaction,
239
- k as redo,
240
- b as redoDom,
241
- x as setAttribute,
242
- v as setText,
243
- L as undo,
244
- C as undoDom
245
- };
246
- //# sourceMappingURL=HistoryPlugin.native-DPvhks6h.mjs.map
@@ -1,139 +0,0 @@
1
- import { r as f } from "./historyHelpers-B0-4mq1E.mjs";
2
- const d = () => m("insertUnorderedList"), u = () => m("insertOrderedList");
3
- function g() {
4
- const o = window.getSelection();
5
- if (o && o.rangeCount > 0) {
6
- const e = o.getRangeAt(0).startContainer, r = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, n = r == null ? void 0 : r.closest('[contenteditable="true"], .rte-content, .editora-content');
7
- if (n) return n;
8
- }
9
- const t = document.activeElement;
10
- return t ? t.getAttribute("contenteditable") === "true" ? t : t.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
11
- }
12
- function p(o) {
13
- o.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach((e) => {
14
- Array.from(e.childNodes).forEach((n) => {
15
- if (n.nodeType === Node.TEXT_NODE) {
16
- const l = (n.textContent || "").trim();
17
- if (!l) {
18
- e.removeChild(n);
19
- return;
20
- }
21
- const s = document.createElement("li");
22
- s.textContent = l, e.replaceChild(s, n);
23
- return;
24
- }
25
- if (!(n instanceof HTMLElement)) {
26
- e.removeChild(n);
27
- return;
28
- }
29
- if (n.tagName === "LI")
30
- return;
31
- const i = document.createElement("li");
32
- for (; n.firstChild; )
33
- i.appendChild(n.firstChild);
34
- e.replaceChild(i, n);
35
- });
36
- });
37
- }
38
- const h = /* @__PURE__ */ new Set([
39
- "P",
40
- "DIV",
41
- "UL",
42
- "OL",
43
- "LI",
44
- "BLOCKQUOTE",
45
- "H1",
46
- "H2",
47
- "H3",
48
- "H4",
49
- "H5",
50
- "H6",
51
- "TABLE",
52
- "PRE",
53
- "FIGURE",
54
- "SECTION",
55
- "ARTICLE",
56
- "HEADER",
57
- "FOOTER"
58
- ]);
59
- function E(o) {
60
- let t = null;
61
- Array.from(o.childNodes).forEach((e) => {
62
- if (e.nodeType === Node.ELEMENT_NODE && h.has(e.tagName)) {
63
- t = null;
64
- return;
65
- }
66
- e.nodeType === Node.TEXT_NODE && !(e.textContent || "").trim() || (t || (t = document.createElement("p"), o.insertBefore(t, e)), t.appendChild(e));
67
- });
68
- }
69
- function m(o) {
70
- const t = g();
71
- if (!t) return !1;
72
- const e = window.getSelection();
73
- if (!e || e.rangeCount === 0) return !1;
74
- const r = e.getRangeAt(0);
75
- if (!t.contains(r.commonAncestorContainer)) return !1;
76
- const n = t.innerHTML;
77
- t.focus({ preventScroll: !0 });
78
- const i = document.execCommand(o, !1);
79
- return p(t), E(t), f(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 })), i !== !1;
80
- }
81
- const a = (o, t) => {
82
- var e;
83
- typeof window != "undefined" && ((e = window.registerEditorCommand) == null || e.call(window, o, t));
84
- }, c = () => {
85
- a("toggleBulletList", d), a("toggleOrderedList", u);
86
- };
87
- typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", c) : c());
88
- const C = () => ({
89
- name: "list",
90
- nodes: {
91
- bulletList: {
92
- content: "listItem+",
93
- group: "block",
94
- parseDOM: [{ tag: "ul" }],
95
- toDOM: () => ["ul", 0]
96
- },
97
- orderedList: {
98
- content: "listItem+",
99
- group: "block",
100
- parseDOM: [{ tag: "ol" }],
101
- toDOM: () => ["ol", 0]
102
- },
103
- listItem: {
104
- content: "paragraph",
105
- parseDOM: [{ tag: "li" }],
106
- toDOM: () => ["li", 0]
107
- }
108
- },
109
- toolbar: [
110
- {
111
- label: "Bullet List",
112
- command: "toggleBulletList",
113
- type: "button",
114
- icon: '<svg width="24" height="24" focusable="false"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Z" fill-rule="evenodd"></path></svg>',
115
- shortcut: "Mod-Shift-8"
116
- },
117
- {
118
- label: "Numbered List",
119
- command: "toggleOrderedList",
120
- type: "button",
121
- icon: '<svg width="24" height="24" focusable="false"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0 0-.2l-.7.3a.5.5 0 0 1-.7-.3.5.5 0 0 1 .3-.6l.7-.4c.5-.2 1.1 0 1.4.4.3.5.3 1.1-.1 1.5l-1.2.7Zm0 3.7v.5c0 .3.2.5.5.5h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1.5 1.5 0 0 1-1.5-1.5v-.5c0-.3.1-.6.3-.8l1.3-1.4c.3-.4.1-.9-.2-1-.1 0-.2 0-.3.2l-.4.5a.5.5 0 0 1-.7.1.5.5 0 0 1-.1-.7l.4-.5c.5-.5 1.2-.6 1.8-.4.6.3 1 .9 1 1.6 0 .4-.2.8-.5 1.1l-1.3 1.4-.3.4Z" fill-rule="evenodd"></path></svg>',
122
- shortcut: "Mod-Shift-7"
123
- }
124
- ],
125
- commands: {
126
- toggleBulletList: d,
127
- toggleOrderedList: u
128
- },
129
- keymap: {
130
- "Mod-Shift-8": "toggleBulletList",
131
- "Mod-Shift-7": "toggleOrderedList"
132
- }
133
- });
134
- export {
135
- C as ListPlugin,
136
- d as toggleBulletList,
137
- u as toggleOrderedList
138
- };
139
- //# sourceMappingURL=ListPlugin.native-Bt0LANbO.mjs.map
@@ -1,116 +0,0 @@
1
- import { r as b } from "./historyHelpers-B0-4mq1E.mjs";
2
- const A = "p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";
3
- function p(e) {
4
- return !!e.cloneContents().querySelector(A);
5
- }
6
- function m(e, n) {
7
- var o, r;
8
- const t = (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE ? e : (o = e == null ? void 0 : e.parentElement) != null ? o : null;
9
- return (t == null ? void 0 : t.closest('[contenteditable="true"]')) || ((r = n()) == null ? void 0 : r.querySelector('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
10
- }
11
- function v(e, n) {
12
- const t = m(e, n);
13
- t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
14
- }
15
- function S(e, n) {
16
- let o = e.startContainer.nodeType === Node.TEXT_NODE ? e.startContainer.parentElement : e.startContainer;
17
- for (; o && o !== document.body; ) {
18
- if (o.classList.contains(n)) {
19
- const r = document.createRange();
20
- if (r.selectNodeContents(o), r.compareBoundaryPoints(Range.START_TO_START, e) <= 0 && r.compareBoundaryPoints(Range.END_TO_END, e) >= 0)
21
- return o;
22
- }
23
- o = o.parentElement;
24
- }
25
- return null;
26
- }
27
- function M(e) {
28
- var c, l;
29
- const n = window.getSelection(), t = (l = (c = e.savedRange) == null ? void 0 : c.commonAncestorContainer) != null ? l : n && n.rangeCount > 0 ? n.getRangeAt(0).commonAncestorContainer : null, o = m(t, e.getActiveEditorRoot), r = o ? o.innerHTML : null, s = T(e);
30
- return s && o && r !== null && b(o, r), s;
31
- }
32
- function T(e) {
33
- try {
34
- if (e.savedRange) {
35
- const c = window.getSelection();
36
- c && (c.removeAllRanges(), c.addRange(e.savedRange.cloneRange()));
37
- }
38
- const n = window.getSelection();
39
- if (!n || n.rangeCount === 0 || n.isCollapsed)
40
- return !1;
41
- const t = n.getRangeAt(0);
42
- if (t.collapsed)
43
- return !1;
44
- const o = S(t, e.className);
45
- if (o)
46
- return e.styleProperty === "backgroundColor" ? o.style.backgroundColor = e.color : o.style.color = e.color, v(o, e.getActiveEditorRoot), !0;
47
- const r = m(
48
- t.commonAncestorContainer,
49
- e.getActiveEditorRoot
50
- );
51
- r == null || r.focus({ preventScroll: !0 });
52
- try {
53
- document.execCommand("styleWithCSS", !1, "true");
54
- } catch (c) {
55
- }
56
- let s = !1;
57
- if (e.commands.forEach((c) => {
58
- s || (s = document.execCommand(c, !1, e.color));
59
- }), !s && !p(t)) {
60
- const c = document.createElement("span");
61
- e.styleProperty === "backgroundColor" ? c.style.backgroundColor = e.color : c.style.color = e.color, c.className = e.className;
62
- const l = t.extractContents();
63
- c.appendChild(l), t.insertNode(c), t.setStartAfter(c), t.collapse(!0), n.removeAllRanges(), n.addRange(t), s = !0;
64
- }
65
- return s ? (v(t.commonAncestorContainer, e.getActiveEditorRoot), !0) : (e.warnMessage && console.warn(e.warnMessage), !1);
66
- } catch (n) {
67
- return e.warnMessage ? console.error(e.warnMessage, n) : console.error("[ColorApply] Failed to apply color", n), !1;
68
- }
69
- }
70
- function k({
71
- popover: e,
72
- anchor: n,
73
- onClose: t,
74
- gap: o = 6,
75
- margin: r = 8,
76
- zIndex: s = 1e4
77
- }) {
78
- e.style.position = "fixed", e.style.zIndex = `${s}`, e.style.visibility = "hidden";
79
- const c = () => {
80
- if (!e.isConnected || !n.isConnected) {
81
- t();
82
- return;
83
- }
84
- const i = n.getBoundingClientRect();
85
- if (i.width === 0 && i.height === 0) {
86
- t();
87
- return;
88
- }
89
- const a = e.getBoundingClientRect(), w = a.width || e.offsetWidth || 220, f = a.height || e.offsetHeight || 260, y = window.innerWidth, E = window.innerHeight;
90
- let u = i.left, d = i.bottom + o;
91
- if (u + w > y - r && (u = y - w - r), u = Math.max(r, u), d + f > E - r) {
92
- const C = i.top - f - o;
93
- C >= r ? d = C : d = Math.max(r, E - f - r);
94
- }
95
- d < r && (d = r), e.style.left = `${Math.round(u)}px`, e.style.top = `${Math.round(d)}px`, e.style.visibility = "visible";
96
- }, l = () => {
97
- c();
98
- }, h = (i) => {
99
- const a = i.target;
100
- a && (e.contains(a) || n.contains(a) || t());
101
- }, g = (i) => {
102
- i.key === "Escape" && t();
103
- };
104
- window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), document.addEventListener("keydown", g);
105
- const R = window.requestAnimationFrame(() => {
106
- document.addEventListener("mousedown", h, !0);
107
- });
108
- return c(), { reposition: c, destroy: () => {
109
- window.cancelAnimationFrame(R), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0), document.removeEventListener("keydown", g), document.removeEventListener("mousedown", h, !0);
110
- } };
111
- }
112
- export {
113
- M as a,
114
- k as b
115
- };
116
- //# sourceMappingURL=anchoredPopover-DJFD2oAP.mjs.map
@@ -1,40 +0,0 @@
1
- function n(e) {
2
- let i = !1;
3
- e.addEventListener(
4
- "pointerdown",
5
- (t) => {
6
- i = t.target !== e;
7
- },
8
- !0
9
- ), e.addEventListener(
10
- "click",
11
- (t) => {
12
- t.target === e && i && t.stopImmediatePropagation(), i = !1;
13
- },
14
- !0
15
- );
16
- }
17
- const a = "rte-dialog-base-styles";
18
- function o() {
19
- if (typeof document == "undefined" || document.getElementById(a)) return;
20
- const e = document.createElement("style");
21
- e.id = a, e.textContent = `
22
- [data-rte-dialog] {
23
- font-family: var(--rte-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
24
- }
25
-
26
- /* Form controls ignore inherited fonts (browsers default them to Arial /
27
- system-ui). :where() keeps this at zero specificity so any control a plugin
28
- styles explicitly - e.g. a monospace formula field - keeps its own font. */
29
- :where([data-rte-dialog]) :where(button, input, select, textarea) {
30
- font-family: inherit;
31
- }
32
- `, document.head.appendChild(e);
33
- }
34
- function s(e) {
35
- e.setAttribute("data-rte-dialog", ""), o(), n(e);
36
- }
37
- export {
38
- s as i
39
- };
40
- //# sourceMappingURL=dialogHelpers-DBf7WqYH.mjs.map