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