@editora/core 1.0.2 → 1.0.4

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.
Files changed (133) hide show
  1. package/README.md +42 -4
  2. package/dist/{A11yCheckerPlugin.native-CZKpi3uF.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +225 -173
  3. package/dist/AnchorPlugin.native-C1Rw5m04.mjs +404 -0
  4. package/dist/BackgroundColorPlugin.native-BE-p9DRd.mjs +489 -0
  5. package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +309 -0
  6. package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +140 -0
  7. package/dist/CodePlugin.native-0Zari_zp.mjs +2041 -0
  8. package/dist/CodeSamplePlugin.native-B-KS1pOl.mjs +384 -0
  9. package/dist/CommentsPlugin.native-tMnWn8a2.mjs +723 -0
  10. package/dist/DirectionPlugin.native-CDnbdNyl.mjs +130 -0
  11. package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs} +154 -50
  12. package/dist/{EmojisPlugin.native-D6mJSnSR.mjs → EmojisPlugin.native-DxTm_DL-.mjs} +156 -103
  13. package/dist/FontFamilyPlugin.native-j8hMTbg4.mjs +158 -0
  14. package/dist/FontSizePlugin.native-B_jCh7dY.mjs +286 -0
  15. package/dist/FootnotePlugin.native-D730OGRm.mjs +425 -0
  16. package/dist/HistoryPlugin.native-DCrPdeSW.mjs +257 -0
  17. package/dist/IndentPlugin.native-BHixp8sP.mjs +150 -0
  18. package/dist/LineHeightPlugin.native-CM7iXdQj.mjs +151 -0
  19. package/dist/{LinkPlugin.native-BdAOV-iu.mjs → LinkPlugin.native-CS2g-G18.mjs} +128 -53
  20. package/dist/{ListPlugin.native-CLFU5AUQ.mjs → ListPlugin.native-V7EZC1lM.mjs} +59 -12
  21. package/dist/MathPlugin.native-KUxz0o8C.mjs +251 -0
  22. package/dist/MediaManagerPlugin.native-CgP5iInD.mjs +970 -0
  23. package/dist/MergeTagPlugin.native-CU9LtsfD.mjs +416 -0
  24. package/dist/PageBreakPlugin.native-CGiQxXqR.mjs +297 -0
  25. package/dist/{PrintPlugin.native-BUpm52VJ.mjs → PrintPlugin.native-7qt5v7L5.mjs} +10 -10
  26. package/dist/{SpecialCharactersPlugin.native-x7a2SWXc.mjs → SpecialCharactersPlugin.native-DANrbExJ.mjs} +143 -97
  27. package/dist/SpellCheckPlugin.native-C8bPvRHy.mjs +1019 -0
  28. package/dist/StrikethroughPlugin.native-0Be7j49s.mjs +73 -0
  29. package/dist/{TablePlugin.native-EEWXn1-s.mjs → TablePlugin.native-DrHX-efe.mjs} +149 -145
  30. package/dist/TemplatePlugin.native-4lKEm-WY.mjs +578 -0
  31. package/dist/TextAlignmentPlugin.native-sM_1s00t.mjs +108 -0
  32. package/dist/{TextColorPlugin.native-D6SmTglm.mjs → TextColorPlugin.native-Clgtb50j.mjs} +173 -92
  33. package/dist/colorSelectionApply-CK1My9N2.mjs +67 -0
  34. package/dist/core.css +1 -1
  35. package/dist/editora.min.js +31 -29
  36. package/dist/editora.umd.js +31 -29
  37. package/dist/index-CqWQFb3D.js +10 -0
  38. package/dist/index-OwnkG39N.mjs +2227 -0
  39. package/dist/index.cjs.js +14 -18
  40. package/dist/index.esm.js +204 -521
  41. package/dist/plugin-loader.js +26 -26
  42. package/dist/webcomponent-core.js +1286 -295
  43. package/dist/webcomponent-core.min.css +1 -1
  44. package/dist/webcomponent-core.min.js +116 -106
  45. package/dist/webcomponent.cjs.js +1 -1
  46. package/dist/webcomponent.esm.js +1 -1
  47. package/dist/webcomponent.js +1252 -261
  48. package/dist/webcomponent.min.css +1 -1
  49. package/dist/webcomponent.min.js +2980 -1488
  50. package/index.d.ts +355 -0
  51. package/package.json +21 -19
  52. package/LICENSE +0 -21
  53. package/dist/A11yCheckerPlugin.native-CZKpi3uF.mjs.map +0 -1
  54. package/dist/AnchorPlugin.native-7es9PVZ9.mjs +0 -340
  55. package/dist/AnchorPlugin.native-7es9PVZ9.mjs.map +0 -1
  56. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs +0 -449
  57. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs.map +0 -1
  58. package/dist/BlockquotePlugin.native-JFmOLsxN.mjs.map +0 -1
  59. package/dist/BoldPlugin.native-BAzzoqU5.mjs.map +0 -1
  60. package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs.map +0 -1
  61. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs +0 -153
  62. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs.map +0 -1
  63. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs +0 -27
  64. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs.map +0 -1
  65. package/dist/CodePlugin.native-DD9xFIid.mjs +0 -1679
  66. package/dist/CodePlugin.native-DD9xFIid.mjs.map +0 -1
  67. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs +0 -326
  68. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs.map +0 -1
  69. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs +0 -473
  70. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs.map +0 -1
  71. package/dist/DirectionPlugin.native-Be7wCzkI.mjs +0 -59
  72. package/dist/DirectionPlugin.native-Be7wCzkI.mjs.map +0 -1
  73. package/dist/DocumentManagerPlugin.native-BvZL5CSG.mjs.map +0 -1
  74. package/dist/EmbedIframePlugin.native-ifr9KLdN.mjs.map +0 -1
  75. package/dist/EmojisPlugin.native-D6mJSnSR.mjs.map +0 -1
  76. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs +0 -106
  77. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs.map +0 -1
  78. package/dist/FontSizePlugin.native-DkLMLPue.mjs +0 -186
  79. package/dist/FontSizePlugin.native-DkLMLPue.mjs.map +0 -1
  80. package/dist/FootnotePlugin.native-BciVc9W6.mjs +0 -128
  81. package/dist/FootnotePlugin.native-BciVc9W6.mjs.map +0 -1
  82. package/dist/FullscreenPlugin.native-ChXyxeNw.mjs.map +0 -1
  83. package/dist/HeadingPlugin.native-DrLYwQnQ.mjs.map +0 -1
  84. package/dist/HistoryPlugin.native-DoDRifCf.mjs +0 -89
  85. package/dist/HistoryPlugin.native-DoDRifCf.mjs.map +0 -1
  86. package/dist/IndentPlugin.native-CbFugPoi.mjs +0 -133
  87. package/dist/IndentPlugin.native-CbFugPoi.mjs.map +0 -1
  88. package/dist/ItalicPlugin.native-CQjjDyUL.mjs.map +0 -1
  89. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs +0 -73
  90. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs.map +0 -1
  91. package/dist/LinkPlugin.native-BdAOV-iu.mjs.map +0 -1
  92. package/dist/ListPlugin.native-CLFU5AUQ.mjs.map +0 -1
  93. package/dist/MathPlugin.native-DE_ii-LA.mjs +0 -182
  94. package/dist/MathPlugin.native-DE_ii-LA.mjs.map +0 -1
  95. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs +0 -533
  96. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs.map +0 -1
  97. package/dist/MergeTagPlugin.native-CrxyThyn.mjs +0 -178
  98. package/dist/MergeTagPlugin.native-CrxyThyn.mjs.map +0 -1
  99. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs +0 -172
  100. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs.map +0 -1
  101. package/dist/PreviewPlugin.native-DBvfpmIv.mjs.map +0 -1
  102. package/dist/PrintPlugin.native-BUpm52VJ.mjs.map +0 -1
  103. package/dist/SpecialCharactersPlugin.native-x7a2SWXc.mjs.map +0 -1
  104. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs +0 -465
  105. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs.map +0 -1
  106. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs +0 -43
  107. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs.map +0 -1
  108. package/dist/TablePlugin.native-EEWXn1-s.mjs.map +0 -1
  109. package/dist/TemplatePlugin.native-BlSn1c9h.mjs +0 -564
  110. package/dist/TemplatePlugin.native-BlSn1c9h.mjs.map +0 -1
  111. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs +0 -97
  112. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs.map +0 -1
  113. package/dist/TextColorPlugin.native-D6SmTglm.mjs.map +0 -1
  114. package/dist/UnderlinePlugin.native-QpIcK4L2.mjs.map +0 -1
  115. package/dist/documentManager-irzj9n3V.mjs.map +0 -1
  116. package/dist/editorContainerHelpers-C7kdWnS0.mjs.map +0 -1
  117. package/dist/editora.min.js.map +0 -1
  118. package/dist/editora.umd.js.map +0 -1
  119. package/dist/index-BF5RBhL9.js +0 -4
  120. package/dist/index-BF5RBhL9.js.map +0 -1
  121. package/dist/index-BPsf460l.mjs +0 -1243
  122. package/dist/index-BPsf460l.mjs.map +0 -1
  123. package/dist/index.cjs.js.map +0 -1
  124. package/dist/index.es-CuicffkQ.mjs.map +0 -1
  125. package/dist/index.esm.js.map +0 -1
  126. package/dist/plugin-loader.js.map +0 -1
  127. package/dist/purify.es-CKpwg8Tk.mjs.map +0 -1
  128. package/dist/webcomponent-core.js.map +0 -1
  129. package/dist/webcomponent-core.min.js.map +0 -1
  130. package/dist/webcomponent.cjs.js.map +0 -1
  131. package/dist/webcomponent.esm.js.map +0 -1
  132. package/dist/webcomponent.js.map +0 -1
  133. package/dist/webcomponent.min.js.map +0 -1
@@ -1,4 +1,4 @@
1
- class w {
1
+ class x {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -72,19 +72,19 @@ class w {
72
72
  return this.loadedPlugins.has(t);
73
73
  }
74
74
  }
75
- class m {
75
+ class b {
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 m(o, { anchor: 0, head: 0 }, t);
81
+ return new b(o, { anchor: 0, head: 0 }, t);
82
82
  }
83
83
  apply(t, e) {
84
- return new m(t, e || this.selection, this.schema);
84
+ return new b(t, e || this.selection, this.schema);
85
85
  }
86
86
  }
87
- class C {
87
+ class E {
88
88
  constructor(t, e) {
89
89
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
90
90
  }
@@ -95,15 +95,25 @@ class C {
95
95
  return { type: "text", text: t, marks: e };
96
96
  }
97
97
  }
98
- class k {
98
+ class S {
99
99
  constructor() {
100
100
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
101
101
  }
102
102
  register(t, e) {
103
- if (this.plugins.push(t), e && this.pluginConfigs.set(t.name, e), t.initialize) {
104
- const o = this.pluginConfigs.get(t.name) || t.config;
105
- t.initialize(o);
106
- }
103
+ this.plugins.push(t), e && this.pluginConfigs.set(t.name, e);
104
+ const o = this.pluginConfigs.get(t.name) || t.config;
105
+ if (t.initialize)
106
+ try {
107
+ t.initialize(o);
108
+ } catch (r) {
109
+ console.error(`Failed to initialize plugin "${t.name}":`, r);
110
+ }
111
+ if (t.init && t.init !== t.initialize)
112
+ try {
113
+ t.init(o);
114
+ } catch (r) {
115
+ console.error(`Failed to run init hook for plugin "${t.name}":`, r);
116
+ }
107
117
  }
108
118
  unregister(t) {
109
119
  const e = this.plugins.findIndex((o) => o.name === t);
@@ -122,7 +132,7 @@ class k {
122
132
  const t = {}, e = {};
123
133
  return this.plugins.forEach((o) => {
124
134
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
125
- }), new C(t, e);
135
+ }), new E(t, e);
126
136
  }
127
137
  getCommands() {
128
138
  const t = {};
@@ -140,9 +150,9 @@ class k {
140
150
  const r = this.getPlugin(t);
141
151
  if (!r)
142
152
  throw new Error(`Plugin not found: ${t}`);
143
- const i = this.getPluginConfig(t) || r.config || {}, a = i.mode || "local";
153
+ const i = this.getPluginConfig(t) || r.config || {}, n = i.mode || "local";
144
154
  try {
145
- switch (a) {
155
+ switch (n) {
146
156
  case "local":
147
157
  return r.executeLocal ? r.executeLocal(e, ...o) : null;
148
158
  case "api":
@@ -162,7 +172,7 @@ class k {
162
172
  }
163
173
  break;
164
174
  default:
165
- throw new Error(`Unknown plugin mode: ${a}`);
175
+ throw new Error(`Unknown plugin mode: ${n}`);
166
176
  }
167
177
  } catch (s) {
168
178
  throw console.error(`Error executing command ${e} on plugin ${t}:`, s), s;
@@ -176,7 +186,7 @@ class k {
176
186
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
177
187
  }
178
188
  }
179
- class E {
189
+ class A {
180
190
  constructor(t = {}) {
181
191
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
182
192
  this.register(e, o);
@@ -219,11 +229,11 @@ class E {
219
229
  this.commands.clear();
220
230
  }
221
231
  }
222
- class v {
232
+ class M {
223
233
  constructor(t = {}) {
224
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new k(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
234
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new S(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
225
235
  const e = this.pluginManager.buildSchema();
226
- this.state = m.create(e), this.commandRegistry = new E(this.pluginManager.getCommands());
236
+ this.state = b.create(e), this.commandRegistry = new A(this.pluginManager.getCommands());
227
237
  }
228
238
  /**
229
239
  * Execute a command
@@ -237,7 +247,11 @@ class v {
237
247
  if (!o)
238
248
  return console.warn(`Command not found: ${t}`), !1;
239
249
  let r;
240
- return e !== void 0 ? r = o(this.state, e) : r = o(this.state), r ? (this.setState(r), this.emit("change", this.state), !0) : !1;
250
+ return e !== void 0 ? r = o(this.state, e) : r = o(this.state), r instanceof Promise ? (r.then((i) => {
251
+ i && typeof i == "object" && "doc" in i && "selection" in i && (this.setState(i), this.emit("change", this.state));
252
+ }).catch((i) => {
253
+ console.error(`Async command failed: ${t}`, i);
254
+ }), !0) : r && typeof r == "object" && "doc" in r && "selection" in r ? (this.setState(r), this.emit("change", this.state), !0) : r !== !1 && r != null;
241
255
  }
242
256
  /**
243
257
  * Update editor state
@@ -320,7 +334,7 @@ class L {
320
334
  r.forEach((s) => {
321
335
  s.command && i.set(s.command, s), s.type === "group" && s.label && i.set(s.label, s);
322
336
  });
323
- const a = {
337
+ const n = {
324
338
  bold: "toggleBold",
325
339
  italic: "toggleItalic",
326
340
  underline: "toggleUnderline",
@@ -373,16 +387,16 @@ class L {
373
387
  };
374
388
  return o.forEach((s) => {
375
389
  const l = [];
376
- s.split(/\s+/).filter(Boolean).forEach((g) => {
377
- if (g === "direction") {
378
- const c = i.get("setDirectionLTR"), h = i.get("setDirectionRTL");
379
- c && l.push({
390
+ s.split(/\s+/).filter(Boolean).forEach((d) => {
391
+ if (d === "direction") {
392
+ const u = i.get("setDirectionLTR"), h = i.get("setDirectionRTL");
393
+ u && l.push({
380
394
  id: "directionLTR",
381
- label: c.label,
382
- command: c.command,
383
- icon: c.icon,
384
- type: c.type || "button",
385
- options: c.options
395
+ label: u.label,
396
+ command: u.command,
397
+ icon: u.icon,
398
+ type: u.type || "button",
399
+ options: u.options
386
400
  }), h && l.push({
387
401
  id: "directionRTL",
388
402
  label: h.label,
@@ -393,15 +407,15 @@ class L {
393
407
  });
394
408
  return;
395
409
  }
396
- if (g === "comments") {
397
- const c = i.get("addComment"), h = i.get("toggleComments");
398
- c && l.push({
410
+ if (d === "comments") {
411
+ const u = i.get("addComment"), h = i.get("toggleComments");
412
+ u && l.push({
399
413
  id: "addComment",
400
- label: c.label,
401
- command: c.command,
402
- icon: c.icon,
403
- type: c.type || "button",
404
- options: c.options
414
+ label: u.label,
415
+ command: u.command,
416
+ icon: u.icon,
417
+ type: u.type || "button",
418
+ options: u.options
405
419
  }), h && l.push({
406
420
  id: "toggleComments",
407
421
  label: h.label,
@@ -412,16 +426,16 @@ class L {
412
426
  });
413
427
  return;
414
428
  }
415
- const p = a[g] || g;
416
- let d = i.get(p);
417
- d || (d = i.get(g)), d && l.push({
418
- id: g,
419
- label: d.label,
420
- command: d.command,
421
- icon: d.icon,
422
- type: d.type === "separator" ? "separator" : d.type || "button",
423
- options: d.options,
424
- items: d.items
429
+ const g = n[d] || d;
430
+ let f = i.get(g);
431
+ f || (f = i.get(d)), f && l.push({
432
+ id: d,
433
+ label: f.label,
434
+ command: f.command,
435
+ icon: f.icon,
436
+ type: f.type === "separator" ? "separator" : f.type || "button",
437
+ options: f.options,
438
+ items: f.items
425
439
  });
426
440
  }), l.length > 0 && e.push(l);
427
441
  }), e;
@@ -439,10 +453,10 @@ class L {
439
453
  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}`);
440
454
  const e = this.config.items || this.getDefaultToolbarString(), o = this.parseToolbarString(e);
441
455
  o.forEach((r, i) => {
442
- const a = document.createElement("div");
443
- if (a.className = "editora-toolbar-group", r.forEach((s) => {
444
- this.appendToolbarButton(a, s);
445
- }), t.appendChild(a), i < o.length - 1) {
456
+ const n = document.createElement("div");
457
+ if (n.className = "editora-toolbar-group", r.forEach((s) => {
458
+ this.appendToolbarButton(n, s);
459
+ }), t.appendChild(n), i < o.length - 1) {
446
460
  const s = document.createElement("div");
447
461
  s.className = "editora-toolbar-separator", t.appendChild(s);
448
462
  }
@@ -496,8 +510,8 @@ class L {
496
510
  */
497
511
  createInput(t) {
498
512
  const e = document.createElement("input");
499
- return e.className = `editora-toolbar-input ${t.label.toLowerCase().replace(/\s+/g, "-")}`, e.type = "text", e.title = t.label, e.placeholder = t.placeholder || "", e.setAttribute("data-command", t.command), t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
500
- o.preventDefault(), this.commandHandler && this.commandHandler(t.command);
513
+ return e.className = `editora-toolbar-input ${t.label.toLowerCase().replace(/\s+/g, "-")}`, e.type = "text", e.title = t.label, e.placeholder = t.placeholder || "", t.command && e.setAttribute("data-command", t.command), t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
514
+ o.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
501
515
  }), e;
502
516
  }
503
517
  /**
@@ -505,7 +519,7 @@ class L {
505
519
  */
506
520
  createButton(t) {
507
521
  const e = document.createElement("button");
508
- if (e.className = "editora-toolbar-button", e.type = "button", e.title = t.label, e.setAttribute("data-command", t.command), t.icon)
522
+ if (e.className = "editora-toolbar-button", e.type = "button", e.title = t.label, t.command && e.setAttribute("data-command", t.command), t.icon)
509
523
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
510
524
  const o = document.createElement("span");
511
525
  o.className = "editora-toolbar-icon", o.innerHTML = t.icon, e.appendChild(o);
@@ -514,7 +528,7 @@ class L {
514
528
  else
515
529
  e.textContent = t.label;
516
530
  return t.active && e.classList.add("active"), t.disabled && (e.disabled = !0), e.addEventListener("click", (o) => {
517
- o.preventDefault(), this.commandHandler && this.commandHandler(t.command);
531
+ o.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command);
518
532
  }), e;
519
533
  }
520
534
  /**
@@ -526,18 +540,18 @@ class L {
526
540
  const o = document.createElement("button");
527
541
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
528
542
  const r = document.createElement("div");
529
- r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((a) => {
543
+ r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((n) => {
530
544
  const s = document.createElement("button");
531
- s.className = "editora-toolbar-dropdown-item", s.type = "button", s.textContent = a.label, s.setAttribute("data-value", a.value), s.addEventListener("click", (l) => {
532
- l.preventDefault(), this.commandHandler && this.commandHandler(t.command, a.value), r.style.display = "none";
545
+ s.className = "editora-toolbar-dropdown-item", s.type = "button", s.textContent = n.label, s.setAttribute("data-value", n.value), s.addEventListener("click", (l) => {
546
+ l.preventDefault(), this.commandHandler && t.command && this.commandHandler(t.command, n.value), r.style.display = "none";
533
547
  }), r.appendChild(s);
534
- }), o.addEventListener("click", (a) => {
535
- a.preventDefault(), a.stopPropagation();
548
+ }), o.addEventListener("click", (n) => {
549
+ n.preventDefault(), n.stopPropagation();
536
550
  const s = r.style.display === "block";
537
551
  r.style.display = s ? "none" : "block";
538
552
  });
539
- const i = (a) => {
540
- e.contains(a.target) || (r.style.display = "none");
553
+ const i = (n) => {
554
+ e.contains(n.target) || (r.style.display = "none");
541
555
  };
542
556
  return document.addEventListener("click", i), e._cleanupDropdown = () => {
543
557
  document.removeEventListener("click", i);
@@ -560,17 +574,17 @@ class L {
560
574
  o.textContent = t.label;
561
575
  const r = document.createElement("div");
562
576
  return r.className = "editora-toolbar-dropdown-menu", r.style.display = "none", t.options && t.options.forEach((i) => {
563
- const a = document.createElement("button");
564
- a.className = "editora-toolbar-dropdown-item", a.type = "button", a.textContent = i.label, a.setAttribute("data-value", i.value), a.addEventListener("click", (s) => {
565
- s.preventDefault(), s.stopPropagation(), this.commandHandler && this.commandHandler(t.command, i.value), r.style.display = "none";
566
- }), r.appendChild(a);
577
+ const n = document.createElement("button");
578
+ n.className = "editora-toolbar-dropdown-item", n.type = "button", n.textContent = i.label, n.setAttribute("data-value", i.value), n.addEventListener("click", (s) => {
579
+ s.preventDefault(), s.stopPropagation(), this.commandHandler && t.command && this.commandHandler(t.command, i.value), r.style.display = "none";
580
+ }), r.appendChild(n);
567
581
  }), o.addEventListener("click", (i) => {
568
582
  var s;
569
583
  i.preventDefault(), i.stopPropagation();
570
- const a = (s = this.container) == null ? void 0 : s.querySelectorAll(
584
+ const n = (s = this.container) == null ? void 0 : s.querySelectorAll(
571
585
  ".editora-toolbar-dropdown-menu"
572
586
  );
573
- a == null || a.forEach((l) => {
587
+ n == null || n.forEach((l) => {
574
588
  l !== r && (l.style.display = "none");
575
589
  }), r.style.display = r.style.display === "none" ? "block" : "none";
576
590
  }), document.addEventListener("click", (i) => {
@@ -603,7 +617,7 @@ class L {
603
617
  }), this.container.innerHTML = ""), this.commandHandler = void 0;
604
618
  }
605
619
  }
606
- class P {
620
+ class T {
607
621
  constructor(t) {
608
622
  this.visible = !1, this.config = t;
609
623
  }
@@ -645,7 +659,7 @@ class P {
645
659
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
646
660
  }
647
661
  }
648
- class T {
662
+ class I {
649
663
  constructor(t = {}) {
650
664
  this.statusInfo = {}, this.config = t;
651
665
  }
@@ -682,17 +696,17 @@ class T {
682
696
  }
683
697
  this.statusInfo.language && o.push(this.statusInfo.language);
684
698
  const r = [];
685
- this.statusInfo.wordCount !== void 0 && r.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && r.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && r.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([i, a]) => {
686
- r.push(`${i}: ${a}`);
687
- }), o.forEach((i, a) => {
699
+ this.statusInfo.wordCount !== void 0 && r.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && r.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && r.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([i, n]) => {
700
+ r.push(`${i}: ${n}`);
701
+ }), o.forEach((i, n) => {
688
702
  const s = document.createElement("span");
689
- if (s.className = "editora-statusbar-item", s.textContent = i, t.appendChild(s), a < o.length - 1) {
703
+ if (s.className = "editora-statusbar-item", s.textContent = i, t.appendChild(s), n < o.length - 1) {
690
704
  const l = document.createElement("span");
691
705
  l.className = "editora-statusbar-separator", l.textContent = "|", t.appendChild(l);
692
706
  }
693
- }), r.forEach((i, a) => {
707
+ }), r.forEach((i, n) => {
694
708
  const s = document.createElement("span");
695
- if (s.className = "editora-statusbar-item", s.textContent = i, e.appendChild(s), a < r.length - 1) {
709
+ if (s.className = "editora-statusbar-item", s.textContent = i, e.appendChild(s), n < r.length - 1) {
696
710
  const l = document.createElement("span");
697
711
  l.className = "editora-statusbar-separator", l.textContent = "|", e.appendChild(l);
698
712
  }
@@ -705,16 +719,16 @@ class T {
705
719
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
706
720
  }
707
721
  }
708
- function I(n, t) {
709
- const e = n.textContent || "", o = A(n, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
710
- `), a = i.length, s = i[i.length - 1].length + 1;
711
- return { line: a, column: s };
722
+ function P(a, t) {
723
+ const e = a.textContent || "", o = D(a, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
724
+ `), n = i.length, s = i[i.length - 1].length + 1;
725
+ return { line: n, column: s };
712
726
  }
713
- function A(n, t, e) {
714
- var a;
727
+ function D(a, t, e) {
728
+ var n;
715
729
  let o = 0;
716
730
  const r = document.createTreeWalker(
717
- n,
731
+ a,
718
732
  NodeFilter.SHOW_TEXT,
719
733
  null
720
734
  );
@@ -723,32 +737,32 @@ function A(n, t, e) {
723
737
  if (i === t) {
724
738
  o += e;
725
739
  break;
726
- } else i.nodeType === Node.TEXT_NODE && (o += ((a = i.textContent) == null ? void 0 : a.length) || 0);
740
+ } else i.nodeType === Node.TEXT_NODE && (o += ((n = i.textContent) == null ? void 0 : n.length) || 0);
727
741
  i = r.nextNode();
728
742
  }
729
743
  return o;
730
744
  }
731
- function S(n) {
745
+ function N(a) {
732
746
  var o, r;
733
- const t = n.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
747
+ const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
734
748
  let e = 1;
735
749
  if (t.length > 0) {
736
750
  e = t.length;
737
751
  const i = t[t.length - 1];
738
752
  (i.tagName === "BR" || ((o = i.innerHTML) == null ? void 0 : o.trim()) === "" || ((r = i.textContent) == null ? void 0 : r.trim()) === "") && e++;
739
753
  } else {
740
- const a = (n.textContent || "").split(`
754
+ const n = (a.textContent || "").split(`
741
755
  `).length;
742
- e = Math.max(1, a);
756
+ e = Math.max(1, n);
743
757
  }
744
758
  return e;
745
759
  }
746
- function M(n) {
747
- const t = n.trim() ? n.trim().split(/\s+/).length : 0, e = n.length;
760
+ function z(a) {
761
+ const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
748
762
  return { words: t, chars: e };
749
763
  }
750
- function N(n, t) {
751
- const e = n.toString();
764
+ function B(a, t) {
765
+ const e = a.toString();
752
766
  return {
753
767
  startLine: t.line,
754
768
  startColumn: t.column,
@@ -759,7 +773,434 @@ function N(n, t) {
759
773
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
760
774
  };
761
775
  }
762
- const y = class y {
776
+ class O {
777
+ constructor(t) {
778
+ 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) => {
779
+ this.registerShortcut(e);
780
+ });
781
+ }
782
+ registerDefaultShortcuts() {
783
+ this.registerShortcut({
784
+ key: "b",
785
+ ctrl: !this.isMac,
786
+ meta: this.isMac,
787
+ command: "toggleBold",
788
+ description: "Bold",
789
+ preventDefault: !0
790
+ }), this.registerShortcut({
791
+ key: "i",
792
+ ctrl: !this.isMac,
793
+ meta: this.isMac,
794
+ command: "toggleItalic",
795
+ description: "Italic",
796
+ preventDefault: !0
797
+ }), this.registerShortcut({
798
+ key: "u",
799
+ ctrl: !this.isMac,
800
+ meta: this.isMac,
801
+ command: "toggleUnderline",
802
+ description: "Underline",
803
+ preventDefault: !0
804
+ }), this.registerShortcut({
805
+ key: "d",
806
+ ctrl: !this.isMac,
807
+ meta: this.isMac,
808
+ command: "toggleStrikethrough",
809
+ description: "Strikethrough",
810
+ preventDefault: !0
811
+ }), this.registerShortcut({
812
+ key: "z",
813
+ ctrl: !this.isMac,
814
+ meta: this.isMac,
815
+ command: "undo",
816
+ description: "Undo",
817
+ preventDefault: !0
818
+ }), this.registerShortcut({
819
+ key: "z",
820
+ ctrl: !this.isMac,
821
+ meta: this.isMac,
822
+ shift: !0,
823
+ command: "redo",
824
+ description: "Redo",
825
+ preventDefault: !0
826
+ }), this.registerShortcut({
827
+ key: "y",
828
+ ctrl: !this.isMac,
829
+ meta: this.isMac,
830
+ command: "redo",
831
+ description: "Redo",
832
+ preventDefault: !0
833
+ });
834
+ for (let t = 1; t <= 6; t++)
835
+ this.registerShortcut({
836
+ key: String(t),
837
+ ctrl: !this.isMac,
838
+ meta: this.isMac,
839
+ alt: !0,
840
+ command: "setBlockType",
841
+ params: `h${t}`,
842
+ description: `Heading ${t}`,
843
+ preventDefault: !0
844
+ });
845
+ this.registerShortcut({
846
+ key: "7",
847
+ ctrl: !this.isMac,
848
+ meta: this.isMac,
849
+ alt: !0,
850
+ command: "setBlockType",
851
+ params: "p",
852
+ description: "Paragraph",
853
+ preventDefault: !0
854
+ }), this.registerShortcut({
855
+ key: "7",
856
+ ctrl: !this.isMac,
857
+ meta: this.isMac,
858
+ shift: !0,
859
+ command: "toggleOrderedList",
860
+ description: "Numbered List",
861
+ preventDefault: !0
862
+ }), this.registerShortcut({
863
+ key: "8",
864
+ ctrl: !this.isMac,
865
+ meta: this.isMac,
866
+ shift: !0,
867
+ command: "toggleBulletList",
868
+ description: "Bullet List",
869
+ preventDefault: !0
870
+ }), this.registerShortcut({
871
+ key: "k",
872
+ ctrl: !this.isMac,
873
+ meta: this.isMac,
874
+ command: "openLinkDialog",
875
+ description: "Insert/Edit Link",
876
+ preventDefault: !0
877
+ }), this.registerShortcut({
878
+ key: "e",
879
+ ctrl: !this.isMac,
880
+ meta: this.isMac,
881
+ alt: !0,
882
+ command: "insertCodeBlock",
883
+ description: "Code Block",
884
+ preventDefault: !0
885
+ }), this.registerShortcut({
886
+ key: "q",
887
+ ctrl: !this.isMac,
888
+ meta: this.isMac,
889
+ shift: !0,
890
+ command: "toggleBlockquote",
891
+ description: "Blockquote",
892
+ preventDefault: !0
893
+ }), this.registerShortcut({
894
+ key: "l",
895
+ ctrl: !this.isMac,
896
+ meta: this.isMac,
897
+ shift: !0,
898
+ command: "setTextAlignment",
899
+ params: "left",
900
+ description: "Align Left",
901
+ preventDefault: !0
902
+ }), this.registerShortcut({
903
+ key: "e",
904
+ ctrl: !this.isMac,
905
+ meta: this.isMac,
906
+ shift: !0,
907
+ alt: !0,
908
+ command: "setTextAlignment",
909
+ params: "center",
910
+ description: "Align Center",
911
+ preventDefault: !0
912
+ }), this.registerShortcut({
913
+ key: "r",
914
+ ctrl: !this.isMac,
915
+ meta: this.isMac,
916
+ shift: !0,
917
+ command: "setTextAlignment",
918
+ params: "right",
919
+ description: "Align Right",
920
+ preventDefault: !0
921
+ }), this.registerShortcut({
922
+ key: "j",
923
+ ctrl: !this.isMac,
924
+ meta: this.isMac,
925
+ shift: !0,
926
+ command: "setTextAlignment",
927
+ params: "justify",
928
+ description: "Justify",
929
+ preventDefault: !0
930
+ }), this.registerShortcut({
931
+ key: "\\",
932
+ ctrl: !this.isMac,
933
+ meta: this.isMac,
934
+ command: "clearFormatting",
935
+ description: "Clear Formatting",
936
+ preventDefault: !0
937
+ }), this.registerShortcut({
938
+ key: "]",
939
+ ctrl: !this.isMac,
940
+ meta: this.isMac,
941
+ command: "increaseIndent",
942
+ description: "Indent",
943
+ preventDefault: !0
944
+ }), this.registerShortcut({
945
+ key: "[",
946
+ ctrl: !this.isMac,
947
+ meta: this.isMac,
948
+ command: "decreaseIndent",
949
+ description: "Outdent",
950
+ preventDefault: !0
951
+ }), this.registerShortcut({
952
+ key: "g",
953
+ ctrl: !this.isMac,
954
+ meta: this.isMac,
955
+ shift: !0,
956
+ command: "insertImage",
957
+ description: "Insert Image",
958
+ preventDefault: !0
959
+ }), this.registerShortcut({
960
+ key: "t",
961
+ ctrl: !this.isMac,
962
+ meta: this.isMac,
963
+ shift: !0,
964
+ alt: !0,
965
+ command: "insertTable",
966
+ description: "Insert Table",
967
+ preventDefault: !0
968
+ }), this.registerShortcut({
969
+ key: "f11",
970
+ command: "toggleFullscreen",
971
+ description: "Toggle Fullscreen",
972
+ preventDefault: !0
973
+ }), this.registerShortcut({
974
+ key: "p",
975
+ ctrl: !this.isMac,
976
+ meta: this.isMac,
977
+ shift: !0,
978
+ command: "togglePreview",
979
+ description: "Preview",
980
+ preventDefault: !0
981
+ }), this.registerShortcut({
982
+ key: "p",
983
+ ctrl: !this.isMac,
984
+ meta: this.isMac,
985
+ command: "print",
986
+ description: "Print",
987
+ preventDefault: !0
988
+ }), this.registerShortcut({
989
+ key: "s",
990
+ ctrl: !this.isMac,
991
+ meta: this.isMac,
992
+ shift: !0,
993
+ alt: !0,
994
+ command: "insertSpecialCharacter",
995
+ description: "Insert Special Character",
996
+ preventDefault: !0
997
+ }), this.registerShortcut({
998
+ key: "m",
999
+ ctrl: !this.isMac,
1000
+ meta: this.isMac,
1001
+ shift: !0,
1002
+ command: "insertEmoji",
1003
+ description: "Insert Emoji",
1004
+ preventDefault: !0
1005
+ }), this.registerShortcut({
1006
+ key: "9",
1007
+ ctrl: !this.isMac,
1008
+ meta: this.isMac,
1009
+ shift: !0,
1010
+ command: "toggleChecklist",
1011
+ description: "Checklist",
1012
+ preventDefault: !0
1013
+ }), this.registerShortcut({
1014
+ key: "a",
1015
+ ctrl: !this.isMac,
1016
+ meta: this.isMac,
1017
+ shift: !0,
1018
+ alt: !0,
1019
+ command: "toggleA11yChecker",
1020
+ description: "Accessibility Checker",
1021
+ preventDefault: !0
1022
+ }), this.registerShortcut({
1023
+ key: "F7",
1024
+ command: "toggleSpellCheck",
1025
+ description: "Spell Check",
1026
+ preventDefault: !0
1027
+ }), this.registerShortcut({
1028
+ key: "m",
1029
+ ctrl: !this.isMac,
1030
+ meta: this.isMac,
1031
+ alt: !0,
1032
+ command: "insertMath",
1033
+ description: "Insert Math",
1034
+ preventDefault: !0
1035
+ }), this.registerShortcut({
1036
+ key: "f",
1037
+ ctrl: !this.isMac,
1038
+ meta: this.isMac,
1039
+ alt: !0,
1040
+ command: "insertFootnote",
1041
+ description: "Insert Footnote",
1042
+ preventDefault: !0
1043
+ });
1044
+ }
1045
+ registerShortcut(t) {
1046
+ const e = this.getShortcutKey(t);
1047
+ this.shortcuts.set(e, t);
1048
+ }
1049
+ unregisterShortcut(t) {
1050
+ const e = this.getShortcutKey(t);
1051
+ this.shortcuts.delete(e);
1052
+ }
1053
+ getShortcutKey(t) {
1054
+ const e = [];
1055
+ return t.ctrl && e.push("ctrl"), t.alt && e.push("alt"), t.shift && e.push("shift"), t.meta && e.push("meta"), e.push(t.key.toLowerCase()), e.join("+");
1056
+ }
1057
+ getEventKey(t) {
1058
+ const e = [];
1059
+ 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("+");
1060
+ }
1061
+ handleKeyDown(t, e) {
1062
+ if (!this.enabled) return !1;
1063
+ const o = this.getEventKey(t), r = this.shortcuts.get(o);
1064
+ return r ? (r.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(r.command, r.params), !0) : !1;
1065
+ }
1066
+ enable() {
1067
+ this.enabled = !0;
1068
+ }
1069
+ disable() {
1070
+ this.enabled = !1;
1071
+ }
1072
+ isEnabled() {
1073
+ return this.enabled;
1074
+ }
1075
+ getAllShortcuts() {
1076
+ return Array.from(this.shortcuts.values());
1077
+ }
1078
+ getShortcutForCommand(t) {
1079
+ return Array.from(this.shortcuts.values()).find((e) => e.command === t);
1080
+ }
1081
+ getShortcutDescription(t) {
1082
+ const e = [];
1083
+ this.isMac ? (t.meta && e.push("⌘"), t.ctrl && e.push("⌃"), t.alt && e.push("⌥"), t.shift && e.push("⇧")) : (t.ctrl && e.push("Ctrl"), t.alt && e.push("Alt"), t.shift && e.push("Shift"));
1084
+ const o = t.key.length === 1 ? t.key.toUpperCase() : t.key;
1085
+ return e.push(o), e.join("+");
1086
+ }
1087
+ getShortcutsHelp() {
1088
+ const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
1089
+ t.forEach((r) => {
1090
+ const i = this.getShortcutCategory(r.command);
1091
+ e.has(i) || e.set(i, []), e.get(i).push(r);
1092
+ });
1093
+ let o = `# Keyboard Shortcuts
1094
+
1095
+ `;
1096
+ return e.forEach((r, i) => {
1097
+ o += `## ${i}
1098
+
1099
+ `, r.forEach((n) => {
1100
+ const s = this.getShortcutDescription(n);
1101
+ o += `- **${s}**: ${n.description || n.command}
1102
+ `;
1103
+ }), o += `
1104
+ `;
1105
+ }), o;
1106
+ }
1107
+ getShortcutCategory(t) {
1108
+ 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";
1109
+ }
1110
+ }
1111
+ const H = [
1112
+ "p",
1113
+ "br",
1114
+ "strong",
1115
+ "em",
1116
+ "u",
1117
+ "s",
1118
+ "strike",
1119
+ "del",
1120
+ "b",
1121
+ "i",
1122
+ "h1",
1123
+ "h2",
1124
+ "h3",
1125
+ "h4",
1126
+ "h5",
1127
+ "h6",
1128
+ "ul",
1129
+ "ol",
1130
+ "li",
1131
+ "a",
1132
+ "img",
1133
+ "video",
1134
+ "audio",
1135
+ "table",
1136
+ "thead",
1137
+ "tbody",
1138
+ "tr",
1139
+ "th",
1140
+ "td",
1141
+ "blockquote",
1142
+ "pre",
1143
+ "code",
1144
+ "span",
1145
+ "div",
1146
+ "sup",
1147
+ "sub",
1148
+ "hr"
1149
+ ], j = {
1150
+ "*": ["class", "style", "id", "data-*"],
1151
+ a: ["href", "target", "rel", "title"],
1152
+ img: ["src", "alt", "width", "height", "loading"],
1153
+ video: ["src", "controls", "width", "height", "autoplay", "loop", "muted"],
1154
+ audio: ["src", "controls", "autoplay", "loop", "muted"],
1155
+ table: ["border", "cellpadding", "cellspacing"],
1156
+ td: ["colspan", "rowspan", "align", "valign"],
1157
+ th: ["colspan", "rowspan", "align", "valign"]
1158
+ };
1159
+ function w(a, t, e) {
1160
+ if ((t == null ? void 0 : t.sanitize) === !1)
1161
+ return a;
1162
+ const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : H, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : j, n = document.createElement("div");
1163
+ return n.innerHTML = a, C(n, o, i), n.innerHTML;
1164
+ }
1165
+ function C(a, t, e) {
1166
+ const o = Array.from(a.childNodes);
1167
+ for (const r of o)
1168
+ if (r.nodeType === Node.ELEMENT_NODE) {
1169
+ const i = r, n = i.tagName.toLowerCase();
1170
+ if (!t.includes(n)) {
1171
+ for (; i.firstChild; )
1172
+ a.insertBefore(i.firstChild, i);
1173
+ a.removeChild(i);
1174
+ continue;
1175
+ }
1176
+ R(i, e), C(i, t, e);
1177
+ } else r.nodeType !== Node.TEXT_NODE && a.removeChild(r);
1178
+ }
1179
+ function R(a, t) {
1180
+ const e = a.tagName.toLowerCase(), o = Array.from(a.attributes), r = t[e] || [], i = t["*"] || [], n = [...r, ...i];
1181
+ for (const s of o) {
1182
+ const l = s.name.toLowerCase();
1183
+ let c = !1;
1184
+ n.includes(l) && (c = !0);
1185
+ for (const d of n)
1186
+ if (d.endsWith("*")) {
1187
+ const g = d.slice(0, -1);
1188
+ if (l.startsWith(g)) {
1189
+ c = !0;
1190
+ break;
1191
+ }
1192
+ }
1193
+ (l.startsWith("on") || l === "javascript:" || l === "href" && s.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && s.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), c || a.removeAttribute(s.name);
1194
+ }
1195
+ 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");
1196
+ }
1197
+ function F(a, t, e) {
1198
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : w(a, t);
1199
+ }
1200
+ function $(a, t, e) {
1201
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : w(a, t);
1202
+ }
1203
+ const k = class k {
763
1204
  /**
764
1205
  * Resolve configuration from multiple sources with priority
765
1206
  */
@@ -769,7 +1210,127 @@ const y = class y {
769
1210
  const o = this.parseAttributes(t.attributes);
770
1211
  Object.assign(e, o);
771
1212
  }
772
- return t.jsConfig && Object.assign(e, t.jsConfig), e;
1213
+ return t.jsConfig && Object.assign(e, t.jsConfig), this.normalizeConfig(e);
1214
+ }
1215
+ /**
1216
+ * Normalize mixed legacy/new config shapes
1217
+ */
1218
+ static normalizeConfig(t) {
1219
+ const e = { ...t };
1220
+ if (e.toolbarFloating !== void 0 || e.toolbarSticky !== void 0) {
1221
+ const n = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
1222
+ e.toolbarFloating !== void 0 && (n.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (n.sticky = !!e.toolbarSticky), e.toolbar = n;
1223
+ }
1224
+ 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) {
1225
+ const n = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
1226
+ e.autosaveEnabled !== void 0 && (n.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (n.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (n.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (n.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (n.apiUrl = e.autosaveApiUrl), e.autosave = n;
1227
+ }
1228
+ const o = {
1229
+ enabled: !1,
1230
+ intervalMs: 3e4,
1231
+ storageKey: "rte-autosave",
1232
+ provider: "localStorage",
1233
+ apiUrl: ""
1234
+ };
1235
+ if (typeof e.autosave == "boolean")
1236
+ e.autosave = {
1237
+ ...o,
1238
+ enabled: e.autosave
1239
+ };
1240
+ else if (typeof e.autosave == "object" && e.autosave) {
1241
+ const n = {
1242
+ ...o,
1243
+ ...e.autosave
1244
+ };
1245
+ n.intervalMs === void 0 && n.interval !== void 0 && (n.intervalMs = Number(n.interval)), n.enabled === void 0 && (n.enabled = !0), (!Number.isFinite(n.intervalMs) || n.intervalMs <= 0) && (n.intervalMs = o.intervalMs), e.autosave = n;
1246
+ } else
1247
+ e.autosave = o;
1248
+ if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
1249
+ const n = typeof e.language == "object" && e.language ? { ...e.language } : {};
1250
+ e.languageLocale !== void 0 && (n.locale = e.languageLocale), e.languageDirection !== void 0 && (n.direction = e.languageDirection), e.language = n;
1251
+ }
1252
+ const r = { locale: "en", direction: "ltr" };
1253
+ if (typeof e.language == "string" ? e.language = {
1254
+ locale: e.language,
1255
+ direction: r.direction
1256
+ } : typeof e.language == "object" && e.language ? e.language = {
1257
+ ...r,
1258
+ ...e.language
1259
+ } : e.language = r, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
1260
+ const n = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
1261
+ e.spellcheckEnabled !== void 0 && (n.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (n.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (n.apiUrl = e.spellcheckApiUrl), e.spellcheck = n;
1262
+ }
1263
+ const i = {
1264
+ enabled: !1,
1265
+ provider: "browser",
1266
+ apiUrl: ""
1267
+ };
1268
+ if (typeof e.spellcheck == "boolean")
1269
+ e.spellcheck = {
1270
+ ...i,
1271
+ enabled: e.spellcheck
1272
+ };
1273
+ else if (typeof e.spellcheck == "object" && e.spellcheck) {
1274
+ const n = {
1275
+ ...i,
1276
+ ...e.spellcheck
1277
+ };
1278
+ !n.provider && n.mode && (n.provider = n.mode === "local" ? "browser" : "api"), n.enabled === void 0 && (n.enabled = !!(n.mode || n.provider || n.apiUrl)), e.spellcheck = n;
1279
+ } else
1280
+ e.spellcheck = i;
1281
+ return e.contextMenuEnabled !== void 0 && (e.contextMenu = {
1282
+ enabled: !!e.contextMenuEnabled
1283
+ }), typeof e.contextMenu == "boolean" ? e.contextMenu = { enabled: e.contextMenu } : typeof e.contextMenu == "object" && e.contextMenu ? e.contextMenu = {
1284
+ enabled: e.contextMenu.enabled !== !1
1285
+ } : e.contextMenu = { enabled: !0 }, (e.pasteClean !== void 0 || e.pasteKeepFormatting !== void 0 || e.pasteConvertWord !== void 0) && (e.paste = {
1286
+ ...e.paste || {},
1287
+ ...e.pasteClean !== void 0 ? { clean: !!e.pasteClean } : {},
1288
+ ...e.pasteKeepFormatting !== void 0 ? { keepFormatting: !!e.pasteKeepFormatting } : {},
1289
+ ...e.pasteConvertWord !== void 0 ? { convertWord: !!e.pasteConvertWord } : {}
1290
+ }), e.paste = {
1291
+ clean: !0,
1292
+ keepFormatting: !1,
1293
+ convertWord: !0,
1294
+ ...e.paste || {}
1295
+ }, e.contentConfig = {
1296
+ allowedTags: [],
1297
+ allowedAttributes: {},
1298
+ sanitize: !0,
1299
+ ...e.contentConfig || {}
1300
+ }, (e.securitySanitizeOnPaste !== void 0 || e.securitySanitizeOnInput !== void 0) && (e.security = {
1301
+ ...e.security || {},
1302
+ ...e.securitySanitizeOnPaste !== void 0 ? { sanitizeOnPaste: !!e.securitySanitizeOnPaste } : {},
1303
+ ...e.securitySanitizeOnInput !== void 0 ? { sanitizeOnInput: !!e.securitySanitizeOnInput } : {}
1304
+ }), e.security = {
1305
+ sanitizeOnPaste: !0,
1306
+ sanitizeOnInput: !0,
1307
+ ...e.security || {}
1308
+ }, (e.accessibilityEnableAria !== void 0 || e.accessibilityKeyboardNavigation !== void 0 || e.accessibilityChecker !== void 0) && (e.accessibility = {
1309
+ ...e.accessibility || {},
1310
+ ...e.accessibilityEnableAria !== void 0 ? { enableARIA: !!e.accessibilityEnableAria } : {},
1311
+ ...e.accessibilityKeyboardNavigation !== void 0 ? { keyboardNavigation: !!e.accessibilityKeyboardNavigation } : {},
1312
+ ...e.accessibilityChecker !== void 0 ? { checker: !!e.accessibilityChecker } : {}
1313
+ }), typeof e.accessibility == "boolean" && (e.accessibility = {
1314
+ enableARIA: e.accessibility,
1315
+ keyboardNavigation: e.accessibility,
1316
+ checker: !1
1317
+ }), e.accessibility = {
1318
+ enableARIA: !0,
1319
+ keyboardNavigation: !0,
1320
+ checker: !1,
1321
+ ...e.accessibility || {}
1322
+ }, (e.performanceDebounceInputMs !== void 0 || e.performanceViewportOnlyScan !== void 0) && (e.performance = {
1323
+ ...e.performance || {},
1324
+ ...e.performanceDebounceInputMs !== void 0 ? { debounceInputMs: Number(e.performanceDebounceInputMs) } : {},
1325
+ ...e.performanceViewportOnlyScan !== void 0 ? { viewportOnlyScan: !!e.performanceViewportOnlyScan } : {}
1326
+ }), typeof e.performance == "boolean" && (e.performance = {
1327
+ debounceInputMs: 100,
1328
+ viewportOnlyScan: e.performance
1329
+ }), e.performance = {
1330
+ debounceInputMs: 100,
1331
+ viewportOnlyScan: !0,
1332
+ ...e.performance || {}
1333
+ }, (typeof e.performance.debounceInputMs != "number" || !Number.isFinite(e.performance.debounceInputMs) || e.performance.debounceInputMs < 0) && (e.performance.debounceInputMs = 100), e;
773
1334
  }
774
1335
  /**
775
1336
  * Parse web component attributes
@@ -831,7 +1392,7 @@ const y = class y {
831
1392
  return e;
832
1393
  }
833
1394
  };
834
- y.EDITOR_DEFAULTS = {
1395
+ k.EDITOR_DEFAULTS = {
835
1396
  height: 400,
836
1397
  width: "100%",
837
1398
  readonly: !1,
@@ -844,21 +1405,63 @@ y.EDITOR_DEFAULTS = {
844
1405
  placeholder: "Start typing...",
845
1406
  autofocus: !1,
846
1407
  autosave: !1,
847
- spellcheck: !1,
848
- language: "en"
1408
+ accessibility: {
1409
+ enableARIA: !0,
1410
+ keyboardNavigation: !0,
1411
+ checker: !1
1412
+ },
1413
+ performance: {
1414
+ debounceInputMs: 100,
1415
+ viewportOnlyScan: !0
1416
+ },
1417
+ spellcheck: {
1418
+ enabled: !1,
1419
+ provider: "browser",
1420
+ apiUrl: ""
1421
+ },
1422
+ language: {
1423
+ locale: "en",
1424
+ direction: "ltr"
1425
+ },
1426
+ contextMenu: {
1427
+ enabled: !0
1428
+ },
1429
+ contentConfig: {
1430
+ allowedTags: [],
1431
+ allowedAttributes: {},
1432
+ sanitize: !0
1433
+ },
1434
+ paste: {
1435
+ clean: !0,
1436
+ keepFormatting: !1,
1437
+ convertWord: !0
1438
+ },
1439
+ security: {
1440
+ sanitizeOnPaste: !0,
1441
+ sanitizeOnInput: !0
1442
+ },
1443
+ statusbar: !1
849
1444
  };
850
- let x = y;
851
- const H = '.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{background:#1e1e1e;color:#d4d4d4;border-color:#3c3c3c}.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:#252526;border-bottom-color:#3c3c3c}.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-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-left:1px solid #ccc;border-top-right-radius:3px;border-bottom-right-radius:3px}}}.editora-theme-dark .editora-toolbar-button{color:#d4d4d4}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:#37373d;border-color:#555}.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:#2a2d2e;border-color:#666}.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:24px;height:24px;display:block}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#3c3c3c}.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:#252526;border-color:#3c3c3c;box-shadow:0 2px 8px #00000080}.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:#d4d4d4}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#37373d}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#6a6a6a}.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-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:#4db8ff}.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-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:#9a9a9a}.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:#252526;border-color:#3c3c3c;box-shadow:0 2px 8px #00000080}.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:#252526;border-top-color:#3c3c3c;color:#9a9a9a}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#3c3c3c}.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}}';
852
- function z() {
853
- const n = "editora-webcomponent-styles";
854
- if (!document.getElementById(n)) {
1445
+ let v = k;
1446
+ const U = '.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-left:1px solid #ccc;border-top-right-radius:3px;border-bottom-right-radius:3px}}}.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-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:#4db8ff}.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:#9a9a9a}.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}}';
1447
+ let m;
1448
+ function W() {
1449
+ const a = "editora-webcomponent-styles";
1450
+ if (!document.getElementById(a)) {
855
1451
  const t = document.createElement("style");
856
- t.id = n, t.textContent = H, document.head.appendChild(t);
1452
+ t.id = a, t.textContent = U, document.head.appendChild(t);
1453
+ }
1454
+ }
1455
+ function K() {
1456
+ if (!m) {
1457
+ const a = p.__globalPluginLoader;
1458
+ a ? m = a : m = new x();
857
1459
  }
1460
+ return m;
858
1461
  }
859
- class u extends HTMLElement {
1462
+ class p extends HTMLElement {
860
1463
  constructor() {
861
- if (super(), this.config = {}, this.isInitialized = !1, z(), !this.hasAttribute("data-initial-content")) {
1464
+ if (super(), this.pluginLoader = K(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new O(), this.lastAutosavedContent = "", this.loadedPlugins = [], W(), !this.hasAttribute("data-initial-content")) {
862
1465
  const t = this.innerHTML.trim();
863
1466
  t && this.setAttribute("data-initial-content", t);
864
1467
  }
@@ -872,13 +1475,41 @@ class u extends HTMLElement {
872
1475
  "plugins",
873
1476
  "toolbar",
874
1477
  "toolbar-items",
1478
+ "toolbar-floating",
1479
+ "toolbar-sticky",
875
1480
  "readonly",
876
1481
  "disabled",
877
1482
  "theme",
878
1483
  "placeholder",
879
1484
  "autofocus",
1485
+ "autosave",
1486
+ "autosave-enabled",
1487
+ "autosave-interval-ms",
1488
+ "autosave-storage-key",
1489
+ "autosave-provider",
1490
+ "autosave-api-url",
1491
+ "accessibility",
1492
+ "accessibility-enable-aria",
1493
+ "accessibility-keyboard-navigation",
1494
+ "accessibility-checker",
1495
+ "performance",
1496
+ "performance-debounce-input-ms",
1497
+ "performance-viewport-only-scan",
880
1498
  "language",
1499
+ "language-locale",
1500
+ "language-direction",
881
1501
  "spellcheck",
1502
+ "spellcheck-enabled",
1503
+ "spellcheck-provider",
1504
+ "context-menu",
1505
+ "context-menu-enabled",
1506
+ "paste",
1507
+ "paste-clean",
1508
+ "paste-keep-formatting",
1509
+ "paste-convert-word",
1510
+ "security",
1511
+ "security-sanitize-on-paste",
1512
+ "security-sanitize-on-input",
882
1513
  "statusbar"
883
1514
  ];
884
1515
  }
@@ -896,13 +1527,13 @@ class u extends HTMLElement {
896
1527
  * Wait for the global plugin loader to be available
897
1528
  */
898
1529
  async waitForPluginLoader() {
899
- if (u.__globalPluginLoader) {
900
- this.pluginLoader = u.__globalPluginLoader;
1530
+ if (p.__globalPluginLoader) {
1531
+ this.pluginLoader = p.__globalPluginLoader;
901
1532
  return;
902
1533
  }
903
1534
  return new Promise((t) => {
904
1535
  const e = () => {
905
- u.__globalPluginLoader ? (this.pluginLoader = u.__globalPluginLoader, t()) : setTimeout(e, 0);
1536
+ p.__globalPluginLoader ? (this.pluginLoader = p.__globalPluginLoader, t()) : setTimeout(e, 0);
906
1537
  };
907
1538
  e();
908
1539
  });
@@ -929,23 +1560,24 @@ class u extends HTMLElement {
929
1560
  * Initialize the editor
930
1561
  */
931
1562
  async initialize() {
1563
+ var o;
932
1564
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
933
1565
  this.setAttribute("data-editora-editor", "true"), 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}`);
934
1566
  const t = await this.loadPlugins();
935
- t.forEach((o) => {
936
- if (o.init && typeof o.init == "function")
1567
+ this.loadedPlugins = t, t.forEach((r) => {
1568
+ if (r.init && typeof r.init == "function")
937
1569
  try {
938
- o.init({ editorElement: this });
939
- } catch (r) {
940
- console.error(`[RichTextEditor] Error initializing plugin ${o.name}:`, r);
1570
+ r.init({ editorElement: this });
1571
+ } catch (i) {
1572
+ console.error(`[RichTextEditor] Error initializing plugin ${r.name}:`, i);
941
1573
  }
942
1574
  });
943
- const e = this.getAttribute("data-initial-content") || "";
944
- this.engine = new v({
1575
+ const e = (o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || "";
1576
+ this.engine = new M({
945
1577
  content: e,
946
1578
  plugins: t,
947
1579
  readonly: this.config.readonly
948
- }), this.createUI(t, e), this.setupEventListeners(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
1580
+ }), this.createUI(t, e), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.dispatchEvent(new CustomEvent("editor-ready", {
949
1581
  detail: { api: this.getAPI() },
950
1582
  bubbles: !0
951
1583
  }));
@@ -964,65 +1596,303 @@ class u extends HTMLElement {
964
1596
  */
965
1597
  async loadPlugins() {
966
1598
  this.pluginLoader || await this.waitForPluginLoader();
967
- const t = [];
968
- if (this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0)) {
1599
+ 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), r = this.getAccessibilityConfig().checker === !0;
1600
+ if (e) {
969
1601
  if (typeof this.config.plugins == "string") {
970
- const o = await this.pluginLoader.parsePluginString(this.config.plugins);
971
- t.push(...o);
972
- } else if (Array.isArray(this.config.plugins))
973
- for (const o of this.config.plugins)
974
- if (typeof o == "string") {
975
- const r = await this.pluginLoader.load(o);
976
- r && t.push(r);
1602
+ const i = this.config.plugins.split(/\s+/).filter(Boolean);
1603
+ r && !i.includes("a11yChecker") && i.push("a11yChecker");
1604
+ for (const n of i) {
1605
+ const s = await this.pluginLoader.load(n, this.getPluginLoadConfig(n));
1606
+ s && t.push(s);
1607
+ }
1608
+ } else if (Array.isArray(this.config.plugins)) {
1609
+ for (const i of this.config.plugins)
1610
+ if (typeof i == "string") {
1611
+ const n = await this.pluginLoader.load(i, this.getPluginLoadConfig(i));
1612
+ n && t.push(n);
977
1613
  } else
978
- t.push(o);
1614
+ t.push(i);
1615
+ if (r && !t.some((i) => (i == null ? void 0 : i.name) === "a11yChecker")) {
1616
+ const i = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
1617
+ i && t.push(i);
1618
+ }
1619
+ }
979
1620
  } else {
980
- const o = this.pluginLoader.getRegisteredPluginNames(), r = await this.pluginLoader.loadMultiple(o);
981
- t.push(...r);
1621
+ const i = this.pluginLoader.getRegisteredPluginNames();
1622
+ for (const n of i) {
1623
+ const s = await this.pluginLoader.load(n, this.getPluginLoadConfig(n));
1624
+ s && t.push(s);
1625
+ }
982
1626
  }
983
1627
  return t;
984
1628
  }
1629
+ resolveToolbarItems() {
1630
+ const t = this.config.toolbarItems;
1631
+ if (typeof t == "string") return t;
1632
+ if (Array.isArray(t)) return t.join(" ");
1633
+ const e = this.config.toolbar;
1634
+ if (typeof e == "string") return e;
1635
+ if (!e || typeof e != "object") return;
1636
+ const o = e.items;
1637
+ if (typeof o == "string") return o;
1638
+ if (Array.isArray(o)) return o.join(" ");
1639
+ }
1640
+ isToolbarStickyEnabled() {
1641
+ const t = this.config.toolbar;
1642
+ return !t || typeof t != "object" ? !1 : !!t.sticky;
1643
+ }
1644
+ isToolbarFloatingEnabled() {
1645
+ const t = this.config.toolbar;
1646
+ return !t || typeof t != "object" ? !1 : !!t.floating;
1647
+ }
1648
+ isStatusbarEnabled() {
1649
+ const t = this.config.statusbar;
1650
+ return typeof t == "boolean" ? t : t && typeof t == "object" ? t.enabled !== !1 : !1;
1651
+ }
1652
+ getStatusbarPosition() {
1653
+ const t = this.config.statusbar;
1654
+ return t && typeof t == "object" && t.position === "top" ? "top" : "bottom";
1655
+ }
1656
+ getLanguageConfig() {
1657
+ const t = this.config.language;
1658
+ return typeof t == "string" ? { locale: t, direction: "ltr" } : t && typeof t == "object" ? {
1659
+ locale: t.locale || "en",
1660
+ direction: t.direction === "rtl" ? "rtl" : "ltr"
1661
+ } : { locale: "en", direction: "ltr" };
1662
+ }
1663
+ getAccessibilityConfig() {
1664
+ const t = this.config.accessibility;
1665
+ return typeof t == "boolean" ? {
1666
+ enableARIA: t,
1667
+ keyboardNavigation: t,
1668
+ checker: !1
1669
+ } : t && typeof t == "object" ? {
1670
+ enableARIA: t.enableARIA !== !1,
1671
+ keyboardNavigation: t.keyboardNavigation !== !1,
1672
+ checker: !!t.checker
1673
+ } : {
1674
+ enableARIA: !0,
1675
+ keyboardNavigation: !0,
1676
+ checker: !1
1677
+ };
1678
+ }
1679
+ getPerformanceConfig() {
1680
+ var e;
1681
+ const t = this.config.performance;
1682
+ if (typeof t == "boolean")
1683
+ return {
1684
+ debounceInputMs: 100,
1685
+ viewportOnlyScan: t
1686
+ };
1687
+ if (t && typeof t == "object") {
1688
+ const o = Number((e = t.debounceInputMs) != null ? e : 100);
1689
+ return {
1690
+ debounceInputMs: Number.isFinite(o) && o >= 0 ? o : 100,
1691
+ viewportOnlyScan: t.viewportOnlyScan !== !1
1692
+ };
1693
+ }
1694
+ return {
1695
+ debounceInputMs: 100,
1696
+ viewportOnlyScan: !0
1697
+ };
1698
+ }
1699
+ isEditorInViewport() {
1700
+ if (!this.contentElement || typeof window == "undefined") return !0;
1701
+ const t = this.contentElement.getBoundingClientRect();
1702
+ return t.bottom >= 0 && t.top <= window.innerHeight;
1703
+ }
1704
+ applyAccessibilitySettings() {
1705
+ if (!this.contentElement) return;
1706
+ const t = this.getAccessibilityConfig();
1707
+ if (t.enableARIA) {
1708
+ this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute("aria-disabled", this.config.readonly ? "true" : "false");
1709
+ const e = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
1710
+ e ? this.contentElement.setAttribute("aria-label", e) : this.contentElement.removeAttribute("aria-label");
1711
+ } else
1712
+ this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
1713
+ this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
1714
+ }
1715
+ applyLanguageSettings() {
1716
+ if (!this.contentElement) return;
1717
+ const t = this.getLanguageConfig();
1718
+ this.contentElement.setAttribute("lang", t.locale), this.contentElement.setAttribute("dir", t.direction);
1719
+ }
1720
+ getSpellcheckConfig() {
1721
+ const t = this.config.spellcheck;
1722
+ if (typeof t == "boolean")
1723
+ return {
1724
+ enabled: t,
1725
+ provider: "browser"
1726
+ };
1727
+ if (t && typeof t == "object") {
1728
+ const e = t.provider || "browser";
1729
+ return {
1730
+ enabled: !!t.enabled,
1731
+ provider: e,
1732
+ mode: t.mode
1733
+ };
1734
+ }
1735
+ return { enabled: !1, provider: "browser" };
1736
+ }
1737
+ applySpellcheckSettings() {
1738
+ if (!this.contentElement) return;
1739
+ const t = this.getSpellcheckConfig(), e = t.enabled && t.provider === "browser";
1740
+ this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
1741
+ }
1742
+ executeCommand(t, e) {
1743
+ var r;
1744
+ typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
1745
+ const o = this.loadedPlugins.find((i) => i.commands && i.commands[t]);
1746
+ if (o && o.commands) {
1747
+ const i = o.commands[t];
1748
+ if (typeof i == "function")
1749
+ try {
1750
+ return i(t === "toggleFullscreen" ? this : e), !0;
1751
+ } catch (n) {
1752
+ return console.error(`[RichTextEditor] Error executing native command ${t}:`, n), !1;
1753
+ }
1754
+ }
1755
+ return ((r = this.engine) == null ? void 0 : r.execCommand(t, e)) || !1;
1756
+ }
1757
+ getPluginLoadConfig(t) {
1758
+ const e = this.config.pluginConfig;
1759
+ if (e && typeof e == "object") {
1760
+ const i = e[t];
1761
+ if (i && typeof i == "object")
1762
+ return i;
1763
+ }
1764
+ const o = {
1765
+ spellCheck: ["spellcheck", "spellCheck"]
1766
+ }, r = [
1767
+ t,
1768
+ t.toLowerCase(),
1769
+ ...o[t] || []
1770
+ ];
1771
+ for (const i of r) {
1772
+ const n = this.config[i];
1773
+ if (n && typeof n == "object" && !Array.isArray(n))
1774
+ return n;
1775
+ }
1776
+ }
1777
+ getContentSanitizeConfig() {
1778
+ const t = this.config.contentConfig;
1779
+ return t && typeof t == "object" ? t : { sanitize: !0 };
1780
+ }
1781
+ getSecurityConfig() {
1782
+ const t = this.config.security;
1783
+ return t && typeof t == "object" ? t : { sanitizeOnPaste: !0, sanitizeOnInput: !0 };
1784
+ }
1785
+ getAutosaveConfig() {
1786
+ var e, o;
1787
+ const t = this.config.autosave;
1788
+ if (typeof t == "boolean")
1789
+ return {
1790
+ enabled: t,
1791
+ intervalMs: 3e4,
1792
+ storageKey: "rte-autosave",
1793
+ provider: "localStorage"
1794
+ };
1795
+ if (t && typeof t == "object") {
1796
+ const r = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
1797
+ return {
1798
+ enabled: !!t.enabled,
1799
+ intervalMs: Number.isFinite(r) && r > 0 ? r : 3e4,
1800
+ storageKey: String(t.storageKey || "rte-autosave"),
1801
+ provider: t.provider || "localStorage",
1802
+ apiUrl: t.apiUrl
1803
+ };
1804
+ }
1805
+ return {
1806
+ enabled: !1,
1807
+ intervalMs: 3e4,
1808
+ storageKey: "rte-autosave",
1809
+ provider: "localStorage"
1810
+ };
1811
+ }
1812
+ persistAutosave(t) {
1813
+ const e = this.getAutosaveConfig();
1814
+ if (e.enabled && t !== this.lastAutosavedContent) {
1815
+ if (this.lastAutosavedContent = t, e.provider === "localStorage") {
1816
+ try {
1817
+ localStorage.setItem(e.storageKey, t), localStorage.setItem(`${e.storageKey}-timestamp`, Date.now().toString());
1818
+ } catch (o) {
1819
+ console.error("[RichTextEditor] Failed to save autosave content to localStorage:", o);
1820
+ }
1821
+ return;
1822
+ }
1823
+ e.provider === "api" && e.apiUrl && fetch(e.apiUrl, {
1824
+ method: "POST",
1825
+ headers: { "Content-Type": "application/json" },
1826
+ body: JSON.stringify({ content: t, timestamp: Date.now() })
1827
+ }).catch((o) => {
1828
+ console.error("[RichTextEditor] Failed to save autosave content to API:", o);
1829
+ });
1830
+ }
1831
+ }
1832
+ restoreAutosavedContent() {
1833
+ const t = this.getAutosaveConfig();
1834
+ if (!t.enabled || t.provider !== "localStorage") return null;
1835
+ try {
1836
+ const e = localStorage.getItem(t.storageKey);
1837
+ if (e)
1838
+ return this.lastAutosavedContent = e, e;
1839
+ } catch (e) {
1840
+ console.error("[RichTextEditor] Failed to restore autosaved content:", e);
1841
+ }
1842
+ return null;
1843
+ }
1844
+ stopAutosave() {
1845
+ this.autosaveTimer && (clearInterval(this.autosaveTimer), this.autosaveTimer = void 0);
1846
+ }
1847
+ startAutosave() {
1848
+ this.stopAutosave();
1849
+ const t = this.getAutosaveConfig();
1850
+ !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
1851
+ var e;
1852
+ this.persistAutosave(((e = this.contentElement) == null ? void 0 : e.innerHTML) || "");
1853
+ }, t.intervalMs));
1854
+ }
1855
+ insertHTMLAtSelection(t) {
1856
+ if (!this.contentElement) return;
1857
+ const e = window.getSelection();
1858
+ if (e && e.rangeCount > 0) {
1859
+ const o = e.getRangeAt(0);
1860
+ o.deleteContents();
1861
+ const r = document.createElement("div");
1862
+ r.innerHTML = t;
1863
+ const i = document.createDocumentFragment();
1864
+ for (; r.firstChild; )
1865
+ i.appendChild(r.firstChild);
1866
+ o.insertNode(i), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
1867
+ } else
1868
+ this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
1869
+ }
985
1870
  /**
986
1871
  * Create UI elements
987
1872
  */
988
1873
  createUI(t, e) {
989
1874
  const o = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
990
- if (this.innerHTML = "", this.config.toolbar !== !1 && !o) {
991
- this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement);
992
- const i = this.config.toolbarItems || this.config.toolbar;
993
- this.toolbar = new L(
994
- {
995
- items: typeof i == "string" ? i : void 0,
996
- sticky: this.config.toolbar && typeof this.config.toolbar == "object" ? this.config.toolbar.sticky : !1,
997
- position: "top"
998
- },
999
- t,
1000
- this.pluginLoader
1001
- // Pass plugin loader to get all registered plugins
1002
- ), this.toolbar.setCommandHandler((a, s) => {
1003
- var b, g;
1004
- if (this.contentElement) {
1005
- this.contentElement.focus();
1006
- const p = window.getSelection();
1007
- if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
1008
- const d = document.createRange(), c = this.contentElement.lastChild || this.contentElement;
1009
- c.nodeType === Node.TEXT_NODE ? d.setStart(c, ((b = c.textContent) == null ? void 0 : b.length) || 0) : c.nodeType === Node.ELEMENT_NODE ? (d.selectNodeContents(c), d.collapse(!1)) : d.setStart(this.contentElement, 0), d.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(d);
1010
- }
1011
- }
1012
- const l = t.find((p) => p.commands && p.commands[a]);
1013
- if (l && l.commands) {
1014
- const p = l.commands[a];
1015
- if (typeof p == "function")
1016
- try {
1017
- return p(a === "toggleFullscreen" ? this : s);
1018
- } catch (d) {
1019
- return console.error(`[RichTextEditor] Error executing native command ${a}:`, d), !1;
1020
- }
1875
+ 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 L(
1876
+ {
1877
+ items: this.resolveToolbarItems(),
1878
+ sticky: this.isToolbarStickyEnabled(),
1879
+ position: "top"
1880
+ },
1881
+ t,
1882
+ this.pluginLoader
1883
+ // Pass plugin loader to get all registered plugins
1884
+ ), this.toolbar.setCommandHandler((i, n) => {
1885
+ var s;
1886
+ if (this.contentElement) {
1887
+ this.contentElement.focus();
1888
+ const l = window.getSelection();
1889
+ if (!l || l.rangeCount === 0 || !this.contentElement.contains(l.anchorNode)) {
1890
+ const c = document.createRange(), d = this.contentElement.lastChild || this.contentElement;
1891
+ d.nodeType === Node.TEXT_NODE ? c.setStart(d, ((s = d.textContent) == null ? void 0 : s.length) || 0) : d.nodeType === Node.ELEMENT_NODE ? (c.selectNodeContents(d), c.collapse(!1)) : c.setStart(this.contentElement, 0), c.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(c);
1021
1892
  }
1022
- return ((g = this.engine) == null ? void 0 : g.execCommand(a, s)) || !1;
1023
- }), this.toolbar.render(this.toolbarElement);
1024
- } else o && this.appendChild(o);
1025
- this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
1893
+ }
1894
+ return this.executeCommand(i, n);
1895
+ }), 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);
1026
1896
  try {
1027
1897
  document.execCommand("defaultParagraphSeparator", !1, "p");
1028
1898
  } catch (i) {
@@ -1039,7 +1909,7 @@ class u extends HTMLElement {
1039
1909
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
1040
1910
  } else
1041
1911
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
1042
- this.appendChild(this.contentElement), this.config.toolbar && typeof this.config.toolbar == "object" && this.config.toolbar.floating && (this.floatingToolbar = new P({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.config.statusbar && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new T({ position: "bottom" }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
1912
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new T({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new I({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
1043
1913
  var i;
1044
1914
  return (i = this.contentElement) == null ? void 0 : i.focus();
1045
1915
  }, 0);
@@ -1049,39 +1919,122 @@ class u extends HTMLElement {
1049
1919
  */
1050
1920
  setupEventListeners() {
1051
1921
  if (!this.contentElement || !this.engine) return;
1922
+ const t = this.keyboardShortcutManager;
1052
1923
  this.contentElement.addEventListener("input", () => {
1053
- const e = this.contentElement.innerHTML;
1054
- this.dispatchEvent(new CustomEvent("content-change", {
1055
- detail: { html: e },
1056
- bubbles: !0
1057
- })), this.updateStatusBar();
1924
+ if (!this.contentElement) return;
1925
+ let o = this.contentElement.innerHTML;
1926
+ const r = this.getPerformanceConfig(), i = this.getContentSanitizeConfig(), n = this.getSecurityConfig();
1927
+ if (n.sanitizeOnInput !== !1 && i.sanitize !== !1) {
1928
+ const l = $(o, i, n);
1929
+ if (l !== o) {
1930
+ const c = window.getSelection(), d = c && c.rangeCount > 0 ? c.getRangeAt(0) : null;
1931
+ if (this.contentElement.innerHTML = l, d && c)
1932
+ try {
1933
+ c.removeAllRanges(), c.addRange(d);
1934
+ } catch (g) {
1935
+ }
1936
+ o = l;
1937
+ }
1938
+ }
1939
+ this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
1940
+ const s = () => {
1941
+ this.dispatchEvent(new CustomEvent("content-change", {
1942
+ detail: { html: o },
1943
+ bubbles: !0
1944
+ }));
1945
+ };
1946
+ r.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(s, r.debounceInputMs) : s(), this.updateStatusBar();
1947
+ }), this.contentElement.addEventListener("contextmenu", (o) => {
1948
+ const r = this.config.contextMenu;
1949
+ (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && o.preventDefault();
1950
+ }), this.contentElement.addEventListener("paste", (o) => {
1951
+ var d, g;
1952
+ o.preventDefault();
1953
+ const r = this.config.paste || {};
1954
+ let i = ((d = o.clipboardData) == null ? void 0 : d.getData("text/html")) || "";
1955
+ const n = ((g = o.clipboardData) == null ? void 0 : g.getData("text/plain")) || "", s = this.getContentSanitizeConfig(), l = this.getSecurityConfig(), c = !!i && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(i);
1956
+ if ((r.clean || !r.keepFormatting) && n) {
1957
+ document.execCommand("insertText", !1, n);
1958
+ return;
1959
+ }
1960
+ if (r.convertWord === !1 && c && n) {
1961
+ document.execCommand("insertText", !1, n);
1962
+ return;
1963
+ }
1964
+ if (i) {
1965
+ l.sanitizeOnPaste !== !1 && s.sanitize !== !1 && (i = F(i, s, l)), this.insertHTMLAtSelection(i);
1966
+ return;
1967
+ }
1968
+ n && document.execCommand("insertText", !1, n);
1058
1969
  }), this.contentElement.addEventListener("focus", () => {
1059
- this.dispatchEvent(new Event("editor-focus", { bubbles: !0 }));
1970
+ this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
1060
1971
  }), this.contentElement.addEventListener("blur", () => {
1061
- this.dispatchEvent(new Event("editor-blur", { bubbles: !0 }));
1972
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
1973
+ detail: { html: this.contentElement.innerHTML },
1974
+ bubbles: !0
1975
+ })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
1976
+ }), this.contentElement.addEventListener("keydown", (o) => {
1977
+ this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (i, n) => {
1978
+ this.executeCommand(i, n);
1979
+ });
1062
1980
  });
1063
- const t = () => {
1064
- this.updateFloatingToolbar(), this.updateStatusBar();
1981
+ const e = () => {
1982
+ const o = this.getSelectionRangeInEditor(), r = document.activeElement, i = !!r && !!this.contentElement && (r === this.contentElement || this.contentElement.contains(r));
1983
+ this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !i || !o && !i || (this.updateFloatingToolbar(), this.updateStatusBar());
1065
1984
  };
1066
- document.addEventListener("selectionchange", t);
1985
+ this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
1986
+ }
1987
+ getSelectionRangeInEditor() {
1988
+ if (!this.contentElement) return null;
1989
+ const t = window.getSelection();
1990
+ if (!t || t.rangeCount === 0)
1991
+ return null;
1992
+ const e = t.getRangeAt(0), o = e.commonAncestorContainer;
1993
+ return this.contentElement.contains(o) ? e : null;
1994
+ }
1995
+ isSelectionBackward(t) {
1996
+ if (!t.anchorNode || !t.focusNode) return !1;
1997
+ try {
1998
+ const e = document.createRange();
1999
+ return e.setStart(t.anchorNode, t.anchorOffset), e.setEnd(t.focusNode, t.focusOffset), e.collapsed;
2000
+ } catch (e) {
2001
+ return !1;
2002
+ }
2003
+ }
2004
+ getSelectionAnchorRect(t, e) {
2005
+ const o = Array.from(e.getClientRects()).filter((i) => i.width > 0 || i.height > 0);
2006
+ return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
1067
2007
  }
1068
2008
  /**
1069
2009
  * Update floating toolbar position
1070
2010
  */
1071
2011
  updateFloatingToolbar() {
1072
2012
  if (!this.floatingToolbar) return;
1073
- const t = window.getSelection();
1074
- if (!t || t.rangeCount === 0) {
2013
+ const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
2014
+ if (t.viewportOnlyScan && !this.isEditorInViewport() && !e) {
1075
2015
  this.floatingToolbar.hide();
1076
2016
  return;
1077
2017
  }
1078
- const e = t.getRangeAt(0);
1079
- if (e.collapsed) {
2018
+ const o = this.getSelectionRangeInEditor();
2019
+ if (!o) {
1080
2020
  this.floatingToolbar.hide();
1081
2021
  return;
1082
2022
  }
1083
- const o = e.getBoundingClientRect();
1084
- this.floatingToolbar.show(o.left, o.top - 40);
2023
+ if (o.collapsed) {
2024
+ this.floatingToolbar.hide();
2025
+ return;
2026
+ }
2027
+ const r = window.getSelection();
2028
+ if (!r) {
2029
+ this.floatingToolbar.hide();
2030
+ return;
2031
+ }
2032
+ const i = this.getSelectionAnchorRect(r, o);
2033
+ if (!i) {
2034
+ this.floatingToolbar.hide();
2035
+ return;
2036
+ }
2037
+ this.floatingToolbar.show(i.left, i.top - 40);
1085
2038
  }
1086
2039
  /**
1087
2040
  * Update status bar with selection and cursor information
@@ -1091,18 +2044,18 @@ class u extends HTMLElement {
1091
2044
  */
1092
2045
  updateStatusBar() {
1093
2046
  if (!this.statusBar || !this.contentElement) return;
1094
- const t = this.contentElement.textContent || "", { words: e, chars: o } = M(t), r = S(this.contentElement), i = window.getSelection();
1095
- let a, s;
1096
- if (i && i.rangeCount > 0) {
1097
- const l = i.getRangeAt(0);
1098
- a = I(this.contentElement, l), l.collapsed || (s = N(l, a), a = void 0);
1099
- }
1100
- this.statusBar.update({
1101
- wordCount: e,
1102
- charCount: o,
1103
- lineCount: r,
1104
- cursorPosition: a,
1105
- selectionInfo: s
2047
+ const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
2048
+ if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
2049
+ return;
2050
+ const o = this.contentElement.textContent || "", { words: r, chars: i } = z(o), n = N(this.contentElement);
2051
+ let s, l;
2052
+ const c = this.getSelectionRangeInEditor();
2053
+ c && (s = P(this.contentElement, c), c.collapsed || (l = B(c, s), s = void 0)), this.statusBar.update({
2054
+ wordCount: r,
2055
+ charCount: i,
2056
+ lineCount: n,
2057
+ cursorPosition: s,
2058
+ selectionInfo: l
1106
2059
  });
1107
2060
  }
1108
2061
  /**
@@ -1111,7 +2064,7 @@ class u extends HTMLElement {
1111
2064
  handleAttributeChange(t, e) {
1112
2065
  switch (t) {
1113
2066
  case "readonly":
1114
- this.contentElement && (this.contentElement.contentEditable = e === "true" ? "false" : "true"), this.engine && this.engine.setReadonly(e === "true");
2067
+ this.contentElement && (this.contentElement.contentEditable = e === "true" ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(e === "true");
1115
2068
  break;
1116
2069
  case "theme":
1117
2070
  this.classList.forEach((o) => {
@@ -1119,10 +2072,52 @@ class u extends HTMLElement {
1119
2072
  }), e && this.classList.add(`editora-theme-${e}`);
1120
2073
  break;
1121
2074
  case "placeholder":
1122
- this.contentElement && this.contentElement.setAttribute("data-placeholder", e);
2075
+ this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
2076
+ break;
2077
+ case "accessibility":
2078
+ case "accessibility-enable-aria":
2079
+ case "accessibility-keyboard-navigation":
2080
+ case "accessibility-checker":
2081
+ this.applyAccessibilitySettings();
2082
+ break;
2083
+ case "performance":
2084
+ case "performance-debounce-input-ms":
2085
+ case "performance-viewport-only-scan":
2086
+ break;
2087
+ case "language":
2088
+ case "language-locale":
2089
+ case "language-direction":
2090
+ this.applyLanguageSettings();
2091
+ break;
2092
+ case "spellcheck":
2093
+ case "spellcheck-enabled":
2094
+ case "spellcheck-provider":
2095
+ this.applySpellcheckSettings();
2096
+ break;
2097
+ case "autosave":
2098
+ case "autosave-enabled":
2099
+ case "autosave-interval-ms":
2100
+ case "autosave-storage-key":
2101
+ case "autosave-provider":
2102
+ case "autosave-api-url":
2103
+ this.startAutosave();
2104
+ break;
2105
+ case "security":
2106
+ case "security-sanitize-on-paste":
2107
+ case "security-sanitize-on-input":
2108
+ case "paste":
2109
+ case "paste-clean":
2110
+ case "paste-keep-formatting":
2111
+ case "paste-convert-word":
2112
+ case "context-menu":
2113
+ case "context-menu-enabled":
1123
2114
  break;
1124
2115
  case "toolbar":
2116
+ case "toolbar-items":
2117
+ case "toolbar-floating":
2118
+ case "toolbar-sticky":
1125
2119
  case "plugins":
2120
+ case "statusbar":
1126
2121
  this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
1127
2122
  this.initialize().catch((o) => {
1128
2123
  console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
@@ -1140,7 +2135,7 @@ class u extends HTMLElement {
1140
2135
  const o = this.attributes[e];
1141
2136
  t[o.name] = o.value;
1142
2137
  }
1143
- return x.resolve({
2138
+ return v.resolve({
1144
2139
  jsConfig: this.jsConfig,
1145
2140
  attributes: t
1146
2141
  });
@@ -1157,10 +2152,7 @@ class u extends HTMLElement {
1157
2152
  setContent: (t) => {
1158
2153
  this.contentElement && (this.contentElement.innerHTML = t);
1159
2154
  },
1160
- execCommand: (t, e) => {
1161
- var o;
1162
- return ((o = this.engine) == null ? void 0 : o.execCommand(t, e)) || !1;
1163
- },
2155
+ execCommand: (t, e) => this.executeCommand(t, e),
1164
2156
  focus: () => {
1165
2157
  var t;
1166
2158
  (t = this.contentElement) == null || t.focus();
@@ -1184,7 +2176,7 @@ class u extends HTMLElement {
1184
2176
  */
1185
2177
  destroy() {
1186
2178
  var t, e, o, r;
1187
- (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.isInitialized = !1, this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2179
+ 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(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
1188
2180
  }
1189
2181
  // Public API methods
1190
2182
  getContent() {
@@ -1195,8 +2187,7 @@ class u extends HTMLElement {
1195
2187
  this.contentElement && (this.contentElement.innerHTML = t);
1196
2188
  }
1197
2189
  execCommand(t, e) {
1198
- var o;
1199
- return ((o = this.engine) == null ? void 0 : o.execCommand(t, e)) || !1;
2190
+ return this.executeCommand(t, e);
1200
2191
  }
1201
2192
  focus() {
1202
2193
  var t;
@@ -1207,80 +2198,80 @@ class u extends HTMLElement {
1207
2198
  (t = this.contentElement) == null || t.blur();
1208
2199
  }
1209
2200
  }
1210
- const f = new w();
1211
- u.__globalPluginLoader = f;
1212
- const B = {
2201
+ const y = new x();
2202
+ p.__globalPluginLoader = y;
2203
+ const _ = {
1213
2204
  // Core editing plugins (always loaded)
1214
- bold: () => import("./BoldPlugin.native-BAzzoqU5.mjs").then((n) => n.BoldPlugin()),
1215
- italic: () => import("./ItalicPlugin.native-CQjjDyUL.mjs").then((n) => n.ItalicPlugin()),
1216
- underline: () => import("./UnderlinePlugin.native-QpIcK4L2.mjs").then((n) => n.UnderlinePlugin()),
1217
- strikethrough: () => import("./StrikethroughPlugin.native-ChaZLaXw.mjs").then((n) => n.StrikethroughPlugin()),
1218
- clearFormatting: () => import("./ClearFormattingPlugin.native-BZPDHswo.mjs").then((n) => n.ClearFormattingPlugin()),
1219
- heading: () => import("./HeadingPlugin.native-DrLYwQnQ.mjs").then((n) => n.HeadingPlugin()),
1220
- blockquote: () => import("./BlockquotePlugin.native-JFmOLsxN.mjs").then((n) => n.BlockquotePlugin()),
1221
- code: () => import("./CodePlugin.native-DD9xFIid.mjs").then((n) => n.CodePlugin()),
1222
- codeSample: () => import("./CodeSamplePlugin.native-DMbEdO9j.mjs").then((n) => n.CodeSamplePlugin()),
1223
- list: () => import("./ListPlugin.native-CLFU5AUQ.mjs").then((n) => n.ListPlugin()),
1224
- checklist: () => import("./ChecklistPlugin.native-Dccs3nLe.mjs").then((n) => n.ChecklistPlugin()),
1225
- textAlignment: () => import("./TextAlignmentPlugin.native-CQIs1m7R.mjs").then((n) => n.TextAlignmentPlugin()),
1226
- indent: () => import("./IndentPlugin.native-CbFugPoi.mjs").then((n) => n.IndentPlugin()),
1227
- direction: () => import("./DirectionPlugin.native-Be7wCzkI.mjs").then((n) => n.DirectionPlugin()),
1228
- textColor: () => import("./TextColorPlugin.native-D6SmTglm.mjs").then((n) => n.TextColorPlugin()),
1229
- backgroundColor: () => import("./BackgroundColorPlugin.native-Dip5uqTg.mjs").then((n) => n.BackgroundColorPlugin()),
1230
- fontSize: () => import("./FontSizePlugin.native-DkLMLPue.mjs").then((n) => n.FontSizePlugin()),
1231
- fontFamily: () => import("./FontFamilyPlugin.native-BzS_9qbM.mjs").then((n) => n.FontFamilyPlugin()),
1232
- lineHeight: () => import("./LineHeightPlugin.native-CWQT2FIa.mjs").then((n) => n.LineHeightPlugin()),
1233
- capitalization: () => import("./CapitalizationPlugin.native-DOMsh5R7.mjs").then((n) => n.CapitalizationPlugin()),
1234
- history: () => import("./HistoryPlugin.native-DoDRifCf.mjs").then((n) => n.HistoryPlugin()),
2205
+ bold: () => import("./BoldPlugin.native-BAzzoqU5.mjs").then((a) => a.BoldPlugin()),
2206
+ italic: () => import("./ItalicPlugin.native-CQjjDyUL.mjs").then((a) => a.ItalicPlugin()),
2207
+ underline: () => import("./UnderlinePlugin.native-QpIcK4L2.mjs").then((a) => a.UnderlinePlugin()),
2208
+ strikethrough: () => import("./StrikethroughPlugin.native-0Be7j49s.mjs").then((a) => a.StrikethroughPlugin()),
2209
+ clearFormatting: () => import("./ClearFormattingPlugin.native-Bq_XcTh2.mjs").then((a) => a.ClearFormattingPlugin()),
2210
+ heading: () => import("./HeadingPlugin.native-DrLYwQnQ.mjs").then((a) => a.HeadingPlugin()),
2211
+ blockquote: () => import("./BlockquotePlugin.native-JFmOLsxN.mjs").then((a) => a.BlockquotePlugin()),
2212
+ code: () => import("./CodePlugin.native-0Zari_zp.mjs").then((a) => a.CodePlugin()),
2213
+ codeSample: () => import("./CodeSamplePlugin.native-B-KS1pOl.mjs").then((a) => a.CodeSamplePlugin()),
2214
+ list: () => import("./ListPlugin.native-V7EZC1lM.mjs").then((a) => a.ListPlugin()),
2215
+ checklist: () => import("./ChecklistPlugin.native-nuSSEFNI.mjs").then((a) => a.ChecklistPlugin()),
2216
+ textAlignment: () => import("./TextAlignmentPlugin.native-sM_1s00t.mjs").then((a) => a.TextAlignmentPlugin()),
2217
+ indent: () => import("./IndentPlugin.native-BHixp8sP.mjs").then((a) => a.IndentPlugin()),
2218
+ direction: () => import("./DirectionPlugin.native-CDnbdNyl.mjs").then((a) => a.DirectionPlugin()),
2219
+ textColor: () => import("./TextColorPlugin.native-Clgtb50j.mjs").then((a) => a.TextColorPlugin()),
2220
+ backgroundColor: () => import("./BackgroundColorPlugin.native-BE-p9DRd.mjs").then((a) => a.BackgroundColorPlugin()),
2221
+ fontSize: () => import("./FontSizePlugin.native-B_jCh7dY.mjs").then((a) => a.FontSizePlugin()),
2222
+ fontFamily: () => import("./FontFamilyPlugin.native-j8hMTbg4.mjs").then((a) => a.FontFamilyPlugin()),
2223
+ lineHeight: () => import("./LineHeightPlugin.native-CM7iXdQj.mjs").then((a) => a.LineHeightPlugin()),
2224
+ capitalization: () => import("./CapitalizationPlugin.native-DOMsh5R7.mjs").then((a) => a.CapitalizationPlugin()),
2225
+ history: () => import("./HistoryPlugin.native-DCrPdeSW.mjs").then((a) => a.HistoryPlugin()),
1235
2226
  // Advanced plugins (lazy loaded)
1236
- link: () => import("./LinkPlugin.native-BdAOV-iu.mjs").then((n) => n.LinkPlugin()),
1237
- table: () => import("./TablePlugin.native-EEWXn1-s.mjs").then((n) => n.TablePlugin()),
1238
- anchor: () => import("./AnchorPlugin.native-7es9PVZ9.mjs").then((n) => n.AnchorPlugin()),
1239
- embedIframe: () => import("./EmbedIframePlugin.native-ifr9KLdN.mjs").then((n) => n.EmbedIframePlugin()),
1240
- math: () => import("./MathPlugin.native-DE_ii-LA.mjs").then((n) => n.MathPlugin()),
1241
- image: () => import("./MediaManagerPlugin.native-DaYFDzNM.mjs").then((n) => n.MediaManagerPlugin()),
1242
- mergeTag: () => import("./MergeTagPlugin.native-CrxyThyn.mjs").then((n) => n.MergeTagPlugin()),
1243
- pageBreak: () => import("./PageBreakPlugin.native-DDjcDyRW.mjs").then((n) => n.PageBreakPlugin()),
1244
- print: () => import("./PrintPlugin.native-BUpm52VJ.mjs").then((n) => n.PrintPlugin()),
1245
- preview: () => import("./PreviewPlugin.native-DBvfpmIv.mjs").then((n) => n.PreviewPlugin()),
1246
- specialCharacters: () => import("./SpecialCharactersPlugin.native-x7a2SWXc.mjs").then((n) => n.SpecialCharactersPlugin()),
1247
- spellCheck: () => import("./SpellCheckPlugin.native-B7yTh0iE.mjs").then((n) => n.SpellCheckPlugin()),
1248
- emojis: () => import("./EmojisPlugin.native-D6mJSnSR.mjs").then((n) => n.EmojisPlugin()),
1249
- a11yChecker: () => import("./A11yCheckerPlugin.native-CZKpi3uF.mjs").then((n) => n.A11yCheckerPlugin()),
1250
- comments: () => import("./CommentsPlugin.native-2zQV8Ia4.mjs").then((n) => n.CommentsPlugin()),
1251
- "document-manager": () => import("./DocumentManagerPlugin.native-BvZL5CSG.mjs").then((n) => n.DocumentManagerPlugin()),
1252
- fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
1253
- template: () => import("./TemplatePlugin.native-BlSn1c9h.mjs").then((n) => n.TemplatePlugin()),
1254
- footnote: () => import("./FootnotePlugin.native-BciVc9W6.mjs").then((n) => n.FootnotePlugin())
2227
+ link: () => import("./LinkPlugin.native-CS2g-G18.mjs").then((a) => a.LinkPlugin()),
2228
+ table: () => import("./TablePlugin.native-DrHX-efe.mjs").then((a) => a.TablePlugin()),
2229
+ anchor: () => import("./AnchorPlugin.native-C1Rw5m04.mjs").then((a) => a.AnchorPlugin()),
2230
+ embedIframe: () => import("./EmbedIframePlugin.native-CSWIB1jm.mjs").then((a) => a.EmbedIframePlugin()),
2231
+ math: () => import("./MathPlugin.native-KUxz0o8C.mjs").then((a) => a.MathPlugin()),
2232
+ image: () => import("./MediaManagerPlugin.native-CgP5iInD.mjs").then((a) => a.MediaManagerPlugin()),
2233
+ mergeTag: () => import("./MergeTagPlugin.native-CU9LtsfD.mjs").then((a) => a.MergeTagPlugin()),
2234
+ pageBreak: () => import("./PageBreakPlugin.native-CGiQxXqR.mjs").then((a) => a.PageBreakPlugin()),
2235
+ print: () => import("./PrintPlugin.native-7qt5v7L5.mjs").then((a) => a.PrintPlugin()),
2236
+ preview: () => import("./PreviewPlugin.native-DBvfpmIv.mjs").then((a) => a.PreviewPlugin()),
2237
+ specialCharacters: () => import("./SpecialCharactersPlugin.native-DANrbExJ.mjs").then((a) => a.SpecialCharactersPlugin()),
2238
+ spellCheck: () => import("./SpellCheckPlugin.native-C8bPvRHy.mjs").then((a) => a.SpellCheckPlugin()),
2239
+ emojis: () => import("./EmojisPlugin.native-DxTm_DL-.mjs").then((a) => a.EmojisPlugin()),
2240
+ a11yChecker: () => import("./A11yCheckerPlugin.native-BRdGYMju.mjs").then((a) => a.A11yCheckerPlugin()),
2241
+ comments: () => import("./CommentsPlugin.native-tMnWn8a2.mjs").then((a) => a.CommentsPlugin()),
2242
+ "document-manager": () => import("./DocumentManagerPlugin.native-BvZL5CSG.mjs").then((a) => a.DocumentManagerPlugin()),
2243
+ fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((a) => a.FullscreenPlugin()),
2244
+ template: () => import("./TemplatePlugin.native-4lKEm-WY.mjs").then((a) => a.TemplatePlugin()),
2245
+ footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((a) => a.FootnotePlugin())
1255
2246
  };
1256
- async function D() {
1257
- return Object.entries(B).forEach(([n, t]) => {
1258
- f.register(n, t);
1259
- }), f;
2247
+ async function q() {
2248
+ return Object.entries(_).forEach(([a, t]) => {
2249
+ y.register(a, t);
2250
+ }), y;
1260
2251
  }
1261
- typeof window != "undefined" && D().then((n) => {
1262
- u.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", u);
2252
+ typeof window != "undefined" && q().then((a) => {
2253
+ p.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", p);
1263
2254
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
1264
2255
  t.forEach((i) => {
1265
- const a = i.innerHTML.trim();
1266
- e.push(a), a && i.setAttribute("data-initial-content", a);
2256
+ const n = i.innerHTML.trim();
2257
+ e.push(n), n && i.setAttribute("data-initial-content", n);
1267
2258
  });
1268
2259
  const o = document.querySelectorAll("editora-editor");
1269
2260
  Array.from(o).filter((i) => !i.hasAttribute("data-initial-content")).forEach((i) => {
1270
- const a = Array.from(o).indexOf(i);
1271
- e[a] && i.setAttribute("data-initial-content", e[a]);
2261
+ const n = Array.from(o).indexOf(i);
2262
+ e[n] && i.setAttribute("data-initial-content", e[n]);
1272
2263
  }), window.Editora = {
1273
2264
  version: "1.0.0",
1274
- plugins: f.getRegisteredPluginNames(),
1275
- WebComponent: u,
1276
- init: async (i, a) => {
2265
+ plugins: y.getRegisteredPluginNames(),
2266
+ WebComponent: p,
2267
+ init: async (i, n) => {
1277
2268
  const s = document.querySelector(i);
1278
- return s instanceof u ? (a && await s.setConfig(a), s.getAPI()) : null;
2269
+ return s instanceof p ? (n && await s.setConfig(n), s.getAPI()) : null;
1279
2270
  }
1280
2271
  };
1281
2272
  });
1282
2273
  export {
1283
- u as RichTextEditorElement,
1284
- D as initWebComponent
2274
+ p as RichTextEditorElement,
2275
+ q as initWebComponent
1285
2276
  };
1286
2277
  //# sourceMappingURL=webcomponent.js.map