markstream-vue 0.0.3-beta.1 → 0.0.3-beta.3

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,34 +1,34 @@
1
- var Ht = Object.defineProperty, Tt = Object.defineProperties;
2
- var Dt = Object.getOwnPropertyDescriptors;
3
- var Ve = Object.getOwnPropertySymbols;
4
- var Pt = Object.prototype.hasOwnProperty, Lt = Object.prototype.propertyIsEnumerable;
5
- var Re = (f, u, i) => u in f ? Ht(f, u, { enumerable: !0, configurable: !0, writable: !0, value: i }) : f[u] = i, _e = (f, u) => {
6
- for (var i in u || (u = {}))
7
- Pt.call(u, i) && Re(f, i, u[i]);
8
- if (Ve)
9
- for (var i of Ve(u))
10
- Lt.call(u, i) && Re(f, i, u[i]);
1
+ var Ot = Object.defineProperty, Dt = Object.defineProperties;
2
+ var $t = Object.getOwnPropertyDescriptors;
3
+ var je = Object.getOwnPropertySymbols;
4
+ var Nt = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
+ var We = (f, s, i) => s in f ? Ot(f, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : f[s] = i, be = (f, s) => {
6
+ for (var i in s || (s = {}))
7
+ Nt.call(s, i) && We(f, i, s[i]);
8
+ if (je)
9
+ for (var i of je(s))
10
+ zt.call(s, i) && We(f, i, s[i]);
11
11
  return f;
12
- }, Ye = (f, u) => Tt(f, Dt(u));
13
- var _ = (f, u, i) => new Promise((j, I) => {
14
- var F = (y) => {
12
+ }, Ce = (f, s) => Dt(f, $t(s));
13
+ var R = (f, s, i) => new Promise((q, Y) => {
14
+ var L = (x) => {
15
15
  try {
16
- m(i.next(y));
17
- } catch ($) {
18
- I($);
16
+ O(i.next(x));
17
+ } catch (c) {
18
+ Y(c);
19
19
  }
20
- }, a = (y) => {
20
+ }, w = (x) => {
21
21
  try {
22
- m(i.throw(y));
23
- } catch ($) {
24
- I($);
22
+ O(i.throw(x));
23
+ } catch (c) {
24
+ Y(c);
25
25
  }
26
- }, m = (y) => y.done ? j(y.value) : Promise.resolve(y.value).then(F, a);
27
- m((i = i.apply(f, u)).next());
26
+ }, O = (x) => x.done ? q(x.value) : Promise.resolve(x.value).then(L, w);
27
+ O((i = i.apply(f, s)).next());
28
28
  });
29
- import { defineComponent as Ze, computed as z, onMounted as Ot, onUnmounted as et, createBlock as Ce, openBlock as E, Teleport as $t, createElementVNode as r, normalizeClass as Q, withModifiers as Nt, toDisplayString as Me, unref as g, getCurrentInstance as zt, ref as B, watch as Y, onBeforeUnmount as It, nextTick as ye, createElementBlock as O, normalizeStyle as Ae, createCommentVNode as X, withDirectives as We, renderSlot as ke, Fragment as Vt, vShow as je } from "vue";
30
- import { u as tt, _ as ot, n as xe, r as Rt, a as _t, g as Yt, s as ae, l as qe, b as At, c as Wt, d as Xe, h as jt } from "./exports-CuW10Rlw.js";
31
- const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-frame__title" }, Ut = { class: "html-preview-frame__label" }, Gt = ["srcdoc"], Kt = /* @__PURE__ */ Ze({
29
+ import { defineComponent as nt, computed as _, onMounted as _t, onUnmounted as it, createBlock as Fe, openBlock as F, Teleport as It, createElementVNode as r, normalizeClass as ee, withModifiers as Vt, toDisplayString as Te, unref as p, getCurrentInstance as Rt, ref as E, watch as A, onBeforeUnmount as At, nextTick as Me, createElementBlock as N, normalizeStyle as qe, createCommentVNode as G, withDirectives as Xe, renderSlot as Be, Fragment as Yt, vShow as Ue } from "vue";
30
+ import { u as lt, _ as at, n as Ee, r as jt, a as Wt, g as qt, s as se, l as Ge, b as Xt, c as Ut, d as Ke, h as Gt } from "./exports-DYua_tlG.js";
31
+ const Kt = { class: "html-preview-frame__header" }, Jt = { class: "html-preview-frame__title" }, Qt = { class: "html-preview-frame__label" }, Zt = ["srcdoc"], eo = /* @__PURE__ */ nt({
32
32
  __name: "HtmlPreviewFrame",
33
33
  props: {
34
34
  code: {},
@@ -37,11 +37,11 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
37
37
  title: {}
38
38
  },
39
39
  setup(f) {
40
- const u = f, { t: i } = tt(), j = z(() => {
41
- const F = u.code || "", a = F.trim().toLowerCase();
42
- if (a.startsWith("<!doctype") || a.startsWith("<html") || a.startsWith("<body"))
43
- return F;
44
- const m = u.isDark ? "#020617" : "#ffffff", y = u.isDark ? "#e5e7eb" : "#020617";
40
+ const s = f, { t: i } = lt(), q = _(() => {
41
+ const L = s.code || "", w = L.trim().toLowerCase();
42
+ if (w.startsWith("<!doctype") || w.startsWith("<html") || w.startsWith("<body"))
43
+ return L;
44
+ const O = s.isDark ? "#020617" : "#ffffff", x = s.isDark ? "#e5e7eb" : "#020617";
45
45
  return `<!doctype html>
46
46
  <html lang="en">
47
47
  <head>
@@ -52,8 +52,8 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
52
52
  margin: 0;
53
53
  padding: 0;
54
54
  height: 100%;
55
- background-color: ${m};
56
- color: ${y};
55
+ background-color: ${O};
56
+ color: ${x};
57
57
  }
58
58
  body {
59
59
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
@@ -61,59 +61,59 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
61
61
  </style>
62
62
  </head>
63
63
  <body>
64
- ${F}
64
+ ${L}
65
65
  </body>
66
66
  </html>`;
67
67
  });
68
- function I(F) {
69
- var a;
70
- (F.key === "Escape" || F.key === "Esc") && ((a = u.onClose) == null || a.call(u));
68
+ function Y(L) {
69
+ var w;
70
+ (L.key === "Escape" || L.key === "Esc") && ((w = s.onClose) == null || w.call(s));
71
71
  }
72
- return Ot(() => {
73
- typeof window != "undefined" && window.addEventListener("keydown", I);
74
- }), et(() => {
75
- typeof window != "undefined" && window.removeEventListener("keydown", I);
76
- }), (F, a) => (E(), Ce($t, { to: "body" }, [
72
+ return _t(() => {
73
+ typeof window != "undefined" && window.addEventListener("keydown", Y);
74
+ }), it(() => {
75
+ typeof window != "undefined" && window.removeEventListener("keydown", Y);
76
+ }), (L, w) => (F(), Fe(It, { to: "body" }, [
77
77
  r("div", {
78
- class: Q(["html-preview-frame__backdrop", { "html-preview-frame__backdrop--dark": u.isDark }]),
79
- onClick: a[2] || (a[2] = (m) => {
80
- var y;
81
- return (y = u.onClose) == null ? void 0 : y.call(u);
78
+ class: ee(["html-preview-frame__backdrop", { "html-preview-frame__backdrop--dark": s.isDark }]),
79
+ onClick: w[2] || (w[2] = (O) => {
80
+ var x;
81
+ return (x = s.onClose) == null ? void 0 : x.call(s);
82
82
  })
83
83
  }, [
84
84
  r("div", {
85
- class: Q(["html-preview-frame", { "html-preview-frame--dark": u.isDark }]),
86
- onClick: a[1] || (a[1] = Nt(() => {
85
+ class: ee(["html-preview-frame", { "html-preview-frame--dark": s.isDark }]),
86
+ onClick: w[1] || (w[1] = Vt(() => {
87
87
  }, ["stop"]))
88
88
  }, [
89
- r("div", qt, [
90
- r("div", Xt, [
91
- a[3] || (a[3] = r("span", { class: "html-preview-frame__dot" }, null, -1)),
92
- r("span", Ut, Me(u.title || g(i)("common.preview") || "Preview"), 1)
89
+ r("div", Kt, [
90
+ r("div", Jt, [
91
+ w[3] || (w[3] = r("span", { class: "html-preview-frame__dot" }, null, -1)),
92
+ r("span", Qt, Te(s.title || p(i)("common.preview") || "Preview"), 1)
93
93
  ]),
94
94
  r("button", {
95
95
  type: "button",
96
- class: Q(["html-preview-frame__close", { "html-preview-frame__close--dark": u.isDark }]),
97
- onClick: a[0] || (a[0] = (m) => {
98
- var y;
99
- return (y = u.onClose) == null ? void 0 : y.call(u);
96
+ class: ee(["html-preview-frame__close", { "html-preview-frame__close--dark": s.isDark }]),
97
+ onClick: w[0] || (w[0] = (O) => {
98
+ var x;
99
+ return (x = s.onClose) == null ? void 0 : x.call(s);
100
100
  })
101
101
  }, " × ", 2)
102
102
  ]),
103
103
  r("iframe", {
104
104
  class: "html-preview-frame__iframe",
105
105
  sandbox: "allow-scripts allow-same-origin",
106
- srcdoc: j.value
107
- }, null, 8, Gt)
106
+ srcdoc: q.value
107
+ }, null, 8, Zt)
108
108
  ], 2)
109
109
  ], 2)
110
110
  ]));
111
111
  }
112
- }), Jt = /* @__PURE__ */ ot(Kt, [["__scopeId", "data-v-3cf0ed56"]]), Qt = {
112
+ }), to = /* @__PURE__ */ at(eo, [["__scopeId", "data-v-3cf0ed56"]]), oo = {
113
113
  key: 0,
114
114
  class: "code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",
115
115
  style: { color: "var(--vscode-editor-foreground)", "background-color": "var(--vscode-editor-background)" }
116
- }, Zt = { class: "flex items-center space-x-2 flex-1 overflow-hidden" }, eo = ["innerHTML"], to = { class: "text-sm font-medium font-mono truncate" }, oo = { class: "flex items-center space-x-2" }, no = ["aria-pressed"], io = ["disabled"], lo = ["disabled"], ao = ["disabled"], ro = ["aria-label"], so = {
116
+ }, no = { class: "flex items-center space-x-2 flex-1 overflow-hidden" }, io = ["innerHTML"], lo = { class: "text-sm font-medium font-mono truncate" }, ao = { class: "flex items-center space-x-2" }, ro = ["aria-pressed"], so = ["disabled"], uo = ["disabled"], co = ["disabled"], fo = ["aria-label"], vo = {
117
117
  key: 0,
118
118
  xmlns: "http://www.w3.org/2000/svg",
119
119
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -123,7 +123,7 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
123
123
  height: "1em",
124
124
  viewBox: "0 0 24 24",
125
125
  class: "w-3 h-3"
126
- }, uo = {
126
+ }, mo = {
127
127
  key: 1,
128
128
  xmlns: "http://www.w3.org/2000/svg",
129
129
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -133,7 +133,7 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
133
133
  height: "1em",
134
134
  viewBox: "0 0 24 24",
135
135
  class: "w-3 h-3"
136
- }, co = ["aria-pressed"], fo = {
136
+ }, ho = ["aria-pressed"], go = {
137
137
  key: 0,
138
138
  xmlns: "http://www.w3.org/2000/svg",
139
139
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -143,7 +143,7 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
143
143
  height: "1em",
144
144
  viewBox: "0 0 24 24",
145
145
  class: "w-3 h-3"
146
- }, vo = {
146
+ }, po = {
147
147
  key: 1,
148
148
  xmlns: "http://www.w3.org/2000/svg",
149
149
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -153,11 +153,11 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
153
153
  height: "1em",
154
154
  viewBox: "0 0 24 24",
155
155
  class: "w-3 h-3"
156
- }, mo = ["aria-label"], ho = { class: "code-loading-placeholder" }, go = {
156
+ }, wo = ["aria-label"], yo = { class: "code-loading-placeholder" }, ko = {
157
157
  class: "sr-only",
158
158
  "aria-live": "polite",
159
159
  role: "status"
160
- }, Ue = 10, Ge = 36, Ke = 1, Je = 0, Qe = 1.5, re = 1, po = /* @__PURE__ */ Ze({
160
+ }, Je = "__markstreamMonacoPassiveTouch__", Qe = 10, Ze = 36, et = 1, tt = 0, ot = 1.5, ue = 1, xo = /* @__PURE__ */ nt({
161
161
  __name: "CodeBlockNode",
162
162
  props: {
163
163
  node: {},
@@ -180,81 +180,107 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
180
180
  customId: {}
181
181
  },
182
182
  emits: ["previewCode", "copy"],
183
- setup(f, { emit: u }) {
184
- var Le;
185
- const i = f, j = u, I = zt(), F = z(() => {
186
- const t = I == null ? void 0 : I.vnode.props;
183
+ setup(f, { emit: s }) {
184
+ var _e;
185
+ const i = f, q = s;
186
+ typeof window != "undefined" && Y();
187
+ function Y() {
188
+ var t;
189
+ try {
190
+ const e = window;
191
+ if (e[Je])
192
+ return;
193
+ const o = (t = window.Element) == null ? void 0 : t.prototype, n = o == null ? void 0 : o.addEventListener;
194
+ if (!o || !n)
195
+ return;
196
+ o.addEventListener = function(a, h, m) {
197
+ return a === "touchstart" && L(this, m) ? n.call(this, a, h, w(m)) : n.call(this, a, h, m);
198
+ }, e[Je] = !0;
199
+ } catch (e) {
200
+ }
201
+ }
202
+ function L(t, e) {
203
+ if (!t)
204
+ return !1;
205
+ const o = t;
206
+ return !(typeof o.closest != "function" || !o.closest(".monaco-editor, .monaco-diff-editor") || e && typeof e == "object" && "passive" in e);
207
+ }
208
+ function w(t) {
209
+ return t == null ? { passive: !0 } : typeof t == "boolean" ? { capture: t, passive: !0 } : typeof t == "object" ? "passive" in t ? t : Ce(be({}, t), { passive: !0 }) : { passive: !0 };
210
+ }
211
+ const O = Rt(), x = _(() => {
212
+ const t = O == null ? void 0 : O.vnode.props;
187
213
  return !!(t && (t.onPreviewCode || t.onPreviewCode));
188
- }), { t: a } = tt(), m = B(null), y = B(null), $ = B(!1), P = B(xe(i.node.language)), U = z(() => Rt(P.value)), C = B(!1), M = B(!1), Z = B(!1), Be = B(!1), A = B(null);
189
- let se = 0;
190
- const nt = _t(), G = B(null), V = B(typeof window == "undefined");
191
- typeof window != "undefined" && Y(
192
- () => y.value,
214
+ }), { t: c } = lt(), b = E(null), ce = E(null), X = E(!1), D = E(Ee(i.node.language)), K = _(() => jt(D.value)), M = E(!1), B = E(!1), te = E(!1), He = E(!1), j = E(null);
215
+ let de = 0;
216
+ const rt = Wt(), J = E(null), I = E(typeof window == "undefined");
217
+ typeof window != "undefined" && A(
218
+ () => ce.value,
193
219
  (t) => {
194
220
  var o;
195
- if ((o = G.value) == null || o.destroy(), G.value = null, !t) {
196
- V.value = !1;
221
+ if ((o = J.value) == null || o.destroy(), J.value = null, !t) {
222
+ I.value = !1;
197
223
  return;
198
224
  }
199
- const e = nt(t, { rootMargin: "400px" });
200
- G.value = e, V.value = e.isVisible.value, e.whenVisible.then(() => {
201
- V.value = !0;
225
+ const e = rt(t, { rootMargin: "400px" });
226
+ J.value = e, I.value = e.isVisible.value, e.whenVisible.then(() => {
227
+ I.value = !0;
202
228
  });
203
229
  },
204
230
  { immediate: !0 }
205
- ), It(() => {
231
+ ), At(() => {
206
232
  var t;
207
- (t = G.value) == null || t.destroy(), G.value = null;
233
+ (t = J.value) == null || t.destroy(), J.value = null;
208
234
  });
209
- let R = null, ee = null, ue = () => {
210
- }, ce = () => {
211
- }, te = () => null, N = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
212
- } }), L = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
213
- } }), oe = () => {
214
- }, de = () => {
215
- }, K = null, Se = () => {
235
+ let V = null, oe = null, fe = () => {
236
+ }, ve = () => {
237
+ }, ne = () => null, z = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
238
+ } }), $ = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
239
+ } }), ie = () => {
240
+ }, me = () => {
241
+ }, Q = null, Pe = () => {
216
242
  var t;
217
243
  return String((t = i.node.language) != null ? t : "plaintext");
218
- }, fe = () => _(null, null, function* () {
244
+ }, he = () => R(null, null, function* () {
219
245
  });
220
- const H = z(() => i.node.diff), ve = B(!1), ne = B(!1);
221
- typeof window != "undefined" && _(null, null, function* () {
246
+ const T = _(() => i.node.diff), ge = E(!1), le = E(!1);
247
+ typeof window != "undefined" && R(null, null, function* () {
222
248
  try {
223
- const t = yield Yt();
249
+ const t = yield qt();
224
250
  if (!t) {
225
- ve.value = !0;
251
+ ge.value = !0;
226
252
  return;
227
253
  }
228
254
  const e = t.useMonaco, o = t.detectLanguage;
229
- if (typeof o == "function" && (Se = o), typeof e == "function") {
230
- const n = Pe();
255
+ if (typeof o == "function" && (Pe = o), typeof e == "function") {
256
+ const n = ze();
231
257
  if (n && i.themes && Array.isArray(i.themes) && !i.themes.includes(n))
232
258
  throw new Error("Preferred theme not in provided themes array");
233
- const l = e(Ye(_e({
259
+ const l = e(Ce(be({
234
260
  wordWrap: "on",
235
261
  wrappingIndent: "same",
236
262
  themes: i.themes,
237
263
  theme: n
238
264
  }, i.monacoOptions || {}), {
239
265
  onThemeChange() {
240
- ut();
266
+ vt();
241
267
  }
242
268
  }));
243
- R = l.createEditor || R, ee = l.createDiffEditor || ee, ue = l.updateCode || ue, ce = l.updateDiff || ce, te = l.getEditor || te, N = l.getEditorView || N, L = l.getDiffEditorView || L, oe = l.cleanupEditor || oe, de = l.safeClean || l.cleanupEditor || de, fe = l.setTheme || fe, Be.value = !0, m.value && (yield pe(m.value));
269
+ V = l.createEditor || V, oe = l.createDiffEditor || oe, fe = l.updateCode || fe, ve = l.updateDiff || ve, ne = l.getEditor || ne, z = l.getEditorView || z, $ = l.getDiffEditorView || $, ie = l.cleanupEditor || ie, me = l.safeClean || l.cleanupEditor || me, he = l.setTheme || he, He.value = !0, b.value && (yield ke(b.value));
244
270
  }
245
271
  } catch (t) {
246
- ve.value = !0;
272
+ ge.value = !0;
247
273
  }
248
274
  });
249
- const T = B(
250
- typeof ((Le = i.monacoOptions) == null ? void 0 : Le.fontSize) == "number" ? i.monacoOptions.fontSize : Number.NaN
251
- ), v = B(T.value), it = z(() => {
252
- const t = T.value, e = v.value;
275
+ const H = E(
276
+ typeof ((_e = i.monacoOptions) == null ? void 0 : _e.fontSize) == "number" ? i.monacoOptions.fontSize : Number.NaN
277
+ ), v = E(H.value), st = _(() => {
278
+ const t = H.value, e = v.value;
253
279
  return typeof t == "number" && Number.isFinite(t) && t > 0 && typeof e == "number" && Number.isFinite(e) && e > 0;
254
280
  });
255
- function lt() {
281
+ function ut() {
256
282
  try {
257
- const t = m.value;
283
+ const t = b.value;
258
284
  if (!t)
259
285
  return null;
260
286
  const e = t.querySelector(".view-lines .view-line");
@@ -267,184 +293,184 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
267
293
  }
268
294
  return null;
269
295
  }
270
- function Ee() {
296
+ function Le() {
271
297
  var t, e, o, n, l;
272
298
  try {
273
- const s = H.value ? (o = (e = (t = L()) == null ? void 0 : t.getModifiedEditor) == null ? void 0 : e.call(t)) != null ? o : L() : N(), w = te(), p = (n = w == null ? void 0 : w.EditorOption) == null ? void 0 : n.fontInfo;
274
- if (s && p != null) {
275
- const k = (l = s.getOption) == null ? void 0 : l.call(s, p), d = k == null ? void 0 : k.fontSize;
299
+ const a = T.value ? (o = (e = (t = $()) == null ? void 0 : t.getModifiedEditor) == null ? void 0 : e.call(t)) != null ? o : $() : z(), h = ne(), m = (n = h == null ? void 0 : h.EditorOption) == null ? void 0 : n.fontInfo;
300
+ if (a && m != null) {
301
+ const y = (l = a.getOption) == null ? void 0 : l.call(a, m), d = y == null ? void 0 : y.fontSize;
276
302
  if (typeof d == "number" && Number.isFinite(d) && d > 0)
277
303
  return d;
278
304
  }
279
- } catch (s) {
305
+ } catch (a) {
280
306
  }
281
307
  try {
282
- const s = m.value;
283
- if (s) {
284
- const w = s.querySelector(".view-lines .view-line");
285
- if (w)
308
+ const a = b.value;
309
+ if (a) {
310
+ const h = a.querySelector(".view-lines .view-line");
311
+ if (h)
286
312
  try {
287
313
  if (typeof window != "undefined" && typeof window.getComputedStyle == "function") {
288
- const p = window.getComputedStyle(w).fontSize, k = p && p.match(/^(\d+(?:\.\d+)?)/);
289
- if (k)
290
- return Number.parseFloat(k[1]);
314
+ const m = window.getComputedStyle(h).fontSize, y = m && m.match(/^(\d+(?:\.\d+)?)/);
315
+ if (y)
316
+ return Number.parseFloat(y[1]);
291
317
  }
292
- } catch (p) {
318
+ } catch (m) {
293
319
  }
294
320
  }
295
- } catch (s) {
321
+ } catch (a) {
296
322
  }
297
323
  return null;
298
324
  }
299
- function me(t) {
325
+ function pe(t) {
300
326
  var n, l;
301
327
  try {
302
- const s = te(), w = (n = s == null ? void 0 : s.EditorOption) == null ? void 0 : n.lineHeight;
303
- if (w != null) {
304
- const p = (l = t == null ? void 0 : t.getOption) == null ? void 0 : l.call(t, w);
305
- if (typeof p == "number" && p > 0)
306
- return p;
328
+ const a = ne(), h = (n = a == null ? void 0 : a.EditorOption) == null ? void 0 : n.lineHeight;
329
+ if (h != null) {
330
+ const m = (l = t == null ? void 0 : t.getOption) == null ? void 0 : l.call(t, h);
331
+ if (typeof m == "number" && m > 0)
332
+ return m;
307
333
  }
308
- } catch (s) {
334
+ } catch (a) {
309
335
  }
310
- const e = lt();
336
+ const e = ut();
311
337
  if (e && e > 0)
312
338
  return e;
313
339
  const o = Number.isFinite(v.value) && v.value > 0 ? v.value : 12;
314
340
  return Math.max(12, Math.round(o * 1.35));
315
341
  }
316
- function he() {
342
+ function we() {
317
343
  var e;
318
- if (Number.isFinite(v.value) && v.value > 0 && Number.isFinite(T.value))
344
+ if (Number.isFinite(v.value) && v.value > 0 && Number.isFinite(H.value))
319
345
  return v.value;
320
- const t = Ee();
321
- return typeof ((e = i.monacoOptions) == null ? void 0 : e.fontSize) == "number" ? (T.value = i.monacoOptions.fontSize, v.value = i.monacoOptions.fontSize, v.value) : t && t > 0 ? (T.value = t, v.value = t, t) : (T.value = 12, v.value = 12, 12);
346
+ const t = Le();
347
+ return typeof ((e = i.monacoOptions) == null ? void 0 : e.fontSize) == "number" ? (H.value = i.monacoOptions.fontSize, v.value = i.monacoOptions.fontSize, v.value) : t && t > 0 ? (H.value = t, v.value = t, t) : (H.value = 12, v.value = 12, 12);
322
348
  }
323
- function at() {
324
- const t = he(), e = Math.min(Ge, t + Ke);
349
+ function ct() {
350
+ const t = we(), e = Math.min(Ze, t + et);
325
351
  v.value = e;
326
352
  }
327
- function rt() {
328
- const t = he(), e = Math.max(Ue, t - Ke);
353
+ function dt() {
354
+ const t = we(), e = Math.max(Qe, t - et);
329
355
  v.value = e;
330
356
  }
331
- function st() {
332
- he(), Number.isFinite(T.value) && (v.value = T.value);
357
+ function ft() {
358
+ we(), Number.isFinite(H.value) && (v.value = H.value);
333
359
  }
334
- function Fe() {
335
- var t, e, o, n, l, s, w, p, k, d, h, Oe, $e, Ne;
360
+ function Oe() {
361
+ var t, e, o, n, l, a, h, m, y, d, g, Ie, Ve, Re;
336
362
  try {
337
- const c = H.value ? L() : N();
338
- if (!c)
363
+ const u = T.value ? $() : z();
364
+ if (!u)
339
365
  return null;
340
- if (H.value && (c != null && c.getOriginalEditor) && (c != null && c.getModifiedEditor)) {
341
- const x = (t = c.getOriginalEditor) == null ? void 0 : t.call(c), b = (e = c.getModifiedEditor) == null ? void 0 : e.call(c);
342
- (o = x == null ? void 0 : x.layout) == null || o.call(x), (n = b == null ? void 0 : b.layout) == null || n.call(b);
343
- const Ct = ((l = x == null ? void 0 : x.getContentHeight) == null ? void 0 : l.call(x)) || 0, Mt = ((s = b == null ? void 0 : b.getContentHeight) == null ? void 0 : s.call(b)) || 0, Ie = Math.max(Ct, Mt);
344
- if (Ie > 0)
345
- return Math.ceil(Ie + re);
346
- const Bt = ((k = (p = (w = x == null ? void 0 : x.getModel) == null ? void 0 : w.call(x)) == null ? void 0 : p.getLineCount) == null ? void 0 : k.call(p)) || 1, St = ((Oe = (h = (d = b == null ? void 0 : b.getModel) == null ? void 0 : d.call(b)) == null ? void 0 : h.getLineCount) == null ? void 0 : Oe.call(h)) || 1, Et = Math.max(Bt, St), Ft = Math.max(me(x), me(b));
347
- return Math.ceil(Et * (Ft + Qe) + Je + re);
348
- } else if (c != null && c.getContentHeight) {
349
- ($e = c == null ? void 0 : c.layout) == null || $e.call(c);
350
- const x = c.getContentHeight();
351
- if (x > 0)
352
- return Math.ceil(x + re);
366
+ if (T.value && (u != null && u.getOriginalEditor) && (u != null && u.getModifiedEditor)) {
367
+ const k = (t = u.getOriginalEditor) == null ? void 0 : t.call(u), C = (e = u.getModifiedEditor) == null ? void 0 : e.call(u);
368
+ (o = k == null ? void 0 : k.layout) == null || o.call(k), (n = C == null ? void 0 : C.layout) == null || n.call(C);
369
+ const St = ((l = k == null ? void 0 : k.getContentHeight) == null ? void 0 : l.call(k)) || 0, Ft = ((a = C == null ? void 0 : C.getContentHeight) == null ? void 0 : a.call(C)) || 0, Ye = Math.max(St, Ft);
370
+ if (Ye > 0)
371
+ return Math.ceil(Ye + ue);
372
+ const Tt = ((y = (m = (h = k == null ? void 0 : k.getModel) == null ? void 0 : h.call(k)) == null ? void 0 : m.getLineCount) == null ? void 0 : y.call(m)) || 1, Ht = ((Ie = (g = (d = C == null ? void 0 : C.getModel) == null ? void 0 : d.call(C)) == null ? void 0 : g.getLineCount) == null ? void 0 : Ie.call(g)) || 1, Pt = Math.max(Tt, Ht), Lt = Math.max(pe(k), pe(C));
373
+ return Math.ceil(Pt * (Lt + ot) + tt + ue);
374
+ } else if (u != null && u.getContentHeight) {
375
+ (Ve = u == null ? void 0 : u.layout) == null || Ve.call(u);
376
+ const k = u.getContentHeight();
377
+ if (k > 0)
378
+ return Math.ceil(k + ue);
353
379
  }
354
- const we = (Ne = c == null ? void 0 : c.getModel) == null ? void 0 : Ne.call(c);
355
- let ze = 1;
356
- we && typeof we.getLineCount == "function" && (ze = we.getLineCount());
357
- const bt = me(c);
358
- return Math.ceil(ze * (bt + Qe) + Je + re);
359
- } catch (c) {
380
+ const xe = (Re = u == null ? void 0 : u.getModel) == null ? void 0 : Re.call(u);
381
+ let Ae = 1;
382
+ xe && typeof xe.getLineCount == "function" && (Ae = xe.getLineCount());
383
+ const Et = pe(u);
384
+ return Math.ceil(Ae * (Et + ot) + tt + ue);
385
+ } catch (u) {
360
386
  return null;
361
387
  }
362
388
  }
363
- function ut() {
364
- var p, k, d;
365
- const t = m.value, e = y.value;
389
+ function vt() {
390
+ var m, y, d;
391
+ const t = b.value, e = ce.value;
366
392
  if (!t || !e)
367
393
  return;
368
394
  const o = t.querySelector(".monaco-editor") || t;
369
395
  let n = null;
370
396
  try {
371
397
  typeof window != "undefined" && typeof window.getComputedStyle == "function" && (n = window.getComputedStyle(o));
372
- } catch (h) {
398
+ } catch (g) {
373
399
  n = null;
374
400
  }
375
- const l = String((p = n == null ? void 0 : n.getPropertyValue("--vscode-editor-foreground")) != null ? p : ""), s = String((k = n == null ? void 0 : n.getPropertyValue("--vscode-editor-background")) != null ? k : ""), w = String((d = n == null ? void 0 : n.getPropertyValue("--vscode-editor-hoverHighlightBackground")) != null ? d : "");
376
- if (l && s)
377
- return e.style.setProperty("--vscode-editor-foreground", l.trim()), e.style.setProperty("--vscode-editor-background", s.trim()), e.style.setProperty("--vscode-editor-selectionBackground", w.trim()), !0;
401
+ const l = String((m = n == null ? void 0 : n.getPropertyValue("--vscode-editor-foreground")) != null ? m : ""), a = String((y = n == null ? void 0 : n.getPropertyValue("--vscode-editor-background")) != null ? y : ""), h = String((d = n == null ? void 0 : n.getPropertyValue("--vscode-editor-hoverHighlightBackground")) != null ? d : "");
402
+ if (l && a)
403
+ return e.style.setProperty("--vscode-editor-foreground", l.trim()), e.style.setProperty("--vscode-editor-background", a.trim()), e.style.setProperty("--vscode-editor-selectionBackground", h.trim()), !0;
378
404
  }
379
405
  function W() {
380
406
  try {
381
- const t = m.value;
407
+ const t = b.value;
382
408
  if (!t)
383
409
  return;
384
- const e = t.getBoundingClientRect(), o = window.scrollY + e.top, n = Fe();
410
+ const e = t.getBoundingClientRect(), o = window.scrollY + e.top, n = Oe();
385
411
  if (n != null && n > 0) {
386
412
  const l = e.height;
387
413
  t.style.height = `${Math.ceil(n)}px`, t.style.maxHeight = "none";
388
- const s = Math.ceil(n) - l;
389
- s !== 0 && o < window.scrollY && window.scrollBy(0, s);
414
+ const a = Math.ceil(n) - l;
415
+ a !== 0 && o < window.scrollY && window.scrollBy(0, a);
390
416
  }
391
417
  } catch (t) {
392
418
  }
393
419
  }
394
- function q() {
420
+ function U() {
395
421
  var t;
396
422
  try {
397
- const e = m.value;
423
+ const e = b.value;
398
424
  if (!e)
399
425
  return;
400
- const o = e.getBoundingClientRect(), n = window.scrollY + o.top, l = o.height, s = ct();
401
- if (se > 0 && (se--, A.value != null)) {
402
- const d = Math.min(A.value, s);
403
- e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
404
- const h = Math.ceil(d) - l;
405
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
426
+ const o = e.getBoundingClientRect(), n = window.scrollY + o.top, l = o.height, a = mt();
427
+ if (de > 0 && (de--, j.value != null)) {
428
+ const d = Math.min(j.value, a);
429
+ e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
430
+ const g = Math.ceil(d) - l;
431
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
406
432
  return;
407
433
  }
408
- const w = Fe();
409
- if (w != null && w > 0) {
410
- const d = Math.min(w, s);
411
- e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
412
- const h = Math.ceil(d) - l;
413
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
434
+ const h = Oe();
435
+ if (h != null && h > 0) {
436
+ const d = Math.min(h, a);
437
+ e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
438
+ const g = Math.ceil(d) - l;
439
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
414
440
  return;
415
441
  }
416
- if (A.value != null) {
417
- const d = Math.min(A.value, s);
418
- e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
419
- const h = Math.ceil(d) - l;
420
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
442
+ if (j.value != null) {
443
+ const d = Math.min(j.value, a);
444
+ e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
445
+ const g = Math.ceil(d) - l;
446
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
421
447
  return;
422
448
  }
423
- const p = Math.ceil(((t = e.getBoundingClientRect) == null ? void 0 : t.call(e).height) || 0);
424
- if (p > 0) {
425
- const d = Math.min(p, s);
426
- e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
427
- const h = Math.ceil(d) - l;
428
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
449
+ const m = Math.ceil(((t = e.getBoundingClientRect) == null ? void 0 : t.call(e).height) || 0);
450
+ if (m > 0) {
451
+ const d = Math.min(m, a);
452
+ e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
453
+ const g = Math.ceil(d) - l;
454
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
429
455
  return;
430
456
  }
431
- const k = Number.parseFloat(e.style.height);
432
- if (!Number.isNaN(k) && k > 0) {
433
- const d = Math.ceil(Math.min(k, s));
457
+ const y = Number.parseFloat(e.style.height);
458
+ if (!Number.isNaN(y) && y > 0) {
459
+ const d = Math.ceil(Math.min(y, a));
434
460
  e.style.height = `${d}px`;
435
- const h = d - l;
436
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
461
+ const g = d - l;
462
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
437
463
  } else {
438
- const d = Math.ceil(s);
464
+ const d = Math.ceil(a);
439
465
  e.style.height = `${d}px`;
440
- const h = d - l;
441
- h !== 0 && n < window.scrollY && window.scrollBy(0, h);
466
+ const g = d - l;
467
+ g !== 0 && n < window.scrollY && window.scrollBy(0, g);
442
468
  }
443
- e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
469
+ e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
444
470
  } catch (e) {
445
471
  }
446
472
  }
447
- function ct() {
473
+ function mt() {
448
474
  var o, n;
449
475
  const t = (n = (o = i.monacoOptions) == null ? void 0 : o.MAX_HEIGHT) != null ? n : 500;
450
476
  if (typeof t == "number")
@@ -452,106 +478,106 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
452
478
  const e = String(t).match(/^(\d+(?:\.\d+)?)/);
453
479
  return e ? Number.parseFloat(e[1]) : 500;
454
480
  }
455
- const ge = z(() => i.isShowPreview && (P.value === "html" || P.value === "svg")), J = z(() => P.value === "mermaid");
456
- Y(
481
+ const ye = _(() => i.isShowPreview && (D.value === "html" || D.value === "svg")), Z = _(() => D.value === "mermaid");
482
+ A(
457
483
  () => i.node.language,
458
484
  (t) => {
459
- P.value = xe(t);
485
+ D.value = Ee(t);
460
486
  }
461
- ), Y(
487
+ ), A(
462
488
  () => i.node.code,
463
- (t) => _(null, null, function* () {
489
+ (t) => R(null, null, function* () {
464
490
  var e, o;
465
491
  if (i.stream !== !1) {
466
- if (P.value || (P.value = xe(Se(t))), R && !Z.value && m.value)
492
+ if (D.value || (D.value = Ee(Pe(t))), V && !te.value && b.value)
467
493
  try {
468
- yield pe(m.value);
494
+ yield ke(b.value);
469
495
  } catch (n) {
470
496
  }
471
- H.value ? ce(String((e = i.node.originalCode) != null ? e : ""), String((o = i.node.updatedCode) != null ? o : ""), U.value) : ue(t, U.value), C.value && ae(() => W());
497
+ T.value ? ve(String((e = i.node.originalCode) != null ? e : ""), String((o = i.node.updatedCode) != null ? o : ""), K.value) : fe(t, K.value), M.value && se(() => W());
472
498
  }
473
499
  })
474
500
  );
475
- const dt = z(() => {
476
- const t = P.value;
477
- return t ? qe[t] || t.charAt(0).toUpperCase() + t.slice(1) : qe[""] || "Plain Text";
478
- }), ft = z(() => At(P.value || "")), vt = z(() => {
501
+ const ht = _(() => {
502
+ const t = D.value;
503
+ return t ? Ge[t] || t.charAt(0).toUpperCase() + t.slice(1) : Ge[""] || "Plain Text";
504
+ }), gt = _(() => Xt(D.value || "")), pt = _(() => {
479
505
  const t = {}, e = (l) => {
480
506
  if (l != null)
481
507
  return typeof l == "number" ? `${l}px` : String(l);
482
508
  }, o = e(i.minWidth), n = e(i.maxWidth);
483
509
  return o && (t.minWidth = o), n && (t.maxWidth = n), t;
484
510
  });
485
- function mt() {
486
- return _(this, null, function* () {
511
+ function wt() {
512
+ return R(this, null, function* () {
487
513
  try {
488
- typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && (yield navigator.clipboard.writeText(i.node.code)), $.value = !0, j("copy", i.node.code), setTimeout(() => {
489
- $.value = !1;
514
+ typeof navigator != "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && (yield navigator.clipboard.writeText(i.node.code)), X.value = !0, q("copy", i.node.code), setTimeout(() => {
515
+ X.value = !1;
490
516
  }, 1e3);
491
517
  } catch (t) {
492
518
  console.error("复制失败:", t);
493
519
  }
494
520
  });
495
521
  }
496
- function He(t) {
522
+ function De(t) {
497
523
  const e = t;
498
524
  return !e || e.disabled;
499
525
  }
500
- function D(t, e, o = "top") {
501
- if (He(t.currentTarget))
526
+ function P(t, e, o = "top") {
527
+ if (De(t.currentTarget))
502
528
  return;
503
529
  const n = t, l = (n == null ? void 0 : n.clientX) != null && (n == null ? void 0 : n.clientY) != null ? { x: n.clientX, y: n.clientY } : void 0;
504
- Xe(t.currentTarget, e, o, !1, l, i.isDark);
530
+ Ke(t.currentTarget, e, o, !1, l, i.isDark);
505
531
  }
506
532
  function S() {
507
- jt();
533
+ Gt();
508
534
  }
509
- function Te(t) {
510
- if (He(t.currentTarget))
535
+ function $e(t) {
536
+ if (De(t.currentTarget))
511
537
  return;
512
- const e = $.value ? a("common.copied") || "Copied" : a("common.copy") || "Copy", o = t, n = (o == null ? void 0 : o.clientX) != null && (o == null ? void 0 : o.clientY) != null ? { x: o.clientX, y: o.clientY } : void 0;
513
- Xe(t.currentTarget, e, "top", !1, n, i.isDark);
538
+ const e = X.value ? c("common.copied") || "Copied" : c("common.copy") || "Copy", o = t, n = (o == null ? void 0 : o.clientX) != null && (o == null ? void 0 : o.clientY) != null ? { x: o.clientX, y: o.clientY } : void 0;
539
+ Ke(t.currentTarget, e, "top", !1, n, i.isDark);
514
540
  }
515
- function ht() {
516
- C.value = !C.value;
517
- const t = H.value ? L() : N(), e = m.value;
518
- !t || !e || (C.value ? (ie(!0), e.style.maxHeight = "none", e.style.overflow = "visible", W()) : (ie(!1), e.style.overflow = "auto", q()));
541
+ function yt() {
542
+ M.value = !M.value;
543
+ const t = T.value ? $() : z(), e = b.value;
544
+ !t || !e || (M.value ? (ae(!0), e.style.maxHeight = "none", e.style.overflow = "visible", W()) : (ae(!1), e.style.overflow = "auto", U()));
519
545
  }
520
- function gt() {
546
+ function kt() {
521
547
  var t, e, o;
522
- if (M.value = !M.value, M.value) {
523
- if (m.value) {
524
- const n = Math.ceil(((e = (t = m.value).getBoundingClientRect) == null ? void 0 : e.call(t).height) || 0);
525
- n > 0 && (A.value = n);
548
+ if (B.value = !B.value, B.value) {
549
+ if (b.value) {
550
+ const n = Math.ceil(((e = (t = b.value).getBoundingClientRect) == null ? void 0 : e.call(t).height) || 0);
551
+ n > 0 && (j.value = n);
526
552
  }
527
- ie(!1);
553
+ ae(!1);
528
554
  } else {
529
- C.value && ie(!0), m.value && A.value != null && (m.value.style.height = `${A.value}px`);
530
- const n = H.value ? L() : N();
555
+ M.value && ae(!0), b.value && j.value != null && (b.value.style.height = `${j.value}px`);
556
+ const n = T.value ? $() : z();
531
557
  try {
532
558
  (o = n == null ? void 0 : n.layout) == null || o.call(n);
533
559
  } catch (l) {
534
560
  }
535
- se = 2, ae(() => {
536
- C.value ? W() : q();
561
+ de = 2, se(() => {
562
+ M.value ? W() : U();
537
563
  });
538
564
  }
539
565
  }
540
- Y(
566
+ A(
541
567
  () => v.value,
542
568
  (t, e) => {
543
- const o = H.value ? L() : N();
544
- o && typeof t == "number" && Number.isFinite(t) && t > 0 && (o.updateOptions({ fontSize: t }), C.value && !M.value && W());
569
+ const o = T.value ? $() : z();
570
+ o && typeof t == "number" && Number.isFinite(t) && t > 0 && (o.updateOptions({ fontSize: t }), M.value && !B.value && W());
545
571
  },
546
572
  { flush: "post", immediate: !1 }
547
573
  );
548
- function pt() {
549
- if (!ge.value)
574
+ function xt() {
575
+ if (!ye.value)
550
576
  return;
551
- const t = P.value;
552
- if (F.value) {
553
- const e = t === "html" ? "text/html" : "image/svg+xml", o = t === "html" ? a("artifacts.htmlPreviewTitle") || "HTML Preview" : a("artifacts.svgPreviewTitle") || "SVG Preview";
554
- j("previewCode", {
577
+ const t = D.value;
578
+ if (x.value) {
579
+ const e = t === "html" ? "text/html" : "image/svg+xml", o = t === "html" ? c("artifacts.htmlPreviewTitle") || "HTML Preview" : c("artifacts.svgPreviewTitle") || "SVG Preview";
580
+ q("previewCode", {
555
581
  node: i.node,
556
582
  artifactType: e,
557
583
  artifactTitle: o,
@@ -559,144 +585,144 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
559
585
  });
560
586
  return;
561
587
  }
562
- t === "html" && (ne.value = !ne.value);
588
+ t === "html" && (le.value = !le.value);
563
589
  }
564
- function ie(t) {
590
+ function ae(t) {
565
591
  var e, o;
566
592
  try {
567
- if (H.value) {
568
- const n = L();
593
+ if (T.value) {
594
+ const n = $();
569
595
  (e = n == null ? void 0 : n.updateOptions) == null || e.call(n, { automaticLayout: t });
570
596
  } else {
571
- const n = N();
597
+ const n = z();
572
598
  (o = n == null ? void 0 : n.updateOptions) == null || o.call(n, { automaticLayout: t });
573
599
  }
574
600
  } catch (n) {
575
601
  }
576
602
  }
577
- function wt(t) {
578
- return _(this, null, function* () {
603
+ function bt(t) {
604
+ return R(this, null, function* () {
579
605
  var o, n, l;
580
- if (!R)
606
+ if (!V)
581
607
  return;
582
- H.value ? (de(), ee ? yield ee(t, String((o = i.node.originalCode) != null ? o : ""), String((n = i.node.updatedCode) != null ? n : ""), U.value) : yield R(t, i.node.code, U.value)) : yield R(t, i.node.code, U.value);
583
- const e = H.value ? L() : N();
608
+ T.value ? (me(), oe ? yield oe(t, String((o = i.node.originalCode) != null ? o : ""), String((n = i.node.updatedCode) != null ? n : ""), K.value) : yield V(t, i.node.code, K.value)) : yield V(t, i.node.code, K.value);
609
+ const e = T.value ? $() : z();
584
610
  if (typeof ((l = i.monacoOptions) == null ? void 0 : l.fontSize) == "number")
585
- e == null || e.updateOptions({ fontSize: i.monacoOptions.fontSize, automaticLayout: !1 }), T.value = i.monacoOptions.fontSize, v.value = i.monacoOptions.fontSize;
611
+ e == null || e.updateOptions({ fontSize: i.monacoOptions.fontSize, automaticLayout: !1 }), H.value = i.monacoOptions.fontSize, v.value = i.monacoOptions.fontSize;
586
612
  else {
587
- const s = Ee();
588
- s && s > 0 ? (T.value = s, v.value = s) : (T.value = 12, v.value = 12);
613
+ const a = Le();
614
+ a && a > 0 ? (H.value = a, v.value = a) : (H.value = 12, v.value = 12);
589
615
  }
590
- !C.value && !M.value && q(), i.loading === !1 && (yield ye(), ae(() => {
591
- C.value && !M.value ? W() : M.value || q();
616
+ !M.value && !B.value && U(), i.loading === !1 && (yield Me(), se(() => {
617
+ M.value && !B.value ? W() : B.value || U();
592
618
  }));
593
619
  });
594
620
  }
595
- function pe(t) {
596
- return R ? K || (Z.value = !0, K = _(null, null, function* () {
597
- yield wt(t);
621
+ function ke(t) {
622
+ return V ? Q || (te.value = !0, Q = R(null, null, function* () {
623
+ yield bt(t);
598
624
  }).finally(() => {
599
- K = null;
600
- }), K) : null;
625
+ Q = null;
626
+ }), Q) : null;
601
627
  }
602
- const De = Y(
603
- () => [m.value, J.value, H.value, i.stream, i.loading, Be.value, V.value],
604
- (p) => _(null, [p], function* ([t, e, o, n, l, s, w]) {
605
- if (!t || !R || !w || n === !1 && l !== !1)
628
+ const Ne = A(
629
+ () => [b.value, Z.value, T.value, i.stream, i.loading, He.value, I.value],
630
+ (m) => R(null, [m], function* ([t, e, o, n, l, a, h]) {
631
+ if (!t || !V || !h || n === !1 && l !== !1)
606
632
  return;
607
- if (J.value) {
608
- oe(), De();
633
+ if (Z.value) {
634
+ ie(), Ne();
609
635
  return;
610
636
  }
611
- const k = pe(t);
612
- k && (yield k, De());
637
+ const y = ke(t);
638
+ y && (yield y, Ne());
613
639
  })
614
- ), yt = Y(
615
- () => [i.darkTheme, i.lightTheme, Z.value, V.value],
640
+ ), Ct = A(
641
+ () => [i.darkTheme, i.lightTheme, te.value, I.value],
616
642
  () => {
617
- if (!(!Z.value || !V.value)) {
618
- if (J.value)
619
- return yt();
620
- kt();
643
+ if (!(!te.value || !I.value)) {
644
+ if (Z.value)
645
+ return Ct();
646
+ Mt();
621
647
  }
622
648
  }
623
649
  );
624
- function Pe() {
650
+ function ze() {
625
651
  return i.isDark ? i.darkTheme : i.lightTheme;
626
652
  }
627
- function kt() {
628
- const t = Pe();
629
- t && fe(t);
653
+ function Mt() {
654
+ const t = ze();
655
+ t && he(t);
630
656
  }
631
- const xt = Y(
632
- () => [i.monacoOptions, V.value],
657
+ const Bt = A(
658
+ () => [i.monacoOptions, I.value],
633
659
  () => {
634
660
  var o, n;
635
- if (!R || !V.value)
661
+ if (!V || !I.value)
636
662
  return;
637
- if (J.value)
638
- return xt();
639
- const t = H.value ? L() : N(), e = typeof ((o = i.monacoOptions) == null ? void 0 : o.fontSize) == "number" ? i.monacoOptions.fontSize : Number.isFinite(v.value) ? v.value : void 0;
640
- typeof e == "number" && Number.isFinite(e) && e > 0 && ((n = t == null ? void 0 : t.updateOptions) == null || n.call(t, { fontSize: e })), C.value && !M.value ? W() : M.value || q();
663
+ if (Z.value)
664
+ return Bt();
665
+ const t = T.value ? $() : z(), e = typeof ((o = i.monacoOptions) == null ? void 0 : o.fontSize) == "number" ? i.monacoOptions.fontSize : Number.isFinite(v.value) ? v.value : void 0;
666
+ typeof e == "number" && Number.isFinite(e) && e > 0 && ((n = t == null ? void 0 : t.updateOptions) == null || n.call(t, { fontSize: e })), M.value && !B.value ? W() : B.value || U();
641
667
  },
642
668
  { deep: !0 }
643
- ), le = Y(
644
- () => [i.loading, V.value],
645
- (o) => _(null, [o], function* ([t, e]) {
669
+ ), re = A(
670
+ () => [i.loading, I.value],
671
+ (o) => R(null, [o], function* ([t, e]) {
646
672
  if (e) {
647
- if (J.value) {
648
- ye(() => {
649
- le == null || le();
673
+ if (Z.value) {
674
+ Me(() => {
675
+ re == null || re();
650
676
  });
651
677
  return;
652
678
  }
653
- t || (yield ye(), ae(() => {
654
- M.value || (C.value ? W() : q()), le();
679
+ t || (yield Me(), se(() => {
680
+ B.value || (M.value ? W() : U()), re();
655
681
  }));
656
682
  }
657
683
  }),
658
684
  { immediate: !0, flush: "post" }
659
685
  );
660
- return et(() => {
661
- oe();
662
- }), (t, e) => ve.value ? (E(), Ce(g(Wt), {
686
+ return it(() => {
687
+ ie();
688
+ }), (t, e) => ge.value ? (F(), Fe(p(Ut), {
663
689
  key: 0,
664
690
  node: f.node,
665
691
  loading: i.loading
666
- }, null, 8, ["node", "loading"])) : (E(), O("div", {
692
+ }, null, 8, ["node", "loading"])) : (F(), N("div", {
667
693
  key: 1,
668
694
  ref_key: "container",
669
- ref: y,
670
- style: Ae(vt.value),
671
- class: Q(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm", [
695
+ ref: ce,
696
+ style: qe(pt.value),
697
+ class: ee(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm", [
672
698
  i.isDark ? "border-gray-700/30 bg-gray-900" : "border-gray-200 bg-white",
673
699
  { "is-rendering": i.loading, "is-dark": i.isDark }
674
700
  ]])
675
701
  }, [
676
- i.showHeader ? (E(), O("div", Qt, [
677
- ke(t.$slots, "header-left", {}, () => [
678
- r("div", Zt, [
702
+ i.showHeader ? (F(), N("div", oo, [
703
+ Be(t.$slots, "header-left", {}, () => [
704
+ r("div", no, [
679
705
  r("span", {
680
706
  class: "icon-slot h-4 w-4 flex-shrink-0",
681
- innerHTML: ft.value
682
- }, null, 8, eo),
683
- r("span", to, Me(dt.value), 1)
707
+ innerHTML: gt.value
708
+ }, null, 8, io),
709
+ r("span", lo, Te(ht.value), 1)
684
710
  ])
685
711
  ], !0),
686
- ke(t.$slots, "header-right", {}, () => [
687
- r("div", oo, [
712
+ Be(t.$slots, "header-right", {}, () => [
713
+ r("div", ao, [
688
714
  r("button", {
689
715
  type: "button",
690
716
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
691
- "aria-pressed": M.value,
692
- onClick: gt,
693
- onMouseenter: e[0] || (e[0] = (o) => D(o, M.value ? g(a)("common.expand") || "Expand" : g(a)("common.collapse") || "Collapse")),
694
- onFocus: e[1] || (e[1] = (o) => D(o, M.value ? g(a)("common.expand") || "Expand" : g(a)("common.collapse") || "Collapse")),
717
+ "aria-pressed": B.value,
718
+ onClick: kt,
719
+ onMouseenter: e[0] || (e[0] = (o) => P(o, B.value ? p(c)("common.expand") || "Expand" : p(c)("common.collapse") || "Collapse")),
720
+ onFocus: e[1] || (e[1] = (o) => P(o, B.value ? p(c)("common.expand") || "Expand" : p(c)("common.collapse") || "Collapse")),
695
721
  onMouseleave: S,
696
722
  onBlur: S
697
723
  }, [
698
- (E(), O("svg", {
699
- style: Ae({ rotate: M.value ? "0deg" : "90deg" }),
724
+ (F(), N("svg", {
725
+ style: qe({ rotate: B.value ? "0deg" : "90deg" }),
700
726
  xmlns: "http://www.w3.org/2000/svg",
701
727
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
702
728
  "aria-hidden": "true",
@@ -715,15 +741,15 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
715
741
  d: "m9 18l6-6l-6-6"
716
742
  }, null, -1)
717
743
  ])], 4))
718
- ], 40, no),
719
- i.showFontSizeButtons && i.enableFontSizeControl ? (E(), O(Vt, { key: 0 }, [
744
+ ], 40, ro),
745
+ i.showFontSizeButtons && i.enableFontSizeControl ? (F(), N(Yt, { key: 0 }, [
720
746
  r("button", {
721
747
  type: "button",
722
748
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
723
- disabled: Number.isFinite(v.value) ? v.value <= Ue : !1,
724
- onClick: e[2] || (e[2] = (o) => rt()),
725
- onMouseenter: e[3] || (e[3] = (o) => D(o, g(a)("common.decrease") || "Decrease")),
726
- onFocus: e[4] || (e[4] = (o) => D(o, g(a)("common.decrease") || "Decrease")),
749
+ disabled: Number.isFinite(v.value) ? v.value <= Qe : !1,
750
+ onClick: e[2] || (e[2] = (o) => dt()),
751
+ onMouseenter: e[3] || (e[3] = (o) => P(o, p(c)("common.decrease") || "Decrease")),
752
+ onFocus: e[4] || (e[4] = (o) => P(o, p(c)("common.decrease") || "Decrease")),
727
753
  onMouseleave: S,
728
754
  onBlur: S
729
755
  }, [...e[18] || (e[18] = [
@@ -746,14 +772,14 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
746
772
  d: "M5 12h14"
747
773
  })
748
774
  ], -1)
749
- ])], 40, io),
775
+ ])], 40, so),
750
776
  r("button", {
751
777
  type: "button",
752
778
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
753
- disabled: !it.value || v.value === T.value,
754
- onClick: e[5] || (e[5] = (o) => st()),
755
- onMouseenter: e[6] || (e[6] = (o) => D(o, g(a)("common.reset") || "Reset")),
756
- onFocus: e[7] || (e[7] = (o) => D(o, g(a)("common.reset") || "Reset")),
779
+ disabled: !st.value || v.value === H.value,
780
+ onClick: e[5] || (e[5] = (o) => ft()),
781
+ onMouseenter: e[6] || (e[6] = (o) => P(o, p(c)("common.reset") || "Reset")),
782
+ onFocus: e[7] || (e[7] = (o) => P(o, p(c)("common.reset") || "Reset")),
757
783
  onMouseleave: S,
758
784
  onBlur: S
759
785
  }, [...e[19] || (e[19] = [
@@ -778,14 +804,14 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
778
804
  r("path", { d: "M3 3v5h5" })
779
805
  ])
780
806
  ], -1)
781
- ])], 40, lo),
807
+ ])], 40, uo),
782
808
  r("button", {
783
809
  type: "button",
784
810
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
785
- disabled: Number.isFinite(v.value) ? v.value >= Ge : !1,
786
- onClick: e[8] || (e[8] = (o) => at()),
787
- onMouseenter: e[9] || (e[9] = (o) => D(o, g(a)("common.increase") || "Increase")),
788
- onFocus: e[10] || (e[10] = (o) => D(o, g(a)("common.increase") || "Increase")),
811
+ disabled: Number.isFinite(v.value) ? v.value >= Ze : !1,
812
+ onClick: e[8] || (e[8] = (o) => ct()),
813
+ onMouseenter: e[9] || (e[9] = (o) => P(o, p(c)("common.increase") || "Increase")),
814
+ onFocus: e[10] || (e[10] = (o) => P(o, p(c)("common.increase") || "Increase")),
789
815
  onMouseleave: S,
790
816
  onBlur: S
791
817
  }, [...e[20] || (e[20] = [
@@ -808,20 +834,20 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
808
834
  d: "M5 12h14m-7-7v14"
809
835
  })
810
836
  ], -1)
811
- ])], 40, ao)
812
- ], 64)) : X("", !0),
813
- i.showCopyButton ? (E(), O("button", {
837
+ ])], 40, co)
838
+ ], 64)) : G("", !0),
839
+ i.showCopyButton ? (F(), N("button", {
814
840
  key: 1,
815
841
  type: "button",
816
842
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
817
- "aria-label": $.value ? g(a)("common.copied") || "Copied" : g(a)("common.copy") || "Copy",
818
- onClick: mt,
819
- onMouseenter: e[11] || (e[11] = (o) => Te(o)),
820
- onFocus: e[12] || (e[12] = (o) => Te(o)),
843
+ "aria-label": X.value ? p(c)("common.copied") || "Copied" : p(c)("common.copy") || "Copy",
844
+ onClick: wt,
845
+ onMouseenter: e[11] || (e[11] = (o) => $e(o)),
846
+ onFocus: e[12] || (e[12] = (o) => $e(o)),
821
847
  onMouseleave: S,
822
848
  onBlur: S
823
849
  }, [
824
- $.value ? (E(), O("svg", uo, [...e[22] || (e[22] = [
850
+ X.value ? (F(), N("svg", mo, [...e[22] || (e[22] = [
825
851
  r("path", {
826
852
  fill: "none",
827
853
  stroke: "currentColor",
@@ -830,7 +856,7 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
830
856
  "stroke-width": "2",
831
857
  d: "M20 6L9 17l-5-5"
832
858
  }, null, -1)
833
- ])])) : (E(), O("svg", so, [...e[21] || (e[21] = [
859
+ ])])) : (F(), N("svg", vo, [...e[21] || (e[21] = [
834
860
  r("g", {
835
861
  fill: "none",
836
862
  stroke: "currentColor",
@@ -849,19 +875,19 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
849
875
  r("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
850
876
  ], -1)
851
877
  ])]))
852
- ], 40, ro)) : X("", !0),
853
- i.showExpandButton ? (E(), O("button", {
878
+ ], 40, fo)) : G("", !0),
879
+ i.showExpandButton ? (F(), N("button", {
854
880
  key: 2,
855
881
  type: "button",
856
882
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
857
- "aria-pressed": C.value,
858
- onClick: ht,
859
- onMouseenter: e[13] || (e[13] = (o) => D(o, C.value ? g(a)("common.collapse") || "Collapse" : g(a)("common.expand") || "Expand")),
860
- onFocus: e[14] || (e[14] = (o) => D(o, C.value ? g(a)("common.collapse") || "Collapse" : g(a)("common.expand") || "Expand")),
883
+ "aria-pressed": M.value,
884
+ onClick: yt,
885
+ onMouseenter: e[13] || (e[13] = (o) => P(o, M.value ? p(c)("common.collapse") || "Collapse" : p(c)("common.expand") || "Expand")),
886
+ onFocus: e[14] || (e[14] = (o) => P(o, M.value ? p(c)("common.collapse") || "Collapse" : p(c)("common.expand") || "Expand")),
861
887
  onMouseleave: S,
862
888
  onBlur: S
863
889
  }, [
864
- C.value ? (E(), O("svg", fo, [...e[23] || (e[23] = [
890
+ M.value ? (F(), N("svg", go, [...e[23] || (e[23] = [
865
891
  r("path", {
866
892
  fill: "none",
867
893
  stroke: "currentColor",
@@ -870,7 +896,7 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
870
896
  "stroke-width": "2",
871
897
  d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"
872
898
  }, null, -1)
873
- ])])) : (E(), O("svg", vo, [...e[24] || (e[24] = [
899
+ ])])) : (F(), N("svg", po, [...e[24] || (e[24] = [
874
900
  r("path", {
875
901
  fill: "none",
876
902
  stroke: "currentColor",
@@ -880,15 +906,15 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
880
906
  d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"
881
907
  }, null, -1)
882
908
  ])]))
883
- ], 40, co)) : X("", !0),
884
- ge.value && i.showPreviewButton ? (E(), O("button", {
909
+ ], 40, ho)) : G("", !0),
910
+ ye.value && i.showPreviewButton ? (F(), N("button", {
885
911
  key: 3,
886
912
  type: "button",
887
913
  class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
888
- "aria-label": g(a)("common.preview") || "Preview",
889
- onClick: pt,
890
- onMouseenter: e[15] || (e[15] = (o) => D(o, g(a)("common.preview") || "Preview")),
891
- onFocus: e[16] || (e[16] = (o) => D(o, g(a)("common.preview") || "Preview")),
914
+ "aria-label": p(c)("common.preview") || "Preview",
915
+ onClick: xt,
916
+ onMouseenter: e[15] || (e[15] = (o) => P(o, p(c)("common.preview") || "Preview")),
917
+ onFocus: e[16] || (e[16] = (o) => P(o, p(c)("common.preview") || "Preview")),
892
918
  onMouseleave: S,
893
919
  onBlur: S
894
920
  }, [...e[25] || (e[25] = [
@@ -907,25 +933,25 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
907
933
  r("path", { d: "M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23" })
908
934
  ])
909
935
  ], -1)
910
- ])], 40, mo)) : X("", !0)
936
+ ])], 40, wo)) : G("", !0)
911
937
  ])
912
938
  ], !0)
913
- ])) : X("", !0),
914
- We(r("div", {
939
+ ])) : G("", !0),
940
+ Xe(r("div", {
915
941
  ref_key: "codeEditor",
916
- ref: m,
917
- class: Q(["code-editor-container", [f.stream ? "" : "code-height-placeholder"]])
942
+ ref: b,
943
+ class: ee(["code-editor-container", [f.stream ? "" : "code-height-placeholder"]])
918
944
  }, null, 2), [
919
- [je, !M.value && (f.stream ? !0 : !f.loading)]
945
+ [Ue, !B.value && (f.stream ? !0 : !f.loading)]
920
946
  ]),
921
- ne.value && !F.value && ge.value && P.value === "html" ? (E(), Ce(Jt, {
947
+ le.value && !x.value && ye.value && D.value === "html" ? (F(), Fe(to, {
922
948
  key: 1,
923
949
  code: f.node.code,
924
950
  "is-dark": i.isDark,
925
- "on-close": () => ne.value = !1
926
- }, null, 8, ["code", "is-dark", "on-close"])) : X("", !0),
927
- We(r("div", ho, [
928
- ke(t.$slots, "loading", {
951
+ "on-close": () => le.value = !1
952
+ }, null, 8, ["code", "is-dark", "on-close"])) : G("", !0),
953
+ Xe(r("div", yo, [
954
+ Be(t.$slots, "loading", {
929
955
  loading: f.loading,
930
956
  stream: f.stream
931
957
  }, () => [
@@ -936,15 +962,15 @@ const qt = { class: "html-preview-frame__header" }, Xt = { class: "html-preview-
936
962
  ], -1))
937
963
  ], !0)
938
964
  ], 512), [
939
- [je, !f.stream && f.loading]
965
+ [Ue, !f.stream && f.loading]
940
966
  ]),
941
- r("span", go, Me($.value ? g(a)("common.copied") || "Copied" : ""), 1)
967
+ r("span", ko, Te(X.value ? p(c)("common.copied") || "Copied" : ""), 1)
942
968
  ], 6));
943
969
  }
944
- }), be = /* @__PURE__ */ ot(po, [["__scopeId", "data-v-f37961ae"]]);
945
- be.install = (f) => {
946
- f.component(be.__name, be);
970
+ }), Se = /* @__PURE__ */ at(xo, [["__scopeId", "data-v-acbbd971"]]);
971
+ Se.install = (f) => {
972
+ f.component(Se.__name, Se);
947
973
  };
948
974
  export {
949
- be as default
975
+ Se as default
950
976
  };