@editora/plugins 1.0.8 → 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 +27 -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 +447 -0
- package/dist/approval-workflow.esm.js +1111 -0
- 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 +442 -0
- package/dist/blocks-library.esm.js +1384 -0
- 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 +548 -0
- package/dist/citations.esm.js +1530 -0
- 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 +626 -0
- package/dist/conditional-content.esm.js +1421 -0
- package/dist/content-rules.cjs.js +408 -0
- package/dist/content-rules.esm.js +1147 -0
- package/dist/data-binding.cjs.js +321 -0
- package/dist/data-binding.esm.js +953 -0
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +398 -0
- package/dist/doc-schema.esm.js +1378 -0
- 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 -0
- package/dist/enterprise.esm.js +58 -0
- 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 +124 -93
- 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 +105 -0
- package/dist/mentions.esm.js +774 -0
- 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 +67 -51
- package/dist/pii-redaction.cjs.js +436 -0
- package/dist/pii-redaction.esm.js +1447 -0
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +37 -32
- 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 +90 -0
- package/dist/slash-commands.esm.js +788 -0
- package/dist/smart-paste.cjs.js +398 -0
- package/dist/smart-paste.esm.js +1444 -0
- 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 +77 -0
- package/dist/track-changes.esm.js +817 -0
- package/dist/translation-workflow.cjs.js +626 -0
- package/dist/translation-workflow.esm.js +1794 -0
- package/dist/version-diff.cjs.js +362 -0
- package/dist/version-diff.esm.js +797 -0
- package/index.d.ts +798 -0
- package/package.json +114 -9
- 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
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
function O(e, t) {
|
|
2
|
+
const o = Array.from({ length: t }).map(() => "<th><p><br></p></th>").join(""), n = Array.from({ length: e }).map(
|
|
3
|
+
() => `<tr>${Array.from({ length: t }).map(() => "<td><p><br></p></td>").join("")}</tr>`
|
|
4
|
+
).join("");
|
|
5
|
+
return `<table class="rte-table"><thead><tr>${o}</tr></thead><tbody>${n}</tbody></table><p><br></p>`;
|
|
6
|
+
}
|
|
7
|
+
function q() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
id: "paragraph",
|
|
11
|
+
label: "Paragraph",
|
|
12
|
+
description: "Switch to paragraph text",
|
|
13
|
+
command: "paragraph",
|
|
14
|
+
keywords: ["text", "normal", "p"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "h1",
|
|
18
|
+
label: "Heading 1",
|
|
19
|
+
description: "Large section heading",
|
|
20
|
+
command: "heading1",
|
|
21
|
+
keywords: ["title", "header", "h1"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "h2",
|
|
25
|
+
label: "Heading 2",
|
|
26
|
+
description: "Medium section heading",
|
|
27
|
+
command: "heading2",
|
|
28
|
+
keywords: ["subtitle", "header", "h2"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "h3",
|
|
32
|
+
label: "Heading 3",
|
|
33
|
+
description: "Small section heading",
|
|
34
|
+
command: "heading3",
|
|
35
|
+
keywords: ["header", "h3"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "bulleted-list",
|
|
39
|
+
label: "Bulleted List",
|
|
40
|
+
description: "Create a bullet list",
|
|
41
|
+
command: "toggleBulletList",
|
|
42
|
+
keywords: ["list", "ul", "bullet"]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "numbered-list",
|
|
46
|
+
label: "Numbered List",
|
|
47
|
+
description: "Create a numbered list",
|
|
48
|
+
command: "toggleOrderedList",
|
|
49
|
+
keywords: ["list", "ol", "numbered"]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "blockquote",
|
|
53
|
+
label: "Blockquote",
|
|
54
|
+
description: "Insert a quote block",
|
|
55
|
+
command: "toggleBlockquote",
|
|
56
|
+
keywords: ["quote", "citation"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "table-3x3",
|
|
60
|
+
label: "Table 3x3",
|
|
61
|
+
description: "Insert a 3 x 3 table",
|
|
62
|
+
action: ({ insertHTML: e }) => e(O(3, 3)),
|
|
63
|
+
keywords: ["table", "grid", "rows", "columns"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "horizontal-rule",
|
|
67
|
+
label: "Divider",
|
|
68
|
+
description: "Insert a horizontal rule",
|
|
69
|
+
command: "insertHorizontalRule",
|
|
70
|
+
keywords: ["hr", "separator", "line"]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "bold",
|
|
74
|
+
label: "Bold",
|
|
75
|
+
description: "Toggle bold formatting",
|
|
76
|
+
command: "toggleBold",
|
|
77
|
+
keywords: ["strong", "b"]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "italic",
|
|
81
|
+
label: "Italic",
|
|
82
|
+
description: "Toggle italic formatting",
|
|
83
|
+
command: "toggleItalic",
|
|
84
|
+
keywords: ["emphasis", "i"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "underline",
|
|
88
|
+
label: "Underline",
|
|
89
|
+
description: "Toggle underline formatting",
|
|
90
|
+
command: "toggleUnderline",
|
|
91
|
+
keywords: ["u"]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "strikethrough",
|
|
95
|
+
label: "Strikethrough",
|
|
96
|
+
description: "Toggle strikethrough formatting",
|
|
97
|
+
command: "toggleStrikethrough",
|
|
98
|
+
keywords: ["strike", "s"]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "clear-formatting",
|
|
102
|
+
label: "Clear Formatting",
|
|
103
|
+
description: "Remove text formatting",
|
|
104
|
+
command: "clearFormatting",
|
|
105
|
+
keywords: ["reset", "plain"]
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
function $(e) {
|
|
110
|
+
const t = [], o = /* @__PURE__ */ new Set();
|
|
111
|
+
return e.forEach((n) => {
|
|
112
|
+
const r = String(n.id || "").trim(), i = String(n.label || "").trim();
|
|
113
|
+
!r || !i || o.has(r) || (o.add(r), t.push({
|
|
114
|
+
...n,
|
|
115
|
+
id: r,
|
|
116
|
+
label: i,
|
|
117
|
+
description: n.description ? String(n.description) : void 0,
|
|
118
|
+
keywords: Array.isArray(n.keywords) ? n.keywords.map((a) => String(a)).filter(Boolean) : void 0
|
|
119
|
+
}));
|
|
120
|
+
}), t;
|
|
121
|
+
}
|
|
122
|
+
function D(e) {
|
|
123
|
+
const t = (e.triggerChar || "/")[0] || "/", o = e.includeDefaultItems !== !1, n = o ? [...e.items || [], ...q()] : e.items || [];
|
|
124
|
+
return {
|
|
125
|
+
triggerChar: t,
|
|
126
|
+
minChars: Math.max(0, e.minChars ?? 0),
|
|
127
|
+
maxQueryLength: Math.max(1, e.maxQueryLength ?? 48),
|
|
128
|
+
maxSuggestions: Math.max(1, e.maxSuggestions ?? 10),
|
|
129
|
+
requireBoundary: e.requireBoundary !== !1,
|
|
130
|
+
includeDefaultItems: o,
|
|
131
|
+
items: $(n),
|
|
132
|
+
itemRenderer: e.itemRenderer || ((r) => r.label),
|
|
133
|
+
emptyStateText: e.emptyStateText || "No commands found",
|
|
134
|
+
panelLabel: e.panelLabel || "Slash commands"
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const u = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark';
|
|
138
|
+
let v = !1;
|
|
139
|
+
function B() {
|
|
140
|
+
if (v || typeof document > "u")
|
|
141
|
+
return;
|
|
142
|
+
v = !0;
|
|
143
|
+
const e = document.createElement("style");
|
|
144
|
+
e.id = "rte-slash-commands-styles", e.textContent = `
|
|
145
|
+
.rte-slash-panel {
|
|
146
|
+
width: min(225px, calc(100vw - 16px));
|
|
147
|
+
max-height: min(360px, calc(100vh - 24px));
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
border: 1px solid #d9dfeb;
|
|
150
|
+
border-radius: 0px;
|
|
151
|
+
background: #ffffff;
|
|
152
|
+
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
|
|
153
|
+
z-index: 2147483646;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.rte-slash-list {
|
|
157
|
+
max-height: min(340px, calc(100vh - 32px));
|
|
158
|
+
overflow: auto;
|
|
159
|
+
padding: 0px;
|
|
160
|
+
display: grid;
|
|
161
|
+
gap: 1px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.rte-slash-item {
|
|
165
|
+
width: 100%;
|
|
166
|
+
border: none;
|
|
167
|
+
background: transparent;
|
|
168
|
+
color: #0f172a;
|
|
169
|
+
border-radius: 0px;
|
|
170
|
+
padding: 6px 9px;
|
|
171
|
+
text-align: left;
|
|
172
|
+
display: grid;
|
|
173
|
+
gap: 0px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
font: inherit;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.rte-slash-item:hover,
|
|
179
|
+
.rte-slash-item.active {
|
|
180
|
+
background: #eff6ff;
|
|
181
|
+
color: #1d4ed8;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.rte-slash-item-title {
|
|
185
|
+
font-size: 13px;
|
|
186
|
+
font-weight: 600;
|
|
187
|
+
line-height: 1.35;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.rte-slash-item-description {
|
|
191
|
+
font-size: 12px;
|
|
192
|
+
color: #64748b;
|
|
193
|
+
line-height: 1.35;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.rte-slash-item mark {
|
|
197
|
+
background: rgba(59, 130, 246, 0.16);
|
|
198
|
+
color: inherit;
|
|
199
|
+
padding: 0 2px;
|
|
200
|
+
border-radius: 3px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.rte-slash-empty {
|
|
204
|
+
font-size: 13px;
|
|
205
|
+
color: #64748b;
|
|
206
|
+
text-align: center;
|
|
207
|
+
padding: 12px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
${u} .rte-slash-panel {
|
|
211
|
+
border-color: #364152;
|
|
212
|
+
background: #1f2937;
|
|
213
|
+
box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
${u} .rte-slash-item {
|
|
217
|
+
color: #e5e7eb;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
${u} .rte-slash-item:hover,
|
|
221
|
+
${u} .rte-slash-item.active {
|
|
222
|
+
background: #334155;
|
|
223
|
+
color: #bfdbfe;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
${u} .rte-slash-item-description,
|
|
227
|
+
${u} .rte-slash-empty {
|
|
228
|
+
color: #9ca3af;
|
|
229
|
+
}
|
|
230
|
+
`, document.head.appendChild(e);
|
|
231
|
+
}
|
|
232
|
+
const s = ".rte-content, .editora-content", g = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap();
|
|
233
|
+
let b = !1, f = null, h = 0, z = 0;
|
|
234
|
+
function P(e) {
|
|
235
|
+
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
236
|
+
}
|
|
237
|
+
function I(e) {
|
|
238
|
+
return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
|
|
239
|
+
}
|
|
240
|
+
function F(e) {
|
|
241
|
+
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
242
|
+
return e.contentElement;
|
|
243
|
+
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
244
|
+
const n = e.editorElement;
|
|
245
|
+
if (n.matches(s))
|
|
246
|
+
return n;
|
|
247
|
+
const r = n.querySelector(s);
|
|
248
|
+
if (r instanceof HTMLElement)
|
|
249
|
+
return r;
|
|
250
|
+
}
|
|
251
|
+
const t = window.getSelection();
|
|
252
|
+
if (t && t.rangeCount > 0) {
|
|
253
|
+
const n = t.getRangeAt(0).startContainer, r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = r == null ? void 0 : r.closest(s);
|
|
254
|
+
if (i)
|
|
255
|
+
return i;
|
|
256
|
+
}
|
|
257
|
+
const o = document.activeElement;
|
|
258
|
+
if (o) {
|
|
259
|
+
if (o.matches(s))
|
|
260
|
+
return o;
|
|
261
|
+
const n = o.closest(s);
|
|
262
|
+
if (n)
|
|
263
|
+
return n;
|
|
264
|
+
}
|
|
265
|
+
return document.querySelector(s);
|
|
266
|
+
}
|
|
267
|
+
function m(e) {
|
|
268
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
269
|
+
}
|
|
270
|
+
function _(e) {
|
|
271
|
+
return e ? /\s|[([{"'`]/.test(e) : !0;
|
|
272
|
+
}
|
|
273
|
+
function E(e) {
|
|
274
|
+
const t = window.getSelection();
|
|
275
|
+
if (!t || t.rangeCount === 0)
|
|
276
|
+
return null;
|
|
277
|
+
const o = t.getRangeAt(0);
|
|
278
|
+
return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
|
|
279
|
+
}
|
|
280
|
+
function y(e, t) {
|
|
281
|
+
const o = window.getSelection();
|
|
282
|
+
o && (o.removeAllRanges(), o.addRange(t), e.focus({ preventScroll: !0 }));
|
|
283
|
+
}
|
|
284
|
+
function j(e) {
|
|
285
|
+
if (!e.collapsed)
|
|
286
|
+
return null;
|
|
287
|
+
const t = e.startContainer, o = e.startOffset;
|
|
288
|
+
if (t.nodeType === Node.TEXT_NODE) {
|
|
289
|
+
const n = t;
|
|
290
|
+
return {
|
|
291
|
+
node: n,
|
|
292
|
+
textBefore: n.data.slice(0, o),
|
|
293
|
+
caretOffset: o
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
297
|
+
const n = t;
|
|
298
|
+
if (o > 0) {
|
|
299
|
+
const r = n.childNodes[o - 1];
|
|
300
|
+
if (r && r.nodeType === Node.TEXT_NODE) {
|
|
301
|
+
const i = r;
|
|
302
|
+
return {
|
|
303
|
+
node: i,
|
|
304
|
+
textBefore: i.data,
|
|
305
|
+
caretOffset: i.length
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
function K(e, t, o, n) {
|
|
313
|
+
const r = e.lastIndexOf(t);
|
|
314
|
+
if (r < 0 || n && !_(e[r - 1]))
|
|
315
|
+
return null;
|
|
316
|
+
const i = e.slice(r + 1);
|
|
317
|
+
return /\s/.test(i) || i.length > o ? null : {
|
|
318
|
+
trigger: t,
|
|
319
|
+
query: i,
|
|
320
|
+
startOffset: r
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
function Q(e, t) {
|
|
324
|
+
const o = t.cloneRange();
|
|
325
|
+
o.collapse(!1);
|
|
326
|
+
const n = o.getClientRects();
|
|
327
|
+
if (n.length > 0)
|
|
328
|
+
return n[n.length - 1];
|
|
329
|
+
const r = document.createElement("span");
|
|
330
|
+
r.textContent = "", o.insertNode(r);
|
|
331
|
+
const i = r.getBoundingClientRect();
|
|
332
|
+
return r.remove(), e.normalize(), i;
|
|
333
|
+
}
|
|
334
|
+
function A(e, t) {
|
|
335
|
+
if (!e.panel)
|
|
336
|
+
return;
|
|
337
|
+
const o = Q(e.editor, t), n = e.panel;
|
|
338
|
+
n.style.display = "block", n.classList.add("show"), n.style.left = "0px", n.style.top = "0px";
|
|
339
|
+
const r = n.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight;
|
|
340
|
+
let l = Math.max(8, Math.min(o.left, i - r.width - 8)), d = o.bottom + 8;
|
|
341
|
+
d + r.height > a - 8 && (d = Math.max(8, o.top - r.height - 8)), n.style.position = "fixed", n.style.left = `${l}px`, n.style.top = `${d}px`;
|
|
342
|
+
}
|
|
343
|
+
function k(e, t) {
|
|
344
|
+
if (!t)
|
|
345
|
+
return m(e);
|
|
346
|
+
const o = e.toLowerCase(), n = t.toLowerCase(), r = o.indexOf(n);
|
|
347
|
+
if (r < 0)
|
|
348
|
+
return m(e);
|
|
349
|
+
const i = m(e.slice(0, r)), a = m(e.slice(r, r + t.length)), l = m(e.slice(r + t.length));
|
|
350
|
+
return `${i}<mark>${a}</mark>${l}`;
|
|
351
|
+
}
|
|
352
|
+
function U(e, t) {
|
|
353
|
+
if (e.panel && e.list)
|
|
354
|
+
return;
|
|
355
|
+
const o = document.createElement("div");
|
|
356
|
+
o.className = "rte-slash-panel", o.style.display = "none", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false");
|
|
357
|
+
const n = document.createElement("div");
|
|
358
|
+
n.className = "rte-slash-list", n.setAttribute("role", "listbox"), n.setAttribute("aria-label", t.panelLabel), o.appendChild(n), document.body.appendChild(o), e.panel = o, e.list = n, o.addEventListener("mousedown", (r) => {
|
|
359
|
+
r.preventDefault();
|
|
360
|
+
}), o.addEventListener("click", (r) => {
|
|
361
|
+
const i = r.target;
|
|
362
|
+
if (!i)
|
|
363
|
+
return;
|
|
364
|
+
const a = i.closest(".rte-slash-item");
|
|
365
|
+
if (!a)
|
|
366
|
+
return;
|
|
367
|
+
const l = Number(a.getAttribute("data-index"));
|
|
368
|
+
Number.isFinite(l) && M(e, l);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function c(e) {
|
|
372
|
+
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);
|
|
373
|
+
}
|
|
374
|
+
function W(e, t, o) {
|
|
375
|
+
if (!t)
|
|
376
|
+
return e.slice(0, o);
|
|
377
|
+
const n = t.toLowerCase();
|
|
378
|
+
return e.filter((i) => [
|
|
379
|
+
i.id,
|
|
380
|
+
i.label,
|
|
381
|
+
i.description || "",
|
|
382
|
+
i.command || "",
|
|
383
|
+
...i.keywords || []
|
|
384
|
+
].join(" ").toLowerCase().includes(n)).slice(0, o);
|
|
385
|
+
}
|
|
386
|
+
function Z(e, t) {
|
|
387
|
+
if (!e.list)
|
|
388
|
+
return;
|
|
389
|
+
const o = e.list;
|
|
390
|
+
if (o.innerHTML = "", e.filteredItems.length === 0) {
|
|
391
|
+
const n = document.createElement("div");
|
|
392
|
+
n.className = "rte-slash-empty", n.textContent = t.emptyStateText, o.appendChild(n), o.removeAttribute("aria-activedescendant");
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
e.filteredItems.forEach((n, r) => {
|
|
396
|
+
const i = document.createElement("button");
|
|
397
|
+
i.type = "button", i.className = "rte-slash-item", i.setAttribute("role", "option"), i.setAttribute("data-index", String(r)), i.setAttribute("id", `rte-slash-item-${e.instanceId}-${r}`), i.setAttribute("aria-selected", r === e.activeIndex ? "true" : "false"), i.setAttribute("aria-label", n.description ? `${n.label} - ${n.description}` : n.label), r === e.activeIndex && i.classList.add("active"), t.itemRenderer ? i.innerHTML = t.itemRenderer(n, e.query) : i.innerHTML = `
|
|
398
|
+
<span class="rte-slash-item-title">${k(n.label, e.query)}</span>
|
|
399
|
+
${n.description ? `<span class="rte-slash-item-description">${k(n.description, e.query)}</span>` : ""}
|
|
400
|
+
`, o.appendChild(i);
|
|
401
|
+
}), e.filteredItems.length > 0 && o.setAttribute("aria-activedescendant", `rte-slash-item-${e.instanceId}-${e.activeIndex}`);
|
|
402
|
+
}
|
|
403
|
+
function G(e, t) {
|
|
404
|
+
if (t === e.innerHTML)
|
|
405
|
+
return;
|
|
406
|
+
const o = window.execEditorCommand || window.executeEditorCommand;
|
|
407
|
+
if (typeof o == "function")
|
|
408
|
+
try {
|
|
409
|
+
o("recordDomTransaction", e, t, e.innerHTML);
|
|
410
|
+
} catch {
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function V(e) {
|
|
414
|
+
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
415
|
+
}
|
|
416
|
+
function L(e, t) {
|
|
417
|
+
e.focus({ preventScroll: !0 });
|
|
418
|
+
try {
|
|
419
|
+
if (document.execCommand("insertHTML", !1, t))
|
|
420
|
+
return !0;
|
|
421
|
+
} catch {
|
|
422
|
+
}
|
|
423
|
+
const o = window.getSelection();
|
|
424
|
+
if (!o || o.rangeCount === 0)
|
|
425
|
+
return !1;
|
|
426
|
+
const n = o.getRangeAt(0);
|
|
427
|
+
if (!e.contains(n.commonAncestorContainer))
|
|
428
|
+
return !1;
|
|
429
|
+
n.deleteContents();
|
|
430
|
+
const r = document.createElement("template");
|
|
431
|
+
r.innerHTML = t;
|
|
432
|
+
const i = r.content, a = i.lastChild;
|
|
433
|
+
if (n.insertNode(i), a) {
|
|
434
|
+
const l = document.createRange();
|
|
435
|
+
l.setStartAfter(a), l.collapse(!0), y(e, l);
|
|
436
|
+
}
|
|
437
|
+
return !0;
|
|
438
|
+
}
|
|
439
|
+
function X(e, t) {
|
|
440
|
+
e.focus({ preventScroll: !0 });
|
|
441
|
+
try {
|
|
442
|
+
if (document.execCommand("insertText", !1, t))
|
|
443
|
+
return !0;
|
|
444
|
+
} catch {
|
|
445
|
+
}
|
|
446
|
+
const o = window.getSelection();
|
|
447
|
+
if (!o || o.rangeCount === 0)
|
|
448
|
+
return !1;
|
|
449
|
+
const n = o.getRangeAt(0);
|
|
450
|
+
if (!e.contains(n.commonAncestorContainer))
|
|
451
|
+
return !1;
|
|
452
|
+
n.deleteContents();
|
|
453
|
+
const r = document.createTextNode(t);
|
|
454
|
+
n.insertNode(r);
|
|
455
|
+
const i = document.createRange();
|
|
456
|
+
return i.setStart(r, r.length), i.collapse(!0), y(e, i), !0;
|
|
457
|
+
}
|
|
458
|
+
function J(e, t) {
|
|
459
|
+
switch (e.toLowerCase()) {
|
|
460
|
+
case "paragraph":
|
|
461
|
+
case "p":
|
|
462
|
+
return document.execCommand("formatBlock", !1, "<p>");
|
|
463
|
+
case "heading1":
|
|
464
|
+
case "h1":
|
|
465
|
+
return document.execCommand("formatBlock", !1, "<h1>");
|
|
466
|
+
case "heading2":
|
|
467
|
+
case "h2":
|
|
468
|
+
return document.execCommand("formatBlock", !1, "<h2>");
|
|
469
|
+
case "heading3":
|
|
470
|
+
case "h3":
|
|
471
|
+
return document.execCommand("formatBlock", !1, "<h3>");
|
|
472
|
+
case "blockquote":
|
|
473
|
+
case "toggleblockquote":
|
|
474
|
+
return document.execCommand("formatBlock", !1, "<blockquote>");
|
|
475
|
+
case "bulletlist":
|
|
476
|
+
case "togglebulletlist":
|
|
477
|
+
case "insertunorderedlist":
|
|
478
|
+
return document.execCommand("insertUnorderedList");
|
|
479
|
+
case "numberedlist":
|
|
480
|
+
case "toggleorderedlist":
|
|
481
|
+
case "insertorderedlist":
|
|
482
|
+
return document.execCommand("insertOrderedList");
|
|
483
|
+
case "horizontalrule":
|
|
484
|
+
case "divider":
|
|
485
|
+
case "inserthorizontalrule":
|
|
486
|
+
return document.execCommand("insertHorizontalRule");
|
|
487
|
+
case "bold":
|
|
488
|
+
case "togglebold":
|
|
489
|
+
return document.execCommand("bold");
|
|
490
|
+
case "italic":
|
|
491
|
+
case "toggleitalic":
|
|
492
|
+
return document.execCommand("italic");
|
|
493
|
+
case "underline":
|
|
494
|
+
case "toggleunderline":
|
|
495
|
+
return document.execCommand("underline");
|
|
496
|
+
case "strikethrough":
|
|
497
|
+
case "togglestrikethrough":
|
|
498
|
+
return document.execCommand("strikeThrough");
|
|
499
|
+
case "clearformatting":
|
|
500
|
+
case "removeformat":
|
|
501
|
+
return document.execCommand("removeFormat");
|
|
502
|
+
default:
|
|
503
|
+
try {
|
|
504
|
+
return document.execCommand(e, !1, t);
|
|
505
|
+
} catch {
|
|
506
|
+
return !1;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function S(e, t, o) {
|
|
511
|
+
const n = I(e);
|
|
512
|
+
if (n && typeof n.execCommand == "function")
|
|
513
|
+
try {
|
|
514
|
+
if (n.execCommand(t, o) !== !1)
|
|
515
|
+
return !0;
|
|
516
|
+
} catch {
|
|
517
|
+
}
|
|
518
|
+
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
519
|
+
if (typeof r == "function")
|
|
520
|
+
try {
|
|
521
|
+
if (r(t, o, {
|
|
522
|
+
editorElement: n,
|
|
523
|
+
contentElement: e
|
|
524
|
+
}) !== !1)
|
|
525
|
+
return !0;
|
|
526
|
+
} catch {
|
|
527
|
+
}
|
|
528
|
+
return J(t, o);
|
|
529
|
+
}
|
|
530
|
+
async function Y(e, t) {
|
|
531
|
+
const o = e.editor, n = I(o), r = {
|
|
532
|
+
editor: o,
|
|
533
|
+
editorRoot: n,
|
|
534
|
+
query: e.query,
|
|
535
|
+
trigger: e.trigger,
|
|
536
|
+
executeCommand: (i, a) => S(o, i, a),
|
|
537
|
+
insertHTML: (i) => L(o, i)
|
|
538
|
+
};
|
|
539
|
+
return t.action ? await Promise.resolve(t.action(r)) !== !1 : t.insertHTML ? L(o, t.insertHTML) : t.command ? S(o, t.command, t.commandValue) : !1;
|
|
540
|
+
}
|
|
541
|
+
async function M(e, t) {
|
|
542
|
+
if (t < 0 || t >= e.filteredItems.length || !e.replaceRange)
|
|
543
|
+
return;
|
|
544
|
+
const o = e.filteredItems[t], n = e.editor, r = n.innerHTML, i = `${e.trigger}${e.query}`;
|
|
545
|
+
if (!window.getSelection())
|
|
546
|
+
return;
|
|
547
|
+
const l = e.replaceRange.cloneRange();
|
|
548
|
+
if (!n.contains(l.commonAncestorContainer))
|
|
549
|
+
return;
|
|
550
|
+
l.deleteContents();
|
|
551
|
+
const d = l.cloneRange();
|
|
552
|
+
d.collapse(!0), y(n, d);
|
|
553
|
+
let x = !1;
|
|
554
|
+
try {
|
|
555
|
+
x = await Y(e, o);
|
|
556
|
+
} catch {
|
|
557
|
+
x = !1;
|
|
558
|
+
}
|
|
559
|
+
c(e), x ? (V(n), G(n, r)) : i && X(n, i), n.focus({ preventScroll: !0 });
|
|
560
|
+
}
|
|
561
|
+
function R(e, t) {
|
|
562
|
+
if (e.filteredItems.length === 0)
|
|
563
|
+
return;
|
|
564
|
+
const o = e.filteredItems.length;
|
|
565
|
+
if (e.activeIndex = ((e.activeIndex + t) % o + o) % o, !e.list)
|
|
566
|
+
return;
|
|
567
|
+
const n = Array.from(e.list.querySelectorAll(".rte-slash-item"));
|
|
568
|
+
n.forEach((i, a) => {
|
|
569
|
+
const l = a === e.activeIndex;
|
|
570
|
+
i.classList.toggle("active", l), i.setAttribute("aria-selected", l ? "true" : "false");
|
|
571
|
+
});
|
|
572
|
+
const r = n[e.activeIndex];
|
|
573
|
+
r && (e.list.setAttribute("aria-activedescendant", r.id), r.scrollIntoView({ block: "nearest" }));
|
|
574
|
+
}
|
|
575
|
+
function T(e) {
|
|
576
|
+
if (!(!e.isOpen || !e.panel || !e.anchorRange)) {
|
|
577
|
+
if (!e.editor.isConnected) {
|
|
578
|
+
c(e);
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
A(e, e.anchorRange);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function N(e, t, o, n, r, i) {
|
|
585
|
+
U(e, t), e.query = n, e.trigger = r, e.replaceRange = i.cloneRange(), e.anchorRange = o.cloneRange(), e.filteredItems = W(e.items, n, t.maxSuggestions), e.activeIndex = 0, e.isOpen = !0, e.panel && (Z(e, t), A(e, o));
|
|
586
|
+
}
|
|
587
|
+
function ee(e, t) {
|
|
588
|
+
const o = e.editor;
|
|
589
|
+
if (o.getAttribute("contenteditable") === "false") {
|
|
590
|
+
c(e);
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
const n = E(o);
|
|
594
|
+
if (!n || !n.collapsed) {
|
|
595
|
+
c(e);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
const r = j(n);
|
|
599
|
+
if (!r) {
|
|
600
|
+
c(e);
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
const i = K(
|
|
604
|
+
r.textBefore,
|
|
605
|
+
t.triggerChar,
|
|
606
|
+
t.maxQueryLength,
|
|
607
|
+
t.requireBoundary
|
|
608
|
+
);
|
|
609
|
+
if (!i) {
|
|
610
|
+
c(e);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
if (i.query.length < t.minChars) {
|
|
614
|
+
c(e);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
const a = n.cloneRange();
|
|
618
|
+
a.setStart(r.node, i.startOffset), a.setEnd(r.node, r.caretOffset), N(e, t, n, i.query, i.trigger, a);
|
|
619
|
+
}
|
|
620
|
+
function H(e, t) {
|
|
621
|
+
const o = e.editor;
|
|
622
|
+
if (o.getAttribute("contenteditable") === "false")
|
|
623
|
+
return !1;
|
|
624
|
+
let n = E(o);
|
|
625
|
+
n || (n = document.createRange(), n.selectNodeContents(o), n.collapse(!1), y(o, n));
|
|
626
|
+
const r = n.cloneRange();
|
|
627
|
+
return r.collapse(!0), N(e, t, n, "", t.triggerChar, r), !0;
|
|
628
|
+
}
|
|
629
|
+
function te(e) {
|
|
630
|
+
return !(e.metaKey || e.ctrlKey) || e.altKey ? !1 : e.key === "/" || e.code === "Slash";
|
|
631
|
+
}
|
|
632
|
+
function ne(e, t) {
|
|
633
|
+
return {
|
|
634
|
+
editor: e,
|
|
635
|
+
panel: null,
|
|
636
|
+
list: null,
|
|
637
|
+
replaceRange: null,
|
|
638
|
+
items: t.items,
|
|
639
|
+
filteredItems: [],
|
|
640
|
+
activeIndex: 0,
|
|
641
|
+
query: "",
|
|
642
|
+
trigger: t.triggerChar,
|
|
643
|
+
isOpen: !1,
|
|
644
|
+
instanceId: ++z,
|
|
645
|
+
anchorRange: null
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function w(e, t) {
|
|
649
|
+
const o = g.get(e);
|
|
650
|
+
if (o)
|
|
651
|
+
return o.items = t.items, o;
|
|
652
|
+
const n = ne(e, t);
|
|
653
|
+
return g.set(e, n), n;
|
|
654
|
+
}
|
|
655
|
+
function re(e) {
|
|
656
|
+
var o;
|
|
657
|
+
const t = g.get(e);
|
|
658
|
+
t && ((o = t.panel) != null && o.parentNode && t.panel.parentNode.removeChild(t.panel), g.delete(e));
|
|
659
|
+
}
|
|
660
|
+
function C(e, t, o) {
|
|
661
|
+
if (p.has(e))
|
|
662
|
+
return;
|
|
663
|
+
const n = {
|
|
664
|
+
input: () => {
|
|
665
|
+
ee(t, o);
|
|
666
|
+
},
|
|
667
|
+
keydown: (r) => {
|
|
668
|
+
if (t.editor.getAttribute("contenteditable") === "false") {
|
|
669
|
+
c(t);
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
if (!t.isOpen && te(r)) {
|
|
673
|
+
r.preventDefault(), H(t, o);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (t.isOpen) {
|
|
677
|
+
if (r.key === "ArrowDown") {
|
|
678
|
+
r.preventDefault(), R(t, 1);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (r.key === "ArrowUp") {
|
|
682
|
+
r.preventDefault(), R(t, -1);
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
if (r.key === "Enter" || r.key === "Tab") {
|
|
686
|
+
if (t.filteredItems.length === 0) {
|
|
687
|
+
r.key === "Tab" && r.preventDefault(), c(t);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
r.preventDefault(), M(t, t.activeIndex);
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
if (r.key === "Escape") {
|
|
694
|
+
r.preventDefault(), c(t);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
blur: () => {
|
|
700
|
+
window.setTimeout(() => {
|
|
701
|
+
const r = document.activeElement;
|
|
702
|
+
t.panel && r && t.panel.contains(r) || c(t);
|
|
703
|
+
}, 0);
|
|
704
|
+
},
|
|
705
|
+
mousedown: (r) => {
|
|
706
|
+
if (!t.isOpen || !t.panel)
|
|
707
|
+
return;
|
|
708
|
+
const i = r.target;
|
|
709
|
+
i && !t.panel.contains(i) && !e.contains(i) && c(t);
|
|
710
|
+
},
|
|
711
|
+
selectionchange: () => {
|
|
712
|
+
if (!t.isOpen)
|
|
713
|
+
return;
|
|
714
|
+
const r = E(e);
|
|
715
|
+
if (!r || !r.collapsed) {
|
|
716
|
+
c(t);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
t.anchorRange = r.cloneRange(), T(t);
|
|
720
|
+
},
|
|
721
|
+
reposition: () => {
|
|
722
|
+
T(t);
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
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), p.set(e, n);
|
|
726
|
+
}
|
|
727
|
+
function oe(e) {
|
|
728
|
+
const t = p.get(e);
|
|
729
|
+
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), p.delete(e));
|
|
730
|
+
}
|
|
731
|
+
function ie(e) {
|
|
732
|
+
b || (b = !0, f = (t) => {
|
|
733
|
+
const o = t.target;
|
|
734
|
+
if (!(o instanceof Node))
|
|
735
|
+
return;
|
|
736
|
+
const n = P(o), r = (n == null ? void 0 : n.closest(s)) || null;
|
|
737
|
+
if (!r)
|
|
738
|
+
return;
|
|
739
|
+
const i = w(r, e);
|
|
740
|
+
C(r, i, e);
|
|
741
|
+
}, document.addEventListener("focusin", f, !0));
|
|
742
|
+
}
|
|
743
|
+
function ae() {
|
|
744
|
+
!b || !f || (document.removeEventListener("focusin", f, !0), b = !1, f = null);
|
|
745
|
+
}
|
|
746
|
+
const le = (e = {}) => {
|
|
747
|
+
B();
|
|
748
|
+
const t = D(e);
|
|
749
|
+
return {
|
|
750
|
+
name: "slashCommands",
|
|
751
|
+
toolbar: [
|
|
752
|
+
{
|
|
753
|
+
id: "slashCommands",
|
|
754
|
+
label: "Slash Commands",
|
|
755
|
+
command: "openSlashCommands",
|
|
756
|
+
icon: '<svg width="24" height="24" focusable="false" aria-hidden="true"><path d="M8.7 20a1 1 0 0 1-.7-.3c-.4-.4-.4-1 0-1.4L15.6 5a1 1 0 0 1 1.4 1.4L9.4 19.7a1 1 0 0 1-.7.3Zm7.8 0c-.3 0-.5 0-.7-.3l-1.8-1.8a1 1 0 1 1 1.4-1.4l1.8 1.8a1 1 0 0 1-.7 1.7Zm-9-12a1 1 0 0 1-.7-1.7L8.6 4.5A1 1 0 1 1 10 6L8.2 7.8a1 1 0 0 1-.7.3Z"></path></svg>'
|
|
757
|
+
}
|
|
758
|
+
],
|
|
759
|
+
commands: {
|
|
760
|
+
openSlashCommands: (o, n) => {
|
|
761
|
+
const r = F(n);
|
|
762
|
+
if (!r)
|
|
763
|
+
return !1;
|
|
764
|
+
const i = w(r, t);
|
|
765
|
+
return C(r, i, t), H(i, t);
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
keymap: {
|
|
769
|
+
"Mod-/": "openSlashCommands",
|
|
770
|
+
"Mod-Shift-7": "openSlashCommands"
|
|
771
|
+
},
|
|
772
|
+
init: () => {
|
|
773
|
+
h += 1, ie(t), Array.from(document.querySelectorAll(s)).forEach((n) => {
|
|
774
|
+
const r = w(n, t);
|
|
775
|
+
C(n, r, t);
|
|
776
|
+
});
|
|
777
|
+
},
|
|
778
|
+
destroy: () => {
|
|
779
|
+
h = Math.max(0, h - 1), Array.from(document.querySelectorAll(s)).forEach((n) => {
|
|
780
|
+
const r = g.get(n);
|
|
781
|
+
r && (c(r), oe(n), re(n));
|
|
782
|
+
}), h === 0 && ae();
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
export {
|
|
787
|
+
le as SlashCommandsPlugin
|
|
788
|
+
};
|