@kong-ui-public/monaco-editor 0.24.14 → 0.24.16

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,13 +1,13 @@
1
- import { onMounted as q, nextTick as Z, getCurrentScope as Me, onScopeDispose as Ne, getCurrentInstance as Le, toValue as P, computed as M, shallowRef as z, watch as _, ref as de, reactive as Ee, onActivated as Oe, onBeforeUnmount as Ae, onWatcherCleanup as Te, defineComponent as ie, resolveComponent as H, openBlock as v, createBlock as N, createSlots as ue, withCtx as O, resolveDynamicComponent as me, createVNode as oe, createElementVNode as F, normalizeClass as re, toDisplayString as ce, createElementBlock as I, Fragment as R, renderList as B, unref as S, createCommentVNode as G, useTemplateRef as V, withDirectives as $e, createTextVNode as _e, vShow as Re, renderSlot as W, useModel as Be, Transition as ge, mergeModels as fe } from "vue";
2
- import { StrikethroughIcon as We, ItalicIcon as De, BoldIcon as Pe, CleaningIcon as Ge, ImageIcon as Fe, LinkIcon as Ke, CodeIcon as Ue, TasklistIcon as Ve, ListOrderedIcon as je, ListUnorderedIcon as ze, TableIcon as He, BlockquoteIcon as qe, CodeblockIcon as xe, SearchIcon as Ye, ExpandIcon as Je, MoreIcon as Qe, ProgressIcon as Xe } from "@kong/icons";
3
- import * as $ from "monaco-editor";
4
- import { KeyMod as T, KeyCode as j } from "monaco-editor";
5
- import { shikiToMonaco as Ze } from "@shikijs/monaco";
6
- import { getSingletonHighlighter as et, bundledLanguages as tt, bundledThemes as nt } from "shiki";
7
- import { createI18n as ot, i18nTComponent as rt } from "@kong-ui-public/i18n";
8
- import { d as rn, a as an, c as ln, b as sn, e as cn, u as dn } from "./code-lenses-CMLSv617.js";
9
- import { getModelContext as mn, invalidateModelContexts as gn } from "./singletons.es.js";
10
- const it = "'JetBrains Mono', Consolas, monospace", at = "12px", lt = "500", st = "20px", ct = "8px", ee = Object.freeze({
1
+ import { onMounted as Y, nextTick as ee, shallowRef as V, shallowReadonly as Me, getCurrentScope as Ne, onScopeDispose as Ee, getCurrentInstance as Le, toValue as D, computed as M, watch as $, ref as ue, reactive as Oe, onActivated as Ae, onBeforeUnmount as Te, onWatcherCleanup as Re, defineComponent as ae, resolveComponent as q, openBlock as v, createBlock as N, createSlots as me, withCtx as O, resolveDynamicComponent as ge, createVNode as re, createElementVNode as K, normalizeClass as ie, toDisplayString as de, createElementBlock as I, Fragment as _, renderList as B, unref as S, createCommentVNode as G, useTemplateRef as z, withDirectives as $e, createTextVNode as _e, vShow as Be, renderSlot as W, useModel as We, Transition as fe, mergeModels as be } from "vue";
2
+ import { StrikethroughIcon as Pe, ItalicIcon as De, BoldIcon as Fe, CleaningIcon as Ge, ImageIcon as Ke, LinkIcon as Ue, CodeIcon as Ve, TasklistIcon as je, ListOrderedIcon as ze, ListUnorderedIcon as He, TableIcon as qe, BlockquoteIcon as Ye, CodeblockIcon as xe, SearchIcon as Xe, ExpandIcon as Je, MoreIcon as Qe, ProgressIcon as Ze } from "@kong/icons";
3
+ import * as R from "monaco-editor";
4
+ import { KeyMod as T, KeyCode as H } from "monaco-editor";
5
+ import { shikiToMonaco as et } from "@shikijs/monaco";
6
+ import { getSingletonHighlighter as tt, bundledLanguages as nt, bundledThemes as ot } from "shiki";
7
+ import { createI18n as rt, i18nTComponent as it } from "@kong-ui-public/i18n";
8
+ import { d as an, a as ln, c as sn, b as cn, e as dn, u as un } from "./code-lenses-CMLSv617.js";
9
+ import { getModelContext as gn, invalidateModelContexts as fn } from "./singletons.es.js";
10
+ const at = "'JetBrains Mono', Consolas, monospace", lt = "12px", st = "500", ct = "20px", dt = "8px", te = Object.freeze({
11
11
  autoClosingQuotes: "always",
12
12
  automaticLayout: !0,
13
13
  // Auto resize layout
@@ -16,10 +16,10 @@ const it = "'JetBrains Mono', Consolas, monospace", at = "12px", lt = "500", st
16
16
  },
17
17
  hideCursorInOverviewRuler: !0,
18
18
  // hide the cursor position in the minimap TODO: maybe hide it on first line or change it colour
19
- fontFamily: it,
20
- fontSize: Number(at.replace("px", "")),
21
- fontWeight: lt,
22
- lineHeight: Number(st.replace("px", "")),
19
+ fontFamily: at,
20
+ fontSize: Number(lt.replace("px", "")),
21
+ fontWeight: st,
22
+ lineHeight: Number(ct.replace("px", "")),
23
23
  formatOnPaste: !0,
24
24
  formatOnType: !0,
25
25
  // Add to enable automatic formatting as the user types.
@@ -64,7 +64,7 @@ const it = "'JetBrains Mono', Consolas, monospace", at = "12px", lt = "500", st
64
64
  addExtraSpaceOnTop: !1
65
65
  // we need this set to false to get the correct absolute position, otherwise when the search box opens the content shifts
66
66
  }
67
- }), be = {
67
+ }), he = {
68
68
  command: T.CtrlCmd,
69
69
  cmd: T.CtrlCmd,
70
70
  ctrl: T.CtrlCmd,
@@ -74,7 +74,7 @@ const it = "'JetBrains Mono', Consolas, monospace", at = "12px", lt = "500", st
74
74
  option: T.Alt,
75
75
  win: T.WinCtrl,
76
76
  meta: T.WinCtrl
77
- }, dt = {
77
+ }, ut = {
78
78
  enter: "Enter",
79
79
  esc: "Escape",
80
80
  escape: "Escape",
@@ -96,29 +96,29 @@ const it = "'JetBrains Mono', Consolas, monospace", at = "12px", lt = "500", st
96
96
  arrowleft: "LeftArrow",
97
97
  arrowright: "RightArrow"
98
98
  };
99
- function ut(e) {
99
+ function mt(e) {
100
100
  if (!e?.length) return;
101
101
  let o = 0, t;
102
102
  for (const n of e) {
103
- const a = n.toLowerCase();
104
- if (be[a]) {
105
- o |= be[a];
103
+ const l = n.toLowerCase();
104
+ if (he[l]) {
105
+ o |= he[l];
106
106
  continue;
107
107
  }
108
- if (/^f\d+$/.test(a)) {
109
- t = j[`F${a.slice(1)}`];
108
+ if (/^f\d+$/.test(l)) {
109
+ t = H[`F${l.slice(1)}`];
110
110
  continue;
111
111
  }
112
- if (/^[a-z]$/.test(a)) {
113
- t = j[`Key${a.toUpperCase()}`];
112
+ if (/^[a-z]$/.test(l)) {
113
+ t = H[`Key${l.toUpperCase()}`];
114
114
  continue;
115
115
  }
116
- if (/^\d$/.test(a)) {
117
- t = j[`Digit${a}`];
116
+ if (/^\d$/.test(l)) {
117
+ t = H[`Digit${l}`];
118
118
  continue;
119
119
  }
120
- const r = dt[a];
121
- r && (t = j[r]);
120
+ const r = ut[l];
121
+ r && (t = H[r]);
122
122
  }
123
123
  return t !== void 0 ? o | t : void 0;
124
124
  }
@@ -132,7 +132,7 @@ function J(e, o) {
132
132
  }
133
133
  }
134
134
  }
135
- const mt = /* @__PURE__ */ new Set(["markdown", "mdc"]), gt = [
135
+ const gt = /* @__PURE__ */ new Set(["markdown", "mdc"]), ft = [
136
136
  // Task list: `- [ ] ` or `- [x] `
137
137
  {
138
138
  detect: /^(\s*)- \[[ x]\] /,
@@ -152,31 +152,31 @@ const mt = /* @__PURE__ */ new Set(["markdown", "mdc"]), gt = [
152
152
  emptyItem: /^(\s*)\d+\. $/
153
153
  }
154
154
  ];
155
- function ft(e) {
155
+ function bt(e) {
156
156
  return e.addAction({
157
157
  id: "editor.action.listContinuation",
158
158
  label: "Continue List on Enter",
159
- keybindings: [j.Enter],
159
+ keybindings: [H.Enter],
160
160
  // Only trigger when: editor has focus, is not read-only, no suggest/autocomplete widget is visible
161
161
  precondition: "editorTextFocus && !editorReadonly && !suggestWidgetVisible && !renameInputVisible && !inSnippetMode && !quickFixWidgetVisible",
162
162
  run: (o) => {
163
163
  const t = o.getModel(), n = o.getSelection();
164
- if (!t || !n || !n.isEmpty() || !mt.has(t.getLanguageId())) {
164
+ if (!t || !n || !n.isEmpty() || !gt.has(t.getLanguageId())) {
165
165
  o.trigger("listContinuation", "type", { text: `
166
166
  ` });
167
167
  return;
168
168
  }
169
- const a = n.startLineNumber, r = t.getLineContent(a);
170
- for (const l of gt) {
171
- const d = r.match(l.detect);
172
- if (!d) continue;
173
- if (l.emptyItem.test(r)) {
169
+ const l = n.startLineNumber, r = t.getLineContent(l);
170
+ for (const a of ft) {
171
+ const c = r.match(a.detect);
172
+ if (!c) continue;
173
+ if (a.emptyItem.test(r)) {
174
174
  o.executeEdits("listContinuation", [
175
175
  {
176
176
  range: {
177
- startLineNumber: a,
177
+ startLineNumber: l,
178
178
  startColumn: 1,
179
- endLineNumber: a,
179
+ endLineNumber: l,
180
180
  endColumn: r.length + 1
181
181
  },
182
182
  text: ""
@@ -184,22 +184,22 @@ function ft(e) {
184
184
  ]);
185
185
  return;
186
186
  }
187
- const s = l.nextPrefix(d);
187
+ const s = a.nextPrefix(c);
188
188
  if (s !== void 0) {
189
- const c = n.startColumn;
189
+ const d = n.startColumn;
190
190
  o.executeEdits("listContinuation", [
191
191
  {
192
192
  range: {
193
- startLineNumber: a,
194
- startColumn: c,
195
- endLineNumber: a,
196
- endColumn: c
193
+ startLineNumber: l,
194
+ startColumn: d,
195
+ endLineNumber: l,
196
+ endColumn: d
197
197
  },
198
198
  text: `
199
199
  ${s}`
200
200
  }
201
201
  ]);
202
- const g = a + 1, i = s.length + 1;
202
+ const g = l + 1, i = s.length + 1;
203
203
  o.setPosition({ lineNumber: g, column: i }), o.revealLine(g);
204
204
  return;
205
205
  }
@@ -209,301 +209,321 @@ ${s}`
209
209
  }
210
210
  });
211
211
  }
212
- function bt(e, o) {
213
- return Me() ? (Ne(e, o), !0) : !1;
212
+ function ht(e, o) {
213
+ return Ne() ? (Ee(e, o), !0) : !1;
214
214
  }
215
- const ht = typeof window < "u" && typeof document < "u";
215
+ const pt = typeof window < "u" && typeof document < "u";
216
216
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
217
- const he = () => {
217
+ const F = () => {
218
218
  };
219
- function pt(e, o) {
219
+ function Ct(e, o) {
220
220
  function t(...n) {
221
- return new Promise((a, r) => {
221
+ return new Promise((l, r) => {
222
222
  Promise.resolve(e(() => o.apply(this, n), {
223
223
  fn: o,
224
224
  thisArg: this,
225
225
  args: n
226
- })).then(a).catch(r);
226
+ })).then(l).catch(r);
227
227
  });
228
228
  }
229
- return t;
229
+ return "cancel" in e && Object.assign(t, {
230
+ cancel: e.cancel,
231
+ flush: e.flush,
232
+ isPending: e.isPending
233
+ }), t;
230
234
  }
231
- function Ct(e, o = {}) {
232
- let t, n, a = he;
233
- const r = (s) => {
234
- clearTimeout(s), a(), a = he;
235
- };
236
- let l;
237
- return (s) => {
238
- const c = P(e), g = P(o.maxWait);
239
- return t && r(t), c <= 0 || g !== void 0 && g <= 0 ? (n && (r(n), n = void 0), Promise.resolve(s())) : new Promise((i, p) => {
240
- a = o.rejectOnCancel ? p : i, l = s, g && !n && (n = setTimeout(() => {
241
- t && r(t), n = void 0, i(l());
242
- }, g)), t = setTimeout(() => {
243
- n && r(n), n = void 0, i(s());
244
- }, c);
245
- });
235
+ function vt(e, o = {}) {
236
+ let t, n, l = F, r = F;
237
+ const a = V(!1), c = (g) => {
238
+ clearTimeout(g), l(), l = F;
246
239
  };
240
+ let s;
241
+ return Object.assign((g) => {
242
+ const i = D(e), f = D(o.maxWait);
243
+ return t && c(t), i <= 0 || f !== void 0 && f <= 0 ? (n && (c(n), n = void 0), a.value = !1, Promise.resolve(g())) : (a.value = !0, new Promise((u, m) => {
244
+ l = o.rejectOnCancel ? m : u, r = u, s = g, f && !n && (n = setTimeout(() => {
245
+ t && c(t), n = void 0, a.value = !1, u(s());
246
+ }, f)), t = setTimeout(() => {
247
+ n && c(n), n = void 0, a.value = !1, u(g());
248
+ }, i);
249
+ }));
250
+ }, {
251
+ cancel: () => {
252
+ t && (c(t), t = void 0), n && (c(n), n = void 0), a.value = !1, r = F;
253
+ },
254
+ flush: () => {
255
+ if (a.value) {
256
+ t && (clearTimeout(t), t = void 0), n && (clearTimeout(n), n = void 0), a.value = !1;
257
+ const g = r;
258
+ l = F, r = F, g(s());
259
+ }
260
+ },
261
+ isPending: Me(a)
262
+ });
247
263
  }
248
- function vt(e) {
264
+ function yt(e) {
249
265
  return Array.isArray(e) ? e : [e];
250
266
  }
251
- function yt(e) {
267
+ function Lt(e) {
252
268
  return Le();
253
269
  }
254
- // @__NO_SIDE_EFFECTS__
255
- function Lt(e, o = 200, t = {}) {
256
- return pt(Ct(o, t), e);
270
+ function xt(e, o = 200, t = {}) {
271
+ return Ct(vt(o, t), e);
257
272
  }
258
- function xt(e, o = !0, t) {
259
- yt() ? q(e, t) : o ? e() : Z(e);
273
+ function kt(e, o = !0, t) {
274
+ Lt() ? Y(e, t) : o ? e() : ee(e);
260
275
  }
261
- const ke = ht ? window : void 0;
262
- function K(e) {
276
+ const ke = pt ? window : void 0;
277
+ function U(e) {
263
278
  var o;
264
- const t = P(e);
279
+ const t = D(e);
265
280
  return (o = t?.$el) !== null && o !== void 0 ? o : t;
266
281
  }
267
282
  // @__NO_SIDE_EFFECTS__
268
- function kt() {
269
- const e = z(!1), o = Le();
270
- return o && q(() => {
283
+ function wt() {
284
+ const e = V(!1), o = Le();
285
+ return o && Y(() => {
271
286
  e.value = !0;
272
287
  }, o), e;
273
288
  }
274
289
  // @__NO_SIDE_EFFECTS__
275
- function wt(e) {
276
- const o = /* @__PURE__ */ kt();
290
+ function St(e) {
291
+ const o = /* @__PURE__ */ wt();
277
292
  return M(() => (o.value, !!e()));
278
293
  }
279
- function St(e, o, t = {}) {
280
- const { window: n = ke, ...a } = t;
294
+ function It(e, o, t = {}) {
295
+ const { window: n = ke, ...l } = t;
281
296
  let r;
282
- const l = /* @__PURE__ */ wt(() => n && "ResizeObserver" in n), d = () => {
297
+ const a = /* @__PURE__ */ St(() => n && "ResizeObserver" in n), c = () => {
283
298
  r && (r.disconnect(), r = void 0);
284
- }, s = _(M(() => {
285
- const g = P(e);
286
- return Array.isArray(g) ? g.map((i) => K(i)) : [K(g)];
299
+ }, s = $(M(() => {
300
+ const g = D(e);
301
+ return Array.isArray(g) ? g.map((i) => U(i)) : [U(g)];
287
302
  }), (g) => {
288
- if (d(), l.value && n) {
303
+ if (c(), a.value && n) {
289
304
  r = new ResizeObserver(o);
290
- for (const i of g) i && r.observe(i, a);
305
+ for (const i of g) i && r.observe(i, l);
291
306
  }
292
307
  }, {
293
308
  immediate: !0,
294
309
  flush: "post"
295
- }), c = () => {
296
- d(), s();
310
+ }), d = () => {
311
+ c(), s();
297
312
  };
298
- return bt(c), {
299
- isSupported: l,
300
- stop: c
313
+ return ht(d), {
314
+ isSupported: a,
315
+ stop: d
301
316
  };
302
317
  }
303
318
  function Q(e, o = {
304
319
  width: 0,
305
320
  height: 0
306
321
  }, t = {}) {
307
- const { window: n = ke, box: a = "content-box" } = t, r = M(() => {
322
+ const { window: n = ke, box: l = "content-box" } = t, r = M(() => {
308
323
  var i;
309
- return (i = K(e)) === null || i === void 0 || (i = i.namespaceURI) === null || i === void 0 ? void 0 : i.includes("svg");
310
- }), l = z(o.width), d = z(o.height), { stop: s } = St(e, ([i]) => {
311
- const p = a === "border-box" ? i.borderBoxSize : a === "content-box" ? i.contentBoxSize : i.devicePixelContentBoxSize;
324
+ return (i = U(e)) === null || i === void 0 || (i = i.namespaceURI) === null || i === void 0 ? void 0 : i.includes("svg");
325
+ }), a = V(o.width), c = V(o.height), { stop: s } = It(e, ([i]) => {
326
+ const f = l === "border-box" ? i.borderBoxSize : l === "content-box" ? i.contentBoxSize : i.devicePixelContentBoxSize;
312
327
  if (n && r.value) {
313
- const m = K(e);
314
- if (m) {
315
- const u = m.getBoundingClientRect();
316
- l.value = u.width, d.value = u.height;
328
+ const u = U(e);
329
+ if (u) {
330
+ const m = u.getBoundingClientRect();
331
+ a.value = m.width, c.value = m.height;
317
332
  }
318
- } else if (p) {
319
- const m = vt(p);
320
- l.value = m.reduce((u, { inlineSize: C }) => u + C, 0), d.value = m.reduce((u, { blockSize: C }) => u + C, 0);
333
+ } else if (f) {
334
+ const u = yt(f);
335
+ a.value = u.reduce((m, { inlineSize: p }) => m + p, 0), c.value = u.reduce((m, { blockSize: p }) => m + p, 0);
321
336
  } else
322
- l.value = i.contentRect.width, d.value = i.contentRect.height;
337
+ a.value = i.contentRect.width, c.value = i.contentRect.height;
323
338
  }, t);
324
- xt(() => {
325
- const i = K(e);
326
- i && (l.value = "offsetWidth" in i ? i.offsetWidth : o.width, d.value = "offsetHeight" in i ? i.offsetHeight : o.height);
339
+ kt(() => {
340
+ const i = U(e);
341
+ if (i && "offsetWidth" in i) if (l === "content-box" && n) {
342
+ const f = n.getComputedStyle(i), u = Number.parseFloat(f.paddingLeft) + Number.parseFloat(f.paddingRight), m = Number.parseFloat(f.paddingTop) + Number.parseFloat(f.paddingBottom), p = Number.parseFloat(f.borderLeftWidth) + Number.parseFloat(f.borderRightWidth), h = Number.parseFloat(f.borderTopWidth) + Number.parseFloat(f.borderBottomWidth);
343
+ a.value = i.offsetWidth - u - p, c.value = i.offsetHeight - m - h;
344
+ } else
345
+ a.value = i.offsetWidth, c.value = i.offsetHeight;
346
+ else i && (a.value = o.width, c.value = o.height);
327
347
  });
328
- const c = _(() => K(e), (i) => {
329
- l.value = i ? o.width : 0, d.value = i ? o.height : 0;
348
+ const d = $(() => U(e), (i) => {
349
+ a.value = i ? o.width : 0, c.value = i ? o.height : 0;
330
350
  });
331
351
  function g() {
332
- s(), c();
352
+ s(), d();
333
353
  }
334
354
  return {
335
- width: l,
336
- height: d,
355
+ width: a,
356
+ height: c,
337
357
  stop: g
338
358
  };
339
359
  }
340
- const we = de(!1);
341
- let U = null;
342
- async function It() {
343
- return U || (U = (async () => {
360
+ const we = ue(!1);
361
+ let j = null;
362
+ async function Mt() {
363
+ return j || (j = (async () => {
344
364
  try {
345
- ($.json?.jsonDefaults || $.languages.json?.jsonDefaults)?.setModeConfiguration({ tokens: !1 });
346
- const o = await et(
365
+ (R.json?.jsonDefaults || R.languages.json?.jsonDefaults)?.setModeConfiguration({ tokens: !1 });
366
+ const o = await tt(
347
367
  {
348
- themes: Object.values(nt),
349
- langs: Object.values(tt)
368
+ themes: Object.values(ot),
369
+ langs: Object.values(nt)
350
370
  }
351
371
  );
352
372
  o.getLoadedLanguages().forEach((t) => {
353
- $.languages.register({ id: t });
354
- }), Ze(o, $), we.value = !0;
373
+ R.languages.register({ id: t });
374
+ }), et(o, R), we.value = !0;
355
375
  } catch (e) {
356
- throw U = null, e;
376
+ throw j = null, e;
357
377
  }
358
- })(), U);
378
+ })(), j);
359
379
  }
360
- function Mt(e, o) {
361
- const t = z();
362
- let n, a = !1, r = !1;
363
- const l = Ee({
380
+ function Nt(e, o) {
381
+ const t = V();
382
+ let n, l = !1, r = !1;
383
+ const a = Oe({
364
384
  editorStatus: "loading",
365
385
  searchBoxIsRevealed: !1,
366
386
  hasContent: !1,
367
387
  theme: o.theme || "light",
368
388
  currentLanguage: o.language || ""
369
- }), d = (b) => {
370
- !a || !t.value || t.value.setValue(b);
371
- }, s = (b) => t.value?.updateOptions({ readOnly: b }), c = () => t.value?.focus(), g = (b) => {
372
- const f = t.value?.getModel();
373
- f && $.editor.setModelLanguage(f, b);
374
- }, i = (b) => {
389
+ }), c = (h) => {
390
+ !l || !t.value || t.value.setValue(h);
391
+ }, s = (h) => t.value?.updateOptions({ readOnly: h }), d = () => t.value?.focus(), g = (h) => {
392
+ const b = t.value?.getModel();
393
+ b && R.editor.setModelLanguage(b, h);
394
+ }, i = (h) => {
375
395
  try {
376
- if (!t.value || !b) return;
377
- t.value.focus(), t.value.trigger("keyboard", b, null);
378
- } catch (f) {
379
- console.error(`useMonacoEditor: Failed to trigger command: ${b}`, f);
396
+ if (!t.value || !h) return;
397
+ t.value.focus(), t.value.trigger("keyboard", h, null);
398
+ } catch (b) {
399
+ console.error(`useMonacoEditor: Failed to trigger command: ${h}`, b);
380
400
  }
381
- }, p = () => {
401
+ }, f = () => {
382
402
  try {
383
403
  if (!t.value) return;
384
- if (l.searchBoxIsRevealed)
404
+ if (a.searchBoxIsRevealed)
385
405
  return t.value.getContribution("editor.contrib.findController")?.closeFindWidget();
386
406
  i("actions.find");
387
- } catch (b) {
388
- console.error("useMonacoEditor: Failed to close findController.", b);
407
+ } catch (h) {
408
+ console.error("useMonacoEditor: Failed to close findController.", h);
389
409
  }
390
- }, m = /* @__PURE__ */ Lt(() => $.editor.remeasureFonts(), 200), u = (b) => {
391
- !t.value || !b?.length || b.forEach((f) => {
392
- if (!(!f.id || !f.action))
410
+ }, u = xt(() => R.editor.remeasureFonts(), 200), m = (h) => {
411
+ !t.value || !h?.length || h.forEach((b) => {
412
+ if (!(!b.id || !b.action))
393
413
  try {
394
414
  const L = {
395
- id: f.id,
396
- label: f.label || f.id,
397
- keybindings: f.keybindings ? [ut(f.keybindings)].filter((k) => k !== void 0) : void 0,
398
- contextMenuGroupId: f.showInContextMenu ? f.contextMenuGroupId || "basic" : void 0,
399
- contextMenuOrder: f.contextMenuOrder ?? 1.5,
415
+ id: b.id,
416
+ label: b.label || b.id,
417
+ keybindings: b.keybindings ? [mt(b.keybindings)].filter((k) => k !== void 0) : void 0,
418
+ contextMenuGroupId: b.showInContextMenu ? b.contextMenuGroupId || "basic" : void 0,
419
+ contextMenuOrder: b.contextMenuOrder ?? 1.5,
400
420
  run: (k) => {
401
- if (typeof f.action == "function")
402
- f.action({
421
+ if (typeof b.action == "function")
422
+ b.action({
403
423
  editor: t,
404
- editorStates: l,
405
- setContent: d,
424
+ editorStates: a,
425
+ setContent: c,
406
426
  setReadOnly: s,
407
- focus: c,
427
+ focus: d,
408
428
  setLanguage: g,
409
- remeasureFonts: m,
410
- toggleSearchWidget: p,
429
+ remeasureFonts: u,
430
+ toggleSearchWidget: f,
411
431
  triggerKeyboardCommand: i,
412
- registerActions: u
432
+ registerActions: m
413
433
  });
414
- else if (typeof f.action == "string") {
415
- const h = k.getAction(f.action);
416
- h ? h.run() : i(f.action);
434
+ else if (typeof b.action == "string") {
435
+ const C = k.getAction(b.action);
436
+ C ? C.run() : i(b.action);
417
437
  }
418
438
  }
419
439
  };
420
440
  t.value?.addAction(L);
421
441
  } catch (L) {
422
- console.error(`useMonacoEditor: Failed to register action: ${f.id}`, L);
442
+ console.error(`useMonacoEditor: Failed to register action: ${b.id}`, L);
423
443
  }
424
444
  });
425
445
  };
426
- return It(), _([we, () => P(e)], ([b, f], [, L]) => {
427
- const k = P(f), h = P(L);
428
- if (!(k instanceof HTMLElement) || !b) {
429
- a = !1;
446
+ return Mt(), $([we, () => D(e)], ([h, b], [, L]) => {
447
+ const k = D(b), C = D(L);
448
+ if (!(k instanceof HTMLElement) || !h) {
449
+ l = !1;
430
450
  return;
431
451
  }
432
- if (!(a && h === k)) {
452
+ if (!(l && C === k)) {
433
453
  if (n)
434
454
  n.setValue(o.code.value);
435
455
  else {
436
- const x = $.Uri.parse(`inmemory://model/${o.language}-${crypto.randomUUID()}`);
437
- n = $.editor.createModel(o.code.value, o.language, x);
456
+ const x = R.Uri.parse(`inmemory://model/${o.language}-${crypto.randomUUID()}`);
457
+ n = R.editor.createModel(o.code.value, o.language, x);
438
458
  }
439
- t.value = $.editor.create(k, {
440
- ...ee,
459
+ t.value = R.editor.create(k, {
460
+ ...te,
441
461
  readOnly: o.readOnly || !1,
442
462
  language: o.language,
443
- theme: l.theme === "light" ? "catppuccin-latte" : "material-theme-darker",
463
+ theme: a.theme === "light" ? "catppuccin-latte" : "material-theme-darker",
444
464
  model: n,
445
465
  editContext: !1,
446
466
  ...o.monacoOptions
447
- }), a = !0, l.editorStatus = "ready", l.hasContent = !!o.code.value, l.currentLanguage = n.getLanguageId(), n.onDidChangeLanguage((x) => {
448
- l.currentLanguage = x.newLanguage;
467
+ }), l = !0, a.editorStatus = "ready", a.hasContent = !!o.code.value, a.currentLanguage = n.getLanguageId(), n.onDidChangeLanguage((x) => {
468
+ a.currentLanguage = x.newLanguage;
449
469
  }), t.value.onDidChangeModelContent(() => {
450
470
  if (r) return;
451
471
  const x = t.value.getValue();
452
- l.hasContent = !!x.length, o.code.value = x;
453
- }), o.actions?.length && u(o.actions), ft(t.value), o.onReady?.(t.value), m();
472
+ a.hasContent = !!x.length, o.code.value = x;
473
+ }), o.actions?.length && m(o.actions), bt(t.value), o.onReady?.(t.value), u();
454
474
  try {
455
475
  const A = t.value.getContribution("editor.contrib.findController")?.getState();
456
476
  A?.onFindReplaceStateChange(() => {
457
- l.searchBoxIsRevealed = A.isRevealed;
477
+ a.searchBoxIsRevealed = A.isRevealed;
458
478
  });
459
479
  } catch (x) {
460
480
  console.error("useMonacoEditor: Failed to get the state of findController", x);
461
481
  }
462
- Te(() => {
482
+ Re(() => {
463
483
  t.value?.dispose();
464
484
  });
465
485
  }
466
486
  }, {
467
487
  immediate: !0,
468
488
  flush: "post"
469
- }), _(o.code, (b) => {
470
- if (!t.value || !n || !a) return;
471
- const f = n.getValue();
472
- b !== f && (r = !0, t.value.executeEdits("external", [
489
+ }), $(o.code, (h) => {
490
+ if (!t.value || !n || !l) return;
491
+ const b = n.getValue();
492
+ h !== b && (r = !0, t.value.executeEdits("external", [
473
493
  {
474
494
  range: n.getFullModelRange(),
475
- text: b
495
+ text: h
476
496
  }
477
- ]), t.value.pushUndoStop(), l.hasContent = !!b.length, r = !1);
478
- }), q(m), Oe(m), Ae(() => {
497
+ ]), t.value.pushUndoStop(), a.hasContent = !!h.length, r = !1);
498
+ }), Y(u), Ae(u), Te(() => {
479
499
  if (!t.value) return;
480
- const b = t.value.getModel();
481
- t.value.dispose(), b && b.dispose();
500
+ const h = t.value.getModel();
501
+ t.value.dispose(), h && h.dispose();
482
502
  }), {
483
503
  editor: t,
484
- editorStates: l,
485
- setContent: d,
504
+ editorStates: a,
505
+ setContent: c,
486
506
  setReadOnly: s,
487
- focus: c,
507
+ focus: d,
488
508
  setLanguage: g,
489
- remeasureFonts: m,
490
- registerActions: u,
491
- toggleSearchWidget: p,
509
+ remeasureFonts: u,
510
+ registerActions: m,
511
+ toggleSearchWidget: f,
492
512
  triggerKeyboardCommand: i
493
513
  };
494
514
  }
495
- const Nt = { labels: { action_search: "Search", action_bold: "Bold", action_italic: "Italic", action_strikethrough: "Strikethrough", action_inline_code: "Code", action_link: "Link", action_image: "Image", action_unordered_list: "Unordered list", action_ordered_list: "Ordered list", action_task_list: "Task list", action_codeblock: "Code block", action_blockquote: "Blockquote", action_table: "Table", action_search_label: "Search document", action_format: "Format", action_format_label: "Format document", action_fullscreen: "Full Screen", action_fullscreen_label: "Toggle full screen mode", action_more: "More", key: "Key: {key}" }, messages: { empty_message: "The editor is currently empty. Start typing to add content.", empty_title: "No content available", loading_message: "Please wait while the {type} content is loaded.", loading_title: "{type} editor" } }, Et = {
496
- editor: Nt
515
+ const Et = { labels: { action_search: "Search", action_bold: "Bold", action_italic: "Italic", action_strikethrough: "Strikethrough", action_inline_code: "Code", action_link: "Link", action_image: "Image", action_unordered_list: "Unordered list", action_ordered_list: "Ordered list", action_task_list: "Task list", action_codeblock: "Code block", action_blockquote: "Blockquote", action_table: "Table", action_search_label: "Search document", action_format: "Format", action_format_label: "Format document", action_fullscreen: "Full Screen", action_fullscreen_label: "Toggle full screen mode", action_more: "More", key: "Key: {key}" }, messages: { empty_message: "The editor is currently empty. Start typing to add content.", empty_title: "No content available", loading_message: "Please wait while the {type} content is loaded.", loading_title: "{type} editor" } }, Ot = {
516
+ editor: Et
497
517
  };
498
- function ae() {
499
- const e = ot("en-us", Et);
518
+ function le() {
519
+ const e = rt("en-us", Ot);
500
520
  return {
501
521
  i18n: e,
502
- i18nT: rt(e)
522
+ i18nT: it(e)
503
523
  // Translation component <i18n-t>
504
524
  };
505
525
  }
506
- const Ot = /* @__PURE__ */ ie({
526
+ const At = /* @__PURE__ */ ae({
507
527
  __name: "MonacoEditorStatusOverlay",
508
528
  props: {
509
529
  title: {},
@@ -512,31 +532,31 @@ const Ot = /* @__PURE__ */ ie({
512
532
  },
513
533
  setup(e) {
514
534
  return (o, t) => {
515
- const n = H("KEmptyState");
535
+ const n = q("KEmptyState");
516
536
  return v(), N(n, {
517
537
  class: "monaco-editor-status-overlay",
518
538
  message: e.message,
519
539
  title: e.title
520
- }, ue({ _: 2 }, [
540
+ }, me({ _: 2 }, [
521
541
  e.icon ? {
522
542
  name: "icon",
523
543
  fn: O(() => [
524
- (v(), N(me(e.icon), { decorative: "" }))
544
+ (v(), N(ge(e.icon), { decorative: "" }))
525
545
  ]),
526
546
  key: "0"
527
547
  } : void 0
528
548
  ]), 1032, ["message", "title"]);
529
549
  };
530
550
  }
531
- }), le = (e, o) => {
551
+ }), se = (e, o) => {
532
552
  const t = e.__vccOpts || e;
533
- for (const [n, a] of o)
534
- t[n] = a;
553
+ for (const [n, l] of o)
554
+ t[n] = l;
535
555
  return t;
536
- }, pe = /* @__PURE__ */ le(Ot, [["__scopeId", "data-v-062eadb5"]]), At = {
556
+ }, pe = /* @__PURE__ */ se(At, [["__scopeId", "data-v-062eadb5"]]), Tt = {
537
557
  key: 0,
538
558
  class: "keys"
539
- }, Tt = ["aria-label", "data-testid", "textContent"], $t = /* @__PURE__ */ ie({
559
+ }, Rt = ["aria-label", "data-testid", "textContent"], $t = /* @__PURE__ */ ae({
540
560
  __name: "ToolbarActionButton",
541
561
  props: {
542
562
  item: {},
@@ -544,8 +564,8 @@ const Ot = /* @__PURE__ */ ie({
544
564
  placement: { default: "bottom-end" }
545
565
  },
546
566
  setup(e) {
547
- const { i18n: o } = ae(), t = M(() => !!e.item.keybindings?.length), n = de(!1), a = (d) => {
548
- const s = d.toLowerCase();
567
+ const { i18n: o } = le(), t = M(() => !!e.item.keybindings?.length), n = ue(!1), l = (c) => {
568
+ const s = c.toLowerCase();
549
569
  return {
550
570
  command: n.value ? "Command" : "Ctrl",
551
571
  cmd: n.value ? "Command" : "Ctrl",
@@ -555,21 +575,21 @@ const Ot = /* @__PURE__ */ ie({
555
575
  option: n.value ? "Option" : "Alt",
556
576
  opt: n.value ? "Option" : "Alt",
557
577
  alt: "Alt"
558
- }[s] || d.toUpperCase();
559
- }, r = (d) => ["command", "cmd", "ctrl", "control", "shift", "option", "opt", "alt"].includes(d.toLowerCase()), l = (d) => {
560
- const s = d.toLowerCase();
578
+ }[s] || c.toUpperCase();
579
+ }, r = (c) => ["command", "cmd", "ctrl", "control", "shift", "option", "opt", "alt"].includes(c.toLowerCase()), a = (c) => {
580
+ const s = c.toLowerCase();
561
581
  return ["command", "cmd", "ctrl", "control"].includes(s) ? "meta-key" : s === "shift" ? "shift-key" : ["option", "opt", "alt"].includes(s) ? "option-key" : "";
562
582
  };
563
- return q(() => {
583
+ return Y(() => {
564
584
  n.value = /Mac|iPhone|iPod|iPad/i.test(navigator?.platform) || /macOS|Mac|iPhone|iPod|iPad/i.test(navigator?.userAgentData?.platform);
565
- }), (d, s) => {
566
- const c = H("KButton"), g = H("KTooltip");
585
+ }), (c, s) => {
586
+ const d = q("KButton"), g = q("KTooltip");
567
587
  return v(), N(g, {
568
588
  "data-testid": `editor-toolbar-mdc-action-${e.item.id}-tooltip`,
569
589
  placement: e.placement
570
- }, ue({
590
+ }, me({
571
591
  default: O(() => [
572
- oe(c, {
592
+ re(d, {
573
593
  appearance: "none",
574
594
  "aria-label": e.item.ariaLabel || e.item.label,
575
595
  class: "toolbar-action-button",
@@ -579,7 +599,7 @@ const Ot = /* @__PURE__ */ ie({
579
599
  onClick: e.item.action
580
600
  }, {
581
601
  default: O(() => [
582
- (v(), N(me(e.item.icon), { decorative: "" }))
602
+ (v(), N(ge(e.item.icon), { decorative: "" }))
583
603
  ]),
584
604
  _: 1
585
605
  }, 8, ["aria-label", "data-testid", "disabled", "onClick"])
@@ -589,20 +609,20 @@ const Ot = /* @__PURE__ */ ie({
589
609
  e.item.label ? {
590
610
  name: "content",
591
611
  fn: O(() => [
592
- F("div", {
593
- class: re(["shortcut-text", { "has-keys": t.value }])
594
- }, ce(e.item.label), 3),
595
- t.value ? (v(), I("div", At, [
596
- (v(!0), I(R, null, B(e.item.keybindings, (i) => (v(), I("kbd", {
612
+ K("div", {
613
+ class: ie(["shortcut-text", { "has-keys": t.value }])
614
+ }, de(e.item.label), 3),
615
+ t.value ? (v(), I("div", Tt, [
616
+ (v(!0), I(_, null, B(e.item.keybindings, (i) => (v(), I("kbd", {
597
617
  key: i,
598
- "aria-label": S(o).t("editor.labels.key", { key: a(i) }),
599
- class: re([
618
+ "aria-label": S(o).t("editor.labels.key", { key: l(i) }),
619
+ class: ie([
600
620
  { mac: n.value },
601
- l(i)
621
+ a(i)
602
622
  ]),
603
- "data-testid": `editor-toolbar-mdc-${r(i) ? l(i) : `${i.toLowerCase()}-key`}`,
604
- textContent: ce(r(i) ? "" : i)
605
- }, null, 10, Tt))), 128))
623
+ "data-testid": `editor-toolbar-mdc-${r(i) ? a(i) : `${i.toLowerCase()}-key`}`,
624
+ textContent: de(r(i) ? "" : i)
625
+ }, null, 10, Rt))), 128))
606
626
  ])) : G("", !0)
607
627
  ]),
608
628
  key: "0"
@@ -610,243 +630,243 @@ const Ot = /* @__PURE__ */ ie({
610
630
  ]), 1032, ["data-testid", "placement"]);
611
631
  };
612
632
  }
613
- }), X = /* @__PURE__ */ le($t, [["__scopeId", "data-v-c588b09b"]]);
614
- function te(e, o) {
633
+ }), Z = /* @__PURE__ */ se($t, [["__scopeId", "data-v-c588b09b"]]);
634
+ function ne(e, o) {
615
635
  return (t) => {
616
636
  const n = t.editor.value;
617
637
  if (!n) return;
618
- const a = n.getSelection(), r = n.getModel();
619
- if (!a || !r) return;
620
- const l = e.length, d = a.isEmpty(), s = a.startLineNumber, c = a.startColumn, g = a.endLineNumber, i = a.endColumn;
621
- if (!d) {
622
- const L = r.getValueInRange(a), k = {
638
+ const l = n.getSelection(), r = n.getModel();
639
+ if (!l || !r) return;
640
+ const a = e.length, c = l.isEmpty(), s = l.startLineNumber, d = l.startColumn, g = l.endLineNumber, i = l.endColumn;
641
+ if (!c) {
642
+ const L = r.getValueInRange(l), k = {
623
643
  startLineNumber: s,
624
- startColumn: Math.max(1, c - l),
644
+ startColumn: Math.max(1, d - a),
625
645
  endLineNumber: s,
626
- endColumn: c
627
- }, h = {
646
+ endColumn: d
647
+ }, C = {
628
648
  startLineNumber: g,
629
649
  startColumn: i,
630
650
  endLineNumber: g,
631
- endColumn: i + l
651
+ endColumn: i + a
632
652
  };
633
- r.getValueInRange(k) === e && r.getValueInRange(h) === e ? (n.executeEdits(o, [
634
- { range: h, text: "" },
653
+ r.getValueInRange(k) === e && r.getValueInRange(C) === e ? (n.executeEdits(o, [
654
+ { range: C, text: "" },
635
655
  { range: k, text: "" }
636
656
  ]), n.setSelection({
637
657
  startLineNumber: s,
638
- startColumn: c - l,
658
+ startColumn: d - a,
639
659
  endLineNumber: g,
640
- endColumn: i - l
660
+ endColumn: i - a
641
661
  })) : (n.executeEdits(o, [
642
- { range: a, text: `${e}${L}${e}` }
662
+ { range: l, text: `${e}${L}${e}` }
643
663
  ]), n.setSelection({
644
664
  startLineNumber: s,
645
- startColumn: c + l,
665
+ startColumn: d + a,
646
666
  endLineNumber: g,
647
- endColumn: i + l
667
+ endColumn: i + a
648
668
  })), n.focus();
649
669
  return;
650
670
  }
651
- const p = r.getLineContent(s), m = p.slice(0, c - 1), u = p.slice(c - 1), C = m.lastIndexOf(e), b = u.indexOf(e);
652
- if (C !== -1 && b !== -1) {
653
- const L = C + 1, k = c + b, h = {
671
+ const f = r.getLineContent(s), u = f.slice(0, d - 1), m = f.slice(d - 1), p = u.lastIndexOf(e), h = m.indexOf(e);
672
+ if (p !== -1 && h !== -1) {
673
+ const L = p + 1, k = d + h, C = {
654
674
  startLineNumber: s,
655
675
  startColumn: L,
656
676
  endLineNumber: s,
657
- endColumn: L + l
677
+ endColumn: L + a
658
678
  }, x = {
659
679
  startLineNumber: s,
660
680
  startColumn: k,
661
681
  endLineNumber: s,
662
- endColumn: k + l
682
+ endColumn: k + a
663
683
  };
664
684
  n.executeEdits(o, [
665
685
  { range: x, text: "" },
666
- { range: h, text: "" }
686
+ { range: C, text: "" }
667
687
  ]), n.setPosition({
668
688
  lineNumber: s,
669
- column: c - l
689
+ column: d - a
670
690
  });
671
691
  } else
672
692
  n.executeEdits(o, [
673
693
  {
674
- range: a,
694
+ range: l,
675
695
  text: `${e}${e}`
676
696
  }
677
697
  ]), n.setPosition({
678
698
  lineNumber: s,
679
- column: c + l
699
+ column: d + a
680
700
  });
681
701
  n.focus();
682
702
  };
683
703
  }
684
704
  function Ce(e, o, t, n) {
685
- return (a) => {
686
- const r = a.editor.value;
705
+ return (l) => {
706
+ const r = l.editor.value;
687
707
  if (!r) return;
688
- const l = r.getSelection(), d = r.getModel();
689
- if (!l || !d) return;
690
- const s = e.length, c = o.length, g = l.isEmpty(), i = l.startLineNumber, p = l.startColumn, m = l.endLineNumber, u = l.endColumn;
708
+ const a = r.getSelection(), c = r.getModel();
709
+ if (!a || !c) return;
710
+ const s = e.length, d = o.length, g = a.isEmpty(), i = a.startLineNumber, f = a.startColumn, u = a.endLineNumber, m = a.endColumn;
691
711
  if (!g) {
692
- const b = d.getValueInRange(l);
693
- if (i === m) {
694
- const h = d.getLineContent(i), x = h.substring(0, p - 1), A = h.substring(u - 1);
712
+ const h = c.getValueInRange(a);
713
+ if (i === u) {
714
+ const C = c.getLineContent(i), x = C.substring(0, f - 1), A = C.substring(m - 1);
695
715
  if (x.endsWith("](") && A.startsWith(")")) {
696
- const D = x.length - 2, w = h.substring(0, D), E = w.lastIndexOf(e);
716
+ const P = x.length - 2, w = C.substring(0, P), E = w.lastIndexOf(e);
697
717
  if (E !== -1) {
698
- const y = w.substring(E + s), Y = E + 1, Ie = u + 1;
718
+ const y = w.substring(E + s), X = E + 1, Ie = m + 1;
699
719
  r.executeEdits(t, [{
700
720
  range: {
701
721
  startLineNumber: i,
702
- startColumn: Y,
722
+ startColumn: X,
703
723
  endLineNumber: i,
704
724
  endColumn: Ie
705
725
  },
706
726
  text: y
707
727
  }]), y ? r.setSelection({
708
728
  startLineNumber: i,
709
- startColumn: Y,
729
+ startColumn: X,
710
730
  endLineNumber: i,
711
- endColumn: Y + y.length
731
+ endColumn: X + y.length
712
732
  }) : r.setPosition({
713
733
  lineNumber: i,
714
- column: Y
734
+ column: X
715
735
  }), r.focus();
716
736
  return;
717
737
  }
718
738
  }
719
739
  }
720
- const f = {
740
+ const b = {
721
741
  startLineNumber: i,
722
- startColumn: Math.max(1, p - s),
742
+ startColumn: Math.max(1, f - s),
723
743
  endLineNumber: i,
724
- endColumn: p
744
+ endColumn: f
725
745
  }, L = {
726
- startLineNumber: m,
727
- startColumn: u,
728
- endLineNumber: m,
729
- endColumn: u + c
746
+ startLineNumber: u,
747
+ startColumn: m,
748
+ endLineNumber: u,
749
+ endColumn: m + d
730
750
  };
731
- if (d.getValueInRange(f) === e && d.getValueInRange(L) === o) {
732
- const h = {
751
+ if (c.getValueInRange(b) === e && c.getValueInRange(L) === o) {
752
+ const C = {
733
753
  startLineNumber: i,
734
- startColumn: p - s,
735
- endLineNumber: m,
736
- endColumn: u + c
754
+ startColumn: f - s,
755
+ endLineNumber: u,
756
+ endColumn: m + d
737
757
  };
738
758
  r.executeEdits(t, [
739
- { range: h, text: "" }
759
+ { range: C, text: "" }
740
760
  ]), r.setPosition({
741
761
  lineNumber: i,
742
- column: p - s
762
+ column: f - s
743
763
  });
744
764
  } else {
745
765
  r.executeEdits(t, [
746
- { range: l, text: `${e}${b}${o}` }
766
+ { range: a, text: `${e}${h}${o}` }
747
767
  ]);
748
- const h = o.indexOf(n);
749
- if (h !== -1 && n && i === m) {
750
- const x = u + s + h;
768
+ const C = o.indexOf(n);
769
+ if (C !== -1 && n && i === u) {
770
+ const x = m + s + C;
751
771
  r.setSelection({
752
- startLineNumber: m,
772
+ startLineNumber: u,
753
773
  startColumn: x,
754
- endLineNumber: m,
774
+ endLineNumber: u,
755
775
  endColumn: x + n.length
756
776
  });
757
777
  } else
758
778
  r.setSelection({
759
779
  startLineNumber: i,
760
- startColumn: p + s,
761
- endLineNumber: m,
762
- endColumn: u + s
780
+ startColumn: f + s,
781
+ endLineNumber: u,
782
+ endColumn: m + s
763
783
  });
764
784
  }
765
785
  r.focus();
766
786
  return;
767
787
  }
768
- const C = t;
788
+ const p = t;
769
789
  r.executeEdits(t, [
770
790
  {
771
- range: l,
772
- text: `${e}${C}${o}`
791
+ range: a,
792
+ text: `${e}${p}${o}`
773
793
  }
774
794
  ]), r.setSelection({
775
795
  startLineNumber: i,
776
- startColumn: p + s,
796
+ startColumn: f + s,
777
797
  endLineNumber: i,
778
- endColumn: p + s + C.length
798
+ endColumn: f + s + p.length
779
799
  }), r.focus();
780
800
  };
781
801
  }
782
- function ne(e, o, t) {
783
- const n = typeof e == "string" ? () => e : e, a = t ?? (typeof e == "string" ? new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`) : null);
802
+ function oe(e, o, t) {
803
+ const n = typeof e == "string" ? () => e : e, l = t ?? (typeof e == "string" ? new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`) : null);
784
804
  return (r) => {
785
- const l = r.editor.value;
786
- if (!l) return;
787
- const d = l.getSelection(), s = l.getModel();
788
- if (!d || !s) return;
789
- const c = d.startLineNumber, g = d.endLineNumber, i = [];
790
- for (let u = c; u <= g; u++)
791
- i.push(s.getLineContent(u));
792
- const p = i.every((u) => a ? a.test(u) : /^\d+\.\s/.test(u) || u.startsWith(n(1))), m = [];
793
- if (p)
794
- for (let u = i.length - 1; u >= 0; u--) {
795
- const C = c + u, b = i[u];
796
- let f = 0;
797
- if (a) {
798
- const L = b.match(a);
799
- L && (f = L[0].length);
805
+ const a = r.editor.value;
806
+ if (!a) return;
807
+ const c = a.getSelection(), s = a.getModel();
808
+ if (!c || !s) return;
809
+ const d = c.startLineNumber, g = c.endLineNumber, i = [];
810
+ for (let m = d; m <= g; m++)
811
+ i.push(s.getLineContent(m));
812
+ const f = i.every((m) => l ? l.test(m) : /^\d+\.\s/.test(m) || m.startsWith(n(1))), u = [];
813
+ if (f)
814
+ for (let m = i.length - 1; m >= 0; m--) {
815
+ const p = d + m, h = i[m];
816
+ let b = 0;
817
+ if (l) {
818
+ const L = h.match(l);
819
+ L && (b = L[0].length);
800
820
  } else {
801
- const L = n(u + 1);
802
- b.startsWith(L) && (f = L.length);
821
+ const L = n(m + 1);
822
+ h.startsWith(L) && (b = L.length);
803
823
  }
804
- f > 0 && m.push({
824
+ b > 0 && u.push({
805
825
  range: {
806
- startLineNumber: C,
826
+ startLineNumber: p,
807
827
  startColumn: 1,
808
- endLineNumber: C,
809
- endColumn: 1 + f
828
+ endLineNumber: p,
829
+ endColumn: 1 + b
810
830
  },
811
831
  text: ""
812
832
  });
813
833
  }
814
834
  else
815
- for (let u = i.length - 1; u >= 0; u--) {
816
- const C = c + u, b = i[u];
817
- if (!(a ? a.test(b) : b.startsWith(n(u + 1)))) {
818
- const L = n(u + 1);
819
- m.push({
835
+ for (let m = i.length - 1; m >= 0; m--) {
836
+ const p = d + m, h = i[m];
837
+ if (!(l ? l.test(h) : h.startsWith(n(m + 1)))) {
838
+ const L = n(m + 1);
839
+ u.push({
820
840
  range: {
821
- startLineNumber: C,
841
+ startLineNumber: p,
822
842
  startColumn: 1,
823
- endLineNumber: C,
843
+ endLineNumber: p,
824
844
  endColumn: 1
825
845
  },
826
846
  text: L
827
847
  });
828
848
  }
829
849
  }
830
- m.length > 0 && l.executeEdits(o, m), l.focus();
850
+ u.length > 0 && a.executeEdits(o, u), a.focus();
831
851
  };
832
852
  }
833
853
  function _t(e) {
834
854
  return (o) => {
835
855
  const t = o.editor.value;
836
856
  if (!t) return;
837
- const n = t.getSelection(), a = t.getModel();
838
- if (!n || !a) return;
839
- const r = n.startLineNumber, l = n.endLineNumber, d = n.isEmpty();
840
- if (!Se(a, r, l)) {
841
- for (let s = r; s <= l; s++)
842
- if (a.getLineContent(s).includes("```")) return;
843
- if (d) {
844
- const c = a.getValueInRange({
857
+ const n = t.getSelection(), l = t.getModel();
858
+ if (!n || !l) return;
859
+ const r = n.startLineNumber, a = n.endLineNumber, c = n.isEmpty();
860
+ if (!Se(l, r, a)) {
861
+ for (let s = r; s <= a; s++)
862
+ if (l.getLineContent(s).includes("```")) return;
863
+ if (c) {
864
+ const d = l.getValueInRange({
845
865
  startLineNumber: r,
846
866
  startColumn: 1,
847
867
  endLineNumber: r,
848
868
  endColumn: n.startColumn
849
- }).trim().length > 0, g = c ? `
869
+ }).trim().length > 0, g = d ? `
850
870
  ` : "";
851
871
  t.executeEdits(e, [
852
872
  {
@@ -856,7 +876,7 @@ function _t(e) {
856
876
  \`\`\``
857
877
  }
858
878
  ]);
859
- const i = c ? r + 1 : r;
879
+ const i = d ? r + 1 : r;
860
880
  t.setSelection({
861
881
  startLineNumber: i,
862
882
  startColumn: 4,
@@ -865,15 +885,15 @@ function _t(e) {
865
885
  endColumn: 12
866
886
  });
867
887
  } else {
868
- const s = r > 1 ? a.getLineContent(r - 1) : "", c = l < a.getLineCount() ? a.getLineContent(l + 1) : "";
869
- if (s.trimEnd().startsWith("```") && c.trimEnd() === "```")
888
+ const s = r > 1 ? l.getLineContent(r - 1) : "", d = a < l.getLineCount() ? l.getLineContent(a + 1) : "";
889
+ if (s.trimEnd().startsWith("```") && d.trimEnd() === "```")
870
890
  t.executeEdits(e, [
871
891
  {
872
892
  range: {
873
- startLineNumber: l + 1,
893
+ startLineNumber: a + 1,
874
894
  startColumn: 1,
875
- endLineNumber: l + 1,
876
- endColumn: a.getLineContent(l + 1).length + 1
895
+ endLineNumber: a + 1,
896
+ endColumn: l.getLineContent(a + 1).length + 1
877
897
  },
878
898
  text: null
879
899
  },
@@ -882,35 +902,35 @@ function _t(e) {
882
902
  startLineNumber: r - 1,
883
903
  startColumn: 1,
884
904
  endLineNumber: r - 1,
885
- endColumn: a.getLineContent(r - 1).length + 1
905
+ endColumn: l.getLineContent(r - 1).length + 1
886
906
  },
887
907
  text: null
888
908
  }
889
909
  ]), t.setSelection({
890
910
  startLineNumber: r - 1,
891
911
  startColumn: 1,
892
- endLineNumber: l - 1,
893
- endColumn: a.getLineContent(l - 1).length + 1
912
+ endLineNumber: a - 1,
913
+ endColumn: l.getLineContent(a - 1).length + 1
894
914
  });
895
915
  else {
896
- const i = a.getValueInRange(n), m = a.getValueInRange({
916
+ const i = l.getValueInRange(n), u = l.getValueInRange({
897
917
  startLineNumber: r,
898
918
  startColumn: 1,
899
919
  endLineNumber: r,
900
920
  endColumn: n.startColumn
901
- }).trim().length > 0, u = m ? `
921
+ }).trim().length > 0, m = u ? `
902
922
  ` : "";
903
923
  t.executeEdits(e, [
904
- { range: n, text: `${u}\`\`\`markdown
924
+ { range: n, text: `${m}\`\`\`markdown
905
925
  ${i}
906
926
  \`\`\`` }
907
927
  ]);
908
- const C = m ? r + 1 : r;
928
+ const p = u ? r + 1 : r;
909
929
  t.setSelection({
910
- startLineNumber: C,
930
+ startLineNumber: p,
911
931
  startColumn: 4,
912
932
  // after ```
913
- endLineNumber: C,
933
+ endLineNumber: p,
914
934
  endColumn: 12
915
935
  });
916
936
  }
@@ -919,15 +939,15 @@ ${i}
919
939
  }
920
940
  };
921
941
  }
922
- function Rt(e) {
942
+ function Bt(e) {
923
943
  return (o) => {
924
944
  const t = o.editor.value;
925
945
  if (!t) return;
926
- const n = t.getSelection(), a = t.getModel();
927
- if (!n || !a) return;
928
- const r = n.startLineNumber, l = n.endLineNumber;
929
- if (Se(a, r, l)) return;
930
- const d = [
946
+ const n = t.getSelection(), l = t.getModel();
947
+ if (!n || !l) return;
948
+ const r = n.startLineNumber, a = n.endLineNumber;
949
+ if (Se(l, r, a)) return;
950
+ const c = [
931
951
  "| Header | Header | Header |",
932
952
  "| ------ | ------ | ------ |",
933
953
  "| Cell | Cell | Cell |",
@@ -935,7 +955,7 @@ function Rt(e) {
935
955
  ].join(`
936
956
  `);
937
957
  t.executeEdits(e, [
938
- { range: n, text: d + `
958
+ { range: n, text: c + `
939
959
  ` }
940
960
  ]);
941
961
  const s = r + 4;
@@ -946,16 +966,16 @@ function Rt(e) {
946
966
  };
947
967
  }
948
968
  function Se(e, o, t) {
949
- let n = 0, a = 0;
969
+ let n = 0, l = 0;
950
970
  for (let r = o - 1; r >= 1; r--)
951
- e.getLineContent(r).trimEnd().startsWith("```") && (a++, a % 2 === 1 && (n = r));
971
+ e.getLineContent(r).trimEnd().startsWith("```") && (l++, l % 2 === 1 && (n = r));
952
972
  if (n === 0) return !1;
953
973
  for (let r = t + 1; r <= e.getLineCount(); r++)
954
974
  if (e.getLineContent(r).trimEnd().startsWith("```"))
955
975
  return !0;
956
976
  return !1;
957
977
  }
958
- const Bt = {
978
+ const Wt = {
959
979
  format: {
960
980
  id: "editor.action.format",
961
981
  icon: Ge,
@@ -971,9 +991,9 @@ const Bt = {
971
991
  },
972
992
  bold: {
973
993
  id: "editor.action.bold",
974
- icon: Pe,
994
+ icon: Fe,
975
995
  label: "editor.labels.action_bold",
976
- action: te("**", "bold"),
996
+ action: ne("**", "bold"),
977
997
  keybindings: ["Command", "B"],
978
998
  placement: "left",
979
999
  group: 2,
@@ -987,7 +1007,7 @@ const Bt = {
987
1007
  id: "editor.action.italic",
988
1008
  icon: De,
989
1009
  label: "editor.labels.action_italic",
990
- action: te("_", "italic"),
1010
+ action: ne("_", "italic"),
991
1011
  keybindings: ["Command", "I"],
992
1012
  placement: "left",
993
1013
  group: 2,
@@ -999,9 +1019,9 @@ const Bt = {
999
1019
  },
1000
1020
  strikethrough: {
1001
1021
  id: "editor.action.strikethrough",
1002
- icon: We,
1022
+ icon: Pe,
1003
1023
  label: "editor.labels.action_strikethrough",
1004
- action: te("~~", "strikethrough"),
1024
+ action: ne("~~", "strikethrough"),
1005
1025
  keybindings: ["Command", "Shift", "X"],
1006
1026
  placement: "left",
1007
1027
  group: 2,
@@ -1011,12 +1031,12 @@ const Bt = {
1011
1031
  contextMenuOrder: 4,
1012
1032
  languages: ["markdown", "mdc"]
1013
1033
  }
1014
- }, Wt = {
1034
+ }, Pt = {
1015
1035
  inlineCode: {
1016
1036
  id: "editor.action.inlineCode",
1017
- icon: Ue,
1037
+ icon: Ve,
1018
1038
  label: "editor.labels.action_inline_code",
1019
- action: te("`", "inlineCode"),
1039
+ action: ne("`", "inlineCode"),
1020
1040
  keybindings: ["Command", "E"],
1021
1041
  placement: "left",
1022
1042
  group: 3,
@@ -1028,7 +1048,7 @@ const Bt = {
1028
1048
  },
1029
1049
  link: {
1030
1050
  id: "editor.action.link",
1031
- icon: Ke,
1051
+ icon: Ue,
1032
1052
  label: "editor.labels.action_link",
1033
1053
  action: Ce("[", "](url)", "link", "url"),
1034
1054
  keybindings: ["Command", "K"],
@@ -1042,7 +1062,7 @@ const Bt = {
1042
1062
  },
1043
1063
  image: {
1044
1064
  id: "editor.action.image",
1045
- icon: Fe,
1065
+ icon: Ke,
1046
1066
  label: "editor.labels.action_image",
1047
1067
  action: Ce("![", "](url)", "image", "url"),
1048
1068
  keybindings: ["Command", "Shift", "I"],
@@ -1057,9 +1077,9 @@ const Bt = {
1057
1077
  }, Dt = {
1058
1078
  unorderedList: {
1059
1079
  id: "editor.action.unorderedList",
1060
- icon: ze,
1080
+ icon: He,
1061
1081
  label: "editor.labels.action_unordered_list",
1062
- action: ne("- ", "unorderedList"),
1082
+ action: oe("- ", "unorderedList"),
1063
1083
  keybindings: [],
1064
1084
  placement: "left",
1065
1085
  group: 4,
@@ -1071,9 +1091,9 @@ const Bt = {
1071
1091
  },
1072
1092
  orderedList: {
1073
1093
  id: "editor.action.orderedList",
1074
- icon: je,
1094
+ icon: ze,
1075
1095
  label: "editor.labels.action_ordered_list",
1076
- action: ne(
1096
+ action: oe(
1077
1097
  (e) => `${e}. `,
1078
1098
  "orderedList",
1079
1099
  /^\d+\.\s/
@@ -1089,9 +1109,9 @@ const Bt = {
1089
1109
  },
1090
1110
  taskList: {
1091
1111
  id: "editor.action.taskList",
1092
- icon: Ve,
1112
+ icon: je,
1093
1113
  label: "editor.labels.action_task_list",
1094
- action: ne("- [ ] ", "taskList"),
1114
+ action: oe("- [ ] ", "taskList"),
1095
1115
  keybindings: [],
1096
1116
  placement: "left",
1097
1117
  group: 4,
@@ -1101,7 +1121,7 @@ const Bt = {
1101
1121
  contextMenuOrder: 3,
1102
1122
  languages: ["markdown", "mdc"]
1103
1123
  }
1104
- }, Pt = {
1124
+ }, Ft = {
1105
1125
  codeblock: {
1106
1126
  id: "editor.action.codeblock",
1107
1127
  icon: xe,
@@ -1118,9 +1138,9 @@ const Bt = {
1118
1138
  },
1119
1139
  blockquote: {
1120
1140
  id: "editor.action.blockquote",
1121
- icon: qe,
1141
+ icon: Ye,
1122
1142
  label: "editor.labels.action_blockquote",
1123
- action: ne("> ", "blockquote"),
1143
+ action: oe("> ", "blockquote"),
1124
1144
  keybindings: [],
1125
1145
  placement: "left",
1126
1146
  group: 5,
@@ -1132,9 +1152,9 @@ const Bt = {
1132
1152
  },
1133
1153
  table: {
1134
1154
  id: "editor.action.table",
1135
- icon: He,
1155
+ icon: qe,
1136
1156
  label: "editor.labels.action_table",
1137
- action: Rt("table"),
1157
+ action: Bt("table"),
1138
1158
  keybindings: [],
1139
1159
  placement: "left",
1140
1160
  group: 5,
@@ -1147,7 +1167,7 @@ const Bt = {
1147
1167
  }, Gt = {
1148
1168
  search: {
1149
1169
  id: "editor.action.find",
1150
- icon: Ye,
1170
+ icon: Xe,
1151
1171
  label: "editor.labels.action_search",
1152
1172
  action: (e) => e.toggleSearchWidget(),
1153
1173
  keybindings: ["Command", "F"],
@@ -1158,7 +1178,7 @@ const Bt = {
1158
1178
  contextMenuGroupId: "navigation",
1159
1179
  contextMenuOrder: 1
1160
1180
  }
1161
- }, Ft = {
1181
+ }, Kt = {
1162
1182
  fullScreen: {
1163
1183
  id: "editor.action.fullScreen",
1164
1184
  icon: Je,
@@ -1173,101 +1193,101 @@ const Bt = {
1173
1193
  contextMenuOrder: 1
1174
1194
  }
1175
1195
  }, ve = {
1176
- ...Bt,
1177
1196
  ...Wt,
1178
- ...Dt,
1179
1197
  ...Pt,
1198
+ ...Dt,
1199
+ ...Ft,
1180
1200
  ...Gt,
1181
- ...Ft
1182
- }, ye = "left", se = 100, Kt = "default";
1183
- function Ut(e, o) {
1184
- const { i18n: t } = ae(), n = e && typeof e == "object" ? e.actions ?? {} : {}, a = M(() => {
1185
- const l = [], d = S(o);
1186
- for (const [s, c] of Object.entries(ve)) {
1201
+ ...Kt
1202
+ }, ye = "left", ce = 100, Ut = "default";
1203
+ function Vt(e, o) {
1204
+ const { i18n: t } = le(), n = e && typeof e == "object" ? e.actions ?? {} : {}, l = M(() => {
1205
+ const a = [], c = S(o);
1206
+ for (const [s, d] of Object.entries(ve)) {
1187
1207
  const g = n[s];
1188
- g !== !1 && (c.languages && d && !c.languages.includes(d) || l.push({
1189
- ...c,
1190
- label: t.t(c.label),
1208
+ g !== !1 && (d.languages && c && !d.languages.includes(c) || a.push({
1209
+ ...d,
1210
+ label: t.t(d.label),
1191
1211
  ...typeof g == "object" ? g : {}
1192
1212
  }));
1193
1213
  }
1194
- for (const [s, c] of Object.entries(n)) {
1195
- if (s in ve || c === !1 || c == null) continue;
1214
+ for (const [s, d] of Object.entries(n)) {
1215
+ if (s in ve || d === !1 || d == null) continue;
1196
1216
  const g = {
1197
1217
  id: s,
1198
- label: typeof c == "object" && c.label ? c.label : s,
1218
+ label: typeof d == "object" && d.label ? d.label : s,
1199
1219
  placement: ye,
1200
- order: se
1201
- }, i = typeof c == "object" ? { ...g, ...c } : g;
1202
- i.icon && i.action && l.push(i);
1220
+ order: ce
1221
+ }, i = typeof d == "object" ? { ...g, ...d } : g;
1222
+ i.icon && i.action && a.push(i);
1203
1223
  }
1204
- return l;
1224
+ return a;
1205
1225
  });
1206
- function r(l) {
1207
- const d = /* @__PURE__ */ new Map();
1208
- return a.value.filter((s) => (s.placement ?? ye) === l).sort((s, c) => (s.order ?? se) - (c.order ?? se)).forEach((s) => {
1209
- const c = String(s.group ?? Kt);
1210
- d.has(c) || d.set(c, []), d.get(c).push(s);
1211
- }), Array.from(d.values());
1226
+ function r(a) {
1227
+ const c = /* @__PURE__ */ new Map();
1228
+ return l.value.filter((s) => (s.placement ?? ye) === a).sort((s, d) => (s.order ?? ce) - (d.order ?? ce)).forEach((s) => {
1229
+ const d = String(s.group ?? Ut);
1230
+ c.has(d) || c.set(d, []), c.get(d).push(s);
1231
+ }), Array.from(c.values());
1212
1232
  }
1213
1233
  return {
1214
- commands: a,
1234
+ commands: l,
1215
1235
  leftGroups: M(() => r("left")),
1216
1236
  centerGroups: M(() => r("center")),
1217
1237
  rightGroups: M(() => r("right"))
1218
1238
  };
1219
1239
  }
1220
- const Vt = {
1240
+ const jt = {
1221
1241
  class: "monaco-editor-ui-toolbar-action-group",
1222
1242
  "data-testid": "toolbar-overflow-group"
1223
- }, jt = 5, zt = /* @__PURE__ */ ie({
1243
+ }, zt = 5, Ht = /* @__PURE__ */ ae({
1224
1244
  __name: "MonacoEditorToolbar",
1225
1245
  props: {
1226
1246
  editor: { default: null },
1227
1247
  settings: { type: [Boolean, Object] }
1228
1248
  },
1229
1249
  setup(e) {
1230
- const { i18n: o } = ae(), t = V("toolbarEl"), n = V("leftSlotEl"), a = V("centerSlotEl"), r = V("rightSlotEl"), l = Q(t), d = Q(n), s = Q(a), c = Q(r), g = M(() => e.editor?.editorStates.currentLanguage ?? ""), { commands: i, leftGroups: p, centerGroups: m, rightGroups: u } = Ut(e.settings, g), C = z([]), b = de(0), f = [], L = M(() => p.value.slice(C.value.length).flatMap(
1231
- (h, x) => h.map((A, D) => ({
1250
+ const { i18n: o } = le(), t = z("toolbarEl"), n = z("leftSlotEl"), l = z("centerSlotEl"), r = z("rightSlotEl"), a = Q(t), c = Q(n), s = Q(l), d = Q(r), g = M(() => e.editor?.editorStates.currentLanguage ?? ""), { commands: i, leftGroups: f, centerGroups: u, rightGroups: m } = Vt(e.settings, g), p = V([]), h = ue(0), b = [], L = M(() => f.value.slice(p.value.length).flatMap(
1251
+ (C, x) => C.map((A, P) => ({
1232
1252
  ...A,
1233
- hasDivider: x > 0 && D === 0
1253
+ hasDivider: x > 0 && P === 0
1234
1254
  }))
1235
1255
  ));
1236
- _(p, (h) => {
1237
- C.value = [...h], f.length = 0;
1256
+ $(f, (C) => {
1257
+ p.value = [...C], b.length = 0;
1238
1258
  }, { immediate: !0 });
1239
1259
  function k() {
1240
- const h = t.value?.getBoundingClientRect().width ?? 0;
1241
- if (h === 0) return;
1242
- const x = n.value?.getBoundingClientRect().width ?? 0, A = a.value?.getBoundingClientRect().width ?? 0, D = r.value?.getBoundingClientRect().width ?? 0, w = x + A + D + 50;
1243
- h < w && C.value.length > 0 ? (f.push(w), C.value = C.value.slice(0, -1), b.value++, Z(k)) : f.length > 0 && C.value.length < p.value.length && h > f[f.length - 1] + jt && (f.pop(), C.value = [
1244
- ...C.value,
1245
- p.value[C.value.length]
1246
- ], Z(k));
1260
+ const C = t.value?.getBoundingClientRect().width ?? 0;
1261
+ if (C === 0) return;
1262
+ const x = n.value?.getBoundingClientRect().width ?? 0, A = l.value?.getBoundingClientRect().width ?? 0, P = r.value?.getBoundingClientRect().width ?? 0, w = x + A + P + 50;
1263
+ C < w && p.value.length > 0 ? (b.push(w), p.value = p.value.slice(0, -1), h.value++, ee(k)) : b.length > 0 && p.value.length < f.value.length && C > b[b.length - 1] + zt && (b.pop(), p.value = [
1264
+ ...p.value,
1265
+ f.value[p.value.length]
1266
+ ], ee(k));
1247
1267
  }
1248
- return _(() => e.editor?.editorStates.editorStatus, (h) => {
1249
- h === "ready" && e.editor && i.value.length > 0 && e.editor.registerActions(i.value);
1268
+ return $(() => e.editor?.editorStates.editorStatus, (C) => {
1269
+ C === "ready" && e.editor && i.value.length > 0 && e.editor.registerActions(i.value);
1250
1270
  }, {
1251
1271
  immediate: !0
1252
- }), _([l.width, d.width, s.width, c.width], k), q(async () => await Z(k)), (h, x) => {
1253
- const A = H("KDropdownItem"), D = H("KDropdown");
1272
+ }), $([a.width, c.width, s.width, d.width], k), Y(async () => await ee(k)), (C, x) => {
1273
+ const A = q("KDropdownItem"), P = q("KDropdown");
1254
1274
  return v(), I("div", {
1255
1275
  ref_key: "toolbarEl",
1256
1276
  ref: t,
1257
1277
  class: "monaco-editor-ui-toolbar",
1258
1278
  "data-testid": "monaco-editor-toolbar"
1259
1279
  }, [
1260
- F("div", {
1280
+ K("div", {
1261
1281
  ref_key: "leftSlotEl",
1262
1282
  ref: n,
1263
1283
  class: "monaco-editor-ui-toolbar-left",
1264
1284
  "data-testid": "monaco-editor-toolbar-left"
1265
1285
  }, [
1266
- (v(!0), I(R, null, B(C.value, (w, E) => (v(), I("div", {
1286
+ (v(!0), I(_, null, B(p.value, (w, E) => (v(), I("div", {
1267
1287
  key: E,
1268
1288
  class: "monaco-editor-ui-toolbar-action-group"
1269
1289
  }, [
1270
- (v(!0), I(R, null, B(w, (y) => (v(), N(X, {
1290
+ (v(!0), I(_, null, B(w, (y) => (v(), N(Z, {
1271
1291
  key: y.id,
1272
1292
  active: e.editor?.editorStates.editorStatus === "ready",
1273
1293
  item: {
@@ -1280,27 +1300,27 @@ const Vt = {
1280
1300
  placement: E === 0 ? "bottom-start" : "bottom"
1281
1301
  }, null, 8, ["active", "item", "placement"]))), 128))
1282
1302
  ]))), 128)),
1283
- $e(F("div", Vt, [
1284
- (v(), N(D, {
1285
- key: b.value,
1286
- class: re({ "is-disabled": e.editor?.editorStates.editorStatus !== "ready" })
1303
+ $e(K("div", jt, [
1304
+ (v(), N(P, {
1305
+ key: h.value,
1306
+ class: ie({ "is-disabled": e.editor?.editorStates.editorStatus !== "ready" })
1287
1307
  }, {
1288
1308
  items: O(() => [
1289
- (v(!0), I(R, null, B(L.value, (w) => (v(), N(A, {
1309
+ (v(!0), I(_, null, B(L.value, (w) => (v(), N(A, {
1290
1310
  key: w.id,
1291
1311
  "data-testid": `overflow-item-${w.id}`,
1292
1312
  "has-divider": w.hasDivider,
1293
1313
  onClick: (E) => S(J)(w, e.editor)
1294
1314
  }, {
1295
1315
  default: O(() => [
1296
- (v(), N(me(w.icon), { decorative: "" })),
1297
- _e(" " + ce(w.label), 1)
1316
+ (v(), N(ge(w.icon), { decorative: "" })),
1317
+ _e(" " + de(w.label), 1)
1298
1318
  ]),
1299
1319
  _: 2
1300
1320
  }, 1032, ["data-testid", "has-divider", "onClick"]))), 128))
1301
1321
  ]),
1302
1322
  default: O(() => [
1303
- oe(X, {
1323
+ re(Z, {
1304
1324
  active: e.editor?.editorStates.editorStatus === "ready",
1305
1325
  item: {
1306
1326
  id: "more",
@@ -1313,21 +1333,21 @@ const Vt = {
1313
1333
  _: 1
1314
1334
  }, 8, ["class"]))
1315
1335
  ], 512), [
1316
- [Re, L.value.length]
1336
+ [Be, L.value.length]
1317
1337
  ]),
1318
- W(h.$slots, "toolbar-left", {}, void 0, !0)
1338
+ W(C.$slots, "toolbar-left", {}, void 0, !0)
1319
1339
  ], 512),
1320
- F("div", {
1340
+ K("div", {
1321
1341
  ref_key: "centerSlotEl",
1322
- ref: a,
1342
+ ref: l,
1323
1343
  class: "monaco-editor-ui-toolbar-center",
1324
1344
  "data-testid": "monaco-editor-toolbar-center"
1325
1345
  }, [
1326
- (v(!0), I(R, null, B(S(m), (w, E) => (v(), I("div", {
1346
+ (v(!0), I(_, null, B(S(u), (w, E) => (v(), I("div", {
1327
1347
  key: E,
1328
1348
  class: "monaco-editor-ui-toolbar-action-group"
1329
1349
  }, [
1330
- (v(!0), I(R, null, B(w, (y) => (v(), N(X, {
1350
+ (v(!0), I(_, null, B(w, (y) => (v(), N(Z, {
1331
1351
  key: y.id,
1332
1352
  active: e.editor?.editorStates.editorStatus === "ready",
1333
1353
  item: {
@@ -1340,19 +1360,19 @@ const Vt = {
1340
1360
  placement: "bottom"
1341
1361
  }, null, 8, ["active", "item"]))), 128))
1342
1362
  ]))), 128)),
1343
- W(h.$slots, "toolbar-center", {}, void 0, !0)
1363
+ W(C.$slots, "toolbar-center", {}, void 0, !0)
1344
1364
  ], 512),
1345
- F("div", {
1365
+ K("div", {
1346
1366
  ref_key: "rightSlotEl",
1347
1367
  ref: r,
1348
1368
  class: "monaco-editor-ui-toolbar-right",
1349
1369
  "data-testid": "monaco-editor-toolbar-right"
1350
1370
  }, [
1351
- (v(!0), I(R, null, B(S(u), (w, E) => (v(), I("div", {
1371
+ (v(!0), I(_, null, B(S(m), (w, E) => (v(), I("div", {
1352
1372
  key: E,
1353
1373
  class: "monaco-editor-ui-toolbar-action-group"
1354
1374
  }, [
1355
- (v(!0), I(R, null, B(w, (y) => (v(), N(X, {
1375
+ (v(!0), I(_, null, B(w, (y) => (v(), N(Z, {
1356
1376
  key: y.id,
1357
1377
  active: e.editor?.editorStates.editorStatus === "ready",
1358
1378
  item: {
@@ -1362,17 +1382,17 @@ const Vt = {
1362
1382
  keybindings: y.keybindings,
1363
1383
  action: () => S(J)(y, e.editor)
1364
1384
  },
1365
- placement: E === S(u).length - 1 ? "bottom-end" : "bottom"
1385
+ placement: E === S(m).length - 1 ? "bottom-end" : "bottom"
1366
1386
  }, null, 8, ["active", "item", "placement"]))), 128))
1367
1387
  ]))), 128)),
1368
- W(h.$slots, "toolbar-right", {}, void 0, !0)
1388
+ W(C.$slots, "toolbar-right", {}, void 0, !0)
1369
1389
  ], 512)
1370
1390
  ], 512);
1371
1391
  };
1372
1392
  }
1373
- }), Ht = /* @__PURE__ */ le(zt, [["__scopeId", "data-v-b6dd2107"]]), qt = /* @__PURE__ */ ie({
1393
+ }), qt = /* @__PURE__ */ se(Ht, [["__scopeId", "data-v-b6dd2107"]]), Yt = /* @__PURE__ */ ae({
1374
1394
  __name: "MonacoEditor",
1375
- props: /* @__PURE__ */ fe({
1395
+ props: /* @__PURE__ */ be({
1376
1396
  appearance: { default: "embedded" },
1377
1397
  theme: { default: "light" },
1378
1398
  language: { default: "markdown" },
@@ -1389,11 +1409,11 @@ const Vt = {
1389
1409
  },
1390
1410
  modelModifiers: {}
1391
1411
  }),
1392
- emits: /* @__PURE__ */ fe(["ready"], ["update:modelValue"]),
1412
+ emits: /* @__PURE__ */ be(["ready"], ["update:modelValue"]),
1393
1413
  setup(e, { expose: o, emit: t }) {
1394
- const n = parseInt(ct, 10), a = t, r = Be(e, "modelValue"), { i18n: l } = ae(), d = V("editorRef"), s = M(() => e.theme === "dark" ? "dark" : "light"), c = M(() => {
1414
+ const n = parseInt(dt, 10), l = t, r = We(e, "modelValue"), { i18n: a } = le(), c = z("editorRef"), s = M(() => e.theme === "dark" ? "dark" : "light"), d = M(() => {
1395
1415
  if (e.appearance === "standalone") {
1396
- const m = String(r.value.split(`
1416
+ const u = String(r.value.split(`
1397
1417
  `).length).length;
1398
1418
  return {
1399
1419
  ...e.options,
@@ -1402,103 +1422,103 @@ const Vt = {
1402
1422
  padding: { top: n, bottom: n },
1403
1423
  // Horizontal padding is not supported, so we increase the minimum chars for line numbers
1404
1424
  // to create some space on the left when standalone.
1405
- lineNumbersMinChars: Math.max(ee.lineNumbersMinChars, m) + 2
1425
+ lineNumbersMinChars: Math.max(te.lineNumbersMinChars, u) + 2
1406
1426
  };
1407
1427
  }
1408
1428
  return {
1409
1429
  // Ensure standalone padding is cleared when switching back to embedded.
1410
- padding: { ...ee.padding },
1411
- lineNumbersMinChars: ee.lineNumbersMinChars,
1430
+ padding: { ...te.padding },
1431
+ lineNumbersMinChars: te.lineNumbersMinChars,
1412
1432
  // Embedded allows user overrides.
1413
1433
  ...e.options
1414
1434
  };
1415
- }), g = Mt(d, {
1435
+ }), g = Nt(c, {
1416
1436
  language: e.language,
1417
1437
  code: r,
1418
1438
  theme: s.value,
1419
- monacoOptions: c.value,
1420
- onReady: (m) => {
1421
- a("ready", m);
1439
+ monacoOptions: d.value,
1440
+ onReady: (u) => {
1441
+ l("ready", u);
1422
1442
  }
1423
- }), i = M(() => e.loading || g.editorStates.editorStatus === "loading"), p = M(() => !i.value && g.editorStates.editorStatus === "ready" && !g.editorStates.hasContent);
1443
+ }), i = M(() => e.loading || g.editorStates.editorStatus === "loading"), f = M(() => !i.value && g.editorStates.editorStatus === "ready" && !g.editorStates.hasContent);
1424
1444
  return o({
1425
1445
  monacoEditor: g
1426
- }), _(() => e.language, (m, u) => {
1427
- m !== u && g.setLanguage(m);
1428
- }), _([g.editor, c], ([m, u]) => {
1429
- m && u && m.updateOptions(u);
1446
+ }), $(() => e.language, (u, m) => {
1447
+ u !== m && g.setLanguage(u);
1448
+ }), $([g.editor, d], ([u, m]) => {
1449
+ u && m && u.updateOptions(m);
1430
1450
  }, {
1431
1451
  deep: !0
1432
- }), (m, u) => (v(), I("div", {
1433
- class: re(["monaco-editor-container", [
1452
+ }), (u, m) => (v(), I("div", {
1453
+ class: ie(["monaco-editor-container", [
1434
1454
  e.appearance,
1435
1455
  s.value,
1436
1456
  { loading: i.value }
1437
1457
  ]]),
1438
1458
  "data-testid": "monaco-editor-container"
1439
1459
  }, [
1440
- e.toolbar ? (v(), N(Ht, {
1460
+ e.toolbar ? (v(), N(qt, {
1441
1461
  key: 0,
1442
1462
  editor: S(g),
1443
1463
  settings: e.toolbar
1444
- }, ue({ _: 2 }, [
1445
- m.$slots["toolbar-left"] ? {
1464
+ }, me({ _: 2 }, [
1465
+ u.$slots["toolbar-left"] ? {
1446
1466
  name: "toolbar-left",
1447
1467
  fn: O(() => [
1448
- W(m.$slots, "toolbar-left", {}, void 0, !0)
1468
+ W(u.$slots, "toolbar-left", {}, void 0, !0)
1449
1469
  ]),
1450
1470
  key: "0"
1451
1471
  } : void 0,
1452
- m.$slots["toolbar-center"] ? {
1472
+ u.$slots["toolbar-center"] ? {
1453
1473
  name: "toolbar-center",
1454
1474
  fn: O(() => [
1455
- W(m.$slots, "toolbar-center", {}, void 0, !0)
1475
+ W(u.$slots, "toolbar-center", {}, void 0, !0)
1456
1476
  ]),
1457
1477
  key: "1"
1458
1478
  } : void 0,
1459
- m.$slots["toolbar-right"] ? {
1479
+ u.$slots["toolbar-right"] ? {
1460
1480
  name: "toolbar-right",
1461
1481
  fn: O(() => [
1462
- W(m.$slots, "toolbar-right", {}, void 0, !0)
1482
+ W(u.$slots, "toolbar-right", {}, void 0, !0)
1463
1483
  ]),
1464
1484
  key: "2"
1465
1485
  } : void 0
1466
1486
  ]), 1032, ["editor", "settings"])) : G("", !0),
1467
- F("div", {
1487
+ K("div", {
1468
1488
  ref_key: "editorRef",
1469
- ref: d,
1489
+ ref: c,
1470
1490
  class: "monaco-editor-target",
1471
1491
  "data-testid": "monaco-editor-target"
1472
1492
  }, null, 512),
1473
- e.showLoadingState ? W(m.$slots, "state-loading", {
1493
+ e.showLoadingState ? W(u.$slots, "state-loading", {
1474
1494
  key: 1,
1475
1495
  isLoading: i.value
1476
1496
  }, () => [
1477
- oe(ge, { name: "fade" }, {
1497
+ re(fe, { name: "fade" }, {
1478
1498
  default: O(() => [
1479
1499
  i.value ? (v(), N(pe, {
1480
1500
  key: 0,
1481
1501
  "data-testid": "monaco-editor-status-overlay-loading",
1482
- icon: S(Xe),
1483
- message: S(l).t("editor.messages.loading_message", { type: e.language }),
1484
- title: S(l).t("editor.messages.loading_title", { type: e.language })
1502
+ icon: S(Ze),
1503
+ message: S(a).t("editor.messages.loading_message", { type: e.language }),
1504
+ title: S(a).t("editor.messages.loading_title", { type: e.language })
1485
1505
  }, null, 8, ["icon", "message", "title"])) : G("", !0)
1486
1506
  ]),
1487
1507
  _: 1
1488
1508
  })
1489
1509
  ], !0) : G("", !0),
1490
- e.showEmptyState ? W(m.$slots, "state-empty", {
1510
+ e.showEmptyState ? W(u.$slots, "state-empty", {
1491
1511
  key: 2,
1492
- isEmpty: p.value
1512
+ isEmpty: f.value
1493
1513
  }, () => [
1494
- oe(ge, { name: "fade" }, {
1514
+ re(fe, { name: "fade" }, {
1495
1515
  default: O(() => [
1496
- p.value ? (v(), N(pe, {
1516
+ f.value ? (v(), N(pe, {
1497
1517
  key: 0,
1498
1518
  "data-testid": "monaco-editor-status-overlay-empty",
1499
1519
  icon: S(xe),
1500
- message: S(l).t("editor.messages.empty_message"),
1501
- title: S(l).t("editor.messages.empty_title")
1520
+ message: S(a).t("editor.messages.empty_message"),
1521
+ title: S(a).t("editor.messages.empty_title")
1502
1522
  }, null, 8, ["icon", "message", "title"])) : G("", !0)
1503
1523
  ]),
1504
1524
  _: 1
@@ -1506,18 +1526,18 @@ const Vt = {
1506
1526
  ], !0) : G("", !0)
1507
1527
  ], 2));
1508
1528
  }
1509
- }), tn = /* @__PURE__ */ le(qt, [["__scopeId", "data-v-3f4acd16"]]);
1529
+ }), nn = /* @__PURE__ */ se(Yt, [["__scopeId", "data-v-3f4acd16"]]);
1510
1530
  export {
1511
- tn as MonacoEditor,
1531
+ nn as MonacoEditor,
1512
1532
  pe as MonacoEditorStatusOverlay,
1513
- rn as collectCodeLensProviders,
1514
- an as collectCodeLenses,
1515
- ln as createCopyUUIDCodeLens,
1516
- sn as createCopyValueCodeLens,
1517
- te as createWrapAction,
1518
- cn as emptyCodeLensList,
1519
- mn as getModelContext,
1520
- gn as invalidateModelContexts,
1521
- Mt as useMonacoEditor,
1522
- dn as uuidRe
1533
+ an as collectCodeLensProviders,
1534
+ ln as collectCodeLenses,
1535
+ sn as createCopyUUIDCodeLens,
1536
+ cn as createCopyValueCodeLens,
1537
+ ne as createWrapAction,
1538
+ dn as emptyCodeLensList,
1539
+ gn as getModelContext,
1540
+ fn as invalidateModelContexts,
1541
+ Nt as useMonacoEditor,
1542
+ un as uuidRe
1523
1543
  };