@editora/core 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
- package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-449ce66c.mjs} +79 -40
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
- package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
- package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs} +119 -60
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
- package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
- package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
- package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-169fb1e8.mjs} +137 -69
- package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
- package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
- package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-4983143a.mjs} +108 -51
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-63ed405b.mjs} +100 -50
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-427e9d75.mjs} +79 -40
- package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-8e41eda0.mjs} +115 -58
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
- package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
- package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
- package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
- package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
- package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
- package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
- package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-3b1e8c05.mjs} +89 -45
- package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-7ab10b9f.mjs} +107 -54
- package/dist/{PageBreakPlugin.native-DijGuHJZ.mjs → PageBreakPlugin.native-1794c5fb.mjs} +31 -16
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-f7b67cc0.mjs} +11 -6
- package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-8d45e511.mjs} +72 -37
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-a6c5efec.mjs} +99 -50
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
- package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
- package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
- package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
- package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
- package/dist/{TrackChangesPlugin.native-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs} +115 -58
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-4e711b1e.mjs} +160 -91
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-5bbeff85.mjs} +51 -26
- package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
- package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
- package/dist/documentManager-8327fb6e.mjs +9166 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
- package/dist/editora.min.js +14 -13
- package/dist/editora.umd.js +14 -13
- package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
- package/dist/index-072ef022.js +11 -0
- package/dist/index-49d31221.mjs +16860 -0
- package/dist/{index-DqC57IEH.mjs → index-7da30697.mjs} +163 -124
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-b47a189f.mjs +5782 -0
- package/dist/index.esm.js +12 -7
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
- package/dist/plugin-loader.js +67 -67
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
- package/dist/style.css +1 -0
- package/dist/webcomponent-core.js +164 -125
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +18 -17
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +226 -187
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1324 -1117
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
- package/dist/core.css +0 -1
- package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
- package/dist/index-BslAFzmv.mjs +0 -16544
- package/dist/index-D1LOqg5C.js +0 -10
- package/dist/index.es-BYD2KEo6.mjs +0 -6666
|
@@ -10,7 +10,7 @@ class v {
|
|
|
10
10
|
return new v(t, e || this.selection, this.schema);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class D {
|
|
14
14
|
constructor(t, e) {
|
|
15
15
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@ class N {
|
|
|
21
21
|
return { type: "text", text: t, marks: e };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class N {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -58,7 +58,7 @@ class P {
|
|
|
58
58
|
const t = {}, e = {};
|
|
59
59
|
return this.plugins.forEach((o) => {
|
|
60
60
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
61
|
-
}), new
|
|
61
|
+
}), new D(t, e);
|
|
62
62
|
}
|
|
63
63
|
getCommands() {
|
|
64
64
|
const t = {};
|
|
@@ -112,7 +112,7 @@ class P {
|
|
|
112
112
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class P {
|
|
116
116
|
constructor(t) {
|
|
117
117
|
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) => {
|
|
118
118
|
this.registerShortcut(e);
|
|
@@ -398,7 +398,8 @@ class O {
|
|
|
398
398
|
return t.ctrlKey && e.push("ctrl"), t.altKey && e.push("alt"), t.shiftKey && e.push("shift"), t.metaKey && e.push("meta"), e.push(t.key.toLowerCase()), e.join("+");
|
|
399
399
|
}
|
|
400
400
|
handleKeyDown(t, e) {
|
|
401
|
-
if (!this.enabled)
|
|
401
|
+
if (!this.enabled)
|
|
402
|
+
return !1;
|
|
402
403
|
const o = this.getEventKey(t), n = this.shortcuts.get(o);
|
|
403
404
|
return n ? (n.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(n.command, n.params), !0) : !1;
|
|
404
405
|
}
|
|
@@ -447,7 +448,7 @@ class O {
|
|
|
447
448
|
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";
|
|
448
449
|
}
|
|
449
450
|
}
|
|
450
|
-
class
|
|
451
|
+
class O {
|
|
451
452
|
constructor(t = {}) {
|
|
452
453
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
453
454
|
this.register(e, o);
|
|
@@ -490,11 +491,11 @@ class B {
|
|
|
490
491
|
this.commands.clear();
|
|
491
492
|
}
|
|
492
493
|
}
|
|
493
|
-
class
|
|
494
|
+
class B {
|
|
494
495
|
constructor(t = {}) {
|
|
495
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
496
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new N(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
496
497
|
const e = this.pluginManager.buildSchema();
|
|
497
|
-
this.state = v.create(e), this.commandRegistry = new
|
|
498
|
+
this.state = v.create(e), this.commandRegistry = new O(this.pluginManager.getCommands());
|
|
498
499
|
}
|
|
499
500
|
/**
|
|
500
501
|
* Execute a command
|
|
@@ -576,10 +577,11 @@ class z {
|
|
|
576
577
|
return this.isDestroyed;
|
|
577
578
|
}
|
|
578
579
|
}
|
|
579
|
-
class
|
|
580
|
+
class z {
|
|
580
581
|
// PluginLoader instance to get all registered plugins
|
|
581
582
|
setLastCommandTrigger(t, e) {
|
|
582
|
-
if (typeof window == "undefined" || !t)
|
|
583
|
+
if (typeof window == "undefined" || !t)
|
|
584
|
+
return;
|
|
583
585
|
const o = e || t.getAttribute("data-command") || void 0;
|
|
584
586
|
o && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = o);
|
|
585
587
|
}
|
|
@@ -886,7 +888,8 @@ class R {
|
|
|
886
888
|
* Update button state
|
|
887
889
|
*/
|
|
888
890
|
updateButtonState(t, e) {
|
|
889
|
-
if (!this.container)
|
|
891
|
+
if (!this.container)
|
|
892
|
+
return;
|
|
890
893
|
const o = this.container.querySelector(
|
|
891
894
|
`[data-command="${t}"]`
|
|
892
895
|
);
|
|
@@ -902,7 +905,7 @@ class R {
|
|
|
902
905
|
}), this.container.innerHTML = ""), this.commandHandler = void 0;
|
|
903
906
|
}
|
|
904
907
|
}
|
|
905
|
-
class
|
|
908
|
+
class R {
|
|
906
909
|
constructor(t) {
|
|
907
910
|
this.visible = !1, this.config = t;
|
|
908
911
|
}
|
|
@@ -944,7 +947,7 @@ class H {
|
|
|
944
947
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
945
948
|
}
|
|
946
949
|
}
|
|
947
|
-
class
|
|
950
|
+
class H {
|
|
948
951
|
constructor(t = {}) {
|
|
949
952
|
this.statusInfo = {}, this.config = t;
|
|
950
953
|
}
|
|
@@ -965,7 +968,8 @@ class j {
|
|
|
965
968
|
* Render status bar content
|
|
966
969
|
*/
|
|
967
970
|
render() {
|
|
968
|
-
if (!this.container)
|
|
971
|
+
if (!this.container)
|
|
972
|
+
return;
|
|
969
973
|
this.container.innerHTML = "";
|
|
970
974
|
const t = document.createElement("div");
|
|
971
975
|
t.className = "editora-statusbar-left";
|
|
@@ -1004,12 +1008,12 @@ class j {
|
|
|
1004
1008
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
1005
1009
|
}
|
|
1006
1010
|
}
|
|
1007
|
-
function
|
|
1008
|
-
const e = s.textContent || "", o =
|
|
1011
|
+
function j(s, t) {
|
|
1012
|
+
const e = s.textContent || "", o = F(s, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
|
|
1009
1013
|
`), r = i.length, a = i[i.length - 1].length + 1;
|
|
1010
1014
|
return { line: r, column: a };
|
|
1011
1015
|
}
|
|
1012
|
-
function
|
|
1016
|
+
function F(s, t, e) {
|
|
1013
1017
|
var r;
|
|
1014
1018
|
let o = 0;
|
|
1015
1019
|
const n = document.createTreeWalker(
|
|
@@ -1022,12 +1026,13 @@ function $(s, t, e) {
|
|
|
1022
1026
|
if (i === t) {
|
|
1023
1027
|
o += e;
|
|
1024
1028
|
break;
|
|
1025
|
-
} else
|
|
1029
|
+
} else
|
|
1030
|
+
i.nodeType === Node.TEXT_NODE && (o += ((r = i.textContent) == null ? void 0 : r.length) || 0);
|
|
1026
1031
|
i = n.nextNode();
|
|
1027
1032
|
}
|
|
1028
1033
|
return o;
|
|
1029
1034
|
}
|
|
1030
|
-
function
|
|
1035
|
+
function $(s) {
|
|
1031
1036
|
var o, n;
|
|
1032
1037
|
const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
1033
1038
|
let e = 1;
|
|
@@ -1042,11 +1047,11 @@ function _(s) {
|
|
|
1042
1047
|
}
|
|
1043
1048
|
return e;
|
|
1044
1049
|
}
|
|
1045
|
-
function
|
|
1050
|
+
function _(s) {
|
|
1046
1051
|
const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
|
|
1047
1052
|
return { words: t, chars: e };
|
|
1048
1053
|
}
|
|
1049
|
-
function
|
|
1054
|
+
function W(s, t) {
|
|
1050
1055
|
const e = s.toString();
|
|
1051
1056
|
return {
|
|
1052
1057
|
startLine: t.line,
|
|
@@ -1058,7 +1063,7 @@ function U(s, t) {
|
|
|
1058
1063
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
1059
1064
|
};
|
|
1060
1065
|
}
|
|
1061
|
-
|
|
1066
|
+
class A {
|
|
1062
1067
|
/**
|
|
1063
1068
|
* Resolve configuration from multiple sources with priority
|
|
1064
1069
|
*/
|
|
@@ -1205,10 +1210,14 @@ const E = class E {
|
|
|
1205
1210
|
* Parse attribute value to appropriate type
|
|
1206
1211
|
*/
|
|
1207
1212
|
static parseAttributeValue(t) {
|
|
1208
|
-
if (t === "true")
|
|
1209
|
-
|
|
1210
|
-
if (
|
|
1211
|
-
|
|
1213
|
+
if (t === "true")
|
|
1214
|
+
return !0;
|
|
1215
|
+
if (t === "false")
|
|
1216
|
+
return !1;
|
|
1217
|
+
if (/^\d+$/.test(t))
|
|
1218
|
+
return parseInt(t, 10);
|
|
1219
|
+
if (/^\d+\.\d+$/.test(t))
|
|
1220
|
+
return parseFloat(t);
|
|
1212
1221
|
if (t.startsWith("{") || t.startsWith("["))
|
|
1213
1222
|
try {
|
|
1214
1223
|
return JSON.parse(t);
|
|
@@ -1249,8 +1258,8 @@ const E = class E {
|
|
|
1249
1258
|
i != null && (typeof i == "object" && !Array.isArray(i) && e[n] ? e[n] = this.merge(e[n], i) : e[n] = i);
|
|
1250
1259
|
return e;
|
|
1251
1260
|
}
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1261
|
+
}
|
|
1262
|
+
A.EDITOR_DEFAULTS = {
|
|
1254
1263
|
height: 400,
|
|
1255
1264
|
width: "100%",
|
|
1256
1265
|
readonly: !1,
|
|
@@ -1300,8 +1309,7 @@ E.EDITOR_DEFAULTS = {
|
|
|
1300
1309
|
},
|
|
1301
1310
|
statusbar: !1
|
|
1302
1311
|
};
|
|
1303
|
-
|
|
1304
|
-
class K {
|
|
1312
|
+
class U {
|
|
1305
1313
|
constructor() {
|
|
1306
1314
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
1307
1315
|
}
|
|
@@ -1375,7 +1383,7 @@ class K {
|
|
|
1375
1383
|
return this.loadedPlugins.has(t);
|
|
1376
1384
|
}
|
|
1377
1385
|
}
|
|
1378
|
-
const
|
|
1386
|
+
const K = [
|
|
1379
1387
|
"p",
|
|
1380
1388
|
"br",
|
|
1381
1389
|
"strong",
|
|
@@ -1414,7 +1422,7 @@ const q = [
|
|
|
1414
1422
|
"sup",
|
|
1415
1423
|
"sub",
|
|
1416
1424
|
"hr"
|
|
1417
|
-
],
|
|
1425
|
+
], q = {
|
|
1418
1426
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck"],
|
|
1419
1427
|
a: ["href", "target", "rel", "title"],
|
|
1420
1428
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -1424,13 +1432,13 @@ const q = [
|
|
|
1424
1432
|
td: ["colspan", "rowspan", "align", "valign"],
|
|
1425
1433
|
th: ["colspan", "rowspan", "align", "valign"]
|
|
1426
1434
|
};
|
|
1427
|
-
function
|
|
1435
|
+
function M(s, t, e) {
|
|
1428
1436
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
1429
1437
|
return s;
|
|
1430
|
-
const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
1431
|
-
return r.innerHTML = s,
|
|
1438
|
+
const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : K, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : q, r = document.createElement("div");
|
|
1439
|
+
return r.innerHTML = s, L(r, o, i), r.innerHTML;
|
|
1432
1440
|
}
|
|
1433
|
-
function
|
|
1441
|
+
function L(s, t, e) {
|
|
1434
1442
|
const o = Array.from(s.childNodes);
|
|
1435
1443
|
for (const n of o)
|
|
1436
1444
|
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -1441,10 +1449,11 @@ function I(s, t, e) {
|
|
|
1441
1449
|
s.removeChild(i);
|
|
1442
1450
|
continue;
|
|
1443
1451
|
}
|
|
1444
|
-
|
|
1445
|
-
} else
|
|
1452
|
+
V(i, e), L(i, t, e);
|
|
1453
|
+
} else
|
|
1454
|
+
n.nodeType !== Node.TEXT_NODE && s.removeChild(n);
|
|
1446
1455
|
}
|
|
1447
|
-
function
|
|
1456
|
+
function V(s, t) {
|
|
1448
1457
|
const e = s.tagName.toLowerCase(), o = Array.from(s.attributes), n = t[e] || [], i = t["*"] || [], r = [...n, ...i];
|
|
1449
1458
|
for (const a of o) {
|
|
1450
1459
|
const l = a.name.toLowerCase();
|
|
@@ -1462,97 +1471,108 @@ function G(s, t) {
|
|
|
1462
1471
|
}
|
|
1463
1472
|
s.hasAttribute("href") && (s.getAttribute("href") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("href"), s.hasAttribute("src") && (s.getAttribute("src") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("src");
|
|
1464
1473
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s :
|
|
1474
|
+
function G(s, t, e) {
|
|
1475
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : M(s, t);
|
|
1467
1476
|
}
|
|
1468
|
-
function
|
|
1469
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s :
|
|
1477
|
+
function X(s, t, e) {
|
|
1478
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : M(s, t);
|
|
1470
1479
|
}
|
|
1471
|
-
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}}';
|
|
1480
|
+
const Y = `.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 0%,#1c2430 100%);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:white;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 0%,#1b2430 100%)!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 0%,#252d37 100%);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:rgba(0,102,204,.2)}.editora-theme-dark .editora-content ::selection{background:rgba(77,184,255,.2)}.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:#ffffff;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:#ffffff;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:#ffffff;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}}
|
|
1481
|
+
`;
|
|
1472
1482
|
let y;
|
|
1473
|
-
const
|
|
1474
|
-
let g = null,
|
|
1475
|
-
function
|
|
1476
|
-
if (!(s instanceof HTMLElement))
|
|
1483
|
+
const J = "__editoraCommandEditorRoot", Q = "__editoraLastCommandButton", C = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", E = ".rte-content, .editora-content", w = /* @__PURE__ */ new Set();
|
|
1484
|
+
let g = null, S = !1, k = null, x = null;
|
|
1485
|
+
function T(s) {
|
|
1486
|
+
if (!(s instanceof HTMLElement))
|
|
1487
|
+
return !1;
|
|
1477
1488
|
const t = s;
|
|
1478
1489
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
1479
1490
|
}
|
|
1480
|
-
function
|
|
1491
|
+
function Z(s) {
|
|
1481
1492
|
return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
|
|
1482
1493
|
}
|
|
1483
1494
|
function b(s) {
|
|
1484
|
-
if (!s)
|
|
1485
|
-
|
|
1495
|
+
if (!s)
|
|
1496
|
+
return null;
|
|
1497
|
+
if (T(s))
|
|
1486
1498
|
return s;
|
|
1487
|
-
const t = s.matches(
|
|
1488
|
-
return !t || !
|
|
1499
|
+
const t = s.matches(C) ? s : s.closest(C);
|
|
1500
|
+
return !t || !T(t) ? null : t;
|
|
1489
1501
|
}
|
|
1490
|
-
function
|
|
1502
|
+
function tt() {
|
|
1491
1503
|
var n;
|
|
1492
|
-
if (typeof window == "undefined")
|
|
1493
|
-
|
|
1504
|
+
if (typeof window == "undefined")
|
|
1505
|
+
return null;
|
|
1506
|
+
const s = window[J];
|
|
1494
1507
|
if (s instanceof HTMLElement) {
|
|
1495
1508
|
const i = b(s);
|
|
1496
|
-
if (i)
|
|
1497
|
-
|
|
1509
|
+
if (i)
|
|
1510
|
+
return i;
|
|
1511
|
+
const r = s.matches(E) ? s : s.querySelector(E);
|
|
1498
1512
|
if (r) {
|
|
1499
1513
|
const a = b(r);
|
|
1500
|
-
if (a)
|
|
1514
|
+
if (a)
|
|
1515
|
+
return a;
|
|
1501
1516
|
}
|
|
1502
1517
|
}
|
|
1503
|
-
const t = window[
|
|
1518
|
+
const t = window[Q];
|
|
1504
1519
|
if (t instanceof HTMLElement) {
|
|
1505
1520
|
const i = b(t);
|
|
1506
|
-
if (i)
|
|
1521
|
+
if (i)
|
|
1522
|
+
return i;
|
|
1507
1523
|
}
|
|
1508
1524
|
const e = document.activeElement;
|
|
1509
1525
|
if (e) {
|
|
1510
1526
|
const i = b(e);
|
|
1511
|
-
if (i)
|
|
1527
|
+
if (i)
|
|
1528
|
+
return i;
|
|
1512
1529
|
}
|
|
1513
1530
|
const o = (n = window.getSelection) == null ? void 0 : n.call(window);
|
|
1514
1531
|
if (o && o.rangeCount > 0) {
|
|
1515
|
-
const i = b(
|
|
1516
|
-
if (i)
|
|
1532
|
+
const i = b(Z(o.getRangeAt(0).startContainer));
|
|
1533
|
+
if (i)
|
|
1534
|
+
return i;
|
|
1517
1535
|
}
|
|
1518
1536
|
if (g && g.isConnected)
|
|
1519
1537
|
return g;
|
|
1520
|
-
for (const i of
|
|
1521
|
-
if (i.isConnected)
|
|
1538
|
+
for (const i of w)
|
|
1539
|
+
if (i.isConnected)
|
|
1540
|
+
return i;
|
|
1522
1541
|
return null;
|
|
1523
1542
|
}
|
|
1524
|
-
function
|
|
1525
|
-
if (typeof window == "undefined" ||
|
|
1543
|
+
function et() {
|
|
1544
|
+
if (typeof window == "undefined" || S)
|
|
1545
|
+
return;
|
|
1526
1546
|
k = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, x = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
1527
1547
|
const s = (t, e) => {
|
|
1528
|
-
const o =
|
|
1548
|
+
const o = tt();
|
|
1529
1549
|
return o ? o.execCommand(t, e) : k ? k(t, e) : x ? x(t, e) : !1;
|
|
1530
1550
|
};
|
|
1531
|
-
window.executeEditorCommand = s, window.execEditorCommand = s,
|
|
1551
|
+
window.executeEditorCommand = s, window.execEditorCommand = s, S = !0;
|
|
1532
1552
|
}
|
|
1533
|
-
function
|
|
1553
|
+
function ot() {
|
|
1534
1554
|
const s = "editora-webcomponent-styles";
|
|
1535
1555
|
if (!document.getElementById(s)) {
|
|
1536
1556
|
const t = document.createElement("style");
|
|
1537
|
-
t.id = s, t.textContent =
|
|
1557
|
+
t.id = s, t.textContent = Y, document.head.appendChild(t);
|
|
1538
1558
|
}
|
|
1539
1559
|
}
|
|
1540
|
-
function
|
|
1560
|
+
function I() {
|
|
1541
1561
|
if (!y) {
|
|
1542
1562
|
const s = m.__globalPluginLoader;
|
|
1543
|
-
s ? y = s : y = new
|
|
1563
|
+
s ? y = s : y = new U();
|
|
1544
1564
|
}
|
|
1545
1565
|
return y;
|
|
1546
1566
|
}
|
|
1547
|
-
function
|
|
1548
|
-
const t =
|
|
1567
|
+
function it(s) {
|
|
1568
|
+
const t = I();
|
|
1549
1569
|
Object.entries(s).forEach(([e, o]) => {
|
|
1550
1570
|
t.register(e, o);
|
|
1551
1571
|
});
|
|
1552
1572
|
}
|
|
1553
1573
|
class m extends HTMLElement {
|
|
1554
1574
|
constructor() {
|
|
1555
|
-
if (super(), this.pluginLoader =
|
|
1575
|
+
if (super(), this.pluginLoader = I(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new P(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ot(), !this.hasAttribute("data-initial-content")) {
|
|
1556
1576
|
const t = this.innerHTML.trim();
|
|
1557
1577
|
t && this.setAttribute("data-initial-content", t);
|
|
1558
1578
|
}
|
|
@@ -1652,8 +1672,9 @@ class m extends HTMLElement {
|
|
|
1652
1672
|
*/
|
|
1653
1673
|
async initialize() {
|
|
1654
1674
|
var o;
|
|
1655
|
-
if (this.querySelector(".editora-toolbar") || this.isInitialized)
|
|
1656
|
-
|
|
1675
|
+
if (this.querySelector(".editora-toolbar") || this.isInitialized)
|
|
1676
|
+
return;
|
|
1677
|
+
this.setAttribute("data-editora-editor", "true"), w.add(this), g || (g = this), et(), 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}`);
|
|
1657
1678
|
const t = await this.loadPlugins();
|
|
1658
1679
|
this.loadedPlugins = t, t.forEach((n) => {
|
|
1659
1680
|
if (n.init && typeof n.init == "function")
|
|
@@ -1664,7 +1685,7 @@ class m extends HTMLElement {
|
|
|
1664
1685
|
}
|
|
1665
1686
|
});
|
|
1666
1687
|
const e = (o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || "";
|
|
1667
|
-
this.engine = new
|
|
1688
|
+
this.engine = new B({
|
|
1668
1689
|
content: e,
|
|
1669
1690
|
plugins: t,
|
|
1670
1691
|
readonly: this.config.readonly
|
|
@@ -1719,14 +1740,20 @@ class m extends HTMLElement {
|
|
|
1719
1740
|
}
|
|
1720
1741
|
resolveToolbarItems() {
|
|
1721
1742
|
const t = this.config.toolbarItems;
|
|
1722
|
-
if (typeof t == "string")
|
|
1723
|
-
|
|
1743
|
+
if (typeof t == "string")
|
|
1744
|
+
return t;
|
|
1745
|
+
if (Array.isArray(t))
|
|
1746
|
+
return t.join(" ");
|
|
1724
1747
|
const e = this.config.toolbar;
|
|
1725
|
-
if (typeof e == "string")
|
|
1726
|
-
|
|
1748
|
+
if (typeof e == "string")
|
|
1749
|
+
return e;
|
|
1750
|
+
if (!e || typeof e != "object")
|
|
1751
|
+
return;
|
|
1727
1752
|
const o = e.items;
|
|
1728
|
-
if (typeof o == "string")
|
|
1729
|
-
|
|
1753
|
+
if (typeof o == "string")
|
|
1754
|
+
return o;
|
|
1755
|
+
if (Array.isArray(o))
|
|
1756
|
+
return o.join(" ");
|
|
1730
1757
|
}
|
|
1731
1758
|
isToolbarStickyEnabled() {
|
|
1732
1759
|
const t = this.config.toolbar;
|
|
@@ -1788,12 +1815,14 @@ class m extends HTMLElement {
|
|
|
1788
1815
|
};
|
|
1789
1816
|
}
|
|
1790
1817
|
isEditorInViewport() {
|
|
1791
|
-
if (!this.contentElement || typeof window == "undefined")
|
|
1818
|
+
if (!this.contentElement || typeof window == "undefined")
|
|
1819
|
+
return !0;
|
|
1792
1820
|
const t = this.contentElement.getBoundingClientRect();
|
|
1793
1821
|
return t.bottom >= 0 && t.top <= window.innerHeight;
|
|
1794
1822
|
}
|
|
1795
1823
|
applyAccessibilitySettings() {
|
|
1796
|
-
if (!this.contentElement)
|
|
1824
|
+
if (!this.contentElement)
|
|
1825
|
+
return;
|
|
1797
1826
|
const t = this.getAccessibilityConfig();
|
|
1798
1827
|
if (t.enableARIA) {
|
|
1799
1828
|
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
|
|
@@ -1804,7 +1833,8 @@ class m extends HTMLElement {
|
|
|
1804
1833
|
this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
|
|
1805
1834
|
}
|
|
1806
1835
|
applyLanguageSettings() {
|
|
1807
|
-
if (!this.contentElement)
|
|
1836
|
+
if (!this.contentElement)
|
|
1837
|
+
return;
|
|
1808
1838
|
const t = this.getLanguageConfig();
|
|
1809
1839
|
this.contentElement.setAttribute("lang", t.locale), this.contentElement.setAttribute("dir", t.direction);
|
|
1810
1840
|
}
|
|
@@ -1826,7 +1856,8 @@ class m extends HTMLElement {
|
|
|
1826
1856
|
return { enabled: !1, provider: "browser" };
|
|
1827
1857
|
}
|
|
1828
1858
|
applySpellcheckSettings() {
|
|
1829
|
-
if (!this.contentElement)
|
|
1859
|
+
if (!this.contentElement)
|
|
1860
|
+
return;
|
|
1830
1861
|
const t = this.getSpellcheckConfig(), e = t.enabled && t.provider === "browser";
|
|
1831
1862
|
this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
|
|
1832
1863
|
}
|
|
@@ -1939,7 +1970,8 @@ class m extends HTMLElement {
|
|
|
1939
1970
|
}
|
|
1940
1971
|
restoreAutosavedContent() {
|
|
1941
1972
|
const t = this.getAutosaveConfig();
|
|
1942
|
-
if (!t.enabled || t.provider !== "localStorage")
|
|
1973
|
+
if (!t.enabled || t.provider !== "localStorage")
|
|
1974
|
+
return null;
|
|
1943
1975
|
try {
|
|
1944
1976
|
const e = localStorage.getItem(t.storageKey);
|
|
1945
1977
|
if (e)
|
|
@@ -1961,7 +1993,8 @@ class m extends HTMLElement {
|
|
|
1961
1993
|
}, t.intervalMs));
|
|
1962
1994
|
}
|
|
1963
1995
|
insertHTMLAtSelection(t) {
|
|
1964
|
-
if (!this.contentElement)
|
|
1996
|
+
if (!this.contentElement)
|
|
1997
|
+
return;
|
|
1965
1998
|
const e = window.getSelection();
|
|
1966
1999
|
if (e && e.rangeCount > 0) {
|
|
1967
2000
|
const o = e.getRangeAt(0);
|
|
@@ -1980,7 +2013,7 @@ class m extends HTMLElement {
|
|
|
1980
2013
|
*/
|
|
1981
2014
|
createUI(t, e) {
|
|
1982
2015
|
const o = this.querySelector('[slot="toolbar"]'), n = this.querySelector('[slot="statusbar"]');
|
|
1983
|
-
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
|
|
2016
|
+
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 z(
|
|
1984
2017
|
{
|
|
1985
2018
|
items: this.resolveToolbarItems(),
|
|
1986
2019
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -2017,7 +2050,7 @@ class m extends HTMLElement {
|
|
|
2017
2050
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
2018
2051
|
} else
|
|
2019
2052
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
2020
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
2053
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new R({ enabled: !0 }), this.floatingToolbar.create(this)), n ? this.appendChild(n) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new H({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
|
|
2021
2054
|
var i;
|
|
2022
2055
|
return (i = this.contentElement) == null ? void 0 : i.focus();
|
|
2023
2056
|
}, 0);
|
|
@@ -2026,16 +2059,18 @@ class m extends HTMLElement {
|
|
|
2026
2059
|
* Setup event listeners
|
|
2027
2060
|
*/
|
|
2028
2061
|
setupEventListeners() {
|
|
2029
|
-
if (!this.contentElement || !this.engine)
|
|
2062
|
+
if (!this.contentElement || !this.engine)
|
|
2063
|
+
return;
|
|
2030
2064
|
const t = this.keyboardShortcutManager;
|
|
2031
2065
|
this.contentElement.addEventListener("beforeinput", (o) => {
|
|
2032
2066
|
this.lastBeforeInputType = o.inputType || null;
|
|
2033
2067
|
}), this.contentElement.addEventListener("input", () => {
|
|
2034
|
-
if (!this.contentElement)
|
|
2068
|
+
if (!this.contentElement)
|
|
2069
|
+
return;
|
|
2035
2070
|
let o = this.contentElement.innerHTML;
|
|
2036
2071
|
const n = this.getPerformanceConfig(), i = this.getContentSanitizeConfig(), r = this.getSecurityConfig(), a = this.lastBeforeInputType;
|
|
2037
2072
|
if (this.lastBeforeInputType = null, r.sanitizeOnInput !== !1 && i.sanitize !== !1 && !a) {
|
|
2038
|
-
const d =
|
|
2073
|
+
const d = X(o, i, r);
|
|
2039
2074
|
if (d !== o) {
|
|
2040
2075
|
const h = window.getSelection(), p = h && h.rangeCount > 0 ? h.getRangeAt(0) : null;
|
|
2041
2076
|
if (this.contentElement.innerHTML = d, p && h)
|
|
@@ -2074,7 +2109,7 @@ class m extends HTMLElement {
|
|
|
2074
2109
|
return;
|
|
2075
2110
|
}
|
|
2076
2111
|
if (i) {
|
|
2077
|
-
l.sanitizeOnPaste !== !1 && a.sanitize !== !1 && (i =
|
|
2112
|
+
l.sanitizeOnPaste !== !1 && a.sanitize !== !1 && (i = G(i, a, l)), this.insertHTMLAtSelection(i);
|
|
2078
2113
|
return;
|
|
2079
2114
|
}
|
|
2080
2115
|
r && document.execCommand("insertText", !1, r);
|
|
@@ -2097,7 +2132,8 @@ class m extends HTMLElement {
|
|
|
2097
2132
|
this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
|
|
2098
2133
|
}
|
|
2099
2134
|
getSelectionRangeInEditor() {
|
|
2100
|
-
if (!this.contentElement)
|
|
2135
|
+
if (!this.contentElement)
|
|
2136
|
+
return null;
|
|
2101
2137
|
const t = window.getSelection();
|
|
2102
2138
|
if (!t || t.rangeCount === 0)
|
|
2103
2139
|
return null;
|
|
@@ -2105,7 +2141,8 @@ class m extends HTMLElement {
|
|
|
2105
2141
|
return this.contentElement.contains(o) ? e : null;
|
|
2106
2142
|
}
|
|
2107
2143
|
isSelectionBackward(t) {
|
|
2108
|
-
if (!t.anchorNode || !t.focusNode)
|
|
2144
|
+
if (!t.anchorNode || !t.focusNode)
|
|
2145
|
+
return !1;
|
|
2109
2146
|
try {
|
|
2110
2147
|
const e = document.createRange();
|
|
2111
2148
|
return e.setStart(t.anchorNode, t.anchorOffset), e.setEnd(t.focusNode, t.focusOffset), e.collapsed;
|
|
@@ -2121,7 +2158,8 @@ class m extends HTMLElement {
|
|
|
2121
2158
|
* Update floating toolbar position
|
|
2122
2159
|
*/
|
|
2123
2160
|
updateFloatingToolbar() {
|
|
2124
|
-
if (!this.floatingToolbar || !this.contentElement)
|
|
2161
|
+
if (!this.floatingToolbar || !this.contentElement)
|
|
2162
|
+
return;
|
|
2125
2163
|
if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.getAttribute("readonly") === "true" || this.getAttribute("data-readonly") === "true") {
|
|
2126
2164
|
this.floatingToolbar.hide();
|
|
2127
2165
|
return;
|
|
@@ -2159,14 +2197,15 @@ class m extends HTMLElement {
|
|
|
2159
2197
|
* Update status bar with current content and cursor information
|
|
2160
2198
|
*/
|
|
2161
2199
|
updateStatusBar() {
|
|
2162
|
-
if (!this.statusBar || !this.contentElement)
|
|
2200
|
+
if (!this.statusBar || !this.contentElement)
|
|
2201
|
+
return;
|
|
2163
2202
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
2164
2203
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
2165
2204
|
return;
|
|
2166
|
-
const o = this.contentElement.textContent || "", { words: n, chars: i } =
|
|
2205
|
+
const o = this.contentElement.textContent || "", { words: n, chars: i } = _(o), r = $(this.contentElement);
|
|
2167
2206
|
let a, l;
|
|
2168
2207
|
const c = this.getSelectionRangeInEditor();
|
|
2169
|
-
c && (a =
|
|
2208
|
+
c && (a = j(this.contentElement, c), c.collapsed || (l = W(c, a), a = void 0)), this.statusBar.update({
|
|
2170
2209
|
wordCount: n,
|
|
2171
2210
|
charCount: i,
|
|
2172
2211
|
lineCount: r,
|
|
@@ -2251,7 +2290,7 @@ class m extends HTMLElement {
|
|
|
2251
2290
|
const o = this.attributes[e];
|
|
2252
2291
|
t[o.name] = o.value;
|
|
2253
2292
|
}
|
|
2254
|
-
return
|
|
2293
|
+
return A.resolve({
|
|
2255
2294
|
jsConfig: this.jsConfig,
|
|
2256
2295
|
attributes: t
|
|
2257
2296
|
});
|
|
@@ -2292,7 +2331,7 @@ class m extends HTMLElement {
|
|
|
2292
2331
|
*/
|
|
2293
2332
|
destroy() {
|
|
2294
2333
|
var t, e, o, n;
|
|
2295
|
-
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(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1,
|
|
2334
|
+
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(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, w.delete(this), g === this && (g = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
2296
2335
|
}
|
|
2297
2336
|
// Public API methods
|
|
2298
2337
|
getContent() {
|
|
@@ -2315,23 +2354,23 @@ class m extends HTMLElement {
|
|
|
2315
2354
|
}
|
|
2316
2355
|
}
|
|
2317
2356
|
export {
|
|
2318
|
-
|
|
2357
|
+
O as C,
|
|
2319
2358
|
v as E,
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
P,
|
|
2359
|
+
R as F,
|
|
2360
|
+
P as K,
|
|
2361
|
+
N as P,
|
|
2323
2362
|
m as R,
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2363
|
+
D as S,
|
|
2364
|
+
z as T,
|
|
2365
|
+
B as a,
|
|
2366
|
+
H as b,
|
|
2367
|
+
F as c,
|
|
2368
|
+
$ as d,
|
|
2369
|
+
_ as e,
|
|
2370
|
+
W as f,
|
|
2371
|
+
j as g,
|
|
2372
|
+
A as h,
|
|
2373
|
+
U as i,
|
|
2374
|
+
it as j
|
|
2336
2375
|
};
|
|
2337
|
-
//# sourceMappingURL=index-
|
|
2376
|
+
//# sourceMappingURL=index-7da30697.mjs.map
|