@editora/plugins 1.0.7 → 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/LICENSE +21 -0
- package/README.md +72 -4
- package/dist/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/anchor.cjs.js +11 -11
- package/dist/anchor.esm.js +130 -107
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/approval-workflow.cjs.js +447 -0
- package/dist/approval-workflow.esm.js +1070 -0
- package/dist/background-color.cjs.js +3 -3
- package/dist/background-color.esm.js +116 -119
- package/dist/blocks-library.cjs.js +442 -0
- package/dist/blocks-library.esm.js +1317 -0
- package/dist/citations.cjs.js +548 -0
- package/dist/citations.esm.js +1457 -0
- package/dist/code.cjs.js +82 -102
- package/dist/code.esm.js +1172 -662
- package/dist/comments.cjs.js +10 -10
- package/dist/comments.esm.js +195 -177
- package/dist/conditional-content.cjs.js +626 -0
- package/dist/conditional-content.esm.js +1360 -0
- package/dist/content-rules.cjs.js +408 -0
- package/dist/content-rules.esm.js +1093 -0
- package/dist/data-binding.cjs.js +321 -0
- package/dist/data-binding.esm.js +913 -0
- package/dist/doc-schema.cjs.js +398 -0
- package/dist/doc-schema.esm.js +1310 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/embed-iframe.cjs.js +2 -2
- package/dist/embed-iframe.esm.js +8 -5
- package/dist/emojis.cjs.js +64 -39
- package/dist/emojis.esm.js +133 -104
- package/dist/enterprise.cjs.js +1 -0
- package/dist/enterprise.esm.js +56 -0
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/html2canvas.esm-BWVIUcAF.mjs +4802 -0
- package/dist/{index-Bskk414V.mjs → index-BFsKNTTj.mjs} +50 -50
- package/dist/index-CvJk4DKa.js +221 -0
- package/dist/index-D3CycEFU.mjs +16543 -0
- package/dist/index-tqLTHcO6.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-Cz1qItab.js → index.es-CE_A4QSm.js} +5 -5
- package/dist/{index.es-DEcRmSTY.mjs → index.es-DQ78mYYo.mjs} +4 -3
- package/dist/index.esm.js +111 -75
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/jspdf.es.min-DQCoX5yh.mjs +7889 -0
- package/dist/link.cjs.js +6 -6
- package/dist/link.esm.js +41 -39
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +151 -112
- package/dist/media-manager.cjs.js +15 -15
- package/dist/media-manager.esm.js +227 -206
- package/dist/mentions.cjs.js +105 -0
- package/dist/mentions.esm.js +726 -0
- package/dist/merge-tag.cjs.js +44 -12
- package/dist/merge-tag.esm.js +368 -241
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +85 -77
- package/dist/pii-redaction.cjs.js +436 -0
- package/dist/pii-redaction.esm.js +1377 -0
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +29 -29
- package/dist/slash-commands.cjs.js +90 -0
- package/dist/slash-commands.esm.js +752 -0
- package/dist/smart-paste.cjs.js +398 -0
- package/dist/smart-paste.esm.js +1388 -0
- package/dist/special-characters.cjs.js +83 -45
- package/dist/special-characters.esm.js +149 -100
- package/dist/spell-check.cjs.js +9 -9
- package/dist/spell-check.esm.js +235 -216
- package/dist/template.cjs.js +14 -14
- package/dist/template.esm.js +157 -131
- package/dist/text-color.cjs.js +9 -9
- package/dist/text-color.esm.js +131 -115
- package/dist/track-changes.cjs.js +77 -0
- package/dist/track-changes.esm.js +755 -0
- package/dist/translation-workflow.cjs.js +626 -0
- package/dist/translation-workflow.esm.js +1718 -0
- package/dist/version-diff.cjs.js +362 -0
- package/dist/version-diff.esm.js +768 -0
- package/index.d.ts +849 -1
- package/package.json +105 -6
- package/dist/colorSelectionApply-C0iOfMWb.js +0 -1
- package/dist/colorSelectionApply-D8r_gV32.mjs +0 -63
- package/dist/documentManager-DRUc1-Cs.mjs +0 -37581
- package/dist/documentManager-_tQQfQi9.js +0 -317
- package/dist/index-D3pJyAsj.js +0 -1
package/dist/text-color.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
let
|
|
3
|
-
const
|
|
1
|
+
import { a as y, b as w } from "./anchoredPopover-Dts0IrgU.mjs";
|
|
2
|
+
let n = null, d = null, g = null, i = "#000000";
|
|
3
|
+
const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
|
|
4
4
|
"#000000",
|
|
5
5
|
"#ffffff",
|
|
6
6
|
"#808080",
|
|
@@ -14,79 +14,95 @@ const s = '[data-theme="dark"], .dark, .editora-theme-dark', k = [
|
|
|
14
14
|
"#800080",
|
|
15
15
|
"#ffc0cb"
|
|
16
16
|
];
|
|
17
|
-
function
|
|
17
|
+
function v() {
|
|
18
18
|
const e = window.getSelection();
|
|
19
19
|
if (e && e.rangeCount > 0) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
20
|
+
const c = e.getRangeAt(0).startContainer, l = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
|
|
21
|
+
if (l) {
|
|
22
|
+
const r = l.closest(
|
|
23
23
|
'[data-editora-editor="true"], .rte-editor, .editora-editor'
|
|
24
24
|
);
|
|
25
|
-
if (
|
|
25
|
+
if (r) return r;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const o = document.activeElement;
|
|
29
|
+
return o ? o.closest(
|
|
30
30
|
'[data-editora-editor="true"], .rte-editor, .editora-editor'
|
|
31
31
|
) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const t =
|
|
35
|
-
if (t) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
function E(e) {
|
|
34
|
+
const o = window.__editoraLastCommand, t = window.__editoraLastCommandButton;
|
|
35
|
+
if (o === e && t && t.isConnected) {
|
|
36
|
+
const a = window.getComputedStyle(t), s = t.getBoundingClientRect();
|
|
37
|
+
if (a.display !== "none" && a.visibility !== "hidden" && a.pointerEvents !== "none" && !(s.width === 0 && s.height === 0))
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
const c = (a) => {
|
|
41
|
+
for (const s of a) {
|
|
42
|
+
const b = window.getComputedStyle(s), h = s.getBoundingClientRect();
|
|
43
|
+
if (!(b.display === "none" || b.visibility === "hidden" || b.pointerEvents === "none") && !(h.width === 0 && h.height === 0))
|
|
44
|
+
return s;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}, l = v();
|
|
48
|
+
if (l) {
|
|
49
|
+
const a = Array.from(
|
|
50
|
+
l.querySelectorAll(`[data-command="${e}"]`)
|
|
51
|
+
), s = c(a);
|
|
52
|
+
if (s) return s;
|
|
40
53
|
}
|
|
41
|
-
|
|
54
|
+
const r = Array.from(
|
|
55
|
+
document.querySelectorAll(`[data-command="${e}"]`)
|
|
56
|
+
);
|
|
57
|
+
return c(r);
|
|
42
58
|
}
|
|
43
|
-
function
|
|
44
|
-
if (e?.closest(
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
if ((
|
|
59
|
+
function S(e) {
|
|
60
|
+
if (e?.closest(u)) return !0;
|
|
61
|
+
const o = window.getSelection();
|
|
62
|
+
if (o && o.rangeCount > 0) {
|
|
63
|
+
const c = o.getRangeAt(0).startContainer;
|
|
64
|
+
if ((c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement)?.closest(u)) return !0;
|
|
49
65
|
}
|
|
50
|
-
return document.activeElement?.closest(
|
|
66
|
+
return document.activeElement?.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
|
|
51
67
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
68
|
+
function f(e) {
|
|
69
|
+
return y({
|
|
54
70
|
color: e,
|
|
55
71
|
className: "rte-text-color",
|
|
56
72
|
styleProperty: "color",
|
|
57
73
|
commands: ["foreColor"],
|
|
58
|
-
savedRange:
|
|
59
|
-
getActiveEditorRoot:
|
|
74
|
+
savedRange: g,
|
|
75
|
+
getActiveEditorRoot: v,
|
|
60
76
|
warnMessage: "[TextColor] Could not apply color for current selection"
|
|
61
77
|
});
|
|
62
78
|
}
|
|
63
|
-
function
|
|
79
|
+
function T() {
|
|
64
80
|
const e = window.getSelection();
|
|
65
81
|
if (!e || e.rangeCount === 0) return "#000000";
|
|
66
|
-
let
|
|
67
|
-
for (;
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
82
|
+
let t = e.getRangeAt(0).startContainer;
|
|
83
|
+
for (; t && t !== document.body; ) {
|
|
84
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
85
|
+
const c = t, l = c.style.color || window.getComputedStyle(c).color;
|
|
86
|
+
if (l && l !== "rgb(0, 0, 0)")
|
|
87
|
+
return A(l);
|
|
72
88
|
}
|
|
73
|
-
|
|
89
|
+
t = t.parentNode;
|
|
74
90
|
}
|
|
75
91
|
return "#000000";
|
|
76
92
|
}
|
|
77
|
-
function
|
|
93
|
+
function A(e) {
|
|
78
94
|
if (e.startsWith("#")) return e;
|
|
79
|
-
const
|
|
80
|
-
if (!
|
|
81
|
-
const
|
|
82
|
-
return "#" + [
|
|
83
|
-
const
|
|
84
|
-
return
|
|
95
|
+
const o = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
96
|
+
if (!o) return "#000000";
|
|
97
|
+
const t = parseInt(o[1]), c = parseInt(o[2]), l = parseInt(o[3]);
|
|
98
|
+
return "#" + [t, c, l].map((r) => {
|
|
99
|
+
const a = r.toString(16);
|
|
100
|
+
return a.length === 1 ? "0" + a : a;
|
|
85
101
|
}).join("");
|
|
86
102
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
|
|
103
|
+
function L(e) {
|
|
104
|
+
const o = window.getSelection();
|
|
105
|
+
o && o.rangeCount > 0 && (g = o.getRangeAt(0).cloneRange()), i = T(), n = document.createElement("div"), n.className = "rte-inline-color-picker", S(e) && n.classList.add("rte-theme-dark"), n.addEventListener("click", (t) => t.stopPropagation()), n.innerHTML = `
|
|
90
106
|
<div class="rte-color-picker-header">
|
|
91
107
|
<span class="rte-color-picker-title">Text Color</span>
|
|
92
108
|
<button class="rte-color-picker-close" aria-label="Close">×</button>
|
|
@@ -103,13 +119,13 @@ function E(e) {
|
|
|
103
119
|
<div class="rte-color-section">
|
|
104
120
|
<label class="rte-color-section-label">Colors</label>
|
|
105
121
|
<div class="rte-color-palette">
|
|
106
|
-
${
|
|
122
|
+
${C.map((t) => `
|
|
107
123
|
<button
|
|
108
|
-
class="rte-color-swatch ${i ===
|
|
109
|
-
style="background-color: ${
|
|
110
|
-
data-color="${
|
|
111
|
-
title="${
|
|
112
|
-
aria-label="${
|
|
124
|
+
class="rte-color-swatch ${i === t ? "selected" : ""}"
|
|
125
|
+
style="background-color: ${t}; ${t === "#ffffff" ? "border: 1px solid #ccc;" : ""}"
|
|
126
|
+
data-color="${t}"
|
|
127
|
+
title="${t.toUpperCase()}"
|
|
128
|
+
aria-label="${t.toUpperCase()}"
|
|
113
129
|
></button>
|
|
114
130
|
`).join("")}
|
|
115
131
|
</div>
|
|
@@ -136,72 +152,72 @@ function E(e) {
|
|
|
136
152
|
</div>
|
|
137
153
|
</div>
|
|
138
154
|
</div>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
`, document.body.appendChild(n), d && (d.destroy(), d = null), d = w({
|
|
156
|
+
popover: n,
|
|
157
|
+
anchor: e,
|
|
158
|
+
onClose: p,
|
|
159
|
+
gap: 4,
|
|
160
|
+
margin: 8,
|
|
161
|
+
zIndex: 1e4
|
|
162
|
+
}), P();
|
|
142
163
|
}
|
|
143
|
-
function
|
|
144
|
-
if (!
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
164
|
+
function P() {
|
|
165
|
+
if (!n) return;
|
|
166
|
+
n.querySelector(".rte-color-picker-close")?.addEventListener("click", () => p()), n.querySelectorAll(".rte-color-swatch").forEach((l) => {
|
|
167
|
+
l.addEventListener("click", () => {
|
|
168
|
+
const r = l.getAttribute("data-color");
|
|
169
|
+
r && (i = r, f(r), p());
|
|
149
170
|
});
|
|
150
171
|
});
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
i =
|
|
172
|
+
const t = n.querySelector(".rte-color-input-native");
|
|
173
|
+
t?.addEventListener("change", (l) => {
|
|
174
|
+
const r = l.target.value;
|
|
175
|
+
i = r, f(r), p();
|
|
155
176
|
});
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
/^#[0-9A-Fa-f]{6}$/.test(
|
|
160
|
-
}),
|
|
161
|
-
const
|
|
162
|
-
i =
|
|
163
|
-
}),
|
|
164
|
-
const
|
|
165
|
-
/^#[0-9A-Fa-f]{6}$/.test(
|
|
177
|
+
const c = n.querySelector(".rte-color-input-text");
|
|
178
|
+
c?.addEventListener("change", (l) => {
|
|
179
|
+
const r = l.target.value;
|
|
180
|
+
/^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, f(r), p());
|
|
181
|
+
}), t?.addEventListener("input", (l) => {
|
|
182
|
+
const r = l.target.value;
|
|
183
|
+
i = r, m(r), k(r), _(r);
|
|
184
|
+
}), c?.addEventListener("input", (l) => {
|
|
185
|
+
const r = l.target.value;
|
|
186
|
+
/^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, m(r), k(r), $(r));
|
|
166
187
|
});
|
|
167
188
|
}
|
|
168
|
-
function
|
|
169
|
-
if (!
|
|
170
|
-
const
|
|
171
|
-
|
|
189
|
+
function m(e) {
|
|
190
|
+
if (!n) return;
|
|
191
|
+
const o = n.querySelector(".rte-color-preview-box"), t = n.querySelector(".rte-color-preview-label");
|
|
192
|
+
o && (o.style.backgroundColor = e, o.style.border = e === "#ffffff" ? "1px solid #ccc" : "none"), t && (t.textContent = e.toUpperCase());
|
|
172
193
|
}
|
|
173
|
-
function
|
|
174
|
-
if (!
|
|
175
|
-
|
|
176
|
-
|
|
194
|
+
function k(e) {
|
|
195
|
+
if (!n) return;
|
|
196
|
+
n.querySelectorAll(".rte-color-swatch").forEach((t) => {
|
|
197
|
+
t.getAttribute("data-color") === e ? t.classList.add("selected") : t.classList.remove("selected");
|
|
177
198
|
});
|
|
178
199
|
}
|
|
179
|
-
function
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
182
|
-
|
|
200
|
+
function $(e) {
|
|
201
|
+
if (!n) return;
|
|
202
|
+
const o = n.querySelector(".rte-color-input-native");
|
|
203
|
+
o && (o.value = e);
|
|
183
204
|
}
|
|
184
|
-
function
|
|
185
|
-
if (!
|
|
186
|
-
const
|
|
187
|
-
|
|
205
|
+
function _(e) {
|
|
206
|
+
if (!n) return;
|
|
207
|
+
const o = n.querySelector(".rte-color-input-text");
|
|
208
|
+
o && (o.value = e);
|
|
188
209
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
210
|
+
function p() {
|
|
211
|
+
d && (d.destroy(), d = null), n && (n.remove(), n = null), g = null;
|
|
191
212
|
}
|
|
192
|
-
function
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
195
|
-
const e =
|
|
196
|
-
return e ? (
|
|
213
|
+
function R() {
|
|
214
|
+
if (x(), n)
|
|
215
|
+
return p(), !0;
|
|
216
|
+
const e = E("openTextColorPicker");
|
|
217
|
+
return e ? (L(e), !0) : !1;
|
|
197
218
|
}
|
|
198
|
-
function
|
|
199
|
-
if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, document.
|
|
200
|
-
if (o && p) {
|
|
201
|
-
const t = e.target;
|
|
202
|
-
!o.contains(t) && !p.contains(t) && a();
|
|
203
|
-
}
|
|
204
|
-
}), !document.getElementById("text-color-plugin-styles"))) {
|
|
219
|
+
function x() {
|
|
220
|
+
if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, !document.getElementById("text-color-plugin-styles"))) {
|
|
205
221
|
const e = document.createElement("style");
|
|
206
222
|
e.id = "text-color-plugin-styles", e.textContent = `
|
|
207
223
|
.rte-inline-color-picker {
|
|
@@ -455,8 +471,8 @@ function g() {
|
|
|
455
471
|
`, document.head.appendChild(e);
|
|
456
472
|
}
|
|
457
473
|
}
|
|
458
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
459
|
-
const
|
|
474
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", x) : setTimeout(x, 100);
|
|
475
|
+
const N = () => ({
|
|
460
476
|
name: "textColor",
|
|
461
477
|
marks: {
|
|
462
478
|
textColor: {
|
|
@@ -467,15 +483,15 @@ const A = () => ({
|
|
|
467
483
|
{
|
|
468
484
|
tag: "span[style*=color]",
|
|
469
485
|
getAttrs: (e) => {
|
|
470
|
-
const
|
|
471
|
-
return
|
|
486
|
+
const t = (e.getAttribute("style") || "").match(/color:\s*([^;]+)/);
|
|
487
|
+
return t ? { color: t[1] } : null;
|
|
472
488
|
}
|
|
473
489
|
},
|
|
474
490
|
{
|
|
475
491
|
tag: "font[color]",
|
|
476
492
|
getAttrs: (e) => {
|
|
477
|
-
const
|
|
478
|
-
return
|
|
493
|
+
const o = e.getAttribute("color");
|
|
494
|
+
return o ? { color: o } : null;
|
|
479
495
|
}
|
|
480
496
|
}
|
|
481
497
|
],
|
|
@@ -497,11 +513,11 @@ const A = () => ({
|
|
|
497
513
|
}
|
|
498
514
|
],
|
|
499
515
|
commands: {
|
|
500
|
-
openTextColorPicker: () =>
|
|
501
|
-
setTextColor: (e) => e ?
|
|
516
|
+
openTextColorPicker: () => R(),
|
|
517
|
+
setTextColor: (e) => e ? f(e) : !1
|
|
502
518
|
},
|
|
503
519
|
keymap: {}
|
|
504
520
|
});
|
|
505
521
|
export {
|
|
506
|
-
|
|
522
|
+
N as TextColorPlugin
|
|
507
523
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=".rte-content, .editora-content",g='.rte-track-insert[data-track-change="insert"]',f='.rte-track-delete[data-track-change="delete"]',x=`${g}, ${f}`,H="__editoraCommandEditorRoot",B=new WeakMap,N=new WeakMap,L=new WeakMap,D=new Set;let q=!1,h=null,j=!1,T={},F=!1;const J=typeof InputEvent<"u"&&typeof InputEvent.prototype=="object"&&"inputType"in InputEvent.prototype,Q=new Set(["IMG","TABLE","VIDEO","AUDIO","SVG","MATH","HR","IFRAME","INPUT","TEXTAREA","SELECT","BUTTON","CANVAS"]);function ee(e){if(!e)return null;const t=e.querySelector('[contenteditable="true"]');return t instanceof HTMLElement?t:null}function te(){if(typeof window>"u")return null;const e=window[H];if(!(e instanceof HTMLElement))return null;window[H]=null;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);if(t){const r=ee(t);if(r)return r;if(t.getAttribute("contenteditable")==="true")return t}if(e.getAttribute("contenteditable")==="true")return e;const n=e.closest('[contenteditable="true"]');return n instanceof HTMLElement?n:null}function ne(e){if(e?.contentElement instanceof HTMLElement)return e.contentElement;if(e?.editorElement instanceof HTMLElement){const o=e.editorElement;if(o.getAttribute("contenteditable")==="true")return o;const a=o.querySelector('[contenteditable="true"]');if(a instanceof HTMLElement)return a}const t=te();if(t&&document.contains(t))return t;const n=window.getSelection();if(n&&n.rangeCount>0){const o=n.getRangeAt(0).startContainer,c=(o.nodeType===Node.ELEMENT_NODE?o:o.parentElement)?.closest(p);if(c)return c}const r=document.activeElement;if(r){if(r.matches(p))return r;const o=r.closest(p);if(o)return o}return h?.isConnected?h:document.querySelector(p)}function w(e,t){k(e),_(e);let n=B.get(e);return n||(n={enabled:!!t.enabledByDefault,author:t.author?.trim()||"system",includeTimestamp:t.includeTimestamp!==!1},B.set(e,n),n.enabled&&(M(e,n),y(e,n.enabled))),S(e,"toggleTrackChanges",n.enabled),n}function y(e,t){e.classList.toggle("rte-track-changes-enabled",t),t?e.setAttribute("data-track-changes","true"):e.removeAttribute("data-track-changes")}function re(e){return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||e}function S(e,t,n){const r=re(e);Array.from(r.querySelectorAll(`.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`)).forEach(a=>{a.classList.toggle("active",n),a.setAttribute("data-active",n?"true":"false"),a.setAttribute("aria-pressed",n?"true":"false"),a.setAttribute("title",n?"Track Changes (On)":"Track Changes (Off)")})}function ae(e){e.dispatchEvent(new Event("input",{bubbles:!0}))}function oe(e,t){if(t===e.innerHTML)return;const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",e,t,e.innerHTML)}catch{}}function m(e,t){ae(e),oe(e,t)}function ce(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function G(e){return{author:e.author,timestamp:e.includeTimestamp?new Date().toISOString():""}}function se(e,t){const n=document.createElement("span");n.className="rte-track-insert",n.setAttribute("data-track-change","insert"),n.setAttribute("contenteditable","false");const r=G(t);return n.setAttribute("data-track-author",r.author),r.timestamp&&n.setAttribute("data-track-time",r.timestamp),n.appendChild(document.createTextNode(e)),n}function k(e){Array.from(e.querySelectorAll(g)).forEach(n=>{n.setAttribute("contenteditable","false")})}function E(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function le(e,t){const n=e.startContainer,r=e.startOffset;if(n.nodeType===Node.TEXT_NODE){const o=n,a=o.previousSibling||o.nextSibling;if(a instanceof HTMLElement&&a.matches(g)&&t.contains(a))return a}if(n.nodeType===Node.ELEMENT_NODE){const o=n,a=o.childNodes[r-1];if(a instanceof HTMLElement&&a.matches(g)&&t.contains(a))return a;const c=o.childNodes[r];if(c instanceof HTMLElement&&c.matches(g)&&t.contains(c))return c}return null}function P(e,t,n){const r=t.lastChild;r&&r.nodeType===Node.TEXT_NODE?r.data+=n:t.appendChild(document.createTextNode(n)),C(e,t)}function ie(e,t){const n=document.createElement("span");n.className="rte-track-delete",n.setAttribute("data-track-change","delete"),n.setAttribute("contenteditable","false");const r=G(t);return n.setAttribute("data-track-author",r.author),r.timestamp&&n.setAttribute("data-track-time",r.timestamp),n.appendChild(e),n}function b(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return e.contains(n.commonAncestorContainer)?n:null}function ue(){F||typeof document>"u"||(F=!0,document.addEventListener("selectionchange",()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),r=E(t.startContainer)?.closest(p)||null;r&&(L.set(r,t.cloneRange()),h=r)},!0))}function C(e,t){if(!t.parentNode){e.focus({preventScroll:!0});return}const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStartAfter(t),r.collapse(!0),n.removeAllRanges(),n.addRange(r),e.focus({preventScroll:!0})}function O(e,t){if(!t.parentNode){e.focus({preventScroll:!0});return}const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStartBefore(t),r.collapse(!0),n.removeAllRanges(),n.addRange(r),e.focus({preventScroll:!0})}function de(e,t,n){const r=window.getSelection();if(!r)return;const o=document.createRange();o.setStart(t,Math.max(0,n)),o.collapse(!0),r.removeAllRanges(),r.addRange(o),e.focus({preventScroll:!0})}function V(e){let t=b(e);if(!t){const c=L.get(e);c&&e.contains(c.commonAncestorContainer)&&(t=c.cloneRange())}if(!t||!t.collapsed)return;const n=E(t.startContainer);if(!n)return;const r=n.closest(g);if(!r||!e.contains(r)||!r.parentNode)return;const o=window.getSelection();if(!o)return;const a=document.createRange();a.setStartAfter(r),a.collapse(!0),o.removeAllRanges(),o.addRange(a),e.focus({preventScroll:!0})}function K(e,t){const n=e.innerHTML;k(e),V(e),e.focus({preventScroll:!0});const r=t==="insertLineBreak"?"insertLineBreak":"insertParagraph",o=document.execCommand(r,!1);return k(e),m(e,n),o!==!1}function fe(e){const t=b(e);if(t&&t.collapsed)return t;const n=L.get(e);return n&&n.collapsed&&e.contains(n.commonAncestorContainer)?n.cloneRange():null}function ge(e){return e.matches(g)||e.matches(f)?(e.textContent||"").replace(/\u200B/g,"").trim().length>0:Q.has(e.tagName)}function W(e,t){if(t!=="insertParagraph")return!1;const n=fe(e);if(!n)return!1;const r=E(n.startContainer);if(!r)return!1;const o=r.closest("li");return!(o instanceof HTMLElement)||!e.contains(o)||(o.textContent||"").replace(/\u200B/g,"").trim().length>0?!1:!Array.from(o.querySelectorAll("*")).some(s=>ge(s))}function me(e){const t=document.createRange(),n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0);if(e.contains(r.commonAncestorContainer))return t.setStart(r.endContainer,r.endOffset),t.collapse(!0),t}return t.selectNodeContents(e),t.collapse(!1),t}function he(e){return(e.textContent||"").length>0?!0:Array.from(e.childNodes).some(n=>{if(n.nodeType!==Node.ELEMENT_NODE)return!1;const r=n;return["BR","IMG","TABLE","VIDEO","AUDIO","SVG","MATH"].includes(r.tagName)})}function pe(e){return Array.from(e.childNodes).some(t=>{if(t.nodeType===Node.TEXT_NODE)return(t.textContent||"").length>0;if(t.nodeType!==Node.ELEMENT_NODE)return!1;const n=t;return["BR","IMG","TABLE","VIDEO","AUDIO","SVG","MATH"].includes(n.tagName)})}function Ee(e,t,n){if(!e.collapsed)return null;const r=e.startContainer,o=e.startOffset;let a=null;if(r.nodeType===Node.TEXT_NODE){const c=r;t==="backward"&&o===0?a=c.previousSibling:t==="forward"&&o===c.length&&(a=c.nextSibling)}else if(r.nodeType===Node.ELEMENT_NODE){const c=r;t==="backward"&&o>0?a=c.childNodes[o-1]||null:t==="forward"&&o<c.childNodes.length&&(a=c.childNodes[o]||null)}return!(a instanceof HTMLElement)||!a.matches(g)||!n.contains(a)?null:a}function ke(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=[];let o=n.nextNode();for(;o;){const a=o;a.data.length>0&&r.push(a),o=n.nextNode()}return r.length===0?null:t?r[r.length-1]:r[0]}function Te(e,t,n){const r=Ee(t,n,e);return r?v(e,r,n):!1}function v(e,t,n){const r=t.parentNode;if(!r)return!1;const o=Array.prototype.indexOf.call(r.childNodes,t),a=ke(t,n==="backward");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}function Z(e){if(e.startContainer!==e.endContainer||e.startContainer.nodeType!==Node.ELEMENT_NODE)return null;const t=e.startContainer;return e.endOffset-e.startOffset!==1?null:t.childNodes[e.startOffset]||null}function I(e,t){const n=Z(e);return!(n instanceof HTMLElement)||!n.matches(f)||!t.contains(n)?null:n}function be(e,t){const n=Z(e);return!(n instanceof HTMLElement)||!n.matches(g)||!t.contains(n)?null:n}function Ce(e,t){if(t.collapsed){const c=E(t.startContainer)?.closest(f);if(c&&e.contains(c)){const s=document.createRange();return s.setStartAfter(c),s.collapse(!0),s}return t}const n=I(t,e);if(n){const a=document.createRange();return a.setStartAfter(n),a.collapse(!0),a}const r=E(t.startContainer)?.closest(f),o=E(t.endContainer)?.closest(f);if(r&&o&&r===o&&e.contains(r)){const a=document.createRange();return a.setStartAfter(r),a.collapse(!0),a}return t}function Ae(e,t){const r=Array.from(t.querySelectorAll(g)).filter(s=>{try{return e.intersectsNode(s)}catch{return!1}});if(r.length!==1)return null;const o=r[0],a=(e.toString()||"").replace(/\s+/g,""),c=(o.textContent||"").replace(/\s+/g,"");return!c||a!==c?null:o}function U(e,t,n){if(t.collapsed)return null;const r=t.cloneContents();if(!he(r))return null;const o=ie(r,n);return t.deleteContents(),t.insertNode(o),C(e,o),o}function Ne(e,t,n){if(!t.collapsed)return t;const r=t.startContainer,o=t.startOffset;if(r.nodeType===Node.TEXT_NODE){const s=r;if(n==="backward"&&o>0){const l=t.cloneRange();return l.setStart(s,o-1),l}if(n==="forward"&&o<s.length){const l=t.cloneRange();return l.setEnd(s,o+1),l}}if(r.nodeType===Node.ELEMENT_NODE){const s=r;if(n==="backward"&&o>0)for(let l=o-1;l>=0;l-=1){const i=s.childNodes[l];if(!i||i instanceof HTMLElement&&i.matches(f))continue;const u=t.cloneRange();if(i.nodeType===Node.TEXT_NODE){const d=i;if(d.length===0)continue;u.setStart(d,d.length-1),u.setEnd(d,d.length)}else u.setStartBefore(i),u.setEndAfter(i);return u}if(n==="forward"&&o<s.childNodes.length)for(let l=o;l<s.childNodes.length;l+=1){const i=s.childNodes[l];if(!i||i instanceof HTMLElement&&i.matches(f))continue;const u=t.cloneRange();if(i.nodeType===Node.TEXT_NODE){const d=i;if(d.length===0)continue;u.setStart(d,0),u.setEnd(d,1)}else u.setStartBefore(i),u.setEndAfter(i);return u}}const a=window.getSelection();if(!a||typeof a.modify!="function")return null;const c=t.cloneRange();a.removeAllRanges(),a.addRange(c);try{if(a.modify("extend",n,"character"),a.rangeCount===0)return null;const s=a.getRangeAt(0).cloneRange();if(s.collapsed||!e.contains(s.commonAncestorContainer))return null;const l=I(s,e);return l?(n==="backward"?O(e,l):C(e,l),null):s}catch{return null}finally{a.removeAllRanges(),a.addRange(c)}}function z(e,t,n){let r=b(e);if(!r)return!1;const o=Ce(e,r.cloneRange());if(!ce(o,r)){const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(o)),r=o}const a=e.innerHTML;r.collapsed||U(e,r.cloneRange(),t);const s=E(r.startContainer)?.closest(g);if(r.collapsed&&s&&e.contains(s))return P(e,s,n),m(e,a),!0;const l=r.collapsed?le(r,e):null;if(l)return P(e,l,n),m(e,a),!0;const i=me(e),u=se(n,t);return i.insertNode(u),C(e,u),m(e,a),!0}function $(e,t,n){const r=b(e);if(!r)return!1;const o=n.includes("Backward")?"backward":"forward",a=e.innerHTML;if(r.collapsed&&Te(e,r.cloneRange(),o))return m(e,a),!0;const c=be(r,e);if(c&&v(e,c,o))return m(e,a),!0;if(!r.collapsed){const u=Ae(r,e);if(u&&v(e,u,o))return m(e,a),!0}const s=r.collapsed?Ne(e,r.cloneRange(),o):r.cloneRange();if(!s)return!1;const l=I(s,e);return l?(o==="backward"?O(e,l):C(e,l),!0):U(e,s,t)?(_(e),m(e,a),!0):!1}function R(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function _(e){Array.from(e.querySelectorAll(f)).forEach(r=>{r.setAttribute("contenteditable","false"),Array.from(r.querySelectorAll(f)).forEach(a=>{a!==r&&R(a)})});let n=!0;for(;n;)n=!1,Array.from(e.querySelectorAll(f)).forEach(o=>{if(!o.isConnected)return;let a=o.nextSibling;for(;a&&a.nodeType===Node.TEXT_NODE&&!(a.textContent||"").trim();)a=a.nextSibling;if(a instanceof HTMLElement&&a.matches(f)){for(;a.firstChild;)o.appendChild(a.firstChild);a.remove(),n=!0}o.firstChild||(o.remove(),n=!0)})}function Y(e){return Array.from(e.querySelectorAll(x))}function ye(e){const t=b(e);if(!t)return[];const n=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?.closest(x);a&&e.contains(a)&&n.add(a);const c=o?.closest(x);return c&&e.contains(c)&&n.add(c),Y(e).filter(l=>{try{return t.intersectsNode(l)}catch{return!1}}).forEach(l=>n.add(l)),Array.from(n)}function A(e,t,n){const r=n==="all"?Y(e):ye(e);if(r.length===0)return!1;const o=e.innerHTML;return r.forEach(a=>{if(!a.isConnected)return;const c=a.matches(g),s=a.matches(f);if(!(!c&&!s)){if(t==="accept"){c?R(a):a.remove();return}c?a.remove():(a.removeAttribute("contenteditable"),R(a))}}),_(e),m(e,o),!0}function Se(e){return e instanceof Node&&(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(p)||null}function Me(){j||typeof document>"u"||(j=!0,document.addEventListener("focusin",e=>{if(!T.enabledByDefault)return;const t=Se(e.target);if(!t)return;h=t;const n=w(t,T);n.enabled?(M(t,n),y(t,!0),S(t,"toggleTrackChanges",!0)):k(t)},!0))}function xe(e,t){return n=>{if(!t.enabled||e.getAttribute("data-track-changes")!=="true")return;h=e;const r=n.inputType||"";if(r==="insertParagraph"||r==="insertLineBreak"){if(W(e,r))return;n.preventDefault(),K(e,r);return}if(r.startsWith("delete")){n.preventDefault(),$(e,t,r);return}if(r==="insertText"||r==="insertCompositionText"){const o=n.data||"";if(!o)return;n.preventDefault(),z(e,t,o)}}}function we(e,t){return n=>{if(!t.enabled||e.getAttribute("data-track-changes")!=="true"||n.key!=="Enter"||J)return;const r=n.shiftKey?"insertLineBreak":"insertParagraph";W(e,r)||(h=e,n.preventDefault(),n.stopPropagation(),K(e,r))}}function ve(e,t){return n=>{if(n.__editoraSmartPasteHandled===!0||n.defaultPrevented||!t.enabled||e.getAttribute("data-track-changes")!=="true")return;const r=n.clipboardData?.getData("text/plain")||"";r&&(n.preventDefault(),h=e,z(e,t,r))}}function Re(e,t){return n=>{if(!t.enabled||e.getAttribute("data-track-changes")!=="true")return;const r=b(e);if(!r||r.collapsed)return;const o=r.toString();n.clipboardData&&(n.clipboardData.setData("text/plain",o),n.preventDefault()),h=e,$(e,t,"deleteByCut")}}function M(e,t){if(N.has(e))return;k(e);const n={beforeInput:xe(e,t),keydown:we(e,t),paste:ve(e,t),cut:Re(e,t)};e.addEventListener("beforeinput",n.beforeInput),e.addEventListener("keydown",n.keydown),e.addEventListener("paste",n.paste),e.addEventListener("cut",n.cut),N.set(e,n),D.add(e)}function X(e){const t=N.get(e);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))}function Le(){if(q||typeof document>"u")return;q=!0;const e=document.createElement("style");e.id="rte-track-changes-styles",e.textContent=`
|
|
2
|
+
.rte-track-insert[data-track-change="insert"] {
|
|
3
|
+
background: rgba(22, 163, 74, 0.2);
|
|
4
|
+
color: inherit;
|
|
5
|
+
text-decoration: underline;
|
|
6
|
+
text-decoration-color: #16a34a;
|
|
7
|
+
text-decoration-thickness: 2px;
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
padding: 0 1px;
|
|
10
|
+
white-space: pre-wrap;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rte-track-delete[data-track-change="delete"] {
|
|
14
|
+
background: rgba(220, 38, 38, 0.16);
|
|
15
|
+
color: inherit;
|
|
16
|
+
text-decoration: line-through;
|
|
17
|
+
text-decoration-color: #dc2626;
|
|
18
|
+
text-decoration-thickness: 2px;
|
|
19
|
+
border-radius: 2px;
|
|
20
|
+
padding: 0 1px;
|
|
21
|
+
white-space: pre-wrap;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.editora-theme-dark .rte-track-insert[data-track-change="insert"],
|
|
26
|
+
.rte-theme-dark .rte-track-insert[data-track-change="insert"] {
|
|
27
|
+
background: rgba(74, 222, 128, 0.2);
|
|
28
|
+
text-decoration-color: #4ade80;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.editora-theme-dark .rte-track-delete[data-track-change="delete"],
|
|
32
|
+
.rte-theme-dark .rte-track-delete[data-track-change="delete"] {
|
|
33
|
+
background: rgba(248, 113, 113, 0.18);
|
|
34
|
+
text-decoration-color: #f87171;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.rte-content[data-track-changes="true"],
|
|
38
|
+
.editora-content[data-track-changes="true"] {
|
|
39
|
+
caret-color: currentColor;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.rte-toolbar-group-items.track-changes,
|
|
43
|
+
.editora-toolbar-group-items.track-changes {
|
|
44
|
+
display: flex;
|
|
45
|
+
border: 1px solid #ccc;
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
background: #fff;
|
|
48
|
+
}
|
|
49
|
+
.rte-toolbar-group-items.track-changes .rte-toolbar-button,
|
|
50
|
+
.editora-toolbar-group-items.track-changes .editora-toolbar-button {
|
|
51
|
+
border: none;
|
|
52
|
+
border-radius: 0px;
|
|
53
|
+
}
|
|
54
|
+
.rte-toolbar-group-items.track-changes .rte-toolbar-button,
|
|
55
|
+
.editora-toolbar-group-items.track-changes .editora-toolbar-button {
|
|
56
|
+
border-right: 1px solid #ccc;
|
|
57
|
+
}
|
|
58
|
+
.rte-toolbar-group-items.track-changes .rte-toolbar-item:last-child .rte-toolbar-button,
|
|
59
|
+
.editora-toolbar-group-items.track-changes .editora-toolbar-item:last-child .editora-toolbar-button {
|
|
60
|
+
border-right: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark) .rte-toolbar-group-items.track-changes,
|
|
64
|
+
:is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark) .editora-toolbar-group-items.track-changes {
|
|
65
|
+
border-color: #566275;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark) .rte-toolbar-group-items.track-changes .rte-toolbar-button,
|
|
69
|
+
:is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark) .editora-toolbar-group-items.track-changes .editora-toolbar-button {
|
|
70
|
+
border-right-color: #566275;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rte-toolbar-button[data-command="toggleTrackChanges"].active,
|
|
74
|
+
.editora-toolbar-button[data-command="toggleTrackChanges"].active {
|
|
75
|
+
background-color: #ccc;
|
|
76
|
+
}
|
|
77
|
+
`,document.head.appendChild(e)}const De=(e={})=>{Le(),ue(),T={...T,...e},Me(),T.enabledByDefault&&typeof document<"u"&&(typeof requestAnimationFrame=="function"?requestAnimationFrame:o=>window.setTimeout(o,0))(()=>{Array.from(document.querySelectorAll(p)).forEach(a=>{const c=w(a,T);c.enabled?(M(a,c),y(a,!0),S(a,"toggleTrackChanges",!0)):k(a)})});const t=r=>{const o=ne(r);return o?(h=o,o):null},n=r=>{const o=t(r);if(!o)return null;const a=w(o,e);return{editor:o,state:a}};return{name:"trackChanges",toolbar:[{label:"Track Changes",command:"toggleTrackChanges",type:"group",items:[{label:"Track Changes",command:"toggleTrackChanges",icon:'<svg width="24" height="24" focusable="false"><path d="M4 6h10a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2Zm0 5h7a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2Zm0 5h8a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2Zm13.3-3.6 1.3 1.3 2.9-2.9a1 1 0 1 1 1.4 1.4l-3.6 3.6a1 1 0 0 1-1.4 0l-2-2a1 1 0 1 1 1.4-1.4Z"></path></svg>',shortcut:"Mod-Shift-t"},{label:"Accept All Changes",command:"acceptAllTrackChanges",icon:'<svg width="24" height="24" focusable="false"><path d="M9.2 16.2 5.8 12.8a1 1 0 1 1 1.4-1.4l2.1 2.1 7.5-7.5a1 1 0 1 1 1.4 1.4l-8.2 8.2a1 1 0 0 1-1.4 0Z"></path></svg>'},{label:"Reject All Changes",command:"rejectAllTrackChanges",icon:'<svg width="24" height="24" focusable="false"><path d="M7.8 7.8a1 1 0 0 1 1.4 0L12 10.6l2.8-2.8a1 1 0 1 1 1.4 1.4L13.4 12l2.8 2.8a1 1 0 1 1-1.4 1.4L12 13.4l-2.8 2.8a1 1 0 1 1-1.4-1.4l2.8-2.8-2.8-2.8a1 1 0 0 1 0-1.4Z"></path></svg>'}]}],commands:{toggleTrackChanges:(r,o)=>{const a=n(o);if(!a)return!1;const{editor:c,state:s}=a;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",{bubbles:!0,detail:{enabled:s.enabled,author:s.author}})),s.enabled},acceptAllTrackChanges:(r,o)=>{const a=n(o);return a?A(a.editor,"accept","all"):!1},rejectAllTrackChanges:(r,o)=>{const a=n(o);return a?A(a.editor,"reject","all"):!1},acceptSelectedTrackChanges:(r,o)=>{const a=n(o);return a?A(a.editor,"accept","selection"):!1},rejectSelectedTrackChanges:(r,o)=>{const a=n(o);return a?A(a.editor,"reject","selection"):!1}},keymap:{"Mod-Shift-t":"toggleTrackChanges","Mod-Shift-T":"toggleTrackChanges"},destroy:()=>{Array.from(D).forEach(r=>X(r))}}};exports.TrackChangesPlugin=De;
|