@editora/plugins 1.0.10 → 1.0.11
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/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +80 -98
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +115 -128
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +208 -249
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +55 -68
- package/dist/blockquote.esm.js +1 -2
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +178 -245
- package/dist/capitalization.esm.js +1 -2
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +58 -82
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +439 -512
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +27 -33
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +82 -93
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +501 -506
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +116 -158
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +371 -432
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +105 -159
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +328 -368
- package/dist/direction.esm.js +9 -18
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +240 -308
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +4 -5
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +73 -81
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +65 -77
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +54 -56
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +39 -47
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +37 -53
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +76 -117
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +70 -92
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +12 -24
- package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
- 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-CE_A4QSm.js +5 -0
- package/dist/index.es-DQ78mYYo.mjs +6665 -0
- package/dist/index.esm.js +125 -128
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +8 -9
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +11 -24
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +24 -30
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +20 -25
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +59 -61
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +139 -146
- package/dist/media-manager.cjs.js +31 -31
- package/dist/media-manager.esm.js +285 -300
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +238 -286
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +177 -216
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +33 -49
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +393 -463
- package/dist/plugins.css +1 -0
- package/dist/preview.esm.js +5 -10
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +17 -20
- package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
- package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
- package/dist/slash-commands.cjs.js +2 -2
- package/dist/slash-commands.esm.js +39 -75
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +280 -336
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +61 -69
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +97 -123
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +14 -19
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +191 -225
- package/dist/template.cjs.js +21 -20
- package/dist/template.esm.js +715 -196
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +21 -27
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +70 -87
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +100 -162
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +602 -678
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +128 -157
- package/package.json +1 -1
- package/dist/_commonjsHelpers-6763f629.js +0 -1
- package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
- package/dist/anchoredPopover-33f1358d.mjs +0 -109
- package/dist/anchoredPopover-8151d535.js +0 -1
- package/dist/documentManager-25b6203c.mjs +0 -9122
- package/dist/documentManager-b69e7054.js +0 -17
- package/dist/html2canvas.esm-09133e29.js +0 -22
- package/dist/index-656d224b.js +0 -231
- package/dist/index-6a8c48bb.js +0 -1
- package/dist/index-d027b7e2.mjs +0 -16859
- package/dist/index.es-730f2d98.mjs +0 -5775
- package/dist/index.es-dd40173b.js +0 -18
- package/dist/jspdf.es.min-90db2c97.js +0 -243
- package/dist/style.css +0 -1
- /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.js} +0 -0
package/dist/history.esm.js
CHANGED
|
@@ -1,102 +1,89 @@
|
|
|
1
1
|
const S = ".rte-content, .editora-content";
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
function
|
|
5
|
-
if (!t)
|
|
6
|
-
return null;
|
|
2
|
+
const T = "__editoraCommandEditorRoot", d = /* @__PURE__ */ new Map(), E = {};
|
|
3
|
+
let g = !1, c = null;
|
|
4
|
+
function I(t) {
|
|
5
|
+
if (!t) return null;
|
|
7
6
|
const e = t.querySelector('[contenteditable="true"]');
|
|
8
7
|
return e instanceof HTMLElement ? e : null;
|
|
9
8
|
}
|
|
10
|
-
function
|
|
11
|
-
if (typeof window > "u")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return null;
|
|
16
|
-
window[g] = null;
|
|
9
|
+
function N() {
|
|
10
|
+
if (typeof window > "u") return null;
|
|
11
|
+
const t = window[T];
|
|
12
|
+
if (!(t instanceof HTMLElement)) return null;
|
|
13
|
+
window[T] = null;
|
|
17
14
|
const e = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
|
|
18
15
|
if (e) {
|
|
19
|
-
const o =
|
|
20
|
-
if (o)
|
|
21
|
-
|
|
22
|
-
if (e.getAttribute("contenteditable") === "true")
|
|
23
|
-
return e;
|
|
16
|
+
const o = I(e);
|
|
17
|
+
if (o) return o;
|
|
18
|
+
if (e.getAttribute("contenteditable") === "true") return e;
|
|
24
19
|
}
|
|
25
20
|
if (t.getAttribute("contenteditable") === "true")
|
|
26
21
|
return t;
|
|
27
22
|
const n = t.closest('[contenteditable="true"]');
|
|
28
23
|
return n instanceof HTMLElement ? n : null;
|
|
29
24
|
}
|
|
30
|
-
function
|
|
25
|
+
function z(t) {
|
|
31
26
|
return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
|
|
32
27
|
}
|
|
33
|
-
function
|
|
34
|
-
const e =
|
|
35
|
-
if (!e)
|
|
36
|
-
return null;
|
|
28
|
+
function a(t) {
|
|
29
|
+
const e = z(t);
|
|
30
|
+
if (!e) return null;
|
|
37
31
|
const n = e.closest(S);
|
|
38
|
-
if (n)
|
|
39
|
-
return n;
|
|
32
|
+
if (n) return n;
|
|
40
33
|
const o = e.closest('[contenteditable="true"]');
|
|
41
|
-
if (!o)
|
|
42
|
-
return null;
|
|
34
|
+
if (!o) return null;
|
|
43
35
|
let r = o, i = r.parentElement;
|
|
44
36
|
for (; i; )
|
|
45
37
|
i.getAttribute("contenteditable") === "true" && (r = i), i = i.parentElement;
|
|
46
38
|
return r;
|
|
47
39
|
}
|
|
48
40
|
function l() {
|
|
49
|
-
const t =
|
|
41
|
+
const t = N();
|
|
50
42
|
if (t && document.contains(t))
|
|
51
43
|
return t;
|
|
52
44
|
const e = window.getSelection();
|
|
53
45
|
if (e && e.rangeCount > 0) {
|
|
54
|
-
const i =
|
|
55
|
-
if (i)
|
|
56
|
-
return i;
|
|
46
|
+
const i = a(e.getRangeAt(0).startContainer);
|
|
47
|
+
if (i) return i;
|
|
57
48
|
}
|
|
58
49
|
const n = document.activeElement;
|
|
59
50
|
if (n) {
|
|
60
|
-
const i =
|
|
61
|
-
if (i)
|
|
62
|
-
return i;
|
|
51
|
+
const i = a(n);
|
|
52
|
+
if (i) return i;
|
|
63
53
|
}
|
|
64
|
-
if (c
|
|
65
|
-
return c;
|
|
54
|
+
if (c?.isConnected) return c;
|
|
66
55
|
const o = Array.from(d.keys()).find((i) => i.isConnected);
|
|
67
|
-
if (o)
|
|
68
|
-
return o;
|
|
56
|
+
if (o) return o;
|
|
69
57
|
const r = document.querySelector(S);
|
|
70
58
|
return r || document.querySelector('[contenteditable="true"]');
|
|
71
59
|
}
|
|
72
|
-
function
|
|
60
|
+
function v() {
|
|
73
61
|
for (const t of d.keys())
|
|
74
62
|
t.isConnected || (d.delete(t), c === t && (c = null));
|
|
75
63
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
64
|
+
function C(t) {
|
|
65
|
+
v();
|
|
78
66
|
let e = d.get(t);
|
|
79
67
|
return e || (e = { undoStack: [], redoStack: [] }, d.set(t, e)), e;
|
|
80
68
|
}
|
|
81
69
|
function s(t) {
|
|
82
70
|
t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
83
71
|
}
|
|
84
|
-
function
|
|
72
|
+
function h(t) {
|
|
85
73
|
return t ? t.innerHTML : "";
|
|
86
74
|
}
|
|
87
75
|
function m(t, e) {
|
|
88
|
-
if (!t)
|
|
89
|
-
|
|
90
|
-
const n = M(t);
|
|
76
|
+
if (!t) return;
|
|
77
|
+
const n = C(t);
|
|
91
78
|
n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
|
|
92
79
|
}
|
|
93
|
-
function
|
|
94
|
-
if (
|
|
80
|
+
function A(t, e = "undo") {
|
|
81
|
+
if (v(), t?.isConnected)
|
|
95
82
|
return t;
|
|
96
83
|
const n = l();
|
|
97
|
-
if (n
|
|
84
|
+
if (n?.isConnected)
|
|
98
85
|
return n;
|
|
99
|
-
if (c
|
|
86
|
+
if (c?.isConnected)
|
|
100
87
|
return c;
|
|
101
88
|
const o = (r) => e === "undo" ? r.undoStack.length > 0 : r.redoStack.length > 0;
|
|
102
89
|
for (const [r, i] of d.entries())
|
|
@@ -104,7 +91,7 @@ function L(t, e = "undo") {
|
|
|
104
91
|
return r;
|
|
105
92
|
return null;
|
|
106
93
|
}
|
|
107
|
-
function
|
|
94
|
+
function y(t) {
|
|
108
95
|
const e = {};
|
|
109
96
|
for (const r of t.getAttributeNames()) {
|
|
110
97
|
const i = t.getAttribute(r);
|
|
@@ -125,8 +112,7 @@ function H(t, e) {
|
|
|
125
112
|
}), 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);
|
|
126
113
|
}
|
|
127
114
|
function u(t, e) {
|
|
128
|
-
if (E[t] = e, typeof window > "u")
|
|
129
|
-
return;
|
|
115
|
+
if (E[t] = e, typeof window > "u") return;
|
|
130
116
|
const n = window.registerEditorCommand;
|
|
131
117
|
typeof n == "function" ? n(t, e) : (window.registerEditorCommand = (o, r) => {
|
|
132
118
|
E[o] = r;
|
|
@@ -136,31 +122,30 @@ const w = (t, ...e) => {
|
|
|
136
122
|
const n = E[t];
|
|
137
123
|
return n ? n(...e) : !1;
|
|
138
124
|
};
|
|
139
|
-
function
|
|
140
|
-
|
|
125
|
+
function p() {
|
|
126
|
+
g || typeof window > "u" || (g = !0, window.execEditorCommand || (window.execEditorCommand = w), window.executeEditorCommand || (window.executeEditorCommand = w), u("undo", x), u("redo", k), u("setAttribute", O), u("setText", D), u("autoFixA11y", _), u("recordDomTransaction", R), u("undoDom", M), u("redoDom", b));
|
|
141
127
|
}
|
|
142
|
-
function
|
|
143
|
-
const n = e || l(), o =
|
|
144
|
-
n
|
|
128
|
+
function L(t, e) {
|
|
129
|
+
const n = e || l(), o = h(n);
|
|
130
|
+
n?.focus({ preventScroll: !0 });
|
|
145
131
|
let r = !1;
|
|
146
132
|
try {
|
|
147
133
|
r = !!document.execCommand(t, !1);
|
|
148
134
|
} catch {
|
|
149
135
|
r = !1;
|
|
150
136
|
}
|
|
151
|
-
const i =
|
|
152
|
-
return
|
|
137
|
+
const i = h(n), f = o !== i;
|
|
138
|
+
return f && s(n), { executed: r, changed: f };
|
|
153
139
|
}
|
|
154
140
|
const x = () => {
|
|
155
141
|
const t = l();
|
|
156
|
-
return
|
|
142
|
+
return L("undo", t).changed ? !0 : M(t ?? void 0);
|
|
157
143
|
}, k = () => {
|
|
158
144
|
const t = l();
|
|
159
|
-
return
|
|
145
|
+
return L("redo", t).changed ? !0 : b(t ?? void 0);
|
|
160
146
|
}, O = (t, e, n) => {
|
|
161
|
-
if (!(t instanceof HTMLElement))
|
|
162
|
-
|
|
163
|
-
const o = f(t), r = t.hasAttribute(e), i = t.getAttribute(e);
|
|
147
|
+
if (!(t instanceof HTMLElement)) return;
|
|
148
|
+
const o = a(t), r = t.hasAttribute(e), i = t.getAttribute(e);
|
|
164
149
|
t.setAttribute(e, n), m(o, {
|
|
165
150
|
undo: () => {
|
|
166
151
|
t.isConnected && (r && i !== null ? t.setAttribute(e, i) : t.removeAttribute(e));
|
|
@@ -170,9 +155,8 @@ const x = () => {
|
|
|
170
155
|
}
|
|
171
156
|
}), s(o);
|
|
172
157
|
}, D = (t, e) => {
|
|
173
|
-
if (!(t instanceof HTMLElement))
|
|
174
|
-
|
|
175
|
-
const n = f(t), o = t.textContent ?? "";
|
|
158
|
+
if (!(t instanceof HTMLElement)) return;
|
|
159
|
+
const n = a(t), o = t.textContent ?? "";
|
|
176
160
|
t.textContent = e, m(n, {
|
|
177
161
|
undo: () => {
|
|
178
162
|
t.isConnected && (t.textContent = o);
|
|
@@ -182,16 +166,13 @@ const x = () => {
|
|
|
182
166
|
}
|
|
183
167
|
}), s(n);
|
|
184
168
|
}, _ = (t) => {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
if (!o || typeof o.fix != "function")
|
|
191
|
-
return;
|
|
192
|
-
const r = h(e);
|
|
169
|
+
const e = t?.element;
|
|
170
|
+
if (!(e instanceof HTMLElement)) return;
|
|
171
|
+
const n = a(e), o = window.a11yRuleRegistry?.find((f) => f.id === t.rule);
|
|
172
|
+
if (!o || typeof o.fix != "function") return;
|
|
173
|
+
const r = y(e);
|
|
193
174
|
o.fix(t);
|
|
194
|
-
const i =
|
|
175
|
+
const i = y(e);
|
|
195
176
|
m(n, {
|
|
196
177
|
undo: () => {
|
|
197
178
|
e.isConnected && H(e, r);
|
|
@@ -201,8 +182,7 @@ const x = () => {
|
|
|
201
182
|
}
|
|
202
183
|
}), s(n);
|
|
203
184
|
}, R = (t, e, n) => {
|
|
204
|
-
if (!(t instanceof HTMLElement))
|
|
205
|
-
return !1;
|
|
185
|
+
if (!(t instanceof HTMLElement)) return !1;
|
|
206
186
|
const o = typeof n == "string" ? n : t.innerHTML;
|
|
207
187
|
return e === o ? !1 : (m(t, {
|
|
208
188
|
undo: () => {
|
|
@@ -212,21 +192,19 @@ const x = () => {
|
|
|
212
192
|
t.isConnected && (t.innerHTML = o);
|
|
213
193
|
}
|
|
214
194
|
}), !0);
|
|
215
|
-
},
|
|
216
|
-
const e =
|
|
217
|
-
if (!e)
|
|
218
|
-
|
|
219
|
-
const n = M(e), o = n.undoStack.pop();
|
|
195
|
+
}, M = (t) => {
|
|
196
|
+
const e = A(t, "undo");
|
|
197
|
+
if (!e) return !1;
|
|
198
|
+
const n = C(e), o = n.undoStack.pop();
|
|
220
199
|
return o ? (o.undo(), n.redoStack.push(o), c = e, s(e), !0) : !1;
|
|
221
|
-
},
|
|
222
|
-
const e =
|
|
223
|
-
if (!e)
|
|
224
|
-
|
|
225
|
-
const n = M(e), o = n.redoStack.pop();
|
|
200
|
+
}, b = (t) => {
|
|
201
|
+
const e = A(t, "redo");
|
|
202
|
+
if (!e) return !1;
|
|
203
|
+
const n = C(e), o = n.redoStack.pop();
|
|
226
204
|
return o ? (o.redo(), n.undoStack.push(o), c = e, s(e), !0) : !1;
|
|
227
205
|
};
|
|
228
|
-
typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
229
|
-
const
|
|
206
|
+
typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", p, { once: !0 }) : p());
|
|
207
|
+
const F = () => (p(), {
|
|
230
208
|
name: "history",
|
|
231
209
|
toolbar: [
|
|
232
210
|
{
|
|
@@ -251,8 +229,8 @@ const Y = () => (C(), {
|
|
|
251
229
|
setText: D,
|
|
252
230
|
autoFixA11y: _,
|
|
253
231
|
recordDomTransaction: R,
|
|
254
|
-
undoDom:
|
|
255
|
-
redoDom:
|
|
232
|
+
undoDom: M,
|
|
233
|
+
redoDom: b
|
|
256
234
|
},
|
|
257
235
|
keymap: {
|
|
258
236
|
"Mod-z": "undo",
|
|
@@ -264,5 +242,5 @@ const Y = () => (C(), {
|
|
|
264
242
|
}
|
|
265
243
|
});
|
|
266
244
|
export {
|
|
267
|
-
|
|
245
|
+
F as HistoryPlugin
|
|
268
246
|
};
|