@scalar/agent-chat 0.2.1 → 0.2.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.
- package/dist/App.vue.d.ts +6 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/Chat.vue.d.ts.map +1 -1
- package/dist/Tooltip-Cm82QgNj.js +575 -0
- package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +5 -0
- package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +5 -0
- package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +5 -0
- package/dist/_basePickBy-hHD8tMGb.js +151 -0
- package/dist/_baseUniq-DTF1wuF6.js +614 -0
- package/dist/arc-Dw2RQerU.js +83 -0
- package/dist/architecture-U656AL7Q-B00Z9eXr.js +36 -0
- package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +4662 -0
- package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +2261 -0
- package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +1579 -0
- package/dist/channel-105myCGU.js +5 -0
- package/dist/chunk-4BX2VUAB-TAxJli7C.js +8 -0
- package/dist/chunk-55IACEB6-VXFJ4bz5.js +8 -0
- package/dist/chunk-B4BG7PRW-CZDQpfj5.js +1375 -0
- package/dist/chunk-DI55MBZ5-D3l7TA-E.js +1370 -0
- package/dist/chunk-FMBD7UC4-BMXFm8I3.js +19 -0
- package/dist/chunk-QN33PNHL-BOUpbpWp.js +19 -0
- package/dist/chunk-QZHKN3VN-C-TEEx05.js +15 -0
- package/dist/chunk-TZMSLE5B-BUiROKNR.js +64 -0
- package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +16 -0
- package/dist/clone-CIIO71O9.js +8 -0
- package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
- package/dist/components/PaymentSection.vue.d.ts +9 -0
- package/dist/components/PaymentSection.vue.d.ts.map +1 -0
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +2609 -0
- package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
- package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +444 -0
- package/dist/defaultLocale-BEa-49Qz.js +171 -0
- package/dist/diagram-PSM6KHXK-1xyGntw2.js +531 -0
- package/dist/diagram-QEK2KX5R-DdZdlAm1.js +217 -0
- package/dist/diagram-S2PKOQOG-C80Eo2jp.js +142 -0
- package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +841 -0
- package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +1620 -0
- package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +2506 -0
- package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +27 -0
- package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +699 -0
- package/dist/graph-Dth4IhEK.js +247 -0
- package/dist/helpers.d.ts +1 -1
- package/dist/hooks/useSearch.d.ts.map +1 -1
- package/dist/index-BOvT43H8.js +111780 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index2-B36B-gt0.js +69 -0
- package/dist/index3-CtIyYUnG.js +70 -0
- package/dist/index4-Dzz91Ao2.js +537 -0
- package/dist/index5-Bmz0gMSP.js +590 -0
- package/dist/index6-DMB3qTSV.js +196 -0
- package/dist/info-NVLQJR56-azt5obk5.js +27 -0
- package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +24 -0
- package/dist/infographic_markstream-vue_false-BfsmcXxk.js +5 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +834 -0
- package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +719 -0
- package/dist/katex-SsTUIUTC.js +11688 -0
- package/dist/layout-7TCY8eA2.js +1332 -0
- package/dist/linear-DSm5i91N.js +625 -0
- package/dist/mermaid-parser.core-CUQWpAMM.js +12746 -0
- package/dist/mermaid.core-QjuzH7xx.js +14164 -0
- package/dist/mhchem-XHl7cef5.js +2306 -0
- package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +784 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/package.json +2 -2
- package/dist/packet-BFZMPI3H-CixuxAEA.js +27 -0
- package/dist/pie-7BOR55EZ-D3cgnzR1.js +32 -0
- package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +1022 -0
- package/dist/radar-NHE76QYJ-DhV0Od_M.js +27 -0
- package/dist/registry/add-documents-to-store.d.ts +3 -2
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +850 -0
- package/dist/safeRaf-I3a3-dyJ.js +10 -0
- package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +810 -0
- package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +2511 -0
- package/dist/state/state.d.ts +7 -3
- package/dist/state/state.d.ts.map +1 -1
- package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +16 -0
- package/dist/style.css +1 -12713
- package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +795 -0
- package/dist/treemap-KMMF4GRG-CQbPsyWe.js +81 -0
- package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +1 -1
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +1340 -0
- package/package.json +1 -1
- package/dist/App.vue.js +0 -29
- package/dist/App.vue.js.map +0 -1
- package/dist/App.vue2.js +0 -5
- package/dist/App.vue2.js.map +0 -1
- package/dist/Chat.vue.js +0 -55
- package/dist/Chat.vue.js.map +0 -1
- package/dist/Chat.vue2.js +0 -5
- package/dist/Chat.vue2.js.map +0 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -11
- package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
- package/dist/components/ApprovalSection.vue.js +0 -8
- package/dist/components/ApprovalSection.vue.js.map +0 -1
- package/dist/components/ApprovalSection.vue2.js +0 -47
- package/dist/components/ApprovalSection.vue2.js.map +0 -1
- package/dist/components/AutosendPaused.vue.js +0 -15
- package/dist/components/AutosendPaused.vue.js.map +0 -1
- package/dist/components/ContextItem.vue.js +0 -8
- package/dist/components/ContextItem.vue.js.map +0 -1
- package/dist/components/ContextItem.vue2.js +0 -22
- package/dist/components/ContextItem.vue2.js.map +0 -1
- package/dist/components/Endpoint.vue.js +0 -8
- package/dist/components/Endpoint.vue.js.map +0 -1
- package/dist/components/Endpoint.vue2.js +0 -98
- package/dist/components/Endpoint.vue2.js.map +0 -1
- package/dist/components/ErrorMessage.vue.js +0 -8
- package/dist/components/ErrorMessage.vue.js.map +0 -1
- package/dist/components/ErrorMessage.vue2.js +0 -28
- package/dist/components/ErrorMessage.vue2.js.map +0 -1
- package/dist/components/LoadingMiniOpenAPIDoc.vue.js +0 -16
- package/dist/components/LoadingMiniOpenAPIDoc.vue.js.map +0 -1
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js +0 -16
- package/dist/components/LoadingOpenAPISpecsSummary.vue.js.map +0 -1
- package/dist/components/Logo.vue.js +0 -25
- package/dist/components/Logo.vue.js.map +0 -1
- package/dist/components/RequestApproved.vue.js +0 -15
- package/dist/components/RequestApproved.vue.js.map +0 -1
- package/dist/components/RequestFailed.vue.js +0 -26
- package/dist/components/RequestFailed.vue.js.map +0 -1
- package/dist/components/RequestPreview.vue.js +0 -9
- package/dist/components/RequestPreview.vue.js.map +0 -1
- package/dist/components/RequestPreview.vue2.js +0 -150
- package/dist/components/RequestPreview.vue2.js.map +0 -1
- package/dist/components/RequestRejected.vue.js +0 -24
- package/dist/components/RequestRejected.vue.js.map +0 -1
- package/dist/components/RequestSuccess.vue.js +0 -15
- package/dist/components/RequestSuccess.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBody.vue.js +0 -45
- package/dist/components/ResponseBody/ResponseBody.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBody.vue2.js +0 -5
- package/dist/components/ResponseBody/ResponseBody.vue2.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +0 -17
- package/dist/components/ResponseBody/ResponseBodyInfo.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +0 -8
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +0 -73
- package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +0 -23
- package/dist/components/ResponseBody/ResponseBodyRaw.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +0 -5
- package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +0 -30
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.js.map +0 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +0 -5
- package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js.map +0 -1
- package/dist/components/ResponseBody/helpers/media-types.js +0 -134
- package/dist/components/ResponseBody/helpers/media-types.js.map +0 -1
- package/dist/components/ResponseBody/helpers/process-response-body.js +0 -63
- package/dist/components/ResponseBody/helpers/process-response-body.js.map +0 -1
- package/dist/components/SearchPopover.vue.js +0 -8
- package/dist/components/SearchPopover.vue.js.map +0 -1
- package/dist/components/SearchPopover.vue2.js +0 -78
- package/dist/components/SearchPopover.vue2.js.map +0 -1
- package/dist/components/SendingRequest.vue.js +0 -26
- package/dist/components/SendingRequest.vue.js.map +0 -1
- package/dist/components/Suggestion.vue.js +0 -8
- package/dist/components/Suggestion.vue.js.map +0 -1
- package/dist/components/Suggestion.vue2.js +0 -28
- package/dist/components/Suggestion.vue2.js.map +0 -1
- package/dist/components/TestRequestButton.vue.js +0 -8
- package/dist/components/TestRequestButton.vue.js.map +0 -1
- package/dist/components/TestRequestButton.vue2.js +0 -37
- package/dist/components/TestRequestButton.vue2.js.map +0 -1
- package/dist/helpers.js +0 -201
- package/dist/helpers.js.map +0 -1
- package/dist/hooks/useChatApprovals.js +0 -25
- package/dist/hooks/useChatApprovals.js.map +0 -1
- package/dist/hooks/useChatOperationBlocks.js +0 -29
- package/dist/hooks/useChatOperationBlocks.js.map +0 -1
- package/dist/hooks/useChatScroll.js +0 -22
- package/dist/hooks/useChatScroll.js.map +0 -1
- package/dist/hooks/useSearch.js +0 -36
- package/dist/hooks/useSearch.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +0 -12
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js +0 -67
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js +0 -25
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js +0 -64
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js +0 -8
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +0 -181
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js +0 -85
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js +0 -61
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js.map +0 -1
- package/dist/registry/add-documents-to-store.js +0 -42
- package/dist/registry/add-documents-to-store.js.map +0 -1
- package/dist/state/state.js +0 -112
- package/dist/state/state.js.map +0 -1
- package/dist/views/Chat/Chat.vue.js +0 -8
- package/dist/views/Chat/Chat.vue.js.map +0 -1
- package/dist/views/Chat/Chat.vue2.js +0 -84
- package/dist/views/Chat/Chat.vue2.js.map +0 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +0 -8
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js.map +0 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +0 -39
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js.map +0 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -8
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js.map +0 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +0 -65
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js.map +0 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +0 -32
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +0 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +0 -5
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js.map +0 -1
- package/dist/views/Chat/Messages/Text.vue.js +0 -21
- package/dist/views/Chat/Messages/Text.vue.js.map +0 -1
- package/dist/views/Chat/Messages/Text.vue2.js +0 -5
- package/dist/views/Chat/Messages/Text.vue2.js.map +0 -1
- package/dist/views/Layout.vue.js +0 -8
- package/dist/views/Layout.vue.js.map +0 -1
- package/dist/views/Layout.vue2.js +0 -28
- package/dist/views/Layout.vue2.js.map +0 -1
- package/dist/views/PromptForm.vue.js +0 -8
- package/dist/views/PromptForm.vue.js.map +0 -1
- package/dist/views/PromptForm.vue2.js +0 -182
- package/dist/views/PromptForm.vue2.js.map +0 -1
- package/dist/views/Settings/Auth.vue.js +0 -66
- package/dist/views/Settings/Auth.vue.js.map +0 -1
- package/dist/views/Settings/Auth.vue2.js +0 -5
- package/dist/views/Settings/Auth.vue2.js.map +0 -1
- package/dist/views/Settings/DocSettings.vue.js +0 -8
- package/dist/views/Settings/DocSettings.vue.js.map +0 -1
- package/dist/views/Settings/DocSettings.vue2.js +0 -50
- package/dist/views/Settings/DocSettings.vue2.js.map +0 -1
- package/dist/views/Settings/Settings.vue.js +0 -9
- package/dist/views/Settings/Settings.vue.js.map +0 -1
- package/dist/views/Settings/Settings.vue2.js +0 -78
- package/dist/views/Settings/Settings.vue2.js.map +0 -1
- package/dist/views/Start.vue.js +0 -8
- package/dist/views/Start.vue.js.map +0 -1
- package/dist/views/Start.vue2.js +0 -56
- package/dist/views/Start.vue2.js.map +0 -1
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import { defineComponent as rt, getCurrentInstance as Et, computed as B, ref as M, watch as W, onBeforeUnmount as Nt, createBlock as ke, createElementBlock as D, onUnmounted as ut, openBlock as F, unref as g, normalizeClass as oe, normalizeStyle as Ee, createCommentVNode as G, withDirectives as Qe, createElementVNode as u, renderSlot as Ne, toDisplayString as Ye, Fragment as $t, vShow as Ze, onMounted as Tt, Teleport as zt, withModifiers as Dt, nextTick as ye } from "vue";
|
|
2
|
+
import { J as st, n as ct, D as $e, U as Ht, o as Lt, q as et, F as jt, f as tt, Y as nt, a as Yt, R as Vt } from "./index-BOvT43H8.js";
|
|
3
|
+
import { e as ae } from "./safeRaf-I3a3-dyJ.js";
|
|
4
|
+
var Wt = Object.defineProperty, qt = Object.defineProperties, It = Object.getOwnPropertyDescriptors, ot = Object.getOwnPropertySymbols, Rt = Object.prototype.hasOwnProperty, Ut = Object.prototype.propertyIsEnumerable, lt = (p, m, k) => m in p ? Wt(p, m, { enumerable: !0, configurable: !0, writable: !0, value: k }) : p[m] = k, Te = (p, m) => {
|
|
5
|
+
for (var k in m || (m = {})) Rt.call(m, k) && lt(p, k, m[k]);
|
|
6
|
+
if (ot) for (var k of ot(m)) Ut.call(m, k) && lt(p, k, m[k]);
|
|
7
|
+
return p;
|
|
8
|
+
}, it = (p, m) => qt(p, It(m)), Y = (p, m, k) => new Promise((l, q) => {
|
|
9
|
+
var N = (d) => {
|
|
10
|
+
try {
|
|
11
|
+
f(k.next(d));
|
|
12
|
+
} catch (X) {
|
|
13
|
+
q(X);
|
|
14
|
+
}
|
|
15
|
+
}, b = (d) => {
|
|
16
|
+
try {
|
|
17
|
+
f(k.throw(d));
|
|
18
|
+
} catch (X) {
|
|
19
|
+
q(X);
|
|
20
|
+
}
|
|
21
|
+
}, f = (d) => d.done ? l(d.value) : Promise.resolve(d.value).then(N, b);
|
|
22
|
+
f((k = k.apply(p, m)).next());
|
|
23
|
+
});
|
|
24
|
+
const Xt = { class: "markstream-vue" }, At = { class: "html-preview-frame__header" }, Jt = { class: "html-preview-frame__title" }, Gt = { class: "html-preview-frame__label" }, Kt = ["srcdoc"], Qt = /* @__PURE__ */ st(/* @__PURE__ */ rt({ __name: "HtmlPreviewFrame", props: { code: {}, isDark: { type: Boolean }, onClose: { type: Function }, title: {} }, setup(p) {
|
|
25
|
+
const m = p, { t: k } = ct(), l = B(() => {
|
|
26
|
+
const N = m.code || "", b = N.trim().toLowerCase();
|
|
27
|
+
return b.startsWith("<!doctype") || b.startsWith("<html") || b.startsWith("<body") ? N : `<!doctype html>
|
|
28
|
+
<html lang="en">
|
|
29
|
+
<head>
|
|
30
|
+
<meta charset="utf-8" />
|
|
31
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
32
|
+
<style>
|
|
33
|
+
html, body {
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
height: 100%;
|
|
37
|
+
background-color: ${m.isDark ? "#020617" : "#ffffff"};
|
|
38
|
+
color: ${m.isDark ? "#e5e7eb" : "#020617"};
|
|
39
|
+
}
|
|
40
|
+
body {
|
|
41
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
${N}
|
|
47
|
+
</body>
|
|
48
|
+
</html>`;
|
|
49
|
+
});
|
|
50
|
+
function q(N) {
|
|
51
|
+
var b;
|
|
52
|
+
N.key !== "Escape" && N.key !== "Esc" || (b = m.onClose) == null || b.call(m);
|
|
53
|
+
}
|
|
54
|
+
return Tt(() => {
|
|
55
|
+
typeof window < "u" && window.addEventListener("keydown", q);
|
|
56
|
+
}), ut(() => {
|
|
57
|
+
typeof window < "u" && window.removeEventListener("keydown", q);
|
|
58
|
+
}), (N, b) => (F(), ke(zt, { to: "body" }, [u("div", Xt, [u("div", { class: oe(["html-preview-frame__backdrop", { "html-preview-frame__backdrop--dark": m.isDark }]), onClick: b[2] || (b[2] = (f) => {
|
|
59
|
+
var d;
|
|
60
|
+
return (d = m.onClose) == null ? void 0 : d.call(m);
|
|
61
|
+
}) }, [u("div", { class: oe(["html-preview-frame", { "html-preview-frame--dark": m.isDark }]), onClick: b[1] || (b[1] = Dt(() => {
|
|
62
|
+
}, ["stop"])) }, [u("div", At, [u("div", Jt, [b[3] || (b[3] = u("span", { class: "html-preview-frame__dot" }, null, -1)), u("span", Gt, Ye(m.title || g(k)("common.preview") || "Preview"), 1)]), u("button", { type: "button", class: oe(["html-preview-frame__close", { "html-preview-frame__close--dark": m.isDark }]), onClick: b[0] || (b[0] = (f) => {
|
|
63
|
+
var d;
|
|
64
|
+
return (d = m.onClose) == null ? void 0 : d.call(m);
|
|
65
|
+
}) }, " × ", 2)]), u("iframe", { class: "html-preview-frame__iframe", sandbox: "allow-scripts allow-same-origin", srcdoc: l.value }, null, 8, Kt)], 2)], 2)])]));
|
|
66
|
+
} }), [["__scopeId", "data-v-296dd89d"]]);
|
|
67
|
+
let te = null, ze = null, re = null, ne = null, De = null, He = null;
|
|
68
|
+
const Le = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
let Zt = 0;
|
|
70
|
+
const en = { key: 0, class: "code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5", style: { color: "var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))", "background-color": "var(--vscode-editor-background, var(--markstream-code-fallback-bg))" } }, tn = { class: "flex items-center gap-x-2 flex-1 overflow-hidden" }, nn = ["innerHTML"], on = { class: "text-sm font-medium font-mono truncate" }, ln = { class: "flex items-center gap-x-2" }, an = ["aria-pressed"], rn = ["disabled"], un = ["disabled"], sn = ["disabled"], cn = ["aria-label"], dn = { key: 0, xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, vn = { key: 1, xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, mn = ["aria-pressed"], fn = { key: 0, xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, pn = { key: 1, xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, hn = ["aria-label"], wn = { class: "code-editor-layer" }, gn = { class: "code-loading-placeholder" }, yn = { class: "sr-only", "aria-live": "polite", role: "status" }, at = "__markstreamMonacoPassiveTouch__", je = /* @__PURE__ */ st(/* @__PURE__ */ rt({ __name: "CodeBlockNode", props: { node: {}, isDark: { type: Boolean }, loading: { type: Boolean, default: !0 }, stream: { type: Boolean, default: !0 }, darkTheme: { default: void 0 }, lightTheme: { default: void 0 }, isShowPreview: { type: Boolean, default: !0 }, monacoOptions: {}, enableFontSizeControl: { type: Boolean, default: !0 }, minWidth: { default: void 0 }, maxWidth: { default: void 0 }, themes: {}, showHeader: { type: Boolean, default: !0 }, showCopyButton: { type: Boolean, default: !0 }, showExpandButton: { type: Boolean, default: !0 }, showPreviewButton: { type: Boolean, default: !0 }, showFontSizeButtons: { type: Boolean, default: !0 }, customId: {} }, emits: ["previewCode", "copy"], setup(p, { emit: m }) {
|
|
71
|
+
var k;
|
|
72
|
+
const l = p, q = m;
|
|
73
|
+
typeof window < "u" && (function() {
|
|
74
|
+
var t;
|
|
75
|
+
try {
|
|
76
|
+
const e = window;
|
|
77
|
+
if (e[at]) return;
|
|
78
|
+
const n = (t = window.Element) == null ? void 0 : t.prototype, o = n?.addEventListener;
|
|
79
|
+
if (!n || !o) return;
|
|
80
|
+
n.addEventListener = function(i, a, c) {
|
|
81
|
+
return i === "touchstart" && (function(r, y) {
|
|
82
|
+
if (!r) return !1;
|
|
83
|
+
const s = r;
|
|
84
|
+
return !(typeof s.closest != "function" || !s.closest(".monaco-editor, .monaco-diff-editor") || y && typeof y == "object" && "passive" in y);
|
|
85
|
+
})(this, c) ? o.call(this, i, a, (function(r) {
|
|
86
|
+
return r == null ? { passive: !0 } : typeof r == "boolean" ? { capture: r, passive: !0 } : typeof r == "object" ? "passive" in r ? r : it(Te({}, r), { passive: !0 }) : { passive: !0 };
|
|
87
|
+
})(c)) : o.call(this, i, a, c);
|
|
88
|
+
}, e[at] = !0;
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
})();
|
|
92
|
+
const N = Et(), b = B(() => {
|
|
93
|
+
const t = N?.vnode.props;
|
|
94
|
+
return !(!t || !t.onPreviewCode && !t.onPreviewCode);
|
|
95
|
+
}), { t: f } = ct(), d = M(null), X = M(null), K = M(!1), H = M($e(l.node.language)), le = B(() => Ht(H.value)), S = M(!1), O = M(!1), ue = M(!1), Q = M(!1), se = M(!1), A = M(null);
|
|
96
|
+
let be = 0;
|
|
97
|
+
const dt = Lt(), ie = M(null), I = M(typeof window > "u");
|
|
98
|
+
typeof window < "u" && W(() => X.value, (t) => {
|
|
99
|
+
var e;
|
|
100
|
+
if ((e = ie.value) == null || e.destroy(), ie.value = null, !t) return void (I.value = !1);
|
|
101
|
+
const n = dt(t, { rootMargin: "400px" });
|
|
102
|
+
ie.value = n, I.value = n.isVisible.value, n.whenVisible.then(() => {
|
|
103
|
+
I.value = !0;
|
|
104
|
+
});
|
|
105
|
+
}, { immediate: !0 }), Nt(() => {
|
|
106
|
+
var t;
|
|
107
|
+
(t = ie.value) == null || t.destroy(), ie.value = null;
|
|
108
|
+
});
|
|
109
|
+
let L = null, ce = null, xe = () => {
|
|
110
|
+
}, Me = () => {
|
|
111
|
+
}, de = () => null, j = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
|
|
112
|
+
} }), z = () => ({ getModel: () => ({ getLineCount: () => 1 }), getOption: () => 14, updateOptions: () => {
|
|
113
|
+
} }), Ce = () => {
|
|
114
|
+
}, ve = () => {
|
|
115
|
+
}, Z = null, Ve = () => {
|
|
116
|
+
var t;
|
|
117
|
+
return String((t = l.node.language) != null ? t : "plaintext");
|
|
118
|
+
}, Be = () => Y(null, null, function* () {
|
|
119
|
+
});
|
|
120
|
+
const P = B(() => l.node.diff), We = B(() => P.value ? "diff" : "single"), vt = M(We.value), me = M(!1), mt = B(() => {
|
|
121
|
+
var t;
|
|
122
|
+
const e = (t = l.monacoOptions) == null ? void 0 : t.wordWrap;
|
|
123
|
+
return e == null || String(e) !== "off";
|
|
124
|
+
}), qe = B(() => typeof window < "u" && !me.value && !Q.value), fe = M(!1);
|
|
125
|
+
typeof window < "u" && Y(null, null, function* () {
|
|
126
|
+
try {
|
|
127
|
+
const t = yield Vt();
|
|
128
|
+
if (!t) return void (me.value = !0);
|
|
129
|
+
const e = t.useMonaco, n = t.detectLanguage;
|
|
130
|
+
if (typeof n == "function" && (Ve = n), typeof e == "function") {
|
|
131
|
+
const o = Je();
|
|
132
|
+
if (o && l.themes && Array.isArray(l.themes) && !l.themes.includes(o)) throw new Error("Preferred theme not in provided themes array");
|
|
133
|
+
const i = e(it(Te({ wordWrap: "on", wrappingIndent: "same", themes: l.themes, theme: o }, l.monacoOptions || {}), { onThemeChange() {
|
|
134
|
+
Fe();
|
|
135
|
+
} }));
|
|
136
|
+
L = i.createEditor || L, ce = i.createDiffEditor || ce, xe = i.updateCode || xe, Me = i.updateDiff || Me, de = i.getEditor || de, j = i.getEditorView || j, z = i.getDiffEditorView || z, Ce = i.cleanupEditor || Ce, ve = i.safeClean || i.cleanupEditor || ve, Be = i.setTheme || Be, se.value = !0, d.value && (yield he(d.value));
|
|
137
|
+
}
|
|
138
|
+
} catch {
|
|
139
|
+
me.value = !0;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const $ = M(typeof ((k = l.monacoOptions) == null ? void 0 : k.fontSize) == "number" ? l.monacoOptions.fontSize : Number.NaN), h = M($.value), ft = B(() => {
|
|
143
|
+
const t = $.value, e = h.value;
|
|
144
|
+
return typeof t == "number" && Number.isFinite(t) && t > 0 && typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
145
|
+
}), Ie = B(() => {
|
|
146
|
+
var t;
|
|
147
|
+
const e = (t = l.monacoOptions) == null ? void 0 : t.fontSize;
|
|
148
|
+
if (typeof e == "number" && Number.isFinite(e) && e > 0) return e;
|
|
149
|
+
const n = h.value;
|
|
150
|
+
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : 12;
|
|
151
|
+
}), pt = B(() => {
|
|
152
|
+
var t;
|
|
153
|
+
const e = (t = l.monacoOptions) == null ? void 0 : t.lineHeight;
|
|
154
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : Math.round(1.5 * Ie.value);
|
|
155
|
+
}), ht = B(() => {
|
|
156
|
+
var t;
|
|
157
|
+
const e = (t = l.monacoOptions) == null ? void 0 : t.tabSize;
|
|
158
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : 4;
|
|
159
|
+
}), wt = B(() => {
|
|
160
|
+
var t;
|
|
161
|
+
const e = (t = l.monacoOptions) == null ? void 0 : t.fontFamily;
|
|
162
|
+
return Te({ fontSize: `${Ie.value}px`, lineHeight: `${pt.value}px`, tabSize: ht.value }, typeof e == "string" && e.trim() ? { "--markstream-code-font-family": e.trim() } : {});
|
|
163
|
+
});
|
|
164
|
+
function Re() {
|
|
165
|
+
var t, e, n, o, i;
|
|
166
|
+
try {
|
|
167
|
+
const a = P.value ? (n = (e = (t = z()) == null ? void 0 : t.getModifiedEditor) == null ? void 0 : e.call(t)) != null ? n : z() : j(), c = de(), r = (o = c?.EditorOption) == null ? void 0 : o.fontInfo;
|
|
168
|
+
if (a && r != null) {
|
|
169
|
+
const y = (i = a.getOption) == null ? void 0 : i.call(a, r), s = y?.fontSize;
|
|
170
|
+
if (typeof s == "number" && Number.isFinite(s) && s > 0) return s;
|
|
171
|
+
}
|
|
172
|
+
} catch {
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
const a = d.value;
|
|
176
|
+
if (a) {
|
|
177
|
+
const c = a.querySelector(".view-lines .view-line");
|
|
178
|
+
if (c) try {
|
|
179
|
+
if (typeof window < "u" && typeof window.getComputedStyle == "function") {
|
|
180
|
+
const r = window.getComputedStyle(c).fontSize, y = r && r.match(/^(\d+(?:\.\d+)?)/);
|
|
181
|
+
if (y) return Number.parseFloat(y[1]);
|
|
182
|
+
}
|
|
183
|
+
} catch {
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} catch {
|
|
187
|
+
}
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
function Se(t) {
|
|
191
|
+
var e, n;
|
|
192
|
+
try {
|
|
193
|
+
const a = de(), c = (e = a?.EditorOption) == null ? void 0 : e.lineHeight;
|
|
194
|
+
if (c != null) {
|
|
195
|
+
const r = (n = t?.getOption) == null ? void 0 : n.call(t, c);
|
|
196
|
+
if (typeof r == "number" && r > 0) return r;
|
|
197
|
+
}
|
|
198
|
+
} catch {
|
|
199
|
+
}
|
|
200
|
+
const o = (function() {
|
|
201
|
+
try {
|
|
202
|
+
const a = d.value;
|
|
203
|
+
if (!a) return null;
|
|
204
|
+
const c = a.querySelector(".view-lines .view-line");
|
|
205
|
+
if (c) {
|
|
206
|
+
const r = Math.ceil(c.getBoundingClientRect().height);
|
|
207
|
+
if (r > 0) return r;
|
|
208
|
+
}
|
|
209
|
+
} catch {
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
})();
|
|
213
|
+
if (o && o > 0) return o;
|
|
214
|
+
const i = Number.isFinite(h.value) && h.value > 0 ? h.value : 12;
|
|
215
|
+
return Math.max(12, Math.round(1.35 * i));
|
|
216
|
+
}
|
|
217
|
+
function Oe() {
|
|
218
|
+
var t;
|
|
219
|
+
if (Number.isFinite(h.value) && h.value > 0 && Number.isFinite($.value)) return h.value;
|
|
220
|
+
const e = Re();
|
|
221
|
+
return typeof ((t = l.monacoOptions) == null ? void 0 : t.fontSize) == "number" ? ($.value = l.monacoOptions.fontSize, h.value = l.monacoOptions.fontSize, h.value) : e && e > 0 ? ($.value = e, h.value = e, e) : ($.value = 12, h.value = 12, 12);
|
|
222
|
+
}
|
|
223
|
+
function Ue() {
|
|
224
|
+
var t, e, n, o, i, a, c, r, y, s, v, V, R, x;
|
|
225
|
+
try {
|
|
226
|
+
const w = P.value ? z() : j();
|
|
227
|
+
if (!w) return null;
|
|
228
|
+
if (P.value && w?.getOriginalEditor && w?.getModifiedEditor) {
|
|
229
|
+
const C = (t = w.getOriginalEditor) == null ? void 0 : t.call(w), E = (e = w.getModifiedEditor) == null ? void 0 : e.call(w);
|
|
230
|
+
(n = C?.layout) == null || n.call(C), (o = E?.layout) == null || o.call(E);
|
|
231
|
+
const ge = ((i = C?.getContentHeight) == null ? void 0 : i.call(C)) || 0, Ge = ((a = E?.getContentHeight) == null ? void 0 : a.call(E)) || 0, Ke = Math.max(ge, Ge);
|
|
232
|
+
if (Ke > 0) return Math.ceil(Ke + 1);
|
|
233
|
+
const Ot = ((y = (r = (c = C?.getModel) == null ? void 0 : c.call(C)) == null ? void 0 : r.getLineCount) == null ? void 0 : y.call(r)) || 1, Ft = ((V = (v = (s = E?.getModel) == null ? void 0 : s.call(E)) == null ? void 0 : v.getLineCount) == null ? void 0 : V.call(v)) || 1, _t = Math.max(Ot, Ft), Pt = Math.max(Se(C), Se(E));
|
|
234
|
+
return Math.ceil(_t * (Pt + 1.5) + 0 + 1);
|
|
235
|
+
}
|
|
236
|
+
if (w?.getContentHeight) {
|
|
237
|
+
(R = w?.layout) == null || R.call(w);
|
|
238
|
+
const C = w.getContentHeight();
|
|
239
|
+
if (C > 0) return Math.ceil(C + 1);
|
|
240
|
+
}
|
|
241
|
+
const U = (x = w?.getModel) == null ? void 0 : x.call(w);
|
|
242
|
+
let we = 1;
|
|
243
|
+
U && typeof U.getLineCount == "function" && (we = U.getLineCount());
|
|
244
|
+
const Pe = Se(w);
|
|
245
|
+
return Math.ceil(we * (Pe + 1.5) + 0 + 1);
|
|
246
|
+
} catch {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function Fe() {
|
|
251
|
+
var t, e, n, o, i, a, c, r;
|
|
252
|
+
const y = d.value, s = X.value;
|
|
253
|
+
if (!y || !s) return;
|
|
254
|
+
const v = y.querySelector(".monaco-editor") || y, V = v.querySelector(".monaco-editor-background") || v, R = v.querySelector(".view-lines") || v;
|
|
255
|
+
let x = null, w = null, U = null;
|
|
256
|
+
try {
|
|
257
|
+
typeof window < "u" && typeof window.getComputedStyle == "function" && (x = window.getComputedStyle(v), w = V === v ? x : window.getComputedStyle(V), U = R === v ? x : window.getComputedStyle(R));
|
|
258
|
+
} catch {
|
|
259
|
+
x = null, w = null, U = null;
|
|
260
|
+
}
|
|
261
|
+
const we = String((t = x?.getPropertyValue("--vscode-editor-foreground")) != null ? t : "").trim(), Pe = String((e = x?.getPropertyValue("--vscode-editor-background")) != null ? e : "").trim(), C = String((o = (n = x?.getPropertyValue("--vscode-editor-selectionBackground")) != null ? n : x?.getPropertyValue("--vscode-editor-hoverHighlightBackground")) != null ? o : "").trim(), E = we || String((a = (i = U?.color) != null ? i : x?.color) != null ? a : "").trim(), ge = Pe || String((r = (c = w?.backgroundColor) != null ? c : x?.backgroundColor) != null ? r : "").trim();
|
|
262
|
+
E && s.style.setProperty("--vscode-editor-foreground", E), ge && s.style.setProperty("--vscode-editor-background", ge), C && s.style.setProperty("--vscode-editor-selectionBackground", C);
|
|
263
|
+
}
|
|
264
|
+
function J() {
|
|
265
|
+
try {
|
|
266
|
+
const t = d.value;
|
|
267
|
+
if (!t) return;
|
|
268
|
+
const e = t.getBoundingClientRect(), n = window.scrollY + e.top, o = Ue();
|
|
269
|
+
if (o != null && o > 0) {
|
|
270
|
+
const i = e.height;
|
|
271
|
+
t.style.height = `${Math.ceil(o)}px`, t.style.maxHeight = "none";
|
|
272
|
+
const a = Math.ceil(o) - i;
|
|
273
|
+
a !== 0 && n < window.scrollY && window.scrollBy(0, a);
|
|
274
|
+
}
|
|
275
|
+
} catch {
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function ee() {
|
|
279
|
+
var t;
|
|
280
|
+
try {
|
|
281
|
+
const e = d.value;
|
|
282
|
+
if (!e) return;
|
|
283
|
+
const n = e.getBoundingClientRect(), o = window.scrollY + n.top, i = n.height, a = (function() {
|
|
284
|
+
var s, v;
|
|
285
|
+
const V = (v = (s = l.monacoOptions) == null ? void 0 : s.MAX_HEIGHT) != null ? v : 500;
|
|
286
|
+
if (typeof V == "number") return V;
|
|
287
|
+
const R = String(V).match(/^(\d+(?:\.\d+)?)/);
|
|
288
|
+
return R ? Number.parseFloat(R[1]) : 500;
|
|
289
|
+
})();
|
|
290
|
+
if (be > 0 && (be--, A.value != null)) {
|
|
291
|
+
const s = Math.min(A.value, a);
|
|
292
|
+
e.style.height = `${Math.ceil(s)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
|
|
293
|
+
const v = Math.ceil(s) - i;
|
|
294
|
+
return void (v !== 0 && o < window.scrollY && window.scrollBy(0, v));
|
|
295
|
+
}
|
|
296
|
+
const c = Ue();
|
|
297
|
+
if (c != null && c > 0) {
|
|
298
|
+
const s = Math.min(c, a);
|
|
299
|
+
e.style.height = `${Math.ceil(s)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
|
|
300
|
+
const v = Math.ceil(s) - i;
|
|
301
|
+
return void (v !== 0 && o < window.scrollY && window.scrollBy(0, v));
|
|
302
|
+
}
|
|
303
|
+
if (A.value != null) {
|
|
304
|
+
const s = Math.min(A.value, a);
|
|
305
|
+
e.style.height = `${Math.ceil(s)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
|
|
306
|
+
const v = Math.ceil(s) - i;
|
|
307
|
+
return void (v !== 0 && o < window.scrollY && window.scrollBy(0, v));
|
|
308
|
+
}
|
|
309
|
+
const r = Math.ceil(((t = e.getBoundingClientRect) == null ? void 0 : t.call(e).height) || 0);
|
|
310
|
+
if (r > 0) {
|
|
311
|
+
const s = Math.min(r, a);
|
|
312
|
+
e.style.height = `${Math.ceil(s)}px`, e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
|
|
313
|
+
const v = Math.ceil(s) - i;
|
|
314
|
+
return void (v !== 0 && o < window.scrollY && window.scrollBy(0, v));
|
|
315
|
+
}
|
|
316
|
+
const y = Number.parseFloat(e.style.height);
|
|
317
|
+
if (!Number.isNaN(y) && y > 0) {
|
|
318
|
+
const s = Math.ceil(Math.min(y, a));
|
|
319
|
+
e.style.height = `${s}px`;
|
|
320
|
+
const v = s - i;
|
|
321
|
+
v !== 0 && o < window.scrollY && window.scrollBy(0, v);
|
|
322
|
+
} else {
|
|
323
|
+
const s = Math.ceil(a);
|
|
324
|
+
e.style.height = `${s}px`;
|
|
325
|
+
const v = s - i;
|
|
326
|
+
v !== 0 && o < window.scrollY && window.scrollBy(0, v);
|
|
327
|
+
}
|
|
328
|
+
e.style.maxHeight = `${Math.ceil(a)}px`, e.style.overflow = "auto";
|
|
329
|
+
} catch {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const _e = B(() => l.isShowPreview && (H.value === "html" || H.value === "svg"));
|
|
333
|
+
W(() => l.node.language, (t) => {
|
|
334
|
+
H.value = $e(t);
|
|
335
|
+
}), W(() => l.node.code, (t) => Y(null, null, function* () {
|
|
336
|
+
var e, n;
|
|
337
|
+
if (l.stream !== !1) {
|
|
338
|
+
if (H.value || (H.value = $e(Ve(t))), L && !ue.value && d.value) try {
|
|
339
|
+
yield he(d.value);
|
|
340
|
+
} catch {
|
|
341
|
+
}
|
|
342
|
+
P.value ? Me(String((e = l.node.originalCode) != null ? e : ""), String((n = l.node.updatedCode) != null ? n : ""), le.value) : xe(t, le.value), S.value && ae(() => J());
|
|
343
|
+
}
|
|
344
|
+
}));
|
|
345
|
+
const gt = B(() => {
|
|
346
|
+
const t = H.value;
|
|
347
|
+
return t ? et[t] || t.charAt(0).toUpperCase() + t.slice(1) : et[""];
|
|
348
|
+
}), yt = B(() => jt(H.value || "")), kt = B(() => {
|
|
349
|
+
const t = {}, e = (i) => {
|
|
350
|
+
if (i != null) return typeof i == "number" ? `${i}px` : String(i);
|
|
351
|
+
}, n = e(l.minWidth), o = e(l.maxWidth);
|
|
352
|
+
return n && (t.minWidth = n), o && (t.maxWidth = o), t;
|
|
353
|
+
});
|
|
354
|
+
function bt() {
|
|
355
|
+
return Y(this, null, function* () {
|
|
356
|
+
try {
|
|
357
|
+
typeof navigator < "u" && navigator.clipboard && typeof navigator.clipboard.writeText == "function" && (yield navigator.clipboard.writeText(l.node.code)), K.value = !0, q("copy", l.node.code), setTimeout(() => {
|
|
358
|
+
K.value = !1;
|
|
359
|
+
}, 1e3);
|
|
360
|
+
} catch (t) {
|
|
361
|
+
console.error("复制失败:", t);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function Xe(t) {
|
|
366
|
+
return !t || t.disabled;
|
|
367
|
+
}
|
|
368
|
+
function T(t, e, n = "top") {
|
|
369
|
+
if (Xe(t.currentTarget)) return;
|
|
370
|
+
const o = t, i = o?.clientX != null && o?.clientY != null ? { x: o.clientX, y: o.clientY } : void 0;
|
|
371
|
+
nt(t.currentTarget, e, n, !1, i, l.isDark);
|
|
372
|
+
}
|
|
373
|
+
function _() {
|
|
374
|
+
Yt();
|
|
375
|
+
}
|
|
376
|
+
function Ae(t) {
|
|
377
|
+
if (Xe(t.currentTarget)) return;
|
|
378
|
+
const e = K.value ? f("common.copied") || "Copied" : f("common.copy") || "Copy", n = t, o = n?.clientX != null && n?.clientY != null ? { x: n.clientX, y: n.clientY } : void 0;
|
|
379
|
+
nt(t.currentTarget, e, "top", !1, o, l.isDark);
|
|
380
|
+
}
|
|
381
|
+
function xt() {
|
|
382
|
+
S.value = !S.value;
|
|
383
|
+
const t = P.value ? z() : j(), e = d.value;
|
|
384
|
+
t && e && (S.value ? (pe(!0), e.style.maxHeight = "none", e.style.overflow = "visible", J()) : (pe(!1), e.style.overflow = "auto", ee()));
|
|
385
|
+
}
|
|
386
|
+
function Mt() {
|
|
387
|
+
var t, e, n;
|
|
388
|
+
if (O.value = !O.value, O.value) {
|
|
389
|
+
if (d.value) {
|
|
390
|
+
const o = Math.ceil(((e = (t = d.value).getBoundingClientRect) == null ? void 0 : e.call(t).height) || 0);
|
|
391
|
+
o > 0 && (A.value = o);
|
|
392
|
+
}
|
|
393
|
+
pe(!1);
|
|
394
|
+
} else {
|
|
395
|
+
S.value && pe(!0), d.value && A.value != null && (d.value.style.height = `${A.value}px`);
|
|
396
|
+
const o = P.value ? z() : j();
|
|
397
|
+
try {
|
|
398
|
+
(n = o?.layout) == null || n.call(o);
|
|
399
|
+
} catch {
|
|
400
|
+
}
|
|
401
|
+
be = 2, ae(() => {
|
|
402
|
+
S.value ? J() : ee();
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function Ct() {
|
|
407
|
+
if (!_e.value) return;
|
|
408
|
+
const t = H.value;
|
|
409
|
+
if (b.value) {
|
|
410
|
+
const e = t === "html" ? "text/html" : "image/svg+xml", n = t === "html" ? f("artifacts.htmlPreviewTitle") || "HTML Preview" : f("artifacts.svgPreviewTitle") || "SVG Preview";
|
|
411
|
+
return void q("previewCode", { node: l.node, artifactType: e, artifactTitle: n, id: `temp-${t}-${Date.now()}` });
|
|
412
|
+
}
|
|
413
|
+
t === "html" && (fe.value = !fe.value);
|
|
414
|
+
}
|
|
415
|
+
function pe(t) {
|
|
416
|
+
var e, n;
|
|
417
|
+
try {
|
|
418
|
+
if (P.value) {
|
|
419
|
+
const o = z();
|
|
420
|
+
(e = o?.updateOptions) == null || e.call(o, { automaticLayout: t });
|
|
421
|
+
} else {
|
|
422
|
+
const o = j();
|
|
423
|
+
(n = o?.updateOptions) == null || n.call(o, { automaticLayout: t });
|
|
424
|
+
}
|
|
425
|
+
} catch {
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function he(t) {
|
|
429
|
+
return L ? Z || (ue.value = !0, Z = Y(null, null, function* () {
|
|
430
|
+
yield (function(n) {
|
|
431
|
+
return Y(this, null, function* () {
|
|
432
|
+
var o, i, a;
|
|
433
|
+
if (!L) return;
|
|
434
|
+
P.value ? (ve(), ce ? yield ce(n, String((o = l.node.originalCode) != null ? o : ""), String((i = l.node.updatedCode) != null ? i : ""), le.value) : yield L(n, l.node.code, le.value)) : yield L(n, l.node.code, le.value);
|
|
435
|
+
const c = P.value ? z() : j();
|
|
436
|
+
if (typeof ((a = l.monacoOptions) == null ? void 0 : a.fontSize) == "number") c?.updateOptions({ fontSize: l.monacoOptions.fontSize, automaticLayout: !1 }), $.value = l.monacoOptions.fontSize, h.value = l.monacoOptions.fontSize;
|
|
437
|
+
else {
|
|
438
|
+
const r = Re();
|
|
439
|
+
r && r > 0 ? ($.value = r, h.value = r) : ($.value = 12, h.value = 12);
|
|
440
|
+
}
|
|
441
|
+
S.value || O.value || ee(), l.loading === !1 && (yield ye(), ae(() => {
|
|
442
|
+
S.value && !O.value ? J() : O.value || ee();
|
|
443
|
+
})), yield ye(), Q.value = !0, Fe();
|
|
444
|
+
});
|
|
445
|
+
})(t);
|
|
446
|
+
}).finally(() => {
|
|
447
|
+
Z = null;
|
|
448
|
+
}), Z) : null;
|
|
449
|
+
}
|
|
450
|
+
W(() => h.value, (t, e) => {
|
|
451
|
+
const n = P.value ? z() : j();
|
|
452
|
+
n && typeof t == "number" && Number.isFinite(t) && t > 0 && (n.updateOptions({ fontSize: t }), S.value && !O.value && J());
|
|
453
|
+
}, { flush: "post", immediate: !1 });
|
|
454
|
+
const Bt = W(() => [d.value, P.value, l.stream, l.loading, se.value, I.value], (t) => Y(null, [t], function* ([e, n, o, i, a, c]) {
|
|
455
|
+
if (!e || !L || !c || o === !1 && i !== !1) return;
|
|
456
|
+
const r = he(e);
|
|
457
|
+
if (r) {
|
|
458
|
+
try {
|
|
459
|
+
yield r;
|
|
460
|
+
} catch {
|
|
461
|
+
Q.value = !1;
|
|
462
|
+
}
|
|
463
|
+
Bt();
|
|
464
|
+
}
|
|
465
|
+
}));
|
|
466
|
+
function Je() {
|
|
467
|
+
return l.isDark ? l.darkTheme : l.lightTheme;
|
|
468
|
+
}
|
|
469
|
+
W(We, (t, e) => Y(null, null, function* () {
|
|
470
|
+
if (t !== e && (vt.value = t, L && d.value && ue.value && (l.stream !== !1 || l.loading === !1) && I.value)) try {
|
|
471
|
+
Q.value = !1, ue.value = !1, Z = null, ve(), yield ye(), yield he(d.value);
|
|
472
|
+
} catch {
|
|
473
|
+
Q.value = !1;
|
|
474
|
+
}
|
|
475
|
+
})), W(() => [l.isDark, l.darkTheme, l.lightTheme, se.value], () => {
|
|
476
|
+
se.value && (function() {
|
|
477
|
+
const t = Je();
|
|
478
|
+
t && (function(e, n) {
|
|
479
|
+
const o = (function(i) {
|
|
480
|
+
if (i == null) return null;
|
|
481
|
+
if (typeof i == "string") return i;
|
|
482
|
+
if (typeof i == "object" && i && "name" in i) return String(i.name);
|
|
483
|
+
if (typeof i == "object") {
|
|
484
|
+
const a = Le.get(i);
|
|
485
|
+
if (a) return a;
|
|
486
|
+
try {
|
|
487
|
+
const r = JSON.stringify(i);
|
|
488
|
+
if (r) return Le.set(i, r), r;
|
|
489
|
+
} catch {
|
|
490
|
+
}
|
|
491
|
+
const c = "__theme_" + ++Zt;
|
|
492
|
+
return Le.set(i, c), c;
|
|
493
|
+
}
|
|
494
|
+
return String(i);
|
|
495
|
+
})(n);
|
|
496
|
+
return o ? (He = e, te || De !== o ? te ? (ne === o || ze === o || (re = n, ne = o), te) : (re = n, ne = o, te = Y(null, null, function* () {
|
|
497
|
+
for (; ne && re != null; ) {
|
|
498
|
+
const i = re, a = ne;
|
|
499
|
+
if (re = null, ne = null, De !== a) try {
|
|
500
|
+
ze = a, yield (He ?? e)(i), De = a;
|
|
501
|
+
} catch {
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}).finally(() => {
|
|
505
|
+
te = null, ze = null;
|
|
506
|
+
}), te) : Promise.resolve()) : Promise.resolve();
|
|
507
|
+
})(Be, t).then(() => {
|
|
508
|
+
Q.value && ae(() => Fe());
|
|
509
|
+
});
|
|
510
|
+
})();
|
|
511
|
+
}), W(() => [l.monacoOptions, I.value], () => {
|
|
512
|
+
var t, e;
|
|
513
|
+
if (!L || !I.value) return;
|
|
514
|
+
const n = P.value ? z() : j(), o = typeof ((t = l.monacoOptions) == null ? void 0 : t.fontSize) == "number" ? l.monacoOptions.fontSize : Number.isFinite(h.value) ? h.value : void 0;
|
|
515
|
+
typeof o == "number" && Number.isFinite(o) && o > 0 && ((e = n?.updateOptions) == null || e.call(n, { fontSize: o })), S.value && !O.value ? J() : O.value || ee();
|
|
516
|
+
}, { deep: !0 });
|
|
517
|
+
const St = W(() => [l.loading, I.value], (t) => Y(null, [t], function* ([e, n]) {
|
|
518
|
+
n && (e || (yield ye(), ae(() => {
|
|
519
|
+
O.value || (S.value ? J() : ee()), St();
|
|
520
|
+
})));
|
|
521
|
+
}), { immediate: !0, flush: "post" });
|
|
522
|
+
return ut(() => {
|
|
523
|
+
Ce();
|
|
524
|
+
}), (t, e) => me.value ? (F(), ke(g(tt), { key: 0, node: p.node, loading: l.loading }, null, 8, ["node", "loading"])) : (F(), D("div", { key: 1, ref_key: "container", ref: X, style: Ee(kt.value), class: oe(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm", [l.isDark ? "border-gray-700/30 bg-gray-900" : "border-gray-200 bg-white", { "is-rendering": l.loading, "is-dark": l.isDark }]]) }, [l.showHeader ? (F(), D("div", en, [Ne(t.$slots, "header-left", {}, () => [u("div", tn, [u("span", { class: "icon-slot h-4 w-4 flex-shrink-0", innerHTML: yt.value }, null, 8, nn), u("span", on, Ye(gt.value), 1)])], !0), Ne(t.$slots, "header-right", {}, () => [u("div", ln, [u("button", { type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", "aria-pressed": O.value, onClick: Mt, onMouseenter: e[0] || (e[0] = (n) => T(n, O.value ? g(f)("common.expand") || "Expand" : g(f)("common.collapse") || "Collapse")), onFocus: e[1] || (e[1] = (n) => T(n, O.value ? g(f)("common.expand") || "Expand" : g(f)("common.collapse") || "Collapse")), onMouseleave: _, onBlur: _ }, [(F(), D("svg", { style: Ee({ rotate: O.value ? "0deg" : "90deg" }), xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, [...e[17] || (e[17] = [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m9 18l6-6l-6-6" }, null, -1)])], 4))], 40, an), l.showFontSizeButtons && l.enableFontSizeControl ? (F(), D($t, { key: 0 }, [u("button", { type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", disabled: !!Number.isFinite(h.value) && h.value <= 10, onClick: e[2] || (e[2] = (n) => (function() {
|
|
525
|
+
const o = Oe(), i = Math.max(10, o - 1);
|
|
526
|
+
h.value = i;
|
|
527
|
+
})()), onMouseenter: e[3] || (e[3] = (n) => T(n, g(f)("common.decrease") || "Decrease")), onFocus: e[4] || (e[4] = (n) => T(n, g(f)("common.decrease") || "Decrease")), onMouseleave: _, onBlur: _ }, [...e[18] || (e[18] = [u("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 12h14" })], -1)])], 40, rn), u("button", { type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", disabled: !ft.value || h.value === $.value, onClick: e[5] || (e[5] = (n) => (Oe(), void (Number.isFinite($.value) && (h.value = $.value)))), onMouseenter: e[6] || (e[6] = (n) => T(n, g(f)("common.reset") || "Reset")), onFocus: e[7] || (e[7] = (n) => T(n, g(f)("common.reset") || "Reset")), onMouseleave: _, onBlur: _ }, [...e[19] || (e[19] = [u("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, [u("g", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2" }, [u("path", { d: "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }), u("path", { d: "M3 3v5h5" })])], -1)])], 40, un), u("button", { type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", disabled: !!Number.isFinite(h.value) && h.value >= 36, onClick: e[8] || (e[8] = (n) => (function() {
|
|
528
|
+
const o = Oe(), i = Math.min(36, o + 1);
|
|
529
|
+
h.value = i;
|
|
530
|
+
})()), onMouseenter: e[9] || (e[9] = (n) => T(n, g(f)("common.increase") || "Increase")), onFocus: e[10] || (e[10] = (n) => T(n, g(f)("common.increase") || "Increase")), onMouseleave: _, onBlur: _ }, [...e[20] || (e[20] = [u("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": "true", role: "img", width: "1em", height: "1em", viewBox: "0 0 24 24", class: "w-3 h-3" }, [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 12h14m-7-7v14" })], -1)])], 40, sn)], 64)) : G("", !0), l.showCopyButton ? (F(), D("button", { key: 1, type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", "aria-label": K.value ? g(f)("common.copied") || "Copied" : g(f)("common.copy") || "Copy", onClick: bt, onMouseenter: e[11] || (e[11] = (n) => Ae(n)), onFocus: e[12] || (e[12] = (n) => Ae(n)), onMouseleave: _, onBlur: _ }, [K.value ? (F(), D("svg", vn, [...e[22] || (e[22] = [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M20 6L9 17l-5-5" }, null, -1)])])) : (F(), D("svg", dn, [...e[21] || (e[21] = [u("g", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2" }, [u("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }), u("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })], -1)])]))], 40, cn)) : G("", !0), l.showExpandButton ? (F(), D("button", { key: 2, type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", "aria-pressed": S.value, onClick: xt, onMouseenter: e[13] || (e[13] = (n) => T(n, S.value ? g(f)("common.collapse") || "Collapse" : g(f)("common.expand") || "Expand")), onFocus: e[14] || (e[14] = (n) => T(n, S.value ? g(f)("common.collapse") || "Collapse" : g(f)("common.expand") || "Expand")), onMouseleave: _, onBlur: _ }, [S.value ? (F(), D("svg", fn, [...e[23] || (e[23] = [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6" }, null, -1)])])) : (F(), D("svg", pn, [...e[24] || (e[24] = [u("path", { fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6" }, null, -1)])]))], 40, mn)) : G("", !0), _e.value && l.showPreviewButton ? (F(), D("button", { key: 3, type: "button", class: "code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]", "aria-label": g(f)("common.preview") || "Preview", onClick: Ct, onMouseenter: e[15] || (e[15] = (n) => T(n, g(f)("common.preview") || "Preview")), onFocus: e[16] || (e[16] = (n) => T(n, g(f)("common.preview") || "Preview")), onMouseleave: _, onBlur: _ }, [...e[25] || (e[25] = [u("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24" }, [u("g", { fill: "currentColor", "fill-rule": "evenodd", "clip-rule": "evenodd" }, [u("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" }), u("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" })])], -1)])], 40, hn)) : G("", !0)])], !0)])) : G("", !0), Qe(u("div", wn, [u("div", { ref_key: "codeEditor", ref: d, class: oe(["code-editor-container", [p.stream ? "" : "code-height-placeholder", { "is-hidden": qe.value }]]) }, null, 2), qe.value ? (F(), ke(g(tt), { key: 0, class: oe(["code-pre-fallback", { "is-wrap": mt.value }]), style: Ee(wt.value), node: p.node }, null, 8, ["class", "style", "node"])) : G("", !0)], 512), [[Ze, !(O.value || !p.stream && p.loading)]]), fe.value && !b.value && _e.value && H.value === "html" ? (F(), ke(Qt, { key: 1, code: p.node.code, "is-dark": l.isDark, "on-close": () => fe.value = !1 }, null, 8, ["code", "is-dark", "on-close"])) : G("", !0), Qe(u("div", gn, [Ne(t.$slots, "loading", { loading: p.loading, stream: p.stream }, () => [e[26] || (e[26] = u("div", { class: "loading-skeleton" }, [u("div", { class: "skeleton-line" }), u("div", { class: "skeleton-line" }), u("div", { class: "skeleton-line short" })], -1))], !0)], 512), [[Ze, !p.stream && p.loading]]), u("span", yn, Ye(K.value ? g(f)("common.copied") || "Copied" : ""), 1)], 6));
|
|
531
|
+
} }), [["__scopeId", "data-v-bf41db7f"]]);
|
|
532
|
+
je.install = (p) => {
|
|
533
|
+
p.component(je.__name, je);
|
|
534
|
+
};
|
|
535
|
+
export {
|
|
536
|
+
je as default
|
|
537
|
+
};
|