@editora/plugins 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/_commonjsHelpers-6763f629.js +1 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +98 -80
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +128 -115
- package/dist/anchoredPopover-33f1358d.mjs +109 -0
- package/dist/anchoredPopover-8151d535.js +1 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +249 -208
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +68 -55
- package/dist/blockquote.esm.js +2 -1
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +245 -178
- package/dist/capitalization.esm.js +2 -1
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +82 -58
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +512 -439
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +33 -27
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +93 -82
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +653 -594
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +158 -116
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +432 -371
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +159 -105
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +368 -328
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +308 -240
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +5 -4
- package/dist/documentManager-25b6203c.mjs +9122 -0
- package/dist/documentManager-b69e7054.js +17 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +81 -73
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +77 -65
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +56 -54
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +47 -39
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +53 -37
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +117 -76
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +92 -70
- package/dist/html2canvas.esm-09133e29.js +22 -0
- package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +24 -12
- package/dist/index-656d224b.js +231 -0
- package/dist/index-6a8c48bb.js +1 -0
- package/dist/index-d027b7e2.mjs +16859 -0
- package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-730f2d98.mjs +5775 -0
- package/dist/index.es-dd40173b.js +18 -0
- package/dist/index.esm.js +128 -125
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +9 -8
- package/dist/jspdf.es.min-90db2c97.js +243 -0
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +24 -11
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +30 -24
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +25 -20
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +61 -59
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +146 -139
- package/dist/media-manager.cjs.js +38 -38
- package/dist/media-manager.esm.js +325 -308
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +286 -238
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +216 -177
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +49 -33
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +463 -393
- package/dist/preview.esm.js +10 -5
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +20 -17
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
- package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
- package/dist/slash-commands.cjs.js +3 -3
- package/dist/slash-commands.esm.js +212 -176
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +336 -280
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +69 -61
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +123 -97
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +19 -14
- package/dist/style.css +1 -0
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +225 -191
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +153 -124
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +27 -21
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +87 -70
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +162 -100
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +678 -602
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +157 -128
- package/package.json +13 -7
- package/LICENSE +0 -21
- package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
- package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/documentManager-CTqRftU8.mjs +0 -8369
- package/dist/documentManager-Jf0RbSks.js +0 -17
- package/dist/html2canvas.esm-B5qzocYs.js +0 -5
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-D3CycEFU.mjs +0 -16543
- package/dist/index-tqLTHcO6.js +0 -1
- package/dist/index.es-CE_A4QSm.js +0 -5
- package/dist/index.es-DQ78mYYo.mjs +0 -6665
- package/dist/jspdf.es.min-BoS80556.js +0 -77
- package/dist/plugins.css +0 -1
- /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ee = "__editoraCommandEditorRoot", te = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", y = "approvalWorkflow",
|
|
1
|
+
const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ee = "__editoraCommandEditorRoot", te = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", y = "approvalWorkflow", v = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ue = {
|
|
2
2
|
panelTitle: "Approval Workflow",
|
|
3
3
|
panelAriaLabel: "Approval workflow panel",
|
|
4
4
|
statusLabel: "Status",
|
|
@@ -26,9 +26,9 @@ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-edi
|
|
|
26
26
|
draft: "statusDraftText",
|
|
27
27
|
review: "statusReviewText",
|
|
28
28
|
approved: "statusApprovedText"
|
|
29
|
-
},
|
|
30
|
-
let _ = 0, me = 0, oe = 0, re = 0, R = null,
|
|
31
|
-
function
|
|
29
|
+
}, p = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
|
|
30
|
+
let _ = 0, me = 0, oe = 0, re = 0, R = null, g = null, T = null, L = null, S = null;
|
|
31
|
+
function c(e) {
|
|
32
32
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
33
33
|
}
|
|
34
34
|
function be(e) {
|
|
@@ -55,26 +55,32 @@ function U(e) {
|
|
|
55
55
|
return e.closest(F) || e;
|
|
56
56
|
}
|
|
57
57
|
function B(e) {
|
|
58
|
-
if (!e)
|
|
59
|
-
|
|
58
|
+
if (!e)
|
|
59
|
+
return null;
|
|
60
|
+
if (e.matches(w))
|
|
61
|
+
return e;
|
|
60
62
|
const t = e.querySelector(w);
|
|
61
63
|
return t instanceof HTMLElement ? t : null;
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
if (typeof window > "u")
|
|
65
|
+
function ve() {
|
|
66
|
+
if (typeof window > "u")
|
|
67
|
+
return null;
|
|
65
68
|
const e = window[ee];
|
|
66
|
-
if (!(e instanceof HTMLElement))
|
|
69
|
+
if (!(e instanceof HTMLElement))
|
|
70
|
+
return null;
|
|
67
71
|
window[ee] = null;
|
|
68
72
|
const t = B(e);
|
|
69
|
-
if (t)
|
|
73
|
+
if (t)
|
|
74
|
+
return t;
|
|
70
75
|
const o = e.closest(F);
|
|
71
76
|
if (o) {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
77
|
+
const a = B(o);
|
|
78
|
+
if (a)
|
|
79
|
+
return a;
|
|
74
80
|
}
|
|
75
81
|
return null;
|
|
76
82
|
}
|
|
77
|
-
function
|
|
83
|
+
function ge(e) {
|
|
78
84
|
const t = e.closest("[data-editora-editor]");
|
|
79
85
|
if (t && B(t) === e)
|
|
80
86
|
return t;
|
|
@@ -91,7 +97,8 @@ function W(e) {
|
|
|
91
97
|
}
|
|
92
98
|
function he(e) {
|
|
93
99
|
const t = U(e);
|
|
94
|
-
if (W(t))
|
|
100
|
+
if (W(t))
|
|
101
|
+
return !0;
|
|
95
102
|
const o = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
96
103
|
return W(o) ? !0 : W(document.documentElement) || W(document.body);
|
|
97
104
|
}
|
|
@@ -102,31 +109,39 @@ function le(e) {
|
|
|
102
109
|
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
103
110
|
}
|
|
104
111
|
function x(e, t = !0) {
|
|
105
|
-
if (D(), e
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
if (D(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
113
|
+
return e.contentElement;
|
|
114
|
+
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
115
|
+
const n = e.editorElement;
|
|
116
|
+
if (n.matches(w))
|
|
117
|
+
return n;
|
|
118
|
+
const l = n.querySelector(w);
|
|
119
|
+
if (l instanceof HTMLElement)
|
|
120
|
+
return l;
|
|
111
121
|
}
|
|
112
|
-
const o =
|
|
113
|
-
if (o)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
const o = ve();
|
|
123
|
+
if (o)
|
|
124
|
+
return o;
|
|
125
|
+
const a = window.getSelection();
|
|
126
|
+
if (a && a.rangeCount > 0) {
|
|
127
|
+
const n = le(a.getRangeAt(0).startContainer), l = n == null ? void 0 : n.closest(w);
|
|
128
|
+
if (l)
|
|
129
|
+
return l;
|
|
118
130
|
}
|
|
119
131
|
const r = document.activeElement;
|
|
120
132
|
if (r) {
|
|
121
|
-
if (r.matches(w))
|
|
122
|
-
|
|
123
|
-
|
|
133
|
+
if (r.matches(w))
|
|
134
|
+
return r;
|
|
135
|
+
const n = r.closest(w);
|
|
136
|
+
if (n)
|
|
137
|
+
return n;
|
|
124
138
|
}
|
|
125
|
-
return
|
|
139
|
+
return g && g.isConnected ? g : (g && !g.isConnected && (g = null), t ? document.querySelector(w) : null);
|
|
126
140
|
}
|
|
127
141
|
function D() {
|
|
128
142
|
Array.from(H).forEach((t) => {
|
|
129
|
-
|
|
143
|
+
var o;
|
|
144
|
+
t.isConnected || ((o = k.get(t)) == null || o.remove(), k.delete(t), O.delete(t), p.delete(t), I.delete(t), H.delete(t), g === t && (g = null));
|
|
130
145
|
});
|
|
131
146
|
}
|
|
132
147
|
function xe(e) {
|
|
@@ -134,18 +149,19 @@ function xe(e) {
|
|
|
134
149
|
}
|
|
135
150
|
function we() {
|
|
136
151
|
const e = window.getSelection();
|
|
137
|
-
if (!e || e.rangeCount === 0)
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
if (!e || e.rangeCount === 0)
|
|
153
|
+
return !1;
|
|
154
|
+
const t = e.getRangeAt(0).startContainer, o = le(t);
|
|
155
|
+
return !!(o != null && o.closest(w));
|
|
140
156
|
}
|
|
141
157
|
function C(e, t, o) {
|
|
142
|
-
const
|
|
158
|
+
const a = ge(e);
|
|
143
159
|
Array.from(
|
|
144
|
-
|
|
160
|
+
a.querySelectorAll(
|
|
145
161
|
`.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
|
|
146
162
|
)
|
|
147
|
-
).forEach((
|
|
148
|
-
|
|
163
|
+
).forEach((n) => {
|
|
164
|
+
n.classList.toggle("active", o), n.setAttribute("aria-pressed", o ? "true" : "false"), n.setAttribute("data-active", o ? "true" : "false");
|
|
149
165
|
});
|
|
150
166
|
}
|
|
151
167
|
function ie(e, t, o) {
|
|
@@ -155,7 +171,8 @@ function Y(e) {
|
|
|
155
171
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
156
172
|
}
|
|
157
173
|
function X(e, t) {
|
|
158
|
-
if (t === e.innerHTML)
|
|
174
|
+
if (t === e.innerHTML)
|
|
175
|
+
return;
|
|
159
176
|
const o = window.execEditorCommand || window.executeEditorCommand;
|
|
160
177
|
if (typeof o == "function")
|
|
161
178
|
try {
|
|
@@ -182,7 +199,7 @@ function ye(e, t) {
|
|
|
182
199
|
const o = fe[e];
|
|
183
200
|
return t.labels[o] || e;
|
|
184
201
|
}
|
|
185
|
-
function
|
|
202
|
+
function pe(e, t, o) {
|
|
186
203
|
if (e.setAttribute("data-approval-status", t.status), e.setAttribute("data-approval-locked", t.locked ? "true" : "false"), e.classList.toggle("rte-approval-locked-editor", t.locked), C(e, "toggleApprovalWorkflowPanel", Z(e)), C(e, "requestApprovalReview", t.status === "review"), C(e, "approveDocument", t.status === "approved"), C(e, "reopenDraft", t.status === "draft"), t.status === "approved" && o.lockOnApproval) {
|
|
187
204
|
t.locked || (t.preApprovalContentEditable = e.getAttribute("contenteditable"), t.preApprovalReadonly = e.getAttribute("data-readonly")), e.setAttribute("contenteditable", "false"), e.setAttribute("data-readonly", "true"), t.locked = !0;
|
|
188
205
|
return;
|
|
@@ -205,7 +222,7 @@ function f(e, t) {
|
|
|
205
222
|
originalReadonly: e.getAttribute("data-readonly"),
|
|
206
223
|
preApprovalContentEditable: null,
|
|
207
224
|
preApprovalReadonly: null
|
|
208
|
-
}, I.set(e, o), H.add(e),
|
|
225
|
+
}, I.set(e, o), H.add(e), pe(e, o, t), o);
|
|
209
226
|
}
|
|
210
227
|
function j(e, t) {
|
|
211
228
|
return e.length <= t ? e : e.slice(e.length - t);
|
|
@@ -227,107 +244,115 @@ function Ae(e, t) {
|
|
|
227
244
|
}
|
|
228
245
|
function q(e) {
|
|
229
246
|
const t = k.get(e);
|
|
230
|
-
if (!t)
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
247
|
+
if (!t)
|
|
248
|
+
return;
|
|
249
|
+
const o = p.get(e) || R;
|
|
250
|
+
if (!o)
|
|
251
|
+
return;
|
|
252
|
+
const a = f(e, o), r = t.querySelector(".rte-approval-summary"), n = t.querySelector('[data-action="request-review"]'), l = t.querySelector('[data-action="approve"]'), s = t.querySelector('[data-action="reopen-draft"]'), u = t.querySelector(".rte-approval-comments-list"), m = t.querySelector(".rte-approval-signoffs-list");
|
|
234
253
|
if (r) {
|
|
235
|
-
const i = ye(
|
|
236
|
-
r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${
|
|
254
|
+
const i = ye(a.status, o);
|
|
255
|
+
r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${a.comments.length} | Sign-offs: ${a.signoffs.length}${a.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
|
|
237
256
|
}
|
|
238
|
-
|
|
257
|
+
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(
|
|
239
258
|
(i) => `
|
|
240
259
|
<li class="rte-approval-item rte-approval-item-${i.kind}" role="listitem">
|
|
241
260
|
<div class="rte-approval-item-head">
|
|
242
|
-
<span class="rte-approval-item-author">${
|
|
243
|
-
<time class="rte-approval-item-time" datetime="${
|
|
261
|
+
<span class="rte-approval-item-author">${c(i.author)}</span>
|
|
262
|
+
<time class="rte-approval-item-time" datetime="${c(i.createdAt)}">${c(
|
|
244
263
|
new Date(i.createdAt).toLocaleString()
|
|
245
264
|
)}</time>
|
|
246
265
|
</div>
|
|
247
|
-
<p class="rte-approval-item-message">${
|
|
266
|
+
<p class="rte-approval-item-message">${c(i.message)}</p>
|
|
248
267
|
</li>
|
|
249
268
|
`
|
|
250
|
-
).join("")), m && (
|
|
269
|
+
).join("")), m && (a.signoffs.length === 0 ? m.innerHTML = `<li class="rte-approval-empty">${c(o.labels.noSignoffsText)}</li>` : m.innerHTML = a.signoffs.slice().reverse().map(
|
|
251
270
|
(i) => `
|
|
252
271
|
<li class="rte-approval-item" role="listitem">
|
|
253
272
|
<div class="rte-approval-item-head">
|
|
254
|
-
<span class="rte-approval-item-author">${
|
|
255
|
-
<time class="rte-approval-item-time" datetime="${
|
|
273
|
+
<span class="rte-approval-item-author">${c(i.author)}</span>
|
|
274
|
+
<time class="rte-approval-item-time" datetime="${c(i.createdAt)}">${c(
|
|
256
275
|
new Date(i.createdAt).toLocaleString()
|
|
257
276
|
)}</time>
|
|
258
277
|
</div>
|
|
259
|
-
<p class="rte-approval-item-message">${
|
|
278
|
+
<p class="rte-approval-item-message">${c(i.comment || "Approved")}</p>
|
|
260
279
|
</li>
|
|
261
280
|
`
|
|
262
281
|
).join(""));
|
|
263
282
|
}
|
|
264
283
|
function G(e, t, o) {
|
|
265
|
-
t.updatedAt = (/* @__PURE__ */ new Date()).toISOString(),
|
|
284
|
+
t.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), pe(e, t, o), q(e), Ae(e, t);
|
|
266
285
|
}
|
|
267
|
-
function ae(e, t, o,
|
|
286
|
+
function ae(e, t, o, a) {
|
|
268
287
|
e.comments.push({
|
|
269
288
|
id: J(),
|
|
270
289
|
author: o || t.defaultActor,
|
|
271
|
-
message:
|
|
290
|
+
message: a,
|
|
272
291
|
kind: "system",
|
|
273
292
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
274
293
|
}), e.comments = j(e.comments, t.maxHistoryEntries);
|
|
275
294
|
}
|
|
276
|
-
function E(e, t, o,
|
|
295
|
+
function E(e, t, o, a) {
|
|
277
296
|
const r = f(e, o);
|
|
278
|
-
if (r.status === t)
|
|
279
|
-
|
|
280
|
-
|
|
297
|
+
if (r.status === t)
|
|
298
|
+
return !1;
|
|
299
|
+
const n = e.innerHTML;
|
|
300
|
+
return r.status = t, t === "review" ? ae(r, o, a, "Review requested.") : t === "draft" && ae(r, o, a, "Returned to draft."), G(e, r, o), Y(e), X(e, n), !0;
|
|
281
301
|
}
|
|
282
|
-
function
|
|
283
|
-
const r =
|
|
284
|
-
if (!r)
|
|
285
|
-
|
|
302
|
+
function ce(e, t, o, a) {
|
|
303
|
+
const r = a.normalizeText(t);
|
|
304
|
+
if (!r)
|
|
305
|
+
return !1;
|
|
306
|
+
const n = a.normalizeText(o) || a.defaultActor, l = f(e, a), s = e.innerHTML;
|
|
286
307
|
return l.comments.push({
|
|
287
308
|
id: J(),
|
|
288
|
-
author:
|
|
309
|
+
author: n,
|
|
289
310
|
message: r,
|
|
290
311
|
kind: "comment",
|
|
291
312
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
292
|
-
}), l.comments = j(l.comments,
|
|
313
|
+
}), l.comments = j(l.comments, a.maxHistoryEntries), G(e, l, a), Y(e), X(e, s), !0;
|
|
293
314
|
}
|
|
294
|
-
function Q(e, t, o,
|
|
295
|
-
const r = t.normalizeText(o) || t.defaultActor,
|
|
296
|
-
if (t.requireCommentOnApprove && !
|
|
297
|
-
|
|
315
|
+
function Q(e, t, o, a) {
|
|
316
|
+
const r = t.normalizeText(o) || t.defaultActor, n = t.normalizeText(a);
|
|
317
|
+
if (t.requireCommentOnApprove && !n)
|
|
318
|
+
return !1;
|
|
319
|
+
const l = f(e, t), s = e.innerHTML;
|
|
298
320
|
return l.status = "approved", l.signoffs.push({
|
|
299
321
|
id: ke(),
|
|
300
322
|
author: r,
|
|
301
|
-
comment:
|
|
323
|
+
comment: n || void 0,
|
|
302
324
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
303
|
-
}), l.signoffs = j(l.signoffs, t.maxHistoryEntries),
|
|
325
|
+
}), l.signoffs = j(l.signoffs, t.maxHistoryEntries), n && (l.comments.push({
|
|
304
326
|
id: J(),
|
|
305
327
|
author: r,
|
|
306
|
-
message:
|
|
328
|
+
message: n,
|
|
307
329
|
kind: "system",
|
|
308
330
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
309
|
-
}), l.comments = j(l.comments, t.maxHistoryEntries)), G(e, l, t), Y(e), X(e,
|
|
331
|
+
}), l.comments = j(l.comments, t.maxHistoryEntries)), G(e, l, t), Y(e), X(e, s), !0;
|
|
310
332
|
}
|
|
311
333
|
function N(e, t) {
|
|
312
334
|
return e.querySelector(`[data-field="${t}"]`);
|
|
313
335
|
}
|
|
314
336
|
function Se(e) {
|
|
315
|
-
|
|
337
|
+
var a, r;
|
|
338
|
+
const t = ((a = N(e, "actor")) == null ? void 0 : a.value) || "", o = ((r = N(e, "comment")) == null ? void 0 : r.value) || "";
|
|
316
339
|
return { actor: t, comment: o };
|
|
317
340
|
}
|
|
318
341
|
function V(e, t) {
|
|
319
|
-
if (!t.classList.contains("show"))
|
|
320
|
-
|
|
321
|
-
|
|
342
|
+
if (!t.classList.contains("show"))
|
|
343
|
+
return;
|
|
344
|
+
const a = U(e).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));
|
|
345
|
+
t.style.width = `${r}px`, t.style.left = `${l}px`, t.style.top = `${s}px`, t.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
|
|
322
346
|
}
|
|
323
347
|
function $e(e) {
|
|
324
348
|
const t = k.get(e);
|
|
325
|
-
if (t)
|
|
326
|
-
|
|
327
|
-
|
|
349
|
+
if (t)
|
|
350
|
+
return t;
|
|
351
|
+
const o = p.get(e) || R || z(), a = `rte-approval-panel-${me++}`, r = document.createElement("section");
|
|
352
|
+
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 = `
|
|
328
353
|
<header class="rte-approval-header">
|
|
329
|
-
<h2 class="rte-approval-title">${
|
|
330
|
-
<button type="button" class="rte-approval-icon-btn" data-action="close" aria-label="${
|
|
354
|
+
<h2 class="rte-approval-title">${c(o.labels.panelTitle)}</h2>
|
|
355
|
+
<button type="button" class="rte-approval-icon-btn" data-action="close" aria-label="${c(
|
|
331
356
|
o.labels.closeText
|
|
332
357
|
)}">✕</button>
|
|
333
358
|
</header>
|
|
@@ -335,55 +360,57 @@ function $e(e) {
|
|
|
335
360
|
<p class="rte-approval-summary" aria-live="polite"></p>
|
|
336
361
|
|
|
337
362
|
<div class="rte-approval-controls" role="toolbar" aria-label="Approval actions">
|
|
338
|
-
<button type="button" class="rte-approval-btn" data-action="request-review">${
|
|
363
|
+
<button type="button" class="rte-approval-btn" data-action="request-review">${c(
|
|
339
364
|
o.labels.requestReviewText
|
|
340
365
|
)}</button>
|
|
341
|
-
<button type="button" class="rte-approval-btn rte-approval-btn-primary" data-action="approve">${
|
|
366
|
+
<button type="button" class="rte-approval-btn rte-approval-btn-primary" data-action="approve">${c(
|
|
342
367
|
o.labels.approveText
|
|
343
368
|
)}</button>
|
|
344
|
-
<button type="button" class="rte-approval-btn" data-action="reopen-draft">${
|
|
369
|
+
<button type="button" class="rte-approval-btn" data-action="reopen-draft">${c(
|
|
345
370
|
o.labels.reopenDraftText
|
|
346
371
|
)}</button>
|
|
347
372
|
</div>
|
|
348
373
|
|
|
349
374
|
<div class="rte-approval-form">
|
|
350
375
|
<label class="rte-approval-label">
|
|
351
|
-
${
|
|
352
|
-
<input type="text" data-field="actor" class="rte-approval-field" autocomplete="off" placeholder="${
|
|
376
|
+
${c(o.labels.actorLabel)}
|
|
377
|
+
<input type="text" data-field="actor" class="rte-approval-field" autocomplete="off" placeholder="${c(
|
|
353
378
|
o.labels.actorPlaceholder
|
|
354
379
|
)}" />
|
|
355
380
|
</label>
|
|
356
381
|
<label class="rte-approval-label">
|
|
357
|
-
${
|
|
358
|
-
<textarea data-field="comment" class="rte-approval-field" rows="2" placeholder="${
|
|
382
|
+
${c(o.labels.commentLabel)}
|
|
383
|
+
<textarea data-field="comment" class="rte-approval-field" rows="2" placeholder="${c(
|
|
359
384
|
o.labels.commentPlaceholder
|
|
360
385
|
)}"></textarea>
|
|
361
386
|
</label>
|
|
362
|
-
<button type="button" class="rte-approval-btn" data-action="add-comment">${
|
|
387
|
+
<button type="button" class="rte-approval-btn" data-action="add-comment">${c(
|
|
363
388
|
o.labels.addCommentText
|
|
364
389
|
)}</button>
|
|
365
390
|
</div>
|
|
366
391
|
|
|
367
|
-
<section class="rte-approval-section" aria-label="${
|
|
368
|
-
<h3 class="rte-approval-section-title">${
|
|
392
|
+
<section class="rte-approval-section" aria-label="${c(o.labels.commentsHeading)}">
|
|
393
|
+
<h3 class="rte-approval-section-title">${c(o.labels.commentsHeading)}</h3>
|
|
369
394
|
<ul class="rte-approval-comments-list" role="list"></ul>
|
|
370
395
|
</section>
|
|
371
396
|
|
|
372
|
-
<section class="rte-approval-section" aria-label="${
|
|
373
|
-
<h3 class="rte-approval-section-title">${
|
|
397
|
+
<section class="rte-approval-section" aria-label="${c(o.labels.signoffsHeading)}">
|
|
398
|
+
<h3 class="rte-approval-section-title">${c(o.labels.signoffsHeading)}</h3>
|
|
374
399
|
<ul class="rte-approval-signoffs-list" role="list"></ul>
|
|
375
400
|
</section>
|
|
376
401
|
|
|
377
|
-
<p class="rte-approval-shortcut">${
|
|
402
|
+
<p class="rte-approval-shortcut">${c(o.labels.shortcutText)}</p>
|
|
378
403
|
<span class="rte-approval-live" aria-live="polite"></span>
|
|
379
404
|
</div>
|
|
380
|
-
`, r.addEventListener("click", (
|
|
381
|
-
const l =
|
|
382
|
-
if (!l)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
405
|
+
`, r.addEventListener("click", (n) => {
|
|
406
|
+
const l = n.target;
|
|
407
|
+
if (!l)
|
|
408
|
+
return;
|
|
409
|
+
const s = l.closest("[data-action]");
|
|
410
|
+
if (!s)
|
|
411
|
+
return;
|
|
412
|
+
const u = s.getAttribute("data-action") || "", m = p.get(e) || R || o;
|
|
413
|
+
if (p.set(e, m), f(e, m), u === "close") {
|
|
387
414
|
P(e, !0);
|
|
388
415
|
return;
|
|
389
416
|
}
|
|
@@ -409,13 +436,14 @@ function $e(e) {
|
|
|
409
436
|
return;
|
|
410
437
|
}
|
|
411
438
|
if (u === "add-comment") {
|
|
412
|
-
if (!
|
|
439
|
+
if (!ce(e, i.comment, i.actor, m))
|
|
440
|
+
return;
|
|
413
441
|
const $ = N(r, "comment");
|
|
414
442
|
$ && ($.value = ""), M(r, "Comment added.");
|
|
415
443
|
return;
|
|
416
444
|
}
|
|
417
|
-
}), r.addEventListener("keydown", (
|
|
418
|
-
|
|
445
|
+
}), r.addEventListener("keydown", (n) => {
|
|
446
|
+
n.key === "Escape" && (n.preventDefault(), P(e, !0));
|
|
419
447
|
}), K(r, e), document.body.appendChild(r), k.set(e, r), O.set(e, !1), q(e), r;
|
|
420
448
|
}
|
|
421
449
|
function Z(e) {
|
|
@@ -424,8 +452,8 @@ function Z(e) {
|
|
|
424
452
|
function A(e) {
|
|
425
453
|
D();
|
|
426
454
|
const t = $e(e);
|
|
427
|
-
k.forEach((o,
|
|
428
|
-
|
|
455
|
+
k.forEach((o, a) => {
|
|
456
|
+
a !== e && P(a, !1);
|
|
429
457
|
}), t.classList.add("show"), O.set(e, !0), C(e, "toggleApprovalWorkflowPanel", !0), K(t, e), V(e, t), q(e);
|
|
430
458
|
}
|
|
431
459
|
function P(e, t = !1) {
|
|
@@ -455,28 +483,31 @@ function Le(e) {
|
|
|
455
483
|
function Re(e) {
|
|
456
484
|
R = e, T || (T = (t) => {
|
|
457
485
|
D();
|
|
458
|
-
const
|
|
459
|
-
if (!
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
486
|
+
const o = t.target, a = o == null ? void 0 : o.closest(w);
|
|
487
|
+
if (!a)
|
|
488
|
+
return;
|
|
489
|
+
g = a;
|
|
490
|
+
const r = p.get(a) || e;
|
|
491
|
+
p.set(a, r), f(a, r);
|
|
492
|
+
const n = k.get(a);
|
|
493
|
+
n && (K(n, a), V(a, n));
|
|
465
494
|
}, document.addEventListener("focusin", T, !0)), L || (L = (t) => {
|
|
466
|
-
if (t.defaultPrevented)
|
|
467
|
-
|
|
468
|
-
|
|
495
|
+
if (t.defaultPrevented)
|
|
496
|
+
return;
|
|
497
|
+
const o = Ee(t), a = Ce(t), r = Te(t), n = Le(t), l = t.key === "Escape";
|
|
498
|
+
if (!l && !o && !a && !r && !n)
|
|
469
499
|
return;
|
|
470
500
|
D();
|
|
471
|
-
const
|
|
472
|
-
if (!xe(
|
|
501
|
+
const s = t.target, u = !!(s != null && s.closest(`.${d} input, .${d} textarea, .${d} select`));
|
|
502
|
+
if (!xe(s) && !we())
|
|
473
503
|
return;
|
|
474
504
|
const i = x(void 0, !1);
|
|
475
|
-
if (!i)
|
|
476
|
-
|
|
477
|
-
|
|
505
|
+
if (!i)
|
|
506
|
+
return;
|
|
507
|
+
const b = p.get(i) || R || e;
|
|
508
|
+
p.set(i, b);
|
|
478
509
|
const $ = f(i, b);
|
|
479
|
-
if (
|
|
510
|
+
if (g = i, l && Z(i)) {
|
|
480
511
|
t.preventDefault(), P(i, !0);
|
|
481
512
|
return;
|
|
482
513
|
}
|
|
@@ -485,7 +516,7 @@ function Re(e) {
|
|
|
485
516
|
t.preventDefault(), t.stopPropagation(), de(i);
|
|
486
517
|
return;
|
|
487
518
|
}
|
|
488
|
-
if (
|
|
519
|
+
if (a) {
|
|
489
520
|
t.preventDefault(), t.stopPropagation(), E(i, "review", b, b.defaultActor) && A(i);
|
|
490
521
|
return;
|
|
491
522
|
}
|
|
@@ -493,7 +524,7 @@ function Re(e) {
|
|
|
493
524
|
t.preventDefault(), t.stopPropagation(), Q(i, b, b.defaultActor, "Approved via keyboard shortcut.") && A(i);
|
|
494
525
|
return;
|
|
495
526
|
}
|
|
496
|
-
|
|
527
|
+
n && (t.preventDefault(), t.stopPropagation(), $.status !== "draft" && E(i, "draft", b, b.defaultActor) && A(i));
|
|
497
528
|
}
|
|
498
529
|
}, document.addEventListener("keydown", L, !0)), S || (S = () => {
|
|
499
530
|
D(), k.forEach((t, o) => {
|
|
@@ -510,10 +541,11 @@ function Me(e) {
|
|
|
510
541
|
));
|
|
511
542
|
}
|
|
512
543
|
function De() {
|
|
513
|
-
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), k.forEach((e) => e.remove()), k.clear(), H.forEach((e) => Me(e)), H.clear(), R = null,
|
|
544
|
+
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), k.forEach((e) => e.remove()), k.clear(), H.forEach((e) => Me(e)), H.clear(), R = null, g = null;
|
|
514
545
|
}
|
|
515
546
|
function He() {
|
|
516
|
-
if (typeof document > "u" || document.getElementById(te))
|
|
547
|
+
if (typeof document > "u" || document.getElementById(te))
|
|
548
|
+
return;
|
|
517
549
|
const e = document.createElement("style");
|
|
518
550
|
e.id = te, e.textContent = `
|
|
519
551
|
.rte-toolbar-group-items.${h},
|
|
@@ -542,10 +574,10 @@ function He() {
|
|
|
542
574
|
background-color: #ccc;
|
|
543
575
|
}
|
|
544
576
|
|
|
545
|
-
${
|
|
546
|
-
${
|
|
547
|
-
${
|
|
548
|
-
${
|
|
577
|
+
${v} .rte-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
|
|
578
|
+
${v} .editora-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
|
|
579
|
+
${v} .rte-toolbar-button[data-command="reopenDraft"].active,
|
|
580
|
+
${v} .editora-toolbar-button[data-command="reopenDraft"].active {
|
|
549
581
|
background: linear-gradient(180deg, #5eaaf6 0%, #4a95de 100%);
|
|
550
582
|
}
|
|
551
583
|
|
|
@@ -556,23 +588,23 @@ function He() {
|
|
|
556
588
|
border-right: none;
|
|
557
589
|
}
|
|
558
590
|
|
|
559
|
-
${
|
|
560
|
-
${
|
|
561
|
-
${
|
|
562
|
-
${
|
|
591
|
+
${v} .rte-toolbar-group-items.${h},
|
|
592
|
+
${v} .editora-toolbar-group-items.${h},
|
|
593
|
+
${v} .rte-toolbar-group-items.${y},
|
|
594
|
+
${v} .editora-toolbar-group-items.${y},
|
|
563
595
|
.${d}.rte-approval-theme-dark {
|
|
564
596
|
border-color: #566275;
|
|
565
597
|
}
|
|
566
|
-
${
|
|
567
|
-
${
|
|
568
|
-
${
|
|
569
|
-
${
|
|
598
|
+
${v} .rte-toolbar-group-items.${h} .rte-toolbar-button svg,
|
|
599
|
+
${v} .editora-toolbar-group-items.${h} .editora-toolbar-button svg,
|
|
600
|
+
${v} .rte-toolbar-group-items.${y} .rte-toolbar-button svg,
|
|
601
|
+
${v} .editora-toolbar-group-items.${y} .editora-toolbar-button svg
|
|
570
602
|
{
|
|
571
603
|
fill: none;
|
|
572
604
|
}
|
|
573
605
|
|
|
574
|
-
${
|
|
575
|
-
${
|
|
606
|
+
${v} .rte-toolbar-group-items.${h} .rte-toolbar-button,
|
|
607
|
+
${v} .editora-toolbar-group-items.${h} .editora-toolbar-button
|
|
576
608
|
{
|
|
577
609
|
border-color: #566275;
|
|
578
610
|
}
|
|
@@ -951,90 +983,99 @@ const qe = (e = {}) => {
|
|
|
951
983
|
}
|
|
952
984
|
],
|
|
953
985
|
commands: {
|
|
954
|
-
approvalWorkflow: (o,
|
|
955
|
-
const r = x(
|
|
956
|
-
if (!r)
|
|
957
|
-
|
|
958
|
-
|
|
986
|
+
approvalWorkflow: (o, a) => {
|
|
987
|
+
const r = x(a);
|
|
988
|
+
if (!r)
|
|
989
|
+
return !1;
|
|
990
|
+
const n = p.get(r) || t;
|
|
991
|
+
return p.set(r, n), f(r, n), g = r, A(r), q(r), !0;
|
|
959
992
|
},
|
|
960
|
-
toggleApprovalWorkflowPanel: (o,
|
|
961
|
-
const r = x(
|
|
962
|
-
if (!r)
|
|
963
|
-
|
|
964
|
-
|
|
993
|
+
toggleApprovalWorkflowPanel: (o, a) => {
|
|
994
|
+
const r = x(a);
|
|
995
|
+
if (!r)
|
|
996
|
+
return !1;
|
|
997
|
+
const n = p.get(r) || t;
|
|
998
|
+
return p.set(r, n), f(r, n), g = r, de(r, typeof o == "boolean" ? o : void 0);
|
|
965
999
|
},
|
|
966
|
-
requestApprovalReview: (o,
|
|
967
|
-
const r = x(
|
|
968
|
-
if (!r)
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1000
|
+
requestApprovalReview: (o, a) => {
|
|
1001
|
+
const r = x(a);
|
|
1002
|
+
if (!r)
|
|
1003
|
+
return !1;
|
|
1004
|
+
const n = p.get(r) || t;
|
|
1005
|
+
p.set(r, n), f(r, n);
|
|
1006
|
+
const l = E(r, "review", n, n.defaultActor);
|
|
972
1007
|
return A(r), l;
|
|
973
1008
|
},
|
|
974
|
-
approveDocument: (o,
|
|
975
|
-
const r = x(
|
|
976
|
-
if (!r)
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1009
|
+
approveDocument: (o, a) => {
|
|
1010
|
+
const r = x(a);
|
|
1011
|
+
if (!r)
|
|
1012
|
+
return !1;
|
|
1013
|
+
const n = p.get(r) || t;
|
|
1014
|
+
p.set(r, n), f(r, n);
|
|
1015
|
+
const l = typeof o == "object" && o ? String(o.author || "") : n.defaultActor, s = typeof o == "object" && o ? String(o.comment || "") : typeof o == "string" ? o : "", u = Q(r, n, l, s);
|
|
980
1016
|
return u && A(r), u;
|
|
981
1017
|
},
|
|
982
|
-
reopenDraft: (o,
|
|
983
|
-
const r = x(
|
|
984
|
-
if (!r)
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1018
|
+
reopenDraft: (o, a) => {
|
|
1019
|
+
const r = x(a);
|
|
1020
|
+
if (!r)
|
|
1021
|
+
return !1;
|
|
1022
|
+
const n = p.get(r) || t;
|
|
1023
|
+
p.set(r, n), f(r, n);
|
|
1024
|
+
const l = E(r, "draft", n, n.defaultActor);
|
|
988
1025
|
return l && A(r), l;
|
|
989
1026
|
},
|
|
990
|
-
addApprovalComment: (o,
|
|
991
|
-
const r = x(
|
|
992
|
-
if (!r)
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1027
|
+
addApprovalComment: (o, a) => {
|
|
1028
|
+
const r = x(a);
|
|
1029
|
+
if (!r)
|
|
1030
|
+
return !1;
|
|
1031
|
+
const n = p.get(r) || t;
|
|
1032
|
+
p.set(r, n), f(r, n);
|
|
1033
|
+
const l = typeof o == "object" && o ? String(o.author || "") : n.defaultActor, s = typeof o == "object" && o ? String(o.message || "") : typeof o == "string" ? o : "", u = ce(r, s, l, n);
|
|
996
1034
|
return u && A(r), u;
|
|
997
1035
|
},
|
|
998
|
-
setApprovalStatus: (o,
|
|
999
|
-
const r = x(
|
|
1000
|
-
if (!r || !o)
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1036
|
+
setApprovalStatus: (o, a) => {
|
|
1037
|
+
const r = x(a);
|
|
1038
|
+
if (!r || !o)
|
|
1039
|
+
return !1;
|
|
1040
|
+
const n = ne(o), l = p.get(r) || t;
|
|
1041
|
+
p.set(r, l), f(r, l);
|
|
1042
|
+
const s = E(r, n, l, l.defaultActor);
|
|
1043
|
+
return s && A(r), s;
|
|
1005
1044
|
},
|
|
1006
|
-
setApprovalWorkflowOptions: (o,
|
|
1007
|
-
const r = x(
|
|
1008
|
-
if (!r || !o || typeof o != "object")
|
|
1009
|
-
|
|
1010
|
-
|
|
1045
|
+
setApprovalWorkflowOptions: (o, a) => {
|
|
1046
|
+
const r = x(a);
|
|
1047
|
+
if (!r || !o || typeof o != "object")
|
|
1048
|
+
return !1;
|
|
1049
|
+
const n = p.get(r) || t, l = z({
|
|
1050
|
+
...n,
|
|
1011
1051
|
...o,
|
|
1012
1052
|
labels: {
|
|
1013
|
-
...
|
|
1053
|
+
...n.labels,
|
|
1014
1054
|
...o.labels || {}
|
|
1015
1055
|
},
|
|
1016
|
-
normalizeText: o.normalizeText ||
|
|
1056
|
+
normalizeText: o.normalizeText || n.normalizeText
|
|
1017
1057
|
});
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
return G(r,
|
|
1058
|
+
p.set(r, l);
|
|
1059
|
+
const s = f(r, l);
|
|
1060
|
+
return G(r, s, l), !0;
|
|
1021
1061
|
},
|
|
1022
|
-
getApprovalWorkflowState: (o,
|
|
1023
|
-
const r = x(
|
|
1024
|
-
if (!r)
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1062
|
+
getApprovalWorkflowState: (o, a) => {
|
|
1063
|
+
const r = x(a);
|
|
1064
|
+
if (!r)
|
|
1065
|
+
return !1;
|
|
1066
|
+
const n = p.get(r) || t;
|
|
1067
|
+
p.set(r, n);
|
|
1068
|
+
const l = f(r, n), s = se(l);
|
|
1028
1069
|
if (typeof o == "function")
|
|
1029
1070
|
try {
|
|
1030
|
-
o(
|
|
1071
|
+
o(s);
|
|
1031
1072
|
} catch {
|
|
1032
1073
|
}
|
|
1033
|
-
return r.__approvalWorkflowState =
|
|
1074
|
+
return r.__approvalWorkflowState = s, r.dispatchEvent(
|
|
1034
1075
|
new CustomEvent("editora:approval-state", {
|
|
1035
1076
|
bubbles: !0,
|
|
1036
1077
|
detail: {
|
|
1037
|
-
state:
|
|
1078
|
+
state: s
|
|
1038
1079
|
}
|
|
1039
1080
|
})
|
|
1040
1081
|
), !0;
|
|
@@ -1050,15 +1091,15 @@ const qe = (e = {}) => {
|
|
|
1050
1091
|
"Mod-Alt-Shift-d": "reopenDraft",
|
|
1051
1092
|
"Mod-Alt-Shift-D": "reopenDraft"
|
|
1052
1093
|
},
|
|
1053
|
-
init: function(
|
|
1094
|
+
init: function(a) {
|
|
1054
1095
|
_ += 1;
|
|
1055
1096
|
const r = this && typeof this.__pluginConfig == "object" ? z({ ...t, ...this.__pluginConfig }) : t;
|
|
1056
1097
|
Re(r);
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1098
|
+
const n = x(
|
|
1099
|
+
a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
|
|
1059
1100
|
!1
|
|
1060
1101
|
);
|
|
1061
|
-
|
|
1102
|
+
n && (p.set(n, r), f(n, r), g = n, q(n));
|
|
1062
1103
|
},
|
|
1063
1104
|
destroy: () => {
|
|
1064
1105
|
_ = Math.max(0, _ - 1), !(_ > 0) && De();
|