@editora/core 1.0.8 → 1.0.9
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/README.md +5 -0
- package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
- package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-449ce66c.mjs} +79 -40
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
- package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
- package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs} +119 -60
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
- package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
- package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
- package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-169fb1e8.mjs} +137 -69
- package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
- package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
- package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-4983143a.mjs} +108 -51
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-63ed405b.mjs} +100 -50
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-427e9d75.mjs} +79 -40
- package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-8e41eda0.mjs} +115 -58
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
- package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
- package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
- package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
- package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
- package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
- package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
- package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-3b1e8c05.mjs} +89 -45
- package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-7ab10b9f.mjs} +107 -54
- package/dist/{PageBreakPlugin.native-DijGuHJZ.mjs → PageBreakPlugin.native-1794c5fb.mjs} +31 -16
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-f7b67cc0.mjs} +11 -6
- package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-8d45e511.mjs} +72 -37
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-a6c5efec.mjs} +99 -50
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
- package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
- package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
- package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
- package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
- package/dist/{TrackChangesPlugin.native-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs} +115 -58
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-4e711b1e.mjs} +160 -91
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-5bbeff85.mjs} +51 -26
- package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
- package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
- package/dist/documentManager-8327fb6e.mjs +9166 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
- package/dist/editora.min.js +14 -13
- package/dist/editora.umd.js +14 -13
- package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
- package/dist/index-072ef022.js +11 -0
- package/dist/index-49d31221.mjs +16860 -0
- package/dist/{index-DqC57IEH.mjs → index-7da30697.mjs} +163 -124
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-b47a189f.mjs +5782 -0
- package/dist/index.esm.js +12 -7
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
- package/dist/plugin-loader.js +67 -67
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
- package/dist/style.css +1 -0
- package/dist/webcomponent-core.js +164 -125
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +18 -17
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +226 -187
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1324 -1117
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
- package/dist/core.css +0 -1
- package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
- package/dist/index-BslAFzmv.mjs +0 -16544
- package/dist/index-D1LOqg5C.js +0 -10
- package/dist/index.es-BYD2KEo6.mjs +0 -6666
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as v, b as w } from "./anchoredPopover-
|
|
1
|
+
import { a as v, b as w } from "./anchoredPopover-5cca53ba.mjs";
|
|
2
2
|
let l = null, d = null, x = null, i = "#000000";
|
|
3
3
|
const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
|
|
4
4
|
"#000000",
|
|
@@ -22,7 +22,8 @@ function y() {
|
|
|
22
22
|
const r = n.closest(
|
|
23
23
|
'[data-editora-editor="true"], .rte-editor, .editora-editor'
|
|
24
24
|
);
|
|
25
|
-
if (r)
|
|
25
|
+
if (r)
|
|
26
|
+
return r;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
const o = document.activeElement;
|
|
@@ -49,7 +50,8 @@ function E(e) {
|
|
|
49
50
|
const a = Array.from(
|
|
50
51
|
n.querySelectorAll(`[data-command="${e}"]`)
|
|
51
52
|
), s = c(a);
|
|
52
|
-
if (s)
|
|
53
|
+
if (s)
|
|
54
|
+
return s;
|
|
53
55
|
}
|
|
54
56
|
const r = Array.from(
|
|
55
57
|
document.querySelectorAll(`[data-command="${e}"]`)
|
|
@@ -57,11 +59,13 @@ function E(e) {
|
|
|
57
59
|
return c(r);
|
|
58
60
|
}
|
|
59
61
|
function S(e) {
|
|
60
|
-
if (e != null && e.closest(u))
|
|
62
|
+
if (e != null && e.closest(u))
|
|
63
|
+
return !0;
|
|
61
64
|
const o = window.getSelection();
|
|
62
65
|
if (o && o.rangeCount > 0) {
|
|
63
66
|
const c = o.getRangeAt(0).startContainer, n = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
|
|
64
|
-
if (n != null && n.closest(u))
|
|
67
|
+
if (n != null && n.closest(u))
|
|
68
|
+
return !0;
|
|
65
69
|
}
|
|
66
70
|
const t = document.activeElement;
|
|
67
71
|
return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
|
|
@@ -79,7 +83,8 @@ function f(e) {
|
|
|
79
83
|
}
|
|
80
84
|
function T() {
|
|
81
85
|
const e = window.getSelection();
|
|
82
|
-
if (!e || e.rangeCount === 0)
|
|
86
|
+
if (!e || e.rangeCount === 0)
|
|
87
|
+
return "#000000";
|
|
83
88
|
let t = e.getRangeAt(0).startContainer;
|
|
84
89
|
for (; t && t !== document.body; ) {
|
|
85
90
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -92,9 +97,11 @@ function T() {
|
|
|
92
97
|
return "#000000";
|
|
93
98
|
}
|
|
94
99
|
function A(e) {
|
|
95
|
-
if (e.startsWith("#"))
|
|
100
|
+
if (e.startsWith("#"))
|
|
101
|
+
return e;
|
|
96
102
|
const o = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
97
|
-
if (!o)
|
|
103
|
+
if (!o)
|
|
104
|
+
return "#000000";
|
|
98
105
|
const t = parseInt(o[1]), c = parseInt(o[2]), n = parseInt(o[3]);
|
|
99
106
|
return "#" + [t, c, n].map((r) => {
|
|
100
107
|
const a = r.toString(16);
|
|
@@ -163,7 +170,8 @@ function L(e) {
|
|
|
163
170
|
}), P();
|
|
164
171
|
}
|
|
165
172
|
function P() {
|
|
166
|
-
if (!l)
|
|
173
|
+
if (!l)
|
|
174
|
+
return;
|
|
167
175
|
const e = l.querySelector(".rte-color-picker-close");
|
|
168
176
|
e == null || e.addEventListener("click", () => p()), l.querySelectorAll(".rte-color-swatch").forEach((n) => {
|
|
169
177
|
n.addEventListener("click", () => {
|
|
@@ -189,23 +197,27 @@ function P() {
|
|
|
189
197
|
});
|
|
190
198
|
}
|
|
191
199
|
function h(e) {
|
|
192
|
-
if (!l)
|
|
200
|
+
if (!l)
|
|
201
|
+
return;
|
|
193
202
|
const o = l.querySelector(".rte-color-preview-box"), t = l.querySelector(".rte-color-preview-label");
|
|
194
203
|
o && (o.style.backgroundColor = e, o.style.border = e === "#ffffff" ? "1px solid #ccc" : "none"), t && (t.textContent = e.toUpperCase());
|
|
195
204
|
}
|
|
196
205
|
function k(e) {
|
|
197
|
-
if (!l)
|
|
206
|
+
if (!l)
|
|
207
|
+
return;
|
|
198
208
|
l.querySelectorAll(".rte-color-swatch").forEach((t) => {
|
|
199
209
|
t.getAttribute("data-color") === e ? t.classList.add("selected") : t.classList.remove("selected");
|
|
200
210
|
});
|
|
201
211
|
}
|
|
202
212
|
function $(e) {
|
|
203
|
-
if (!l)
|
|
213
|
+
if (!l)
|
|
214
|
+
return;
|
|
204
215
|
const o = l.querySelector(".rte-color-input-native");
|
|
205
216
|
o && (o.value = e);
|
|
206
217
|
}
|
|
207
218
|
function _(e) {
|
|
208
|
-
if (!l)
|
|
219
|
+
if (!l)
|
|
220
|
+
return;
|
|
209
221
|
const o = l.querySelector(".rte-color-input-text");
|
|
210
222
|
o && (o.value = e);
|
|
211
223
|
}
|
|
@@ -526,4 +538,4 @@ const M = () => ({
|
|
|
526
538
|
export {
|
|
527
539
|
M as TextColorPlugin
|
|
528
540
|
};
|
|
529
|
-
//# sourceMappingURL=TextColorPlugin.native-
|
|
541
|
+
//# sourceMappingURL=TextColorPlugin.native-d53ed459.mjs.map
|
package/dist/{TrackChangesPlugin.native-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs}
RENAMED
|
@@ -16,20 +16,25 @@ const J = typeof InputEvent != "undefined" && typeof InputEvent.prototype == "ob
|
|
|
16
16
|
"CANVAS"
|
|
17
17
|
]);
|
|
18
18
|
function ee(e) {
|
|
19
|
-
if (!e)
|
|
19
|
+
if (!e)
|
|
20
|
+
return null;
|
|
20
21
|
const t = e.querySelector('[contenteditable="true"]');
|
|
21
22
|
return t instanceof HTMLElement ? t : null;
|
|
22
23
|
}
|
|
23
24
|
function te() {
|
|
24
|
-
if (typeof window == "undefined")
|
|
25
|
+
if (typeof window == "undefined")
|
|
26
|
+
return null;
|
|
25
27
|
const e = window[_];
|
|
26
|
-
if (!(e instanceof HTMLElement))
|
|
28
|
+
if (!(e instanceof HTMLElement))
|
|
29
|
+
return null;
|
|
27
30
|
window[_] = null;
|
|
28
31
|
const t = e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? e : null);
|
|
29
32
|
if (t) {
|
|
30
33
|
const r = ee(t);
|
|
31
|
-
if (r)
|
|
32
|
-
|
|
34
|
+
if (r)
|
|
35
|
+
return r;
|
|
36
|
+
if (t.getAttribute("contenteditable") === "true")
|
|
37
|
+
return t;
|
|
33
38
|
}
|
|
34
39
|
if (e.getAttribute("contenteditable") === "true")
|
|
35
40
|
return e;
|
|
@@ -37,25 +42,32 @@ function te() {
|
|
|
37
42
|
return n instanceof HTMLElement ? n : null;
|
|
38
43
|
}
|
|
39
44
|
function ne(e) {
|
|
40
|
-
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
45
|
+
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
46
|
+
return e.contentElement;
|
|
41
47
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
42
48
|
const o = e.editorElement;
|
|
43
|
-
if (o.getAttribute("contenteditable") === "true")
|
|
49
|
+
if (o.getAttribute("contenteditable") === "true")
|
|
50
|
+
return o;
|
|
44
51
|
const a = o.querySelector('[contenteditable="true"]');
|
|
45
|
-
if (a instanceof HTMLElement)
|
|
52
|
+
if (a instanceof HTMLElement)
|
|
53
|
+
return a;
|
|
46
54
|
}
|
|
47
55
|
const t = te();
|
|
48
|
-
if (t && document.contains(t))
|
|
56
|
+
if (t && document.contains(t))
|
|
57
|
+
return t;
|
|
49
58
|
const n = window.getSelection();
|
|
50
59
|
if (n && n.rangeCount > 0) {
|
|
51
60
|
const o = n.getRangeAt(0).startContainer, a = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement, c = a == null ? void 0 : a.closest(p);
|
|
52
|
-
if (c)
|
|
61
|
+
if (c)
|
|
62
|
+
return c;
|
|
53
63
|
}
|
|
54
64
|
const r = document.activeElement;
|
|
55
65
|
if (r) {
|
|
56
|
-
if (r.matches(p))
|
|
66
|
+
if (r.matches(p))
|
|
67
|
+
return r;
|
|
57
68
|
const o = r.closest(p);
|
|
58
|
-
if (o)
|
|
69
|
+
if (o)
|
|
70
|
+
return o;
|
|
59
71
|
}
|
|
60
72
|
return h != null && h.isConnected ? h : document.querySelector(p);
|
|
61
73
|
}
|
|
@@ -89,7 +101,8 @@ function ae(e) {
|
|
|
89
101
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
90
102
|
}
|
|
91
103
|
function oe(e, t) {
|
|
92
|
-
if (t === e.innerHTML)
|
|
104
|
+
if (t === e.innerHTML)
|
|
105
|
+
return;
|
|
93
106
|
const n = window.execEditorCommand || window.executeEditorCommand;
|
|
94
107
|
if (typeof n == "function")
|
|
95
108
|
try {
|
|
@@ -152,7 +165,8 @@ function ie(e, t) {
|
|
|
152
165
|
}
|
|
153
166
|
function b(e) {
|
|
154
167
|
const t = window.getSelection();
|
|
155
|
-
if (!t || t.rangeCount === 0)
|
|
168
|
+
if (!t || t.rangeCount === 0)
|
|
169
|
+
return null;
|
|
156
170
|
const n = t.getRangeAt(0);
|
|
157
171
|
return e.contains(n.commonAncestorContainer) ? n : null;
|
|
158
172
|
}
|
|
@@ -161,7 +175,8 @@ function ue() {
|
|
|
161
175
|
"selectionchange",
|
|
162
176
|
() => {
|
|
163
177
|
const e = window.getSelection();
|
|
164
|
-
if (!e || e.rangeCount === 0)
|
|
178
|
+
if (!e || e.rangeCount === 0)
|
|
179
|
+
return;
|
|
165
180
|
const t = e.getRangeAt(0), n = E(t.startContainer), r = (n == null ? void 0 : n.closest(p)) || null;
|
|
166
181
|
r && (L.set(r, t.cloneRange()), h = r);
|
|
167
182
|
},
|
|
@@ -174,7 +189,8 @@ function C(e, t) {
|
|
|
174
189
|
return;
|
|
175
190
|
}
|
|
176
191
|
const n = window.getSelection();
|
|
177
|
-
if (!n)
|
|
192
|
+
if (!n)
|
|
193
|
+
return;
|
|
178
194
|
const r = document.createRange();
|
|
179
195
|
r.setStartAfter(t), r.collapse(!0), n.removeAllRanges(), n.addRange(r), e.focus({ preventScroll: !0 });
|
|
180
196
|
}
|
|
@@ -184,13 +200,15 @@ function O(e, t) {
|
|
|
184
200
|
return;
|
|
185
201
|
}
|
|
186
202
|
const n = window.getSelection();
|
|
187
|
-
if (!n)
|
|
203
|
+
if (!n)
|
|
204
|
+
return;
|
|
188
205
|
const r = document.createRange();
|
|
189
206
|
r.setStartBefore(t), r.collapse(!0), n.removeAllRanges(), n.addRange(r), e.focus({ preventScroll: !0 });
|
|
190
207
|
}
|
|
191
208
|
function de(e, t, n) {
|
|
192
209
|
const r = window.getSelection();
|
|
193
|
-
if (!r)
|
|
210
|
+
if (!r)
|
|
211
|
+
return;
|
|
194
212
|
const o = document.createRange();
|
|
195
213
|
o.setStart(t, Math.max(0, n)), o.collapse(!0), r.removeAllRanges(), r.addRange(o), e.focus({ preventScroll: !0 });
|
|
196
214
|
}
|
|
@@ -200,13 +218,17 @@ function V(e) {
|
|
|
200
218
|
const c = L.get(e);
|
|
201
219
|
c && e.contains(c.commonAncestorContainer) && (t = c.cloneRange());
|
|
202
220
|
}
|
|
203
|
-
if (!t || !t.collapsed)
|
|
221
|
+
if (!t || !t.collapsed)
|
|
222
|
+
return;
|
|
204
223
|
const n = E(t.startContainer);
|
|
205
|
-
if (!n)
|
|
224
|
+
if (!n)
|
|
225
|
+
return;
|
|
206
226
|
const r = n.closest(g);
|
|
207
|
-
if (!r || !e.contains(r) || !r.parentNode)
|
|
227
|
+
if (!r || !e.contains(r) || !r.parentNode)
|
|
228
|
+
return;
|
|
208
229
|
const o = window.getSelection();
|
|
209
|
-
if (!o)
|
|
230
|
+
if (!o)
|
|
231
|
+
return;
|
|
210
232
|
const a = document.createRange();
|
|
211
233
|
a.setStartAfter(r), a.collapse(!0), o.removeAllRanges(), o.addRange(a), e.focus({ preventScroll: !0 });
|
|
212
234
|
}
|
|
@@ -218,7 +240,8 @@ function K(e, t) {
|
|
|
218
240
|
}
|
|
219
241
|
function fe(e) {
|
|
220
242
|
const t = b(e);
|
|
221
|
-
if (t && t.collapsed)
|
|
243
|
+
if (t && t.collapsed)
|
|
244
|
+
return t;
|
|
222
245
|
const n = L.get(e);
|
|
223
246
|
return n && n.collapsed && e.contains(n.commonAncestorContainer) ? n.cloneRange() : null;
|
|
224
247
|
}
|
|
@@ -226,11 +249,14 @@ function ge(e) {
|
|
|
226
249
|
return e.matches(g) || e.matches(f) ? (e.textContent || "").replace(/\u200B/g, "").trim().length > 0 : Q.has(e.tagName);
|
|
227
250
|
}
|
|
228
251
|
function W(e, t) {
|
|
229
|
-
if (t !== "insertParagraph")
|
|
252
|
+
if (t !== "insertParagraph")
|
|
253
|
+
return !1;
|
|
230
254
|
const n = fe(e);
|
|
231
|
-
if (!n)
|
|
255
|
+
if (!n)
|
|
256
|
+
return !1;
|
|
232
257
|
const r = E(n.startContainer);
|
|
233
|
-
if (!r)
|
|
258
|
+
if (!r)
|
|
259
|
+
return !1;
|
|
234
260
|
const o = r.closest("li");
|
|
235
261
|
return !(o instanceof HTMLElement) || !e.contains(o) || (o.textContent || "").replace(/\u200B/g, "").trim().length > 0 ? !1 : !Array.from(o.querySelectorAll("*")).some(
|
|
236
262
|
(s) => ge(s)
|
|
@@ -247,7 +273,8 @@ function he(e) {
|
|
|
247
273
|
}
|
|
248
274
|
function me(e) {
|
|
249
275
|
return (e.textContent || "").length > 0 ? !0 : Array.from(e.childNodes).some((n) => {
|
|
250
|
-
if (n.nodeType !== Node.ELEMENT_NODE)
|
|
276
|
+
if (n.nodeType !== Node.ELEMENT_NODE)
|
|
277
|
+
return !1;
|
|
251
278
|
const r = n;
|
|
252
279
|
return ["BR", "IMG", "TABLE", "VIDEO", "AUDIO", "SVG", "MATH"].includes(r.tagName);
|
|
253
280
|
});
|
|
@@ -256,13 +283,15 @@ function pe(e) {
|
|
|
256
283
|
return Array.from(e.childNodes).some((t) => {
|
|
257
284
|
if (t.nodeType === Node.TEXT_NODE)
|
|
258
285
|
return (t.textContent || "").length > 0;
|
|
259
|
-
if (t.nodeType !== Node.ELEMENT_NODE)
|
|
286
|
+
if (t.nodeType !== Node.ELEMENT_NODE)
|
|
287
|
+
return !1;
|
|
260
288
|
const n = t;
|
|
261
289
|
return ["BR", "IMG", "TABLE", "VIDEO", "AUDIO", "SVG", "MATH"].includes(n.tagName);
|
|
262
290
|
});
|
|
263
291
|
}
|
|
264
292
|
function Ee(e, t, n) {
|
|
265
|
-
if (!e.collapsed)
|
|
293
|
+
if (!e.collapsed)
|
|
294
|
+
return null;
|
|
266
295
|
const r = e.startContainer, o = e.startOffset;
|
|
267
296
|
let a = null;
|
|
268
297
|
if (r.nodeType === Node.TEXT_NODE) {
|
|
@@ -289,12 +318,14 @@ function Te(e, t, n) {
|
|
|
289
318
|
}
|
|
290
319
|
function x(e, t, n) {
|
|
291
320
|
const r = t.parentNode;
|
|
292
|
-
if (!r)
|
|
321
|
+
if (!r)
|
|
322
|
+
return !1;
|
|
293
323
|
const o = Array.prototype.indexOf.call(r.childNodes, t), a = ke(t, n === "backward");
|
|
294
324
|
return a ? (n === "backward" ? a.data = a.data.slice(0, -1) : a.data = a.data.slice(1), a.data.length === 0 && a.remove(), pe(t) ? (n === "backward" ? C(e, t) : O(e, t), !0) : (t.remove(), de(e, r, o), !0)) : !1;
|
|
295
325
|
}
|
|
296
326
|
function Z(e) {
|
|
297
|
-
if (e.startContainer !== e.endContainer || e.startContainer.nodeType !== Node.ELEMENT_NODE)
|
|
327
|
+
if (e.startContainer !== e.endContainer || e.startContainer.nodeType !== Node.ELEMENT_NODE)
|
|
328
|
+
return null;
|
|
298
329
|
const t = e.startContainer;
|
|
299
330
|
return e.endOffset - e.startOffset !== 1 ? null : t.childNodes[e.startOffset] || null;
|
|
300
331
|
}
|
|
@@ -336,19 +367,23 @@ function Ae(e, t) {
|
|
|
336
367
|
return !1;
|
|
337
368
|
}
|
|
338
369
|
});
|
|
339
|
-
if (r.length !== 1)
|
|
370
|
+
if (r.length !== 1)
|
|
371
|
+
return null;
|
|
340
372
|
const o = r[0], a = (e.toString() || "").replace(/\s+/g, ""), c = (o.textContent || "").replace(/\s+/g, "");
|
|
341
373
|
return !c || a !== c ? null : o;
|
|
342
374
|
}
|
|
343
375
|
function U(e, t, n) {
|
|
344
|
-
if (t.collapsed)
|
|
376
|
+
if (t.collapsed)
|
|
377
|
+
return null;
|
|
345
378
|
const r = t.cloneContents();
|
|
346
|
-
if (!me(r))
|
|
379
|
+
if (!me(r))
|
|
380
|
+
return null;
|
|
347
381
|
const o = ie(r, n);
|
|
348
382
|
return t.deleteContents(), t.insertNode(o), C(e, o), o;
|
|
349
383
|
}
|
|
350
384
|
function Ne(e, t, n) {
|
|
351
|
-
if (!t.collapsed)
|
|
385
|
+
if (!t.collapsed)
|
|
386
|
+
return t;
|
|
352
387
|
const r = t.startContainer, o = t.startOffset;
|
|
353
388
|
if (r.nodeType === Node.TEXT_NODE) {
|
|
354
389
|
const s = r;
|
|
@@ -371,7 +406,8 @@ function Ne(e, t, n) {
|
|
|
371
406
|
const u = t.cloneRange();
|
|
372
407
|
if (i.nodeType === Node.TEXT_NODE) {
|
|
373
408
|
const d = i;
|
|
374
|
-
if (d.length === 0)
|
|
409
|
+
if (d.length === 0)
|
|
410
|
+
continue;
|
|
375
411
|
u.setStart(d, d.length - 1), u.setEnd(d, d.length);
|
|
376
412
|
} else
|
|
377
413
|
u.setStartBefore(i), u.setEndAfter(i);
|
|
@@ -385,7 +421,8 @@ function Ne(e, t, n) {
|
|
|
385
421
|
const u = t.cloneRange();
|
|
386
422
|
if (i.nodeType === Node.TEXT_NODE) {
|
|
387
423
|
const d = i;
|
|
388
|
-
if (d.length === 0)
|
|
424
|
+
if (d.length === 0)
|
|
425
|
+
continue;
|
|
389
426
|
u.setStart(d, 0), u.setEnd(d, 1);
|
|
390
427
|
} else
|
|
391
428
|
u.setStartBefore(i), u.setEndAfter(i);
|
|
@@ -413,7 +450,8 @@ function Ne(e, t, n) {
|
|
|
413
450
|
}
|
|
414
451
|
function z(e, t, n) {
|
|
415
452
|
let r = b(e);
|
|
416
|
-
if (!r)
|
|
453
|
+
if (!r)
|
|
454
|
+
return !1;
|
|
417
455
|
const o = Ce(e, r.cloneRange());
|
|
418
456
|
if (!ce(o, r)) {
|
|
419
457
|
const d = window.getSelection();
|
|
@@ -432,7 +470,8 @@ function z(e, t, n) {
|
|
|
432
470
|
}
|
|
433
471
|
function $(e, t, n) {
|
|
434
472
|
const r = b(e);
|
|
435
|
-
if (!r)
|
|
473
|
+
if (!r)
|
|
474
|
+
return !1;
|
|
436
475
|
const o = n.includes("Backward") ? "backward" : "forward", a = e.innerHTML;
|
|
437
476
|
if (r.collapsed && Te(e, r.cloneRange(), o))
|
|
438
477
|
return m(e, a), !0;
|
|
@@ -445,7 +484,8 @@ function $(e, t, n) {
|
|
|
445
484
|
return m(e, a), !0;
|
|
446
485
|
}
|
|
447
486
|
const s = r.collapsed ? Ne(e, r.cloneRange(), o) : r.cloneRange();
|
|
448
|
-
if (!s)
|
|
487
|
+
if (!s)
|
|
488
|
+
return !1;
|
|
449
489
|
const l = I(s, e);
|
|
450
490
|
return l ? (o === "backward" ? O(e, l) : C(e, l), !0) : U(e, s, t) ? (H(e), m(e, a), !0) : !1;
|
|
451
491
|
}
|
|
@@ -466,7 +506,8 @@ function H(e) {
|
|
|
466
506
|
let n = !0;
|
|
467
507
|
for (; n; )
|
|
468
508
|
n = !1, Array.from(e.querySelectorAll(f)).forEach((o) => {
|
|
469
|
-
if (!o.isConnected)
|
|
509
|
+
if (!o.isConnected)
|
|
510
|
+
return;
|
|
470
511
|
let a = o.nextSibling;
|
|
471
512
|
for (; a && a.nodeType === Node.TEXT_NODE && !(a.textContent || "").trim(); )
|
|
472
513
|
a = a.nextSibling;
|
|
@@ -483,7 +524,8 @@ function Y(e) {
|
|
|
483
524
|
}
|
|
484
525
|
function ye(e) {
|
|
485
526
|
const t = b(e);
|
|
486
|
-
if (!t)
|
|
527
|
+
if (!t)
|
|
528
|
+
return [];
|
|
487
529
|
const n = /* @__PURE__ */ new Set(), r = t.startContainer.nodeType === Node.ELEMENT_NODE ? t.startContainer : t.startContainer.parentElement, o = t.endContainer.nodeType === Node.ELEMENT_NODE ? t.endContainer : t.endContainer.parentElement, a = r == null ? void 0 : r.closest(w);
|
|
488
530
|
a && e.contains(a) && n.add(a);
|
|
489
531
|
const c = o == null ? void 0 : o.closest(w);
|
|
@@ -497,10 +539,12 @@ function ye(e) {
|
|
|
497
539
|
}
|
|
498
540
|
function A(e, t, n) {
|
|
499
541
|
const r = n === "all" ? Y(e) : ye(e);
|
|
500
|
-
if (r.length === 0)
|
|
542
|
+
if (r.length === 0)
|
|
543
|
+
return !1;
|
|
501
544
|
const o = e.innerHTML;
|
|
502
545
|
return r.forEach((a) => {
|
|
503
|
-
if (!a.isConnected)
|
|
546
|
+
if (!a.isConnected)
|
|
547
|
+
return;
|
|
504
548
|
const c = a.matches(g), s = a.matches(f);
|
|
505
549
|
if (!(!c && !s)) {
|
|
506
550
|
if (t === "accept") {
|
|
@@ -512,7 +556,8 @@ function A(e, t, n) {
|
|
|
512
556
|
}), H(e), m(e, o), !0;
|
|
513
557
|
}
|
|
514
558
|
function Se(e) {
|
|
515
|
-
if (!(e instanceof Node))
|
|
559
|
+
if (!(e instanceof Node))
|
|
560
|
+
return null;
|
|
516
561
|
const t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
517
562
|
return (t == null ? void 0 : t.closest(p)) || null;
|
|
518
563
|
}
|
|
@@ -520,9 +565,11 @@ function Me() {
|
|
|
520
565
|
F || typeof document == "undefined" || (F = !0, document.addEventListener(
|
|
521
566
|
"focusin",
|
|
522
567
|
(e) => {
|
|
523
|
-
if (!T.enabledByDefault)
|
|
568
|
+
if (!T.enabledByDefault)
|
|
569
|
+
return;
|
|
524
570
|
const t = Se(e.target);
|
|
525
|
-
if (!t)
|
|
571
|
+
if (!t)
|
|
572
|
+
return;
|
|
526
573
|
h = t;
|
|
527
574
|
const n = R(t, T);
|
|
528
575
|
n.enabled ? (M(t, n), y(t, !0), S(t, "toggleTrackChanges", !0)) : k(t);
|
|
@@ -532,7 +579,8 @@ function Me() {
|
|
|
532
579
|
}
|
|
533
580
|
function we(e, t) {
|
|
534
581
|
return (n) => {
|
|
535
|
-
if (!t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
582
|
+
if (!t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
583
|
+
return;
|
|
536
584
|
h = e;
|
|
537
585
|
const r = n.inputType || "";
|
|
538
586
|
if (r === "insertParagraph" || r === "insertLineBreak") {
|
|
@@ -547,14 +595,16 @@ function we(e, t) {
|
|
|
547
595
|
}
|
|
548
596
|
if (r === "insertText" || r === "insertCompositionText") {
|
|
549
597
|
const o = n.data || "";
|
|
550
|
-
if (!o)
|
|
598
|
+
if (!o)
|
|
599
|
+
return;
|
|
551
600
|
n.preventDefault(), z(e, t, o);
|
|
552
601
|
}
|
|
553
602
|
};
|
|
554
603
|
}
|
|
555
604
|
function Re(e, t) {
|
|
556
605
|
return (n) => {
|
|
557
|
-
if (!t.enabled || e.getAttribute("data-track-changes") !== "true" || n.key !== "Enter" || J)
|
|
606
|
+
if (!t.enabled || e.getAttribute("data-track-changes") !== "true" || n.key !== "Enter" || J)
|
|
607
|
+
return;
|
|
558
608
|
const r = n.shiftKey ? "insertLineBreak" : "insertParagraph";
|
|
559
609
|
W(e, r) || (h = e, n.preventDefault(), n.stopPropagation(), K(e, r));
|
|
560
610
|
};
|
|
@@ -562,22 +612,26 @@ function Re(e, t) {
|
|
|
562
612
|
function xe(e, t) {
|
|
563
613
|
return (n) => {
|
|
564
614
|
var o;
|
|
565
|
-
if (n.__editoraSmartPasteHandled === !0 || n.defaultPrevented || !t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
615
|
+
if (n.__editoraSmartPasteHandled === !0 || n.defaultPrevented || !t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
616
|
+
return;
|
|
566
617
|
const r = ((o = n.clipboardData) == null ? void 0 : o.getData("text/plain")) || "";
|
|
567
618
|
r && (n.preventDefault(), h = e, z(e, t, r));
|
|
568
619
|
};
|
|
569
620
|
}
|
|
570
621
|
function ve(e, t) {
|
|
571
622
|
return (n) => {
|
|
572
|
-
if (!t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
623
|
+
if (!t.enabled || e.getAttribute("data-track-changes") !== "true")
|
|
624
|
+
return;
|
|
573
625
|
const r = b(e);
|
|
574
|
-
if (!r || r.collapsed)
|
|
626
|
+
if (!r || r.collapsed)
|
|
627
|
+
return;
|
|
575
628
|
const o = r.toString();
|
|
576
629
|
n.clipboardData && (n.clipboardData.setData("text/plain", o), n.preventDefault()), h = e, $(e, t, "deleteByCut");
|
|
577
630
|
};
|
|
578
631
|
}
|
|
579
632
|
function M(e, t) {
|
|
580
|
-
if (N.has(e))
|
|
633
|
+
if (N.has(e))
|
|
634
|
+
return;
|
|
581
635
|
k(e);
|
|
582
636
|
const n = {
|
|
583
637
|
beforeInput: we(e, t),
|
|
@@ -592,7 +646,8 @@ function X(e) {
|
|
|
592
646
|
t && (e.removeEventListener("beforeinput", t.beforeInput), e.removeEventListener("keydown", t.keydown), e.removeEventListener("paste", t.paste), e.removeEventListener("cut", t.cut), N.delete(e), D.delete(e));
|
|
593
647
|
}
|
|
594
648
|
function Le() {
|
|
595
|
-
if (q || typeof document == "undefined")
|
|
649
|
+
if (q || typeof document == "undefined")
|
|
650
|
+
return;
|
|
596
651
|
q = !0;
|
|
597
652
|
const e = document.createElement("style");
|
|
598
653
|
e.id = "rte-track-changes-styles", e.textContent = `
|
|
@@ -685,7 +740,8 @@ const De = (e = {}) => {
|
|
|
685
740
|
return o ? (h = o, o) : null;
|
|
686
741
|
}, n = (r) => {
|
|
687
742
|
const o = t(r);
|
|
688
|
-
if (!o)
|
|
743
|
+
if (!o)
|
|
744
|
+
return null;
|
|
689
745
|
const a = R(o, e);
|
|
690
746
|
return { editor: o, state: a };
|
|
691
747
|
};
|
|
@@ -719,7 +775,8 @@ const De = (e = {}) => {
|
|
|
719
775
|
commands: {
|
|
720
776
|
toggleTrackChanges: (r, o) => {
|
|
721
777
|
const a = n(o);
|
|
722
|
-
if (!a)
|
|
778
|
+
if (!a)
|
|
779
|
+
return !1;
|
|
723
780
|
const { editor: c, state: s } = a;
|
|
724
781
|
return s.enabled = !s.enabled, s.enabled ? M(c, s) : (X(c), k(c), V(c)), y(c, s.enabled), S(c, "toggleTrackChanges", s.enabled), c.dispatchEvent(new CustomEvent("editora:track-changes-toggle", {
|
|
725
782
|
bubbles: !0,
|
|
@@ -758,4 +815,4 @@ const De = (e = {}) => {
|
|
|
758
815
|
export {
|
|
759
816
|
De as TrackChangesPlugin
|
|
760
817
|
};
|
|
761
|
-
//# sourceMappingURL=TrackChangesPlugin.native-
|
|
818
|
+
//# sourceMappingURL=TrackChangesPlugin.native-e96da509.mjs.map
|