@editora/core 1.0.17 → 1.0.19

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.
@@ -1,5 +1,6 @@
1
1
  import { i as Q } from "./dialogHelpers-DBf7WqYH.mjs";
2
- class K {
2
+ import { s as Y } from "./sanitizeHtml-DA0ajC6k.mjs";
3
+ class W {
3
4
  constructor(e = "") {
4
5
  this._lines = [], this._version = 0, this.setText(e);
5
6
  }
@@ -85,7 +86,7 @@ class K {
85
86
  }
86
87
  // Clone the model
87
88
  clone() {
88
- const e = new K();
89
+ const e = new W();
89
90
  return e._lines = [...this._lines], e._version = this._version, e;
90
91
  }
91
92
  normalizeRange(e) {
@@ -98,7 +99,7 @@ class K {
98
99
  return e.line !== t.line ? e.line - t.line : e.column - t.column;
99
100
  }
100
101
  }
101
- class Y {
102
+ class X {
102
103
  constructor(e) {
103
104
  this.gutterWidth = 50, this.gutterFoldColumnWidth = 20, this.gutterFoldColumnGap = 4, this.gutterLineNumberPaddingLeft = 8, this.gutterLineNumberPaddingRight = 4, this.gutterDigitWidth = 9, this.lineHeight = 21, this.trailingNewlineMarkerAttr = "data-lce-trailing-newline-marker", this.foldPlaceholderAttr = "data-lce-fold-placeholder", this.virtualMarkerRegex = /[\u200B\uE000]/, this.virtualMarkerGlobalRegex = /[\u200B\uE000]/g, this.lastLineCount = 0, this.lastHighlightHTML = "", this.highlightOverlayActive = !1, this.lastLineDecorationSnapshot = "", this.lastGutterDecorationSnapshot = "", this.container = e, this.createDOM();
104
105
  }
@@ -823,10 +824,10 @@ class Y {
823
824
  this.contentElement.__lceFoldPlaceholderSources = e;
824
825
  }
825
826
  }
826
- let X = 0;
827
+ let J = 0;
827
828
  const w = class w {
828
829
  constructor(e, t = {}) {
829
- this.extensions = /* @__PURE__ */ new Map(), this.commands = /* @__PURE__ */ new Map(), this.eventListeners = /* @__PURE__ */ new Map(), this.folds = [], this.currentTheme = "default", this.isDestroyed = !1, this.undoStack = [], this.redoStack = [], this.suppressHistory = !1, this.highlightTimeout = null, this.expectingProgrammaticCursor = !1, this.lastKnownCursor = { line: 0, column: 0 }, this.editorInstanceId = ++X, this.decorationHighlightStyleId = `editora-decoration-style-${this.editorInstanceId}`, this.decorationHighlightLimit = 1e3, this.decorationLayers = /* @__PURE__ */ new Map(), this.inlineDecorationHighlightNames = /* @__PURE__ */ new Set(), this.decorationRenderRaf = null, this.decorationMutationObserver = null, this.hasCustomDecorationHighlightSupport = !1, this.lastProgrammaticClipboardInsertAt = 0, this.config = {
830
+ this.extensions = /* @__PURE__ */ new Map(), this.commands = /* @__PURE__ */ new Map(), this.eventListeners = /* @__PURE__ */ new Map(), this.folds = [], this.currentTheme = "default", this.isDestroyed = !1, this.undoStack = [], this.redoStack = [], this.suppressHistory = !1, this.highlightTimeout = null, this.expectingProgrammaticCursor = !1, this.lastKnownCursor = { line: 0, column: 0 }, this.editorInstanceId = ++J, this.decorationHighlightStyleId = `editora-decoration-style-${this.editorInstanceId}`, this.decorationHighlightLimit = 1e3, this.decorationLayers = /* @__PURE__ */ new Map(), this.inlineDecorationHighlightNames = /* @__PURE__ */ new Set(), this.decorationRenderRaf = null, this.decorationMutationObserver = null, this.hasCustomDecorationHighlightSupport = !1, this.lastProgrammaticClipboardInsertAt = 0, this.config = {
830
831
  value: "",
831
832
  theme: "default",
832
833
  readOnly: !1,
@@ -834,7 +835,7 @@ const w = class w {
834
835
  lineWrapping: !1,
835
836
  lineNumbers: !0,
836
837
  ...t
837
- }, this.textModel = new K(this.config.value), this.view = new Y(e), this.view.setTabSize(this.config.tabSize || 2), this.view.setLineWrapping(!!this.config.lineWrapping), this.view.setLineNumbersVisible(this.config.lineNumbers !== !1), this.hasCustomDecorationHighlightSupport = this.detectCustomHighlightSupport(), this.observeDecorationRelevantMutations(), this.setupEventHandlers(), this.config.extensions && this.config.extensions.forEach((i) => this.addExtension(i)), this.setTheme(this.config.theme), this.view.setReadOnly(this.config.readOnly || !1), this.renderTextWithHighlight(this.textModel.getText()), this.registerBuiltInCommands();
838
+ }, this.textModel = new W(this.config.value), this.view = new X(e), this.view.setTabSize(this.config.tabSize || 2), this.view.setLineWrapping(!!this.config.lineWrapping), this.view.setLineNumbersVisible(this.config.lineNumbers !== !1), this.hasCustomDecorationHighlightSupport = this.detectCustomHighlightSupport(), this.observeDecorationRelevantMutations(), this.setupEventHandlers(), this.config.extensions && this.config.extensions.forEach((i) => this.addExtension(i)), this.setTheme(this.config.theme), this.view.setReadOnly(this.config.readOnly || !1), this.renderTextWithHighlight(this.textModel.getText()), this.registerBuiltInCommands();
838
839
  }
839
840
  // Public accessors for extensions
840
841
  getTextModel() {
@@ -1900,8 +1901,8 @@ const w = class w {
1900
1901
  }
1901
1902
  };
1902
1903
  w.CURSOR_SENTINEL = "";
1903
- let V = w;
1904
- class J {
1904
+ let B = w;
1905
+ class ee {
1905
1906
  constructor(e) {
1906
1907
  this.name = "keymap", this.editor = null, this.keymap = {}, this.isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0, this.keymap = e || this.getDefaultKeymap();
1907
1908
  }
@@ -1975,7 +1976,7 @@ class J {
1975
1976
  this.keymap = {}, this.editor = null;
1976
1977
  }
1977
1978
  }
1978
- const A = class A {
1979
+ const D = class D {
1979
1980
  constructor() {
1980
1981
  this.name = "transaction", this.transactions = [];
1981
1982
  }
@@ -1987,9 +1988,9 @@ const A = class A {
1987
1988
  effects: [],
1988
1989
  annotations: []
1989
1990
  };
1990
- this.transactions.push(i), this.transactions.length > A.MAX_TRANSACTIONS && this.transactions.splice(
1991
+ this.transactions.push(i), this.transactions.length > D.MAX_TRANSACTIONS && this.transactions.splice(
1991
1992
  0,
1992
- this.transactions.length - A.MAX_TRANSACTIONS
1993
+ this.transactions.length - D.MAX_TRANSACTIONS
1993
1994
  );
1994
1995
  });
1995
1996
  }
@@ -2000,9 +2001,9 @@ const A = class A {
2000
2001
  this.transactions = [];
2001
2002
  }
2002
2003
  };
2003
- A.MAX_TRANSACTIONS = 200;
2004
- let W = A;
2005
- class ee {
2004
+ D.MAX_TRANSACTIONS = 200;
2005
+ let z = D;
2006
+ class te {
2006
2007
  constructor() {
2007
2008
  this.name = "line-numbers", this.editor = null, this.lineNumbersElement = null, this.isEnabled = !0;
2008
2009
  }
@@ -2031,7 +2032,7 @@ class ee {
2031
2032
  this.lineNumbersElement = null, this.editor = null;
2032
2033
  }
2033
2034
  }
2034
- class te {
2035
+ class ie {
2035
2036
  constructor() {
2036
2037
  this.name = "theme", this.editor = null, this.currentTheme = "dark";
2037
2038
  }
@@ -2056,7 +2057,7 @@ class te {
2056
2057
  this.editor = null;
2057
2058
  }
2058
2059
  }
2059
- class ie {
2060
+ class ne {
2060
2061
  constructor() {
2061
2062
  this.name = "read-only", this.editor = null, this.isReadOnly = !1;
2062
2063
  }
@@ -2083,14 +2084,14 @@ class ie {
2083
2084
  this.editor = null;
2084
2085
  }
2085
2086
  }
2086
- let ne = 0;
2087
+ let se = 0;
2087
2088
  const x = class x {
2088
2089
  constructor(e = {}) {
2089
2090
  this.name = "search", this.editor = null, this.searchUI = null, this.isVisible = !1, this.currentResults = [], this.currentIndex = -1, this.searchDebounceTimer = null, this.liveRefreshTimer = null, this.statusResetTimer = null, this.statusFreezeUntil = 0, this.findInput = null, this.replaceInputEl = null, this.statusDiv = null, this.modeDiv = null, this.caseSensitiveInput = null, this.wholeWordInput = null, this.regexInput = null, this.currentQuery = "", this.savedCursor = null, this.editorChangeHandler = null, this.searchOptions = {
2090
2091
  caseSensitive: !1,
2091
2092
  wholeWord: !1,
2092
2093
  regex: !1
2093
- }, this.trailingMarkerAttr = "data-lce-trailing-newline-marker", this.editorContainerSelector = '[data-lce-editor-container="true"]', this.highlightId = ++ne, this.highlightMatchName = `editora-search-match-${this.highlightId}`, this.highlightActiveName = `editora-search-active-${this.highlightId}`, this.highlightStyleId = `editora-search-highlight-style-${this.highlightId}`, this.maxCustomHighlightRanges = 2e3, this.virtualMarkerRegex = /[\u200B\uE000]/, this.hasCustomHighlightSupport = !1, this.config = {
2094
+ }, this.trailingMarkerAttr = "data-lce-trailing-newline-marker", this.editorContainerSelector = '[data-lce-editor-container="true"]', this.highlightId = ++se, this.highlightMatchName = `editora-search-match-${this.highlightId}`, this.highlightActiveName = `editora-search-active-${this.highlightId}`, this.highlightStyleId = `editora-search-highlight-style-${this.highlightId}`, this.maxCustomHighlightRanges = 2e3, this.virtualMarkerRegex = /[\u200B\uE000]/, this.hasCustomHighlightSupport = !1, this.config = {
2094
2095
  replaceAndFindNext: !0,
2095
2096
  ...e
2096
2097
  };
@@ -2657,8 +2658,8 @@ x.css = {
2657
2658
  mode: "search-mode",
2658
2659
  modeLayout: "lce-search-mode"
2659
2660
  };
2660
- let U = x, se = 0;
2661
- class re {
2661
+ let V = x, re = 0;
2662
+ class oe {
2662
2663
  constructor() {
2663
2664
  this.name = "bracket-matching", this.editor = null, this.bracketPairs = {
2664
2665
  "(": ")",
@@ -2670,7 +2671,7 @@ class re {
2670
2671
  "]": "[",
2671
2672
  "}": "{",
2672
2673
  ">": "<"
2673
- }, this.highlightId = ++se, this.highlightName = `editora-bracket-match-${this.highlightId}`, this.highlightStyleId = `editora-bracket-match-style-${this.highlightId}`, this.currentMatch = null, this.hasCustomHighlightSupport = !1, this.observer = null, this.pendingUpdateRaf = null, this.updateRequestVersion = 0, this.cursorHandler = null, this.changeHandler = null;
2674
+ }, this.highlightId = ++re, this.highlightName = `editora-bracket-match-${this.highlightId}`, this.highlightStyleId = `editora-bracket-match-style-${this.highlightId}`, this.currentMatch = null, this.hasCustomHighlightSupport = !1, this.observer = null, this.pendingUpdateRaf = null, this.updateRequestVersion = 0, this.cursorHandler = null, this.changeHandler = null;
2674
2675
  }
2675
2676
  setup(e) {
2676
2677
  this.editor = e, this.hasCustomHighlightSupport = this.detectCustomHighlightSupport(), this.hasCustomHighlightSupport && (this.ensureHighlightStyles(), this.observeContentMutations()), this.cursorHandler = () => {
@@ -2828,7 +2829,7 @@ class re {
2828
2829
  this.cursorHandler = null, this.changeHandler = null, this.editor = null;
2829
2830
  }
2830
2831
  }
2831
- class oe {
2832
+ class le {
2832
2833
  constructor() {
2833
2834
  this.name = "code-folding", this.lineHeight = 21, this.voidMarkupTags = /* @__PURE__ */ new Set([
2834
2835
  "area",
@@ -3496,7 +3497,7 @@ class oe {
3496
3497
  this.pendingUpdateRaf !== null && (cancelAnimationFrame(this.pendingUpdateRaf), this.pendingUpdateRaf = null), this.editor && this.changeHandler && this.editor.off("change", this.changeHandler), this.foldingUI && this.foldingUI.parentNode && this.foldingUI.parentNode.removeChild(this.foldingUI), this.restoreFullDisplay(), this.changeHandler = null, this.lastSnapshot = "", this.lastParsedText = null, this.foldingUI = null, this.foldRegions = [], this.cachedLineInfo = null, this.editor = null;
3497
3498
  }
3498
3499
  }
3499
- class le {
3500
+ class ae {
3500
3501
  constructor() {
3501
3502
  this.name = "syntax-highlighting", this.editor = null, this.currentTheme = "dark", this.currentLanguage = null, this.modes = /* @__PURE__ */ new Map();
3502
3503
  }
@@ -3737,16 +3738,16 @@ class le {
3737
3738
  return y = y.replace(
3738
3739
  /([\w:-]+)(\s*=\s*)((&quot;[\s\S]*?&quot;|&#39;[\s\S]*?&#39;|[^\s&>]+))/g,
3739
3740
  (T, S, v, C) => {
3740
- const O = String(S).toLowerCase(), $ = `<span style="color: ${i.attrName};">${S}</span>`;
3741
- let I = C, M = "";
3742
- C.startsWith("&quot;") && C.endsWith("&quot;") ? (I = C.slice(6, -6), M = "&quot;") : C.startsWith("&#39;") && C.endsWith("&#39;") && (I = C.slice(5, -5), M = "&#39;");
3741
+ const L = String(S).toLowerCase(), H = `<span style="color: ${i.attrName};">${S}</span>`;
3742
+ let O = C, M = "";
3743
+ C.startsWith("&quot;") && C.endsWith("&quot;") ? (O = C.slice(6, -6), M = "&quot;") : C.startsWith("&#39;") && C.endsWith("&#39;") && (O = C.slice(5, -5), M = "&#39;");
3743
3744
  let E = C;
3744
- if (O === "style") {
3745
- const N = I.replace(/([\w-]+)\s*:\s*([^;]+)(;?)/g, (F, k, P, H) => `<span style="color: ${i.styleProp};">${k}</span>:<span style="color: ${i.styleVal};">${P}</span>${H}`);
3745
+ if (L === "style") {
3746
+ const N = O.replace(/([\w-]+)\s*:\s*([^;]+)(;?)/g, (F, k, A, I) => `<span style="color: ${i.styleProp};">${k}</span>:<span style="color: ${i.styleVal};">${A}</span>${I}`);
3746
3747
  M ? E = `${M}${N}${M}` : E = N, E = `<span style="color: ${i.attrValue};">${E}</span>`;
3747
3748
  } else
3748
- M && (E = `${M}${I}${M}`), E = `<span style="color: ${i.attrValue};">${E}</span>`;
3749
- return `${$}${v}${E}`;
3749
+ M && (E = `${M}${O}${M}`), E = `<span style="color: ${i.attrValue};">${E}</span>`;
3750
+ return `${H}${v}${E}`;
3750
3751
  }
3751
3752
  ), `${f}${m}${y}${p}`;
3752
3753
  }), a = a.replace(/\u0002ht(\d+)\u0002/g, (d, f) => o[Number(f)] || ""), this.restoreHighlightTokens(a, s);
@@ -4076,11 +4077,11 @@ class le {
4076
4077
  this.editor = null, this.modes.clear();
4077
4078
  }
4078
4079
  }
4079
- function ae(R, e) {
4080
+ function he(R, e) {
4080
4081
  const t = { ...e };
4081
- return t.extensions || (t.extensions = []), t.extensions.some((s) => s.name === "keymap") || t.extensions.unshift(new J(t.keymap)), t.extensions.some((s) => s.name === "transaction") || t.extensions.unshift(new W()), new V(R, t);
4082
+ return t.extensions || (t.extensions = []), t.extensions.some((s) => s.name === "keymap") || t.extensions.unshift(new ee(t.keymap)), t.extensions.some((s) => s.name === "transaction") || t.extensions.unshift(new z()), new B(R, t);
4082
4083
  }
4083
- const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Editor Dialog Styles */
4084
+ const P = '[data-theme="dark"], .dark, .editora-theme-dark', ce = `/* Source Editor Dialog Styles */
4084
4085
  .rte-source-editor-overlay {
4085
4086
  position: fixed !important;
4086
4087
  top: 0 !important;
@@ -4457,7 +4458,7 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4457
4458
  flex: 1;
4458
4459
  text-align: center;
4459
4460
  }
4460
- }`, de = () => ({
4461
+ }`, ge = () => ({
4461
4462
  name: "code",
4462
4463
  // Toolbar button configuration
4463
4464
  toolbar: [
@@ -4528,7 +4529,7 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4528
4529
  document.querySelectorAll(".rte-source-editor-overlay").forEach((b) => b.remove());
4529
4530
  const r = i(t);
4530
4531
  let o = null, l = "dark", a = !1, h = !1, c = !1, d = !1;
4531
- const f = !!e.closest(z) || document.body.matches(z) || document.documentElement.matches(z), u = document.createElement("div");
4532
+ const f = !!e.closest(P) || document.body.matches(P) || document.documentElement.matches(P), u = document.createElement("div");
4532
4533
  Q(u), u.className = "rte-source-editor-overlay", f && u.classList.add("rte-theme-dark");
4533
4534
  const g = document.createElement("div");
4534
4535
  g.className = "rte-source-editor-modal", g.setAttribute("role", "dialog"), g.setAttribute("aria-modal", "true"), g.setAttribute("aria-labelledby", "source-editor-title");
@@ -4589,15 +4590,15 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4589
4590
  </div>
4590
4591
  `, g.appendChild(p), g.appendChild(m), g.appendChild(v), u.appendChild(g), !document.getElementById("rte-source-editor-styles")) {
4591
4592
  const b = document.createElement("style");
4592
- b.id = "rte-source-editor-styles", b.textContent = he, document.head.appendChild(b);
4593
+ b.id = "rte-source-editor-styles", b.textContent = ce, document.head.appendChild(b);
4593
4594
  }
4594
4595
  const C = p.querySelector(
4595
4596
  ".theme-toggle-btn"
4596
- ), O = p.querySelector(
4597
+ ), L = p.querySelector(
4597
4598
  ".readonly-toggle-btn"
4598
- ), $ = p.querySelector(
4599
+ ), H = p.querySelector(
4599
4600
  ".rte-source-editor-fullscreen-btn"
4600
- ), I = p.querySelector(
4601
+ ), O = p.querySelector(
4601
4602
  ".rte-source-editor-close-btn"
4602
4603
  ), M = v.querySelector(
4603
4604
  ".rte-source-editor-btn-cancel"
@@ -4605,13 +4606,13 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4605
4606
  ".rte-source-editor-btn-save"
4606
4607
  ), N = v.querySelector(
4607
4608
  ".unsaved-changes"
4608
- ), F = [], k = (b, L, B, D) => {
4609
- b.addEventListener(L, B, D), F.push(
4610
- () => b.removeEventListener(L, B, D)
4609
+ ), F = [], k = (b, $, U, K) => {
4610
+ b.addEventListener($, U, K), F.push(
4611
+ () => b.removeEventListener($, U, K)
4611
4612
  );
4612
- }, P = (b) => {
4613
+ }, A = (b) => {
4613
4614
  c !== b && (c = b, N && (N.style.display = c ? "inline" : "none"));
4614
- }, H = () => {
4615
+ }, I = () => {
4615
4616
  if (!d) {
4616
4617
  for (d = !0; F.length; ) {
4617
4618
  const b = F.pop();
@@ -4638,7 +4639,7 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4638
4639
  </svg>
4639
4640
  `);
4640
4641
  }, j = () => {
4641
- a = !a, o == null || o.setReadOnly(a), O && (O.classList.toggle("active", a), O.innerHTML = a ? `
4642
+ a = !a, o == null || o.setReadOnly(a), L && (L.classList.toggle("active", a), L.innerHTML = a ? `
4642
4643
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
4643
4644
  <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
4644
4645
  <circle cx="12" cy="16" r="1"/>
@@ -4651,7 +4652,7 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4651
4652
  </svg>
4652
4653
  `);
4653
4654
  }, q = () => {
4654
- h = !h, u.classList.toggle("fullscreen", h), S.style.height = h ? "calc(100vh - 200px)" : "400px", $ && ($.innerHTML = h ? `
4655
+ h = !h, u.classList.toggle("fullscreen", h), S.style.height = h ? "calc(100vh - 200px)" : "400px", H && (H.innerHTML = h ? `
4655
4656
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
4656
4657
  <path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3"/>
4657
4658
  </svg>
@@ -4661,13 +4662,11 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4661
4662
  </svg>
4662
4663
  `);
4663
4664
  }, G = () => {
4664
- c && !confirm("You have unsaved changes. Are you sure you want to cancel?") || H();
4665
+ c && !confirm("You have unsaved changes. Are you sure you want to cancel?") || I();
4665
4666
  }, Z = () => {
4666
4667
  try {
4667
- const b = (o == null ? void 0 : o.getValue()) || "", L = document.createElement("div");
4668
- L.innerHTML = b, L.querySelectorAll(
4669
- 'script, iframe[src^="javascript:"], object, embed'
4670
- ).forEach((D) => D.remove()), e.innerHTML = L.innerHTML;
4668
+ const b = (o == null ? void 0 : o.getValue()) || "";
4669
+ e.innerHTML = Y(b);
4671
4670
  try {
4672
4671
  e.dispatchEvent(
4673
4672
  new InputEvent("input", {
@@ -4676,42 +4675,42 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4676
4675
  inputType: "insertReplacementText"
4677
4676
  })
4678
4677
  );
4679
- } catch (D) {
4678
+ } catch ($) {
4680
4679
  e.dispatchEvent(
4681
4680
  new Event("input", { bubbles: !0 })
4682
4681
  );
4683
4682
  }
4684
4683
  e.dispatchEvent(
4685
4684
  new Event("change", { bubbles: !0 })
4686
- ), P(!1), H();
4685
+ ), A(!1), I();
4687
4686
  } catch (b) {
4688
4687
  alert("Failed to update HTML. Please check your syntax."), console.error("HTML update error:", b);
4689
4688
  }
4690
4689
  };
4691
- C && k(C, "click", _), O && k(O, "click", j), $ && k($, "click", q), I && k(I, "click", H), M && k(M, "click", G), E && k(E, "click", Z), k(u, "click", (b) => {
4692
- b.target === u && H();
4690
+ C && k(C, "click", _), L && k(L, "click", j), H && k(H, "click", q), O && k(O, "click", I), M && k(M, "click", G), E && k(E, "click", Z), k(u, "click", (b) => {
4691
+ b.target === u && I();
4693
4692
  }), k(document, "keydown", (b) => {
4694
- const L = b;
4695
- L.key === "Escape" && (L.preventDefault(), H());
4693
+ const $ = b;
4694
+ $.key === "Escape" && ($.preventDefault(), I());
4696
4695
  }), document.body.appendChild(u), requestAnimationFrame(() => {
4697
4696
  if (!(d || !u.isConnected))
4698
4697
  try {
4699
- o = ae(S, {
4698
+ o = he(S, {
4700
4699
  value: r,
4701
4700
  theme: "dark",
4702
4701
  readOnly: !1,
4703
4702
  extensions: [
4704
- new ee(),
4705
4703
  new te(),
4706
4704
  new ie(),
4707
- new re(),
4708
- new U(),
4705
+ new ne(),
4709
4706
  new oe(),
4710
- new le()
4707
+ new V(),
4708
+ new le(),
4709
+ new ae()
4711
4710
  ]
4712
4711
  }), o.on("change", () => {
4713
4712
  const b = (o == null ? void 0 : o.getValue()) || "";
4714
- P(b !== r);
4713
+ A(b !== r);
4715
4714
  }), requestAnimationFrame(() => o == null ? void 0 : o.focus());
4716
4715
  } catch (b) {
4717
4716
  console.error("Failed to initialize code editor:", b);
@@ -4727,6 +4726,6 @@ const z = '[data-theme="dark"], .dark, .editora-theme-dark', he = `/* Source Edi
4727
4726
  }
4728
4727
  });
4729
4728
  export {
4730
- de as CodePlugin
4729
+ ge as CodePlugin
4731
4730
  };
4732
- //# sourceMappingURL=CodePlugin.native-BH-K4xmW.mjs.map
4731
+ //# sourceMappingURL=CodePlugin.native-BcVqm5MS.mjs.map