@editora/core 1.0.15 → 1.0.17
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-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-XsYC_KdJ.mjs +3923 -0
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +17 -14
- package/dist/plugin-loader.js +53 -52
- package/dist/webcomponent-core.js +2055 -476
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +96 -66
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2223 -643
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1564 -1198
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-BLm1MtzH.js +0 -10
- package/dist/index-Cd9jEuZP.mjs +0 -2341
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { r as b } from "./historyHelpers-B0-4mq1E.mjs";
|
|
2
|
+
const _ = () => ({
|
|
2
3
|
name: "fontSize",
|
|
3
4
|
marks: {
|
|
4
5
|
fontSize: {
|
|
@@ -57,14 +58,14 @@ const O = () => ({
|
|
|
57
58
|
commands: {
|
|
58
59
|
decreaseFontSize: () => {
|
|
59
60
|
try {
|
|
60
|
-
return
|
|
61
|
+
return g(-2), y(), !0;
|
|
61
62
|
} catch (e) {
|
|
62
63
|
return console.error("Failed to decrease font size:", e), !1;
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
increaseFontSize: () => {
|
|
66
67
|
try {
|
|
67
|
-
return
|
|
68
|
+
return g(2), y(), !0;
|
|
68
69
|
} catch (e) {
|
|
69
70
|
return console.error("Failed to increase font size:", e), !1;
|
|
70
71
|
}
|
|
@@ -76,14 +77,14 @@ const O = () => ({
|
|
|
76
77
|
const n = e.trim().match(/^(\d+(?:\.\d+)?)(px|em|rem)?$/i);
|
|
77
78
|
if (!n) return !1;
|
|
78
79
|
const i = parseFloat(n[1]), r = ((o = n[2]) == null ? void 0 : o.toLowerCase()) || "px";
|
|
79
|
-
return r === "px" && (i < 8 || i > 72) || (r === "em" || r === "rem") && (i < 0.5 || i > 5) ? !1 : (
|
|
80
|
+
return r === "px" && (i < 8 || i > 72) || (r === "em" || r === "rem") && (i < 0.5 || i > 5) ? !1 : (F(i, r), !0);
|
|
80
81
|
} catch (t) {
|
|
81
82
|
return console.error("Failed to set font size:", t), !1;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
},
|
|
85
86
|
keymap: {}
|
|
86
|
-
}),
|
|
87
|
+
}), N = "p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre", z = {
|
|
87
88
|
"xx-small": 9,
|
|
88
89
|
"x-small": 10,
|
|
89
90
|
small: 13,
|
|
@@ -102,23 +103,23 @@ function p(e) {
|
|
|
102
103
|
value: parseFloat(t[1]),
|
|
103
104
|
unit: t[2].toLowerCase()
|
|
104
105
|
};
|
|
105
|
-
const n =
|
|
106
|
+
const n = z[o];
|
|
106
107
|
return n ? { value: n, unit: "px" } : null;
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
return e.trim().toLowerCase() in
|
|
109
|
+
function x(e) {
|
|
110
|
+
return e.trim().toLowerCase() in z;
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
return !!e.cloneContents().querySelector(
|
|
112
|
+
function w(e) {
|
|
113
|
+
return !!e.cloneContents().querySelector(N);
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function h(e) {
|
|
115
116
|
const o = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
116
117
|
return (o == null ? void 0 : o.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
|
|
117
118
|
}
|
|
118
119
|
function d(e) {
|
|
119
120
|
e && e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function E(e, o) {
|
|
122
123
|
var i;
|
|
123
124
|
const t = document.createElement("span");
|
|
124
125
|
for (const r of Array.from(e.attributes))
|
|
@@ -128,7 +129,7 @@ function w(e, o) {
|
|
|
128
129
|
t.appendChild(e.firstChild);
|
|
129
130
|
(i = e.parentNode) == null || i.replaceChild(t, e);
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
+
function T(e, o, t, n) {
|
|
132
133
|
const i = Array.from(
|
|
133
134
|
e.querySelectorAll("font[size], [style*='font-size']")
|
|
134
135
|
), r = (s) => {
|
|
@@ -143,10 +144,10 @@ function E(e, o, t, n) {
|
|
|
143
144
|
};
|
|
144
145
|
let c = !1;
|
|
145
146
|
return i.forEach((s) => {
|
|
146
|
-
const a = !o.has(s), l = s.tagName === "FONT", u =
|
|
147
|
+
const a = !o.has(s), l = s.tagName === "FONT", u = x(s.style.fontSize || ""), f = r(s);
|
|
147
148
|
if (!(!a && !f) && !(!a && !l && !u)) {
|
|
148
149
|
if (c = !0, s.tagName === "FONT") {
|
|
149
|
-
|
|
150
|
+
E(s, t);
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
153
|
s.style.fontSize = t;
|
|
@@ -158,8 +159,8 @@ function S(e) {
|
|
|
158
159
|
t.childElementCount > 0 || (t.textContent || "").trim().length > 0 || t.remove();
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
if (
|
|
162
|
+
function R(e, o, t) {
|
|
163
|
+
if (w(e))
|
|
163
164
|
return !1;
|
|
164
165
|
const n = document.createElement("span");
|
|
165
166
|
n.style.fontSize = t;
|
|
@@ -172,16 +173,16 @@ function T(e, o, t) {
|
|
|
172
173
|
const i = document.createRange();
|
|
173
174
|
return i.selectNodeContents(n), o.removeAllRanges(), o.addRange(i), !0;
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function g(e) {
|
|
176
177
|
const o = window.getSelection();
|
|
177
178
|
if (!o || o.rangeCount === 0) return;
|
|
178
|
-
const { value: t, unit: n } =
|
|
179
|
+
const { value: t, unit: n } = C();
|
|
179
180
|
let i = e;
|
|
180
181
|
(n === "em" || n === "rem") && (i = e * 0.125);
|
|
181
182
|
let r;
|
|
182
|
-
n === "px" ? r = e < 0 ? Math.max(8, t + e) : Math.min(72, t + e) : r = e < 0 ? Math.max(0.5, t + i) : Math.min(5, t + i),
|
|
183
|
+
n === "px" ? r = e < 0 ? Math.max(8, t + e) : Math.min(72, t + e) : r = e < 0 ? Math.max(0.5, t + i) : Math.min(5, t + i), F(r, n);
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
+
function C() {
|
|
185
186
|
var i;
|
|
186
187
|
const e = window.getSelection();
|
|
187
188
|
if (!e || e.rangeCount === 0)
|
|
@@ -200,14 +201,20 @@ function h() {
|
|
|
200
201
|
}
|
|
201
202
|
return { value: 14, unit: "px" };
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function F(e, o = "px") {
|
|
205
|
+
const t = window.getSelection();
|
|
206
|
+
if (!t || t.rangeCount === 0) return;
|
|
207
|
+
const n = h(t.getRangeAt(0).commonAncestorContainer), i = n ? n.innerHTML : null;
|
|
208
|
+
v(e, o), n && i !== null && b(n, i);
|
|
209
|
+
}
|
|
210
|
+
function v(e, o = "px") {
|
|
204
211
|
const t = window.getSelection();
|
|
205
212
|
if (!t || t.rangeCount === 0) return;
|
|
206
|
-
const n = t.getRangeAt(0), i = n.cloneRange(), r =
|
|
213
|
+
const n = t.getRangeAt(0), i = n.cloneRange(), r = h(n.commonAncestorContainer);
|
|
207
214
|
if (n.collapsed)
|
|
208
215
|
return;
|
|
209
|
-
const c = `${e}${o}`, s = n.commonAncestorContainer, a =
|
|
210
|
-
if (a &&
|
|
216
|
+
const c = `${e}${o}`, s = n.commonAncestorContainer, a = L(s);
|
|
217
|
+
if (a && O(n, a)) {
|
|
211
218
|
a.style.fontSize = c, d(r);
|
|
212
219
|
const m = document.createRange();
|
|
213
220
|
m.selectNodeContents(a), t.removeAllRanges(), t.addRange(m);
|
|
@@ -225,19 +232,19 @@ function C(e, o = "px") {
|
|
|
225
232
|
} catch (m) {
|
|
226
233
|
}
|
|
227
234
|
let u = document.execCommand("fontSize", !1, "7");
|
|
228
|
-
const f = t.rangeCount > 0 ? t.getRangeAt(0).cloneRange() : i,
|
|
235
|
+
const f = t.rangeCount > 0 ? t.getRangeAt(0).cloneRange() : i, A = T(
|
|
229
236
|
r,
|
|
230
237
|
l,
|
|
231
238
|
c,
|
|
232
239
|
f
|
|
233
240
|
);
|
|
234
|
-
if (u &&
|
|
241
|
+
if (u && A) {
|
|
235
242
|
S(r), d(r);
|
|
236
243
|
return;
|
|
237
244
|
}
|
|
238
|
-
u =
|
|
245
|
+
u = R(i, t, c), u && (S(r), d(r));
|
|
239
246
|
}
|
|
240
|
-
function
|
|
247
|
+
function L(e) {
|
|
241
248
|
let o = e;
|
|
242
249
|
for (; o && o !== document.body; ) {
|
|
243
250
|
if (o.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -249,13 +256,13 @@ function R(e) {
|
|
|
249
256
|
}
|
|
250
257
|
return null;
|
|
251
258
|
}
|
|
252
|
-
function
|
|
259
|
+
function O(e, o) {
|
|
253
260
|
const t = e.startContainer, n = e.endContainer;
|
|
254
261
|
return o.contains(t) && o.contains(n);
|
|
255
262
|
}
|
|
256
|
-
function
|
|
263
|
+
function y() {
|
|
257
264
|
setTimeout(() => {
|
|
258
|
-
const { value: e, unit: o } =
|
|
265
|
+
const { value: e, unit: o } = C(), t = window.getSelection();
|
|
259
266
|
if (!t || t.rangeCount === 0) return;
|
|
260
267
|
let n = null, r = t.getRangeAt(0).startContainer;
|
|
261
268
|
for (; r; ) {
|
|
@@ -281,6 +288,6 @@ function z() {
|
|
|
281
288
|
}, 10);
|
|
282
289
|
}
|
|
283
290
|
export {
|
|
284
|
-
|
|
291
|
+
_ as FontSizePlugin
|
|
285
292
|
};
|
|
286
|
-
//# sourceMappingURL=FontSizePlugin.native-
|
|
293
|
+
//# sourceMappingURL=FontSizePlugin.native-DsLrH8eq.mjs.map
|
package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs}
RENAMED
|
@@ -381,7 +381,8 @@ function It(t, e) {
|
|
|
381
381
|
return o < i.data.length && i.splitText(o), r > 0 && (i = i.splitText(r)), i;
|
|
382
382
|
}
|
|
383
383
|
function xt(t, e) {
|
|
384
|
-
|
|
384
|
+
const n = t;
|
|
385
|
+
let r = n.parentElement;
|
|
385
386
|
for (; r && r.matches(y) && !x(r, e) && tt(r, e); )
|
|
386
387
|
Bt(r, n), r = n.parentElement;
|
|
387
388
|
return n;
|
|
@@ -673,4 +674,4 @@ function B(t) {
|
|
|
673
674
|
export {
|
|
674
675
|
ne as FormatPainterPlugin
|
|
675
676
|
};
|
|
676
|
-
//# sourceMappingURL=FormatPainterPlugin.native-
|
|
677
|
+
//# sourceMappingURL=FormatPainterPlugin.native-BhjzsiVq.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const S = ".rte-content, .editora-content";
|
|
2
|
-
const y = "__editoraCommandEditorRoot", d = /* @__PURE__ */ new Map(),
|
|
2
|
+
const y = "__editoraCommandEditorRoot", d = /* @__PURE__ */ new Map(), m = {};
|
|
3
3
|
let T = !1, c = null;
|
|
4
4
|
function R(t) {
|
|
5
5
|
if (!t) return null;
|
|
@@ -37,7 +37,7 @@ function s(t) {
|
|
|
37
37
|
i.getAttribute("contenteditable") === "true" && (r = i), i = i.parentElement;
|
|
38
38
|
return r;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function M() {
|
|
41
41
|
const t = I();
|
|
42
42
|
if (t && document.contains(t))
|
|
43
43
|
return t;
|
|
@@ -61,7 +61,7 @@ function A() {
|
|
|
61
61
|
for (const t of d.keys())
|
|
62
62
|
t.isConnected || (d.delete(t), c === t && (c = null));
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function f(t) {
|
|
65
65
|
A();
|
|
66
66
|
let e = d.get(t);
|
|
67
67
|
return e || (e = { undoStack: [], redoStack: [] }, d.set(t, e)), e;
|
|
@@ -69,15 +69,15 @@ function C(t) {
|
|
|
69
69
|
function a(t) {
|
|
70
70
|
t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function l(t, e) {
|
|
73
73
|
if (!t) return;
|
|
74
|
-
const n =
|
|
74
|
+
const n = f(t);
|
|
75
75
|
n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
|
|
76
76
|
}
|
|
77
77
|
function h(t, e = "undo") {
|
|
78
78
|
if (A(), t != null && t.isConnected)
|
|
79
79
|
return t;
|
|
80
|
-
const n =
|
|
80
|
+
const n = M();
|
|
81
81
|
if (n != null && n.isConnected)
|
|
82
82
|
return n;
|
|
83
83
|
if (c != null && c.isConnected)
|
|
@@ -109,29 +109,29 @@ function w(t, e) {
|
|
|
109
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
110
|
}
|
|
111
111
|
function u(t, e) {
|
|
112
|
-
if (
|
|
112
|
+
if (m[t] = e, typeof window == "undefined") return;
|
|
113
113
|
const n = window.registerEditorCommand;
|
|
114
114
|
typeof n == "function" ? n(t, e) : (window.registerEditorCommand = (o, r) => {
|
|
115
|
-
|
|
115
|
+
m[o] = r;
|
|
116
116
|
}, window.registerEditorCommand(t, e));
|
|
117
117
|
}
|
|
118
118
|
const H = (t, ...e) => {
|
|
119
|
-
const n =
|
|
119
|
+
const n = m[t];
|
|
120
120
|
return n ? n(...e) : !1;
|
|
121
121
|
};
|
|
122
|
-
function
|
|
123
|
-
T || typeof window == "undefined" || (T = !0, window.execEditorCommand || (window.execEditorCommand = H), window.executeEditorCommand || (window.executeEditorCommand = H), u("undo", L), u("redo",
|
|
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
124
|
}
|
|
125
125
|
const L = () => {
|
|
126
|
-
const t =
|
|
127
|
-
return
|
|
128
|
-
},
|
|
129
|
-
const t =
|
|
126
|
+
const t = M();
|
|
127
|
+
return C(t != null ? t : void 0);
|
|
128
|
+
}, k = () => {
|
|
129
|
+
const t = M();
|
|
130
130
|
return b(t != null ? t : void 0);
|
|
131
|
-
},
|
|
131
|
+
}, x = (t, e, n) => {
|
|
132
132
|
if (!(t instanceof HTMLElement)) return;
|
|
133
133
|
const o = s(t), r = t.hasAttribute(e), i = t.getAttribute(e);
|
|
134
|
-
t.setAttribute(e, n),
|
|
134
|
+
t.setAttribute(e, n), l(o, {
|
|
135
135
|
undo: () => {
|
|
136
136
|
t.isConnected && (r && i !== null ? t.setAttribute(e, i) : t.removeAttribute(e));
|
|
137
137
|
},
|
|
@@ -143,7 +143,7 @@ const L = () => {
|
|
|
143
143
|
var r;
|
|
144
144
|
if (!(t instanceof HTMLElement)) return;
|
|
145
145
|
const n = s(t), o = (r = t.textContent) != null ? r : "";
|
|
146
|
-
t.textContent = e,
|
|
146
|
+
t.textContent = e, l(n, {
|
|
147
147
|
undo: () => {
|
|
148
148
|
t.isConnected && (t.textContent = o);
|
|
149
149
|
},
|
|
@@ -160,7 +160,7 @@ const L = () => {
|
|
|
160
160
|
const r = g(e);
|
|
161
161
|
o.fix(t);
|
|
162
162
|
const i = g(e);
|
|
163
|
-
|
|
163
|
+
l(n, {
|
|
164
164
|
undo: () => {
|
|
165
165
|
e.isConnected && w(e, r);
|
|
166
166
|
},
|
|
@@ -171,7 +171,11 @@ const L = () => {
|
|
|
171
171
|
}, D = (t, e, n) => {
|
|
172
172
|
if (!(t instanceof HTMLElement)) return !1;
|
|
173
173
|
const o = typeof n == "string" ? n : t.innerHTML;
|
|
174
|
-
|
|
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,
|
|
175
179
|
undo: () => {
|
|
176
180
|
t.isConnected && (t.innerHTML = e);
|
|
177
181
|
},
|
|
@@ -179,19 +183,19 @@ const L = () => {
|
|
|
179
183
|
t.isConnected && (t.innerHTML = o);
|
|
180
184
|
}
|
|
181
185
|
}), !0);
|
|
182
|
-
},
|
|
186
|
+
}, C = (t) => {
|
|
183
187
|
const e = h(t, "undo");
|
|
184
188
|
if (!e) return !1;
|
|
185
|
-
const n =
|
|
189
|
+
const n = f(e), o = n.undoStack.pop();
|
|
186
190
|
return o ? (o.undo(), n.redoStack.push(o), c = e, a(e), !0) : !1;
|
|
187
191
|
}, b = (t) => {
|
|
188
192
|
const e = h(t, "redo");
|
|
189
193
|
if (!e) return !1;
|
|
190
|
-
const n =
|
|
194
|
+
const n = f(e), o = n.redoStack.pop();
|
|
191
195
|
return o ? (o.redo(), n.undoStack.push(o), c = e, a(e), !0) : !1;
|
|
192
196
|
};
|
|
193
|
-
typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
194
|
-
const z = () => (
|
|
197
|
+
typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", E, { once: !0 }) : E());
|
|
198
|
+
const z = () => (E(), {
|
|
195
199
|
name: "history",
|
|
196
200
|
toolbar: [
|
|
197
201
|
{
|
|
@@ -211,12 +215,12 @@ const z = () => (m(), {
|
|
|
211
215
|
],
|
|
212
216
|
commands: {
|
|
213
217
|
undo: L,
|
|
214
|
-
redo:
|
|
215
|
-
setAttribute:
|
|
218
|
+
redo: k,
|
|
219
|
+
setAttribute: x,
|
|
216
220
|
setText: v,
|
|
217
221
|
autoFixA11y: O,
|
|
218
222
|
recordDomTransaction: D,
|
|
219
|
-
undoDom:
|
|
223
|
+
undoDom: C,
|
|
220
224
|
redoDom: b
|
|
221
225
|
},
|
|
222
226
|
keymap: {
|
|
@@ -232,11 +236,11 @@ export {
|
|
|
232
236
|
z as HistoryPlugin,
|
|
233
237
|
O as autoFixA11y,
|
|
234
238
|
D as recordDomTransaction,
|
|
235
|
-
|
|
239
|
+
k as redo,
|
|
236
240
|
b as redoDom,
|
|
237
|
-
|
|
241
|
+
x as setAttribute,
|
|
238
242
|
v as setText,
|
|
239
243
|
L as undo,
|
|
240
|
-
|
|
244
|
+
C as undoDom
|
|
241
245
|
};
|
|
242
|
-
//# sourceMappingURL=HistoryPlugin.native-
|
|
246
|
+
//# sourceMappingURL=HistoryPlugin.native-DPvhks6h.mjs.map
|