@editora/core 1.0.6 → 1.0.8
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/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
- package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
- package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
- package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
- package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
- package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
- package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
- package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
- package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
- package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
- package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
- package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
- package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
- package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
- package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
- package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
- package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
- package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
- package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
- package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
- package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
- package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
- package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
- package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
- package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
- package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
- package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
- package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
- package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
- package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/editora.min.js +13 -13
- package/dist/editora.umd.js +13 -13
- package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-D1LOqg5C.js +10 -0
- package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
- package/dist/index.esm.js +2 -2
- package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
- package/dist/plugin-loader.js +77 -40
- package/dist/webcomponent-core.js +456 -346
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +87 -107
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +503 -356
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +6003 -658
- package/package.json +2 -2
- package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
- package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
- package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
- package/dist/documentManager-irzj9n3V.mjs +0 -37627
- package/dist/index-CqWQFb3D.js +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
let
|
|
3
|
-
const
|
|
1
|
+
import { a as v, b as w } from "./anchoredPopover-Bxds0VoB.mjs";
|
|
2
|
+
let l = null, d = null, x = null, i = "#000000";
|
|
3
|
+
const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
|
|
4
4
|
"#000000",
|
|
5
5
|
"#ffffff",
|
|
6
6
|
"#808080",
|
|
@@ -14,80 +14,96 @@ const s = '[data-theme="dark"], .dark, .editora-theme-dark', k = [
|
|
|
14
14
|
"#800080",
|
|
15
15
|
"#ffc0cb"
|
|
16
16
|
];
|
|
17
|
-
function
|
|
17
|
+
function y() {
|
|
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, n = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
|
|
21
|
+
if (n) {
|
|
22
|
+
const r = n.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), m = s.getBoundingClientRect();
|
|
43
|
+
if (!(b.display === "none" || b.visibility === "hidden" || b.pointerEvents === "none") && !(m.width === 0 && m.height === 0))
|
|
44
|
+
return s;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}, n = y();
|
|
48
|
+
if (n) {
|
|
49
|
+
const a = Array.from(
|
|
50
|
+
n.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 != null && e.closest(
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
59
|
+
function S(e) {
|
|
60
|
+
if (e != null && e.closest(u)) return !0;
|
|
61
|
+
const o = window.getSelection();
|
|
62
|
+
if (o && o.rangeCount > 0) {
|
|
63
|
+
const c = o.getRangeAt(0).startContainer, n = c.nodeType === Node.ELEMENT_NODE ? c : c.parentElement;
|
|
64
|
+
if (n != null && n.closest(u)) return !0;
|
|
49
65
|
}
|
|
50
|
-
const
|
|
51
|
-
return
|
|
66
|
+
const t = document.activeElement;
|
|
67
|
+
return t != null && t.closest(u) ? !0 : document.body.matches(u) || document.documentElement.matches(u);
|
|
52
68
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
69
|
+
function f(e) {
|
|
70
|
+
return v({
|
|
55
71
|
color: e,
|
|
56
72
|
className: "rte-text-color",
|
|
57
73
|
styleProperty: "color",
|
|
58
74
|
commands: ["foreColor"],
|
|
59
|
-
savedRange:
|
|
60
|
-
getActiveEditorRoot:
|
|
75
|
+
savedRange: x,
|
|
76
|
+
getActiveEditorRoot: y,
|
|
61
77
|
warnMessage: "[TextColor] Could not apply color for current selection"
|
|
62
78
|
});
|
|
63
79
|
}
|
|
64
|
-
function
|
|
80
|
+
function T() {
|
|
65
81
|
const e = window.getSelection();
|
|
66
82
|
if (!e || e.rangeCount === 0) return "#000000";
|
|
67
|
-
let
|
|
68
|
-
for (;
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
return
|
|
83
|
+
let t = e.getRangeAt(0).startContainer;
|
|
84
|
+
for (; t && t !== document.body; ) {
|
|
85
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
86
|
+
const c = t, n = c.style.color || window.getComputedStyle(c).color;
|
|
87
|
+
if (n && n !== "rgb(0, 0, 0)")
|
|
88
|
+
return A(n);
|
|
73
89
|
}
|
|
74
|
-
|
|
90
|
+
t = t.parentNode;
|
|
75
91
|
}
|
|
76
92
|
return "#000000";
|
|
77
93
|
}
|
|
78
|
-
function
|
|
94
|
+
function A(e) {
|
|
79
95
|
if (e.startsWith("#")) return e;
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
82
|
-
const
|
|
83
|
-
return "#" + [
|
|
84
|
-
const
|
|
85
|
-
return
|
|
96
|
+
const o = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
97
|
+
if (!o) return "#000000";
|
|
98
|
+
const t = parseInt(o[1]), c = parseInt(o[2]), n = parseInt(o[3]);
|
|
99
|
+
return "#" + [t, c, n].map((r) => {
|
|
100
|
+
const a = r.toString(16);
|
|
101
|
+
return a.length === 1 ? "0" + a : a;
|
|
86
102
|
}).join("");
|
|
87
103
|
}
|
|
88
|
-
function
|
|
89
|
-
const
|
|
90
|
-
|
|
104
|
+
function L(e) {
|
|
105
|
+
const o = window.getSelection();
|
|
106
|
+
o && o.rangeCount > 0 && (x = o.getRangeAt(0).cloneRange()), i = T(), l = document.createElement("div"), l.className = "rte-inline-color-picker", S(e) && l.classList.add("rte-theme-dark"), l.addEventListener("click", (t) => t.stopPropagation()), l.innerHTML = `
|
|
91
107
|
<div class="rte-color-picker-header">
|
|
92
108
|
<span class="rte-color-picker-title">Text Color</span>
|
|
93
109
|
<button class="rte-color-picker-close" aria-label="Close">×</button>
|
|
@@ -104,13 +120,13 @@ function E(e) {
|
|
|
104
120
|
<div class="rte-color-section">
|
|
105
121
|
<label class="rte-color-section-label">Colors</label>
|
|
106
122
|
<div class="rte-color-palette">
|
|
107
|
-
${
|
|
123
|
+
${C.map((t) => `
|
|
108
124
|
<button
|
|
109
|
-
class="rte-color-swatch ${i ===
|
|
110
|
-
style="background-color: ${
|
|
111
|
-
data-color="${
|
|
112
|
-
title="${
|
|
113
|
-
aria-label="${
|
|
125
|
+
class="rte-color-swatch ${i === t ? "selected" : ""}"
|
|
126
|
+
style="background-color: ${t}; ${t === "#ffffff" ? "border: 1px solid #ccc;" : ""}"
|
|
127
|
+
data-color="${t}"
|
|
128
|
+
title="${t.toUpperCase()}"
|
|
129
|
+
aria-label="${t.toUpperCase()}"
|
|
114
130
|
></button>
|
|
115
131
|
`).join("")}
|
|
116
132
|
</div>
|
|
@@ -137,73 +153,73 @@ function E(e) {
|
|
|
137
153
|
</div>
|
|
138
154
|
</div>
|
|
139
155
|
</div>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
`, document.body.appendChild(l), d && (d.destroy(), d = null), d = w({
|
|
157
|
+
popover: l,
|
|
158
|
+
anchor: e,
|
|
159
|
+
onClose: p,
|
|
160
|
+
gap: 4,
|
|
161
|
+
margin: 8,
|
|
162
|
+
zIndex: 1e4
|
|
163
|
+
}), P();
|
|
143
164
|
}
|
|
144
|
-
function
|
|
145
|
-
if (!
|
|
146
|
-
const e =
|
|
147
|
-
e == null || e.addEventListener("click", () =>
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
165
|
+
function P() {
|
|
166
|
+
if (!l) return;
|
|
167
|
+
const e = l.querySelector(".rte-color-picker-close");
|
|
168
|
+
e == null || e.addEventListener("click", () => p()), l.querySelectorAll(".rte-color-swatch").forEach((n) => {
|
|
169
|
+
n.addEventListener("click", () => {
|
|
170
|
+
const r = n.getAttribute("data-color");
|
|
171
|
+
r && (i = r, f(r), p());
|
|
151
172
|
});
|
|
152
173
|
});
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
i =
|
|
174
|
+
const t = l.querySelector(".rte-color-input-native");
|
|
175
|
+
t == null || t.addEventListener("change", (n) => {
|
|
176
|
+
const r = n.target.value;
|
|
177
|
+
i = r, f(r), p();
|
|
157
178
|
});
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
/^#[0-9A-Fa-f]{6}$/.test(
|
|
162
|
-
}),
|
|
163
|
-
const
|
|
164
|
-
i =
|
|
165
|
-
}),
|
|
166
|
-
const
|
|
167
|
-
/^#[0-9A-Fa-f]{6}$/.test(
|
|
179
|
+
const c = l.querySelector(".rte-color-input-text");
|
|
180
|
+
c == null || c.addEventListener("change", (n) => {
|
|
181
|
+
const r = n.target.value;
|
|
182
|
+
/^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, f(r), p());
|
|
183
|
+
}), t == null || t.addEventListener("input", (n) => {
|
|
184
|
+
const r = n.target.value;
|
|
185
|
+
i = r, h(r), k(r), _(r);
|
|
186
|
+
}), c == null || c.addEventListener("input", (n) => {
|
|
187
|
+
const r = n.target.value;
|
|
188
|
+
/^#[0-9A-Fa-f]{6}$/.test(r) && (i = r, h(r), k(r), $(r));
|
|
168
189
|
});
|
|
169
190
|
}
|
|
170
|
-
function
|
|
171
|
-
if (!
|
|
172
|
-
const
|
|
173
|
-
|
|
191
|
+
function h(e) {
|
|
192
|
+
if (!l) return;
|
|
193
|
+
const o = l.querySelector(".rte-color-preview-box"), t = l.querySelector(".rte-color-preview-label");
|
|
194
|
+
o && (o.style.backgroundColor = e, o.style.border = e === "#ffffff" ? "1px solid #ccc" : "none"), t && (t.textContent = e.toUpperCase());
|
|
174
195
|
}
|
|
175
|
-
function
|
|
176
|
-
if (!
|
|
177
|
-
|
|
178
|
-
|
|
196
|
+
function k(e) {
|
|
197
|
+
if (!l) return;
|
|
198
|
+
l.querySelectorAll(".rte-color-swatch").forEach((t) => {
|
|
199
|
+
t.getAttribute("data-color") === e ? t.classList.add("selected") : t.classList.remove("selected");
|
|
179
200
|
});
|
|
180
201
|
}
|
|
181
|
-
function
|
|
182
|
-
if (!
|
|
183
|
-
const
|
|
184
|
-
|
|
202
|
+
function $(e) {
|
|
203
|
+
if (!l) return;
|
|
204
|
+
const o = l.querySelector(".rte-color-input-native");
|
|
205
|
+
o && (o.value = e);
|
|
185
206
|
}
|
|
186
|
-
function
|
|
187
|
-
if (!
|
|
188
|
-
const
|
|
189
|
-
|
|
207
|
+
function _(e) {
|
|
208
|
+
if (!l) return;
|
|
209
|
+
const o = l.querySelector(".rte-color-input-text");
|
|
210
|
+
o && (o.value = e);
|
|
190
211
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
212
|
+
function p() {
|
|
213
|
+
d && (d.destroy(), d = null), l && (l.remove(), l = null), x = null;
|
|
193
214
|
}
|
|
194
|
-
function
|
|
195
|
-
if (
|
|
196
|
-
return
|
|
197
|
-
const e =
|
|
198
|
-
return e ? (
|
|
215
|
+
function R() {
|
|
216
|
+
if (g(), l)
|
|
217
|
+
return p(), !0;
|
|
218
|
+
const e = E("openTextColorPicker");
|
|
219
|
+
return e ? (L(e), !0) : !1;
|
|
199
220
|
}
|
|
200
221
|
function g() {
|
|
201
|
-
if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, document.
|
|
202
|
-
if (r && p) {
|
|
203
|
-
const t = e.target;
|
|
204
|
-
!r.contains(t) && !p.contains(t) && a();
|
|
205
|
-
}
|
|
206
|
-
}), !document.getElementById("text-color-plugin-styles"))) {
|
|
222
|
+
if (!window.__textColorPluginInitialized && (window.__textColorPluginInitialized = !0, !document.getElementById("text-color-plugin-styles"))) {
|
|
207
223
|
const e = document.createElement("style");
|
|
208
224
|
e.id = "text-color-plugin-styles", e.textContent = `
|
|
209
225
|
.rte-inline-color-picker {
|
|
@@ -458,7 +474,7 @@ function g() {
|
|
|
458
474
|
}
|
|
459
475
|
}
|
|
460
476
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", g) : setTimeout(g, 100);
|
|
461
|
-
const
|
|
477
|
+
const M = () => ({
|
|
462
478
|
name: "textColor",
|
|
463
479
|
marks: {
|
|
464
480
|
textColor: {
|
|
@@ -469,24 +485,24 @@ const A = () => ({
|
|
|
469
485
|
{
|
|
470
486
|
tag: "span[style*=color]",
|
|
471
487
|
getAttrs: (e) => {
|
|
472
|
-
const
|
|
473
|
-
return
|
|
488
|
+
const t = (e.getAttribute("style") || "").match(/color:\s*([^;]+)/);
|
|
489
|
+
return t ? { color: t[1] } : null;
|
|
474
490
|
}
|
|
475
491
|
},
|
|
476
492
|
{
|
|
477
493
|
tag: "font[color]",
|
|
478
494
|
getAttrs: (e) => {
|
|
479
|
-
const
|
|
480
|
-
return
|
|
495
|
+
const o = e.getAttribute("color");
|
|
496
|
+
return o ? { color: o } : null;
|
|
481
497
|
}
|
|
482
498
|
}
|
|
483
499
|
],
|
|
484
500
|
toDOM: (e) => {
|
|
485
|
-
var
|
|
501
|
+
var o;
|
|
486
502
|
return [
|
|
487
503
|
"span",
|
|
488
504
|
{
|
|
489
|
-
style: `color: ${((
|
|
505
|
+
style: `color: ${((o = e.attrs) == null ? void 0 : o.color) || "#000000"}`,
|
|
490
506
|
class: "rte-text-color"
|
|
491
507
|
},
|
|
492
508
|
0
|
|
@@ -502,12 +518,12 @@ const A = () => ({
|
|
|
502
518
|
}
|
|
503
519
|
],
|
|
504
520
|
commands: {
|
|
505
|
-
openTextColorPicker: () =>
|
|
506
|
-
setTextColor: (e) => e ?
|
|
521
|
+
openTextColorPicker: () => R(),
|
|
522
|
+
setTextColor: (e) => e ? f(e) : !1
|
|
507
523
|
},
|
|
508
524
|
keymap: {}
|
|
509
525
|
});
|
|
510
526
|
export {
|
|
511
|
-
|
|
527
|
+
M as TextColorPlugin
|
|
512
528
|
};
|
|
513
|
-
//# sourceMappingURL=TextColorPlugin.native-
|
|
529
|
+
//# sourceMappingURL=TextColorPlugin.native-Bwl_bSmc.mjs.map
|