@editora/core 1.0.7 → 1.0.8

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
  3. package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
  4. package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
  5. package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
  6. package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
  7. package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
  8. package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
  9. package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
  10. package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
  11. package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +37 -37
  12. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
  13. package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
  14. package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
  15. package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
  16. package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
  17. package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
  18. package/dist/editora.min.js +13 -13
  19. package/dist/editora.umd.js +13 -13
  20. package/dist/index-D1LOqg5C.js +10 -0
  21. package/dist/{index-yzU4NdPT.mjs → index-DqC57IEH.mjs} +424 -331
  22. package/dist/index.cjs.js +1 -1
  23. package/dist/index.esm.js +2 -2
  24. package/dist/plugin-loader.js +77 -40
  25. package/dist/webcomponent-core.js +479 -386
  26. package/dist/webcomponent-core.min.css +1 -1
  27. package/dist/webcomponent-core.min.js +39 -39
  28. package/dist/webcomponent.cjs.js +1 -1
  29. package/dist/webcomponent.esm.js +1 -1
  30. package/dist/webcomponent.js +417 -287
  31. package/dist/webcomponent.min.css +1 -1
  32. package/dist/webcomponent.min.js +5664 -394
  33. package/package.json +2 -2
  34. package/dist/index-BpE6GFbz.js +0 -10
@@ -1,4 +1,4 @@
1
- class x {
1
+ class I {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -17,16 +17,16 @@ class x {
17
17
  const o = this.pluginRegistry.get(t);
18
18
  if (!o)
19
19
  return console.warn(`Plugin not found: ${t}`), null;
20
- const i = await o();
21
- return e && this.applyPluginConfig(i, e), this.loadedPlugins.set(t, i), i;
20
+ const n = await o();
21
+ return e && this.applyPluginConfig(n, e), this.loadedPlugins.set(t, n), n;
22
22
  }
23
23
  /**
24
24
  * Load multiple plugins
25
25
  */
26
26
  async loadMultiple(t, e) {
27
27
  return (await Promise.all(
28
- t.map((i) => this.load(i, e))
29
- )).filter((i) => i !== null);
28
+ t.map((n) => this.load(n, e))
29
+ )).filter((n) => n !== null);
30
30
  }
31
31
  /**
32
32
  * Parse plugin string "lists link image media"
@@ -72,19 +72,19 @@ class x {
72
72
  return this.loadedPlugins.has(t);
73
73
  }
74
74
  }
75
- class b {
75
+ class v {
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 b(o, { anchor: 0, head: 0 }, t);
81
+ return new v(o, { anchor: 0, head: 0 }, t);
82
82
  }
83
83
  apply(t, e) {
84
- return new b(t, e || this.selection, this.schema);
84
+ return new v(t, e || this.selection, this.schema);
85
85
  }
86
86
  }
87
- class E {
87
+ class N {
88
88
  constructor(t, e) {
89
89
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
90
90
  }
@@ -95,7 +95,7 @@ class E {
95
95
  return { type: "text", text: t, marks: e };
96
96
  }
97
97
  }
98
- class S {
98
+ class B {
99
99
  constructor() {
100
100
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
101
101
  }
@@ -105,14 +105,14 @@ class S {
105
105
  if (t.initialize)
106
106
  try {
107
107
  t.initialize(o);
108
- } catch (i) {
109
- console.error(`Failed to initialize plugin "${t.name}":`, i);
108
+ } catch (n) {
109
+ console.error(`Failed to initialize plugin "${t.name}":`, n);
110
110
  }
111
111
  if (t.init && t.init !== t.initialize)
112
112
  try {
113
113
  t.init(o);
114
- } catch (i) {
115
- console.error(`Failed to run init hook for plugin "${t.name}":`, i);
114
+ } catch (n) {
115
+ console.error(`Failed to run init hook for plugin "${t.name}":`, n);
116
116
  }
117
117
  }
118
118
  unregister(t) {
@@ -132,7 +132,7 @@ class S {
132
132
  const t = {}, e = {};
133
133
  return this.plugins.forEach((o) => {
134
134
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
135
- }), new E(t, e);
135
+ }), new N(t, e);
136
136
  }
137
137
  getCommands() {
138
138
  const t = {};
@@ -147,35 +147,35 @@ class S {
147
147
  * Execute plugin command with mode awareness
148
148
  */
149
149
  async executePluginCommand(t, e, ...o) {
150
- const i = this.getPlugin(t);
151
- if (!i)
150
+ const n = this.getPlugin(t);
151
+ if (!n)
152
152
  throw new Error(`Plugin not found: ${t}`);
153
- const r = this.getPluginConfig(t) || i.config || {}, n = r.mode || "local";
153
+ const i = this.getPluginConfig(t) || n.config || {}, r = i.mode || "local";
154
154
  try {
155
- switch (n) {
155
+ switch (r) {
156
156
  case "local":
157
- return i.executeLocal ? i.executeLocal(e, ...o) : null;
157
+ return n.executeLocal ? n.executeLocal(e, ...o) : null;
158
158
  case "api":
159
- if (!i.executeAPI)
159
+ if (!n.executeAPI)
160
160
  throw new Error(`Plugin ${t} does not support API mode`);
161
- return await i.executeAPI(e, ...o);
161
+ return await n.executeAPI(e, ...o);
162
162
  case "hybrid":
163
- if (i.executeHybrid)
164
- return await i.executeHybrid(e, ...o);
163
+ if (n.executeHybrid)
164
+ return await n.executeHybrid(e, ...o);
165
165
  try {
166
- if (i.executeAPI)
167
- return await i.executeAPI(e, ...o);
168
- } catch (a) {
169
- if (console.warn(`API execution failed for ${t}, falling back to local`, a), i.executeLocal && r.fallbackToLocal !== !1)
170
- return i.executeLocal(e, ...o);
171
- throw a;
166
+ if (n.executeAPI)
167
+ return await n.executeAPI(e, ...o);
168
+ } catch (s) {
169
+ if (console.warn(`API execution failed for ${t}, falling back to local`, s), n.executeLocal && i.fallbackToLocal !== !1)
170
+ return n.executeLocal(e, ...o);
171
+ throw s;
172
172
  }
173
173
  break;
174
174
  default:
175
- throw new Error(`Unknown plugin mode: ${n}`);
175
+ throw new Error(`Unknown plugin mode: ${r}`);
176
176
  }
177
- } catch (a) {
178
- throw console.error(`Error executing command ${e} on plugin ${t}:`, a), a;
177
+ } catch (s) {
178
+ throw console.error(`Error executing command ${e} on plugin ${t}:`, s), s;
179
179
  }
180
180
  }
181
181
  /**
@@ -186,7 +186,7 @@ class S {
186
186
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
187
187
  }
188
188
  }
189
- class L {
189
+ class O {
190
190
  constructor(t = {}) {
191
191
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
192
192
  this.register(e, o);
@@ -229,11 +229,11 @@ class L {
229
229
  this.commands.clear();
230
230
  }
231
231
  }
232
- class M {
232
+ class z {
233
233
  constructor(t = {}) {
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));
234
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new B(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
235
235
  const e = this.pluginManager.buildSchema();
236
- this.state = b.create(e), this.commandRegistry = new L(this.pluginManager.getCommands());
236
+ this.state = v.create(e), this.commandRegistry = new O(this.pluginManager.getCommands());
237
237
  }
238
238
  /**
239
239
  * Execute a command
@@ -246,12 +246,12 @@ class M {
246
246
  const o = this.commandRegistry.get(t);
247
247
  if (!o)
248
248
  return console.warn(`Command not found: ${t}`), !1;
249
- let i;
250
- return e !== void 0 ? i = o(this.state, e) : i = o(this.state), i instanceof Promise ? (i.then((r) => {
251
- r && typeof r == "object" && "doc" in r && "selection" in r && (this.setState(r), this.emit("change", this.state));
252
- }).catch((r) => {
253
- console.error(`Async command failed: ${t}`, r);
254
- }), !0) : i && typeof i == "object" && "doc" in i && "selection" in i ? (this.setState(i), this.emit("change", this.state), !0) : i !== !1 && i != null;
249
+ let n;
250
+ return e !== void 0 ? n = o(this.state, e) : n = o(this.state), n instanceof Promise ? (n.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) : n && typeof n == "object" && "doc" in n && "selection" in n ? (this.setState(n), this.emit("change", this.state), !0) : n !== !1 && n != null;
255
255
  }
256
256
  /**
257
257
  * Update editor state
@@ -284,8 +284,8 @@ class M {
284
284
  return this.listeners.has(t) || this.listeners.set(t, []), this.listeners.get(t).push(e), () => {
285
285
  const o = this.listeners.get(t);
286
286
  if (o) {
287
- const i = o.indexOf(e);
288
- i > -1 && o.splice(i, 1);
287
+ const n = o.indexOf(e);
288
+ n > -1 && o.splice(n, 1);
289
289
  }
290
290
  };
291
291
  }
@@ -294,11 +294,11 @@ class M {
294
294
  */
295
295
  emit(t, ...e) {
296
296
  const o = this.listeners.get(t);
297
- o && o.forEach((i) => {
297
+ o && o.forEach((n) => {
298
298
  try {
299
- i(...e);
300
- } catch (r) {
301
- console.error(`Error in ${t} handler:`, r);
299
+ n(...e);
300
+ } catch (i) {
301
+ console.error(`Error in ${t} handler:`, i);
302
302
  }
303
303
  });
304
304
  }
@@ -315,7 +315,7 @@ class M {
315
315
  return this.isDestroyed;
316
316
  }
317
317
  }
318
- class A {
318
+ class R {
319
319
  // PluginLoader instance to get all registered plugins
320
320
  setLastCommandTrigger(t, e) {
321
321
  if (typeof window == "undefined" || !t) return;
@@ -335,11 +335,11 @@ class A {
335
335
  * Parse toolbar string into button groups
336
336
  */
337
337
  parseToolbarString(t) {
338
- const e = [], o = t.split("|").map((a) => a.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
339
- i.forEach((a) => {
340
- a.command && r.set(a.command, a), a.type === "group" && a.label && r.set(a.label, a);
338
+ const e = [], o = t.split("|").map((s) => s.trim()), n = this.getAvailableToolbarItems(), i = /* @__PURE__ */ new Map();
339
+ n.forEach((s) => {
340
+ s.command && i.set(s.command, s), s.type === "group" && s.label && i.set(s.label, s);
341
341
  });
342
- const n = {
342
+ const r = {
343
343
  bold: "toggleBold",
344
344
  italic: "toggleItalic",
345
345
  underline: "toggleUnderline",
@@ -350,6 +350,9 @@ class A {
350
350
  link: "openLinkDialog",
351
351
  image: "openImageDialog",
352
352
  table: "insertTable",
353
+ trackChanges: "toggleTrackChanges",
354
+ acceptTrackChanges: "acceptAllTrackChanges",
355
+ rejectTrackChanges: "rejectAllTrackChanges",
353
356
  anchor: "insertAnchor",
354
357
  code: "toggleSourceView",
355
358
  blockquote: "toggleBlockquote",
@@ -381,6 +384,14 @@ class A {
381
384
  toggleComments: "toggleComments",
382
385
  footnote: "insertFootnote",
383
386
  mergeTags: "insertMergeTag",
387
+ dataBinding: "openDataBindingDialog",
388
+ dataBindingPreview: "openDataBindingDialog",
389
+ contentRules: "toggleContentRulesPanel",
390
+ contentRulesAudit: "runContentRulesAudit",
391
+ contentRulesRealtime: "toggleContentRulesRealtime",
392
+ mention: "insertMention",
393
+ slash: "openSlashCommands",
394
+ slashCommands: "openSlashCommands",
384
395
  pageBreak: "insertPageBreak",
385
396
  template: "insertTemplate",
386
397
  importWord: "importWord",
@@ -390,11 +401,11 @@ class A {
390
401
  insertVideo: "insertVideo",
391
402
  codeBlock: "insertCodeBlock"
392
403
  };
393
- return o.forEach((a) => {
404
+ return o.forEach((s) => {
394
405
  const l = [];
395
- a.split(/\s+/).filter(Boolean).forEach((d) => {
406
+ s.split(/\s+/).filter(Boolean).forEach((d) => {
396
407
  if (d === "direction") {
397
- const u = r.get("setDirectionLTR"), h = r.get("setDirectionRTL");
408
+ const u = i.get("setDirectionLTR"), f = i.get("setDirectionRTL");
398
409
  u && l.push({
399
410
  id: "directionLTR",
400
411
  label: u.label,
@@ -402,18 +413,18 @@ class A {
402
413
  icon: u.icon,
403
414
  type: u.type || "button",
404
415
  options: u.options
405
- }), h && l.push({
416
+ }), f && l.push({
406
417
  id: "directionRTL",
407
- label: h.label,
408
- command: h.command,
409
- icon: h.icon,
410
- type: h.type || "button",
411
- options: h.options
418
+ label: f.label,
419
+ command: f.command,
420
+ icon: f.icon,
421
+ type: f.type || "button",
422
+ options: f.options
412
423
  });
413
424
  return;
414
425
  }
415
426
  if (d === "comments") {
416
- const u = r.get("addComment"), h = r.get("toggleComments");
427
+ const u = i.get("addComment"), f = i.get("toggleComments");
417
428
  u && l.push({
418
429
  id: "addComment",
419
430
  label: u.label,
@@ -421,19 +432,19 @@ class A {
421
432
  icon: u.icon,
422
433
  type: u.type || "button",
423
434
  options: u.options
424
- }), h && l.push({
435
+ }), f && l.push({
425
436
  id: "toggleComments",
426
- label: h.label,
427
- command: h.command,
428
- icon: h.icon,
429
- type: h.type || "button",
430
- options: h.options
437
+ label: f.label,
438
+ command: f.command,
439
+ icon: f.icon,
440
+ type: f.type || "button",
441
+ options: f.options
431
442
  });
432
443
  return;
433
444
  }
434
- const g = n[d] || d;
435
- let p = r.get(g);
436
- p || (p = r.get(d)), p && l.push({
445
+ const h = r[d] || d;
446
+ let p = i.get(h);
447
+ p || (p = i.get(d)), p && l.push({
437
448
  id: d,
438
449
  label: p.label,
439
450
  command: p.command,
@@ -457,13 +468,13 @@ class A {
457
468
  render(t) {
458
469
  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}`);
459
470
  const e = this.config.items || this.getDefaultToolbarString(), o = this.parseToolbarString(e);
460
- o.forEach((i, r) => {
461
- const n = document.createElement("div");
462
- if (n.className = "editora-toolbar-group", i.forEach((a) => {
463
- this.appendToolbarButton(n, a);
464
- }), t.appendChild(n), r < o.length - 1) {
465
- const a = document.createElement("div");
466
- a.className = "editora-toolbar-separator", t.appendChild(a);
471
+ o.forEach((n, i) => {
472
+ const r = document.createElement("div");
473
+ if (r.className = "editora-toolbar-group", n.forEach((s) => {
474
+ this.appendToolbarButton(r, s);
475
+ }), t.appendChild(r), i < o.length - 1) {
476
+ const s = document.createElement("div");
477
+ s.className = "editora-toolbar-separator", t.appendChild(s);
467
478
  }
468
479
  });
469
480
  }
@@ -495,18 +506,18 @@ class A {
495
506
  * Create a toolbar button element
496
507
  */
497
508
  createGroupButton(t) {
498
- const e = document.createElement("div");
499
- if (e.className = "editora-toolbar-group-button", e.title = t.label, t.icon)
509
+ const e = document.createElement("div"), o = t.label.toLowerCase().replace(/\s+/g, "-");
510
+ if (e.className = `editora-toolbar-group-button ${o}`, e.title = t.label, t.icon)
500
511
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
501
- const o = document.createElement("span");
502
- o.className = "editora-toolbar-icon", o.innerHTML = t.icon, e.appendChild(o);
512
+ const n = document.createElement("span");
513
+ n.className = "editora-toolbar-icon", n.innerHTML = t.icon, e.appendChild(n);
503
514
  } else
504
515
  e.innerHTML = t.icon;
505
516
  if (t.items && t.items.length) {
506
- const o = document.createElement("div");
507
- o.className = "editora-toolbar-group-items", t.items.forEach((i) => {
508
- this.appendToolbarButton(o, i);
509
- }), e.appendChild(o);
517
+ const n = document.createElement("div");
518
+ n.className = `editora-toolbar-group-items ${o}`, t.items.forEach((i) => {
519
+ this.appendToolbarButton(n, i);
520
+ }), e.appendChild(n);
510
521
  }
511
522
  return e;
512
523
  }
@@ -544,25 +555,25 @@ class A {
544
555
  e.className = "editora-toolbar-dropdown";
545
556
  const o = document.createElement("button");
546
557
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
547
- const i = document.createElement("div");
548
- i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((a) => {
558
+ const n = document.createElement("div");
559
+ n.className = "editora-toolbar-dropdown-menu", n.style.display = "none", t.options && t.options.forEach((s) => {
549
560
  const l = document.createElement("button");
550
- l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = a.label, l.setAttribute("data-value", a.value), l.addEventListener("click", (c) => {
551
- c.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, a.value), i.style.display = "none";
552
- }), i.appendChild(l);
553
- }), o.addEventListener("click", (a) => {
554
- a.preventDefault(), a.stopPropagation(), this.setLastCommandTrigger(o, t.command);
555
- const l = i.style.display === "block";
556
- i.style.display = l ? "none" : "block";
561
+ l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = s.label, l.setAttribute("data-value", s.value), l.addEventListener("click", (c) => {
562
+ c.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, s.value), n.style.display = "none";
563
+ }), n.appendChild(l);
564
+ }), o.addEventListener("click", (s) => {
565
+ s.preventDefault(), s.stopPropagation(), this.setLastCommandTrigger(o, t.command);
566
+ const l = n.style.display === "block";
567
+ n.style.display = l ? "none" : "block";
557
568
  });
558
- const r = (a) => {
559
- e.contains(a.target) || (i.style.display = "none");
560
- }, n = (a) => {
561
- a.key === "Escape" && (i.style.display = "none");
569
+ const i = (s) => {
570
+ e.contains(s.target) || (n.style.display = "none");
571
+ }, r = (s) => {
572
+ s.key === "Escape" && (n.style.display = "none");
562
573
  };
563
- return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", n), e._cleanupDropdown = () => {
564
- document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", n);
565
- }, e.appendChild(o), e.appendChild(i), e;
574
+ return document.addEventListener("mousedown", i, !0), document.addEventListener("keydown", r), e._cleanupDropdown = () => {
575
+ document.removeEventListener("mousedown", i, !0), document.removeEventListener("keydown", r);
576
+ }, e.appendChild(o), e.appendChild(n), e;
566
577
  }
567
578
  /**
568
579
  * Create an inline menu element (like dropdown but triggered by button click)
@@ -573,36 +584,36 @@ class A {
573
584
  const o = document.createElement("button");
574
585
  if (o.className = "editora-toolbar-button", o.type = "button", o.title = t.label, t.icon)
575
586
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
576
- const a = document.createElement("span");
577
- a.className = "editora-toolbar-icon", a.innerHTML = t.icon, o.appendChild(a);
587
+ const s = document.createElement("span");
588
+ s.className = "editora-toolbar-icon", s.innerHTML = t.icon, o.appendChild(s);
578
589
  } else
579
590
  o.innerHTML = t.icon;
580
591
  else
581
592
  o.textContent = t.label;
582
- const i = document.createElement("div");
583
- i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((a) => {
593
+ const n = document.createElement("div");
594
+ n.className = "editora-toolbar-dropdown-menu", n.style.display = "none", t.options && t.options.forEach((s) => {
584
595
  const l = document.createElement("button");
585
- l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = a.label, l.setAttribute("data-value", a.value), l.addEventListener("click", (c) => {
586
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, a.value), i.style.display = "none";
587
- }), i.appendChild(l);
588
- }), o.addEventListener("click", (a) => {
596
+ l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = s.label, l.setAttribute("data-value", s.value), l.addEventListener("click", (c) => {
597
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, s.value), n.style.display = "none";
598
+ }), n.appendChild(l);
599
+ }), o.addEventListener("click", (s) => {
589
600
  var c;
590
- a.preventDefault(), a.stopPropagation(), this.setLastCommandTrigger(o, t.command);
601
+ s.preventDefault(), s.stopPropagation(), this.setLastCommandTrigger(o, t.command);
591
602
  const l = (c = this.container) == null ? void 0 : c.querySelectorAll(
592
603
  ".editora-toolbar-dropdown-menu"
593
604
  );
594
605
  l == null || l.forEach((d) => {
595
- d !== i && (d.style.display = "none");
596
- }), i.style.display = i.style.display === "none" ? "block" : "none";
606
+ d !== n && (d.style.display = "none");
607
+ }), n.style.display = n.style.display === "none" ? "block" : "none";
597
608
  });
598
- const r = (a) => {
599
- e.contains(a.target) || (i.style.display = "none");
600
- }, n = (a) => {
601
- a.key === "Escape" && (i.style.display = "none");
609
+ const i = (s) => {
610
+ e.contains(s.target) || (n.style.display = "none");
611
+ }, r = (s) => {
612
+ s.key === "Escape" && (n.style.display = "none");
602
613
  };
603
- return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", n), e._cleanupDropdown = () => {
604
- document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", n);
605
- }, e.appendChild(o), e.appendChild(i), e;
614
+ return document.addEventListener("mousedown", i, !0), document.addEventListener("keydown", r), e._cleanupDropdown = () => {
615
+ document.removeEventListener("mousedown", i, !0), document.removeEventListener("keydown", r);
616
+ }, e.appendChild(o), e.appendChild(n), e;
606
617
  }
607
618
  /**
608
619
  * Get default toolbar string if none provided
@@ -630,7 +641,7 @@ class A {
630
641
  }), this.container.innerHTML = ""), this.commandHandler = void 0;
631
642
  }
632
643
  }
633
- class T {
644
+ class H {
634
645
  constructor(t) {
635
646
  this.visible = !1, this.config = t;
636
647
  }
@@ -672,7 +683,7 @@ class T {
672
683
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
673
684
  }
674
685
  }
675
- class I {
686
+ class j {
676
687
  constructor(t = {}) {
677
688
  this.statusInfo = {}, this.config = t;
678
689
  }
@@ -701,25 +712,25 @@ class I {
701
712
  e.className = "editora-statusbar-right";
702
713
  const o = [];
703
714
  if (this.statusInfo.selectionInfo) {
704
- const r = this.statusInfo.selectionInfo;
705
- r.startLine === r.endLine && r.startColumn === r.endColumn ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}`) : (r.startLine === r.endLine ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}-${r.endColumn}`) : o.push(`Ln ${r.startLine}:${r.startColumn} - ${r.endLine}:${r.endColumn}`), o.push(`${r.selectedChars} chars selected`));
715
+ const i = this.statusInfo.selectionInfo;
716
+ i.startLine === i.endLine && i.startColumn === i.endColumn ? o.push(`Ln ${i.startLine}, Col ${i.startColumn}`) : (i.startLine === i.endLine ? o.push(`Ln ${i.startLine}, Col ${i.startColumn}-${i.endColumn}`) : o.push(`Ln ${i.startLine}:${i.startColumn} - ${i.endLine}:${i.endColumn}`), o.push(`${i.selectedChars} chars selected`));
706
717
  } else if (this.statusInfo.cursorPosition) {
707
- const r = this.statusInfo.cursorPosition;
708
- o.push(`Ln ${r.line}, Col ${r.column}`);
718
+ const i = this.statusInfo.cursorPosition;
719
+ o.push(`Ln ${i.line}, Col ${i.column}`);
709
720
  }
710
721
  this.statusInfo.language && o.push(this.statusInfo.language);
711
- const i = [];
712
- this.statusInfo.wordCount !== void 0 && i.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && i.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && i.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([r, n]) => {
713
- i.push(`${r}: ${n}`);
714
- }), o.forEach((r, n) => {
715
- const a = document.createElement("span");
716
- if (a.className = "editora-statusbar-item", a.textContent = r, t.appendChild(a), n < o.length - 1) {
722
+ const n = [];
723
+ this.statusInfo.wordCount !== void 0 && n.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && n.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && n.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([i, r]) => {
724
+ n.push(`${i}: ${r}`);
725
+ }), o.forEach((i, r) => {
726
+ const s = document.createElement("span");
727
+ if (s.className = "editora-statusbar-item", s.textContent = i, t.appendChild(s), r < o.length - 1) {
717
728
  const l = document.createElement("span");
718
729
  l.className = "editora-statusbar-separator", l.textContent = "|", t.appendChild(l);
719
730
  }
720
- }), i.forEach((r, n) => {
721
- const a = document.createElement("span");
722
- if (a.className = "editora-statusbar-item", a.textContent = r, e.appendChild(a), n < i.length - 1) {
731
+ }), n.forEach((i, r) => {
732
+ const s = document.createElement("span");
733
+ if (s.className = "editora-statusbar-item", s.textContent = i, e.appendChild(s), r < n.length - 1) {
723
734
  const l = document.createElement("span");
724
735
  l.className = "editora-statusbar-separator", l.textContent = "|", e.appendChild(l);
725
736
  }
@@ -732,50 +743,50 @@ class I {
732
743
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
733
744
  }
734
745
  }
735
- function D(s, t) {
736
- const e = s.textContent || "", o = P(s, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
737
- `), n = r.length, a = r[r.length - 1].length + 1;
738
- return { line: n, column: a };
746
+ function F(a, t) {
747
+ const e = a.textContent || "", o = $(a, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
748
+ `), r = i.length, s = i[i.length - 1].length + 1;
749
+ return { line: r, column: s };
739
750
  }
740
- function P(s, t, e) {
741
- var n;
751
+ function $(a, t, e) {
752
+ var r;
742
753
  let o = 0;
743
- const i = document.createTreeWalker(
744
- s,
754
+ const n = document.createTreeWalker(
755
+ a,
745
756
  NodeFilter.SHOW_TEXT,
746
757
  null
747
758
  );
748
- let r = i.firstChild();
749
- for (; r; ) {
750
- if (r === t) {
759
+ let i = n.firstChild();
760
+ for (; i; ) {
761
+ if (i === t) {
751
762
  o += e;
752
763
  break;
753
- } else r.nodeType === Node.TEXT_NODE && (o += ((n = r.textContent) == null ? void 0 : n.length) || 0);
754
- r = i.nextNode();
764
+ } else i.nodeType === Node.TEXT_NODE && (o += ((r = i.textContent) == null ? void 0 : r.length) || 0);
765
+ i = n.nextNode();
755
766
  }
756
767
  return o;
757
768
  }
758
- function N(s) {
759
- var o, i;
760
- const t = s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
769
+ function _(a) {
770
+ var o, n;
771
+ const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
761
772
  let e = 1;
762
773
  if (t.length > 0) {
763
774
  e = t.length;
764
- const r = t[t.length - 1];
765
- (r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
775
+ const i = t[t.length - 1];
776
+ (i.tagName === "BR" || ((o = i.innerHTML) == null ? void 0 : o.trim()) === "" || ((n = i.textContent) == null ? void 0 : n.trim()) === "") && e++;
766
777
  } else {
767
- const n = (s.textContent || "").split(`
778
+ const r = (a.textContent || "").split(`
768
779
  `).length;
769
- e = Math.max(1, n);
780
+ e = Math.max(1, r);
770
781
  }
771
782
  return e;
772
783
  }
773
- function z(s) {
774
- const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
784
+ function W(a) {
785
+ const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
775
786
  return { words: t, chars: e };
776
787
  }
777
- function B(s, t) {
778
- const e = s.toString();
788
+ function U(a, t) {
789
+ const e = a.toString();
779
790
  return {
780
791
  startLine: t.line,
781
792
  startColumn: t.column,
@@ -786,7 +797,7 @@ function B(s, t) {
786
797
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
787
798
  };
788
799
  }
789
- class O {
800
+ class K {
790
801
  constructor(t) {
791
802
  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) => {
792
803
  this.registerShortcut(e);
@@ -1073,8 +1084,8 @@ class O {
1073
1084
  }
1074
1085
  handleKeyDown(t, e) {
1075
1086
  if (!this.enabled) return !1;
1076
- const o = this.getEventKey(t), i = this.shortcuts.get(o);
1077
- return i ? (i.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(i.command, i.params), !0) : !1;
1087
+ const o = this.getEventKey(t), n = this.shortcuts.get(o);
1088
+ return n ? (n.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(n.command, n.params), !0) : !1;
1078
1089
  }
1079
1090
  enable() {
1080
1091
  this.enabled = !0;
@@ -1099,19 +1110,19 @@ class O {
1099
1110
  }
1100
1111
  getShortcutsHelp() {
1101
1112
  const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
1102
- t.forEach((i) => {
1103
- const r = this.getShortcutCategory(i.command);
1104
- e.has(r) || e.set(r, []), e.get(r).push(i);
1113
+ t.forEach((n) => {
1114
+ const i = this.getShortcutCategory(n.command);
1115
+ e.has(i) || e.set(i, []), e.get(i).push(n);
1105
1116
  });
1106
1117
  let o = `# Keyboard Shortcuts
1107
1118
 
1108
1119
  `;
1109
- return e.forEach((i, r) => {
1110
- o += `## ${r}
1120
+ return e.forEach((n, i) => {
1121
+ o += `## ${i}
1111
1122
 
1112
- `, i.forEach((n) => {
1113
- const a = this.getShortcutDescription(n);
1114
- o += `- **${a}**: ${n.description || n.command}
1123
+ `, n.forEach((r) => {
1124
+ const s = this.getShortcutDescription(r);
1125
+ o += `- **${s}**: ${r.description || r.command}
1115
1126
  `;
1116
1127
  }), o += `
1117
1128
  `;
@@ -1121,7 +1132,7 @@ class O {
1121
1132
  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";
1122
1133
  }
1123
1134
  }
1124
- const H = [
1135
+ const q = [
1125
1136
  "p",
1126
1137
  "br",
1127
1138
  "strong",
@@ -1156,11 +1167,12 @@ const H = [
1156
1167
  "code",
1157
1168
  "span",
1158
1169
  "div",
1170
+ "section",
1159
1171
  "sup",
1160
1172
  "sub",
1161
1173
  "hr"
1162
- ], j = {
1163
- "*": ["class", "style", "id", "data-*"],
1174
+ ], V = {
1175
+ "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck"],
1164
1176
  a: ["href", "target", "rel", "title"],
1165
1177
  img: ["src", "alt", "width", "height", "loading"],
1166
1178
  video: ["src", "controls", "width", "height", "autoplay", "loop", "muted"],
@@ -1169,51 +1181,51 @@ const H = [
1169
1181
  td: ["colspan", "rowspan", "align", "valign"],
1170
1182
  th: ["colspan", "rowspan", "align", "valign"]
1171
1183
  };
1172
- function w(s, t, e) {
1184
+ function D(a, t, e) {
1173
1185
  if ((t == null ? void 0 : t.sanitize) === !1)
1174
- return s;
1175
- const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : H, r = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : j, n = document.createElement("div");
1176
- return n.innerHTML = s, C(n, o, r), n.innerHTML;
1186
+ return a;
1187
+ const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : q, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : V, r = document.createElement("div");
1188
+ return r.innerHTML = a, P(r, o, i), r.innerHTML;
1177
1189
  }
1178
- function C(s, t, e) {
1179
- const o = Array.from(s.childNodes);
1180
- for (const i of o)
1181
- if (i.nodeType === Node.ELEMENT_NODE) {
1182
- const r = i, n = r.tagName.toLowerCase();
1183
- if (!t.includes(n)) {
1184
- for (; r.firstChild; )
1185
- s.insertBefore(r.firstChild, r);
1186
- s.removeChild(r);
1190
+ function P(a, t, e) {
1191
+ const o = Array.from(a.childNodes);
1192
+ for (const n of o)
1193
+ if (n.nodeType === Node.ELEMENT_NODE) {
1194
+ const i = n, r = i.tagName.toLowerCase();
1195
+ if (!t.includes(r)) {
1196
+ for (; i.firstChild; )
1197
+ a.insertBefore(i.firstChild, i);
1198
+ a.removeChild(i);
1187
1199
  continue;
1188
1200
  }
1189
- R(r, e), C(r, t, e);
1190
- } else i.nodeType !== Node.TEXT_NODE && s.removeChild(i);
1201
+ G(i, e), P(i, t, e);
1202
+ } else n.nodeType !== Node.TEXT_NODE && a.removeChild(n);
1191
1203
  }
1192
- function R(s, t) {
1193
- const e = s.tagName.toLowerCase(), o = Array.from(s.attributes), i = t[e] || [], r = t["*"] || [], n = [...i, ...r];
1194
- for (const a of o) {
1195
- const l = a.name.toLowerCase();
1204
+ function G(a, t) {
1205
+ const e = a.tagName.toLowerCase(), o = Array.from(a.attributes), n = t[e] || [], i = t["*"] || [], r = [...n, ...i];
1206
+ for (const s of o) {
1207
+ const l = s.name.toLowerCase();
1196
1208
  let c = !1;
1197
- n.includes(l) && (c = !0);
1198
- for (const d of n)
1209
+ r.includes(l) && (c = !0);
1210
+ for (const d of r)
1199
1211
  if (d.endsWith("*")) {
1200
- const g = d.slice(0, -1);
1201
- if (l.startsWith(g)) {
1212
+ const h = d.slice(0, -1);
1213
+ if (l.startsWith(h)) {
1202
1214
  c = !0;
1203
1215
  break;
1204
1216
  }
1205
1217
  }
1206
- (l.startsWith("on") || l === "javascript:" || l === "href" && a.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && a.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), c || s.removeAttribute(a.name);
1218
+ (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);
1207
1219
  }
1208
- s.hasAttribute("href") && (s.getAttribute("href") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("href"), s.hasAttribute("src") && (s.getAttribute("src") || "").trim().toLowerCase().startsWith("javascript:") && s.removeAttribute("src");
1220
+ 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");
1209
1221
  }
1210
- function F(s, t, e) {
1211
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : w(s, t);
1222
+ function X(a, t, e) {
1223
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : D(a, t);
1212
1224
  }
1213
- function $(s, t, e) {
1214
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : w(s, t);
1225
+ function Y(a, t, e) {
1226
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : D(a, t);
1215
1227
  }
1216
- const k = class k {
1228
+ const S = class S {
1217
1229
  /**
1218
1230
  * Resolve configuration from multiple sources with priority
1219
1231
  */
@@ -1231,12 +1243,12 @@ const k = class k {
1231
1243
  static normalizeConfig(t) {
1232
1244
  const e = { ...t };
1233
1245
  if (e.toolbarFloating !== void 0 || e.toolbarSticky !== void 0) {
1234
- const n = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
1235
- e.toolbarFloating !== void 0 && (n.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (n.sticky = !!e.toolbarSticky), e.toolbar = n;
1246
+ const r = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
1247
+ e.toolbarFloating !== void 0 && (r.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (r.sticky = !!e.toolbarSticky), e.toolbar = r;
1236
1248
  }
1237
1249
  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) {
1238
- const n = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
1239
- 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;
1250
+ const r = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
1251
+ e.autosaveEnabled !== void 0 && (r.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (r.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (r.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (r.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (r.apiUrl = e.autosaveApiUrl), e.autosave = r;
1240
1252
  }
1241
1253
  const o = {
1242
1254
  enabled: !1,
@@ -1251,46 +1263,46 @@ const k = class k {
1251
1263
  enabled: e.autosave
1252
1264
  };
1253
1265
  else if (typeof e.autosave == "object" && e.autosave) {
1254
- const n = {
1266
+ const r = {
1255
1267
  ...o,
1256
1268
  ...e.autosave
1257
1269
  };
1258
- 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;
1270
+ r.intervalMs === void 0 && r.interval !== void 0 && (r.intervalMs = Number(r.interval)), r.enabled === void 0 && (r.enabled = !0), (!Number.isFinite(r.intervalMs) || r.intervalMs <= 0) && (r.intervalMs = o.intervalMs), e.autosave = r;
1259
1271
  } else
1260
1272
  e.autosave = o;
1261
1273
  if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
1262
- const n = typeof e.language == "object" && e.language ? { ...e.language } : {};
1263
- e.languageLocale !== void 0 && (n.locale = e.languageLocale), e.languageDirection !== void 0 && (n.direction = e.languageDirection), e.language = n;
1274
+ const r = typeof e.language == "object" && e.language ? { ...e.language } : {};
1275
+ e.languageLocale !== void 0 && (r.locale = e.languageLocale), e.languageDirection !== void 0 && (r.direction = e.languageDirection), e.language = r;
1264
1276
  }
1265
- const i = { locale: "en", direction: "ltr" };
1277
+ const n = { locale: "en", direction: "ltr" };
1266
1278
  if (typeof e.language == "string" ? e.language = {
1267
1279
  locale: e.language,
1268
- direction: i.direction
1280
+ direction: n.direction
1269
1281
  } : typeof e.language == "object" && e.language ? e.language = {
1270
- ...i,
1282
+ ...n,
1271
1283
  ...e.language
1272
- } : e.language = i, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
1273
- const n = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
1274
- 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;
1284
+ } : e.language = n, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
1285
+ const r = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
1286
+ e.spellcheckEnabled !== void 0 && (r.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (r.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (r.apiUrl = e.spellcheckApiUrl), e.spellcheck = r;
1275
1287
  }
1276
- const r = {
1288
+ const i = {
1277
1289
  enabled: !1,
1278
1290
  provider: "browser",
1279
1291
  apiUrl: ""
1280
1292
  };
1281
1293
  if (typeof e.spellcheck == "boolean")
1282
1294
  e.spellcheck = {
1283
- ...r,
1295
+ ...i,
1284
1296
  enabled: e.spellcheck
1285
1297
  };
1286
1298
  else if (typeof e.spellcheck == "object" && e.spellcheck) {
1287
- const n = {
1288
- ...r,
1299
+ const r = {
1300
+ ...i,
1289
1301
  ...e.spellcheck
1290
1302
  };
1291
- !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;
1303
+ !r.provider && r.mode && (r.provider = r.mode === "local" ? "browser" : "api"), r.enabled === void 0 && (r.enabled = !!(r.mode || r.provider || r.apiUrl)), e.spellcheck = r;
1292
1304
  } else
1293
- e.spellcheck = r;
1305
+ e.spellcheck = i;
1294
1306
  return e.contextMenuEnabled !== void 0 && (e.contextMenu = {
1295
1307
  enabled: !!e.contextMenuEnabled
1296
1308
  }), typeof e.contextMenu == "boolean" ? e.contextMenu = { enabled: e.contextMenu } : typeof e.contextMenu == "object" && e.contextMenu ? e.contextMenu = {
@@ -1350,9 +1362,9 @@ const k = class k {
1350
1362
  */
1351
1363
  static parseAttributes(t) {
1352
1364
  const e = {};
1353
- for (const [o, i] of Object.entries(t)) {
1354
- const r = this.kebabToCamel(o);
1355
- e[r] = this.parseAttributeValue(i);
1365
+ for (const [o, n] of Object.entries(t)) {
1366
+ const i = this.kebabToCamel(o);
1367
+ e[i] = this.parseAttributeValue(n);
1356
1368
  }
1357
1369
  return e;
1358
1370
  }
@@ -1400,12 +1412,12 @@ const k = class k {
1400
1412
  static merge(...t) {
1401
1413
  const e = {};
1402
1414
  for (const o of t)
1403
- for (const [i, r] of Object.entries(o))
1404
- r != null && (typeof r == "object" && !Array.isArray(r) && e[i] ? e[i] = this.merge(e[i], r) : e[i] = r);
1415
+ for (const [n, i] of Object.entries(o))
1416
+ i != null && (typeof i == "object" && !Array.isArray(i) && e[n] ? e[n] = this.merge(e[n], i) : e[n] = i);
1405
1417
  return e;
1406
1418
  }
1407
1419
  };
1408
- k.EDITOR_DEFAULTS = {
1420
+ S.EDITOR_DEFAULTS = {
1409
1421
  height: 400,
1410
1422
  width: "100%",
1411
1423
  readonly: !1,
@@ -1455,26 +1467,86 @@ k.EDITOR_DEFAULTS = {
1455
1467
  },
1456
1468
  statusbar: !1
1457
1469
  };
1458
- let y = k;
1459
- 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}}';
1460
- let m;
1461
- function W() {
1462
- const s = "editora-webcomponent-styles";
1463
- if (!document.getElementById(s)) {
1470
+ let w = S;
1471
+ const J = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor;fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';
1472
+ let y;
1473
+ const Q = "__editoraCommandEditorRoot", Z = "__editoraLastCommandButton", T = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", A = ".rte-content, .editora-content", C = /* @__PURE__ */ new Set();
1474
+ let m = null, L = !1, k = null, x = null;
1475
+ function M(a) {
1476
+ if (!(a instanceof HTMLElement)) return !1;
1477
+ const t = a;
1478
+ return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
1479
+ }
1480
+ function tt(a) {
1481
+ return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
1482
+ }
1483
+ function b(a) {
1484
+ if (!a) return null;
1485
+ if (M(a))
1486
+ return a;
1487
+ const t = a.matches(T) ? a : a.closest(T);
1488
+ return !t || !M(t) ? null : t;
1489
+ }
1490
+ function et() {
1491
+ var n;
1492
+ if (typeof window == "undefined") return null;
1493
+ const a = window[Q];
1494
+ if (a instanceof HTMLElement) {
1495
+ const i = b(a);
1496
+ if (i) return i;
1497
+ const r = a.matches(A) ? a : a.querySelector(A);
1498
+ if (r) {
1499
+ const s = b(r);
1500
+ if (s) return s;
1501
+ }
1502
+ }
1503
+ const t = window[Z];
1504
+ if (t instanceof HTMLElement) {
1505
+ const i = b(t);
1506
+ if (i) return i;
1507
+ }
1508
+ const e = document.activeElement;
1509
+ if (e) {
1510
+ const i = b(e);
1511
+ if (i) return i;
1512
+ }
1513
+ const o = (n = window.getSelection) == null ? void 0 : n.call(window);
1514
+ if (o && o.rangeCount > 0) {
1515
+ const i = b(tt(o.getRangeAt(0).startContainer));
1516
+ if (i) return i;
1517
+ }
1518
+ if (m && m.isConnected)
1519
+ return m;
1520
+ for (const i of C)
1521
+ if (i.isConnected) return i;
1522
+ return null;
1523
+ }
1524
+ function ot() {
1525
+ if (typeof window == "undefined" || L) return;
1526
+ k = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, x = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
1527
+ const a = (t, e) => {
1528
+ const o = et();
1529
+ return o ? o.execCommand(t, e) : k ? k(t, e) : x ? x(t, e) : !1;
1530
+ };
1531
+ window.executeEditorCommand = a, window.execEditorCommand = a, L = !0;
1532
+ }
1533
+ function it() {
1534
+ const a = "editora-webcomponent-styles";
1535
+ if (!document.getElementById(a)) {
1464
1536
  const t = document.createElement("style");
1465
- t.id = s, t.textContent = U, document.head.appendChild(t);
1537
+ t.id = a, t.textContent = J, document.head.appendChild(t);
1466
1538
  }
1467
1539
  }
1468
- function _() {
1469
- if (!m) {
1470
- const s = f.__globalPluginLoader;
1471
- s ? m = s : m = new x();
1540
+ function nt() {
1541
+ if (!y) {
1542
+ const a = g.__globalPluginLoader;
1543
+ a ? y = a : y = new I();
1472
1544
  }
1473
- return m;
1545
+ return y;
1474
1546
  }
1475
- class f extends HTMLElement {
1547
+ class g extends HTMLElement {
1476
1548
  constructor() {
1477
- if (super(), this.pluginLoader = _(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new O(), this.lastAutosavedContent = "", this.loadedPlugins = [], W(), !this.hasAttribute("data-initial-content")) {
1549
+ if (super(), this.pluginLoader = nt(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new K(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, it(), !this.hasAttribute("data-initial-content")) {
1478
1550
  const t = this.innerHTML.trim();
1479
1551
  t && this.setAttribute("data-initial-content", t);
1480
1552
  }
@@ -1540,13 +1612,13 @@ class f extends HTMLElement {
1540
1612
  * Wait for the global plugin loader to be available
1541
1613
  */
1542
1614
  async waitForPluginLoader() {
1543
- if (f.__globalPluginLoader) {
1544
- this.pluginLoader = f.__globalPluginLoader;
1615
+ if (g.__globalPluginLoader) {
1616
+ this.pluginLoader = g.__globalPluginLoader;
1545
1617
  return;
1546
1618
  }
1547
1619
  return new Promise((t) => {
1548
1620
  const e = () => {
1549
- f.__globalPluginLoader ? (this.pluginLoader = f.__globalPluginLoader, t()) : setTimeout(e, 0);
1621
+ g.__globalPluginLoader ? (this.pluginLoader = g.__globalPluginLoader, t()) : setTimeout(e, 0);
1550
1622
  };
1551
1623
  e();
1552
1624
  });
@@ -1575,18 +1647,18 @@ class f extends HTMLElement {
1575
1647
  async initialize() {
1576
1648
  var o;
1577
1649
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
1578
- 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}`);
1650
+ this.setAttribute("data-editora-editor", "true"), C.add(this), m || (m = this), ot(), 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}`);
1579
1651
  const t = await this.loadPlugins();
1580
- this.loadedPlugins = t, t.forEach((i) => {
1581
- if (i.init && typeof i.init == "function")
1652
+ this.loadedPlugins = t, t.forEach((n) => {
1653
+ if (n.init && typeof n.init == "function")
1582
1654
  try {
1583
- i.init({ editorElement: this });
1584
- } catch (r) {
1585
- console.error(`[RichTextEditor] Error initializing plugin ${i.name}:`, r);
1655
+ n.init({ editorElement: this });
1656
+ } catch (i) {
1657
+ console.error(`[RichTextEditor] Error initializing plugin ${n.name}:`, i);
1586
1658
  }
1587
1659
  });
1588
1660
  const e = (o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || "";
1589
- this.engine = new M({
1661
+ this.engine = new z({
1590
1662
  content: e,
1591
1663
  plugins: t,
1592
1664
  readonly: this.config.readonly
@@ -1609,32 +1681,32 @@ class f extends HTMLElement {
1609
1681
  */
1610
1682
  async loadPlugins() {
1611
1683
  this.pluginLoader || await this.waitForPluginLoader();
1612
- const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), i = this.getAccessibilityConfig().checker === !0;
1684
+ 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), n = this.getAccessibilityConfig().checker === !0;
1613
1685
  if (e) {
1614
1686
  if (typeof this.config.plugins == "string") {
1615
- const r = this.config.plugins.split(/\s+/).filter(Boolean);
1616
- i && !r.includes("a11yChecker") && r.push("a11yChecker");
1617
- for (const n of r) {
1618
- const a = await this.pluginLoader.load(n, this.getPluginLoadConfig(n));
1619
- a && t.push(a);
1687
+ const i = this.config.plugins.split(/\s+/).filter(Boolean);
1688
+ n && !i.includes("a11yChecker") && i.push("a11yChecker");
1689
+ for (const r of i) {
1690
+ const s = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
1691
+ s && t.push(s);
1620
1692
  }
1621
1693
  } else if (Array.isArray(this.config.plugins)) {
1622
- for (const r of this.config.plugins)
1623
- if (typeof r == "string") {
1624
- const n = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
1625
- n && t.push(n);
1694
+ for (const i of this.config.plugins)
1695
+ if (typeof i == "string") {
1696
+ const r = await this.pluginLoader.load(i, this.getPluginLoadConfig(i));
1697
+ r && t.push(r);
1626
1698
  } else
1627
- t.push(r);
1628
- if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
1629
- const r = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
1630
- r && t.push(r);
1699
+ t.push(i);
1700
+ if (n && !t.some((i) => (i == null ? void 0 : i.name) === "a11yChecker")) {
1701
+ const i = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
1702
+ i && t.push(i);
1631
1703
  }
1632
1704
  }
1633
1705
  } else {
1634
- const r = this.pluginLoader.getRegisteredPluginNames();
1635
- for (const n of r) {
1636
- const a = await this.pluginLoader.load(n, this.getPluginLoadConfig(n));
1637
- a && t.push(a);
1706
+ const i = this.pluginLoader.getRegisteredPluginNames();
1707
+ for (const r of i) {
1708
+ const s = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
1709
+ s && t.push(s);
1638
1710
  }
1639
1711
  }
1640
1712
  return t;
@@ -1753,42 +1825,55 @@ class f extends HTMLElement {
1753
1825
  this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
1754
1826
  }
1755
1827
  executeCommand(t, e) {
1756
- var r;
1828
+ var i;
1757
1829
  typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
1758
1830
  const o = {
1759
1831
  editorElement: this,
1760
1832
  contentElement: this.contentElement,
1761
1833
  toolbarElement: this.toolbarElement
1762
- }, i = this.loadedPlugins.find((n) => n.commands && n.commands[t]);
1763
- if (i && i.commands) {
1764
- const n = i.commands[t];
1765
- if (typeof n == "function")
1834
+ }, n = this.loadedPlugins.find((r) => r.commands && r.commands[t]);
1835
+ if (n && n.commands) {
1836
+ const r = n.commands[t];
1837
+ if (typeof r == "function")
1766
1838
  try {
1767
- return n(t === "toggleFullscreen" ? this : e, o), !0;
1768
- } catch (a) {
1769
- return console.error(`[RichTextEditor] Error executing native command ${t}:`, a), !1;
1839
+ return r(t === "toggleFullscreen" ? this : e, o), !0;
1840
+ } catch (s) {
1841
+ return console.error(`[RichTextEditor] Error executing native command ${t}:`, s), !1;
1770
1842
  }
1771
1843
  }
1772
- return ((r = this.engine) == null ? void 0 : r.execCommand(t, e)) || !1;
1844
+ return ((i = this.engine) == null ? void 0 : i.execCommand(t, e)) || !1;
1773
1845
  }
1774
1846
  getPluginLoadConfig(t) {
1775
1847
  const e = this.config.pluginConfig;
1776
1848
  if (e && typeof e == "object") {
1777
- const r = e[t];
1778
- if (r && typeof r == "object")
1779
- return r;
1849
+ const i = e[t];
1850
+ if (i && typeof i == "object")
1851
+ return i;
1780
1852
  }
1781
1853
  const o = {
1782
- spellCheck: ["spellcheck", "spellCheck"]
1783
- }, i = [
1854
+ spellCheck: ["spellcheck", "spellCheck"],
1855
+ trackChanges: ["trackchanges", "track-changes", "trackChanges"],
1856
+ versionDiff: ["versiondiff", "version-diff", "versionDiff"],
1857
+ "version-diff": ["versiondiff", "version-diff", "versionDiff"],
1858
+ conditionalContent: ["conditionalcontent", "conditional-content", "conditionalContent"],
1859
+ "conditional-content": ["conditionalcontent", "conditional-content", "conditionalContent"],
1860
+ dataBinding: ["databinding", "data-binding", "dataBinding"],
1861
+ "data-binding": ["databinding", "data-binding", "dataBinding"],
1862
+ contentRules: ["contentrules", "content-rules", "contentRules"],
1863
+ "content-rules": ["contentrules", "content-rules", "contentRules"],
1864
+ mentions: ["mention", "mentions"],
1865
+ mention: ["mention", "mentions"],
1866
+ slashCommands: ["slashcommands", "slash-commands", "slashCommands"],
1867
+ "slash-commands": ["slashcommands", "slash-commands", "slashCommands"]
1868
+ }, n = [
1784
1869
  t,
1785
1870
  t.toLowerCase(),
1786
1871
  ...o[t] || []
1787
1872
  ];
1788
- for (const r of i) {
1789
- const n = this.config[r];
1790
- if (n && typeof n == "object" && !Array.isArray(n))
1791
- return n;
1873
+ for (const i of n) {
1874
+ const r = this.config[i];
1875
+ if (r && typeof r == "object" && !Array.isArray(r))
1876
+ return r;
1792
1877
  }
1793
1878
  }
1794
1879
  getContentSanitizeConfig() {
@@ -1810,10 +1895,10 @@ class f extends HTMLElement {
1810
1895
  provider: "localStorage"
1811
1896
  };
1812
1897
  if (t && typeof t == "object") {
1813
- const i = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
1898
+ const n = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
1814
1899
  return {
1815
1900
  enabled: !!t.enabled,
1816
- intervalMs: Number.isFinite(i) && i > 0 ? i : 3e4,
1901
+ intervalMs: Number.isFinite(n) && n > 0 ? n : 3e4,
1817
1902
  storageKey: String(t.storageKey || "rte-autosave"),
1818
1903
  provider: t.provider || "localStorage",
1819
1904
  apiUrl: t.apiUrl
@@ -1875,12 +1960,12 @@ class f extends HTMLElement {
1875
1960
  if (e && e.rangeCount > 0) {
1876
1961
  const o = e.getRangeAt(0);
1877
1962
  o.deleteContents();
1878
- const i = document.createElement("div");
1879
- i.innerHTML = t;
1880
- const r = document.createDocumentFragment();
1881
- for (; i.firstChild; )
1882
- r.appendChild(i.firstChild);
1883
- o.insertNode(r), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
1963
+ const n = document.createElement("div");
1964
+ n.innerHTML = t;
1965
+ const i = document.createDocumentFragment();
1966
+ for (; n.firstChild; )
1967
+ i.appendChild(n.firstChild);
1968
+ o.insertNode(i), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
1884
1969
  } else
1885
1970
  this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
1886
1971
  }
@@ -1888,8 +1973,8 @@ class f extends HTMLElement {
1888
1973
  * Create UI elements
1889
1974
  */
1890
1975
  createUI(t, e) {
1891
- const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
1892
- 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 A(
1976
+ const o = this.querySelector('[slot="toolbar"]'), n = this.querySelector('[slot="statusbar"]');
1977
+ 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 R(
1893
1978
  {
1894
1979
  items: this.resolveToolbarItems(),
1895
1980
  sticky: this.isToolbarStickyEnabled(),
@@ -1898,37 +1983,37 @@ class f extends HTMLElement {
1898
1983
  t,
1899
1984
  this.pluginLoader
1900
1985
  // Pass plugin loader to get all registered plugins
1901
- ), this.toolbar.setCommandHandler((r, n) => {
1902
- var a;
1986
+ ), this.toolbar.setCommandHandler((i, r) => {
1987
+ var s;
1903
1988
  if (this.contentElement) {
1904
1989
  this.contentElement.focus();
1905
1990
  const l = window.getSelection();
1906
1991
  if (!l || l.rangeCount === 0 || !this.contentElement.contains(l.anchorNode)) {
1907
1992
  const c = document.createRange(), d = this.contentElement.lastChild || this.contentElement;
1908
- d.nodeType === Node.TEXT_NODE ? c.setStart(d, ((a = d.textContent) == null ? void 0 : a.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);
1993
+ 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);
1909
1994
  }
1910
1995
  }
1911
- return this.executeCommand(r, n);
1996
+ return this.executeCommand(i, r);
1912
1997
  }), 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);
1913
1998
  try {
1914
1999
  document.execCommand("defaultParagraphSeparator", !1, "p");
1915
- } catch (r) {
1916
- console.warn("defaultParagraphSeparator not supported:", r);
2000
+ } catch (i) {
2001
+ console.warn("defaultParagraphSeparator not supported:", i);
1917
2002
  }
1918
2003
  if (e) {
1919
- const r = document.createElement("div");
1920
- r.innerHTML = e.trim(), !Array.from(r.childNodes).some((a) => {
1921
- if (a.nodeType === Node.ELEMENT_NODE) {
1922
- const l = a.tagName;
2004
+ const i = document.createElement("div");
2005
+ i.innerHTML = e.trim(), !Array.from(i.childNodes).some((s) => {
2006
+ if (s.nodeType === Node.ELEMENT_NODE) {
2007
+ const l = s.tagName;
1923
2008
  return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(l);
1924
2009
  }
1925
2010
  return !1;
1926
2011
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
1927
2012
  } else
1928
2013
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
1929
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new T({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new I({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
1930
- var r;
1931
- return (r = this.contentElement) == null ? void 0 : r.focus();
2014
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new H({ enabled: !0 }), this.floatingToolbar.create(this)), n ? this.appendChild(n) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new j({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
2015
+ var i;
2016
+ return (i = this.contentElement) == null ? void 0 : i.focus();
1932
2017
  }, 0);
1933
2018
  }
1934
2019
  /**
@@ -1937,67 +2022,71 @@ class f extends HTMLElement {
1937
2022
  setupEventListeners() {
1938
2023
  if (!this.contentElement || !this.engine) return;
1939
2024
  const t = this.keyboardShortcutManager;
1940
- this.contentElement.addEventListener("input", () => {
2025
+ this.contentElement.addEventListener("beforeinput", (o) => {
2026
+ this.lastBeforeInputType = o.inputType || null;
2027
+ }), this.contentElement.addEventListener("input", () => {
1941
2028
  if (!this.contentElement) return;
1942
2029
  let o = this.contentElement.innerHTML;
1943
- const i = this.getPerformanceConfig(), r = this.getContentSanitizeConfig(), n = this.getSecurityConfig();
1944
- if (n.sanitizeOnInput !== !1 && r.sanitize !== !1) {
1945
- const l = $(o, r, n);
1946
- if (l !== o) {
1947
- const c = window.getSelection(), d = c && c.rangeCount > 0 ? c.getRangeAt(0) : null;
1948
- if (this.contentElement.innerHTML = l, d && c)
2030
+ const n = this.getPerformanceConfig(), i = this.getContentSanitizeConfig(), r = this.getSecurityConfig(), s = this.lastBeforeInputType;
2031
+ if (this.lastBeforeInputType = null, r.sanitizeOnInput !== !1 && i.sanitize !== !1 && !s) {
2032
+ const d = Y(o, i, r);
2033
+ if (d !== o) {
2034
+ const h = window.getSelection(), p = h && h.rangeCount > 0 ? h.getRangeAt(0) : null;
2035
+ if (this.contentElement.innerHTML = d, p && h)
1949
2036
  try {
1950
- c.removeAllRanges(), c.addRange(d);
1951
- } catch (g) {
2037
+ h.removeAllRanges(), h.addRange(p);
2038
+ } catch (u) {
1952
2039
  }
1953
- o = l;
2040
+ o = d;
1954
2041
  }
1955
2042
  }
1956
2043
  this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
1957
- const a = () => {
2044
+ const c = () => {
1958
2045
  this.dispatchEvent(new CustomEvent("content-change", {
1959
2046
  detail: { html: o },
1960
2047
  bubbles: !0
1961
2048
  }));
1962
2049
  };
1963
- i.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(a, i.debounceInputMs) : a(), this.updateStatusBar();
2050
+ n.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(c, n.debounceInputMs) : c(), this.updateStatusBar();
1964
2051
  }), this.contentElement.addEventListener("contextmenu", (o) => {
1965
- const i = this.config.contextMenu;
1966
- (i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
2052
+ const n = this.config.contextMenu;
2053
+ (n === !1 || typeof n == "object" && n !== null && n.enabled === !1) && o.preventDefault();
1967
2054
  }), this.contentElement.addEventListener("paste", (o) => {
1968
- var d, g;
2055
+ var d, h;
2056
+ if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
2057
+ return;
1969
2058
  o.preventDefault();
1970
- const i = this.config.paste || {};
1971
- let r = ((d = o.clipboardData) == null ? void 0 : d.getData("text/html")) || "";
1972
- const n = ((g = o.clipboardData) == null ? void 0 : g.getData("text/plain")) || "", a = this.getContentSanitizeConfig(), l = this.getSecurityConfig(), c = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
1973
- if ((i.clean || !i.keepFormatting) && n) {
1974
- document.execCommand("insertText", !1, n);
2059
+ const n = this.config.paste || {};
2060
+ let i = ((d = o.clipboardData) == null ? void 0 : d.getData("text/html")) || "";
2061
+ const r = ((h = o.clipboardData) == null ? void 0 : h.getData("text/plain")) || "", s = this.getContentSanitizeConfig(), l = this.getSecurityConfig(), c = !!i && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(i);
2062
+ if ((n.clean || !n.keepFormatting) && r) {
2063
+ document.execCommand("insertText", !1, r);
1975
2064
  return;
1976
2065
  }
1977
- if (i.convertWord === !1 && c && n) {
1978
- document.execCommand("insertText", !1, n);
2066
+ if (n.convertWord === !1 && c && r) {
2067
+ document.execCommand("insertText", !1, r);
1979
2068
  return;
1980
2069
  }
1981
- if (r) {
1982
- l.sanitizeOnPaste !== !1 && a.sanitize !== !1 && (r = F(r, a, l)), this.insertHTMLAtSelection(r);
2070
+ if (i) {
2071
+ l.sanitizeOnPaste !== !1 && s.sanitize !== !1 && (i = X(i, s, l)), this.insertHTMLAtSelection(i);
1983
2072
  return;
1984
2073
  }
1985
- n && document.execCommand("insertText", !1, n);
2074
+ r && document.execCommand("insertText", !1, r);
1986
2075
  }), this.contentElement.addEventListener("focus", () => {
1987
- this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
2076
+ m = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
1988
2077
  }), this.contentElement.addEventListener("blur", () => {
1989
2078
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
1990
2079
  detail: { html: this.contentElement.innerHTML },
1991
2080
  bubbles: !0
1992
2081
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
1993
2082
  }), this.contentElement.addEventListener("keydown", (o) => {
1994
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, n) => {
1995
- this.executeCommand(r, n);
2083
+ this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (i, r) => {
2084
+ this.executeCommand(i, r);
1996
2085
  });
1997
2086
  });
1998
2087
  const e = () => {
1999
- const o = this.getSelectionRangeInEditor(), i = document.activeElement, r = !!i && !!this.contentElement && (i === this.contentElement || this.contentElement.contains(i));
2000
- this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !r || !o && !r || (this.updateFloatingToolbar(), this.updateStatusBar());
2088
+ const o = this.getSelectionRangeInEditor(), n = document.activeElement, i = !!n && !!this.contentElement && (n === this.contentElement || this.contentElement.contains(n));
2089
+ this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !i || !o && !i || (this.updateFloatingToolbar(), this.updateStatusBar());
2001
2090
  };
2002
2091
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
2003
2092
  }
@@ -2019,25 +2108,29 @@ class f extends HTMLElement {
2019
2108
  }
2020
2109
  }
2021
2110
  getSelectionAnchorRect(t, e) {
2022
- const o = Array.from(e.getClientRects()).filter((r) => r.width > 0 || r.height > 0);
2111
+ const o = Array.from(e.getClientRects()).filter((i) => i.width > 0 || i.height > 0);
2023
2112
  return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
2024
2113
  }
2025
2114
  /**
2026
2115
  * Update floating toolbar position
2027
2116
  */
2028
2117
  updateFloatingToolbar() {
2029
- if (!this.floatingToolbar) return;
2030
- const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
2031
- if (t.viewportOnlyScan && !this.isEditorInViewport() && !e) {
2118
+ if (!this.floatingToolbar || !this.contentElement) return;
2119
+ if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.getAttribute("readonly") === "true" || this.getAttribute("data-readonly") === "true") {
2120
+ this.floatingToolbar.hide();
2121
+ return;
2122
+ }
2123
+ const e = this.getPerformanceConfig(), o = document.activeElement === this.contentElement || !!this.contentElement && this.contentElement.contains(document.activeElement);
2124
+ if (e.viewportOnlyScan && !this.isEditorInViewport() && !o) {
2032
2125
  this.floatingToolbar.hide();
2033
2126
  return;
2034
2127
  }
2035
- const o = this.getSelectionRangeInEditor();
2036
- if (!o) {
2128
+ const n = this.getSelectionRangeInEditor();
2129
+ if (!n) {
2037
2130
  this.floatingToolbar.hide();
2038
2131
  return;
2039
2132
  }
2040
- if (o.collapsed) {
2133
+ if (n.collapsed) {
2041
2134
  this.floatingToolbar.hide();
2042
2135
  return;
2043
2136
  }
@@ -2046,7 +2139,7 @@ class f extends HTMLElement {
2046
2139
  this.floatingToolbar.hide();
2047
2140
  return;
2048
2141
  }
2049
- const r = this.getSelectionAnchorRect(i, o);
2142
+ const r = this.getSelectionAnchorRect(i, n);
2050
2143
  if (!r) {
2051
2144
  this.floatingToolbar.hide();
2052
2145
  return;
@@ -2064,14 +2157,14 @@ class f extends HTMLElement {
2064
2157
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
2065
2158
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
2066
2159
  return;
2067
- const o = this.contentElement.textContent || "", { words: i, chars: r } = z(o), n = N(this.contentElement);
2068
- let a, l;
2160
+ const o = this.contentElement.textContent || "", { words: n, chars: i } = W(o), r = _(this.contentElement);
2161
+ let s, l;
2069
2162
  const c = this.getSelectionRangeInEditor();
2070
- c && (a = D(this.contentElement, c), c.collapsed || (l = B(c, a), a = void 0)), this.statusBar.update({
2071
- wordCount: i,
2072
- charCount: r,
2073
- lineCount: n,
2074
- cursorPosition: a,
2163
+ c && (s = F(this.contentElement, c), c.collapsed || (l = U(c, s), s = void 0)), this.statusBar.update({
2164
+ wordCount: n,
2165
+ charCount: i,
2166
+ lineCount: r,
2167
+ cursorPosition: s,
2075
2168
  selectionInfo: l
2076
2169
  });
2077
2170
  }
@@ -2152,7 +2245,7 @@ class f extends HTMLElement {
2152
2245
  const o = this.attributes[e];
2153
2246
  t[o.name] = o.value;
2154
2247
  }
2155
- return y.resolve({
2248
+ return w.resolve({
2156
2249
  jsConfig: this.jsConfig,
2157
2250
  attributes: t
2158
2251
  });
@@ -2192,8 +2285,8 @@ class f extends HTMLElement {
2192
2285
  * Destroy the editor
2193
2286
  */
2194
2287
  destroy() {
2195
- var t, e, o, i;
2196
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2288
+ var t, e, o, n;
2289
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, C.delete(this), m === this && (m = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2197
2290
  }
2198
2291
  // Public API methods
2199
2292
  getContent() {
@@ -2215,37 +2308,37 @@ class f extends HTMLElement {
2215
2308
  (t = this.contentElement) == null || t.blur();
2216
2309
  }
2217
2310
  }
2218
- const v = new x();
2219
- f.__globalPluginLoader = v;
2220
- const K = {
2311
+ const E = new I();
2312
+ g.__globalPluginLoader = E;
2313
+ const rt = {
2221
2314
  // Core editing plugins (always loaded)
2222
- bold: () => import("./BoldPlugin.native-BAzzoqU5.mjs").then((s) => s.BoldPlugin()),
2223
- italic: () => import("./ItalicPlugin.native-CQjjDyUL.mjs").then((s) => s.ItalicPlugin()),
2224
- underline: () => import("./UnderlinePlugin.native-QpIcK4L2.mjs").then((s) => s.UnderlinePlugin()),
2225
- strikethrough: () => import("./StrikethroughPlugin.native-0Be7j49s.mjs").then((s) => s.StrikethroughPlugin()),
2226
- clearFormatting: () => import("./ClearFormattingPlugin.native-Bq_XcTh2.mjs").then((s) => s.ClearFormattingPlugin()),
2227
- heading: () => import("./HeadingPlugin.native-DrLYwQnQ.mjs").then((s) => s.HeadingPlugin()),
2228
- blockquote: () => import("./BlockquotePlugin.native-JFmOLsxN.mjs").then((s) => s.BlockquotePlugin()),
2229
- code: () => import("./CodePlugin.native-DlpTPdkd.mjs").then((s) => s.CodePlugin()),
2230
- list: () => import("./ListPlugin.native-V7EZC1lM.mjs").then((s) => s.ListPlugin()),
2231
- history: () => import("./HistoryPlugin.native-TDnVMsEO.mjs").then((s) => s.HistoryPlugin())
2315
+ bold: () => import("./BoldPlugin.native-BAzzoqU5.mjs").then((a) => a.BoldPlugin()),
2316
+ italic: () => import("./ItalicPlugin.native-CQjjDyUL.mjs").then((a) => a.ItalicPlugin()),
2317
+ underline: () => import("./UnderlinePlugin.native-QpIcK4L2.mjs").then((a) => a.UnderlinePlugin()),
2318
+ strikethrough: () => import("./StrikethroughPlugin.native-0Be7j49s.mjs").then((a) => a.StrikethroughPlugin()),
2319
+ clearFormatting: () => import("./ClearFormattingPlugin.native-Bq_XcTh2.mjs").then((a) => a.ClearFormattingPlugin()),
2320
+ heading: () => import("./HeadingPlugin.native-DrLYwQnQ.mjs").then((a) => a.HeadingPlugin()),
2321
+ blockquote: () => import("./BlockquotePlugin.native-JFmOLsxN.mjs").then((a) => a.BlockquotePlugin()),
2322
+ code: () => import("./CodePlugin.native-DlpTPdkd.mjs").then((a) => a.CodePlugin()),
2323
+ list: () => import("./ListPlugin.native-V7EZC1lM.mjs").then((a) => a.ListPlugin()),
2324
+ history: () => import("./HistoryPlugin.native-TDnVMsEO.mjs").then((a) => a.HistoryPlugin())
2232
2325
  };
2233
- async function q() {
2234
- return Object.entries(K).forEach(([s, t]) => {
2235
- v.register(s, t);
2236
- }), v;
2326
+ async function at() {
2327
+ return Object.entries(rt).forEach(([a, t]) => {
2328
+ E.register(a, t);
2329
+ }), E;
2237
2330
  }
2238
- typeof window != "undefined" && q().then((s) => {
2239
- f.__globalPluginLoader = s, customElements.get("editora-editor") || customElements.define("editora-editor", f);
2331
+ typeof window != "undefined" && at().then((a) => {
2332
+ g.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", g);
2240
2333
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
2241
2334
  t.forEach((o) => {
2242
- const i = o.innerHTML.trim();
2243
- i && (e.push(i), o.setAttribute("data-initial-content", i), o.innerHTML = "");
2244
- }), t.forEach((o, i) => {
2245
- o instanceof f && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
2335
+ const n = o.innerHTML.trim();
2336
+ n && (e.push(n), o.setAttribute("data-initial-content", n), o.innerHTML = "");
2337
+ }), t.forEach((o, n) => {
2338
+ o instanceof g && !o.isInitialized && e[n] && o.setAttribute("content", e[n]);
2246
2339
  });
2247
2340
  });
2248
2341
  export {
2249
- q as initWebComponent
2342
+ at as initWebComponent
2250
2343
  };
2251
2344
  //# sourceMappingURL=webcomponent-core.js.map