markstream-vue 0.0.2-beta.9 → 0.0.3-beta.0
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.
- package/README.md +33 -0
- package/README.zh-CN.md +33 -0
- package/dist/exports-ByrWvfQh.cjs +246 -0
- package/dist/{exports-CyoL-8XF.js → exports-CuW10Rlw.js} +2259 -2177
- package/dist/exports.js +1 -1
- package/dist/{index-DoRl8S3_.js → index-BZqRC51k.js} +1 -1
- package/dist/index-CapyHsmU.cjs +22 -0
- package/dist/{index-OTPe0l-Z.cjs → index-ClFlwUOZ.cjs} +1 -1
- package/dist/{index-Br7IvHNe.cjs → index-Cn5LHgOE.cjs} +1 -1
- package/dist/{index-DdtMPiwH.js → index-D-TkURzk.js} +12 -12
- package/dist/{index-CDRkq20z.js → index-DGTqKnzM.js} +323 -331
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +42 -40
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +4 -4
- package/dist/exports-DADWwNRQ.cjs +0 -246
- package/dist/index-CcqRGphH.cjs +0 -22
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
6
|
for (var i in u || (u = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
|
|
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]);
|
|
11
11
|
return f;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, Ye = (f, u) => Tt(f, Dt(u));
|
|
13
|
+
var _ = (f, u, i) => new Promise((j, I) => {
|
|
14
|
+
var F = (y) => {
|
|
15
15
|
try {
|
|
16
16
|
m(i.next(y));
|
|
17
17
|
} catch ($) {
|
|
18
|
-
|
|
18
|
+
I($);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, a = (y) => {
|
|
21
21
|
try {
|
|
22
22
|
m(i.throw(y));
|
|
23
23
|
} catch ($) {
|
|
24
|
-
|
|
24
|
+
I($);
|
|
25
25
|
}
|
|
26
|
-
}, m = (y) => y.done ? j(y.value) : Promise.resolve(y.value).then(
|
|
26
|
+
}, m = (y) => y.done ? j(y.value) : Promise.resolve(y.value).then(F, a);
|
|
27
27
|
m((i = i.apply(f, u)).next());
|
|
28
28
|
});
|
|
29
|
-
import { defineComponent as
|
|
30
|
-
import { u as
|
|
31
|
-
const
|
|
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({
|
|
32
32
|
__name: "HtmlPreviewFrame",
|
|
33
33
|
props: {
|
|
34
34
|
code: {},
|
|
@@ -37,10 +37,10 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
37
37
|
title: {}
|
|
38
38
|
},
|
|
39
39
|
setup(f) {
|
|
40
|
-
const u = f, { t: i } =
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
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
44
|
const m = u.isDark ? "#020617" : "#ffffff", y = u.isDark ? "#e5e7eb" : "#020617";
|
|
45
45
|
return `<!doctype html>
|
|
46
46
|
<html lang="en">
|
|
@@ -61,59 +61,59 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
61
61
|
</style>
|
|
62
62
|
</head>
|
|
63
63
|
<body>
|
|
64
|
-
${
|
|
64
|
+
${F}
|
|
65
65
|
</body>
|
|
66
66
|
</html>`;
|
|
67
67
|
});
|
|
68
|
-
function
|
|
69
|
-
var
|
|
70
|
-
(
|
|
68
|
+
function I(F) {
|
|
69
|
+
var a;
|
|
70
|
+
(F.key === "Escape" || F.key === "Esc") && ((a = u.onClose) == null || a.call(u));
|
|
71
71
|
}
|
|
72
|
-
return
|
|
73
|
-
typeof window != "undefined" && window.addEventListener("keydown",
|
|
74
|
-
}),
|
|
75
|
-
typeof window != "undefined" && window.removeEventListener("keydown",
|
|
76
|
-
}), (
|
|
77
|
-
|
|
78
|
-
class:
|
|
79
|
-
onClick:
|
|
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" }, [
|
|
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
80
|
var y;
|
|
81
81
|
return (y = u.onClose) == null ? void 0 : y.call(u);
|
|
82
82
|
})
|
|
83
83
|
}, [
|
|
84
|
-
|
|
85
|
-
class:
|
|
86
|
-
onClick:
|
|
84
|
+
r("div", {
|
|
85
|
+
class: Q(["html-preview-frame", { "html-preview-frame--dark": u.isDark }]),
|
|
86
|
+
onClick: a[1] || (a[1] = Nt(() => {
|
|
87
87
|
}, ["stop"]))
|
|
88
88
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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)
|
|
93
93
|
]),
|
|
94
|
-
|
|
94
|
+
r("button", {
|
|
95
95
|
type: "button",
|
|
96
|
-
class:
|
|
97
|
-
onClick:
|
|
96
|
+
class: Q(["html-preview-frame__close", { "html-preview-frame__close--dark": u.isDark }]),
|
|
97
|
+
onClick: a[0] || (a[0] = (m) => {
|
|
98
98
|
var y;
|
|
99
99
|
return (y = u.onClose) == null ? void 0 : y.call(u);
|
|
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
106
|
srcdoc: j.value
|
|
107
|
-
}, null, 8,
|
|
107
|
+
}, null, 8, Gt)
|
|
108
108
|
], 2)
|
|
109
109
|
], 2)
|
|
110
110
|
]));
|
|
111
111
|
}
|
|
112
|
-
}),
|
|
112
|
+
}), Jt = /* @__PURE__ */ ot(Kt, [["__scopeId", "data-v-3cf0ed56"]]), Qt = {
|
|
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
|
-
},
|
|
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 = {
|
|
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 Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
123
123
|
height: "1em",
|
|
124
124
|
viewBox: "0 0 24 24",
|
|
125
125
|
class: "w-3 h-3"
|
|
126
|
-
},
|
|
126
|
+
}, uo = {
|
|
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 Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
133
133
|
height: "1em",
|
|
134
134
|
viewBox: "0 0 24 24",
|
|
135
135
|
class: "w-3 h-3"
|
|
136
|
-
},
|
|
136
|
+
}, co = ["aria-pressed"], fo = {
|
|
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 Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
143
143
|
height: "1em",
|
|
144
144
|
viewBox: "0 0 24 24",
|
|
145
145
|
class: "w-3 h-3"
|
|
146
|
-
},
|
|
146
|
+
}, vo = {
|
|
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 Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
153
153
|
height: "1em",
|
|
154
154
|
viewBox: "0 0 24 24",
|
|
155
155
|
class: "w-3 h-3"
|
|
156
|
-
},
|
|
156
|
+
}, mo = ["aria-label"], ho = { class: "code-loading-placeholder" }, go = {
|
|
157
157
|
class: "sr-only",
|
|
158
158
|
"aria-live": "polite",
|
|
159
159
|
role: "status"
|
|
160
|
-
},
|
|
160
|
+
}, Ue = 10, Ge = 36, Ke = 1, Je = 0, Qe = 1.5, re = 1, po = /* @__PURE__ */ Ze({
|
|
161
161
|
__name: "CodeBlockNode",
|
|
162
162
|
props: {
|
|
163
163
|
node: {},
|
|
@@ -181,78 +181,78 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
181
181
|
},
|
|
182
182
|
emits: ["previewCode", "copy"],
|
|
183
183
|
setup(f, { emit: u }) {
|
|
184
|
-
var
|
|
185
|
-
const i = f, j = u,
|
|
186
|
-
const t =
|
|
184
|
+
var Le;
|
|
185
|
+
const i = f, j = u, I = zt(), F = z(() => {
|
|
186
|
+
const t = I == null ? void 0 : I.vnode.props;
|
|
187
187
|
return !!(t && (t.onPreviewCode || t.onPreviewCode));
|
|
188
|
-
}), { t:
|
|
189
|
-
let
|
|
190
|
-
const
|
|
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
191
|
typeof window != "undefined" && Y(
|
|
192
192
|
() => y.value,
|
|
193
193
|
(t) => {
|
|
194
194
|
var o;
|
|
195
|
-
if ((o =
|
|
196
|
-
|
|
195
|
+
if ((o = G.value) == null || o.destroy(), G.value = null, !t) {
|
|
196
|
+
V.value = !1;
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
const e =
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
const e = nt(t, { rootMargin: "400px" });
|
|
200
|
+
G.value = e, V.value = e.isVisible.value, e.whenVisible.then(() => {
|
|
201
|
+
V.value = !0;
|
|
202
202
|
});
|
|
203
203
|
},
|
|
204
204
|
{ immediate: !0 }
|
|
205
|
-
),
|
|
205
|
+
), It(() => {
|
|
206
206
|
var t;
|
|
207
|
-
(t =
|
|
207
|
+
(t = G.value) == null || t.destroy(), G.value = null;
|
|
208
208
|
});
|
|
209
|
-
let
|
|
210
|
-
}, ue = () => {
|
|
211
|
-
}, ee = () => null, N = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
|
|
212
|
-
} }), P = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
|
|
213
|
-
} }), te = () => {
|
|
209
|
+
let R = null, ee = null, ue = () => {
|
|
214
210
|
}, ce = () => {
|
|
215
|
-
},
|
|
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 = () => {
|
|
216
216
|
var t;
|
|
217
217
|
return String((t = i.node.language) != null ? t : "plaintext");
|
|
218
|
-
},
|
|
218
|
+
}, fe = () => _(null, null, function* () {
|
|
219
219
|
});
|
|
220
|
-
const
|
|
221
|
-
typeof window != "undefined" &&
|
|
220
|
+
const H = z(() => i.node.diff), ve = B(!1), ne = B(!1);
|
|
221
|
+
typeof window != "undefined" && _(null, null, function* () {
|
|
222
222
|
try {
|
|
223
|
-
const t = yield
|
|
223
|
+
const t = yield Yt();
|
|
224
224
|
if (!t) {
|
|
225
|
-
|
|
225
|
+
ve.value = !0;
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
const e = t.useMonaco, o = t.detectLanguage;
|
|
229
|
-
if (typeof o == "function" && (
|
|
230
|
-
const n =
|
|
229
|
+
if (typeof o == "function" && (Se = o), typeof e == "function") {
|
|
230
|
+
const n = Pe();
|
|
231
231
|
if (n && i.themes && Array.isArray(i.themes) && !i.themes.includes(n))
|
|
232
232
|
throw new Error("Preferred theme not in provided themes array");
|
|
233
|
-
const l = e(_e(
|
|
233
|
+
const l = e(Ye(_e({
|
|
234
234
|
wordWrap: "on",
|
|
235
235
|
wrappingIndent: "same",
|
|
236
236
|
themes: i.themes,
|
|
237
237
|
theme: n
|
|
238
238
|
}, i.monacoOptions || {}), {
|
|
239
239
|
onThemeChange() {
|
|
240
|
-
|
|
240
|
+
ut();
|
|
241
241
|
}
|
|
242
242
|
}));
|
|
243
|
-
|
|
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));
|
|
244
244
|
}
|
|
245
245
|
} catch (t) {
|
|
246
|
-
|
|
246
|
+
ve.value = !0;
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
const
|
|
250
|
-
typeof ((
|
|
251
|
-
), v = B(
|
|
252
|
-
const t =
|
|
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;
|
|
253
253
|
return typeof t == "number" && Number.isFinite(t) && t > 0 && typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
254
254
|
});
|
|
255
|
-
function
|
|
255
|
+
function lt() {
|
|
256
256
|
try {
|
|
257
257
|
const t = m.value;
|
|
258
258
|
if (!t)
|
|
@@ -267,10 +267,10 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
267
267
|
}
|
|
268
268
|
return null;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Ee() {
|
|
271
271
|
var t, e, o, n, l;
|
|
272
272
|
try {
|
|
273
|
-
const s =
|
|
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
274
|
if (s && p != null) {
|
|
275
275
|
const k = (l = s.getOption) == null ? void 0 : l.call(s, p), d = k == null ? void 0 : k.fontSize;
|
|
276
276
|
if (typeof d == "number" && Number.isFinite(d) && d > 0)
|
|
@@ -296,10 +296,10 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
296
296
|
}
|
|
297
297
|
return null;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function me(t) {
|
|
300
300
|
var n, l;
|
|
301
301
|
try {
|
|
302
|
-
const s =
|
|
302
|
+
const s = te(), w = (n = s == null ? void 0 : s.EditorOption) == null ? void 0 : n.lineHeight;
|
|
303
303
|
if (w != null) {
|
|
304
304
|
const p = (l = t == null ? void 0 : t.getOption) == null ? void 0 : l.call(t, w);
|
|
305
305
|
if (typeof p == "number" && p > 0)
|
|
@@ -307,60 +307,60 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
307
307
|
}
|
|
308
308
|
} catch (s) {
|
|
309
309
|
}
|
|
310
|
-
const e =
|
|
310
|
+
const e = lt();
|
|
311
311
|
if (e && e > 0)
|
|
312
312
|
return e;
|
|
313
313
|
const o = Number.isFinite(v.value) && v.value > 0 ? v.value : 12;
|
|
314
314
|
return Math.max(12, Math.round(o * 1.35));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function he() {
|
|
317
317
|
var e;
|
|
318
|
-
if (Number.isFinite(v.value) && v.value > 0 && Number.isFinite(
|
|
318
|
+
if (Number.isFinite(v.value) && v.value > 0 && Number.isFinite(T.value))
|
|
319
319
|
return v.value;
|
|
320
|
-
const t =
|
|
321
|
-
return typeof ((e = i.monacoOptions) == null ? void 0 : e.fontSize) == "number" ? (
|
|
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);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
const t =
|
|
323
|
+
function at() {
|
|
324
|
+
const t = he(), e = Math.min(Ge, t + Ke);
|
|
325
325
|
v.value = e;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
const t =
|
|
327
|
+
function rt() {
|
|
328
|
+
const t = he(), e = Math.max(Ue, t - Ke);
|
|
329
329
|
v.value = e;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
|
|
331
|
+
function st() {
|
|
332
|
+
he(), Number.isFinite(T.value) && (v.value = T.value);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
var t, e, o, n, l, s, w, p, k, d, h,
|
|
334
|
+
function Fe() {
|
|
335
|
+
var t, e, o, n, l, s, w, p, k, d, h, Oe, $e, Ne;
|
|
336
336
|
try {
|
|
337
|
-
const c =
|
|
337
|
+
const c = H.value ? L() : N();
|
|
338
338
|
if (!c)
|
|
339
339
|
return null;
|
|
340
|
-
if (
|
|
340
|
+
if (H.value && (c != null && c.getOriginalEditor) && (c != null && c.getModifiedEditor)) {
|
|
341
341
|
const x = (t = c.getOriginalEditor) == null ? void 0 : t.call(c), b = (e = c.getModifiedEditor) == null ? void 0 : e.call(c);
|
|
342
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
|
|
344
|
-
if (
|
|
345
|
-
return Math.ceil(
|
|
346
|
-
const
|
|
347
|
-
return Math.ceil(
|
|
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
348
|
} else if (c != null && c.getContentHeight) {
|
|
349
|
-
(
|
|
349
|
+
($e = c == null ? void 0 : c.layout) == null || $e.call(c);
|
|
350
350
|
const x = c.getContentHeight();
|
|
351
351
|
if (x > 0)
|
|
352
352
|
return Math.ceil(x + re);
|
|
353
353
|
}
|
|
354
|
-
const
|
|
355
|
-
let
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
return Math.ceil(
|
|
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
359
|
} catch (c) {
|
|
360
360
|
return null;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function ut() {
|
|
364
364
|
var p, k, d;
|
|
365
365
|
const t = m.value, e = y.value;
|
|
366
366
|
if (!t || !e)
|
|
@@ -381,7 +381,7 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
381
381
|
const t = m.value;
|
|
382
382
|
if (!t)
|
|
383
383
|
return;
|
|
384
|
-
const e = t.getBoundingClientRect(), o = window.scrollY + e.top, n =
|
|
384
|
+
const e = t.getBoundingClientRect(), o = window.scrollY + e.top, n = Fe();
|
|
385
385
|
if (n != null && n > 0) {
|
|
386
386
|
const l = e.height;
|
|
387
387
|
t.style.height = `${Math.ceil(n)}px`, t.style.maxHeight = "none";
|
|
@@ -397,15 +397,15 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
397
397
|
const e = m.value;
|
|
398
398
|
if (!e)
|
|
399
399
|
return;
|
|
400
|
-
const o = e.getBoundingClientRect(), n = window.scrollY + o.top, l = o.height, s =
|
|
401
|
-
if (
|
|
400
|
+
const o = e.getBoundingClientRect(), n = window.scrollY + o.top, l = o.height, s = ct();
|
|
401
|
+
if (se > 0 && (se--, A.value != null)) {
|
|
402
402
|
const d = Math.min(A.value, s);
|
|
403
403
|
e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
|
|
404
404
|
const h = Math.ceil(d) - l;
|
|
405
405
|
h !== 0 && n < window.scrollY && window.scrollBy(0, h);
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const w =
|
|
408
|
+
const w = Fe();
|
|
409
409
|
if (w != null && w > 0) {
|
|
410
410
|
const d = Math.min(w, s);
|
|
411
411
|
e.style.height = `${Math.ceil(d)}px`, e.style.maxHeight = `${Math.ceil(s)}px`, e.style.overflow = "auto";
|
|
@@ -444,7 +444,7 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
444
444
|
} catch (e) {
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function ct() {
|
|
448
448
|
var o, n;
|
|
449
449
|
const t = (n = (o = i.monacoOptions) == null ? void 0 : o.MAX_HEIGHT) != null ? n : 500;
|
|
450
450
|
if (typeof t == "number")
|
|
@@ -452,46 +452,38 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
452
452
|
const e = String(t).match(/^(\d+(?:\.\d+)?)/);
|
|
453
453
|
return e ? Number.parseFloat(e[1]) : 500;
|
|
454
454
|
}
|
|
455
|
-
const
|
|
456
|
-
const t = S.value.trim().toLowerCase();
|
|
457
|
-
return i.isShowPreview && (t === "html" || t === "svg");
|
|
458
|
-
}), K = _(
|
|
459
|
-
() => S.value.trim().toLowerCase() === "mermaid"
|
|
460
|
-
);
|
|
455
|
+
const ge = z(() => i.isShowPreview && (P.value === "html" || P.value === "svg")), J = z(() => P.value === "mermaid");
|
|
461
456
|
Y(
|
|
462
457
|
() => i.node.language,
|
|
463
458
|
(t) => {
|
|
464
|
-
|
|
459
|
+
P.value = xe(t);
|
|
465
460
|
}
|
|
466
461
|
), Y(
|
|
467
462
|
() => i.node.code,
|
|
468
|
-
(t) =>
|
|
463
|
+
(t) => _(null, null, function* () {
|
|
469
464
|
var e, o;
|
|
470
465
|
if (i.stream !== !1) {
|
|
471
|
-
if (
|
|
466
|
+
if (P.value || (P.value = xe(Se(t))), R && !Z.value && m.value)
|
|
472
467
|
try {
|
|
473
|
-
yield
|
|
468
|
+
yield pe(m.value);
|
|
474
469
|
} catch (n) {
|
|
475
470
|
}
|
|
476
|
-
|
|
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());
|
|
477
472
|
}
|
|
478
473
|
})
|
|
479
474
|
);
|
|
480
|
-
const
|
|
481
|
-
const t =
|
|
482
|
-
return
|
|
483
|
-
}),
|
|
484
|
-
const t = S.value.trim().toLowerCase();
|
|
485
|
-
return _t(t.split(":")[0]);
|
|
486
|
-
}), dt = _(() => {
|
|
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(() => {
|
|
487
479
|
const t = {}, e = (l) => {
|
|
488
480
|
if (l != null)
|
|
489
481
|
return typeof l == "number" ? `${l}px` : String(l);
|
|
490
482
|
}, o = e(i.minWidth), n = e(i.maxWidth);
|
|
491
483
|
return o && (t.minWidth = o), n && (t.maxWidth = n), t;
|
|
492
484
|
});
|
|
493
|
-
function
|
|
494
|
-
return
|
|
485
|
+
function mt() {
|
|
486
|
+
return _(this, null, function* () {
|
|
495
487
|
try {
|
|
496
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(() => {
|
|
497
489
|
$.value = !1;
|
|
@@ -501,46 +493,46 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
501
493
|
}
|
|
502
494
|
});
|
|
503
495
|
}
|
|
504
|
-
function
|
|
496
|
+
function He(t) {
|
|
505
497
|
const e = t;
|
|
506
498
|
return !e || e.disabled;
|
|
507
499
|
}
|
|
508
|
-
function
|
|
509
|
-
if (
|
|
500
|
+
function D(t, e, o = "top") {
|
|
501
|
+
if (He(t.currentTarget))
|
|
510
502
|
return;
|
|
511
503
|
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;
|
|
512
|
-
|
|
504
|
+
Xe(t.currentTarget, e, o, !1, l, i.isDark);
|
|
513
505
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
506
|
+
function S() {
|
|
507
|
+
jt();
|
|
516
508
|
}
|
|
517
|
-
function
|
|
518
|
-
if (
|
|
509
|
+
function Te(t) {
|
|
510
|
+
if (He(t.currentTarget))
|
|
519
511
|
return;
|
|
520
|
-
const e = $.value ?
|
|
521
|
-
|
|
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);
|
|
522
514
|
}
|
|
523
|
-
function
|
|
515
|
+
function ht() {
|
|
524
516
|
C.value = !C.value;
|
|
525
|
-
const t =
|
|
526
|
-
!t || !e || (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()));
|
|
527
519
|
}
|
|
528
|
-
function
|
|
520
|
+
function gt() {
|
|
529
521
|
var t, e, o;
|
|
530
522
|
if (M.value = !M.value, M.value) {
|
|
531
523
|
if (m.value) {
|
|
532
524
|
const n = Math.ceil(((e = (t = m.value).getBoundingClientRect) == null ? void 0 : e.call(t).height) || 0);
|
|
533
525
|
n > 0 && (A.value = n);
|
|
534
526
|
}
|
|
535
|
-
|
|
527
|
+
ie(!1);
|
|
536
528
|
} else {
|
|
537
|
-
C.value &&
|
|
538
|
-
const n =
|
|
529
|
+
C.value && ie(!0), m.value && A.value != null && (m.value.style.height = `${A.value}px`);
|
|
530
|
+
const n = H.value ? L() : N();
|
|
539
531
|
try {
|
|
540
532
|
(o = n == null ? void 0 : n.layout) == null || o.call(n);
|
|
541
533
|
} catch (l) {
|
|
542
534
|
}
|
|
543
|
-
|
|
535
|
+
se = 2, ae(() => {
|
|
544
536
|
C.value ? W() : q();
|
|
545
537
|
});
|
|
546
538
|
}
|
|
@@ -548,17 +540,17 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
548
540
|
Y(
|
|
549
541
|
() => v.value,
|
|
550
542
|
(t, e) => {
|
|
551
|
-
const o =
|
|
543
|
+
const o = H.value ? L() : N();
|
|
552
544
|
o && typeof t == "number" && Number.isFinite(t) && t > 0 && (o.updateOptions({ fontSize: t }), C.value && !M.value && W());
|
|
553
545
|
},
|
|
554
546
|
{ flush: "post", immediate: !1 }
|
|
555
547
|
);
|
|
556
|
-
function
|
|
557
|
-
if (!
|
|
548
|
+
function pt() {
|
|
549
|
+
if (!ge.value)
|
|
558
550
|
return;
|
|
559
|
-
const t =
|
|
560
|
-
if (
|
|
561
|
-
const e = t === "html" ? "text/html" : "image/svg+xml", o = t === "html" ?
|
|
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";
|
|
562
554
|
j("previewCode", {
|
|
563
555
|
node: i.node,
|
|
564
556
|
artifactType: e,
|
|
@@ -567,13 +559,13 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
567
559
|
});
|
|
568
560
|
return;
|
|
569
561
|
}
|
|
570
|
-
t === "html" && (
|
|
562
|
+
t === "html" && (ne.value = !ne.value);
|
|
571
563
|
}
|
|
572
|
-
function
|
|
564
|
+
function ie(t) {
|
|
573
565
|
var e, o;
|
|
574
566
|
try {
|
|
575
|
-
if (
|
|
576
|
-
const n =
|
|
567
|
+
if (H.value) {
|
|
568
|
+
const n = L();
|
|
577
569
|
(e = n == null ? void 0 : n.updateOptions) == null || e.call(n, { automaticLayout: t });
|
|
578
570
|
} else {
|
|
579
571
|
const n = N();
|
|
@@ -582,129 +574,129 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
582
574
|
} catch (n) {
|
|
583
575
|
}
|
|
584
576
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
577
|
+
function wt(t) {
|
|
578
|
+
return _(this, null, function* () {
|
|
587
579
|
var o, n, l;
|
|
588
|
-
if (!
|
|
580
|
+
if (!R)
|
|
589
581
|
return;
|
|
590
|
-
|
|
591
|
-
const e =
|
|
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();
|
|
592
584
|
if (typeof ((l = i.monacoOptions) == null ? void 0 : l.fontSize) == "number")
|
|
593
|
-
e == null || e.updateOptions({ fontSize: i.monacoOptions.fontSize, automaticLayout: !1 }),
|
|
585
|
+
e == null || e.updateOptions({ fontSize: i.monacoOptions.fontSize, automaticLayout: !1 }), T.value = i.monacoOptions.fontSize, v.value = i.monacoOptions.fontSize;
|
|
594
586
|
else {
|
|
595
|
-
const s =
|
|
596
|
-
s && s > 0 ? (
|
|
587
|
+
const s = Ee();
|
|
588
|
+
s && s > 0 ? (T.value = s, v.value = s) : (T.value = 12, v.value = 12);
|
|
597
589
|
}
|
|
598
|
-
!C.value && !M.value && q(), i.loading === !1 && (yield
|
|
590
|
+
!C.value && !M.value && q(), i.loading === !1 && (yield ye(), ae(() => {
|
|
599
591
|
C.value && !M.value ? W() : M.value || q();
|
|
600
592
|
}));
|
|
601
593
|
});
|
|
602
594
|
}
|
|
603
|
-
function
|
|
604
|
-
return
|
|
605
|
-
yield
|
|
595
|
+
function pe(t) {
|
|
596
|
+
return R ? K || (Z.value = !0, K = _(null, null, function* () {
|
|
597
|
+
yield wt(t);
|
|
606
598
|
}).finally(() => {
|
|
607
|
-
|
|
608
|
-
}),
|
|
599
|
+
K = null;
|
|
600
|
+
}), K) : null;
|
|
609
601
|
}
|
|
610
|
-
const
|
|
611
|
-
() => [m.value,
|
|
612
|
-
(p) =>
|
|
613
|
-
if (!t || !
|
|
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)
|
|
614
606
|
return;
|
|
615
|
-
if (
|
|
616
|
-
|
|
607
|
+
if (J.value) {
|
|
608
|
+
oe(), De();
|
|
617
609
|
return;
|
|
618
610
|
}
|
|
619
|
-
const k =
|
|
620
|
-
k && (yield k,
|
|
611
|
+
const k = pe(t);
|
|
612
|
+
k && (yield k, De());
|
|
621
613
|
})
|
|
622
|
-
),
|
|
623
|
-
() => [i.darkTheme, i.lightTheme,
|
|
614
|
+
), yt = Y(
|
|
615
|
+
() => [i.darkTheme, i.lightTheme, Z.value, V.value],
|
|
624
616
|
() => {
|
|
625
|
-
if (!(!
|
|
626
|
-
if (
|
|
627
|
-
return
|
|
628
|
-
|
|
617
|
+
if (!(!Z.value || !V.value)) {
|
|
618
|
+
if (J.value)
|
|
619
|
+
return yt();
|
|
620
|
+
kt();
|
|
629
621
|
}
|
|
630
622
|
}
|
|
631
623
|
);
|
|
632
|
-
function
|
|
624
|
+
function Pe() {
|
|
633
625
|
return i.isDark ? i.darkTheme : i.lightTheme;
|
|
634
626
|
}
|
|
635
|
-
function
|
|
636
|
-
const t =
|
|
637
|
-
t &&
|
|
627
|
+
function kt() {
|
|
628
|
+
const t = Pe();
|
|
629
|
+
t && fe(t);
|
|
638
630
|
}
|
|
639
|
-
const
|
|
640
|
-
() => [i.monacoOptions,
|
|
631
|
+
const xt = Y(
|
|
632
|
+
() => [i.monacoOptions, V.value],
|
|
641
633
|
() => {
|
|
642
634
|
var o, n;
|
|
643
|
-
if (!
|
|
635
|
+
if (!R || !V.value)
|
|
644
636
|
return;
|
|
645
|
-
if (
|
|
646
|
-
return
|
|
647
|
-
const t =
|
|
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;
|
|
648
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();
|
|
649
641
|
},
|
|
650
642
|
{ deep: !0 }
|
|
651
|
-
),
|
|
652
|
-
() => [i.loading,
|
|
653
|
-
(o) =>
|
|
643
|
+
), le = Y(
|
|
644
|
+
() => [i.loading, V.value],
|
|
645
|
+
(o) => _(null, [o], function* ([t, e]) {
|
|
654
646
|
if (e) {
|
|
655
|
-
if (
|
|
656
|
-
|
|
657
|
-
|
|
647
|
+
if (J.value) {
|
|
648
|
+
ye(() => {
|
|
649
|
+
le == null || le();
|
|
658
650
|
});
|
|
659
651
|
return;
|
|
660
652
|
}
|
|
661
|
-
t || (yield
|
|
662
|
-
M.value || (C.value ? W() : q()),
|
|
653
|
+
t || (yield ye(), ae(() => {
|
|
654
|
+
M.value || (C.value ? W() : q()), le();
|
|
663
655
|
}));
|
|
664
656
|
}
|
|
665
657
|
}),
|
|
666
658
|
{ immediate: !0, flush: "post" }
|
|
667
659
|
);
|
|
668
|
-
return
|
|
669
|
-
|
|
670
|
-
}), (t, e) =>
|
|
660
|
+
return et(() => {
|
|
661
|
+
oe();
|
|
662
|
+
}), (t, e) => ve.value ? (E(), Ce(g(Wt), {
|
|
671
663
|
key: 0,
|
|
672
664
|
node: f.node,
|
|
673
665
|
loading: i.loading
|
|
674
|
-
}, null, 8, ["node", "loading"])) : (
|
|
666
|
+
}, null, 8, ["node", "loading"])) : (E(), O("div", {
|
|
675
667
|
key: 1,
|
|
676
668
|
ref_key: "container",
|
|
677
669
|
ref: y,
|
|
678
|
-
style:
|
|
679
|
-
class:
|
|
670
|
+
style: Ae(vt.value),
|
|
671
|
+
class: Q(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm", [
|
|
680
672
|
i.isDark ? "border-gray-700/30 bg-gray-900" : "border-gray-200 bg-white",
|
|
681
673
|
{ "is-rendering": i.loading, "is-dark": i.isDark }
|
|
682
674
|
]])
|
|
683
675
|
}, [
|
|
684
|
-
i.showHeader ? (
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
676
|
+
i.showHeader ? (E(), O("div", Qt, [
|
|
677
|
+
ke(t.$slots, "header-left", {}, () => [
|
|
678
|
+
r("div", Zt, [
|
|
679
|
+
r("span", {
|
|
688
680
|
class: "icon-slot h-4 w-4 flex-shrink-0",
|
|
689
|
-
innerHTML:
|
|
690
|
-
}, null, 8,
|
|
691
|
-
|
|
681
|
+
innerHTML: ft.value
|
|
682
|
+
}, null, 8, eo),
|
|
683
|
+
r("span", to, Me(dt.value), 1)
|
|
692
684
|
])
|
|
693
685
|
], !0),
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
686
|
+
ke(t.$slots, "header-right", {}, () => [
|
|
687
|
+
r("div", oo, [
|
|
688
|
+
r("button", {
|
|
697
689
|
type: "button",
|
|
698
690
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
699
691
|
"aria-pressed": M.value,
|
|
700
|
-
onClick:
|
|
701
|
-
onMouseenter: e[0] || (e[0] = (o) =>
|
|
702
|
-
onFocus: e[1] || (e[1] = (o) =>
|
|
703
|
-
onMouseleave:
|
|
704
|
-
onBlur:
|
|
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")),
|
|
695
|
+
onMouseleave: S,
|
|
696
|
+
onBlur: S
|
|
705
697
|
}, [
|
|
706
|
-
(
|
|
707
|
-
style:
|
|
698
|
+
(E(), O("svg", {
|
|
699
|
+
style: Ae({ rotate: M.value ? "0deg" : "90deg" }),
|
|
708
700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
709
701
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
710
702
|
"aria-hidden": "true",
|
|
@@ -714,7 +706,7 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
714
706
|
viewBox: "0 0 24 24",
|
|
715
707
|
class: "w-3 h-3"
|
|
716
708
|
}, [...e[17] || (e[17] = [
|
|
717
|
-
|
|
709
|
+
r("path", {
|
|
718
710
|
fill: "none",
|
|
719
711
|
stroke: "currentColor",
|
|
720
712
|
"stroke-linecap": "round",
|
|
@@ -723,19 +715,19 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
723
715
|
d: "m9 18l6-6l-6-6"
|
|
724
716
|
}, null, -1)
|
|
725
717
|
])], 4))
|
|
726
|
-
], 40,
|
|
727
|
-
i.showFontSizeButtons && i.enableFontSizeControl ? (
|
|
728
|
-
|
|
718
|
+
], 40, no),
|
|
719
|
+
i.showFontSizeButtons && i.enableFontSizeControl ? (E(), O(Vt, { key: 0 }, [
|
|
720
|
+
r("button", {
|
|
729
721
|
type: "button",
|
|
730
722
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
731
|
-
disabled: Number.isFinite(v.value) ? v.value <=
|
|
732
|
-
onClick: e[2] || (e[2] = (o) =>
|
|
733
|
-
onMouseenter: e[3] || (e[3] = (o) =>
|
|
734
|
-
onFocus: e[4] || (e[4] = (o) =>
|
|
735
|
-
onMouseleave:
|
|
736
|
-
onBlur:
|
|
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")),
|
|
727
|
+
onMouseleave: S,
|
|
728
|
+
onBlur: S
|
|
737
729
|
}, [...e[18] || (e[18] = [
|
|
738
|
-
|
|
730
|
+
r("svg", {
|
|
739
731
|
xmlns: "http://www.w3.org/2000/svg",
|
|
740
732
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
741
733
|
"aria-hidden": "true",
|
|
@@ -745,7 +737,7 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
745
737
|
viewBox: "0 0 24 24",
|
|
746
738
|
class: "w-3 h-3"
|
|
747
739
|
}, [
|
|
748
|
-
|
|
740
|
+
r("path", {
|
|
749
741
|
fill: "none",
|
|
750
742
|
stroke: "currentColor",
|
|
751
743
|
"stroke-linecap": "round",
|
|
@@ -754,18 +746,18 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
754
746
|
d: "M5 12h14"
|
|
755
747
|
})
|
|
756
748
|
], -1)
|
|
757
|
-
])], 40,
|
|
758
|
-
|
|
749
|
+
])], 40, io),
|
|
750
|
+
r("button", {
|
|
759
751
|
type: "button",
|
|
760
752
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
761
|
-
disabled: !
|
|
762
|
-
onClick: e[5] || (e[5] = (o) =>
|
|
763
|
-
onMouseenter: e[6] || (e[6] = (o) =>
|
|
764
|
-
onFocus: e[7] || (e[7] = (o) =>
|
|
765
|
-
onMouseleave:
|
|
766
|
-
onBlur:
|
|
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")),
|
|
757
|
+
onMouseleave: S,
|
|
758
|
+
onBlur: S
|
|
767
759
|
}, [...e[19] || (e[19] = [
|
|
768
|
-
|
|
760
|
+
r("svg", {
|
|
769
761
|
xmlns: "http://www.w3.org/2000/svg",
|
|
770
762
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
771
763
|
"aria-hidden": "true",
|
|
@@ -775,29 +767,29 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
775
767
|
viewBox: "0 0 24 24",
|
|
776
768
|
class: "w-3 h-3"
|
|
777
769
|
}, [
|
|
778
|
-
|
|
770
|
+
r("g", {
|
|
779
771
|
fill: "none",
|
|
780
772
|
stroke: "currentColor",
|
|
781
773
|
"stroke-linecap": "round",
|
|
782
774
|
"stroke-linejoin": "round",
|
|
783
775
|
"stroke-width": "2"
|
|
784
776
|
}, [
|
|
785
|
-
|
|
786
|
-
|
|
777
|
+
r("path", { d: "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
778
|
+
r("path", { d: "M3 3v5h5" })
|
|
787
779
|
])
|
|
788
780
|
], -1)
|
|
789
|
-
])], 40,
|
|
790
|
-
|
|
781
|
+
])], 40, lo),
|
|
782
|
+
r("button", {
|
|
791
783
|
type: "button",
|
|
792
784
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
793
|
-
disabled: Number.isFinite(v.value) ? v.value >=
|
|
794
|
-
onClick: e[8] || (e[8] = (o) =>
|
|
795
|
-
onMouseenter: e[9] || (e[9] = (o) =>
|
|
796
|
-
onFocus: e[10] || (e[10] = (o) =>
|
|
797
|
-
onMouseleave:
|
|
798
|
-
onBlur:
|
|
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")),
|
|
789
|
+
onMouseleave: S,
|
|
790
|
+
onBlur: S
|
|
799
791
|
}, [...e[20] || (e[20] = [
|
|
800
|
-
|
|
792
|
+
r("svg", {
|
|
801
793
|
xmlns: "http://www.w3.org/2000/svg",
|
|
802
794
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
803
795
|
"aria-hidden": "true",
|
|
@@ -807,7 +799,7 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
807
799
|
viewBox: "0 0 24 24",
|
|
808
800
|
class: "w-3 h-3"
|
|
809
801
|
}, [
|
|
810
|
-
|
|
802
|
+
r("path", {
|
|
811
803
|
fill: "none",
|
|
812
804
|
stroke: "currentColor",
|
|
813
805
|
"stroke-linecap": "round",
|
|
@@ -816,21 +808,21 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
816
808
|
d: "M5 12h14m-7-7v14"
|
|
817
809
|
})
|
|
818
810
|
], -1)
|
|
819
|
-
])], 40,
|
|
811
|
+
])], 40, ao)
|
|
820
812
|
], 64)) : X("", !0),
|
|
821
|
-
i.showCopyButton ? (
|
|
813
|
+
i.showCopyButton ? (E(), O("button", {
|
|
822
814
|
key: 1,
|
|
823
815
|
type: "button",
|
|
824
816
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
825
|
-
"aria-label": $.value ? g(
|
|
826
|
-
onClick:
|
|
827
|
-
onMouseenter: e[11] || (e[11] = (o) =>
|
|
828
|
-
onFocus: e[12] || (e[12] = (o) =>
|
|
829
|
-
onMouseleave:
|
|
830
|
-
onBlur:
|
|
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)),
|
|
821
|
+
onMouseleave: S,
|
|
822
|
+
onBlur: S
|
|
831
823
|
}, [
|
|
832
|
-
$.value ? (
|
|
833
|
-
|
|
824
|
+
$.value ? (E(), O("svg", uo, [...e[22] || (e[22] = [
|
|
825
|
+
r("path", {
|
|
834
826
|
fill: "none",
|
|
835
827
|
stroke: "currentColor",
|
|
836
828
|
"stroke-linecap": "round",
|
|
@@ -838,15 +830,15 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
838
830
|
"stroke-width": "2",
|
|
839
831
|
d: "M20 6L9 17l-5-5"
|
|
840
832
|
}, null, -1)
|
|
841
|
-
])])) : (
|
|
842
|
-
|
|
833
|
+
])])) : (E(), O("svg", so, [...e[21] || (e[21] = [
|
|
834
|
+
r("g", {
|
|
843
835
|
fill: "none",
|
|
844
836
|
stroke: "currentColor",
|
|
845
837
|
"stroke-linecap": "round",
|
|
846
838
|
"stroke-linejoin": "round",
|
|
847
839
|
"stroke-width": "2"
|
|
848
840
|
}, [
|
|
849
|
-
|
|
841
|
+
r("rect", {
|
|
850
842
|
width: "14",
|
|
851
843
|
height: "14",
|
|
852
844
|
x: "8",
|
|
@@ -854,23 +846,23 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
854
846
|
rx: "2",
|
|
855
847
|
ry: "2"
|
|
856
848
|
}),
|
|
857
|
-
|
|
849
|
+
r("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
858
850
|
], -1)
|
|
859
851
|
])]))
|
|
860
|
-
], 40,
|
|
861
|
-
i.showExpandButton ? (
|
|
852
|
+
], 40, ro)) : X("", !0),
|
|
853
|
+
i.showExpandButton ? (E(), O("button", {
|
|
862
854
|
key: 2,
|
|
863
855
|
type: "button",
|
|
864
856
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
865
857
|
"aria-pressed": C.value,
|
|
866
|
-
onClick:
|
|
867
|
-
onMouseenter: e[13] || (e[13] = (o) =>
|
|
868
|
-
onFocus: e[14] || (e[14] = (o) =>
|
|
869
|
-
onMouseleave:
|
|
870
|
-
onBlur:
|
|
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")),
|
|
861
|
+
onMouseleave: S,
|
|
862
|
+
onBlur: S
|
|
871
863
|
}, [
|
|
872
|
-
C.value ? (
|
|
873
|
-
|
|
864
|
+
C.value ? (E(), O("svg", fo, [...e[23] || (e[23] = [
|
|
865
|
+
r("path", {
|
|
874
866
|
fill: "none",
|
|
875
867
|
stroke: "currentColor",
|
|
876
868
|
"stroke-linecap": "round",
|
|
@@ -878,8 +870,8 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
878
870
|
"stroke-width": "2",
|
|
879
871
|
d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"
|
|
880
872
|
}, null, -1)
|
|
881
|
-
])])) : (
|
|
882
|
-
|
|
873
|
+
])])) : (E(), O("svg", vo, [...e[24] || (e[24] = [
|
|
874
|
+
r("path", {
|
|
883
875
|
fill: "none",
|
|
884
876
|
stroke: "currentColor",
|
|
885
877
|
"stroke-linecap": "round",
|
|
@@ -888,71 +880,71 @@ const Wt = { class: "html-preview-frame__header" }, jt = { class: "html-preview-
|
|
|
888
880
|
d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"
|
|
889
881
|
}, null, -1)
|
|
890
882
|
])]))
|
|
891
|
-
], 40,
|
|
892
|
-
|
|
883
|
+
], 40, co)) : X("", !0),
|
|
884
|
+
ge.value && i.showPreviewButton ? (E(), O("button", {
|
|
893
885
|
key: 3,
|
|
894
886
|
type: "button",
|
|
895
887
|
class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",
|
|
896
|
-
"aria-label": g(
|
|
897
|
-
onClick:
|
|
898
|
-
onMouseenter: e[15] || (e[15] = (o) =>
|
|
899
|
-
onFocus: e[16] || (e[16] = (o) =>
|
|
900
|
-
onMouseleave:
|
|
901
|
-
onBlur:
|
|
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")),
|
|
892
|
+
onMouseleave: S,
|
|
893
|
+
onBlur: S
|
|
902
894
|
}, [...e[25] || (e[25] = [
|
|
903
|
-
|
|
895
|
+
r("svg", {
|
|
904
896
|
xmlns: "http://www.w3.org/2000/svg",
|
|
905
897
|
width: "12",
|
|
906
898
|
height: "12",
|
|
907
899
|
viewBox: "0 0 24 24"
|
|
908
900
|
}, [
|
|
909
|
-
|
|
901
|
+
r("g", {
|
|
910
902
|
fill: "currentColor",
|
|
911
903
|
"fill-rule": "evenodd",
|
|
912
904
|
"clip-rule": "evenodd"
|
|
913
905
|
}, [
|
|
914
|
-
|
|
915
|
-
|
|
906
|
+
r("path", { d: "M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496" }),
|
|
907
|
+
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" })
|
|
916
908
|
])
|
|
917
909
|
], -1)
|
|
918
|
-
])], 40,
|
|
910
|
+
])], 40, mo)) : X("", !0)
|
|
919
911
|
])
|
|
920
912
|
], !0)
|
|
921
913
|
])) : X("", !0),
|
|
922
|
-
|
|
914
|
+
We(r("div", {
|
|
923
915
|
ref_key: "codeEditor",
|
|
924
916
|
ref: m,
|
|
925
|
-
class:
|
|
917
|
+
class: Q(["code-editor-container", [f.stream ? "" : "code-height-placeholder"]])
|
|
926
918
|
}, null, 2), [
|
|
927
|
-
[
|
|
919
|
+
[je, !M.value && (f.stream ? !0 : !f.loading)]
|
|
928
920
|
]),
|
|
929
|
-
|
|
921
|
+
ne.value && !F.value && ge.value && P.value === "html" ? (E(), Ce(Jt, {
|
|
930
922
|
key: 1,
|
|
931
923
|
code: f.node.code,
|
|
932
924
|
"is-dark": i.isDark,
|
|
933
|
-
"on-close": () =>
|
|
925
|
+
"on-close": () => ne.value = !1
|
|
934
926
|
}, null, 8, ["code", "is-dark", "on-close"])) : X("", !0),
|
|
935
|
-
|
|
936
|
-
|
|
927
|
+
We(r("div", ho, [
|
|
928
|
+
ke(t.$slots, "loading", {
|
|
937
929
|
loading: f.loading,
|
|
938
930
|
stream: f.stream
|
|
939
931
|
}, () => [
|
|
940
|
-
e[26] || (e[26] =
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
932
|
+
e[26] || (e[26] = r("div", { class: "loading-skeleton" }, [
|
|
933
|
+
r("div", { class: "skeleton-line" }),
|
|
934
|
+
r("div", { class: "skeleton-line" }),
|
|
935
|
+
r("div", { class: "skeleton-line short" })
|
|
944
936
|
], -1))
|
|
945
937
|
], !0)
|
|
946
938
|
], 512), [
|
|
947
|
-
[
|
|
939
|
+
[je, !f.stream && f.loading]
|
|
948
940
|
]),
|
|
949
|
-
|
|
941
|
+
r("span", go, Me($.value ? g(a)("common.copied") || "Copied" : ""), 1)
|
|
950
942
|
], 6));
|
|
951
943
|
}
|
|
952
|
-
}),
|
|
953
|
-
|
|
954
|
-
f.component(
|
|
944
|
+
}), be = /* @__PURE__ */ ot(po, [["__scopeId", "data-v-f37961ae"]]);
|
|
945
|
+
be.install = (f) => {
|
|
946
|
+
f.component(be.__name, be);
|
|
955
947
|
};
|
|
956
948
|
export {
|
|
957
|
-
|
|
949
|
+
be as default
|
|
958
950
|
};
|