@editora/core 1.0.15 → 1.0.17
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-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-XsYC_KdJ.mjs +3923 -0
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +17 -14
- package/dist/plugin-loader.js +53 -52
- package/dist/webcomponent-core.js +2055 -476
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +96 -66
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2223 -643
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1564 -1198
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-BLm1MtzH.js +0 -10
- package/dist/index-Cd9jEuZP.mjs +0 -2341
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Ao {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
@@ -17,16 +17,16 @@ class I {
|
|
|
17
17
|
const o = this.pluginRegistry.get(t);
|
|
18
18
|
if (!o)
|
|
19
19
|
return console.warn(`Plugin not found: ${t}`), null;
|
|
20
|
-
const
|
|
21
|
-
return e && this.applyPluginConfig(
|
|
20
|
+
const i = await o();
|
|
21
|
+
return e && this.applyPluginConfig(i, e), this.loadedPlugins.set(t, i), i;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Load multiple plugins
|
|
25
25
|
*/
|
|
26
26
|
async loadMultiple(t, e) {
|
|
27
27
|
return (await Promise.all(
|
|
28
|
-
t.map((
|
|
29
|
-
)).filter((
|
|
28
|
+
t.map((i) => this.load(i, e))
|
|
29
|
+
)).filter((i) => i !== null);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Parse plugin string "lists link image media"
|
|
@@ -72,19 +72,19 @@ class I {
|
|
|
72
72
|
return this.loadedPlugins.has(t);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
class
|
|
75
|
+
class Gt {
|
|
76
76
|
constructor(t, e, o) {
|
|
77
77
|
this.doc = t, this.selection = e, this.schema = o;
|
|
78
78
|
}
|
|
79
79
|
static create(t, e) {
|
|
80
80
|
const o = e || t.node("doc", {}, [t.node("paragraph")]);
|
|
81
|
-
return new
|
|
81
|
+
return new Gt(o, { anchor: 0, head: 0 }, t);
|
|
82
82
|
}
|
|
83
83
|
apply(t, e) {
|
|
84
|
-
return new
|
|
84
|
+
return new Gt(t, e || this.selection, this.schema);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
class
|
|
87
|
+
class an {
|
|
88
88
|
constructor(t, e) {
|
|
89
89
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
90
90
|
}
|
|
@@ -95,7 +95,7 @@ class N {
|
|
|
95
95
|
return { type: "text", text: t, marks: e };
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
class
|
|
98
|
+
class sn {
|
|
99
99
|
constructor() {
|
|
100
100
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
101
101
|
}
|
|
@@ -105,14 +105,14 @@ class B {
|
|
|
105
105
|
if (t.initialize)
|
|
106
106
|
try {
|
|
107
107
|
t.initialize(o);
|
|
108
|
-
} catch (
|
|
109
|
-
console.error(`Failed to initialize plugin "${t.name}":`,
|
|
108
|
+
} catch (i) {
|
|
109
|
+
console.error(`Failed to initialize plugin "${t.name}":`, i);
|
|
110
110
|
}
|
|
111
111
|
if (t.init && t.init !== t.initialize)
|
|
112
112
|
try {
|
|
113
113
|
t.init(o);
|
|
114
|
-
} catch (
|
|
115
|
-
console.error(`Failed to run init hook for plugin "${t.name}":`,
|
|
114
|
+
} catch (i) {
|
|
115
|
+
console.error(`Failed to run init hook for plugin "${t.name}":`, i);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
unregister(t) {
|
|
@@ -132,7 +132,7 @@ class B {
|
|
|
132
132
|
const t = {}, e = {};
|
|
133
133
|
return this.plugins.forEach((o) => {
|
|
134
134
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
135
|
-
}), new
|
|
135
|
+
}), new an(t, e);
|
|
136
136
|
}
|
|
137
137
|
getCommands() {
|
|
138
138
|
const t = {};
|
|
@@ -147,35 +147,35 @@ class B {
|
|
|
147
147
|
* Execute plugin command with mode awareness
|
|
148
148
|
*/
|
|
149
149
|
async executePluginCommand(t, e, ...o) {
|
|
150
|
-
const
|
|
151
|
-
if (!
|
|
150
|
+
const i = this.getPlugin(t);
|
|
151
|
+
if (!i)
|
|
152
152
|
throw new Error(`Plugin not found: ${t}`);
|
|
153
|
-
const
|
|
153
|
+
const r = this.getPluginConfig(t) || i.config || {}, l = r.mode || "local";
|
|
154
154
|
try {
|
|
155
|
-
switch (
|
|
155
|
+
switch (l) {
|
|
156
156
|
case "local":
|
|
157
|
-
return
|
|
157
|
+
return i.executeLocal ? i.executeLocal(e, ...o) : null;
|
|
158
158
|
case "api":
|
|
159
|
-
if (!
|
|
159
|
+
if (!i.executeAPI)
|
|
160
160
|
throw new Error(`Plugin ${t} does not support API mode`);
|
|
161
|
-
return await
|
|
161
|
+
return await i.executeAPI(e, ...o);
|
|
162
162
|
case "hybrid":
|
|
163
|
-
if (
|
|
164
|
-
return await
|
|
163
|
+
if (i.executeHybrid)
|
|
164
|
+
return await i.executeHybrid(e, ...o);
|
|
165
165
|
try {
|
|
166
|
-
if (
|
|
167
|
-
return await
|
|
168
|
-
} catch (
|
|
169
|
-
if (console.warn(`API execution failed for ${t}, falling back to local`,
|
|
170
|
-
return
|
|
171
|
-
throw
|
|
166
|
+
if (i.executeAPI)
|
|
167
|
+
return await i.executeAPI(e, ...o);
|
|
168
|
+
} catch (c) {
|
|
169
|
+
if (console.warn(`API execution failed for ${t}, falling back to local`, c), i.executeLocal && r.fallbackToLocal !== !1)
|
|
170
|
+
return i.executeLocal(e, ...o);
|
|
171
|
+
throw c;
|
|
172
172
|
}
|
|
173
173
|
break;
|
|
174
174
|
default:
|
|
175
|
-
throw new Error(`Unknown plugin mode: ${
|
|
175
|
+
throw new Error(`Unknown plugin mode: ${l}`);
|
|
176
176
|
}
|
|
177
|
-
} catch (
|
|
178
|
-
throw console.error(`Error executing command ${e} on plugin ${t}:`,
|
|
177
|
+
} catch (c) {
|
|
178
|
+
throw console.error(`Error executing command ${e} on plugin ${t}:`, c), c;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
@@ -186,7 +186,7 @@ class B {
|
|
|
186
186
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
class
|
|
189
|
+
class ln {
|
|
190
190
|
constructor(t = {}) {
|
|
191
191
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
192
192
|
this.register(e, o);
|
|
@@ -229,11 +229,11 @@ class O {
|
|
|
229
229
|
this.commands.clear();
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class cn {
|
|
233
233
|
constructor(t = {}) {
|
|
234
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
234
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new sn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
235
235
|
const e = this.pluginManager.buildSchema();
|
|
236
|
-
this.state =
|
|
236
|
+
this.state = Gt.create(e), this.commandRegistry = new ln(this.pluginManager.getCommands());
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Execute a command
|
|
@@ -246,12 +246,12 @@ class z {
|
|
|
246
246
|
const o = this.commandRegistry.get(t);
|
|
247
247
|
if (!o)
|
|
248
248
|
return console.warn(`Command not found: ${t}`), !1;
|
|
249
|
-
let
|
|
250
|
-
return e.length === 0 ?
|
|
251
|
-
|
|
252
|
-
}).catch((
|
|
253
|
-
console.error(`Async command failed: ${t}`,
|
|
254
|
-
}), !0) :
|
|
249
|
+
let i;
|
|
250
|
+
return e.length === 0 ? i = o(this.state) : e.length === 1 ? i = o(this.state, e[0]) : i = o(this.state, ...e), i instanceof Promise ? (i.then((r) => {
|
|
251
|
+
r && typeof r == "object" && "doc" in r && "selection" in r && (this.setState(r), this.emit("change", this.state));
|
|
252
|
+
}).catch((r) => {
|
|
253
|
+
console.error(`Async command failed: ${t}`, r);
|
|
254
|
+
}), !0) : i && typeof i == "object" && "doc" in i && "selection" in i ? (this.setState(i), this.emit("change", this.state), !0) : i !== !1 && i != null;
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
* Update editor state
|
|
@@ -284,8 +284,8 @@ class z {
|
|
|
284
284
|
return this.listeners.has(t) || this.listeners.set(t, []), this.listeners.get(t).push(e), () => {
|
|
285
285
|
const o = this.listeners.get(t);
|
|
286
286
|
if (o) {
|
|
287
|
-
const
|
|
288
|
-
|
|
287
|
+
const i = o.indexOf(e);
|
|
288
|
+
i > -1 && o.splice(i, 1);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
}
|
|
@@ -294,11 +294,11 @@ class z {
|
|
|
294
294
|
*/
|
|
295
295
|
emit(t, ...e) {
|
|
296
296
|
const o = this.listeners.get(t);
|
|
297
|
-
o && o.forEach((
|
|
297
|
+
o && o.forEach((i) => {
|
|
298
298
|
try {
|
|
299
|
-
|
|
300
|
-
} catch (
|
|
301
|
-
console.error(`Error in ${t} handler:`,
|
|
299
|
+
i(...e);
|
|
300
|
+
} catch (r) {
|
|
301
|
+
console.error(`Error in ${t} handler:`, r);
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
}
|
|
@@ -315,16 +315,20 @@ class z {
|
|
|
315
315
|
return this.isDestroyed;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
class
|
|
319
|
-
|
|
318
|
+
class dn {
|
|
319
|
+
constructor(t, e, o) {
|
|
320
|
+
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
321
|
+
var l, c;
|
|
322
|
+
if (!this.expandedOpen) return;
|
|
323
|
+
const r = i.target;
|
|
324
|
+
r && ((l = this.moreButton) != null && l.contains(r) || (c = this.expandedRow) != null && c.contains(r)) || this.setExpandedOpen(!1);
|
|
325
|
+
}, this.config = t, this.plugins = e, this.pluginLoader = o;
|
|
326
|
+
}
|
|
320
327
|
setLastCommandTrigger(t, e) {
|
|
321
328
|
if (typeof window == "undefined" || !t) return;
|
|
322
329
|
const o = e || t.getAttribute("data-command") || void 0;
|
|
323
330
|
o && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = o);
|
|
324
331
|
}
|
|
325
|
-
constructor(t, e, o) {
|
|
326
|
-
this.config = t, this.plugins = e, this.pluginLoader = o;
|
|
327
|
-
}
|
|
328
332
|
/**
|
|
329
333
|
* Set command handler for toolbar buttons
|
|
330
334
|
*/
|
|
@@ -335,11 +339,11 @@ class R {
|
|
|
335
339
|
* Parse toolbar string into button groups
|
|
336
340
|
*/
|
|
337
341
|
parseToolbarString(t) {
|
|
338
|
-
const e = [], o = t.split("|").map((
|
|
339
|
-
|
|
340
|
-
|
|
342
|
+
const e = [], o = t.split("|").map((c) => c.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
|
|
343
|
+
i.forEach((c) => {
|
|
344
|
+
c.command && r.set(c.command, c), c.type === "group" && c.label && r.set(c.label, c);
|
|
341
345
|
});
|
|
342
|
-
const
|
|
346
|
+
const l = {
|
|
343
347
|
bold: "toggleBold",
|
|
344
348
|
italic: "toggleItalic",
|
|
345
349
|
underline: "toggleUnderline",
|
|
@@ -401,59 +405,59 @@ class R {
|
|
|
401
405
|
insertVideo: "insertVideo",
|
|
402
406
|
codeBlock: "insertCodeBlock"
|
|
403
407
|
};
|
|
404
|
-
return o.forEach((
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
return o.forEach((c) => {
|
|
409
|
+
const p = [];
|
|
410
|
+
c.split(/\s+/).filter(Boolean).forEach((v) => {
|
|
411
|
+
if (v === "direction") {
|
|
412
|
+
const w = r.get("setDirectionLTR"), E = r.get("setDirectionRTL");
|
|
413
|
+
w && p.push({
|
|
410
414
|
id: "directionLTR",
|
|
411
|
-
label:
|
|
412
|
-
command:
|
|
413
|
-
icon:
|
|
414
|
-
type:
|
|
415
|
-
options:
|
|
416
|
-
}),
|
|
415
|
+
label: w.label,
|
|
416
|
+
command: w.command,
|
|
417
|
+
icon: w.icon,
|
|
418
|
+
type: w.type || "button",
|
|
419
|
+
options: w.options
|
|
420
|
+
}), E && p.push({
|
|
417
421
|
id: "directionRTL",
|
|
418
|
-
label:
|
|
419
|
-
command:
|
|
420
|
-
icon:
|
|
421
|
-
type:
|
|
422
|
-
options:
|
|
422
|
+
label: E.label,
|
|
423
|
+
command: E.command,
|
|
424
|
+
icon: E.icon,
|
|
425
|
+
type: E.type || "button",
|
|
426
|
+
options: E.options
|
|
423
427
|
});
|
|
424
428
|
return;
|
|
425
429
|
}
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
428
|
-
|
|
430
|
+
if (v === "comments") {
|
|
431
|
+
const w = r.get("addComment"), E = r.get("toggleComments");
|
|
432
|
+
w && p.push({
|
|
429
433
|
id: "addComment",
|
|
430
|
-
label:
|
|
431
|
-
command:
|
|
432
|
-
icon:
|
|
433
|
-
type:
|
|
434
|
-
options:
|
|
435
|
-
}),
|
|
434
|
+
label: w.label,
|
|
435
|
+
command: w.command,
|
|
436
|
+
icon: w.icon,
|
|
437
|
+
type: w.type || "button",
|
|
438
|
+
options: w.options
|
|
439
|
+
}), E && p.push({
|
|
436
440
|
id: "toggleComments",
|
|
437
|
-
label:
|
|
438
|
-
command:
|
|
439
|
-
icon:
|
|
440
|
-
type:
|
|
441
|
-
options:
|
|
441
|
+
label: E.label,
|
|
442
|
+
command: E.command,
|
|
443
|
+
icon: E.icon,
|
|
444
|
+
type: E.type || "button",
|
|
445
|
+
options: E.options
|
|
442
446
|
});
|
|
443
447
|
return;
|
|
444
448
|
}
|
|
445
|
-
const
|
|
446
|
-
let
|
|
447
|
-
|
|
448
|
-
id:
|
|
449
|
-
label:
|
|
450
|
-
command:
|
|
451
|
-
icon:
|
|
452
|
-
type:
|
|
453
|
-
options:
|
|
454
|
-
items:
|
|
449
|
+
const A = l[v] || v;
|
|
450
|
+
let C = r.get(A);
|
|
451
|
+
C || (C = r.get(v)), C && p.push({
|
|
452
|
+
id: v,
|
|
453
|
+
label: C.label,
|
|
454
|
+
command: C.command,
|
|
455
|
+
icon: C.icon,
|
|
456
|
+
type: C.type === "separator" ? "separator" : C.type || "button",
|
|
457
|
+
options: C.options,
|
|
458
|
+
items: C.items
|
|
455
459
|
});
|
|
456
|
-
}),
|
|
460
|
+
}), p.length > 0 && e.push(p);
|
|
457
461
|
}), e;
|
|
458
462
|
}
|
|
459
463
|
/**
|
|
@@ -467,16 +471,60 @@ class R {
|
|
|
467
471
|
*/
|
|
468
472
|
render(t) {
|
|
469
473
|
this.container = t, t.innerHTML = "", t.className = "editora-toolbar", this.config.sticky && t.classList.add("editora-toolbar-sticky"), this.config.position && t.classList.add(`editora-toolbar-${this.config.position}`);
|
|
470
|
-
const e =
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
474
|
+
const e = document.createElement("div");
|
|
475
|
+
e.className = "editora-toolbar-items-container", this.itemsContainer = e, this.overflowUnits = [];
|
|
476
|
+
const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
|
|
477
|
+
i.forEach((r, l) => {
|
|
478
|
+
const c = document.createElement("div");
|
|
479
|
+
if (c.className = "editora-toolbar-group", r.forEach((p) => {
|
|
480
|
+
this.appendToolbarButton(c, p);
|
|
481
|
+
const m = c.lastElementChild;
|
|
482
|
+
m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
|
|
483
|
+
}), e.appendChild(c), l < i.length - 1) {
|
|
484
|
+
const p = document.createElement("div");
|
|
485
|
+
p.className = "editora-toolbar-separator", e.appendChild(p);
|
|
478
486
|
}
|
|
479
|
-
});
|
|
487
|
+
}), t.appendChild(e), this.setupOverflow(t);
|
|
488
|
+
}
|
|
489
|
+
/** Measures top-level items in `itemsContainer` and moves whatever doesn't
|
|
490
|
+
* fit into a collapsible "more options" row, re-measuring on resize. */
|
|
491
|
+
setupOverflow(t) {
|
|
492
|
+
if (!this.itemsContainer || typeof ResizeObserver == "undefined") return;
|
|
493
|
+
const o = document.createElement("button");
|
|
494
|
+
o.type = "button", o.className = "editora-toolbar-more-button", o.title = "Show more options", o.setAttribute("aria-label", "More toolbar options"), o.textContent = "☰", o.style.display = "none", o.addEventListener("click", (c) => {
|
|
495
|
+
c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
|
|
496
|
+
}), this.moreButton = o, t.appendChild(o);
|
|
497
|
+
const i = document.createElement("div");
|
|
498
|
+
i.className = "editora-toolbar-expanded-row", this.expandedRow = i, t.appendChild(i), document.addEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0);
|
|
499
|
+
const r = () => {
|
|
500
|
+
const c = this.overflowUnits;
|
|
501
|
+
if (c.length === 0) return;
|
|
502
|
+
c.forEach((D) => {
|
|
503
|
+
var P;
|
|
504
|
+
D.parentElement === i && ((P = this.overflowUnitHomes.get(D)) == null || P.appendChild(D));
|
|
505
|
+
});
|
|
506
|
+
const p = t.clientWidth, m = 16, v = 40, A = 4, C = Math.max(0, p - m - v - A);
|
|
507
|
+
let w = 0, E = 0;
|
|
508
|
+
for (const D of c) {
|
|
509
|
+
const P = D.getBoundingClientRect().width + A;
|
|
510
|
+
if (w + P <= C)
|
|
511
|
+
w += P, E++;
|
|
512
|
+
else
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
E = Math.max(1, Math.min(E, c.length));
|
|
516
|
+
const Y = E < c.length;
|
|
517
|
+
o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, P) => {
|
|
518
|
+
P >= E && i.appendChild(D);
|
|
519
|
+
});
|
|
520
|
+
}, l = () => {
|
|
521
|
+
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
522
|
+
};
|
|
523
|
+
this.resizeObserver = new ResizeObserver(() => l()), this.resizeObserver.observe(t), l();
|
|
524
|
+
}
|
|
525
|
+
setExpandedOpen(t) {
|
|
526
|
+
var e, o;
|
|
527
|
+
this.expandedOpen = t, (e = this.expandedRow) == null || e.classList.toggle("show", t), (o = this.moreButton) == null || o.classList.toggle("active", t);
|
|
480
528
|
}
|
|
481
529
|
/**
|
|
482
530
|
* Append a toolbar button or group to a parent element
|
|
@@ -509,15 +557,15 @@ class R {
|
|
|
509
557
|
const e = document.createElement("div"), o = t.label.toLowerCase().replace(/\s+/g, "-");
|
|
510
558
|
if (e.className = `editora-toolbar-group-button ${o}`, e.title = t.label, t.icon)
|
|
511
559
|
if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
|
|
512
|
-
const
|
|
513
|
-
|
|
560
|
+
const i = document.createElement("span");
|
|
561
|
+
i.className = "editora-toolbar-icon", i.innerHTML = t.icon, e.appendChild(i);
|
|
514
562
|
} else
|
|
515
563
|
e.innerHTML = t.icon;
|
|
516
564
|
if (t.items && t.items.length) {
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
this.appendToolbarButton(
|
|
520
|
-
}), e.appendChild(
|
|
565
|
+
const i = document.createElement("div");
|
|
566
|
+
i.className = `editora-toolbar-group-items ${o}`, t.items.forEach((r) => {
|
|
567
|
+
this.appendToolbarButton(i, r);
|
|
568
|
+
}), e.appendChild(i);
|
|
521
569
|
}
|
|
522
570
|
return e;
|
|
523
571
|
}
|
|
@@ -555,25 +603,25 @@ class R {
|
|
|
555
603
|
e.className = "editora-toolbar-dropdown";
|
|
556
604
|
const o = document.createElement("button");
|
|
557
605
|
o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}),
|
|
564
|
-
}), o.addEventListener("click", (
|
|
565
|
-
|
|
566
|
-
const
|
|
567
|
-
|
|
606
|
+
const i = document.createElement("div");
|
|
607
|
+
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
608
|
+
const p = document.createElement("button");
|
|
609
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
610
|
+
m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
611
|
+
}), i.appendChild(p);
|
|
612
|
+
}), o.addEventListener("click", (c) => {
|
|
613
|
+
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
614
|
+
const p = i.style.display === "block";
|
|
615
|
+
i.style.display = p ? "none" : "block";
|
|
568
616
|
});
|
|
569
|
-
const
|
|
570
|
-
e.contains(
|
|
571
|
-
},
|
|
572
|
-
|
|
617
|
+
const r = (c) => {
|
|
618
|
+
e.contains(c.target) || (i.style.display = "none");
|
|
619
|
+
}, l = (c) => {
|
|
620
|
+
c.key === "Escape" && (i.style.display = "none");
|
|
573
621
|
};
|
|
574
|
-
return document.addEventListener("mousedown",
|
|
575
|
-
document.removeEventListener("mousedown",
|
|
576
|
-
}, e.appendChild(o), e.appendChild(
|
|
622
|
+
return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
|
|
623
|
+
document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
|
|
624
|
+
}, e.appendChild(o), e.appendChild(i), e;
|
|
577
625
|
}
|
|
578
626
|
/**
|
|
579
627
|
* Create an inline menu element (like dropdown but triggered by button click)
|
|
@@ -584,36 +632,36 @@ class R {
|
|
|
584
632
|
const o = document.createElement("button");
|
|
585
633
|
if (o.className = "editora-toolbar-button", o.type = "button", o.title = t.label, t.icon)
|
|
586
634
|
if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
|
|
587
|
-
const
|
|
588
|
-
|
|
635
|
+
const c = document.createElement("span");
|
|
636
|
+
c.className = "editora-toolbar-icon", c.innerHTML = t.icon, o.appendChild(c);
|
|
589
637
|
} else
|
|
590
638
|
o.innerHTML = t.icon;
|
|
591
639
|
else
|
|
592
640
|
o.textContent = t.label;
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}),
|
|
599
|
-
}), o.addEventListener("click", (
|
|
600
|
-
var
|
|
601
|
-
|
|
602
|
-
const
|
|
641
|
+
const i = document.createElement("div");
|
|
642
|
+
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
643
|
+
const p = document.createElement("button");
|
|
644
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
645
|
+
m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
646
|
+
}), i.appendChild(p);
|
|
647
|
+
}), o.addEventListener("click", (c) => {
|
|
648
|
+
var m;
|
|
649
|
+
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
650
|
+
const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
603
651
|
".editora-toolbar-dropdown-menu"
|
|
604
652
|
);
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}),
|
|
653
|
+
p == null || p.forEach((v) => {
|
|
654
|
+
v !== i && (v.style.display = "none");
|
|
655
|
+
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
608
656
|
});
|
|
609
|
-
const
|
|
610
|
-
e.contains(
|
|
611
|
-
},
|
|
612
|
-
|
|
657
|
+
const r = (c) => {
|
|
658
|
+
e.contains(c.target) || (i.style.display = "none");
|
|
659
|
+
}, l = (c) => {
|
|
660
|
+
c.key === "Escape" && (i.style.display = "none");
|
|
613
661
|
};
|
|
614
|
-
return document.addEventListener("mousedown",
|
|
615
|
-
document.removeEventListener("mousedown",
|
|
616
|
-
}, e.appendChild(o), e.appendChild(
|
|
662
|
+
return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
|
|
663
|
+
document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
|
|
664
|
+
}, e.appendChild(o), e.appendChild(i), e;
|
|
617
665
|
}
|
|
618
666
|
/**
|
|
619
667
|
* Get default toolbar string if none provided
|
|
@@ -635,13 +683,14 @@ class R {
|
|
|
635
683
|
* Destroy toolbar
|
|
636
684
|
*/
|
|
637
685
|
destroy() {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
686
|
+
var t;
|
|
687
|
+
this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((o) => {
|
|
688
|
+
const i = o._cleanupDropdown;
|
|
689
|
+
i && i();
|
|
690
|
+
}), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
|
|
642
691
|
}
|
|
643
692
|
}
|
|
644
|
-
class
|
|
693
|
+
class un {
|
|
645
694
|
constructor(t) {
|
|
646
695
|
this.visible = !1, this.config = t;
|
|
647
696
|
}
|
|
@@ -683,7 +732,7 @@ class H {
|
|
|
683
732
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
684
733
|
}
|
|
685
734
|
}
|
|
686
|
-
class
|
|
735
|
+
class fn {
|
|
687
736
|
constructor(t = {}) {
|
|
688
737
|
this.statusInfo = {}, this.config = t;
|
|
689
738
|
}
|
|
@@ -712,27 +761,27 @@ class j {
|
|
|
712
761
|
e.className = "editora-statusbar-right";
|
|
713
762
|
const o = [];
|
|
714
763
|
if (this.statusInfo.selectionInfo) {
|
|
715
|
-
const
|
|
716
|
-
|
|
764
|
+
const r = this.statusInfo.selectionInfo;
|
|
765
|
+
r.startLine === r.endLine && r.startColumn === r.endColumn ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}`) : (r.startLine === r.endLine ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}-${r.endColumn}`) : o.push(`Ln ${r.startLine}:${r.startColumn} - ${r.endLine}:${r.endColumn}`), o.push(`${r.selectedChars} chars selected`));
|
|
717
766
|
} else if (this.statusInfo.cursorPosition) {
|
|
718
|
-
const
|
|
719
|
-
o.push(`Ln ${
|
|
767
|
+
const r = this.statusInfo.cursorPosition;
|
|
768
|
+
o.push(`Ln ${r.line}, Col ${r.column}`);
|
|
720
769
|
}
|
|
721
770
|
this.statusInfo.language && o.push(this.statusInfo.language);
|
|
722
|
-
const
|
|
723
|
-
this.statusInfo.wordCount !== void 0 &&
|
|
724
|
-
|
|
725
|
-
}), o.forEach((
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
const
|
|
729
|
-
|
|
771
|
+
const i = [];
|
|
772
|
+
this.statusInfo.wordCount !== void 0 && i.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && i.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && i.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([r, l]) => {
|
|
773
|
+
i.push(`${r}: ${l}`);
|
|
774
|
+
}), o.forEach((r, l) => {
|
|
775
|
+
const c = document.createElement("span");
|
|
776
|
+
if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
|
|
777
|
+
const p = document.createElement("span");
|
|
778
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
|
|
730
779
|
}
|
|
731
|
-
}),
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
const
|
|
735
|
-
|
|
780
|
+
}), i.forEach((r, l) => {
|
|
781
|
+
const c = document.createElement("span");
|
|
782
|
+
if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
|
|
783
|
+
const p = document.createElement("span");
|
|
784
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
|
|
736
785
|
}
|
|
737
786
|
}), this.container.appendChild(t), this.container.appendChild(e);
|
|
738
787
|
}
|
|
@@ -743,49 +792,49 @@ class j {
|
|
|
743
792
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
744
793
|
}
|
|
745
794
|
}
|
|
746
|
-
function
|
|
747
|
-
const e = a.textContent || "", o =
|
|
748
|
-
`),
|
|
749
|
-
return { line:
|
|
795
|
+
function pn(a, t) {
|
|
796
|
+
const e = a.textContent || "", o = hn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
797
|
+
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
798
|
+
return { line: l, column: c };
|
|
750
799
|
}
|
|
751
|
-
function
|
|
752
|
-
var
|
|
800
|
+
function hn(a, t, e) {
|
|
801
|
+
var l;
|
|
753
802
|
let o = 0;
|
|
754
|
-
const
|
|
803
|
+
const i = document.createTreeWalker(
|
|
755
804
|
a,
|
|
756
805
|
NodeFilter.SHOW_TEXT,
|
|
757
806
|
null
|
|
758
807
|
);
|
|
759
|
-
let
|
|
760
|
-
for (;
|
|
761
|
-
if (
|
|
808
|
+
let r = i.firstChild();
|
|
809
|
+
for (; r; ) {
|
|
810
|
+
if (r === t) {
|
|
762
811
|
o += e;
|
|
763
812
|
break;
|
|
764
|
-
} else
|
|
765
|
-
|
|
813
|
+
} else r.nodeType === Node.TEXT_NODE && (o += ((l = r.textContent) == null ? void 0 : l.length) || 0);
|
|
814
|
+
r = i.nextNode();
|
|
766
815
|
}
|
|
767
816
|
return o;
|
|
768
817
|
}
|
|
769
|
-
function
|
|
770
|
-
var o,
|
|
818
|
+
function mn(a) {
|
|
819
|
+
var o, i;
|
|
771
820
|
const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
772
821
|
let e = 1;
|
|
773
822
|
if (t.length > 0) {
|
|
774
823
|
e = t.length;
|
|
775
|
-
const
|
|
776
|
-
(
|
|
824
|
+
const r = t[t.length - 1];
|
|
825
|
+
(r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
|
|
777
826
|
} else {
|
|
778
|
-
const
|
|
827
|
+
const l = (a.textContent || "").split(`
|
|
779
828
|
`).length;
|
|
780
|
-
e = Math.max(1,
|
|
829
|
+
e = Math.max(1, l);
|
|
781
830
|
}
|
|
782
831
|
return e;
|
|
783
832
|
}
|
|
784
|
-
function
|
|
833
|
+
function gn(a) {
|
|
785
834
|
const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
|
|
786
835
|
return { words: t, chars: e };
|
|
787
836
|
}
|
|
788
|
-
function
|
|
837
|
+
function bn(a, t) {
|
|
789
838
|
const e = a.toString();
|
|
790
839
|
return {
|
|
791
840
|
startLine: t.line,
|
|
@@ -797,7 +846,7 @@ function U(a, t) {
|
|
|
797
846
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
798
847
|
};
|
|
799
848
|
}
|
|
800
|
-
class
|
|
849
|
+
class yn {
|
|
801
850
|
constructor(t) {
|
|
802
851
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
803
852
|
this.registerShortcut(e);
|
|
@@ -1084,8 +1133,8 @@ class K {
|
|
|
1084
1133
|
}
|
|
1085
1134
|
handleKeyDown(t, e) {
|
|
1086
1135
|
if (!this.enabled) return !1;
|
|
1087
|
-
const o = this.getEventKey(t),
|
|
1088
|
-
return
|
|
1136
|
+
const o = this.getEventKey(t), i = this.shortcuts.get(o);
|
|
1137
|
+
return i ? (i.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(i.command, i.params), !0) : !1;
|
|
1089
1138
|
}
|
|
1090
1139
|
enable() {
|
|
1091
1140
|
this.enabled = !0;
|
|
@@ -1110,19 +1159,19 @@ class K {
|
|
|
1110
1159
|
}
|
|
1111
1160
|
getShortcutsHelp() {
|
|
1112
1161
|
const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
|
|
1113
|
-
t.forEach((
|
|
1114
|
-
const
|
|
1115
|
-
e.has(
|
|
1162
|
+
t.forEach((i) => {
|
|
1163
|
+
const r = this.getShortcutCategory(i.command);
|
|
1164
|
+
e.has(r) || e.set(r, []), e.get(r).push(i);
|
|
1116
1165
|
});
|
|
1117
1166
|
let o = `# Keyboard Shortcuts
|
|
1118
1167
|
|
|
1119
1168
|
`;
|
|
1120
|
-
return e.forEach((
|
|
1121
|
-
o += `## ${
|
|
1169
|
+
return e.forEach((i, r) => {
|
|
1170
|
+
o += `## ${r}
|
|
1122
1171
|
|
|
1123
|
-
`,
|
|
1124
|
-
const
|
|
1125
|
-
o += `- **${
|
|
1172
|
+
`, i.forEach((l) => {
|
|
1173
|
+
const c = this.getShortcutDescription(l);
|
|
1174
|
+
o += `- **${c}**: ${l.description || l.command}
|
|
1126
1175
|
`;
|
|
1127
1176
|
}), o += `
|
|
1128
1177
|
`;
|
|
@@ -1132,7 +1181,1484 @@ class K {
|
|
|
1132
1181
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
1133
1182
|
}
|
|
1134
1183
|
}
|
|
1135
|
-
|
|
1184
|
+
function io(a, t) {
|
|
1185
|
+
(t == null || t > a.length) && (t = a.length);
|
|
1186
|
+
for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
|
|
1187
|
+
return o;
|
|
1188
|
+
}
|
|
1189
|
+
function En(a) {
|
|
1190
|
+
if (Array.isArray(a)) return a;
|
|
1191
|
+
}
|
|
1192
|
+
function vn(a, t) {
|
|
1193
|
+
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1194
|
+
if (e != null) {
|
|
1195
|
+
var o, i, r, l, c = [], p = !0, m = !1;
|
|
1196
|
+
try {
|
|
1197
|
+
if (r = (e = e.call(a)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
|
|
1198
|
+
} catch (v) {
|
|
1199
|
+
m = !0, i = v;
|
|
1200
|
+
} finally {
|
|
1201
|
+
try {
|
|
1202
|
+
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1203
|
+
} finally {
|
|
1204
|
+
if (m) throw i;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
return c;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
function wn() {
|
|
1211
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1212
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1213
|
+
}
|
|
1214
|
+
function Tn(a, t) {
|
|
1215
|
+
return En(a) || vn(a, t) || kn(a, t) || wn();
|
|
1216
|
+
}
|
|
1217
|
+
function kn(a, t) {
|
|
1218
|
+
if (a) {
|
|
1219
|
+
if (typeof a == "string") return io(a, t);
|
|
1220
|
+
var e = {}.toString.call(a).slice(8, -1);
|
|
1221
|
+
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(a, t) : void 0;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
const Co = Object.entries, ro = Object.setPrototypeOf, xn = Object.isFrozen, An = Object.getPrototypeOf, Cn = Object.getOwnPropertyDescriptor;
|
|
1225
|
+
let M = Object.freeze, I = Object.seal, gt = Object.create, So = typeof Reflect != "undefined" && Reflect, ve = So.apply, we = So.construct;
|
|
1226
|
+
M || (M = function(t) {
|
|
1227
|
+
return t;
|
|
1228
|
+
});
|
|
1229
|
+
I || (I = function(t) {
|
|
1230
|
+
return t;
|
|
1231
|
+
});
|
|
1232
|
+
ve || (ve = function(t, e) {
|
|
1233
|
+
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1234
|
+
return t.apply(e, i);
|
|
1235
|
+
});
|
|
1236
|
+
we || (we = function(t) {
|
|
1237
|
+
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1238
|
+
return new t(...o);
|
|
1239
|
+
});
|
|
1240
|
+
const rt = L(Array.prototype.forEach), Sn = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), kt = L(Array.prototype.push), _n = L(Array.prototype.splice), bt = Array.isArray, St = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), Ln = L(String.prototype.trim), Mn = L(Number.prototype.toString), In = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = On(TypeError);
|
|
1241
|
+
function L(a) {
|
|
1242
|
+
return function(t) {
|
|
1243
|
+
t instanceof RegExp && (t.lastIndex = 0);
|
|
1244
|
+
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1245
|
+
return ve(a, t, o);
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
function On(a) {
|
|
1249
|
+
return function() {
|
|
1250
|
+
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1251
|
+
return we(a, e);
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
function y(a, t) {
|
|
1255
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
|
|
1256
|
+
if (ro && ro(a, null), !bt(t)) return a;
|
|
1257
|
+
let o = t.length;
|
|
1258
|
+
for (; o--; ) {
|
|
1259
|
+
let i = t[o];
|
|
1260
|
+
if (typeof i == "string") {
|
|
1261
|
+
const r = e(i);
|
|
1262
|
+
r !== i && (xn(t) || (t[o] = r), i = r);
|
|
1263
|
+
}
|
|
1264
|
+
a[i] = !0;
|
|
1265
|
+
}
|
|
1266
|
+
return a;
|
|
1267
|
+
}
|
|
1268
|
+
function Dn(a) {
|
|
1269
|
+
for (let t = 0; t < a.length; t++) z(a, t) || (a[t] = null);
|
|
1270
|
+
return a;
|
|
1271
|
+
}
|
|
1272
|
+
function H(a) {
|
|
1273
|
+
const t = gt(null);
|
|
1274
|
+
for (const o of Co(a)) {
|
|
1275
|
+
var e = Tn(o, 2);
|
|
1276
|
+
const i = e[0], r = e[1];
|
|
1277
|
+
z(a, i) && (bt(r) ? t[i] = Dn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = H(r) : t[i] = r);
|
|
1278
|
+
}
|
|
1279
|
+
return t;
|
|
1280
|
+
}
|
|
1281
|
+
function Rn(a) {
|
|
1282
|
+
switch (typeof a) {
|
|
1283
|
+
case "string":
|
|
1284
|
+
return a;
|
|
1285
|
+
case "number":
|
|
1286
|
+
return Mn(a);
|
|
1287
|
+
case "boolean":
|
|
1288
|
+
return In(a);
|
|
1289
|
+
case "bigint":
|
|
1290
|
+
return co ? co(a) : "0";
|
|
1291
|
+
case "symbol":
|
|
1292
|
+
return uo ? uo(a) : "Symbol()";
|
|
1293
|
+
case "undefined":
|
|
1294
|
+
return At(a);
|
|
1295
|
+
case "function":
|
|
1296
|
+
case "object": {
|
|
1297
|
+
if (a === null) return At(a);
|
|
1298
|
+
const t = a, e = j(t, "toString");
|
|
1299
|
+
if (typeof e == "function") {
|
|
1300
|
+
const o = e(t);
|
|
1301
|
+
return typeof o == "string" ? o : At(o);
|
|
1302
|
+
}
|
|
1303
|
+
return At(a);
|
|
1304
|
+
}
|
|
1305
|
+
default:
|
|
1306
|
+
return At(a);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
function j(a, t) {
|
|
1310
|
+
for (; a !== null; ) {
|
|
1311
|
+
const o = Cn(a, t);
|
|
1312
|
+
if (o) {
|
|
1313
|
+
if (o.get) return L(o.get);
|
|
1314
|
+
if (typeof o.value == "function") return L(o.value);
|
|
1315
|
+
}
|
|
1316
|
+
a = An(a);
|
|
1317
|
+
}
|
|
1318
|
+
function e() {
|
|
1319
|
+
return null;
|
|
1320
|
+
}
|
|
1321
|
+
return e;
|
|
1322
|
+
}
|
|
1323
|
+
function Pn(a) {
|
|
1324
|
+
try {
|
|
1325
|
+
return O(a, ""), !0;
|
|
1326
|
+
} catch (t) {
|
|
1327
|
+
return !1;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
const fo = M([
|
|
1331
|
+
"a",
|
|
1332
|
+
"abbr",
|
|
1333
|
+
"acronym",
|
|
1334
|
+
"address",
|
|
1335
|
+
"area",
|
|
1336
|
+
"article",
|
|
1337
|
+
"aside",
|
|
1338
|
+
"audio",
|
|
1339
|
+
"b",
|
|
1340
|
+
"bdi",
|
|
1341
|
+
"bdo",
|
|
1342
|
+
"big",
|
|
1343
|
+
"blink",
|
|
1344
|
+
"blockquote",
|
|
1345
|
+
"body",
|
|
1346
|
+
"br",
|
|
1347
|
+
"button",
|
|
1348
|
+
"canvas",
|
|
1349
|
+
"caption",
|
|
1350
|
+
"center",
|
|
1351
|
+
"cite",
|
|
1352
|
+
"code",
|
|
1353
|
+
"col",
|
|
1354
|
+
"colgroup",
|
|
1355
|
+
"content",
|
|
1356
|
+
"data",
|
|
1357
|
+
"datalist",
|
|
1358
|
+
"dd",
|
|
1359
|
+
"decorator",
|
|
1360
|
+
"del",
|
|
1361
|
+
"details",
|
|
1362
|
+
"dfn",
|
|
1363
|
+
"dialog",
|
|
1364
|
+
"dir",
|
|
1365
|
+
"div",
|
|
1366
|
+
"dl",
|
|
1367
|
+
"dt",
|
|
1368
|
+
"element",
|
|
1369
|
+
"em",
|
|
1370
|
+
"fieldset",
|
|
1371
|
+
"figcaption",
|
|
1372
|
+
"figure",
|
|
1373
|
+
"font",
|
|
1374
|
+
"footer",
|
|
1375
|
+
"form",
|
|
1376
|
+
"h1",
|
|
1377
|
+
"h2",
|
|
1378
|
+
"h3",
|
|
1379
|
+
"h4",
|
|
1380
|
+
"h5",
|
|
1381
|
+
"h6",
|
|
1382
|
+
"head",
|
|
1383
|
+
"header",
|
|
1384
|
+
"hgroup",
|
|
1385
|
+
"hr",
|
|
1386
|
+
"html",
|
|
1387
|
+
"i",
|
|
1388
|
+
"img",
|
|
1389
|
+
"input",
|
|
1390
|
+
"ins",
|
|
1391
|
+
"kbd",
|
|
1392
|
+
"label",
|
|
1393
|
+
"legend",
|
|
1394
|
+
"li",
|
|
1395
|
+
"main",
|
|
1396
|
+
"map",
|
|
1397
|
+
"mark",
|
|
1398
|
+
"marquee",
|
|
1399
|
+
"menu",
|
|
1400
|
+
"menuitem",
|
|
1401
|
+
"meter",
|
|
1402
|
+
"nav",
|
|
1403
|
+
"nobr",
|
|
1404
|
+
"ol",
|
|
1405
|
+
"optgroup",
|
|
1406
|
+
"option",
|
|
1407
|
+
"output",
|
|
1408
|
+
"p",
|
|
1409
|
+
"picture",
|
|
1410
|
+
"pre",
|
|
1411
|
+
"progress",
|
|
1412
|
+
"q",
|
|
1413
|
+
"rp",
|
|
1414
|
+
"rt",
|
|
1415
|
+
"ruby",
|
|
1416
|
+
"s",
|
|
1417
|
+
"samp",
|
|
1418
|
+
"search",
|
|
1419
|
+
"section",
|
|
1420
|
+
"select",
|
|
1421
|
+
"shadow",
|
|
1422
|
+
"slot",
|
|
1423
|
+
"small",
|
|
1424
|
+
"source",
|
|
1425
|
+
"spacer",
|
|
1426
|
+
"span",
|
|
1427
|
+
"strike",
|
|
1428
|
+
"strong",
|
|
1429
|
+
"style",
|
|
1430
|
+
"sub",
|
|
1431
|
+
"summary",
|
|
1432
|
+
"sup",
|
|
1433
|
+
"table",
|
|
1434
|
+
"tbody",
|
|
1435
|
+
"td",
|
|
1436
|
+
"template",
|
|
1437
|
+
"textarea",
|
|
1438
|
+
"tfoot",
|
|
1439
|
+
"th",
|
|
1440
|
+
"thead",
|
|
1441
|
+
"time",
|
|
1442
|
+
"tr",
|
|
1443
|
+
"track",
|
|
1444
|
+
"tt",
|
|
1445
|
+
"u",
|
|
1446
|
+
"ul",
|
|
1447
|
+
"var",
|
|
1448
|
+
"video",
|
|
1449
|
+
"wbr"
|
|
1450
|
+
]), pe = M([
|
|
1451
|
+
"svg",
|
|
1452
|
+
"a",
|
|
1453
|
+
"altglyph",
|
|
1454
|
+
"altglyphdef",
|
|
1455
|
+
"altglyphitem",
|
|
1456
|
+
"animatecolor",
|
|
1457
|
+
"animatemotion",
|
|
1458
|
+
"animatetransform",
|
|
1459
|
+
"circle",
|
|
1460
|
+
"clippath",
|
|
1461
|
+
"defs",
|
|
1462
|
+
"desc",
|
|
1463
|
+
"ellipse",
|
|
1464
|
+
"enterkeyhint",
|
|
1465
|
+
"exportparts",
|
|
1466
|
+
"filter",
|
|
1467
|
+
"font",
|
|
1468
|
+
"g",
|
|
1469
|
+
"glyph",
|
|
1470
|
+
"glyphref",
|
|
1471
|
+
"hkern",
|
|
1472
|
+
"image",
|
|
1473
|
+
"inputmode",
|
|
1474
|
+
"line",
|
|
1475
|
+
"lineargradient",
|
|
1476
|
+
"marker",
|
|
1477
|
+
"mask",
|
|
1478
|
+
"metadata",
|
|
1479
|
+
"mpath",
|
|
1480
|
+
"part",
|
|
1481
|
+
"path",
|
|
1482
|
+
"pattern",
|
|
1483
|
+
"polygon",
|
|
1484
|
+
"polyline",
|
|
1485
|
+
"radialgradient",
|
|
1486
|
+
"rect",
|
|
1487
|
+
"stop",
|
|
1488
|
+
"style",
|
|
1489
|
+
"switch",
|
|
1490
|
+
"symbol",
|
|
1491
|
+
"text",
|
|
1492
|
+
"textpath",
|
|
1493
|
+
"title",
|
|
1494
|
+
"tref",
|
|
1495
|
+
"tspan",
|
|
1496
|
+
"view",
|
|
1497
|
+
"vkern"
|
|
1498
|
+
]), he = M([
|
|
1499
|
+
"feBlend",
|
|
1500
|
+
"feColorMatrix",
|
|
1501
|
+
"feComponentTransfer",
|
|
1502
|
+
"feComposite",
|
|
1503
|
+
"feConvolveMatrix",
|
|
1504
|
+
"feDiffuseLighting",
|
|
1505
|
+
"feDisplacementMap",
|
|
1506
|
+
"feDistantLight",
|
|
1507
|
+
"feDropShadow",
|
|
1508
|
+
"feFlood",
|
|
1509
|
+
"feFuncA",
|
|
1510
|
+
"feFuncB",
|
|
1511
|
+
"feFuncG",
|
|
1512
|
+
"feFuncR",
|
|
1513
|
+
"feGaussianBlur",
|
|
1514
|
+
"feImage",
|
|
1515
|
+
"feMerge",
|
|
1516
|
+
"feMergeNode",
|
|
1517
|
+
"feMorphology",
|
|
1518
|
+
"feOffset",
|
|
1519
|
+
"fePointLight",
|
|
1520
|
+
"feSpecularLighting",
|
|
1521
|
+
"feSpotLight",
|
|
1522
|
+
"feTile",
|
|
1523
|
+
"feTurbulence"
|
|
1524
|
+
]), Nn = M([
|
|
1525
|
+
"animate",
|
|
1526
|
+
"color-profile",
|
|
1527
|
+
"cursor",
|
|
1528
|
+
"discard",
|
|
1529
|
+
"font-face",
|
|
1530
|
+
"font-face-format",
|
|
1531
|
+
"font-face-name",
|
|
1532
|
+
"font-face-src",
|
|
1533
|
+
"font-face-uri",
|
|
1534
|
+
"foreignobject",
|
|
1535
|
+
"hatch",
|
|
1536
|
+
"hatchpath",
|
|
1537
|
+
"mesh",
|
|
1538
|
+
"meshgradient",
|
|
1539
|
+
"meshpatch",
|
|
1540
|
+
"meshrow",
|
|
1541
|
+
"missing-glyph",
|
|
1542
|
+
"script",
|
|
1543
|
+
"set",
|
|
1544
|
+
"solidcolor",
|
|
1545
|
+
"unknown",
|
|
1546
|
+
"use"
|
|
1547
|
+
]), me = M([
|
|
1548
|
+
"math",
|
|
1549
|
+
"menclose",
|
|
1550
|
+
"merror",
|
|
1551
|
+
"mfenced",
|
|
1552
|
+
"mfrac",
|
|
1553
|
+
"mglyph",
|
|
1554
|
+
"mi",
|
|
1555
|
+
"mlabeledtr",
|
|
1556
|
+
"mmultiscripts",
|
|
1557
|
+
"mn",
|
|
1558
|
+
"mo",
|
|
1559
|
+
"mover",
|
|
1560
|
+
"mpadded",
|
|
1561
|
+
"mphantom",
|
|
1562
|
+
"mroot",
|
|
1563
|
+
"mrow",
|
|
1564
|
+
"ms",
|
|
1565
|
+
"mspace",
|
|
1566
|
+
"msqrt",
|
|
1567
|
+
"mstyle",
|
|
1568
|
+
"msub",
|
|
1569
|
+
"msup",
|
|
1570
|
+
"msubsup",
|
|
1571
|
+
"mtable",
|
|
1572
|
+
"mtd",
|
|
1573
|
+
"mtext",
|
|
1574
|
+
"mtr",
|
|
1575
|
+
"munder",
|
|
1576
|
+
"munderover",
|
|
1577
|
+
"mprescripts"
|
|
1578
|
+
]), zn = M([
|
|
1579
|
+
"maction",
|
|
1580
|
+
"maligngroup",
|
|
1581
|
+
"malignmark",
|
|
1582
|
+
"mlongdiv",
|
|
1583
|
+
"mscarries",
|
|
1584
|
+
"mscarry",
|
|
1585
|
+
"msgroup",
|
|
1586
|
+
"mstack",
|
|
1587
|
+
"msline",
|
|
1588
|
+
"msrow",
|
|
1589
|
+
"semantics",
|
|
1590
|
+
"annotation",
|
|
1591
|
+
"annotation-xml",
|
|
1592
|
+
"mprescripts",
|
|
1593
|
+
"none"
|
|
1594
|
+
]), po = M(["#text"]), ho = M([
|
|
1595
|
+
"accept",
|
|
1596
|
+
"action",
|
|
1597
|
+
"align",
|
|
1598
|
+
"alt",
|
|
1599
|
+
"autocapitalize",
|
|
1600
|
+
"autocomplete",
|
|
1601
|
+
"autopictureinpicture",
|
|
1602
|
+
"autoplay",
|
|
1603
|
+
"background",
|
|
1604
|
+
"bgcolor",
|
|
1605
|
+
"border",
|
|
1606
|
+
"capture",
|
|
1607
|
+
"cellpadding",
|
|
1608
|
+
"cellspacing",
|
|
1609
|
+
"checked",
|
|
1610
|
+
"cite",
|
|
1611
|
+
"class",
|
|
1612
|
+
"clear",
|
|
1613
|
+
"color",
|
|
1614
|
+
"cols",
|
|
1615
|
+
"colspan",
|
|
1616
|
+
"command",
|
|
1617
|
+
"commandfor",
|
|
1618
|
+
"controls",
|
|
1619
|
+
"controlslist",
|
|
1620
|
+
"coords",
|
|
1621
|
+
"crossorigin",
|
|
1622
|
+
"datetime",
|
|
1623
|
+
"decoding",
|
|
1624
|
+
"default",
|
|
1625
|
+
"dir",
|
|
1626
|
+
"disabled",
|
|
1627
|
+
"disablepictureinpicture",
|
|
1628
|
+
"disableremoteplayback",
|
|
1629
|
+
"download",
|
|
1630
|
+
"draggable",
|
|
1631
|
+
"enctype",
|
|
1632
|
+
"enterkeyhint",
|
|
1633
|
+
"exportparts",
|
|
1634
|
+
"face",
|
|
1635
|
+
"for",
|
|
1636
|
+
"headers",
|
|
1637
|
+
"height",
|
|
1638
|
+
"hidden",
|
|
1639
|
+
"high",
|
|
1640
|
+
"href",
|
|
1641
|
+
"hreflang",
|
|
1642
|
+
"id",
|
|
1643
|
+
"inert",
|
|
1644
|
+
"inputmode",
|
|
1645
|
+
"integrity",
|
|
1646
|
+
"ismap",
|
|
1647
|
+
"kind",
|
|
1648
|
+
"label",
|
|
1649
|
+
"lang",
|
|
1650
|
+
"list",
|
|
1651
|
+
"loading",
|
|
1652
|
+
"loop",
|
|
1653
|
+
"low",
|
|
1654
|
+
"max",
|
|
1655
|
+
"maxlength",
|
|
1656
|
+
"media",
|
|
1657
|
+
"method",
|
|
1658
|
+
"min",
|
|
1659
|
+
"minlength",
|
|
1660
|
+
"multiple",
|
|
1661
|
+
"muted",
|
|
1662
|
+
"name",
|
|
1663
|
+
"nonce",
|
|
1664
|
+
"noshade",
|
|
1665
|
+
"novalidate",
|
|
1666
|
+
"nowrap",
|
|
1667
|
+
"open",
|
|
1668
|
+
"optimum",
|
|
1669
|
+
"part",
|
|
1670
|
+
"pattern",
|
|
1671
|
+
"placeholder",
|
|
1672
|
+
"playsinline",
|
|
1673
|
+
"popover",
|
|
1674
|
+
"popovertarget",
|
|
1675
|
+
"popovertargetaction",
|
|
1676
|
+
"poster",
|
|
1677
|
+
"preload",
|
|
1678
|
+
"pubdate",
|
|
1679
|
+
"radiogroup",
|
|
1680
|
+
"readonly",
|
|
1681
|
+
"rel",
|
|
1682
|
+
"required",
|
|
1683
|
+
"rev",
|
|
1684
|
+
"reversed",
|
|
1685
|
+
"role",
|
|
1686
|
+
"rows",
|
|
1687
|
+
"rowspan",
|
|
1688
|
+
"spellcheck",
|
|
1689
|
+
"scope",
|
|
1690
|
+
"selected",
|
|
1691
|
+
"shape",
|
|
1692
|
+
"size",
|
|
1693
|
+
"sizes",
|
|
1694
|
+
"slot",
|
|
1695
|
+
"span",
|
|
1696
|
+
"srclang",
|
|
1697
|
+
"start",
|
|
1698
|
+
"src",
|
|
1699
|
+
"srcset",
|
|
1700
|
+
"step",
|
|
1701
|
+
"style",
|
|
1702
|
+
"summary",
|
|
1703
|
+
"tabindex",
|
|
1704
|
+
"title",
|
|
1705
|
+
"translate",
|
|
1706
|
+
"type",
|
|
1707
|
+
"usemap",
|
|
1708
|
+
"valign",
|
|
1709
|
+
"value",
|
|
1710
|
+
"width",
|
|
1711
|
+
"wrap",
|
|
1712
|
+
"xmlns"
|
|
1713
|
+
]), ge = M([
|
|
1714
|
+
"accent-height",
|
|
1715
|
+
"accumulate",
|
|
1716
|
+
"additive",
|
|
1717
|
+
"alignment-baseline",
|
|
1718
|
+
"amplitude",
|
|
1719
|
+
"ascent",
|
|
1720
|
+
"attributename",
|
|
1721
|
+
"attributetype",
|
|
1722
|
+
"azimuth",
|
|
1723
|
+
"basefrequency",
|
|
1724
|
+
"baseline-shift",
|
|
1725
|
+
"begin",
|
|
1726
|
+
"bias",
|
|
1727
|
+
"by",
|
|
1728
|
+
"class",
|
|
1729
|
+
"clip",
|
|
1730
|
+
"clippathunits",
|
|
1731
|
+
"clip-path",
|
|
1732
|
+
"clip-rule",
|
|
1733
|
+
"color",
|
|
1734
|
+
"color-interpolation",
|
|
1735
|
+
"color-interpolation-filters",
|
|
1736
|
+
"color-profile",
|
|
1737
|
+
"color-rendering",
|
|
1738
|
+
"cx",
|
|
1739
|
+
"cy",
|
|
1740
|
+
"d",
|
|
1741
|
+
"dx",
|
|
1742
|
+
"dy",
|
|
1743
|
+
"diffuseconstant",
|
|
1744
|
+
"direction",
|
|
1745
|
+
"display",
|
|
1746
|
+
"divisor",
|
|
1747
|
+
"dominant-baseline",
|
|
1748
|
+
"dur",
|
|
1749
|
+
"edgemode",
|
|
1750
|
+
"elevation",
|
|
1751
|
+
"end",
|
|
1752
|
+
"exponent",
|
|
1753
|
+
"fill",
|
|
1754
|
+
"fill-opacity",
|
|
1755
|
+
"fill-rule",
|
|
1756
|
+
"filter",
|
|
1757
|
+
"filterunits",
|
|
1758
|
+
"flood-color",
|
|
1759
|
+
"flood-opacity",
|
|
1760
|
+
"font-family",
|
|
1761
|
+
"font-size",
|
|
1762
|
+
"font-size-adjust",
|
|
1763
|
+
"font-stretch",
|
|
1764
|
+
"font-style",
|
|
1765
|
+
"font-variant",
|
|
1766
|
+
"font-weight",
|
|
1767
|
+
"fx",
|
|
1768
|
+
"fy",
|
|
1769
|
+
"g1",
|
|
1770
|
+
"g2",
|
|
1771
|
+
"glyph-name",
|
|
1772
|
+
"glyphref",
|
|
1773
|
+
"gradientunits",
|
|
1774
|
+
"gradienttransform",
|
|
1775
|
+
"height",
|
|
1776
|
+
"href",
|
|
1777
|
+
"id",
|
|
1778
|
+
"image-rendering",
|
|
1779
|
+
"in",
|
|
1780
|
+
"in2",
|
|
1781
|
+
"intercept",
|
|
1782
|
+
"k",
|
|
1783
|
+
"k1",
|
|
1784
|
+
"k2",
|
|
1785
|
+
"k3",
|
|
1786
|
+
"k4",
|
|
1787
|
+
"kerning",
|
|
1788
|
+
"keypoints",
|
|
1789
|
+
"keysplines",
|
|
1790
|
+
"keytimes",
|
|
1791
|
+
"lang",
|
|
1792
|
+
"lengthadjust",
|
|
1793
|
+
"letter-spacing",
|
|
1794
|
+
"kernelmatrix",
|
|
1795
|
+
"kernelunitlength",
|
|
1796
|
+
"lighting-color",
|
|
1797
|
+
"local",
|
|
1798
|
+
"marker-end",
|
|
1799
|
+
"marker-mid",
|
|
1800
|
+
"marker-start",
|
|
1801
|
+
"markerheight",
|
|
1802
|
+
"markerunits",
|
|
1803
|
+
"markerwidth",
|
|
1804
|
+
"maskcontentunits",
|
|
1805
|
+
"maskunits",
|
|
1806
|
+
"max",
|
|
1807
|
+
"mask",
|
|
1808
|
+
"mask-type",
|
|
1809
|
+
"media",
|
|
1810
|
+
"method",
|
|
1811
|
+
"mode",
|
|
1812
|
+
"min",
|
|
1813
|
+
"name",
|
|
1814
|
+
"numoctaves",
|
|
1815
|
+
"offset",
|
|
1816
|
+
"operator",
|
|
1817
|
+
"opacity",
|
|
1818
|
+
"order",
|
|
1819
|
+
"orient",
|
|
1820
|
+
"orientation",
|
|
1821
|
+
"origin",
|
|
1822
|
+
"overflow",
|
|
1823
|
+
"paint-order",
|
|
1824
|
+
"path",
|
|
1825
|
+
"pathlength",
|
|
1826
|
+
"patterncontentunits",
|
|
1827
|
+
"patterntransform",
|
|
1828
|
+
"patternunits",
|
|
1829
|
+
"pointer-events",
|
|
1830
|
+
"points",
|
|
1831
|
+
"preservealpha",
|
|
1832
|
+
"preserveaspectratio",
|
|
1833
|
+
"primitiveunits",
|
|
1834
|
+
"r",
|
|
1835
|
+
"rx",
|
|
1836
|
+
"ry",
|
|
1837
|
+
"radius",
|
|
1838
|
+
"refx",
|
|
1839
|
+
"refy",
|
|
1840
|
+
"repeatcount",
|
|
1841
|
+
"repeatdur",
|
|
1842
|
+
"restart",
|
|
1843
|
+
"result",
|
|
1844
|
+
"rotate",
|
|
1845
|
+
"scale",
|
|
1846
|
+
"seed",
|
|
1847
|
+
"shape-rendering",
|
|
1848
|
+
"slope",
|
|
1849
|
+
"specularconstant",
|
|
1850
|
+
"specularexponent",
|
|
1851
|
+
"spreadmethod",
|
|
1852
|
+
"startoffset",
|
|
1853
|
+
"stddeviation",
|
|
1854
|
+
"stitchtiles",
|
|
1855
|
+
"stop-color",
|
|
1856
|
+
"stop-opacity",
|
|
1857
|
+
"stroke-dasharray",
|
|
1858
|
+
"stroke-dashoffset",
|
|
1859
|
+
"stroke-linecap",
|
|
1860
|
+
"stroke-linejoin",
|
|
1861
|
+
"stroke-miterlimit",
|
|
1862
|
+
"stroke-opacity",
|
|
1863
|
+
"stroke",
|
|
1864
|
+
"stroke-width",
|
|
1865
|
+
"style",
|
|
1866
|
+
"surfacescale",
|
|
1867
|
+
"systemlanguage",
|
|
1868
|
+
"tabindex",
|
|
1869
|
+
"tablevalues",
|
|
1870
|
+
"targetx",
|
|
1871
|
+
"targety",
|
|
1872
|
+
"transform",
|
|
1873
|
+
"transform-origin",
|
|
1874
|
+
"text-anchor",
|
|
1875
|
+
"text-decoration",
|
|
1876
|
+
"text-orientation",
|
|
1877
|
+
"text-rendering",
|
|
1878
|
+
"textlength",
|
|
1879
|
+
"type",
|
|
1880
|
+
"u1",
|
|
1881
|
+
"u2",
|
|
1882
|
+
"unicode",
|
|
1883
|
+
"values",
|
|
1884
|
+
"vector-effect",
|
|
1885
|
+
"viewbox",
|
|
1886
|
+
"visibility",
|
|
1887
|
+
"version",
|
|
1888
|
+
"vert-adv-y",
|
|
1889
|
+
"vert-origin-x",
|
|
1890
|
+
"vert-origin-y",
|
|
1891
|
+
"width",
|
|
1892
|
+
"word-spacing",
|
|
1893
|
+
"wrap",
|
|
1894
|
+
"writing-mode",
|
|
1895
|
+
"xchannelselector",
|
|
1896
|
+
"ychannelselector",
|
|
1897
|
+
"x",
|
|
1898
|
+
"x1",
|
|
1899
|
+
"x2",
|
|
1900
|
+
"xmlns",
|
|
1901
|
+
"y",
|
|
1902
|
+
"y1",
|
|
1903
|
+
"y2",
|
|
1904
|
+
"z",
|
|
1905
|
+
"zoomandpan"
|
|
1906
|
+
]), mo = M([
|
|
1907
|
+
"accent",
|
|
1908
|
+
"accentunder",
|
|
1909
|
+
"align",
|
|
1910
|
+
"bevelled",
|
|
1911
|
+
"close",
|
|
1912
|
+
"columnalign",
|
|
1913
|
+
"columnlines",
|
|
1914
|
+
"columnspacing",
|
|
1915
|
+
"columnspan",
|
|
1916
|
+
"denomalign",
|
|
1917
|
+
"depth",
|
|
1918
|
+
"dir",
|
|
1919
|
+
"display",
|
|
1920
|
+
"displaystyle",
|
|
1921
|
+
"encoding",
|
|
1922
|
+
"fence",
|
|
1923
|
+
"frame",
|
|
1924
|
+
"height",
|
|
1925
|
+
"href",
|
|
1926
|
+
"id",
|
|
1927
|
+
"largeop",
|
|
1928
|
+
"length",
|
|
1929
|
+
"linethickness",
|
|
1930
|
+
"lquote",
|
|
1931
|
+
"lspace",
|
|
1932
|
+
"mathbackground",
|
|
1933
|
+
"mathcolor",
|
|
1934
|
+
"mathsize",
|
|
1935
|
+
"mathvariant",
|
|
1936
|
+
"maxsize",
|
|
1937
|
+
"minsize",
|
|
1938
|
+
"movablelimits",
|
|
1939
|
+
"notation",
|
|
1940
|
+
"numalign",
|
|
1941
|
+
"open",
|
|
1942
|
+
"rowalign",
|
|
1943
|
+
"rowlines",
|
|
1944
|
+
"rowspacing",
|
|
1945
|
+
"rowspan",
|
|
1946
|
+
"rspace",
|
|
1947
|
+
"rquote",
|
|
1948
|
+
"scriptlevel",
|
|
1949
|
+
"scriptminsize",
|
|
1950
|
+
"scriptsizemultiplier",
|
|
1951
|
+
"selection",
|
|
1952
|
+
"separator",
|
|
1953
|
+
"separators",
|
|
1954
|
+
"stretchy",
|
|
1955
|
+
"subscriptshift",
|
|
1956
|
+
"supscriptshift",
|
|
1957
|
+
"symmetric",
|
|
1958
|
+
"voffset",
|
|
1959
|
+
"width",
|
|
1960
|
+
"xmlns"
|
|
1961
|
+
]), jt = M([
|
|
1962
|
+
"xlink:href",
|
|
1963
|
+
"xml:id",
|
|
1964
|
+
"xlink:title",
|
|
1965
|
+
"xml:space",
|
|
1966
|
+
"xmlns:xlink"
|
|
1967
|
+
]), Bn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Hn = I(/\${[\w\W]*/g), Un = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), jn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Wn = I(/^(?:\w+script|data):/i), $n = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Gn = I(/^html$/i), Kn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), Yn = I(/<\/no(script|embed|frames)/i), qn = I(/\/>/i), F = {
|
|
1968
|
+
element: 1,
|
|
1969
|
+
attribute: 2,
|
|
1970
|
+
text: 3,
|
|
1971
|
+
cdataSection: 4,
|
|
1972
|
+
entityReference: 5,
|
|
1973
|
+
entityNode: 6,
|
|
1974
|
+
processingInstruction: 7,
|
|
1975
|
+
comment: 8,
|
|
1976
|
+
document: 9,
|
|
1977
|
+
documentType: 10,
|
|
1978
|
+
documentFragment: 11,
|
|
1979
|
+
notation: 12
|
|
1980
|
+
}, _o = [
|
|
1981
|
+
"style",
|
|
1982
|
+
"script",
|
|
1983
|
+
"xmp",
|
|
1984
|
+
"iframe",
|
|
1985
|
+
"noembed",
|
|
1986
|
+
"noframes",
|
|
1987
|
+
"plaintext",
|
|
1988
|
+
"noscript"
|
|
1989
|
+
], Vn = M(y({}, _o)), Xn = (function() {
|
|
1990
|
+
const a = {};
|
|
1991
|
+
return rt(_o, (t) => {
|
|
1992
|
+
a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1993
|
+
}), M(a);
|
|
1994
|
+
})(), Zn = function() {
|
|
1995
|
+
return typeof window == "undefined" ? null : window;
|
|
1996
|
+
}, Jn = function(t, e) {
|
|
1997
|
+
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
1998
|
+
let o = null;
|
|
1999
|
+
const i = "data-tt-policy-suffix";
|
|
2000
|
+
e && e.hasAttribute(i) && (o = e.getAttribute(i));
|
|
2001
|
+
const r = "dompurify" + (o ? "#" + o : "");
|
|
2002
|
+
try {
|
|
2003
|
+
return t.createPolicy(r, {
|
|
2004
|
+
createHTML(l) {
|
|
2005
|
+
return l;
|
|
2006
|
+
},
|
|
2007
|
+
createScriptURL(l) {
|
|
2008
|
+
return l;
|
|
2009
|
+
}
|
|
2010
|
+
});
|
|
2011
|
+
} catch (l) {
|
|
2012
|
+
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
2013
|
+
}
|
|
2014
|
+
}, Eo = function() {
|
|
2015
|
+
return {
|
|
2016
|
+
afterSanitizeAttributes: [],
|
|
2017
|
+
afterSanitizeElements: [],
|
|
2018
|
+
afterSanitizeShadowDOM: [],
|
|
2019
|
+
beforeSanitizeAttributes: [],
|
|
2020
|
+
beforeSanitizeElements: [],
|
|
2021
|
+
beforeSanitizeShadowDOM: [],
|
|
2022
|
+
uponSanitizeAttribute: [],
|
|
2023
|
+
uponSanitizeElement: [],
|
|
2024
|
+
uponSanitizeShadowNode: []
|
|
2025
|
+
};
|
|
2026
|
+
}, J = function(t, e, o, i) {
|
|
2027
|
+
return z(t, e) && bt(t[e]) ? y(i.base ? H(i.base) : {}, t[e], i.transform) : o;
|
|
2028
|
+
}, be = function(t, e, o) {
|
|
2029
|
+
const i = z(t, e) ? t[e] : void 0;
|
|
2030
|
+
return i && typeof i == "object" ? H(i) : o();
|
|
2031
|
+
};
|
|
2032
|
+
function Lo() {
|
|
2033
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Zn();
|
|
2034
|
+
const t = (u) => Lo(u);
|
|
2035
|
+
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
|
|
2036
|
+
return t.isSupported = !1, t;
|
|
2037
|
+
let e = a.document;
|
|
2038
|
+
const o = e, i = o.currentScript;
|
|
2039
|
+
a.DocumentFragment;
|
|
2040
|
+
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
|
|
2041
|
+
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2042
|
+
const m = a.DOMParser, v = a.trustedTypes, A = c.prototype, C = j(A, "cloneNode"), w = j(A, "remove"), E = j(A, "removeAttributeNode"), Y = j(A, "nextSibling"), D = j(A, "childNodes"), P = j(A, "parentNode"), Ae = j(A, "shadowRoot"), Yt = j(A, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, _t = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(n) {
|
|
2043
|
+
return tt ? tt(n) : n.nodeType;
|
|
2044
|
+
}, qt = function(n) {
|
|
2045
|
+
return at ? at(n) : n.nodeName;
|
|
2046
|
+
};
|
|
2047
|
+
if (typeof r == "function") {
|
|
2048
|
+
const u = e.createElement("template");
|
|
2049
|
+
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2050
|
+
}
|
|
2051
|
+
let N, et = "", Vt, Ce = !1, Et = 0;
|
|
2052
|
+
const Se = function() {
|
|
2053
|
+
if (Et > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
2054
|
+
}, st = function(n) {
|
|
2055
|
+
Se(), Et++;
|
|
2056
|
+
try {
|
|
2057
|
+
return N.createHTML(n);
|
|
2058
|
+
} finally {
|
|
2059
|
+
Et--;
|
|
2060
|
+
}
|
|
2061
|
+
}, Io = function(n) {
|
|
2062
|
+
Se(), Et++;
|
|
2063
|
+
try {
|
|
2064
|
+
return N.createScriptURL(n);
|
|
2065
|
+
} finally {
|
|
2066
|
+
Et--;
|
|
2067
|
+
}
|
|
2068
|
+
}, Oo = function() {
|
|
2069
|
+
return Ce || (Vt = Jn(v, i), Ce = !0), Vt;
|
|
2070
|
+
}, Lt = e, Xt = Lt.implementation, _e = Lt.createNodeIterator, Do = Lt.createDocumentFragment, Ro = Lt.getElementsByTagName, Po = o.importNode;
|
|
2071
|
+
let T = Eo();
|
|
2072
|
+
t.isSupported = typeof Co == "function" && typeof P == "function" && Xt && Xt.createHTMLDocument !== void 0;
|
|
2073
|
+
const No = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, Le = $n, jo = Kn;
|
|
2074
|
+
let Me = go, k = null;
|
|
2075
|
+
const Zt = y({}, [
|
|
2076
|
+
...fo,
|
|
2077
|
+
...pe,
|
|
2078
|
+
...he,
|
|
2079
|
+
...me,
|
|
2080
|
+
...po
|
|
2081
|
+
]);
|
|
2082
|
+
let x = null;
|
|
2083
|
+
const Jt = y({}, [
|
|
2084
|
+
...ho,
|
|
2085
|
+
...ge,
|
|
2086
|
+
...mo,
|
|
2087
|
+
...jt
|
|
2088
|
+
]);
|
|
2089
|
+
let W = Object.seal(gt(null, {
|
|
2090
|
+
tagNameCheck: {
|
|
2091
|
+
writable: !0,
|
|
2092
|
+
configurable: !1,
|
|
2093
|
+
enumerable: !0,
|
|
2094
|
+
value: null
|
|
2095
|
+
},
|
|
2096
|
+
attributeNameCheck: {
|
|
2097
|
+
writable: !0,
|
|
2098
|
+
configurable: !1,
|
|
2099
|
+
enumerable: !0,
|
|
2100
|
+
value: null
|
|
2101
|
+
},
|
|
2102
|
+
allowCustomizedBuiltInElements: {
|
|
2103
|
+
writable: !0,
|
|
2104
|
+
configurable: !1,
|
|
2105
|
+
enumerable: !0,
|
|
2106
|
+
value: !1
|
|
2107
|
+
}
|
|
2108
|
+
})), vt = null, Ie = null;
|
|
2109
|
+
const q = Object.seal(gt(null, {
|
|
2110
|
+
tagCheck: {
|
|
2111
|
+
writable: !0,
|
|
2112
|
+
configurable: !1,
|
|
2113
|
+
enumerable: !0,
|
|
2114
|
+
value: null
|
|
2115
|
+
},
|
|
2116
|
+
attributeCheck: {
|
|
2117
|
+
writable: !0,
|
|
2118
|
+
configurable: !1,
|
|
2119
|
+
enumerable: !0,
|
|
2120
|
+
value: null
|
|
2121
|
+
}
|
|
2122
|
+
}));
|
|
2123
|
+
let Oe = !0, Qt = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, te = !1, Mt = null, It = null, ee = !1, lt = !1, Ot = !1, Dt = !1, Pe = !0, Ne = !1;
|
|
2124
|
+
const ze = "user-content-";
|
|
2125
|
+
let oe = !0, ne = !1, ct = {}, dt = null;
|
|
2126
|
+
const Be = y({}, [
|
|
2127
|
+
"annotation-xml",
|
|
2128
|
+
"audio",
|
|
2129
|
+
"colgroup",
|
|
2130
|
+
"desc",
|
|
2131
|
+
"foreignobject",
|
|
2132
|
+
"head",
|
|
2133
|
+
"iframe",
|
|
2134
|
+
"math",
|
|
2135
|
+
"mi",
|
|
2136
|
+
"mn",
|
|
2137
|
+
"mo",
|
|
2138
|
+
"ms",
|
|
2139
|
+
"mtext",
|
|
2140
|
+
"noembed",
|
|
2141
|
+
"noframes",
|
|
2142
|
+
"noscript",
|
|
2143
|
+
"plaintext",
|
|
2144
|
+
"script",
|
|
2145
|
+
"selectedcontent",
|
|
2146
|
+
"style",
|
|
2147
|
+
"svg",
|
|
2148
|
+
"template",
|
|
2149
|
+
"thead",
|
|
2150
|
+
"title",
|
|
2151
|
+
"video",
|
|
2152
|
+
"xmp"
|
|
2153
|
+
]);
|
|
2154
|
+
let Fe = null;
|
|
2155
|
+
const He = y({}, [
|
|
2156
|
+
"audio",
|
|
2157
|
+
"video",
|
|
2158
|
+
"img",
|
|
2159
|
+
"source",
|
|
2160
|
+
"image",
|
|
2161
|
+
"track"
|
|
2162
|
+
]);
|
|
2163
|
+
let Ue = null;
|
|
2164
|
+
const je = y({}, [
|
|
2165
|
+
"alt",
|
|
2166
|
+
"class",
|
|
2167
|
+
"for",
|
|
2168
|
+
"id",
|
|
2169
|
+
"label",
|
|
2170
|
+
"name",
|
|
2171
|
+
"pattern",
|
|
2172
|
+
"placeholder",
|
|
2173
|
+
"role",
|
|
2174
|
+
"summary",
|
|
2175
|
+
"title",
|
|
2176
|
+
"value",
|
|
2177
|
+
"style",
|
|
2178
|
+
"xmlns"
|
|
2179
|
+
]), Rt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
|
|
2180
|
+
let ut = $, ie = !1, re = null;
|
|
2181
|
+
const Wo = y({}, [
|
|
2182
|
+
Rt,
|
|
2183
|
+
Pt,
|
|
2184
|
+
$
|
|
2185
|
+
], fe), We = M([
|
|
2186
|
+
"mi",
|
|
2187
|
+
"mo",
|
|
2188
|
+
"mn",
|
|
2189
|
+
"ms",
|
|
2190
|
+
"mtext"
|
|
2191
|
+
]);
|
|
2192
|
+
let ae = y({}, We);
|
|
2193
|
+
const $e = M(["annotation-xml"]);
|
|
2194
|
+
let se = y({}, $e);
|
|
2195
|
+
const $o = y({}, [
|
|
2196
|
+
"title",
|
|
2197
|
+
"style",
|
|
2198
|
+
"font",
|
|
2199
|
+
"a",
|
|
2200
|
+
"script"
|
|
2201
|
+
]);
|
|
2202
|
+
let wt = null;
|
|
2203
|
+
const Go = ["application/xhtml+xml", "text/html"], Ko = "text/html";
|
|
2204
|
+
let _ = null, ft = null;
|
|
2205
|
+
const Yo = e.createElement("form"), Ge = function(n) {
|
|
2206
|
+
return n instanceof RegExp || n instanceof Function;
|
|
2207
|
+
}, le = function() {
|
|
2208
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2209
|
+
if (ft && ft === n) return;
|
|
2210
|
+
(!n || typeof n != "object") && (n = {}), n = H(n), wt = Go.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Ko : n.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : St, k = J(n, "ALLOWED_TAGS", Zt, { transform: _ }), x = J(n, "ALLOWED_ATTR", Jt, { transform: _ }), re = J(n, "ALLOWED_NAMESPACES", Wo, { transform: fe }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
|
|
2211
|
+
transform: _,
|
|
2212
|
+
base: je
|
|
2213
|
+
}), Fe = J(n, "ADD_DATA_URI_TAGS", He, {
|
|
2214
|
+
transform: _,
|
|
2215
|
+
base: He
|
|
2216
|
+
}), dt = J(n, "FORBID_CONTENTS", Be, { transform: _ }), vt = J(n, "FORBID_TAGS", H({}), { transform: _ }), Ie = J(n, "FORBID_ATTR", H({}), { transform: _ }), ct = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? H(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, Qt = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, lt = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Dt = n.RETURN_TRUSTED_TYPE || !1, ee = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, Ne = n.SANITIZE_NAMED_PROPS || !1, oe = n.KEEP_CONTENT !== !1, ne = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, ut = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, ae = be(n, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, We)), se = be(n, "HTML_INTEGRATION_POINTS", () => y({}, $e));
|
|
2217
|
+
const s = be(n, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
|
|
2218
|
+
if (W = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (Qt = !1), Ot && (lt = !0), ct && (k = y({}, po), x = gt(null), ct.html === !0 && (y(k, fo), y(x, ho)), ct.svg === !0 && (y(k, pe), y(x, ge), y(x, jt)), ct.svgFilters === !0 && (y(k, he), y(x, ge), y(x, jt)), ct.mathMl === !0 && (y(k, me), y(x, mo), y(x, jt))), q.tagCheck = null, q.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (k === Zt && (k = H(k)), y(k, n.ADD_TAGS, _))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (x === Jt && (x = H(x)), y(x, n.ADD_ATTR, _))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (dt === Be && (dt = H(dt)), y(dt, n.ADD_FORBID_CONTENTS, _)), oe && (k["#text"] = !0), nt && y(k, [
|
|
2219
|
+
"html",
|
|
2220
|
+
"head",
|
|
2221
|
+
"body"
|
|
2222
|
+
]), k.table && (y(k, ["tbody"]), delete vt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2223
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2224
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2225
|
+
const d = N;
|
|
2226
|
+
N = n.TRUSTED_TYPES_POLICY;
|
|
2227
|
+
try {
|
|
2228
|
+
et = st("");
|
|
2229
|
+
} catch (f) {
|
|
2230
|
+
throw N = d, f;
|
|
2231
|
+
}
|
|
2232
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Oo()), N && typeof et == "string" && (et = st("")));
|
|
2233
|
+
M && M(n), ft = n;
|
|
2234
|
+
}, Ke = y({}, [
|
|
2235
|
+
...pe,
|
|
2236
|
+
...he,
|
|
2237
|
+
...Nn
|
|
2238
|
+
]), Ye = y({}, [...me, ...zn]), qo = function(n, s, d) {
|
|
2239
|
+
return s.namespaceURI === $ ? n === "svg" : s.namespaceURI === Rt ? n === "svg" && (d === "annotation-xml" || ae[d]) : !!Ke[n];
|
|
2240
|
+
}, Vo = function(n, s, d) {
|
|
2241
|
+
return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && se[d] : !!Ye[n];
|
|
2242
|
+
}, Xo = function(n, s, d) {
|
|
2243
|
+
return s.namespaceURI === Pt && !se[d] || s.namespaceURI === Rt && !ae[d] ? !1 : !Ye[n] && ($o[n] || !Ke[n]);
|
|
2244
|
+
}, Zo = function(n) {
|
|
2245
|
+
let s = P(n);
|
|
2246
|
+
(!s || !s.tagName) && (s = {
|
|
2247
|
+
namespaceURI: ut,
|
|
2248
|
+
tagName: "template"
|
|
2249
|
+
});
|
|
2250
|
+
const d = St(n.tagName), f = St(s.tagName);
|
|
2251
|
+
return re[n.namespaceURI] ? n.namespaceURI === Pt ? qo(d, s, f) : n.namespaceURI === Rt ? Vo(d, s, f) : n.namespaceURI === $ ? Xo(d, s, f) : !!(wt === "application/xhtml+xml" && re[n.namespaceURI]) : !1;
|
|
2252
|
+
}, X = function(n) {
|
|
2253
|
+
kt(t.removed, { element: n });
|
|
2254
|
+
try {
|
|
2255
|
+
P(n).removeChild(n);
|
|
2256
|
+
} catch (s) {
|
|
2257
|
+
if (w(n), !P(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2258
|
+
}
|
|
2259
|
+
}, qe = function(n, s, d) {
|
|
2260
|
+
try {
|
|
2261
|
+
E(n, s);
|
|
2262
|
+
} catch (f) {
|
|
2263
|
+
try {
|
|
2264
|
+
n.removeAttribute(d);
|
|
2265
|
+
} catch (h) {
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
}, Nt = function(n) {
|
|
2269
|
+
zt(n);
|
|
2270
|
+
const s = D(n);
|
|
2271
|
+
if (s) {
|
|
2272
|
+
const f = [];
|
|
2273
|
+
rt(s, (h) => {
|
|
2274
|
+
kt(f, h);
|
|
2275
|
+
}), rt(f, (h) => {
|
|
2276
|
+
try {
|
|
2277
|
+
w(h);
|
|
2278
|
+
} catch (g) {
|
|
2279
|
+
}
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
const d = Yt(n);
|
|
2283
|
+
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2284
|
+
const h = d[f], g = h && h.name;
|
|
2285
|
+
typeof g == "string" && qe(n, h, g);
|
|
2286
|
+
}
|
|
2287
|
+
}, it = function(n, s, d) {
|
|
2288
|
+
if (!d) try {
|
|
2289
|
+
d = s.getAttributeNode(n);
|
|
2290
|
+
} catch (f) {
|
|
2291
|
+
d = null;
|
|
2292
|
+
}
|
|
2293
|
+
kt(t.removed, {
|
|
2294
|
+
attribute: d || null,
|
|
2295
|
+
from: s
|
|
2296
|
+
});
|
|
2297
|
+
try {
|
|
2298
|
+
d ? E(s, d) : s.removeAttribute(n);
|
|
2299
|
+
} catch (f) {
|
|
2300
|
+
try {
|
|
2301
|
+
s.removeAttribute(n);
|
|
2302
|
+
} catch (h) {
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
if (n === "is")
|
|
2306
|
+
if (lt || Ot) try {
|
|
2307
|
+
X(s);
|
|
2308
|
+
} catch (f) {
|
|
2309
|
+
}
|
|
2310
|
+
else try {
|
|
2311
|
+
s.setAttribute(n, "");
|
|
2312
|
+
} catch (f) {
|
|
2313
|
+
}
|
|
2314
|
+
}, Jo = function(n) {
|
|
2315
|
+
const s = Yt(n);
|
|
2316
|
+
if (s)
|
|
2317
|
+
for (let d = s.length - 1; d >= 0; --d) {
|
|
2318
|
+
const f = s[d], h = f && f.name;
|
|
2319
|
+
typeof h != "string" || x[_(h)] || qe(n, f, h);
|
|
2320
|
+
}
|
|
2321
|
+
}, zt = function(n) {
|
|
2322
|
+
const s = [n];
|
|
2323
|
+
for (; s.length > 0; ) {
|
|
2324
|
+
const d = s.pop();
|
|
2325
|
+
yt(d) === F.element && Jo(d);
|
|
2326
|
+
const f = D(d);
|
|
2327
|
+
if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
|
|
2328
|
+
}
|
|
2329
|
+
}, Ve = function(n, s) {
|
|
2330
|
+
return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2331
|
+
}, Qo = function(n) {
|
|
2332
|
+
if (!ot) return;
|
|
2333
|
+
const s = [n];
|
|
2334
|
+
for (; s.length > 0; ) {
|
|
2335
|
+
const d = s.pop(), f = yt(d);
|
|
2336
|
+
if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
|
|
2337
|
+
try {
|
|
2338
|
+
w(d);
|
|
2339
|
+
} catch (g) {
|
|
2340
|
+
}
|
|
2341
|
+
continue;
|
|
2342
|
+
}
|
|
2343
|
+
if (f === F.element) {
|
|
2344
|
+
const g = d, b = _(qt(d));
|
|
2345
|
+
try {
|
|
2346
|
+
g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", b) && g.removeAttribute("for");
|
|
2347
|
+
} catch (S) {
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
const h = D(d);
|
|
2351
|
+
if (h) for (let g = h.length - 1; g >= 0; --g) s.push(h[g]);
|
|
2352
|
+
}
|
|
2353
|
+
}, Xe = function(n) {
|
|
2354
|
+
let s = null, d = null;
|
|
2355
|
+
if (ee) n = "<remove></remove>" + n;
|
|
2356
|
+
else {
|
|
2357
|
+
const g = so(n, /^[\r\n\t ]+/);
|
|
2358
|
+
d = g && g[0];
|
|
2359
|
+
}
|
|
2360
|
+
wt === "application/xhtml+xml" && ut === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2361
|
+
const f = N ? st(n) : n;
|
|
2362
|
+
if (ut === $) try {
|
|
2363
|
+
s = new m().parseFromString(f, wt);
|
|
2364
|
+
} catch (g) {
|
|
2365
|
+
}
|
|
2366
|
+
if (!s || !s.documentElement) {
|
|
2367
|
+
s = Xt.createDocument(ut, "template", null);
|
|
2368
|
+
try {
|
|
2369
|
+
s.documentElement.innerHTML = ie ? et : f;
|
|
2370
|
+
} catch (g) {
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
const h = s.body || s.documentElement;
|
|
2374
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === $ ? Ro.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
|
|
2375
|
+
}, Ze = function(n) {
|
|
2376
|
+
const s = _t ? _t(n) : n.ownerDocument;
|
|
2377
|
+
return _e.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2378
|
+
}, Bt = function(n) {
|
|
2379
|
+
return n = xt(n, No, " "), n = xt(n, zo, " "), n = xt(n, Bo, " "), n;
|
|
2380
|
+
}, ce = function(n) {
|
|
2381
|
+
var s;
|
|
2382
|
+
n.normalize();
|
|
2383
|
+
const d = _t ? _t(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2384
|
+
let h = f.nextNode();
|
|
2385
|
+
for (; h; )
|
|
2386
|
+
h.data = Bt(h.data), h = f.nextNode();
|
|
2387
|
+
const g = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2388
|
+
g && rt(g, (b) => {
|
|
2389
|
+
pt(b.content) && ce(b.content);
|
|
2390
|
+
});
|
|
2391
|
+
}, Ft = function(n) {
|
|
2392
|
+
const s = at ? at(n) : null;
|
|
2393
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== Yt(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== tt(n) || n.childNodes !== D(n);
|
|
2394
|
+
}, pt = function(n) {
|
|
2395
|
+
if (!tt || typeof n != "object" || n === null) return !1;
|
|
2396
|
+
try {
|
|
2397
|
+
return tt(n) === F.documentFragment;
|
|
2398
|
+
} catch (s) {
|
|
2399
|
+
return !1;
|
|
2400
|
+
}
|
|
2401
|
+
}, Tt = function(n) {
|
|
2402
|
+
if (!tt || typeof n != "object" || n === null) return !1;
|
|
2403
|
+
try {
|
|
2404
|
+
return typeof tt(n) == "number";
|
|
2405
|
+
} catch (s) {
|
|
2406
|
+
return !1;
|
|
2407
|
+
}
|
|
2408
|
+
};
|
|
2409
|
+
function G(u, n, s) {
|
|
2410
|
+
u.length !== 0 && rt(u, (d) => {
|
|
2411
|
+
d.call(t, n, s, ft);
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2414
|
+
const tn = function(n, s) {
|
|
2415
|
+
return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === $ && Vn[s] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Xn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
|
|
2416
|
+
}, Ht = function(n, s) {
|
|
2417
|
+
if (n instanceof RegExp) return O(n, s);
|
|
2418
|
+
if (n instanceof Function) {
|
|
2419
|
+
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2420
|
+
return !!n(s, ...f);
|
|
2421
|
+
}
|
|
2422
|
+
return !1;
|
|
2423
|
+
}, en = function(n, s, d) {
|
|
2424
|
+
if (!vt[s] && eo(s) && Ht(W.tagNameCheck, s)) return !1;
|
|
2425
|
+
if (oe && !dt[s]) {
|
|
2426
|
+
const f = P(n), h = D(n);
|
|
2427
|
+
if (h && f) {
|
|
2428
|
+
const g = h.length;
|
|
2429
|
+
for (let b = g - 1; b >= 0; --b) {
|
|
2430
|
+
const S = n === d ? C(h[b], !0) : h[b];
|
|
2431
|
+
f.insertBefore(S, Y(n));
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
return X(n), !0;
|
|
2436
|
+
}, Je = function(n, s, d, f) {
|
|
2437
|
+
return n.length === 0 ? s : s === d || s === f ? H(s) : s;
|
|
2438
|
+
}, ht = function(n, s) {
|
|
2439
|
+
return n === s || P(n) !== null ? !1 : (ne && zt(n), !0);
|
|
2440
|
+
}, Qe = function(n, s) {
|
|
2441
|
+
if (G(T.beforeSanitizeElements, n, null), ht(n, s)) return !0;
|
|
2442
|
+
if (Ft(n))
|
|
2443
|
+
return X(n), !0;
|
|
2444
|
+
const d = _(qt(n));
|
|
2445
|
+
if (k = Je(T.uponSanitizeElement, k, Zt, Mt), G(T.uponSanitizeElement, n, {
|
|
2446
|
+
tagName: d,
|
|
2447
|
+
allowedTags: k
|
|
2448
|
+
}), ht(n, s)) return !0;
|
|
2449
|
+
if (tn(n, d))
|
|
2450
|
+
return X(n), !0;
|
|
2451
|
+
if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !k[d]) {
|
|
2452
|
+
const f = en(n, d, s);
|
|
2453
|
+
return f === !1 && (G(T.afterSanitizeElements, n, null), ht(n, s)) ? !0 : f;
|
|
2454
|
+
}
|
|
2455
|
+
if (yt(n) === F.element && !Zo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Yn, n.innerHTML))
|
|
2456
|
+
return X(n), !0;
|
|
2457
|
+
if (V && n.nodeType === F.text) {
|
|
2458
|
+
const f = Bt(n.textContent);
|
|
2459
|
+
n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2460
|
+
}
|
|
2461
|
+
return G(T.afterSanitizeElements, n, null), ht(n, s);
|
|
2462
|
+
}, to = function(n, s, d) {
|
|
2463
|
+
if (Ie[s] || Ve(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Yo)) return !1;
|
|
2464
|
+
const f = x[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
|
|
2465
|
+
return Qt && O(Fo, s) || Oe && O(Ho, s) ? !0 : f ? Ue[s] || O(Me, xt(d, Le, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && lo(d, "data:") === 0 && Fe[n] || De && !O(Uo, xt(d, Le, "")) ? !0 : !d : eo(n) && Ht(W.tagNameCheck, n) && Ht(W.attributeNameCheck, s, n) || s === "is" && W.allowCustomizedBuiltInElements && Ht(W.tagNameCheck, d);
|
|
2466
|
+
}, on = y({}, [
|
|
2467
|
+
"annotation-xml",
|
|
2468
|
+
"color-profile",
|
|
2469
|
+
"font-face",
|
|
2470
|
+
"font-face-format",
|
|
2471
|
+
"font-face-name",
|
|
2472
|
+
"font-face-src",
|
|
2473
|
+
"font-face-uri",
|
|
2474
|
+
"missing-glyph"
|
|
2475
|
+
]), eo = function(n) {
|
|
2476
|
+
return !on[St(n)] && O(jo, n);
|
|
2477
|
+
}, nn = function(n, s, d, f) {
|
|
2478
|
+
if (N && typeof v == "object" && typeof v.getAttributeType == "function" && !d) switch (v.getAttributeType(n, s)) {
|
|
2479
|
+
case "TrustedHTML":
|
|
2480
|
+
return st(f);
|
|
2481
|
+
case "TrustedScriptURL":
|
|
2482
|
+
return Io(f);
|
|
2483
|
+
}
|
|
2484
|
+
return f;
|
|
2485
|
+
}, rn = function(n, s, d, f) {
|
|
2486
|
+
try {
|
|
2487
|
+
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), Ft(n) ? (X(n), !1) : !0;
|
|
2488
|
+
} catch (h) {
|
|
2489
|
+
return it(s, n), !1;
|
|
2490
|
+
}
|
|
2491
|
+
}, oo = function(n, s) {
|
|
2492
|
+
if (G(T.beforeSanitizeAttributes, n, null), ht(n, s)) return;
|
|
2493
|
+
const d = n.attributes;
|
|
2494
|
+
if (!d || Ft(n)) return;
|
|
2495
|
+
x = Je(T.uponSanitizeAttribute, x, Jt, It);
|
|
2496
|
+
const f = {
|
|
2497
|
+
attrName: "",
|
|
2498
|
+
attrValue: "",
|
|
2499
|
+
keepAttr: !0,
|
|
2500
|
+
allowedAttributes: x,
|
|
2501
|
+
forceKeepAttr: void 0
|
|
2502
|
+
};
|
|
2503
|
+
let h = d.length;
|
|
2504
|
+
const g = _(n.nodeName);
|
|
2505
|
+
for (; h--; ) {
|
|
2506
|
+
const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), ue = B;
|
|
2507
|
+
let R = S === "value" ? ue : Ln(ue), no = !1;
|
|
2508
|
+
if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(T.uponSanitizeAttribute, n, f), R = f.attrValue, Ne && (mt === "id" || mt === "name") && lo(R, ze) !== 0 && (it(S, n, b), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2509
|
+
it(S, n, b);
|
|
2510
|
+
continue;
|
|
2511
|
+
}
|
|
2512
|
+
if (mt === "attributename" && so(R, "href")) {
|
|
2513
|
+
it(S, n, b);
|
|
2514
|
+
continue;
|
|
2515
|
+
}
|
|
2516
|
+
if (!f.forceKeepAttr) {
|
|
2517
|
+
if (!f.keepAttr) {
|
|
2518
|
+
it(S, n, b);
|
|
2519
|
+
continue;
|
|
2520
|
+
}
|
|
2521
|
+
if (!Re && O(qn, R)) {
|
|
2522
|
+
it(S, n, b);
|
|
2523
|
+
continue;
|
|
2524
|
+
}
|
|
2525
|
+
if (V && (R = Bt(R)), !to(g, mt, R)) {
|
|
2526
|
+
it(S, n, b);
|
|
2527
|
+
continue;
|
|
2528
|
+
}
|
|
2529
|
+
R = nn(g, mt, U, R), R !== ue && rn(n, S, U, R) && no && ao(t.removed);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
G(T.afterSanitizeAttributes, n, null), ht(n, s);
|
|
2533
|
+
}, Ut = function(n) {
|
|
2534
|
+
let s = null;
|
|
2535
|
+
const d = Ze(n);
|
|
2536
|
+
for (G(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2537
|
+
if (G(T.uponSanitizeShadowNode, s, null), Qe(s, n), oo(s, n), pt(s.content) && Ut(s.content), yt(s) === F.element) {
|
|
2538
|
+
const f = Ae(s);
|
|
2539
|
+
pt(f) && (de(f), Ut(f));
|
|
2540
|
+
}
|
|
2541
|
+
G(T.afterSanitizeShadowDOM, n, null);
|
|
2542
|
+
}, de = function(n) {
|
|
2543
|
+
const s = [{
|
|
2544
|
+
node: n,
|
|
2545
|
+
shadow: null
|
|
2546
|
+
}];
|
|
2547
|
+
for (; s.length > 0; ) {
|
|
2548
|
+
const d = s.pop();
|
|
2549
|
+
if (d.shadow) {
|
|
2550
|
+
Ut(d.shadow);
|
|
2551
|
+
continue;
|
|
2552
|
+
}
|
|
2553
|
+
const f = d.node, h = yt(f) === F.element, g = D(f);
|
|
2554
|
+
if (g) for (let b = g.length - 1; b >= 0; --b) s.push({
|
|
2555
|
+
node: g[b],
|
|
2556
|
+
shadow: null
|
|
2557
|
+
});
|
|
2558
|
+
if (h) {
|
|
2559
|
+
const b = at ? at(f) : null;
|
|
2560
|
+
if (typeof b == "string" && _(b) === "template") {
|
|
2561
|
+
const S = f.content;
|
|
2562
|
+
pt(S) && s.push({
|
|
2563
|
+
node: S,
|
|
2564
|
+
shadow: null
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
if (h) {
|
|
2569
|
+
const b = Ae(f);
|
|
2570
|
+
pt(b) && s.push({
|
|
2571
|
+
node: null,
|
|
2572
|
+
shadow: b
|
|
2573
|
+
}, {
|
|
2574
|
+
node: b,
|
|
2575
|
+
shadow: null
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
};
|
|
2580
|
+
return t.sanitize = function(u) {
|
|
2581
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
|
|
2582
|
+
if (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Rn(u), typeof u != "string"))
|
|
2583
|
+
throw Z("dirty is not a string, aborting");
|
|
2584
|
+
if (!t.isSupported) return u;
|
|
2585
|
+
te ? (k = Mt, x = It) : le(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (k = H(k)), T.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
|
|
2586
|
+
const g = ne && typeof u != "string" && Tt(u);
|
|
2587
|
+
if (g) {
|
|
2588
|
+
Qo(u);
|
|
2589
|
+
const U = qt(u);
|
|
2590
|
+
if (typeof U == "string") {
|
|
2591
|
+
const B = _(U);
|
|
2592
|
+
if (!k[B] || vt[B])
|
|
2593
|
+
throw Nt(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2594
|
+
}
|
|
2595
|
+
if (Ft(u))
|
|
2596
|
+
throw Nt(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2597
|
+
try {
|
|
2598
|
+
de(u);
|
|
2599
|
+
} catch (B) {
|
|
2600
|
+
throw Nt(u), B;
|
|
2601
|
+
}
|
|
2602
|
+
} else if (Tt(u))
|
|
2603
|
+
s = Xe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), de(s);
|
|
2604
|
+
else {
|
|
2605
|
+
if (!lt && !V && !nt && u.indexOf("<") === -1) return N && Dt ? st(u) : u;
|
|
2606
|
+
if (s = Xe(u), !s) return lt ? null : Dt ? et : "";
|
|
2607
|
+
}
|
|
2608
|
+
s && ee && X(s.firstChild);
|
|
2609
|
+
const b = g ? u : s;
|
|
2610
|
+
try {
|
|
2611
|
+
const U = Ze(b);
|
|
2612
|
+
for (; f = U.nextNode(); )
|
|
2613
|
+
Qe(f, b), oo(f, b), pt(f.content) && Ut(f.content);
|
|
2614
|
+
} catch (U) {
|
|
2615
|
+
throw g && (Nt(u), rt(t.removed, (B) => {
|
|
2616
|
+
B.element && zt(B.element);
|
|
2617
|
+
})), U;
|
|
2618
|
+
}
|
|
2619
|
+
if (g) {
|
|
2620
|
+
let U = !1;
|
|
2621
|
+
if (rt(t.removed, (B) => {
|
|
2622
|
+
B.element && (B.element === u && (U = !0), zt(B.element));
|
|
2623
|
+
}), U) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2624
|
+
return V && ce(u), u;
|
|
2625
|
+
}
|
|
2626
|
+
if (lt) {
|
|
2627
|
+
if (V && ce(s), Ot)
|
|
2628
|
+
for (h = Do.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2629
|
+
else h = s;
|
|
2630
|
+
return (x.shadowroot || x.shadowrootmode) && (h = Po.call(o, h, !0)), h;
|
|
2631
|
+
}
|
|
2632
|
+
let S = nt ? s.outerHTML : s.innerHTML;
|
|
2633
|
+
return nt && k["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(Gn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2634
|
+
` + S), V && (S = Bt(S)), N && Dt ? st(S) : S;
|
|
2635
|
+
}, t.setConfig = function() {
|
|
2636
|
+
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2637
|
+
le(u), te = !0, Mt = k, It = x;
|
|
2638
|
+
}, t.clearConfig = function() {
|
|
2639
|
+
ft = null, te = !1, Mt = null, It = null, N = Vt, et = "";
|
|
2640
|
+
}, t.isValidAttribute = function(u, n, s) {
|
|
2641
|
+
ft || le({});
|
|
2642
|
+
const d = _(u), f = _(n);
|
|
2643
|
+
return to(d, f, s);
|
|
2644
|
+
}, t.addHook = function(u, n) {
|
|
2645
|
+
typeof n == "function" && z(T, u) && kt(T[u], n);
|
|
2646
|
+
}, t.removeHook = function(u, n) {
|
|
2647
|
+
if (z(T, u)) {
|
|
2648
|
+
if (n !== void 0) {
|
|
2649
|
+
const s = Sn(T[u], n);
|
|
2650
|
+
return s === -1 ? void 0 : _n(T[u], s, 1)[0];
|
|
2651
|
+
}
|
|
2652
|
+
return ao(T[u]);
|
|
2653
|
+
}
|
|
2654
|
+
}, t.removeHooks = function(u) {
|
|
2655
|
+
z(T, u) && (T[u] = []);
|
|
2656
|
+
}, t.removeAllHooks = function() {
|
|
2657
|
+
T = Eo();
|
|
2658
|
+
}, t;
|
|
2659
|
+
}
|
|
2660
|
+
var Wt = Lo();
|
|
2661
|
+
const Qn = [
|
|
1136
2662
|
"p",
|
|
1137
2663
|
"br",
|
|
1138
2664
|
"strong",
|
|
@@ -1156,7 +2682,6 @@ const q = [
|
|
|
1156
2682
|
"img",
|
|
1157
2683
|
"video",
|
|
1158
2684
|
"audio",
|
|
1159
|
-
"iframe",
|
|
1160
2685
|
"table",
|
|
1161
2686
|
"thead",
|
|
1162
2687
|
"tbody",
|
|
@@ -1172,62 +2697,76 @@ const q = [
|
|
|
1172
2697
|
"sup",
|
|
1173
2698
|
"sub",
|
|
1174
2699
|
"hr"
|
|
1175
|
-
|
|
2700
|
+
// 'iframe' is deliberately not in the default allowlist. Arbitrary pasted
|
|
2701
|
+
// or typed content should not be able to silently embed an iframe - that's
|
|
2702
|
+
// a real vector (e.g. pasting from a compromised page). The editor's
|
|
2703
|
+
// embed-iframe plugin inserts iframes through its own explicit,
|
|
2704
|
+
// user-initiated dialog, a different trust boundary that never calls
|
|
2705
|
+
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2706
|
+
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2707
|
+
], ti = {
|
|
1176
2708
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
1177
2709
|
a: ["href", "target", "rel", "title"],
|
|
1178
2710
|
img: ["src", "alt", "width", "height", "loading"],
|
|
1179
2711
|
video: ["src", "controls", "width", "height", "autoplay", "loop", "muted"],
|
|
1180
2712
|
audio: ["src", "controls", "autoplay", "loop", "muted"],
|
|
1181
|
-
iframe: ["src", "width", "height", "name", "title", "longdesc", "allow", "allowfullscreen", "frameborder", "scrolling", "loading", "referrerpolicy"],
|
|
1182
2713
|
table: ["border", "cellpadding", "cellspacing"],
|
|
1183
2714
|
td: ["colspan", "rowspan", "align", "valign"],
|
|
1184
|
-
th: ["colspan", "rowspan", "align", "valign"]
|
|
1185
|
-
|
|
1186
|
-
|
|
2715
|
+
th: ["colspan", "rowspan", "align", "valign"],
|
|
2716
|
+
// 'iframe' itself is still excluded from DEFAULT_ALLOWED_TAGS above, so this
|
|
2717
|
+
// entry is inert for ordinary input/paste - it only takes effect for the
|
|
2718
|
+
// embed-iframe plugin's trust-marked insertions (see sanitizeInputHTML's
|
|
2719
|
+
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2720
|
+
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2721
|
+
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2722
|
+
}, ei = "data-editora-embed";
|
|
2723
|
+
function oi(a) {
|
|
2724
|
+
if (!a || /\s/.test(a.trim())) return !1;
|
|
2725
|
+
try {
|
|
2726
|
+
const t = new URL(a.trim());
|
|
2727
|
+
return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
|
|
2728
|
+
} catch (t) {
|
|
2729
|
+
return !1;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
function Mo(a, t, e, o) {
|
|
1187
2733
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
1188
2734
|
return a;
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
for (const d of r)
|
|
1213
|
-
if (d.endsWith("*")) {
|
|
1214
|
-
const h = d.slice(0, -1);
|
|
1215
|
-
if (l.startsWith(h)) {
|
|
1216
|
-
c = !0;
|
|
1217
|
-
break;
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
(l.startsWith("on") || l === "javascript:" || l === "href" && s.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && s.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), l === "dir" && !["ltr", "rtl", "auto"].includes(s.value.trim().toLowerCase()) && (c = !1), c || a.removeAttribute(s.name);
|
|
2735
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Qn, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ti, p = /* @__PURE__ */ new Set();
|
|
2736
|
+
for (const A of Object.values(c))
|
|
2737
|
+
for (const C of A) p.add(C);
|
|
2738
|
+
const m = {
|
|
2739
|
+
ALLOWED_TAGS: r,
|
|
2740
|
+
ALLOWED_ATTR: Array.from(p)
|
|
2741
|
+
};
|
|
2742
|
+
if (!o)
|
|
2743
|
+
return Wt.sanitize(a, m);
|
|
2744
|
+
const v = r.includes("iframe");
|
|
2745
|
+
Wt.addHook(
|
|
2746
|
+
"uponSanitizeElement",
|
|
2747
|
+
(A, C) => {
|
|
2748
|
+
var E;
|
|
2749
|
+
if (C.tagName !== "iframe") return;
|
|
2750
|
+
const w = A;
|
|
2751
|
+
C.allowedTags.iframe = v || ((E = w.getAttribute) == null ? void 0 : E.call(w, ei)) === "true" && oi(w.getAttribute("src"));
|
|
2752
|
+
}
|
|
2753
|
+
);
|
|
2754
|
+
try {
|
|
2755
|
+
return Wt.sanitize(a, m);
|
|
2756
|
+
} finally {
|
|
2757
|
+
Wt.removeHook("uponSanitizeElement");
|
|
1221
2758
|
}
|
|
1222
|
-
a.hasAttribute("href") && (a.getAttribute("href") || "").trim().toLowerCase().startsWith("javascript:") && a.removeAttribute("href"), a.hasAttribute("src") && (a.getAttribute("src") || "").trim().toLowerCase().startsWith("javascript:") && a.removeAttribute("src");
|
|
1223
2759
|
}
|
|
1224
|
-
function
|
|
1225
|
-
return (
|
|
2760
|
+
function ni(a, t, e, o) {
|
|
2761
|
+
return Mo(a, t, o, !1);
|
|
1226
2762
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return (e == null ? void 0 : e.
|
|
2763
|
+
function ii(a, t, e) {
|
|
2764
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ni(a, t);
|
|
1229
2765
|
}
|
|
1230
|
-
|
|
2766
|
+
function vo(a, t, e, o) {
|
|
2767
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Mo(a, t, o, !0);
|
|
2768
|
+
}
|
|
2769
|
+
const Kt = class Kt {
|
|
1231
2770
|
/**
|
|
1232
2771
|
* Resolve configuration from multiple sources with priority
|
|
1233
2772
|
*/
|
|
@@ -1245,12 +2784,12 @@ const S = class S {
|
|
|
1245
2784
|
static normalizeConfig(t) {
|
|
1246
2785
|
const e = { ...t };
|
|
1247
2786
|
if (e.toolbarFloating !== void 0 || e.toolbarSticky !== void 0) {
|
|
1248
|
-
const
|
|
1249
|
-
e.toolbarFloating !== void 0 && (
|
|
2787
|
+
const l = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
|
|
2788
|
+
e.toolbarFloating !== void 0 && (l.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (l.sticky = !!e.toolbarSticky), e.toolbar = l;
|
|
1250
2789
|
}
|
|
1251
2790
|
if (e.toolbarItems !== void 0 && typeof e.toolbar == "object" && e.toolbar && (e.toolbar.items = e.toolbarItems), e.autosaveEnabled !== void 0 || e.autosaveIntervalMs !== void 0 || e.autosaveStorageKey !== void 0 || e.autosaveProvider !== void 0 || e.autosaveApiUrl !== void 0) {
|
|
1252
|
-
const
|
|
1253
|
-
e.autosaveEnabled !== void 0 && (
|
|
2791
|
+
const l = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
|
|
2792
|
+
e.autosaveEnabled !== void 0 && (l.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (l.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (l.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (l.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (l.apiUrl = e.autosaveApiUrl), e.autosave = l;
|
|
1254
2793
|
}
|
|
1255
2794
|
const o = {
|
|
1256
2795
|
enabled: !1,
|
|
@@ -1265,46 +2804,46 @@ const S = class S {
|
|
|
1265
2804
|
enabled: e.autosave
|
|
1266
2805
|
};
|
|
1267
2806
|
else if (typeof e.autosave == "object" && e.autosave) {
|
|
1268
|
-
const
|
|
2807
|
+
const l = {
|
|
1269
2808
|
...o,
|
|
1270
2809
|
...e.autosave
|
|
1271
2810
|
};
|
|
1272
|
-
|
|
2811
|
+
l.intervalMs === void 0 && l.interval !== void 0 && (l.intervalMs = Number(l.interval)), l.enabled === void 0 && (l.enabled = !0), (!Number.isFinite(l.intervalMs) || l.intervalMs <= 0) && (l.intervalMs = o.intervalMs), e.autosave = l;
|
|
1273
2812
|
} else
|
|
1274
2813
|
e.autosave = o;
|
|
1275
2814
|
if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
|
|
1276
|
-
const
|
|
1277
|
-
e.languageLocale !== void 0 && (
|
|
2815
|
+
const l = typeof e.language == "object" && e.language ? { ...e.language } : {};
|
|
2816
|
+
e.languageLocale !== void 0 && (l.locale = e.languageLocale), e.languageDirection !== void 0 && (l.direction = e.languageDirection), e.language = l;
|
|
1278
2817
|
}
|
|
1279
|
-
const
|
|
2818
|
+
const i = { locale: "en", direction: "ltr" };
|
|
1280
2819
|
if (typeof e.language == "string" ? e.language = {
|
|
1281
2820
|
locale: e.language,
|
|
1282
|
-
direction:
|
|
2821
|
+
direction: i.direction
|
|
1283
2822
|
} : typeof e.language == "object" && e.language ? e.language = {
|
|
1284
|
-
...
|
|
2823
|
+
...i,
|
|
1285
2824
|
...e.language
|
|
1286
|
-
} : e.language =
|
|
1287
|
-
const
|
|
1288
|
-
e.spellcheckEnabled !== void 0 && (
|
|
2825
|
+
} : e.language = i, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
|
|
2826
|
+
const l = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
|
|
2827
|
+
e.spellcheckEnabled !== void 0 && (l.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (l.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (l.apiUrl = e.spellcheckApiUrl), e.spellcheck = l;
|
|
1289
2828
|
}
|
|
1290
|
-
const
|
|
2829
|
+
const r = {
|
|
1291
2830
|
enabled: !1,
|
|
1292
2831
|
provider: "browser",
|
|
1293
2832
|
apiUrl: ""
|
|
1294
2833
|
};
|
|
1295
2834
|
if (typeof e.spellcheck == "boolean")
|
|
1296
2835
|
e.spellcheck = {
|
|
1297
|
-
...
|
|
2836
|
+
...r,
|
|
1298
2837
|
enabled: e.spellcheck
|
|
1299
2838
|
};
|
|
1300
2839
|
else if (typeof e.spellcheck == "object" && e.spellcheck) {
|
|
1301
|
-
const
|
|
1302
|
-
...
|
|
2840
|
+
const l = {
|
|
2841
|
+
...r,
|
|
1303
2842
|
...e.spellcheck
|
|
1304
2843
|
};
|
|
1305
|
-
!
|
|
2844
|
+
!l.provider && l.mode && (l.provider = l.mode === "local" ? "browser" : "api"), l.enabled === void 0 && (l.enabled = !!(l.mode || l.provider || l.apiUrl)), e.spellcheck = l;
|
|
1306
2845
|
} else
|
|
1307
|
-
e.spellcheck =
|
|
2846
|
+
e.spellcheck = r;
|
|
1308
2847
|
return e.contextMenuEnabled !== void 0 && (e.contextMenu = {
|
|
1309
2848
|
enabled: !!e.contextMenuEnabled
|
|
1310
2849
|
}), typeof e.contextMenu == "boolean" ? e.contextMenu = { enabled: e.contextMenu } : typeof e.contextMenu == "object" && e.contextMenu ? e.contextMenu = {
|
|
@@ -1364,9 +2903,9 @@ const S = class S {
|
|
|
1364
2903
|
*/
|
|
1365
2904
|
static parseAttributes(t) {
|
|
1366
2905
|
const e = {};
|
|
1367
|
-
for (const [o,
|
|
1368
|
-
const
|
|
1369
|
-
e[
|
|
2906
|
+
for (const [o, i] of Object.entries(t)) {
|
|
2907
|
+
const r = this.kebabToCamel(o);
|
|
2908
|
+
e[r] = this.BOOLEAN_ATTRIBUTES.has(o) && (i === "" || i === o) ? !0 : this.parseAttributeValue(i);
|
|
1370
2909
|
}
|
|
1371
2910
|
return e;
|
|
1372
2911
|
}
|
|
@@ -1414,12 +2953,12 @@ const S = class S {
|
|
|
1414
2953
|
static merge(...t) {
|
|
1415
2954
|
const e = {};
|
|
1416
2955
|
for (const o of t)
|
|
1417
|
-
for (const [
|
|
1418
|
-
|
|
2956
|
+
for (const [i, r] of Object.entries(o))
|
|
2957
|
+
r != null && (typeof r == "object" && !Array.isArray(r) && e[i] ? e[i] = this.merge(e[i], r) : e[i] = r);
|
|
1419
2958
|
return e;
|
|
1420
2959
|
}
|
|
1421
2960
|
};
|
|
1422
|
-
|
|
2961
|
+
Kt.EDITOR_DEFAULTS = {
|
|
1423
2962
|
height: 400,
|
|
1424
2963
|
width: "100%",
|
|
1425
2964
|
readonly: !1,
|
|
@@ -1468,87 +3007,106 @@ S.EDITOR_DEFAULTS = {
|
|
|
1468
3007
|
sanitizeOnInput: !0
|
|
1469
3008
|
},
|
|
1470
3009
|
statusbar: !1
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
const J = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor;fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
3010
|
+
}, Kt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
3011
|
+
"readonly",
|
|
3012
|
+
"disabled",
|
|
3013
|
+
"autofocus",
|
|
3014
|
+
"statusbar",
|
|
3015
|
+
"toolbar-floating",
|
|
3016
|
+
"toolbar-sticky",
|
|
3017
|
+
"autosave-enabled",
|
|
3018
|
+
"accessibility-enable-aria",
|
|
3019
|
+
"accessibility-keyboard-navigation",
|
|
3020
|
+
"accessibility-checker",
|
|
3021
|
+
"performance-viewport-only-scan",
|
|
3022
|
+
"spellcheck-enabled",
|
|
3023
|
+
"context-menu-enabled",
|
|
3024
|
+
"paste-clean",
|
|
3025
|
+
"paste-keep-formatting",
|
|
3026
|
+
"paste-convert-word",
|
|
3027
|
+
"security-sanitize-on-paste",
|
|
3028
|
+
"security-sanitize-on-input"
|
|
3029
|
+
]);
|
|
3030
|
+
let Te = Kt;
|
|
3031
|
+
const ri = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
|
|
3032
|
+
let $t;
|
|
3033
|
+
const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", ke = /* @__PURE__ */ new Set();
|
|
3034
|
+
let Q = null, ko = !1, ye = null, Ee = null;
|
|
3035
|
+
function xo(a) {
|
|
1478
3036
|
if (!(a instanceof HTMLElement)) return !1;
|
|
1479
3037
|
const t = a;
|
|
1480
3038
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
1481
3039
|
}
|
|
1482
|
-
function
|
|
3040
|
+
function li(a) {
|
|
1483
3041
|
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
1484
3042
|
}
|
|
1485
|
-
function
|
|
3043
|
+
function Ct(a) {
|
|
1486
3044
|
if (!a) return null;
|
|
1487
|
-
if (
|
|
3045
|
+
if (xo(a))
|
|
1488
3046
|
return a;
|
|
1489
|
-
const t = a.matches(
|
|
1490
|
-
return !t || !
|
|
3047
|
+
const t = a.matches(wo) ? a : a.closest(wo);
|
|
3048
|
+
return !t || !xo(t) ? null : t;
|
|
1491
3049
|
}
|
|
1492
|
-
function
|
|
1493
|
-
var
|
|
3050
|
+
function ci() {
|
|
3051
|
+
var i;
|
|
1494
3052
|
if (typeof window == "undefined") return null;
|
|
1495
|
-
const a = window[
|
|
3053
|
+
const a = window[ai];
|
|
1496
3054
|
if (a instanceof HTMLElement) {
|
|
1497
|
-
const
|
|
1498
|
-
if (
|
|
1499
|
-
const
|
|
1500
|
-
if (
|
|
1501
|
-
const
|
|
1502
|
-
if (
|
|
3055
|
+
const r = Ct(a);
|
|
3056
|
+
if (r) return r;
|
|
3057
|
+
const l = a.matches(To) ? a : a.querySelector(To);
|
|
3058
|
+
if (l) {
|
|
3059
|
+
const c = Ct(l);
|
|
3060
|
+
if (c) return c;
|
|
1503
3061
|
}
|
|
1504
3062
|
}
|
|
1505
|
-
const t = window[
|
|
3063
|
+
const t = window[si];
|
|
1506
3064
|
if (t instanceof HTMLElement) {
|
|
1507
|
-
const
|
|
1508
|
-
if (
|
|
3065
|
+
const r = Ct(t);
|
|
3066
|
+
if (r) return r;
|
|
1509
3067
|
}
|
|
1510
3068
|
const e = document.activeElement;
|
|
1511
3069
|
if (e) {
|
|
1512
|
-
const
|
|
1513
|
-
if (
|
|
3070
|
+
const r = Ct(e);
|
|
3071
|
+
if (r) return r;
|
|
1514
3072
|
}
|
|
1515
|
-
const o = (
|
|
3073
|
+
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
1516
3074
|
if (o && o.rangeCount > 0) {
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
3075
|
+
const r = Ct(li(o.getRangeAt(0).startContainer));
|
|
3076
|
+
if (r) return r;
|
|
1519
3077
|
}
|
|
1520
|
-
if (
|
|
1521
|
-
return
|
|
1522
|
-
for (const
|
|
1523
|
-
if (
|
|
3078
|
+
if (Q && Q.isConnected)
|
|
3079
|
+
return Q;
|
|
3080
|
+
for (const r of ke)
|
|
3081
|
+
if (r.isConnected) return r;
|
|
1524
3082
|
return null;
|
|
1525
3083
|
}
|
|
1526
|
-
function
|
|
1527
|
-
if (typeof window == "undefined" ||
|
|
1528
|
-
|
|
3084
|
+
function di() {
|
|
3085
|
+
if (typeof window == "undefined" || ko) return;
|
|
3086
|
+
ye = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Ee = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
1529
3087
|
const a = (t, ...e) => {
|
|
1530
|
-
const o =
|
|
1531
|
-
return o ? o.execCommand(t, ...e) :
|
|
3088
|
+
const o = ci();
|
|
3089
|
+
return o ? o.execCommand(t, ...e) : ye ? ye(t, ...e) : Ee ? Ee(t, ...e) : !1;
|
|
1532
3090
|
};
|
|
1533
|
-
window.executeEditorCommand = a, window.execEditorCommand = a,
|
|
3091
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, ko = !0;
|
|
1534
3092
|
}
|
|
1535
|
-
function
|
|
3093
|
+
function ui() {
|
|
1536
3094
|
const a = "editora-webcomponent-styles";
|
|
1537
3095
|
if (!document.getElementById(a)) {
|
|
1538
3096
|
const t = document.createElement("style");
|
|
1539
|
-
t.id = a, t.textContent =
|
|
3097
|
+
t.id = a, t.textContent = ri, document.head.appendChild(t);
|
|
1540
3098
|
}
|
|
1541
3099
|
}
|
|
1542
|
-
function
|
|
1543
|
-
if (
|
|
1544
|
-
const a =
|
|
1545
|
-
a ?
|
|
3100
|
+
function fi() {
|
|
3101
|
+
if (!$t) {
|
|
3102
|
+
const a = K.__globalPluginLoader;
|
|
3103
|
+
a ? $t = a : $t = new Ao();
|
|
1546
3104
|
}
|
|
1547
|
-
return
|
|
3105
|
+
return $t;
|
|
1548
3106
|
}
|
|
1549
|
-
class
|
|
3107
|
+
class K extends HTMLElement {
|
|
1550
3108
|
constructor() {
|
|
1551
|
-
if (super(), this.pluginLoader =
|
|
3109
|
+
if (super(), this.pluginLoader = fi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new yn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
|
|
1552
3110
|
const t = this.innerHTML.trim();
|
|
1553
3111
|
t && this.setAttribute("data-initial-content", t);
|
|
1554
3112
|
}
|
|
@@ -1614,13 +3172,13 @@ class g extends HTMLElement {
|
|
|
1614
3172
|
* Wait for the global plugin loader to be available
|
|
1615
3173
|
*/
|
|
1616
3174
|
async waitForPluginLoader() {
|
|
1617
|
-
if (
|
|
1618
|
-
this.pluginLoader =
|
|
3175
|
+
if (K.__globalPluginLoader) {
|
|
3176
|
+
this.pluginLoader = K.__globalPluginLoader;
|
|
1619
3177
|
return;
|
|
1620
3178
|
}
|
|
1621
3179
|
return new Promise((t) => {
|
|
1622
3180
|
const e = () => {
|
|
1623
|
-
|
|
3181
|
+
K.__globalPluginLoader ? (this.pluginLoader = K.__globalPluginLoader, t()) : setTimeout(e, 0);
|
|
1624
3182
|
};
|
|
1625
3183
|
e();
|
|
1626
3184
|
});
|
|
@@ -1649,18 +3207,23 @@ class g extends HTMLElement {
|
|
|
1649
3207
|
async initialize() {
|
|
1650
3208
|
var o;
|
|
1651
3209
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
1652
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3210
|
+
this.setAttribute("data-editora-editor", "true"), ke.add(this), Q || (Q = this), di(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.config.theme && this.classList.add(`editora-theme-${this.config.theme}`);
|
|
1653
3211
|
const t = await this.loadPlugins();
|
|
1654
|
-
this.loadedPlugins = t, t.forEach((
|
|
1655
|
-
if (
|
|
3212
|
+
if (this.loadedPlugins = t, t.forEach((i) => {
|
|
3213
|
+
if (i.init && typeof i.init == "function")
|
|
1656
3214
|
try {
|
|
1657
|
-
|
|
1658
|
-
} catch (
|
|
1659
|
-
console.error(`[RichTextEditor] Error initializing plugin ${
|
|
3215
|
+
i.init({ editorElement: this });
|
|
3216
|
+
} catch (r) {
|
|
3217
|
+
console.error(`[RichTextEditor] Error initializing plugin ${i.name}:`, r);
|
|
1660
3218
|
}
|
|
1661
|
-
})
|
|
1662
|
-
|
|
1663
|
-
|
|
3219
|
+
}), !this.hasAttribute("data-initial-content") && !this.contentElement) {
|
|
3220
|
+
const i = this.innerHTML.trim();
|
|
3221
|
+
i && this.setAttribute("data-initial-content", i);
|
|
3222
|
+
}
|
|
3223
|
+
const e = this.sanitizeLoadedContent(
|
|
3224
|
+
(o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || ""
|
|
3225
|
+
);
|
|
3226
|
+
this.engine = new cn({
|
|
1664
3227
|
content: e,
|
|
1665
3228
|
plugins: t,
|
|
1666
3229
|
readonly: this.config.readonly
|
|
@@ -1683,32 +3246,32 @@ class g extends HTMLElement {
|
|
|
1683
3246
|
*/
|
|
1684
3247
|
async loadPlugins() {
|
|
1685
3248
|
this.pluginLoader || await this.waitForPluginLoader();
|
|
1686
|
-
const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0),
|
|
3249
|
+
const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), i = this.getAccessibilityConfig().checker === !0;
|
|
1687
3250
|
if (e) {
|
|
1688
3251
|
if (typeof this.config.plugins == "string") {
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
for (const
|
|
1692
|
-
const
|
|
1693
|
-
|
|
3252
|
+
const r = this.config.plugins.split(/\s+/).filter(Boolean);
|
|
3253
|
+
i && !r.includes("a11yChecker") && r.push("a11yChecker");
|
|
3254
|
+
for (const l of r) {
|
|
3255
|
+
const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
|
|
3256
|
+
c && t.push(c);
|
|
1694
3257
|
}
|
|
1695
3258
|
} else if (Array.isArray(this.config.plugins)) {
|
|
1696
|
-
for (const
|
|
1697
|
-
if (typeof
|
|
1698
|
-
const
|
|
1699
|
-
|
|
3259
|
+
for (const r of this.config.plugins)
|
|
3260
|
+
if (typeof r == "string") {
|
|
3261
|
+
const l = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
|
|
3262
|
+
l && t.push(l);
|
|
1700
3263
|
} else
|
|
1701
|
-
t.push(
|
|
1702
|
-
if (
|
|
1703
|
-
const
|
|
1704
|
-
|
|
3264
|
+
t.push(r);
|
|
3265
|
+
if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3266
|
+
const r = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3267
|
+
r && t.push(r);
|
|
1705
3268
|
}
|
|
1706
3269
|
}
|
|
1707
3270
|
} else {
|
|
1708
|
-
const
|
|
1709
|
-
for (const
|
|
1710
|
-
const
|
|
1711
|
-
|
|
3271
|
+
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3272
|
+
for (const l of r) {
|
|
3273
|
+
const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
|
|
3274
|
+
c && t.push(c);
|
|
1712
3275
|
}
|
|
1713
3276
|
}
|
|
1714
3277
|
return t;
|
|
@@ -1827,30 +3390,30 @@ class g extends HTMLElement {
|
|
|
1827
3390
|
this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
|
|
1828
3391
|
}
|
|
1829
3392
|
executeCommand(t, ...e) {
|
|
1830
|
-
var
|
|
3393
|
+
var r;
|
|
1831
3394
|
typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
|
|
1832
3395
|
const o = {
|
|
1833
3396
|
editorElement: this,
|
|
1834
3397
|
contentElement: this.contentElement,
|
|
1835
3398
|
toolbarElement: this.toolbarElement
|
|
1836
|
-
},
|
|
1837
|
-
if (
|
|
1838
|
-
const
|
|
1839
|
-
if (typeof
|
|
3399
|
+
}, i = this.loadedPlugins.find((l) => l.commands && l.commands[t]);
|
|
3400
|
+
if (i && i.commands) {
|
|
3401
|
+
const l = i.commands[t];
|
|
3402
|
+
if (typeof l == "function")
|
|
1840
3403
|
try {
|
|
1841
|
-
return t === "toggleFullscreen" ?
|
|
1842
|
-
} catch (
|
|
1843
|
-
return console.error(`[RichTextEditor] Error executing native command ${t}:`,
|
|
3404
|
+
return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
|
|
3405
|
+
} catch (c) {
|
|
3406
|
+
return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
|
|
1844
3407
|
}
|
|
1845
3408
|
}
|
|
1846
|
-
return ((
|
|
3409
|
+
return ((r = this.engine) == null ? void 0 : r.execCommand(t, ...e)) || !1;
|
|
1847
3410
|
}
|
|
1848
3411
|
getPluginLoadConfig(t) {
|
|
1849
3412
|
const e = this.config.pluginConfig;
|
|
1850
3413
|
if (e && typeof e == "object") {
|
|
1851
|
-
const
|
|
1852
|
-
if (
|
|
1853
|
-
return
|
|
3414
|
+
const r = e[t];
|
|
3415
|
+
if (r && typeof r == "object")
|
|
3416
|
+
return r;
|
|
1854
3417
|
}
|
|
1855
3418
|
const o = {
|
|
1856
3419
|
spellCheck: ["spellcheck", "spellCheck"],
|
|
@@ -1869,15 +3432,15 @@ class g extends HTMLElement {
|
|
|
1869
3432
|
"slash-commands": ["slashcommands", "slash-commands", "slashCommands"],
|
|
1870
3433
|
formatPainter: ["formatpainter", "format-painter", "formatPainter"],
|
|
1871
3434
|
"format-painter": ["formatpainter", "format-painter", "formatPainter"]
|
|
1872
|
-
},
|
|
3435
|
+
}, i = [
|
|
1873
3436
|
t,
|
|
1874
3437
|
t.toLowerCase(),
|
|
1875
3438
|
...o[t] || []
|
|
1876
3439
|
];
|
|
1877
|
-
for (const
|
|
1878
|
-
const
|
|
1879
|
-
if (
|
|
1880
|
-
return
|
|
3440
|
+
for (const r of i) {
|
|
3441
|
+
const l = this.config[r];
|
|
3442
|
+
if (l && typeof l == "object" && !Array.isArray(l))
|
|
3443
|
+
return l;
|
|
1881
3444
|
}
|
|
1882
3445
|
}
|
|
1883
3446
|
getContentSanitizeConfig() {
|
|
@@ -1888,6 +3451,14 @@ class g extends HTMLElement {
|
|
|
1888
3451
|
const t = this.config.security;
|
|
1889
3452
|
return t && typeof t == "object" ? t : { sanitizeOnPaste: !0, sanitizeOnInput: !0 };
|
|
1890
3453
|
}
|
|
3454
|
+
/**
|
|
3455
|
+
* HTML handed to the editor from outside (initial markup, restored autosave, setContent).
|
|
3456
|
+
* Same allowlist and opt-outs as typed input, applied before the markup is parsed into the
|
|
3457
|
+
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3458
|
+
*/
|
|
3459
|
+
sanitizeLoadedContent(t) {
|
|
3460
|
+
return vo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3461
|
+
}
|
|
1891
3462
|
getAutosaveConfig() {
|
|
1892
3463
|
var e, o;
|
|
1893
3464
|
const t = this.config.autosave;
|
|
@@ -1899,10 +3470,10 @@ class g extends HTMLElement {
|
|
|
1899
3470
|
provider: "localStorage"
|
|
1900
3471
|
};
|
|
1901
3472
|
if (t && typeof t == "object") {
|
|
1902
|
-
const
|
|
3473
|
+
const i = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
|
|
1903
3474
|
return {
|
|
1904
3475
|
enabled: !!t.enabled,
|
|
1905
|
-
intervalMs: Number.isFinite(
|
|
3476
|
+
intervalMs: Number.isFinite(i) && i > 0 ? i : 3e4,
|
|
1906
3477
|
storageKey: String(t.storageKey || "rte-autosave"),
|
|
1907
3478
|
provider: t.provider || "localStorage",
|
|
1908
3479
|
apiUrl: t.apiUrl
|
|
@@ -1964,12 +3535,12 @@ class g extends HTMLElement {
|
|
|
1964
3535
|
if (e && e.rangeCount > 0) {
|
|
1965
3536
|
const o = e.getRangeAt(0);
|
|
1966
3537
|
o.deleteContents();
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
for (;
|
|
1971
|
-
|
|
1972
|
-
o.insertNode(
|
|
3538
|
+
const i = document.createElement("div");
|
|
3539
|
+
i.innerHTML = t;
|
|
3540
|
+
const r = document.createDocumentFragment();
|
|
3541
|
+
for (; i.firstChild; )
|
|
3542
|
+
r.appendChild(i.firstChild);
|
|
3543
|
+
o.insertNode(r), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
|
|
1973
3544
|
} else
|
|
1974
3545
|
this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
|
|
1975
3546
|
}
|
|
@@ -1977,8 +3548,8 @@ class g extends HTMLElement {
|
|
|
1977
3548
|
* Create UI elements
|
|
1978
3549
|
*/
|
|
1979
3550
|
createUI(t, e) {
|
|
1980
|
-
const o = this.querySelector('[slot="toolbar"]'),
|
|
1981
|
-
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new
|
|
3551
|
+
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3552
|
+
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new dn(
|
|
1982
3553
|
{
|
|
1983
3554
|
items: this.resolveToolbarItems(),
|
|
1984
3555
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -1987,37 +3558,37 @@ class g extends HTMLElement {
|
|
|
1987
3558
|
t,
|
|
1988
3559
|
this.pluginLoader
|
|
1989
3560
|
// Pass plugin loader to get all registered plugins
|
|
1990
|
-
), this.toolbar.setCommandHandler((
|
|
1991
|
-
var
|
|
3561
|
+
), this.toolbar.setCommandHandler((r, l) => {
|
|
3562
|
+
var c;
|
|
1992
3563
|
if (this.contentElement) {
|
|
1993
3564
|
this.contentElement.focus();
|
|
1994
|
-
const
|
|
1995
|
-
if (!
|
|
1996
|
-
const
|
|
1997
|
-
|
|
3565
|
+
const p = window.getSelection();
|
|
3566
|
+
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3567
|
+
const m = document.createRange(), v = this.contentElement.lastChild || this.contentElement;
|
|
3568
|
+
v.nodeType === Node.TEXT_NODE ? m.setStart(v, ((c = v.textContent) == null ? void 0 : c.length) || 0) : v.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(v), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
|
|
1998
3569
|
}
|
|
1999
3570
|
}
|
|
2000
|
-
return this.executeCommand(
|
|
3571
|
+
return this.executeCommand(r, l);
|
|
2001
3572
|
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
2002
3573
|
try {
|
|
2003
3574
|
document.execCommand("defaultParagraphSeparator", !1, "p");
|
|
2004
|
-
} catch (
|
|
2005
|
-
console.warn("defaultParagraphSeparator not supported:",
|
|
3575
|
+
} catch (r) {
|
|
3576
|
+
console.warn("defaultParagraphSeparator not supported:", r);
|
|
2006
3577
|
}
|
|
2007
3578
|
if (e) {
|
|
2008
|
-
const
|
|
2009
|
-
|
|
2010
|
-
if (
|
|
2011
|
-
const
|
|
2012
|
-
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(
|
|
3579
|
+
const r = document.createElement("div");
|
|
3580
|
+
r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
|
|
3581
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
3582
|
+
const p = c.tagName;
|
|
3583
|
+
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
|
|
2013
3584
|
}
|
|
2014
3585
|
return !1;
|
|
2015
3586
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
2016
3587
|
} else
|
|
2017
3588
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
2018
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
2019
|
-
var
|
|
2020
|
-
return (
|
|
3589
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new un({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new fn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
3590
|
+
var r;
|
|
3591
|
+
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
2021
3592
|
}, 0);
|
|
2022
3593
|
}
|
|
2023
3594
|
/**
|
|
@@ -2028,69 +3599,70 @@ class g extends HTMLElement {
|
|
|
2028
3599
|
const t = this.keyboardShortcutManager;
|
|
2029
3600
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
2030
3601
|
this.lastBeforeInputType = o.inputType || null;
|
|
2031
|
-
}), this.contentElement.addEventListener("input", () => {
|
|
3602
|
+
}), this.contentElement.addEventListener("input", (o) => {
|
|
3603
|
+
var C;
|
|
2032
3604
|
if (!this.contentElement) return;
|
|
2033
|
-
let
|
|
2034
|
-
const
|
|
2035
|
-
if (this.lastBeforeInputType = null,
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2038
|
-
const
|
|
2039
|
-
if (this.contentElement.innerHTML =
|
|
3605
|
+
let i = this.contentElement.innerHTML;
|
|
3606
|
+
const r = (C = o == null ? void 0 : o.detail) == null ? void 0 : C.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3607
|
+
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3608
|
+
const w = vo(i, c, p, r);
|
|
3609
|
+
if (w !== i) {
|
|
3610
|
+
const E = window.getSelection(), Y = E && E.rangeCount > 0 ? E.getRangeAt(0) : null;
|
|
3611
|
+
if (this.contentElement.innerHTML = w, Y && E)
|
|
2040
3612
|
try {
|
|
2041
|
-
|
|
2042
|
-
} catch (
|
|
3613
|
+
E.removeAllRanges(), E.addRange(Y);
|
|
3614
|
+
} catch (D) {
|
|
2043
3615
|
}
|
|
2044
|
-
|
|
3616
|
+
i = w;
|
|
2045
3617
|
}
|
|
2046
3618
|
}
|
|
2047
3619
|
this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
2048
|
-
const
|
|
3620
|
+
const A = () => {
|
|
2049
3621
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
2050
|
-
detail: { html:
|
|
3622
|
+
detail: { html: i },
|
|
2051
3623
|
bubbles: !0
|
|
2052
3624
|
}));
|
|
2053
3625
|
};
|
|
2054
|
-
|
|
3626
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(A, l.debounceInputMs) : A(), this.updateStatusBar();
|
|
2055
3627
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
2056
|
-
const
|
|
2057
|
-
(
|
|
3628
|
+
const i = this.config.contextMenu;
|
|
3629
|
+
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
2058
3630
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
2059
|
-
var
|
|
3631
|
+
var v, A;
|
|
2060
3632
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
2061
3633
|
return;
|
|
2062
3634
|
o.preventDefault();
|
|
2063
|
-
const
|
|
2064
|
-
let
|
|
2065
|
-
const
|
|
2066
|
-
if ((
|
|
2067
|
-
document.execCommand("insertText", !1,
|
|
3635
|
+
const i = this.config.paste || {};
|
|
3636
|
+
let r = ((v = o.clipboardData) == null ? void 0 : v.getData("text/html")) || "";
|
|
3637
|
+
const l = ((A = o.clipboardData) == null ? void 0 : A.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3638
|
+
if ((i.clean || !i.keepFormatting) && l) {
|
|
3639
|
+
document.execCommand("insertText", !1, l);
|
|
2068
3640
|
return;
|
|
2069
3641
|
}
|
|
2070
|
-
if (
|
|
2071
|
-
document.execCommand("insertText", !1,
|
|
3642
|
+
if (i.convertWord === !1 && m && l) {
|
|
3643
|
+
document.execCommand("insertText", !1, l);
|
|
2072
3644
|
return;
|
|
2073
3645
|
}
|
|
2074
|
-
if (
|
|
2075
|
-
|
|
3646
|
+
if (r) {
|
|
3647
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ii(r, c, p)), this.insertHTMLAtSelection(r);
|
|
2076
3648
|
return;
|
|
2077
3649
|
}
|
|
2078
|
-
|
|
3650
|
+
l && document.execCommand("insertText", !1, l);
|
|
2079
3651
|
}), this.contentElement.addEventListener("focus", () => {
|
|
2080
|
-
|
|
3652
|
+
Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
2081
3653
|
}), this.contentElement.addEventListener("blur", () => {
|
|
2082
3654
|
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
|
|
2083
3655
|
detail: { html: this.contentElement.innerHTML },
|
|
2084
3656
|
bubbles: !0
|
|
2085
3657
|
})), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
2086
3658
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
2087
|
-
this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (
|
|
2088
|
-
this.executeCommand(
|
|
3659
|
+
this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, l) => {
|
|
3660
|
+
this.executeCommand(r, l);
|
|
2089
3661
|
});
|
|
2090
3662
|
});
|
|
2091
3663
|
const e = () => {
|
|
2092
|
-
const o = this.getSelectionRangeInEditor(),
|
|
2093
|
-
this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !
|
|
3664
|
+
const o = this.getSelectionRangeInEditor(), i = document.activeElement, r = !!i && !!this.contentElement && (i === this.contentElement || this.contentElement.contains(i));
|
|
3665
|
+
this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !r || !o && !r || (this.updateFloatingToolbar(), this.updateStatusBar());
|
|
2094
3666
|
};
|
|
2095
3667
|
this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
|
|
2096
3668
|
}
|
|
@@ -2112,7 +3684,7 @@ class g extends HTMLElement {
|
|
|
2112
3684
|
}
|
|
2113
3685
|
}
|
|
2114
3686
|
getSelectionAnchorRect(t, e) {
|
|
2115
|
-
const o = Array.from(e.getClientRects()).filter((
|
|
3687
|
+
const o = Array.from(e.getClientRects()).filter((r) => r.width > 0 || r.height > 0);
|
|
2116
3688
|
return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
|
|
2117
3689
|
}
|
|
2118
3690
|
/**
|
|
@@ -2120,7 +3692,7 @@ class g extends HTMLElement {
|
|
|
2120
3692
|
*/
|
|
2121
3693
|
updateFloatingToolbar() {
|
|
2122
3694
|
if (!this.floatingToolbar || !this.contentElement) return;
|
|
2123
|
-
if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.getAttribute("readonly")
|
|
3695
|
+
if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.isReadonlyAttribute(this.getAttribute("readonly")) || this.getAttribute("data-readonly") === "true") {
|
|
2124
3696
|
this.floatingToolbar.hide();
|
|
2125
3697
|
return;
|
|
2126
3698
|
}
|
|
@@ -2129,26 +3701,26 @@ class g extends HTMLElement {
|
|
|
2129
3701
|
this.floatingToolbar.hide();
|
|
2130
3702
|
return;
|
|
2131
3703
|
}
|
|
2132
|
-
const
|
|
2133
|
-
if (!
|
|
3704
|
+
const i = this.getSelectionRangeInEditor();
|
|
3705
|
+
if (!i) {
|
|
2134
3706
|
this.floatingToolbar.hide();
|
|
2135
3707
|
return;
|
|
2136
3708
|
}
|
|
2137
|
-
if (
|
|
3709
|
+
if (i.collapsed) {
|
|
2138
3710
|
this.floatingToolbar.hide();
|
|
2139
3711
|
return;
|
|
2140
3712
|
}
|
|
2141
|
-
const
|
|
2142
|
-
if (!
|
|
3713
|
+
const r = window.getSelection();
|
|
3714
|
+
if (!r) {
|
|
2143
3715
|
this.floatingToolbar.hide();
|
|
2144
3716
|
return;
|
|
2145
3717
|
}
|
|
2146
|
-
const
|
|
2147
|
-
if (!
|
|
3718
|
+
const l = this.getSelectionAnchorRect(r, i);
|
|
3719
|
+
if (!l) {
|
|
2148
3720
|
this.floatingToolbar.hide();
|
|
2149
3721
|
return;
|
|
2150
3722
|
}
|
|
2151
|
-
this.floatingToolbar.show(
|
|
3723
|
+
this.floatingToolbar.show(l.left, l.top - 40);
|
|
2152
3724
|
}
|
|
2153
3725
|
/**
|
|
2154
3726
|
* Update status bar with selection and cursor information
|
|
@@ -2161,24 +3733,31 @@ class g extends HTMLElement {
|
|
|
2161
3733
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
2162
3734
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
2163
3735
|
return;
|
|
2164
|
-
const o = this.contentElement.textContent || "", { words:
|
|
2165
|
-
let
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2168
|
-
wordCount:
|
|
2169
|
-
charCount:
|
|
2170
|
-
lineCount:
|
|
2171
|
-
cursorPosition:
|
|
2172
|
-
selectionInfo:
|
|
3736
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = gn(o), l = mn(this.contentElement);
|
|
3737
|
+
let c, p;
|
|
3738
|
+
const m = this.getSelectionRangeInEditor();
|
|
3739
|
+
m && (c = pn(this.contentElement, m), m.collapsed || (p = bn(m, c), c = void 0)), this.statusBar.update({
|
|
3740
|
+
wordCount: i,
|
|
3741
|
+
charCount: r,
|
|
3742
|
+
lineCount: l,
|
|
3743
|
+
cursorPosition: c,
|
|
3744
|
+
selectionInfo: p
|
|
2173
3745
|
});
|
|
2174
3746
|
}
|
|
3747
|
+
/**
|
|
3748
|
+
* `<editora-editor readonly>` and `readonly="true"` both lock the editor; only
|
|
3749
|
+
* removing the attribute or `readonly="false"` unlocks it.
|
|
3750
|
+
*/
|
|
3751
|
+
isReadonlyAttribute(t) {
|
|
3752
|
+
return t !== null && t !== "false";
|
|
3753
|
+
}
|
|
2175
3754
|
/**
|
|
2176
3755
|
* Handle attribute changes
|
|
2177
3756
|
*/
|
|
2178
3757
|
handleAttributeChange(t, e) {
|
|
2179
3758
|
switch (t) {
|
|
2180
3759
|
case "readonly":
|
|
2181
|
-
this.contentElement && (this.contentElement.contentEditable = e
|
|
3760
|
+
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
|
|
2182
3761
|
break;
|
|
2183
3762
|
case "theme":
|
|
2184
3763
|
this.classList.forEach((o) => {
|
|
@@ -2249,7 +3828,7 @@ class g extends HTMLElement {
|
|
|
2249
3828
|
const o = this.attributes[e];
|
|
2250
3829
|
t[o.name] = o.value;
|
|
2251
3830
|
}
|
|
2252
|
-
return
|
|
3831
|
+
return Te.resolve({
|
|
2253
3832
|
jsConfig: this.jsConfig,
|
|
2254
3833
|
attributes: t
|
|
2255
3834
|
});
|
|
@@ -2264,7 +3843,7 @@ class g extends HTMLElement {
|
|
|
2264
3843
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
2265
3844
|
},
|
|
2266
3845
|
setContent: (t) => {
|
|
2267
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3846
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
2268
3847
|
},
|
|
2269
3848
|
execCommand: (t, e) => this.executeCommand(t, e),
|
|
2270
3849
|
focus: () => {
|
|
@@ -2289,8 +3868,8 @@ class g extends HTMLElement {
|
|
|
2289
3868
|
* Destroy the editor
|
|
2290
3869
|
*/
|
|
2291
3870
|
destroy() {
|
|
2292
|
-
var t, e, o,
|
|
2293
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (
|
|
3871
|
+
var t, e, o, i;
|
|
3872
|
+
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, ke.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
2294
3873
|
}
|
|
2295
3874
|
// Public API methods
|
|
2296
3875
|
getContent() {
|
|
@@ -2298,7 +3877,7 @@ class g extends HTMLElement {
|
|
|
2298
3877
|
return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
|
|
2299
3878
|
}
|
|
2300
3879
|
setContent(t) {
|
|
2301
|
-
this.contentElement && (this.contentElement.innerHTML = t);
|
|
3880
|
+
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
2302
3881
|
}
|
|
2303
3882
|
execCommand(t, ...e) {
|
|
2304
3883
|
return this.executeCommand(t, ...e);
|
|
@@ -2312,37 +3891,37 @@ class g extends HTMLElement {
|
|
|
2312
3891
|
(t = this.contentElement) == null || t.blur();
|
|
2313
3892
|
}
|
|
2314
3893
|
}
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2317
|
-
const
|
|
3894
|
+
const xe = new Ao();
|
|
3895
|
+
K.__globalPluginLoader = xe;
|
|
3896
|
+
const pi = {
|
|
2318
3897
|
// Core editing plugins (always loaded)
|
|
2319
3898
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
|
|
2320
3899
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
|
|
2321
3900
|
underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((a) => a.UnderlinePlugin()),
|
|
2322
3901
|
strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((a) => a.StrikethroughPlugin()),
|
|
2323
|
-
clearFormatting: () => import("./ClearFormattingPlugin.native-
|
|
3902
|
+
clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((a) => a.ClearFormattingPlugin()),
|
|
2324
3903
|
heading: () => import("./HeadingPlugin.native-DZdvubrQ.mjs").then((a) => a.HeadingPlugin()),
|
|
2325
3904
|
blockquote: () => import("./BlockquotePlugin.native-57_Xcjl1.mjs").then((a) => a.BlockquotePlugin()),
|
|
2326
|
-
code: () => import("./CodePlugin.native-
|
|
2327
|
-
list: () => import("./ListPlugin.native-
|
|
2328
|
-
history: () => import("./HistoryPlugin.native-
|
|
3905
|
+
code: () => import("./CodePlugin.native-hNgfXlfS.mjs").then((a) => a.CodePlugin()),
|
|
3906
|
+
list: () => import("./ListPlugin.native-Bt0LANbO.mjs").then((a) => a.ListPlugin()),
|
|
3907
|
+
history: () => import("./HistoryPlugin.native-DPvhks6h.mjs").then((a) => a.HistoryPlugin())
|
|
2329
3908
|
};
|
|
2330
|
-
async function
|
|
2331
|
-
return Object.entries(
|
|
2332
|
-
|
|
2333
|
-
}),
|
|
3909
|
+
async function hi() {
|
|
3910
|
+
return Object.entries(pi).forEach(([a, t]) => {
|
|
3911
|
+
xe.register(a, t);
|
|
3912
|
+
}), xe;
|
|
2334
3913
|
}
|
|
2335
|
-
typeof window != "undefined" &&
|
|
2336
|
-
|
|
3914
|
+
typeof window != "undefined" && hi().then((a) => {
|
|
3915
|
+
K.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", K);
|
|
2337
3916
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
2338
3917
|
t.forEach((o) => {
|
|
2339
|
-
const
|
|
2340
|
-
|
|
2341
|
-
}), t.forEach((o,
|
|
2342
|
-
o instanceof
|
|
3918
|
+
const i = o.innerHTML.trim();
|
|
3919
|
+
i && (e.push(i), o.setAttribute("data-initial-content", i), o.innerHTML = "");
|
|
3920
|
+
}), t.forEach((o, i) => {
|
|
3921
|
+
o instanceof K && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
|
|
2343
3922
|
});
|
|
2344
3923
|
});
|
|
2345
3924
|
export {
|
|
2346
|
-
|
|
3925
|
+
hi as initWebComponent
|
|
2347
3926
|
};
|
|
2348
3927
|
//# sourceMappingURL=webcomponent-core.js.map
|