@editora/core 1.0.23 → 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/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
package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { a as f } from "./dialogHelpers-Dzn8DHoF.mjs";
|
|
2
|
+
function q(e, t) {
|
|
3
|
+
const r = Array.from({ length: t }).map(() => "<th><p><br></p></th>").join(""), n = Array.from({ length: e }).map(
|
|
3
4
|
() => `<tr>${Array.from({ length: t }).map(() => "<td><p><br></p></td>").join("")}</tr>`
|
|
4
5
|
).join("");
|
|
5
|
-
return `<table class="rte-table"><thead><tr>${
|
|
6
|
+
return `<table class="rte-table"><thead><tr>${r}</tr></thead><tbody>${n}</tbody></table><p><br></p>`;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
+
function $() {
|
|
8
9
|
return [
|
|
9
10
|
{
|
|
10
11
|
id: "paragraph",
|
|
@@ -59,7 +60,7 @@ function q() {
|
|
|
59
60
|
id: "table-3x3",
|
|
60
61
|
label: "Table 3x3",
|
|
61
62
|
description: "Insert a 3 x 3 table",
|
|
62
|
-
action: ({ insertHTML: e }) => e(
|
|
63
|
+
action: ({ insertHTML: e }) => e(q(3, 3)),
|
|
63
64
|
keywords: ["table", "grid", "rows", "columns"]
|
|
64
65
|
},
|
|
65
66
|
{
|
|
@@ -106,40 +107,40 @@ function q() {
|
|
|
106
107
|
}
|
|
107
108
|
];
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
-
const t = [],
|
|
110
|
+
function D(e) {
|
|
111
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
111
112
|
return e.forEach((n) => {
|
|
112
|
-
const
|
|
113
|
-
!
|
|
113
|
+
const o = String(n.id || "").trim(), i = String(n.label || "").trim();
|
|
114
|
+
!o || !i || r.has(o) || (r.add(o), t.push({
|
|
114
115
|
...n,
|
|
115
|
-
id:
|
|
116
|
+
id: o,
|
|
116
117
|
label: i,
|
|
117
118
|
description: n.description ? String(n.description) : void 0,
|
|
118
119
|
keywords: Array.isArray(n.keywords) ? n.keywords.map((a) => String(a)).filter(Boolean) : void 0
|
|
119
120
|
}));
|
|
120
121
|
}), t;
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
-
var
|
|
124
|
-
const t = (e.triggerChar || "/")[0] || "/",
|
|
123
|
+
function B(e) {
|
|
124
|
+
var o, i, a;
|
|
125
|
+
const t = (e.triggerChar || "/")[0] || "/", r = e.includeDefaultItems !== !1, n = r ? [...e.items || [], ...$()] : e.items || [];
|
|
125
126
|
return {
|
|
126
127
|
triggerChar: t,
|
|
127
|
-
minChars: Math.max(0, (
|
|
128
|
+
minChars: Math.max(0, (o = e.minChars) != null ? o : 0),
|
|
128
129
|
maxQueryLength: Math.max(1, (i = e.maxQueryLength) != null ? i : 48),
|
|
129
130
|
maxSuggestions: Math.max(1, (a = e.maxSuggestions) != null ? a : 10),
|
|
130
131
|
requireBoundary: e.requireBoundary !== !1,
|
|
131
|
-
includeDefaultItems:
|
|
132
|
-
items:
|
|
132
|
+
includeDefaultItems: r,
|
|
133
|
+
items: D(n),
|
|
133
134
|
itemRenderer: e.itemRenderer || ((l) => l.label),
|
|
134
135
|
emptyStateText: e.emptyStateText || "No commands found",
|
|
135
136
|
panelLabel: e.panelLabel || "Slash commands"
|
|
136
137
|
};
|
|
137
138
|
}
|
|
138
139
|
const u = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark';
|
|
139
|
-
let
|
|
140
|
-
function
|
|
141
|
-
if (
|
|
142
|
-
|
|
140
|
+
let k = !1;
|
|
141
|
+
function z() {
|
|
142
|
+
if (k || typeof document == "undefined") return;
|
|
143
|
+
k = !0;
|
|
143
144
|
const e = document.createElement("style");
|
|
144
145
|
e.id = "rte-slash-commands-styles", e.textContent = `
|
|
145
146
|
.rte-slash-panel {
|
|
@@ -235,68 +236,85 @@ function B() {
|
|
|
235
236
|
}
|
|
236
237
|
`, document.head.appendChild(e);
|
|
237
238
|
}
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
const _ = /^(P|DIV|H[1-6]|LI|BLOCKQUOTE|PRE|TD|TH)$/, P = 'br, img, video, audio, iframe, hr, table, svg, canvas, object, embed, [contenteditable="false"]';
|
|
240
|
+
function F(e, t) {
|
|
241
|
+
var o;
|
|
242
|
+
let r = t.startContainer;
|
|
243
|
+
r.nodeType !== Node.ELEMENT_NODE && (r = r.parentNode);
|
|
244
|
+
let n = null;
|
|
245
|
+
for (; r && r !== e; ) {
|
|
246
|
+
if (r instanceof HTMLElement && _.test(r.tagName)) {
|
|
247
|
+
n = r;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
r = r.parentNode;
|
|
251
|
+
}
|
|
252
|
+
return !n || !e.contains(n) || ((o = n.textContent) != null ? o : "") !== "" || n.querySelector(P) ? null : (Array.from(n.childNodes).forEach((i) => {
|
|
253
|
+
i.nodeType === Node.TEXT_NODE && i.data === "" && n.removeChild(i);
|
|
254
|
+
}), n.appendChild(document.createElement("br")), t.setStart(n, 0), t.collapse(!0), n);
|
|
255
|
+
}
|
|
256
|
+
const d = ".rte-content, .editora-content", j = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark', h = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap();
|
|
257
|
+
let y = !1, g = null, p = 0, K = 0;
|
|
258
|
+
function Q(e) {
|
|
241
259
|
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
242
260
|
}
|
|
243
|
-
function
|
|
261
|
+
function A(e) {
|
|
244
262
|
return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
|
|
245
263
|
}
|
|
246
|
-
function
|
|
264
|
+
function U(e) {
|
|
247
265
|
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
|
|
248
266
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
249
267
|
const n = e.editorElement;
|
|
250
|
-
if (n.matches(
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
268
|
+
if (n.matches(d)) return n;
|
|
269
|
+
const o = n.querySelector(d);
|
|
270
|
+
if (o instanceof HTMLElement) return o;
|
|
253
271
|
}
|
|
254
272
|
const t = window.getSelection();
|
|
255
273
|
if (t && t.rangeCount > 0) {
|
|
256
|
-
const n = t.getRangeAt(0).startContainer,
|
|
274
|
+
const n = t.getRangeAt(0).startContainer, o = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = o == null ? void 0 : o.closest(d);
|
|
257
275
|
if (i) return i;
|
|
258
276
|
}
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
if (
|
|
262
|
-
const n =
|
|
277
|
+
const r = document.activeElement;
|
|
278
|
+
if (r) {
|
|
279
|
+
if (r.matches(d)) return r;
|
|
280
|
+
const n = r.closest(d);
|
|
263
281
|
if (n) return n;
|
|
264
282
|
}
|
|
265
|
-
return document.querySelector(
|
|
283
|
+
return document.querySelector(d);
|
|
266
284
|
}
|
|
267
285
|
function m(e) {
|
|
268
286
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
269
287
|
}
|
|
270
|
-
function
|
|
288
|
+
function W(e) {
|
|
271
289
|
return e ? /\s|[([{"'`]/.test(e) : !0;
|
|
272
290
|
}
|
|
273
|
-
function
|
|
291
|
+
function v(e) {
|
|
274
292
|
const t = window.getSelection();
|
|
275
293
|
if (!t || t.rangeCount === 0) return null;
|
|
276
|
-
const
|
|
277
|
-
return e.contains(
|
|
294
|
+
const r = t.getRangeAt(0);
|
|
295
|
+
return e.contains(r.commonAncestorContainer) ? r.cloneRange() : null;
|
|
278
296
|
}
|
|
279
|
-
function
|
|
280
|
-
const
|
|
281
|
-
|
|
297
|
+
function E(e, t) {
|
|
298
|
+
const r = window.getSelection();
|
|
299
|
+
r && (r.removeAllRanges(), r.addRange(t), e.focus({ preventScroll: !0 }));
|
|
282
300
|
}
|
|
283
|
-
function
|
|
301
|
+
function G(e) {
|
|
284
302
|
if (!e.collapsed) return null;
|
|
285
|
-
const t = e.startContainer,
|
|
303
|
+
const t = e.startContainer, r = e.startOffset;
|
|
286
304
|
if (t.nodeType === Node.TEXT_NODE) {
|
|
287
305
|
const n = t;
|
|
288
306
|
return {
|
|
289
307
|
node: n,
|
|
290
|
-
textBefore: n.data.slice(0,
|
|
291
|
-
caretOffset:
|
|
308
|
+
textBefore: n.data.slice(0, r),
|
|
309
|
+
caretOffset: r
|
|
292
310
|
};
|
|
293
311
|
}
|
|
294
312
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
295
313
|
const n = t;
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
299
|
-
const i =
|
|
314
|
+
if (r > 0) {
|
|
315
|
+
const o = n.childNodes[r - 1];
|
|
316
|
+
if (o && o.nodeType === Node.TEXT_NODE) {
|
|
317
|
+
const i = o;
|
|
300
318
|
return {
|
|
301
319
|
node: i,
|
|
302
320
|
textBefore: i.data,
|
|
@@ -307,64 +325,64 @@ function K(e) {
|
|
|
307
325
|
}
|
|
308
326
|
return null;
|
|
309
327
|
}
|
|
310
|
-
function
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
328
|
+
function V(e, t, r, n) {
|
|
329
|
+
const o = e.lastIndexOf(t);
|
|
330
|
+
if (o < 0 || n && !W(e[o - 1]))
|
|
313
331
|
return null;
|
|
314
|
-
const i = e.slice(
|
|
315
|
-
return /\s/.test(i) || i.length >
|
|
332
|
+
const i = e.slice(o + 1);
|
|
333
|
+
return /\s/.test(i) || i.length > r ? null : {
|
|
316
334
|
trigger: t,
|
|
317
335
|
query: i,
|
|
318
|
-
startOffset:
|
|
336
|
+
startOffset: o
|
|
319
337
|
};
|
|
320
338
|
}
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
const n =
|
|
339
|
+
function X(e, t) {
|
|
340
|
+
const r = t.cloneRange();
|
|
341
|
+
r.collapse(!1);
|
|
342
|
+
const n = r.getClientRects();
|
|
325
343
|
if (n.length > 0)
|
|
326
344
|
return n[n.length - 1];
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
const i =
|
|
330
|
-
return
|
|
345
|
+
const o = document.createElement("span");
|
|
346
|
+
o.textContent = "", r.insertNode(o);
|
|
347
|
+
const i = o.getBoundingClientRect();
|
|
348
|
+
return o.remove(), e.normalize(), i;
|
|
331
349
|
}
|
|
332
|
-
function
|
|
350
|
+
function N(e, t) {
|
|
333
351
|
if (!e.panel) return;
|
|
334
|
-
const
|
|
335
|
-
n.classList.toggle("rte-slash-theme-dark", !!e.editor.closest(
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
|
|
352
|
+
const r = X(e.editor, t), n = e.panel;
|
|
353
|
+
n.classList.toggle("rte-slash-theme-dark", !!e.editor.closest(j)), n.style.display = "block", n.classList.add("show"), n.style.left = "0px", n.style.top = "0px";
|
|
354
|
+
const o = n.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight, l = Math.max(8, Math.min(r.left, i - o.width - 8));
|
|
355
|
+
let c = r.bottom + 8;
|
|
356
|
+
c + o.height > a - 8 && (c = Math.max(8, r.top - o.height - 8)), n.style.position = "fixed", n.style.left = `${l}px`, n.style.top = `${c}px`;
|
|
339
357
|
}
|
|
340
|
-
function
|
|
358
|
+
function L(e, t) {
|
|
341
359
|
if (!t) return m(e);
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
344
|
-
const i = m(e.slice(0,
|
|
360
|
+
const r = e.toLowerCase(), n = t.toLowerCase(), o = r.indexOf(n);
|
|
361
|
+
if (o < 0) return m(e);
|
|
362
|
+
const i = m(e.slice(0, o)), a = m(e.slice(o, o + t.length)), l = m(e.slice(o + t.length));
|
|
345
363
|
return `${i}<mark>${a}</mark>${l}`;
|
|
346
364
|
}
|
|
347
|
-
function
|
|
365
|
+
function Z(e, t) {
|
|
348
366
|
if (e.panel && e.list) return;
|
|
349
|
-
const
|
|
350
|
-
|
|
367
|
+
const r = document.createElement("div");
|
|
368
|
+
r.className = "rte-slash-panel", r.style.display = "none", r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false");
|
|
351
369
|
const n = document.createElement("div");
|
|
352
|
-
n.className = "rte-slash-list", n.setAttribute("role", "listbox"), n.setAttribute("aria-label", t.panelLabel),
|
|
353
|
-
|
|
354
|
-
}),
|
|
355
|
-
const i =
|
|
370
|
+
n.className = "rte-slash-list", n.setAttribute("role", "listbox"), n.setAttribute("aria-label", t.panelLabel), r.appendChild(n), document.body.appendChild(r), e.panel = r, e.list = n, r.addEventListener("mousedown", (o) => {
|
|
371
|
+
o.preventDefault();
|
|
372
|
+
}), r.addEventListener("click", (o) => {
|
|
373
|
+
const i = o.target;
|
|
356
374
|
if (!i) return;
|
|
357
375
|
const a = i.closest(".rte-slash-item");
|
|
358
376
|
if (!a) return;
|
|
359
377
|
const l = Number(a.getAttribute("data-index"));
|
|
360
|
-
Number.isFinite(l) &&
|
|
378
|
+
Number.isFinite(l) && O(e, l);
|
|
361
379
|
});
|
|
362
380
|
}
|
|
363
381
|
function s(e) {
|
|
364
|
-
e.panel && (e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.filteredItems = [], e.activeIndex = 0, e.query = "", e.replaceRange = null, e.anchorRange = null);
|
|
382
|
+
e.panel && (e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.filteredItems = [], e.activeIndex = 0, e.query = "", e.replaceRange = null, e.anchorRange = null, f(e.editor, null, null));
|
|
365
383
|
}
|
|
366
|
-
function
|
|
367
|
-
if (!t) return e.slice(0,
|
|
384
|
+
function J(e, t, r) {
|
|
385
|
+
if (!t) return e.slice(0, r);
|
|
368
386
|
const n = t.toLowerCase();
|
|
369
387
|
return e.filter((i) => [
|
|
370
388
|
i.id,
|
|
@@ -372,75 +390,79 @@ function Z(e, t, o) {
|
|
|
372
390
|
i.description || "",
|
|
373
391
|
i.command || "",
|
|
374
392
|
...i.keywords || []
|
|
375
|
-
].join(" ").toLowerCase().includes(n)).slice(0,
|
|
393
|
+
].join(" ").toLowerCase().includes(n)).slice(0, r);
|
|
376
394
|
}
|
|
377
|
-
function
|
|
395
|
+
function Y(e, t) {
|
|
378
396
|
if (!e.list) return;
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
397
|
+
const r = e.list;
|
|
398
|
+
if (r.innerHTML = "", e.filteredItems.length === 0) {
|
|
381
399
|
const n = document.createElement("div");
|
|
382
|
-
n.className = "rte-slash-empty", n.textContent = t.emptyStateText,
|
|
400
|
+
n.className = "rte-slash-empty", n.textContent = t.emptyStateText, r.appendChild(n), r.removeAttribute("aria-activedescendant"), f(e.editor, null, null);
|
|
383
401
|
return;
|
|
384
402
|
}
|
|
385
|
-
e.filteredItems.forEach((n,
|
|
403
|
+
if (e.filteredItems.forEach((n, o) => {
|
|
386
404
|
const i = document.createElement("button");
|
|
387
|
-
i.type = "button", i.className = "rte-slash-item", i.setAttribute("role", "option"), i.setAttribute("data-index", String(
|
|
388
|
-
<span class="rte-slash-item-title">${
|
|
389
|
-
${n.description ? `<span class="rte-slash-item-description">${
|
|
390
|
-
`,
|
|
391
|
-
}), e.filteredItems.length > 0
|
|
392
|
-
}
|
|
393
|
-
|
|
405
|
+
i.type = "button", i.className = "rte-slash-item", i.setAttribute("role", "option"), i.setAttribute("data-index", String(o)), i.setAttribute("id", `rte-slash-item-${e.instanceId}-${o}`), i.setAttribute("aria-selected", o === e.activeIndex ? "true" : "false"), i.setAttribute("aria-label", n.description ? `${n.label} - ${n.description}` : n.label), o === e.activeIndex && i.classList.add("active"), t.itemRenderer ? i.innerHTML = t.itemRenderer(n, e.query) : i.innerHTML = `
|
|
406
|
+
<span class="rte-slash-item-title">${L(n.label, e.query)}</span>
|
|
407
|
+
${n.description ? `<span class="rte-slash-item-description">${L(n.description, e.query)}</span>` : ""}
|
|
408
|
+
`, r.appendChild(i);
|
|
409
|
+
}), e.filteredItems.length > 0) {
|
|
410
|
+
const n = `rte-slash-item-${e.instanceId}-${e.activeIndex}`;
|
|
411
|
+
r.setAttribute("aria-activedescendant", n), f(e.editor, r, r.querySelector(`[id="${n}"]`));
|
|
412
|
+
} else
|
|
413
|
+
f(e.editor, null, null);
|
|
414
|
+
}
|
|
415
|
+
function ee(e, t) {
|
|
394
416
|
if (t === e.innerHTML) return;
|
|
395
|
-
const
|
|
396
|
-
if (typeof
|
|
417
|
+
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
418
|
+
if (typeof r == "function")
|
|
397
419
|
try {
|
|
398
|
-
|
|
420
|
+
r("recordDomTransaction", e, t, e.innerHTML);
|
|
399
421
|
} catch (n) {
|
|
400
422
|
}
|
|
401
423
|
}
|
|
402
|
-
function
|
|
424
|
+
function te(e) {
|
|
403
425
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
404
426
|
}
|
|
405
|
-
function
|
|
427
|
+
function T(e, t) {
|
|
406
428
|
e.focus({ preventScroll: !0 });
|
|
407
429
|
try {
|
|
408
430
|
if (document.execCommand("insertHTML", !1, t))
|
|
409
431
|
return !0;
|
|
410
432
|
} catch (l) {
|
|
411
433
|
}
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
414
|
-
const n =
|
|
434
|
+
const r = window.getSelection();
|
|
435
|
+
if (!r || r.rangeCount === 0) return !1;
|
|
436
|
+
const n = r.getRangeAt(0);
|
|
415
437
|
if (!e.contains(n.commonAncestorContainer)) return !1;
|
|
416
438
|
n.deleteContents();
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
const i =
|
|
439
|
+
const o = document.createElement("template");
|
|
440
|
+
o.innerHTML = t;
|
|
441
|
+
const i = o.content, a = i.lastChild;
|
|
420
442
|
if (n.insertNode(i), a) {
|
|
421
443
|
const l = document.createRange();
|
|
422
|
-
l.setStartAfter(a), l.collapse(!0),
|
|
444
|
+
l.setStartAfter(a), l.collapse(!0), E(e, l);
|
|
423
445
|
}
|
|
424
446
|
return !0;
|
|
425
447
|
}
|
|
426
|
-
function
|
|
448
|
+
function ne(e, t) {
|
|
427
449
|
e.focus({ preventScroll: !0 });
|
|
428
450
|
try {
|
|
429
451
|
if (document.execCommand("insertText", !1, t))
|
|
430
452
|
return !0;
|
|
431
453
|
} catch (a) {
|
|
432
454
|
}
|
|
433
|
-
const
|
|
434
|
-
if (!
|
|
435
|
-
const n =
|
|
455
|
+
const r = window.getSelection();
|
|
456
|
+
if (!r || r.rangeCount === 0) return !1;
|
|
457
|
+
const n = r.getRangeAt(0);
|
|
436
458
|
if (!e.contains(n.commonAncestorContainer)) return !1;
|
|
437
459
|
n.deleteContents();
|
|
438
|
-
const
|
|
439
|
-
n.insertNode(
|
|
460
|
+
const o = document.createTextNode(t);
|
|
461
|
+
n.insertNode(o);
|
|
440
462
|
const i = document.createRange();
|
|
441
|
-
return i.setStart(
|
|
463
|
+
return i.setStart(o, o.length), i.collapse(!0), E(e, i), !0;
|
|
442
464
|
}
|
|
443
|
-
function
|
|
465
|
+
function re(e, t) {
|
|
444
466
|
switch (e.toLowerCase()) {
|
|
445
467
|
case "paragraph":
|
|
446
468
|
case "p":
|
|
@@ -492,94 +514,96 @@ function Y(e, t) {
|
|
|
492
514
|
}
|
|
493
515
|
}
|
|
494
516
|
}
|
|
495
|
-
function S(e, t,
|
|
496
|
-
const n =
|
|
517
|
+
function S(e, t, r) {
|
|
518
|
+
const n = A(e);
|
|
497
519
|
if (n && typeof n.execCommand == "function")
|
|
498
520
|
try {
|
|
499
|
-
if (n.execCommand(t,
|
|
500
|
-
} catch (
|
|
521
|
+
if (n.execCommand(t, r) !== !1) return !0;
|
|
522
|
+
} catch (a) {
|
|
501
523
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
524
|
+
const o = [window.executeEditorCommand, window.execEditorCommand].filter(
|
|
525
|
+
(a, l, c) => typeof a == "function" && c.indexOf(a) === l
|
|
526
|
+
), i = {
|
|
527
|
+
editorElement: n,
|
|
528
|
+
contentElement: e
|
|
529
|
+
};
|
|
530
|
+
for (const a of o)
|
|
504
531
|
try {
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
contentElement: e
|
|
508
|
-
}) !== !1) return !0;
|
|
509
|
-
} catch (i) {
|
|
532
|
+
if (a(t, r, i) !== !1) return !0;
|
|
533
|
+
} catch (l) {
|
|
510
534
|
}
|
|
511
|
-
return
|
|
535
|
+
return re(t, r);
|
|
512
536
|
}
|
|
513
|
-
async function
|
|
514
|
-
const
|
|
515
|
-
editor:
|
|
537
|
+
async function oe(e, t) {
|
|
538
|
+
const r = e.editor, n = A(r), o = {
|
|
539
|
+
editor: r,
|
|
516
540
|
editorRoot: n,
|
|
517
541
|
query: e.query,
|
|
518
542
|
trigger: e.trigger,
|
|
519
|
-
executeCommand: (i, a) => S(
|
|
520
|
-
insertHTML: (i) =>
|
|
543
|
+
executeCommand: (i, a) => S(r, i, a),
|
|
544
|
+
insertHTML: (i) => T(r, i)
|
|
521
545
|
};
|
|
522
|
-
return t.action ? await Promise.resolve(t.action(
|
|
546
|
+
return t.action ? await Promise.resolve(t.action(o)) !== !1 : t.insertHTML ? T(r, t.insertHTML) : t.command ? S(r, t.command, t.commandValue) : !1;
|
|
523
547
|
}
|
|
524
|
-
async function
|
|
548
|
+
async function O(e, t) {
|
|
525
549
|
if (t < 0 || t >= e.filteredItems.length || !e.replaceRange) return;
|
|
526
|
-
const
|
|
550
|
+
const r = e.filteredItems[t], n = e.editor, o = n.innerHTML, i = `${e.trigger}${e.query}`;
|
|
527
551
|
if (!window.getSelection()) return;
|
|
528
552
|
const l = e.replaceRange.cloneRange();
|
|
529
553
|
if (!n.contains(l.commonAncestorContainer)) return;
|
|
530
554
|
l.deleteContents();
|
|
531
|
-
const
|
|
532
|
-
|
|
555
|
+
const c = l.cloneRange();
|
|
556
|
+
c.collapse(!0), F(n, c), E(n, c);
|
|
533
557
|
let x = !1;
|
|
534
558
|
try {
|
|
535
|
-
x = await
|
|
536
|
-
} catch (
|
|
559
|
+
x = await oe(e, r);
|
|
560
|
+
} catch (me) {
|
|
537
561
|
x = !1;
|
|
538
562
|
}
|
|
539
|
-
s(e), x ? (
|
|
563
|
+
s(e), x ? (te(n), ee(n, o)) : i && ne(n, i), n.focus({ preventScroll: !0 });
|
|
540
564
|
}
|
|
541
565
|
function R(e, t) {
|
|
542
566
|
if (e.filteredItems.length === 0) return;
|
|
543
|
-
const
|
|
544
|
-
if (e.activeIndex = ((e.activeIndex + t) %
|
|
567
|
+
const r = e.filteredItems.length;
|
|
568
|
+
if (e.activeIndex = ((e.activeIndex + t) % r + r) % r, !e.list) return;
|
|
545
569
|
const n = Array.from(e.list.querySelectorAll(".rte-slash-item"));
|
|
546
570
|
n.forEach((i, a) => {
|
|
547
571
|
const l = a === e.activeIndex;
|
|
548
572
|
i.classList.toggle("active", l), i.setAttribute("aria-selected", l ? "true" : "false");
|
|
549
573
|
});
|
|
550
|
-
const
|
|
551
|
-
|
|
574
|
+
const o = n[e.activeIndex];
|
|
575
|
+
o && (e.list.setAttribute("aria-activedescendant", o.id), f(e.editor, e.list, o), o.scrollIntoView({ block: "nearest" }));
|
|
552
576
|
}
|
|
553
|
-
function
|
|
577
|
+
function I(e) {
|
|
554
578
|
if (!(!e.isOpen || !e.panel || !e.anchorRange)) {
|
|
555
579
|
if (!e.editor.isConnected) {
|
|
556
580
|
s(e);
|
|
557
581
|
return;
|
|
558
582
|
}
|
|
559
|
-
|
|
583
|
+
N(e, e.anchorRange);
|
|
560
584
|
}
|
|
561
585
|
}
|
|
562
|
-
function M(e, t,
|
|
563
|
-
|
|
586
|
+
function M(e, t, r, n, o, i) {
|
|
587
|
+
Z(e, t), e.query = n, e.trigger = o, e.replaceRange = i.cloneRange(), e.anchorRange = r.cloneRange(), e.filteredItems = J(e.items, n, t.maxSuggestions), e.activeIndex = 0, e.isOpen = !0, e.panel && (Y(e, t), N(e, r));
|
|
564
588
|
}
|
|
565
|
-
function
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
589
|
+
function ie(e, t) {
|
|
590
|
+
const r = e.editor;
|
|
591
|
+
if (r.getAttribute("contenteditable") === "false") {
|
|
568
592
|
s(e);
|
|
569
593
|
return;
|
|
570
594
|
}
|
|
571
|
-
const n =
|
|
595
|
+
const n = v(r);
|
|
572
596
|
if (!n || !n.collapsed) {
|
|
573
597
|
s(e);
|
|
574
598
|
return;
|
|
575
599
|
}
|
|
576
|
-
const
|
|
577
|
-
if (!
|
|
600
|
+
const o = G(n);
|
|
601
|
+
if (!o) {
|
|
578
602
|
s(e);
|
|
579
603
|
return;
|
|
580
604
|
}
|
|
581
|
-
const i =
|
|
582
|
-
|
|
605
|
+
const i = V(
|
|
606
|
+
o.textBefore,
|
|
583
607
|
t.triggerChar,
|
|
584
608
|
t.maxQueryLength,
|
|
585
609
|
t.requireBoundary
|
|
@@ -592,25 +616,25 @@ function te(e, t) {
|
|
|
592
616
|
s(e);
|
|
593
617
|
return;
|
|
594
618
|
}
|
|
595
|
-
if (e.dismissedNode ===
|
|
619
|
+
if (e.dismissedNode === o.node && e.dismissedOffset === i.startOffset)
|
|
596
620
|
return;
|
|
597
621
|
e.dismissedNode = null, e.dismissedOffset = -1;
|
|
598
622
|
const a = n.cloneRange();
|
|
599
|
-
a.setStart(
|
|
623
|
+
a.setStart(o.node, i.startOffset), a.setEnd(o.node, o.caretOffset), M(e, t, n, i.query, i.trigger, a);
|
|
600
624
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
if (
|
|
625
|
+
function H(e, t) {
|
|
626
|
+
const r = e.editor;
|
|
627
|
+
if (r.getAttribute("contenteditable") === "false")
|
|
604
628
|
return !1;
|
|
605
|
-
let n =
|
|
606
|
-
n || (n = document.createRange(), n.selectNodeContents(
|
|
607
|
-
const
|
|
608
|
-
return
|
|
629
|
+
let n = v(r);
|
|
630
|
+
n || (n = document.createRange(), n.selectNodeContents(r), n.collapse(!1), E(r, n));
|
|
631
|
+
const o = n.cloneRange();
|
|
632
|
+
return o.collapse(!0), M(e, t, n, "", t.triggerChar, o), !0;
|
|
609
633
|
}
|
|
610
|
-
function
|
|
634
|
+
function ae(e) {
|
|
611
635
|
return !(e.metaKey || e.ctrlKey) || e.altKey ? !1 : e.key === "/" || e.code === "Slash";
|
|
612
636
|
}
|
|
613
|
-
function
|
|
637
|
+
function le(e, t) {
|
|
614
638
|
return {
|
|
615
639
|
editor: e,
|
|
616
640
|
panel: null,
|
|
@@ -622,108 +646,108 @@ function re(e, t) {
|
|
|
622
646
|
query: "",
|
|
623
647
|
trigger: t.triggerChar,
|
|
624
648
|
isOpen: !1,
|
|
625
|
-
instanceId: ++
|
|
649
|
+
instanceId: ++K,
|
|
626
650
|
anchorRange: null,
|
|
627
651
|
dismissedNode: null,
|
|
628
652
|
dismissedOffset: -1
|
|
629
653
|
};
|
|
630
654
|
}
|
|
631
655
|
function w(e, t) {
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
634
|
-
return
|
|
635
|
-
const n =
|
|
636
|
-
return
|
|
637
|
-
}
|
|
638
|
-
function
|
|
639
|
-
var
|
|
640
|
-
const t =
|
|
641
|
-
t && ((
|
|
642
|
-
}
|
|
643
|
-
function C(e, t,
|
|
644
|
-
if (
|
|
656
|
+
const r = h.get(e);
|
|
657
|
+
if (r)
|
|
658
|
+
return r.items = t.items, r;
|
|
659
|
+
const n = le(e, t);
|
|
660
|
+
return h.set(e, n), n;
|
|
661
|
+
}
|
|
662
|
+
function se(e) {
|
|
663
|
+
var r;
|
|
664
|
+
const t = h.get(e);
|
|
665
|
+
t && ((r = t.panel) != null && r.parentNode && t.panel.parentNode.removeChild(t.panel), h.delete(e));
|
|
666
|
+
}
|
|
667
|
+
function C(e, t, r) {
|
|
668
|
+
if (b.has(e)) return;
|
|
645
669
|
const n = {
|
|
646
670
|
input: () => {
|
|
647
|
-
|
|
671
|
+
ie(t, r);
|
|
648
672
|
},
|
|
649
|
-
keydown: (
|
|
673
|
+
keydown: (o) => {
|
|
650
674
|
if (t.editor.getAttribute("contenteditable") === "false") {
|
|
651
675
|
s(t);
|
|
652
676
|
return;
|
|
653
677
|
}
|
|
654
|
-
if (!t.isOpen &&
|
|
655
|
-
|
|
678
|
+
if (!t.isOpen && ae(o)) {
|
|
679
|
+
o.preventDefault(), H(t, r);
|
|
656
680
|
return;
|
|
657
681
|
}
|
|
658
682
|
if (t.isOpen) {
|
|
659
|
-
if (
|
|
660
|
-
|
|
683
|
+
if (o.key === "ArrowDown") {
|
|
684
|
+
o.preventDefault(), R(t, 1);
|
|
661
685
|
return;
|
|
662
686
|
}
|
|
663
|
-
if (
|
|
664
|
-
|
|
687
|
+
if (o.key === "ArrowUp") {
|
|
688
|
+
o.preventDefault(), R(t, -1);
|
|
665
689
|
return;
|
|
666
690
|
}
|
|
667
|
-
if (
|
|
691
|
+
if (o.key === "Enter" || o.key === "Tab") {
|
|
668
692
|
if (t.filteredItems.length === 0) {
|
|
669
|
-
|
|
693
|
+
o.key === "Tab" && o.preventDefault(), s(t);
|
|
670
694
|
return;
|
|
671
695
|
}
|
|
672
|
-
|
|
696
|
+
o.preventDefault(), O(t, t.activeIndex);
|
|
673
697
|
return;
|
|
674
698
|
}
|
|
675
|
-
if (
|
|
676
|
-
|
|
699
|
+
if (o.key === "Escape") {
|
|
700
|
+
o.preventDefault(), t.replaceRange && (t.dismissedNode = t.replaceRange.startContainer, t.dismissedOffset = t.replaceRange.startOffset), s(t);
|
|
677
701
|
return;
|
|
678
702
|
}
|
|
679
703
|
}
|
|
680
704
|
},
|
|
681
705
|
blur: () => {
|
|
682
706
|
window.setTimeout(() => {
|
|
683
|
-
const
|
|
684
|
-
t.panel &&
|
|
707
|
+
const o = document.activeElement;
|
|
708
|
+
t.panel && o && t.panel.contains(o) || s(t);
|
|
685
709
|
}, 0);
|
|
686
710
|
},
|
|
687
|
-
mousedown: (
|
|
711
|
+
mousedown: (o) => {
|
|
688
712
|
if (!t.isOpen || !t.panel) return;
|
|
689
|
-
const i =
|
|
713
|
+
const i = o.target;
|
|
690
714
|
i && !t.panel.contains(i) && !e.contains(i) && s(t);
|
|
691
715
|
},
|
|
692
716
|
selectionchange: () => {
|
|
693
717
|
if (!t.isOpen) return;
|
|
694
|
-
const
|
|
695
|
-
if (!
|
|
718
|
+
const o = v(e);
|
|
719
|
+
if (!o || !o.collapsed) {
|
|
696
720
|
s(t);
|
|
697
721
|
return;
|
|
698
722
|
}
|
|
699
|
-
t.anchorRange =
|
|
723
|
+
t.anchorRange = o.cloneRange(), I(t);
|
|
700
724
|
},
|
|
701
725
|
reposition: () => {
|
|
702
|
-
|
|
726
|
+
I(t);
|
|
703
727
|
}
|
|
704
728
|
};
|
|
705
|
-
e.addEventListener("input", n.input), e.addEventListener("keydown", n.keydown), e.addEventListener("blur", n.blur), document.addEventListener("mousedown", n.mousedown, !0), document.addEventListener("selectionchange", n.selectionchange), window.addEventListener("resize", n.reposition, { passive: !0 }), window.addEventListener("scroll", n.reposition, !0),
|
|
706
|
-
}
|
|
707
|
-
function
|
|
708
|
-
const t =
|
|
709
|
-
t && (e.removeEventListener("input", t.input), e.removeEventListener("keydown", t.keydown), e.removeEventListener("blur", t.blur), document.removeEventListener("mousedown", t.mousedown, !0), document.removeEventListener("selectionchange", t.selectionchange), window.removeEventListener("resize", t.reposition), window.removeEventListener("scroll", t.reposition, !0),
|
|
710
|
-
}
|
|
711
|
-
function
|
|
712
|
-
|
|
713
|
-
const
|
|
714
|
-
if (!(
|
|
715
|
-
const n =
|
|
716
|
-
if (!
|
|
717
|
-
const i = w(
|
|
718
|
-
C(
|
|
719
|
-
}, document.addEventListener("focusin",
|
|
720
|
-
}
|
|
721
|
-
function
|
|
722
|
-
!
|
|
723
|
-
}
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
const t =
|
|
729
|
+
e.addEventListener("input", n.input), e.addEventListener("keydown", n.keydown), e.addEventListener("blur", n.blur), document.addEventListener("mousedown", n.mousedown, !0), document.addEventListener("selectionchange", n.selectionchange), window.addEventListener("resize", n.reposition, { passive: !0 }), window.addEventListener("scroll", n.reposition, !0), b.set(e, n);
|
|
730
|
+
}
|
|
731
|
+
function ce(e) {
|
|
732
|
+
const t = b.get(e);
|
|
733
|
+
t && (e.removeEventListener("input", t.input), e.removeEventListener("keydown", t.keydown), e.removeEventListener("blur", t.blur), document.removeEventListener("mousedown", t.mousedown, !0), document.removeEventListener("selectionchange", t.selectionchange), window.removeEventListener("resize", t.reposition), window.removeEventListener("scroll", t.reposition, !0), b.delete(e));
|
|
734
|
+
}
|
|
735
|
+
function de(e) {
|
|
736
|
+
y || (y = !0, g = (t) => {
|
|
737
|
+
const r = t.target;
|
|
738
|
+
if (!(r instanceof Node)) return;
|
|
739
|
+
const n = Q(r), o = (n == null ? void 0 : n.closest(d)) || null;
|
|
740
|
+
if (!o) return;
|
|
741
|
+
const i = w(o, e);
|
|
742
|
+
C(o, i, e);
|
|
743
|
+
}, document.addEventListener("focusin", g, !0));
|
|
744
|
+
}
|
|
745
|
+
function ue() {
|
|
746
|
+
!y || !g || (document.removeEventListener("focusin", g, !0), y = !1, g = null);
|
|
747
|
+
}
|
|
748
|
+
const ge = (e = {}) => {
|
|
749
|
+
z();
|
|
750
|
+
const t = B(e);
|
|
727
751
|
return {
|
|
728
752
|
name: "slashCommands",
|
|
729
753
|
toolbar: [
|
|
@@ -735,11 +759,11 @@ const ce = (e = {}) => {
|
|
|
735
759
|
}
|
|
736
760
|
],
|
|
737
761
|
commands: {
|
|
738
|
-
openSlashCommands: (
|
|
739
|
-
const
|
|
740
|
-
if (!
|
|
741
|
-
const i = w(
|
|
742
|
-
return C(
|
|
762
|
+
openSlashCommands: (r, n) => {
|
|
763
|
+
const o = U(n);
|
|
764
|
+
if (!o) return !1;
|
|
765
|
+
const i = w(o, t);
|
|
766
|
+
return C(o, i, t), H(i, t);
|
|
743
767
|
}
|
|
744
768
|
},
|
|
745
769
|
keymap: {
|
|
@@ -747,20 +771,20 @@ const ce = (e = {}) => {
|
|
|
747
771
|
"Mod-Shift-7": "openSlashCommands"
|
|
748
772
|
},
|
|
749
773
|
init: () => {
|
|
750
|
-
|
|
751
|
-
const
|
|
752
|
-
C(n,
|
|
774
|
+
p += 1, de(t), Array.from(document.querySelectorAll(d)).forEach((n) => {
|
|
775
|
+
const o = w(n, t);
|
|
776
|
+
C(n, o, t);
|
|
753
777
|
});
|
|
754
778
|
},
|
|
755
779
|
destroy: () => {
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
}),
|
|
780
|
+
p = Math.max(0, p - 1), Array.from(document.querySelectorAll(d)).forEach((n) => {
|
|
781
|
+
const o = h.get(n);
|
|
782
|
+
o && (s(o), ce(n), se(n));
|
|
783
|
+
}), p === 0 && ue();
|
|
760
784
|
}
|
|
761
785
|
};
|
|
762
786
|
};
|
|
763
787
|
export {
|
|
764
|
-
|
|
788
|
+
ge as SlashCommandsPlugin
|
|
765
789
|
};
|
|
766
|
-
//# sourceMappingURL=SlashCommandsPlugin.native-
|
|
790
|
+
//# sourceMappingURL=SlashCommandsPlugin.native-BzGTRmMB.mjs.map
|