@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.
- package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
- package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
- package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
- package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
- package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
- package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
- package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
- package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-CRpX2G93.mjs} +167 -113
- package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
- package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
- package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
- package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
- package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
- package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-CaBqCH-p.mjs} +21 -20
- package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
- package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
- package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
- package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
- package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
- package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
- package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
- package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
- package/dist/MediaManagerPlugin.native-0YFHZfsb.mjs +4823 -0
- package/dist/MediaManagerPlugin.native-mXWWARRX.mjs +4908 -0
- package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
- package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
- package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
- package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
- package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
- package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
- package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
- package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
- package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
- package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
- package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
- package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
- package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
- package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
- package/dist/confirmDialog-CNqPHT5x.mjs +92 -0
- package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
- package/dist/{documentManager-BWK_-KJp.mjs → documentManager-DHLCoWzw.mjs} +1963 -1969
- package/dist/editora.min.js +21 -21
- package/dist/editora.umd.js +10 -10
- package/dist/index-DHPPVQwx.js +12 -0
- package/dist/{index-DGMYWPLx.mjs → index-gI4djib2.mjs} +407 -327
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/katex-DLIObQUm.mjs +11683 -0
- package/dist/katex.min--Ws3c9be.mjs +6 -0
- package/dist/notify-DCQGpmq-.mjs +60 -0
- package/dist/plugin-loader.js +54 -54
- package/dist/shared-config-DuA34Iii.mjs +26 -0
- package/dist/webcomponent-core.js +315 -235
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +153 -80
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +672 -592
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +3099 -1532
- package/package.json +1 -1
- package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
- package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
- package/dist/MediaManagerPlugin.native-BT1NZIJS.mjs +0 -998
- package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
- package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
- package/dist/index-C1sO7DAC.js +0 -12
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { r as y } from "./historyHelpers-B0-4mq1E.mjs";
|
|
2
|
+
function v(n) {
|
|
3
|
+
var s, i;
|
|
4
|
+
const t = Array.from(n.querySelectorAll("ul, ol")).filter(
|
|
5
|
+
(a) => {
|
|
6
|
+
var l;
|
|
7
|
+
return ((l = a.parentElement) == null ? void 0 : l.tagName) === "P" && n.contains(a.parentElement);
|
|
8
|
+
}
|
|
9
|
+
);
|
|
10
|
+
if (t.length === 0) return;
|
|
11
|
+
const e = (i = (s = n.ownerDocument.defaultView) == null ? void 0 : s.getSelection()) != null ? i : null, o = e && e.rangeCount > 0 ? e.getRangeAt(0) : null, r = o && n.contains(o.commonAncestorContainer) ? {
|
|
12
|
+
startContainer: o.startContainer,
|
|
13
|
+
startOffset: o.startOffset,
|
|
14
|
+
endContainer: o.endContainer,
|
|
15
|
+
endOffset: o.endOffset
|
|
16
|
+
} : null;
|
|
17
|
+
if (t.forEach((a) => {
|
|
18
|
+
const l = a.parentElement;
|
|
19
|
+
if (!l || l.tagName !== "P" || !l.parentNode) return;
|
|
20
|
+
const c = l.parentNode, f = [], u = [];
|
|
21
|
+
let p = !1;
|
|
22
|
+
Array.from(l.childNodes).forEach((d) => {
|
|
23
|
+
d === a ? p = !0 : p ? u.push(d) : f.push(d);
|
|
24
|
+
});
|
|
25
|
+
const h = (d) => d.some((m) => {
|
|
26
|
+
var g;
|
|
27
|
+
return m.nodeType === Node.TEXT_NODE ? ((g = m.textContent) != null ? g : "").trim() !== "" : !0;
|
|
28
|
+
}), C = (d) => {
|
|
29
|
+
const m = l.cloneNode(!1);
|
|
30
|
+
return d.forEach((g) => m.appendChild(g)), m;
|
|
31
|
+
};
|
|
32
|
+
h(f) && c.insertBefore(C(f), l), c.insertBefore(a, l), h(u) && c.insertBefore(C(u), l), c.removeChild(l);
|
|
33
|
+
}), r && e && n.contains(r.startContainer) && n.contains(r.endContainer)) {
|
|
34
|
+
const a = n.ownerDocument.createRange();
|
|
35
|
+
a.setStart(r.startContainer, r.startOffset), a.setEnd(r.endContainer, r.endOffset), e.removeAllRanges(), e.addRange(a);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function S(n) {
|
|
39
|
+
var t;
|
|
40
|
+
return n instanceof HTMLElement && n.tagName === "P" && ((t = n.textContent) != null ? t : "") === "" && n.querySelector("*") === null;
|
|
41
|
+
}
|
|
42
|
+
function b(n) {
|
|
43
|
+
const t = (e, o) => {
|
|
44
|
+
var s;
|
|
45
|
+
let r = e[o];
|
|
46
|
+
for (; r && r.nodeType === Node.TEXT_NODE && ((s = r.textContent) != null ? s : "").trim() === ""; ) r = r[o];
|
|
47
|
+
return r;
|
|
48
|
+
};
|
|
49
|
+
n.querySelectorAll("ul, ol").forEach((e) => {
|
|
50
|
+
var o, r;
|
|
51
|
+
if (!(e.parentNode !== n && ((o = e.parentElement) != null && o.closest("ul, ol"))))
|
|
52
|
+
for (const s of ["previousSibling", "nextSibling"]) {
|
|
53
|
+
let i = t(e, s);
|
|
54
|
+
for (; S(i); ) {
|
|
55
|
+
const a = i;
|
|
56
|
+
i = t(a, s), (r = a.parentNode) == null || r.removeChild(a);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const A = /^(P|LI|H[1-6]|BLOCKQUOTE|PRE|DIV|TD|TH)$/;
|
|
62
|
+
function L(n, t) {
|
|
63
|
+
let e = t;
|
|
64
|
+
for (; e && e !== n; ) {
|
|
65
|
+
if (e instanceof HTMLElement && A.test(e.tagName)) return e;
|
|
66
|
+
e = e.parentNode;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
function D(n) {
|
|
71
|
+
var s;
|
|
72
|
+
const t = (s = n.ownerDocument.defaultView) == null ? void 0 : s.getSelection();
|
|
73
|
+
if (!t || t.rangeCount === 0 || !t.isCollapsed) return null;
|
|
74
|
+
const e = t.getRangeAt(0);
|
|
75
|
+
if (!n.contains(e.startContainer)) return null;
|
|
76
|
+
const o = L(n, e.startContainer);
|
|
77
|
+
if (!o) return null;
|
|
78
|
+
const r = n.ownerDocument.createRange();
|
|
79
|
+
return r.selectNodeContents(o), r.setEnd(e.startContainer, e.startOffset), r.toString().length;
|
|
80
|
+
}
|
|
81
|
+
function M(n, t) {
|
|
82
|
+
var f;
|
|
83
|
+
const e = (f = n.ownerDocument.defaultView) == null ? void 0 : f.getSelection();
|
|
84
|
+
if (!e || e.rangeCount === 0 || !e.isCollapsed) return;
|
|
85
|
+
const o = e.getRangeAt(0);
|
|
86
|
+
if (!n.contains(o.startContainer)) return;
|
|
87
|
+
const r = L(n, o.startContainer);
|
|
88
|
+
if (!r) return;
|
|
89
|
+
const s = n.ownerDocument.createTreeWalker(r, NodeFilter.SHOW_TEXT);
|
|
90
|
+
let i = Math.max(0, t), a = null, l;
|
|
91
|
+
const c = n.ownerDocument.createRange();
|
|
92
|
+
for (; l = s.nextNode(); ) {
|
|
93
|
+
const u = l;
|
|
94
|
+
if (a = u, i <= u.data.length) {
|
|
95
|
+
c.setStart(u, i), c.collapse(!0), e.removeAllRanges(), e.addRange(c);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
i -= u.data.length;
|
|
99
|
+
}
|
|
100
|
+
a && (c.setStart(a, a.data.length), c.collapse(!0), e.removeAllRanges(), e.addRange(c));
|
|
101
|
+
}
|
|
102
|
+
const N = () => w("insertUnorderedList"), T = () => w("insertOrderedList");
|
|
103
|
+
function R() {
|
|
104
|
+
const n = window.getSelection();
|
|
105
|
+
if (n && n.rangeCount > 0) {
|
|
106
|
+
const e = n.getRangeAt(0).startContainer, o = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, r = o == null ? void 0 : o.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
107
|
+
if (r) return r;
|
|
108
|
+
}
|
|
109
|
+
const t = document.activeElement;
|
|
110
|
+
return t ? t.getAttribute("contenteditable") === "true" ? t : t.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
111
|
+
}
|
|
112
|
+
function B(n) {
|
|
113
|
+
n.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach((e) => {
|
|
114
|
+
Array.from(e.childNodes).forEach((r) => {
|
|
115
|
+
if (r.nodeType === Node.TEXT_NODE) {
|
|
116
|
+
const i = (r.textContent || "").trim();
|
|
117
|
+
if (!i) {
|
|
118
|
+
e.removeChild(r);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const a = document.createElement("li");
|
|
122
|
+
a.textContent = i, e.replaceChild(a, r);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (!(r instanceof HTMLElement)) {
|
|
126
|
+
e.removeChild(r);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (r.tagName === "LI")
|
|
130
|
+
return;
|
|
131
|
+
const s = document.createElement("li");
|
|
132
|
+
for (; r.firstChild; )
|
|
133
|
+
s.appendChild(r.firstChild);
|
|
134
|
+
e.replaceChild(s, r);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const H = /* @__PURE__ */ new Set([
|
|
139
|
+
"P",
|
|
140
|
+
"DIV",
|
|
141
|
+
"UL",
|
|
142
|
+
"OL",
|
|
143
|
+
"LI",
|
|
144
|
+
"BLOCKQUOTE",
|
|
145
|
+
"H1",
|
|
146
|
+
"H2",
|
|
147
|
+
"H3",
|
|
148
|
+
"H4",
|
|
149
|
+
"H5",
|
|
150
|
+
"H6",
|
|
151
|
+
"TABLE",
|
|
152
|
+
"PRE",
|
|
153
|
+
"FIGURE",
|
|
154
|
+
"SECTION",
|
|
155
|
+
"ARTICLE",
|
|
156
|
+
"HEADER",
|
|
157
|
+
"FOOTER"
|
|
158
|
+
]);
|
|
159
|
+
function k(n) {
|
|
160
|
+
let t = null;
|
|
161
|
+
Array.from(n.childNodes).forEach((e) => {
|
|
162
|
+
if (e.nodeType === Node.ELEMENT_NODE && H.has(e.tagName)) {
|
|
163
|
+
t = null;
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
e.nodeType === Node.TEXT_NODE && !(e.textContent || "").trim() || (t || (t = document.createElement("p"), n.insertBefore(t, e)), t.appendChild(e));
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function w(n) {
|
|
170
|
+
const t = R();
|
|
171
|
+
if (!t) return !1;
|
|
172
|
+
const e = window.getSelection();
|
|
173
|
+
if (!e || e.rangeCount === 0) return !1;
|
|
174
|
+
const o = e.getRangeAt(0);
|
|
175
|
+
if (!t.contains(o.commonAncestorContainer)) return !1;
|
|
176
|
+
const r = t.innerHTML, s = D(t);
|
|
177
|
+
t.focus({ preventScroll: !0 });
|
|
178
|
+
const i = document.execCommand(n, !1);
|
|
179
|
+
return B(t), v(t), b(t), k(t), s !== null && M(t, s), y(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 })), i !== !1;
|
|
180
|
+
}
|
|
181
|
+
const E = (n, t) => {
|
|
182
|
+
var e;
|
|
183
|
+
typeof window != "undefined" && ((e = window.registerEditorCommand) == null || e.call(window, n, t));
|
|
184
|
+
}, O = () => {
|
|
185
|
+
E("toggleBulletList", N), E("toggleOrderedList", T);
|
|
186
|
+
};
|
|
187
|
+
typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", O) : O());
|
|
188
|
+
const I = () => ({
|
|
189
|
+
name: "list",
|
|
190
|
+
nodes: {
|
|
191
|
+
bulletList: {
|
|
192
|
+
content: "listItem+",
|
|
193
|
+
group: "block",
|
|
194
|
+
parseDOM: [{ tag: "ul" }],
|
|
195
|
+
toDOM: () => ["ul", 0]
|
|
196
|
+
},
|
|
197
|
+
orderedList: {
|
|
198
|
+
content: "listItem+",
|
|
199
|
+
group: "block",
|
|
200
|
+
parseDOM: [{ tag: "ol" }],
|
|
201
|
+
toDOM: () => ["ol", 0]
|
|
202
|
+
},
|
|
203
|
+
listItem: {
|
|
204
|
+
content: "paragraph",
|
|
205
|
+
parseDOM: [{ tag: "li" }],
|
|
206
|
+
toDOM: () => ["li", 0]
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
toolbar: [
|
|
210
|
+
{
|
|
211
|
+
label: "Bullet List",
|
|
212
|
+
command: "toggleBulletList",
|
|
213
|
+
type: "button",
|
|
214
|
+
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>',
|
|
215
|
+
shortcut: "Mod-Shift-8"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: "Numbered List",
|
|
219
|
+
command: "toggleOrderedList",
|
|
220
|
+
type: "button",
|
|
221
|
+
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>',
|
|
222
|
+
shortcut: "Mod-Shift-7"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
commands: {
|
|
226
|
+
toggleBulletList: N,
|
|
227
|
+
toggleOrderedList: T
|
|
228
|
+
},
|
|
229
|
+
keymap: {
|
|
230
|
+
"Mod-Shift-8": "toggleBulletList",
|
|
231
|
+
"Mod-Shift-7": "toggleOrderedList"
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
export {
|
|
235
|
+
I as ListPlugin,
|
|
236
|
+
N as toggleBulletList,
|
|
237
|
+
T as toggleOrderedList
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=ListPlugin.native-UYaoRiub.mjs.map
|