@editora/core 1.0.22 → 1.0.24
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 +247 -243
- package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
- package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
- package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
- package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
- package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
- package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
- package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
- package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
- package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
- package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
- package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
- package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
- package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
- package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-tZqIa9o5.mjs} +21 -20
- package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
- package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
- package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
- package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
- package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
- package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
- package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
- package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
- package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +1161 -0
- package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
- package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
- package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
- package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
- package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
- package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
- package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
- package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
- package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
- package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
- package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
- package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
- package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
- package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
- package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
- package/dist/confirmDialog-BP8hZPpX.mjs +112 -0
- package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
- package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
- package/dist/editora.min.js +21 -21
- package/dist/editora.umd.js +10 -10
- package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
- package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/katex-DLIObQUm.mjs +11683 -0
- package/dist/katex.min--Ws3c9be.mjs +6 -0
- package/dist/notify-DCQGpmq-.mjs +60 -0
- package/dist/plugin-loader.js +54 -54
- package/dist/webcomponent-core.js +305 -234
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +153 -80
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +631 -560
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1677 -1328
- package/package.json +1 -1
- package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
- package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
- package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
- package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { i as z } from "./dialogHelpers-
|
|
1
|
+
import { i as z } from "./dialogHelpers-Dzn8DHoF.mjs";
|
|
2
|
+
import { n as M } from "./notify-DCQGpmq-.mjs";
|
|
2
3
|
import { f as D, g as S } from "./editorContainerHelpers-C7kdWnS0.mjs";
|
|
3
4
|
const b = /* @__PURE__ */ new Set(), y = '[data-theme="dark"], .dark, .editora-theme-dark';
|
|
4
|
-
function
|
|
5
|
+
function H(t, l) {
|
|
5
6
|
if (l === t.innerHTML) return;
|
|
6
7
|
const i = window.execEditorCommand || window.executeEditorCommand;
|
|
7
8
|
if (typeof i == "function")
|
|
@@ -10,7 +11,7 @@ function M(t, l) {
|
|
|
10
11
|
} catch (r) {
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function R() {
|
|
14
15
|
if (typeof window == "undefined" || window.__anchorObserverInitialized) return;
|
|
15
16
|
window.__anchorObserverInitialized = !0, new MutationObserver((l) => {
|
|
16
17
|
l.forEach((i) => {
|
|
@@ -38,7 +39,7 @@ function H() {
|
|
|
38
39
|
function A(t) {
|
|
39
40
|
return !t || t.trim().length === 0 ? { valid: !1, error: "Anchor ID cannot be empty" } : t.length > 256 ? { valid: !1, error: "Anchor ID must be less than 256 characters" } : /^[A-Za-z_]/.test(t) ? /^[A-Za-z0-9\-_]+$/.test(t) ? { valid: !0, error: "" } : { valid: !1, error: "Anchor ID can only contain letters, numbers, hyphens, and underscores" } : { valid: !1, error: "Anchor ID must start with a letter or underscore" };
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function I() {
|
|
42
43
|
const t = D();
|
|
43
44
|
if (!t) return;
|
|
44
45
|
const l = S(t);
|
|
@@ -49,7 +50,7 @@ function R() {
|
|
|
49
50
|
e && r.add(e);
|
|
50
51
|
}), b.clear(), r.forEach((a) => b.add(a));
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function _(t) {
|
|
53
54
|
if (t) {
|
|
54
55
|
const r = t.startContainer, a = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement;
|
|
55
56
|
if (a != null && a.closest(y)) return !0;
|
|
@@ -62,9 +63,9 @@ function I(t) {
|
|
|
62
63
|
const i = document.activeElement;
|
|
63
64
|
return i != null && i.closest(y) ? !0 : document.body.matches(y) || document.documentElement.matches(y);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
document.querySelectorAll(".rte-anchor-dialog-overlay").forEach((s) => s.remove()),
|
|
67
|
-
const a =
|
|
66
|
+
function L(t, l, i, r) {
|
|
67
|
+
document.querySelectorAll(".rte-anchor-dialog-overlay").forEach((s) => s.remove()), I();
|
|
68
|
+
const a = _(r), e = a ? {
|
|
68
69
|
overlay: "rgba(0, 0, 0, 0.62)",
|
|
69
70
|
dialogBg: "#1f2937",
|
|
70
71
|
panelBg: "#222d3a",
|
|
@@ -81,7 +82,7 @@ function _(t, l, i, r) {
|
|
|
81
82
|
cancelBg: "#334155",
|
|
82
83
|
cancelHover: "#475569",
|
|
83
84
|
cancelText: "#e2e8f0",
|
|
84
|
-
saveBg: "#
|
|
85
|
+
saveBg: "#2563eb",
|
|
85
86
|
saveHover: "#2563eb",
|
|
86
87
|
saveDisabledBg: "#374151",
|
|
87
88
|
saveDisabledText: "#7f8ca1",
|
|
@@ -94,7 +95,7 @@ function _(t, l, i, r) {
|
|
|
94
95
|
panelBg: "#f9f9f9",
|
|
95
96
|
border: "#e0e0e0",
|
|
96
97
|
text: "#333333",
|
|
97
|
-
muted: "#
|
|
98
|
+
muted: "#6b6b6b",
|
|
98
99
|
closeHoverBg: "#e0e0e0",
|
|
99
100
|
fieldBg: "#ffffff",
|
|
100
101
|
fieldFocusBg: "#f9f9ff",
|
|
@@ -109,7 +110,7 @@ function _(t, l, i, r) {
|
|
|
109
110
|
saveHover: "#0052a3",
|
|
110
111
|
saveDisabledBg: "#d0d0d0",
|
|
111
112
|
saveDisabledText: "#999999",
|
|
112
|
-
help: "#
|
|
113
|
+
help: "#6b6b6b",
|
|
113
114
|
focusRing: "rgba(0, 102, 204, 0.1)",
|
|
114
115
|
errorRing: "rgba(211, 47, 47, 0.1)"
|
|
115
116
|
}, n = document.createElement("div");
|
|
@@ -272,7 +273,7 @@ function _(t, l, i, r) {
|
|
|
272
273
|
s.target === n && w();
|
|
273
274
|
}, f.appendChild(u), f.appendChild(C), f.appendChild(E), n.appendChild(f), document.body.appendChild(n), setTimeout(() => o.focus(), 100);
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function O(t, l) {
|
|
276
277
|
var c;
|
|
277
278
|
let i;
|
|
278
279
|
if (l)
|
|
@@ -301,7 +302,7 @@ function L(t, l) {
|
|
|
301
302
|
`, i.insertNode(n), b.add(t), i.setStart(n.nextSibling || n.parentNode, 0), i.collapse(!0);
|
|
302
303
|
const f = window.getSelection();
|
|
303
304
|
if (f && (f.removeAllRanges(), f.addRange(i)), r)
|
|
304
|
-
|
|
305
|
+
H(r, e), r.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
305
306
|
else {
|
|
306
307
|
const u = D();
|
|
307
308
|
if (u) {
|
|
@@ -394,7 +395,7 @@ function N() {
|
|
|
394
395
|
}
|
|
395
396
|
`, document.head.appendChild(t);
|
|
396
397
|
}
|
|
397
|
-
const
|
|
398
|
+
const P = () => (typeof window != "undefined" && (R(), N()), {
|
|
398
399
|
name: "anchor",
|
|
399
400
|
toolbar: [
|
|
400
401
|
{
|
|
@@ -409,10 +410,10 @@ const j = () => (typeof window != "undefined" && (H(), N()), {
|
|
|
409
410
|
try {
|
|
410
411
|
const t = window.getSelection();
|
|
411
412
|
if (!t || t.rangeCount === 0)
|
|
412
|
-
return
|
|
413
|
+
return M("Please place your cursor where you want to insert the anchor."), !1;
|
|
413
414
|
const l = t.getRangeAt(0).cloneRange();
|
|
414
|
-
return
|
|
415
|
-
|
|
415
|
+
return L("add", "", (i) => {
|
|
416
|
+
O(i, l);
|
|
416
417
|
}, l), !0;
|
|
417
418
|
} catch (t) {
|
|
418
419
|
return console.error("Failed to insert anchor:", t), !1;
|
|
@@ -424,6 +425,6 @@ const j = () => (typeof window != "undefined" && (H(), N()), {
|
|
|
424
425
|
}
|
|
425
426
|
});
|
|
426
427
|
export {
|
|
427
|
-
|
|
428
|
+
P as AnchorPlugin
|
|
428
429
|
};
|
|
429
|
-
//# sourceMappingURL=AnchorPlugin.native-
|
|
430
|
+
//# sourceMappingURL=AnchorPlugin.native-Dk9R26cF.mjs.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { f as ft } from "./dialogHelpers-Dzn8DHoF.mjs";
|
|
2
|
+
const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", et = "__editoraCommandEditorRoot", ot = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", k = "approvalWorkflow", v = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', mt = {
|
|
2
3
|
panelTitle: "Approval Workflow",
|
|
3
4
|
panelAriaLabel: "Approval workflow panel",
|
|
4
5
|
statusLabel: "Status",
|
|
@@ -22,16 +23,16 @@ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-edi
|
|
|
22
23
|
lockedSuffix: "Locked",
|
|
23
24
|
shortcutText: "Shortcuts: Ctrl/Cmd+Alt+Shift+A/R/P/D",
|
|
24
25
|
approveCommentRequiredText: "Approval comment is required."
|
|
25
|
-
},
|
|
26
|
+
}, bt = {
|
|
26
27
|
draft: "statusDraftText",
|
|
27
28
|
review: "statusReviewText",
|
|
28
29
|
approved: "statusApprovedText"
|
|
29
30
|
}, p = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
|
|
30
|
-
let _ = 0,
|
|
31
|
+
let _ = 0, vt = 0, rt = 0, at = 0, R = null, g = null, T = null, L = null, S = null;
|
|
31
32
|
function c(t) {
|
|
32
33
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function gt(t) {
|
|
35
36
|
return t.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
|
|
36
37
|
}
|
|
37
38
|
function lt(t) {
|
|
@@ -46,10 +47,10 @@ function z(t = {}) {
|
|
|
46
47
|
requireCommentOnApprove: !!t.requireCommentOnApprove,
|
|
47
48
|
defaultActor: (t.defaultActor || "system").trim() || "system",
|
|
48
49
|
labels: {
|
|
49
|
-
...
|
|
50
|
+
...mt,
|
|
50
51
|
...t.labels || {}
|
|
51
52
|
},
|
|
52
|
-
normalizeText: t.normalizeText ||
|
|
53
|
+
normalizeText: t.normalizeText || gt
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
function Y(t) {
|
|
@@ -61,7 +62,7 @@ function K(t) {
|
|
|
61
62
|
const e = t.querySelector(w);
|
|
62
63
|
return e instanceof HTMLElement ? e : null;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function ht() {
|
|
65
66
|
if (typeof window == "undefined") return null;
|
|
66
67
|
const t = window[et];
|
|
67
68
|
if (!(t instanceof HTMLElement)) return null;
|
|
@@ -75,7 +76,7 @@ function gt() {
|
|
|
75
76
|
}
|
|
76
77
|
return null;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function xt(t) {
|
|
79
80
|
const e = t.closest("[data-editora-editor]");
|
|
80
81
|
if (e && K(e) === t)
|
|
81
82
|
return e;
|
|
@@ -90,14 +91,14 @@ function ht(t) {
|
|
|
90
91
|
function W(t) {
|
|
91
92
|
return t ? (t.getAttribute("data-theme") || t.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : t.classList.contains("dark") || t.classList.contains("editora-theme-dark") || t.classList.contains("rte-theme-dark") : !1;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function wt(t) {
|
|
94
95
|
const e = Y(t);
|
|
95
96
|
if (W(e)) return !0;
|
|
96
97
|
const o = e.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
97
98
|
return W(o) ? !0 : W(document.documentElement) || W(document.body);
|
|
98
99
|
}
|
|
99
100
|
function B(t, e) {
|
|
100
|
-
t.classList.remove("rte-approval-theme-dark"),
|
|
101
|
+
t.classList.remove("rte-approval-theme-dark"), wt(e) && t.classList.add("rte-approval-theme-dark");
|
|
101
102
|
}
|
|
102
103
|
function it(t) {
|
|
103
104
|
return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
|
|
@@ -110,7 +111,7 @@ function x(t, e = !0) {
|
|
|
110
111
|
const l = n.querySelector(w);
|
|
111
112
|
if (l instanceof HTMLElement) return l;
|
|
112
113
|
}
|
|
113
|
-
const o =
|
|
114
|
+
const o = ht();
|
|
114
115
|
if (o) return o;
|
|
115
116
|
const a = window.getSelection();
|
|
116
117
|
if (a && a.rangeCount > 0) {
|
|
@@ -131,17 +132,17 @@ function D() {
|
|
|
131
132
|
e.isConnected || ((o = y.get(e)) == null || o.remove(), y.delete(e), O.delete(e), p.delete(e), I.delete(e), H.delete(e), g === e && (g = null));
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function yt(t) {
|
|
135
136
|
return t ? !!(t.closest(`.${d}`) || t.closest(w) || t.closest(F)) : !1;
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
+
function kt() {
|
|
138
139
|
const t = window.getSelection();
|
|
139
140
|
if (!t || t.rangeCount === 0) return !1;
|
|
140
141
|
const e = t.getRangeAt(0).startContainer, o = it(e);
|
|
141
142
|
return !!(o != null && o.closest(w));
|
|
142
143
|
}
|
|
143
144
|
function C(t, e, o) {
|
|
144
|
-
const a =
|
|
145
|
+
const a = xt(t);
|
|
145
146
|
Array.from(
|
|
146
147
|
a.querySelectorAll(
|
|
147
148
|
`.rte-toolbar-button[data-command="${e}"], .editora-toolbar-button[data-command="${e}"]`
|
|
@@ -168,7 +169,7 @@ function J(t, e) {
|
|
|
168
169
|
function Q() {
|
|
169
170
|
return rt += 1, `approval-comment-${Date.now().toString(36)}-${rt.toString(36)}`;
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function At() {
|
|
172
173
|
return at += 1, `approval-signoff-${Date.now().toString(36)}-${at.toString(36)}`;
|
|
173
174
|
}
|
|
174
175
|
function pt(t) {
|
|
@@ -180,8 +181,8 @@ function pt(t) {
|
|
|
180
181
|
updatedAt: t.updatedAt
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
const o =
|
|
184
|
+
function St(t, e) {
|
|
185
|
+
const o = bt[t];
|
|
185
186
|
return e.labels[o] || t;
|
|
186
187
|
}
|
|
187
188
|
function ct(t, e, o) {
|
|
@@ -218,7 +219,7 @@ function M(t, e) {
|
|
|
218
219
|
const o = t.querySelector(".rte-approval-live");
|
|
219
220
|
o && (o.textContent = e);
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
+
function Et(t, e) {
|
|
222
223
|
const o = pt(e);
|
|
223
224
|
t.__approvalWorkflowState = o, t.dispatchEvent(
|
|
224
225
|
new CustomEvent("editora:approval-state-changed", {
|
|
@@ -229,14 +230,14 @@ function St(t, e) {
|
|
|
229
230
|
})
|
|
230
231
|
);
|
|
231
232
|
}
|
|
232
|
-
function
|
|
233
|
+
function P(t) {
|
|
233
234
|
const e = y.get(t);
|
|
234
235
|
if (!e) return;
|
|
235
236
|
const o = p.get(t) || R;
|
|
236
237
|
if (!o) return;
|
|
237
238
|
const a = f(t, o), r = e.querySelector(".rte-approval-summary"), n = e.querySelector('[data-action="request-review"]'), l = e.querySelector('[data-action="approve"]'), s = e.querySelector('[data-action="reopen-draft"]'), u = e.querySelector(".rte-approval-comments-list"), m = e.querySelector(".rte-approval-signoffs-list");
|
|
238
239
|
if (r) {
|
|
239
|
-
const i =
|
|
240
|
+
const i = St(a.status, o);
|
|
240
241
|
r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${a.comments.length} | Sign-offs: ${a.signoffs.length}${a.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
|
|
241
242
|
}
|
|
242
243
|
n && (n.disabled = a.status !== "draft"), l && (l.disabled = a.status === "approved"), s && (s.disabled = a.status === "draft"), u && (a.comments.length === 0 ? u.innerHTML = `<li class="rte-approval-empty">${c(o.labels.noCommentsText)}</li>` : u.innerHTML = a.comments.slice().reverse().map(
|
|
@@ -266,7 +267,7 @@ function q(t) {
|
|
|
266
267
|
).join(""));
|
|
267
268
|
}
|
|
268
269
|
function G(t, e, o) {
|
|
269
|
-
e.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ct(t, e, o),
|
|
270
|
+
e.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ct(t, e, o), P(t), Et(t, e);
|
|
270
271
|
}
|
|
271
272
|
function nt(t, e, o, a) {
|
|
272
273
|
t.comments.push({
|
|
@@ -300,7 +301,7 @@ function Z(t, e, o, a) {
|
|
|
300
301
|
if (e.requireCommentOnApprove && !n) return !1;
|
|
301
302
|
const l = f(t, e), s = t.innerHTML;
|
|
302
303
|
return l.status = "approved", l.signoffs.push({
|
|
303
|
-
id:
|
|
304
|
+
id: At(),
|
|
304
305
|
author: r,
|
|
305
306
|
comment: n || void 0,
|
|
306
307
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -315,7 +316,7 @@ function Z(t, e, o, a) {
|
|
|
315
316
|
function N(t, e) {
|
|
316
317
|
return t.querySelector(`[data-field="${e}"]`);
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
+
function $t(t) {
|
|
319
320
|
var a, r;
|
|
320
321
|
const e = ((a = N(t, "actor")) == null ? void 0 : a.value) || "", o = ((r = N(t, "comment")) == null ? void 0 : r.value) || "";
|
|
321
322
|
return { actor: e, comment: o };
|
|
@@ -325,10 +326,10 @@ function U(t, e) {
|
|
|
325
326
|
const a = Y(t).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 420), n = Math.max(10, window.innerWidth - r - 10), l = Math.min(Math.max(10, a.right - r), n), s = Math.max(10, Math.min(window.innerHeight - 10 - 280, a.top + 12));
|
|
326
327
|
e.style.width = `${r}px`, e.style.left = `${l}px`, e.style.top = `${s}px`, e.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
+
function Ct(t) {
|
|
329
330
|
const e = y.get(t);
|
|
330
331
|
if (e) return e;
|
|
331
|
-
const o = p.get(t) || R || z(), a = `rte-approval-panel-${
|
|
332
|
+
const o = p.get(t) || R || z(), a = `rte-approval-panel-${vt++}`, r = document.createElement("section");
|
|
332
333
|
return r.className = d, r.id = a, r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false"), r.setAttribute("aria-label", o.labels.panelAriaLabel), r.setAttribute("tabindex", "-1"), r.innerHTML = `
|
|
333
334
|
<header class="rte-approval-header">
|
|
334
335
|
<h2 class="rte-approval-title">${c(o.labels.panelTitle)}</h2>
|
|
@@ -389,10 +390,10 @@ function $t(t) {
|
|
|
389
390
|
if (!s) return;
|
|
390
391
|
const u = s.getAttribute("data-action") || "", m = p.get(t) || R || o;
|
|
391
392
|
if (p.set(t, m), f(t, m), u === "close") {
|
|
392
|
-
|
|
393
|
+
q(t, !0);
|
|
393
394
|
return;
|
|
394
395
|
}
|
|
395
|
-
const i =
|
|
396
|
+
const i = $t(r);
|
|
396
397
|
if (u === "request-review") {
|
|
397
398
|
$(t, "review", m, i.actor || m.defaultActor) && M(r, "Status changed to review.");
|
|
398
399
|
return;
|
|
@@ -420,47 +421,47 @@ function $t(t) {
|
|
|
420
421
|
return;
|
|
421
422
|
}
|
|
422
423
|
}), r.addEventListener("keydown", (n) => {
|
|
423
|
-
n.key === "Escape" && (n.preventDefault(),
|
|
424
|
-
}), B(r, t), document.body.appendChild(r), y.set(t, r), O.set(t, !1),
|
|
424
|
+
n.key === "Escape" && (n.preventDefault(), q(t, !0));
|
|
425
|
+
}), B(r, t), document.body.appendChild(r), y.set(t, r), O.set(t, !1), P(t), r;
|
|
425
426
|
}
|
|
426
427
|
function tt(t) {
|
|
427
428
|
return O.get(t) === !0;
|
|
428
429
|
}
|
|
429
430
|
function A(t) {
|
|
430
431
|
D();
|
|
431
|
-
const e =
|
|
432
|
+
const e = Ct(t);
|
|
432
433
|
y.forEach((o, a) => {
|
|
433
|
-
a !== t &&
|
|
434
|
-
}), e.classList.add("show"), O.set(t, !0), C(t, "toggleApprovalWorkflowPanel", !0), B(e, t), U(t, e),
|
|
434
|
+
a !== t && q(a, !1);
|
|
435
|
+
}), e.classList.add("show"), O.set(t, !0), C(t, "toggleApprovalWorkflowPanel", !0), B(e, t), U(t, e), P(t), ft(e);
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function q(t, e = !1) {
|
|
437
438
|
const o = y.get(t);
|
|
438
439
|
o && (o.classList.remove("show"), O.set(t, !1), C(t, "toggleApprovalWorkflowPanel", !1), e && t.focus({ preventScroll: !0 }));
|
|
439
440
|
}
|
|
440
441
|
function ut(t, e) {
|
|
441
442
|
const o = tt(t);
|
|
442
|
-
return (typeof e == "boolean" ? e : !o) ? A(t) :
|
|
443
|
+
return (typeof e == "boolean" ? e : !o) ? A(t) : q(t), !0;
|
|
443
444
|
}
|
|
444
445
|
function V(t) {
|
|
445
446
|
return typeof t.key == "string" ? t.key.toLowerCase() : "";
|
|
446
447
|
}
|
|
447
|
-
function
|
|
448
|
+
function Tt(t) {
|
|
448
449
|
const e = V(t);
|
|
449
450
|
return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "a";
|
|
450
451
|
}
|
|
451
|
-
function
|
|
452
|
+
function Lt(t) {
|
|
452
453
|
const e = V(t);
|
|
453
454
|
return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "r";
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
+
function Rt(t) {
|
|
456
457
|
const e = V(t);
|
|
457
458
|
return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "p";
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
+
function Mt(t) {
|
|
460
461
|
const e = V(t);
|
|
461
462
|
return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "d";
|
|
462
463
|
}
|
|
463
|
-
function
|
|
464
|
+
function Dt(t) {
|
|
464
465
|
R = t, T || (T = (e) => {
|
|
465
466
|
D();
|
|
466
467
|
const o = e.target, a = o == null ? void 0 : o.closest(w);
|
|
@@ -472,12 +473,12 @@ function Mt(t) {
|
|
|
472
473
|
n && (B(n, a), U(a, n));
|
|
473
474
|
}, document.addEventListener("focusin", T, !0)), L || (L = (e) => {
|
|
474
475
|
if (e.defaultPrevented) return;
|
|
475
|
-
const o =
|
|
476
|
+
const o = Tt(e), a = Lt(e), r = Rt(e), n = Mt(e), l = e.key === "Escape";
|
|
476
477
|
if (!l && !o && !a && !r && !n)
|
|
477
478
|
return;
|
|
478
479
|
D();
|
|
479
480
|
const s = e.target, u = !!(s != null && s.closest(`.${d} input, .${d} textarea, .${d} select`));
|
|
480
|
-
if (!
|
|
481
|
+
if (!yt(s) && !kt())
|
|
481
482
|
return;
|
|
482
483
|
const i = x(void 0, !1);
|
|
483
484
|
if (!i) return;
|
|
@@ -485,7 +486,7 @@ function Mt(t) {
|
|
|
485
486
|
p.set(i, b);
|
|
486
487
|
const E = f(i, b);
|
|
487
488
|
if (g = i, l && tt(i)) {
|
|
488
|
-
e.preventDefault(),
|
|
489
|
+
e.preventDefault(), q(i, !0);
|
|
489
490
|
return;
|
|
490
491
|
}
|
|
491
492
|
if (!u) {
|
|
@@ -509,7 +510,7 @@ function Mt(t) {
|
|
|
509
510
|
});
|
|
510
511
|
}, window.addEventListener("scroll", S, !0), window.addEventListener("resize", S));
|
|
511
512
|
}
|
|
512
|
-
function
|
|
513
|
+
function Ht(t) {
|
|
513
514
|
var o, a;
|
|
514
515
|
const e = I.get(t);
|
|
515
516
|
e && (t.classList.remove("rte-approval-locked-editor"), t.removeAttribute("data-approval-status"), t.removeAttribute("data-approval-locked"), st(
|
|
@@ -518,8 +519,8 @@ function Dt(t) {
|
|
|
518
519
|
(a = e.preApprovalReadonly) != null ? a : e.originalReadonly
|
|
519
520
|
));
|
|
520
521
|
}
|
|
521
|
-
function
|
|
522
|
-
T && (document.removeEventListener("focusin", T, !0), T = null), L && (document.removeEventListener("keydown", L, !0), L = null), S && (window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), S = null), y.forEach((t) => t.remove()), y.clear(), H.forEach((t) =>
|
|
522
|
+
function Pt() {
|
|
523
|
+
T && (document.removeEventListener("focusin", T, !0), T = null), L && (document.removeEventListener("keydown", L, !0), L = null), S && (window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), S = null), y.forEach((t) => t.remove()), y.clear(), H.forEach((t) => Ht(t)), H.clear(), R = null, g = null;
|
|
523
524
|
}
|
|
524
525
|
function qt() {
|
|
525
526
|
if (typeof document == "undefined" || document.getElementById(ot)) return;
|
|
@@ -858,7 +859,7 @@ function qt() {
|
|
|
858
859
|
|
|
859
860
|
.rte-approval-item-time {
|
|
860
861
|
font-size: 11px;
|
|
861
|
-
color: #
|
|
862
|
+
color: #475569;
|
|
862
863
|
}
|
|
863
864
|
|
|
864
865
|
.${d}.rte-approval-theme-dark .rte-approval-item-time {
|
|
@@ -877,7 +878,7 @@ function qt() {
|
|
|
877
878
|
border-radius: 8px;
|
|
878
879
|
padding: 8px;
|
|
879
880
|
font-size: 12px;
|
|
880
|
-
color: #
|
|
881
|
+
color: #475569;
|
|
881
882
|
}
|
|
882
883
|
|
|
883
884
|
.${d}.rte-approval-theme-dark .rte-approval-empty {
|
|
@@ -888,7 +889,7 @@ function qt() {
|
|
|
888
889
|
.rte-approval-shortcut {
|
|
889
890
|
margin: 0;
|
|
890
891
|
font-size: 11px;
|
|
891
|
-
color: #
|
|
892
|
+
color: #475569;
|
|
892
893
|
}
|
|
893
894
|
|
|
894
895
|
.${d}.rte-approval-theme-dark .rte-approval-shortcut {
|
|
@@ -917,7 +918,7 @@ function qt() {
|
|
|
917
918
|
}
|
|
918
919
|
`, document.head.appendChild(t);
|
|
919
920
|
}
|
|
920
|
-
const
|
|
921
|
+
const _t = (t = {}) => {
|
|
921
922
|
const e = z(t);
|
|
922
923
|
return qt(), {
|
|
923
924
|
name: "approvalWorkflow",
|
|
@@ -964,7 +965,7 @@ const Pt = (t = {}) => {
|
|
|
964
965
|
const r = x(a);
|
|
965
966
|
if (!r) return !1;
|
|
966
967
|
const n = p.get(r) || e;
|
|
967
|
-
return p.set(r, n), f(r, n), g = r, A(r),
|
|
968
|
+
return p.set(r, n), f(r, n), g = r, A(r), P(r), !0;
|
|
968
969
|
},
|
|
969
970
|
toggleApprovalWorkflowPanel: (o, a) => {
|
|
970
971
|
const r = x(a);
|
|
@@ -1062,19 +1063,19 @@ const Pt = (t = {}) => {
|
|
|
1062
1063
|
init: function(a) {
|
|
1063
1064
|
_ += 1;
|
|
1064
1065
|
const r = this && typeof this.__pluginConfig == "object" ? z({ ...e, ...this.__pluginConfig }) : e;
|
|
1065
|
-
|
|
1066
|
+
Dt(r);
|
|
1066
1067
|
const n = x(
|
|
1067
1068
|
a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
|
|
1068
1069
|
!1
|
|
1069
1070
|
);
|
|
1070
|
-
n && (p.set(n, r), f(n, r), g = n,
|
|
1071
|
+
n && (p.set(n, r), f(n, r), g = n, P(n));
|
|
1071
1072
|
},
|
|
1072
1073
|
destroy: () => {
|
|
1073
|
-
_ = Math.max(0, _ - 1), !(_ > 0) &&
|
|
1074
|
+
_ = Math.max(0, _ - 1), !(_ > 0) && Pt();
|
|
1074
1075
|
}
|
|
1075
1076
|
};
|
|
1076
1077
|
};
|
|
1077
1078
|
export {
|
|
1078
|
-
|
|
1079
|
+
_t as ApprovalWorkflowPlugin
|
|
1079
1080
|
};
|
|
1080
|
-
//# sourceMappingURL=ApprovalWorkflowPlugin.native-
|
|
1081
|
+
//# sourceMappingURL=ApprovalWorkflowPlugin.native-AeJsehXM.mjs.map
|