@moonshot-ai/kimi-code 0.17.0 → 0.17.1
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/main.mjs +46 -14
- package/dist-web/assets/{CodeBlockNode-xopu-OEb.js → CodeBlockNode-vmRAVvlY.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DmARNWLd.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D7cd0odT.js} +1 -1
- package/dist-web/assets/{Tooltip-DzPFYPha.js → Tooltip-CI0tm-sG.js} +1 -1
- package/dist-web/assets/{arc-D9ISmG8O.js → arc-Djkym0AF.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-Bde5KvUn.js → architectureDiagram-3BPJPVTR-DLrOk3V4.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-JCl1lMhx.js → blockDiagram-GPEHLZMM-D7ZMpDwh.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-CbJhvcRt.js → c4Diagram-AAUBKEIU-3sZCSGlJ.js} +1 -1
- package/dist-web/assets/channel-97XWJRAg.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-L9nQnfKd.js → chunk-2J33WTMH-TZ7iDloU.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-zohve9Ok.js → chunk-4BX2VUAB-os68rI_r.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DR3E48TL.js → chunk-55IACEB6-BdcyQW8j.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-C18LQHi4.js → chunk-727SXJPM-hV3FcNf8.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-BsjNQvhe.js → chunk-AQP2D5EJ-CpCXUpoM.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-774mj8wI.js → chunk-FMBD7UC4-BGDdp_2m.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BahAcenP.js → chunk-ND2GUHAM-BVuDpfxz.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-Dc2ML4_y.js → chunk-QZHKN3VN-AQKmYDN8.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-k3kUO4ez.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-k3kUO4ez.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-BHhvV2M3.js → cose-bilkent-S5V4N54A-jj0S_myT.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-CCUkqn3c.js → dagre-BM42HDAG-DhHXwUla.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-CJAIuD9v.js → diagram-2AECGRRQ-YuLZoYa_.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-CIzOyklY.js → diagram-5GNKFQAL-nNgfkL-R.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-Dy0TSkF9.js → diagram-KO2AKTUF-BrPhamXZ.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D0VZv9QJ.js → diagram-LMA3HP47-B9b99bO8.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BOmRuoa3.js → diagram-OG6HWLK6-CCcsE4Tt.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-XD82Xp5G.js → erDiagram-TEJ5UH35-B_OK4boO.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-Cjx82rYf.js → flowDiagram-I6XJVG4X-X7Nm6QCL.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-uApHfVFI.js → ganttDiagram-6RSMTGT7-B4_qFAVN.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-pCJa6Sqh.js → gitGraphDiagram-PVQCEYII-Ufsbvzz9.js} +1 -1
- package/dist-web/assets/{index-ruKp3ITH.js → index-BFpV325K.js} +1 -1
- package/dist-web/assets/{index-Bm5hIhdQ.css → index-CPTbmGc1.css} +1 -1
- package/dist-web/assets/{index-Cr6PBwa_.js → index-DJBkLs7V.js} +110 -110
- package/dist-web/assets/{index-DSJEhgK2.js → index-wPNJZXfp.js} +3 -3
- package/dist-web/assets/{index10-BU_fP3cF.js → index10-DpoaTccP.js} +1 -1
- package/dist-web/assets/{index11-4vKmecHt.js → index11-DNE8EUhV.js} +2 -2
- package/dist-web/assets/{index5-B_Zm1CXv.js → index5-CXG5Kvjq.js} +1 -1
- package/dist-web/assets/{index6-Bcj2CUc2.js → index6-CrFdDnVh.js} +1 -1
- package/dist-web/assets/{index7-CktYDBgt.js → index7-D59HZqqm.js} +1 -1
- package/dist-web/assets/{index8-Dv0bVWi6.js → index8-xIVr3unq.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-ntWeW9KZ.js → infoDiagram-5YYISTIA-CsE2g2Il.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-LIB-i9cU.js → ishikawaDiagram-YF4QCWOH-CYdUb1q3.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-BlfBWGGp.js → journeyDiagram-JHISSGLW-SkVrzfB4.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-D5dIR3XR.js → kanban-definition-UN3LZRKU-XnEcZATo.js} +1 -1
- package/dist-web/assets/{linear-DModnwwD.js → linear-DZVJqliw.js} +1 -1
- package/dist-web/assets/{mermaid.core-vCZSrzF3.js → mermaid.core-BDMalRpc.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-DtXX70f6.js → mindmap-definition-RKZ34NQL-DMLb1QNj.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-BTWE5xhz.js → pieDiagram-4H26LBE5-DOB1pjsN.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BIf4h40K.js → quadrantDiagram-W4KKPZXB-CA1tMTER.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-DYIJe9Dp.js → requirementDiagram-4Y6WPE33-itYDyshX.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-C6fQmYW1.js → sankeyDiagram-5OEKKPKP-B716oThO.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-j9sFp20c.js → sequenceDiagram-3UESZ5HK-BDQQ2PKi.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-BmdayxXt.js → stateDiagram-AJRCARHV-hOpURkpJ.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DgPl6urs.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-CoPa3Alw.js → timeline-definition-PNZ67QCA-H6cvrlnv.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-C1znvnC_.js → vennDiagram-CIIHVFJN-BGpdRtjz.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-C3-MzG4F.js → vue.runtime.esm-bundler-BKNhxoad.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CRUU46rw.js → wardley-L42UT6IY-BPYGeryJ.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-u3Px8OI4.js → wardleyDiagram-YWT4CUSO-Cv6P6sbi.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-CCMgiVYB.js → xychartDiagram-2RQKCTM6-Dnx33n3-.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +2 -2
- package/dist-web/assets/channel-Dx9cvqoI.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-CQBVgO9P.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CQBVgO9P.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BGbtlEvl.js +0 -1
package/dist/main.mjs
CHANGED
|
@@ -183731,20 +183731,20 @@ function emptyUpdateInstallState() {
|
|
|
183731
183731
|
}
|
|
183732
183732
|
//#endregion
|
|
183733
183733
|
//#region src/cli/update/source.ts
|
|
183734
|
-
const nodeRequire$
|
|
183735
|
-
let cachedSea;
|
|
183736
|
-
function loadSeaModule$
|
|
183737
|
-
if (cachedSea !== void 0) return cachedSea;
|
|
183734
|
+
const nodeRequire$5 = createRequire(import.meta.url);
|
|
183735
|
+
let cachedSea$1;
|
|
183736
|
+
function loadSeaModule$2() {
|
|
183737
|
+
if (cachedSea$1 !== void 0) return cachedSea$1;
|
|
183738
183738
|
try {
|
|
183739
|
-
cachedSea = nodeRequire$
|
|
183739
|
+
cachedSea$1 = nodeRequire$5("node:sea");
|
|
183740
183740
|
} catch {
|
|
183741
|
-
cachedSea = null;
|
|
183741
|
+
cachedSea$1 = null;
|
|
183742
183742
|
}
|
|
183743
|
-
return cachedSea;
|
|
183743
|
+
return cachedSea$1;
|
|
183744
183744
|
}
|
|
183745
183745
|
/** Runtime SEA detection — true when running as a packaged native binary. */
|
|
183746
183746
|
function detectNativeInstall() {
|
|
183747
|
-
const sea = loadSeaModule$
|
|
183747
|
+
const sea = loadSeaModule$2();
|
|
183748
183748
|
if (sea === null) return false;
|
|
183749
183749
|
try {
|
|
183750
183750
|
return sea.isSea();
|
|
@@ -223273,6 +223273,7 @@ function mapFsWatchError(err) {
|
|
|
223273
223273
|
msg: err instanceof Error ? err.message : "fs watch error"
|
|
223274
223274
|
};
|
|
223275
223275
|
}
|
|
223276
|
+
createRequire(import.meta.url);
|
|
223276
223277
|
//#endregion
|
|
223277
223278
|
//#region src/cli/sub/server/shared.ts
|
|
223278
223279
|
const DEFAULT_SERVER_HOST = "127.0.0.1";
|
|
@@ -223434,20 +223435,44 @@ async function resolveDaemonPort(host = DEFAULT_SERVER_HOST, preferred = DEFAULT
|
|
|
223434
223435
|
for (let candidate = preferred; candidate < preferred + 100 && candidate <= 65535; candidate++) if (await canBind(host, candidate)) return candidate;
|
|
223435
223436
|
return getFreePort(host);
|
|
223436
223437
|
}
|
|
223438
|
+
const nodeRequire$3 = createRequire(import.meta.url);
|
|
223439
|
+
let cachedSea;
|
|
223440
|
+
function loadSeaModule$1() {
|
|
223441
|
+
if (cachedSea !== void 0) return cachedSea;
|
|
223442
|
+
try {
|
|
223443
|
+
cachedSea = nodeRequire$3("node:sea");
|
|
223444
|
+
} catch {
|
|
223445
|
+
cachedSea = null;
|
|
223446
|
+
}
|
|
223447
|
+
return cachedSea;
|
|
223448
|
+
}
|
|
223449
|
+
/** True when running as a compiled single-executable (SEA / native) binary. */
|
|
223450
|
+
function detectSea() {
|
|
223451
|
+
const sea = loadSeaModule$1();
|
|
223452
|
+
if (sea === null) return false;
|
|
223453
|
+
try {
|
|
223454
|
+
return sea.isSea();
|
|
223455
|
+
} catch {
|
|
223456
|
+
return false;
|
|
223457
|
+
}
|
|
223458
|
+
}
|
|
223437
223459
|
/**
|
|
223438
223460
|
* Absolute path to the CLI entry that should be re-execed to run the daemon.
|
|
223439
223461
|
* Mirrors `resolveSupervisorProgram` in `packages/server/src/svc/program.ts`:
|
|
223440
|
-
* when the CLI is a compiled single binary, `argv[1]` is
|
|
223441
|
-
*
|
|
223462
|
+
* when the CLI is a compiled single binary, `argv[1]` is the invoked command
|
|
223463
|
+
* name (e.g. `kimi`) or the first user argument — never a script path — so we
|
|
223464
|
+
* must re-exec `process.execPath` itself.
|
|
223442
223465
|
*/
|
|
223443
|
-
function resolveDaemonProgram(argv = process.argv, cwd = process.cwd(), execPath = process.execPath) {
|
|
223466
|
+
function resolveDaemonProgram(argv = process.argv, cwd = process.cwd(), execPath = process.execPath, isSea = detectSea()) {
|
|
223467
|
+
if (isSea) return execPath;
|
|
223444
223468
|
const candidate = argv[1] === "server" ? execPath : argv[1] ?? execPath;
|
|
223445
223469
|
return isAbsolute$1(candidate) ? candidate : resolve$1(cwd, candidate);
|
|
223446
223470
|
}
|
|
223447
223471
|
function spawnDaemonChild(options) {
|
|
223448
223472
|
const program = resolveDaemonProgram();
|
|
223449
223473
|
const logPath = daemonLogPath();
|
|
223450
|
-
|
|
223474
|
+
const logDir = dirname$1(logPath);
|
|
223475
|
+
mkdirSync(logDir, { recursive: true });
|
|
223451
223476
|
const args = [
|
|
223452
223477
|
"server",
|
|
223453
223478
|
"run",
|
|
@@ -223461,14 +223486,21 @@ function spawnDaemonChild(options) {
|
|
|
223461
223486
|
if (options.idleGraceMs !== void 0) args.push("--idle-grace-ms", String(options.idleGraceMs));
|
|
223462
223487
|
const logFd = openSync(logPath, "a");
|
|
223463
223488
|
try {
|
|
223464
|
-
spawn$1(program, args, {
|
|
223489
|
+
const child = spawn$1(program, args, {
|
|
223465
223490
|
detached: true,
|
|
223491
|
+
cwd: logDir,
|
|
223466
223492
|
stdio: [
|
|
223467
223493
|
"ignore",
|
|
223468
223494
|
logFd,
|
|
223469
223495
|
logFd
|
|
223470
223496
|
]
|
|
223471
|
-
})
|
|
223497
|
+
});
|
|
223498
|
+
child.once("error", (error) => {
|
|
223499
|
+
try {
|
|
223500
|
+
appendFileSync(logPath, `[spawner] failed to launch daemon: ${error.message}\n`);
|
|
223501
|
+
} catch {}
|
|
223502
|
+
});
|
|
223503
|
+
child.unref();
|
|
223472
223504
|
} finally {
|
|
223473
223505
|
closeSync(logFd);
|
|
223474
223506
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bR as Hl,cd as Nl,bQ as tl,M as nl,bl as zl,af as Vn,bZ as Tl,c0 as ll,aU as L,c1 as en,bT as Dl,bE as U,az as Rl,c2 as _l,aI as ol,aL as Ae,s as gt,bk as sn,ce as Jn,u as Gn,I as Wl,A as Al,bJ as mt,aY as tn,bL as Il,v as z,aw as nn,au as wt,t as ln,bB as ql,bb as dn,q as g,cf as jl,c4 as Ul,c5 as Vl,c6 as Jl,a0 as Gl,c3 as Yn,aD as Yl,bO as Ql,T as Xl,as as ne,b$ as Zl,cg as Kl}from"./index-
|
|
1
|
+
import{bR as Hl,cd as Nl,bQ as tl,M as nl,bl as zl,af as Vn,bZ as Tl,c0 as ll,aU as L,c1 as en,bT as Dl,bE as U,az as Rl,c2 as _l,aI as ol,aL as Ae,s as gt,bk as sn,ce as Jn,u as Gn,I as Wl,A as Al,bJ as mt,aY as tn,bL as Il,v as z,aw as nn,au as wt,t as ln,bB as ql,bb as dn,q as g,cf as jl,c4 as Ul,c5 as Vl,c6 as Jl,a0 as Gl,c3 as Yn,aD as Yl,bO as Ql,T as Xl,as as ne,b$ as Zl,cg as Kl}from"./index-DJBkLs7V.js";import{i as V,t as eo}from"./safeRaf-DGuzXxDK.js";import{V as to}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-D7cd0odT.js";var pt=(P,b,B)=>new Promise((r,ae)=>{var xe=C=>{try{J(B.next(C))}catch(E){ae(E)}},_=C=>{try{J(B.throw(C))}catch(E){ae(E)}},J=C=>C.done?r(C.value):Promise.resolve(C.value).then(xe,_);J((B=B.apply(P,b)).next())});let Qn=!1,et=null,ht=null,Xn=!1,tt=null;function no(){return pt(this,null,function*(){if(tt)return tt;tt=pt(null,null,function*(){if(!ht){if(Xn)return null;try{ht=yield Hl(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])}catch{return Xn=!0,null}}try{return yield(function(P){return pt(this,null,function*(){return Qn?void 0:et||(et=pt(null,null,function*(){const B=globalThis?.MonacoEnvironment;B&&(typeof B.getWorker=="function"||typeof B.getWorkerUrl=="function")||typeof P?.preloadMonacoWorkers!="function"||(yield P.preloadMonacoWorkers()),Qn=!0}).finally(()=>{et=null}),et)})})(ht),Nl(),ht}catch{return null}});try{return yield tt}finally{tt=null}})}var lo=Object.defineProperty,oo=Object.defineProperties,io=Object.getOwnPropertyDescriptors,Zn=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,ao=Object.prototype.propertyIsEnumerable,Kn=(P,b,B)=>b in P?lo(P,b,{enumerable:!0,configurable:!0,writable:!0,value:B}):P[b]=B,N=(P,b)=>{for(var B in b||(b={}))ro.call(b,B)&&Kn(P,B,b[B]);if(Zn)for(var B of Zn(b))ao.call(b,B)&&Kn(P,B,b[B]);return P},ke=(P,b)=>oo(P,io(b)),H=(P,b,B)=>new Promise((r,ae)=>{var xe=C=>{try{J(B.next(C))}catch(E){ae(E)}},_=C=>{try{J(B.throw(C))}catch(E){ae(E)}},J=C=>C.done?r(C.value):Promise.resolve(C.value).then(xe,_);J((B=B.apply(P,b)).next())});const uo={class:"html-preview-frame__header"},so={class:"html-preview-frame__title"},co={class:"html-preview-frame__label"},vo=["sandbox","srcdoc"],fo=tl(nl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(P){const b=P,B=import.meta!==void 0&&!1;let r=null;const{t:ae}=ll(),xe=g(()=>{const C=b.code||"",E=C.trim().toLowerCase();return E.startsWith("<!doctype")||E.startsWith("<html")||E.startsWith("<body")?C:`<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as N,c0 as V,aL as s,u as i,aY as f,v as o,bb as p,t as d,bk as c,aw as R,bO as _,G as D,I as $,bJ as H,F,g as A,bL as S,bB as M,aU as g,q as w,c6 as I,c2 as q}from"./index-Cr6PBwa_.js";const G={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},J={class:"flex items-center gap-0.5"},O=["aria-label"],U={class:"code-diff-stat removed"},Y={class:"code-diff-stat added"},K=["aria-label"],Q={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},W={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},X=["aria-pressed"],Z={key:3,class:"relative"},ee=["aria-expanded"],oe=["disabled"],te=["disabled"],ne=["disabled"],ae={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},re={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},le={class:"code-block-shell-content"},se={class:"code-loading-placeholder"},ie={class:"sr-only","aria-live":"polite",role:"status"},de=N({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(a,{emit:z}){const t=a,v=z,u=g(!1),x=g(null),b=g(null);function E(){u.value=!u.value,u.value&&document.addEventListener("click",y,{once:!0,capture:!0})}function y(l){var e,n;const C=l.target;(e=x.value)!=null&&e.contains(C)||(n=b.value)!=null&&n.contains(C)?document.addEventListener("click",y,{once:!0,capture:!0}):u.value=!1}const j=w(()=>t.showFontSizeButtons&&t.enableFontSizeControl||t.showExpandButton||t.isPreviewable&&t.showPreviewButton),{t:r}=V(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&I(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&q()}function B(l){m(l,t.copyText?r("common.copied")||"Copied":r("common.copy")||"Copy")}const L=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)<=((e=t.codeFontMin)!=null?e:0)}),T=w(()=>!t.fontBaselineReady||t.codeFontSize===t.defaultCodeFontSize),P=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)>=((e=t.codeFontMax)!=null?e:100)});return(l,e)=>(s(),i(F,null,[t.showHeader?(s(),i("div",G,[f(l.$slots,"header-left"),f(l.$slots,"header-right",{},()=>[o("div",J,[a.diffStats?(s(),i("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[o("span",U,"-"+p(a.diffStats.removed),1),o("span",Y,"+"+p(a.diffStats.added),1)],8,O)):d("",!0),t.showCopyButton?(s(),i("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":a.copyText?c(r)("common.copied")||"Copied":c(r)("common.copy")||"Copy",onClick:e[0]||(e[0]=n=>v("copy")),onMouseenter:e[1]||(e[1]=n=>B(n)),onFocus:e[2]||(e[2]=n=>B(n)),onMouseleave:h,onBlur:h},[a.copyText?(s(),i("svg",W,[...e[14]||(e[14]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(s(),i("svg",Q,[...e[13]||(e[13]=[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o("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,K)):d("",!0),t.showCollapseButton?(s(),i("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":a.isCollapsed,onClick:e[3]||(e[3]=n=>v("toggleCollapse")),onMouseenter:e[4]||(e[4]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onFocus:e[5]||(e[5]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onMouseleave:h,onBlur:h},[(s(),i("svg",{style:R({rotate:a.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,X)):d("",!0),j.value?(s(),i("div",Z,[o("button",{ref_key:"moreBtnRef",ref:b,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":u.value,"aria-haspopup":"true",onClick:_(E,["stop"]),onMouseenter:e[6]||(e[6]=n=>m(n,c(r)("common.more")||"More")),onFocus:e[7]||(e[7]=n=>m(n,c(r)("common.more")||"More")),onMouseleave:h,onBlur:h},[...e[16]||(e[16]=[D('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,ee),$(A,{name:"code-menu"},{default:H(()=>[u.value?(s(),i("div",{key:0,ref_key:"moreMenuRef",ref:x,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[t.showFontSizeButtons&&t.enableFontSizeControl?(s(),i(F,{key:0},[o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:L.value,onClick:e[8]||(e[8]=n=>v("decreaseFont"))},[e[17]||(e[17]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),o("span",null,p(c(r)("common.fontSmaller")||"Font size −"),1)],8,oe),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:T.value,onClick:e[9]||(e[9]=n=>v("resetFont"))},[e[18]||(e[18]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o("path",{d:"M3 3v5h5"})])],-1)),o("span",null,p(c(r)("common.fontReset")||"Font size reset"),1)],8,te),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:P.value,onClick:e[10]||(e[10]=n=>v("increaseFont"))},[e[19]||(e[19]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),o("span",null,p(c(r)("common.fontLarger")||"Font size +"),1)],8,ne)],64)):d("",!0),t.showExpandButton?(s(),i("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[11]||(e[11]=n=>{v("toggleExpand",n),u.value=!1})},[a.isExpanded?(s(),i("svg",ae,[...e[20]||(e[20]=[o("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)])])):(s(),i("svg",re,[...e[21]||(e[21]=[o("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)])])),o("span",null,p(a.isExpanded?c(r)("common.collapse")||"Collapse":c(r)("common.expand")||"Expand"),1)])):d("",!0),a.isPreviewable&&t.showPreviewButton?(s(),i("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[12]||(e[12]=n=>{v("preview"),u.value=!1})},[e[22]||(e[22]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),o("circle",{cx:"12",cy:"12",r:"3"})])],-1)),o("span",null,p(c(r)("common.preview")||"Preview"),1)])):d("",!0)],512)):d("",!0)]),_:1})])):d("",!0)])])])):d("",!0),S(o("div",le,[f(l.$slots,"default")],512),[[M,!(a.isCollapsed||!a.stream&&a.loading)]]),S(o("div",se,[f(l.$slots,"loading",{},()=>[e[23]||(e[23]=o("div",{class:"loading-skeleton"},[o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line short"})],-1))])],512),[[M,!a.stream&&a.loading]]),o("span",ie,p(a.copyText?c(r)("common.copied")||"Copied":""),1)],64))}});export{de as V};
|
|
1
|
+
import{M as N,c0 as V,aL as s,u as i,aY as f,v as o,bb as p,t as d,bk as c,aw as R,bO as _,G as D,I as $,bJ as H,F,g as A,bL as S,bB as M,aU as g,q as w,c6 as I,c2 as q}from"./index-DJBkLs7V.js";const G={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},J={class:"flex items-center gap-0.5"},O=["aria-label"],U={class:"code-diff-stat removed"},Y={class:"code-diff-stat added"},K=["aria-label"],Q={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},W={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},X=["aria-pressed"],Z={key:3,class:"relative"},ee=["aria-expanded"],oe=["disabled"],te=["disabled"],ne=["disabled"],ae={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},re={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},le={class:"code-block-shell-content"},se={class:"code-loading-placeholder"},ie={class:"sr-only","aria-live":"polite",role:"status"},de=N({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(a,{emit:z}){const t=a,v=z,u=g(!1),x=g(null),b=g(null);function E(){u.value=!u.value,u.value&&document.addEventListener("click",y,{once:!0,capture:!0})}function y(l){var e,n;const C=l.target;(e=x.value)!=null&&e.contains(C)||(n=b.value)!=null&&n.contains(C)?document.addEventListener("click",y,{once:!0,capture:!0}):u.value=!1}const j=w(()=>t.showFontSizeButtons&&t.enableFontSizeControl||t.showExpandButton||t.isPreviewable&&t.showPreviewButton),{t:r}=V(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&I(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&q()}function B(l){m(l,t.copyText?r("common.copied")||"Copied":r("common.copy")||"Copy")}const L=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)<=((e=t.codeFontMin)!=null?e:0)}),T=w(()=>!t.fontBaselineReady||t.codeFontSize===t.defaultCodeFontSize),P=w(()=>{var l,e;return!!Number.isFinite(t.codeFontSize)&&((l=t.codeFontSize)!=null?l:0)>=((e=t.codeFontMax)!=null?e:100)});return(l,e)=>(s(),i(F,null,[t.showHeader?(s(),i("div",G,[f(l.$slots,"header-left"),f(l.$slots,"header-right",{},()=>[o("div",J,[a.diffStats?(s(),i("div",{key:0,class:"code-diff-stats","aria-label":a.diffStatsAriaLabel},[o("span",U,"-"+p(a.diffStats.removed),1),o("span",Y,"+"+p(a.diffStats.added),1)],8,O)):d("",!0),t.showCopyButton?(s(),i("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":a.copyText?c(r)("common.copied")||"Copied":c(r)("common.copy")||"Copy",onClick:e[0]||(e[0]=n=>v("copy")),onMouseenter:e[1]||(e[1]=n=>B(n)),onFocus:e[2]||(e[2]=n=>B(n)),onMouseleave:h,onBlur:h},[a.copyText?(s(),i("svg",W,[...e[14]||(e[14]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(s(),i("svg",Q,[...e[13]||(e[13]=[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),o("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,K)):d("",!0),t.showCollapseButton?(s(),i("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":a.isCollapsed,onClick:e[3]||(e[3]=n=>v("toggleCollapse")),onMouseenter:e[4]||(e[4]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onFocus:e[5]||(e[5]=n=>m(n,a.isCollapsed?c(r)("common.expand")||"Expand":c(r)("common.collapse")||"Collapse")),onMouseleave:h,onBlur:h},[(s(),i("svg",{style:R({rotate:a.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,X)):d("",!0),j.value?(s(),i("div",Z,[o("button",{ref_key:"moreBtnRef",ref:b,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":u.value,"aria-haspopup":"true",onClick:_(E,["stop"]),onMouseenter:e[6]||(e[6]=n=>m(n,c(r)("common.more")||"More")),onFocus:e[7]||(e[7]=n=>m(n,c(r)("common.more")||"More")),onMouseleave:h,onBlur:h},[...e[16]||(e[16]=[D('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,ee),$(A,{name:"code-menu"},{default:H(()=>[u.value?(s(),i("div",{key:0,ref_key:"moreMenuRef",ref:x,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[t.showFontSizeButtons&&t.enableFontSizeControl?(s(),i(F,{key:0},[o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:L.value,onClick:e[8]||(e[8]=n=>v("decreaseFont"))},[e[17]||(e[17]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),o("span",null,p(c(r)("common.fontSmaller")||"Font size −"),1)],8,oe),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:T.value,onClick:e[9]||(e[9]=n=>v("resetFont"))},[e[18]||(e[18]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),o("path",{d:"M3 3v5h5"})])],-1)),o("span",null,p(c(r)("common.fontReset")||"Font size reset"),1)],8,te),o("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:P.value,onClick:e[10]||(e[10]=n=>v("increaseFont"))},[e[19]||(e[19]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),o("span",null,p(c(r)("common.fontLarger")||"Font size +"),1)],8,ne)],64)):d("",!0),t.showExpandButton?(s(),i("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[11]||(e[11]=n=>{v("toggleExpand",n),u.value=!1})},[a.isExpanded?(s(),i("svg",ae,[...e[20]||(e[20]=[o("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)])])):(s(),i("svg",re,[...e[21]||(e[21]=[o("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)])])),o("span",null,p(a.isExpanded?c(r)("common.collapse")||"Collapse":c(r)("common.expand")||"Expand"),1)])):d("",!0),a.isPreviewable&&t.showPreviewButton?(s(),i("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:e[12]||(e[12]=n=>{v("preview"),u.value=!1})},[e[22]||(e[22]=o("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[o("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[o("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),o("circle",{cx:"12",cy:"12",r:"3"})])],-1)),o("span",null,p(c(r)("common.preview")||"Preview"),1)])):d("",!0)],512)):d("",!0)]),_:1})])):d("",!0)])])])):d("",!0),S(o("div",le,[f(l.$slots,"default")],512),[[M,!(a.isCollapsed||!a.stream&&a.loading)]]),S(o("div",se,[f(l.$slots,"loading",{},()=>[e[23]||(e[23]=o("div",{class:"loading-skeleton"},[o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line"}),o("div",{class:"skeleton-line short"})],-1))])],512),[[M,!a.stream&&a.loading]]),o("span",ie,p(a.copyText?c(r)("common.copied")||"Copied":""),1)],64))}});export{de as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-
|
|
1
|
+
import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-DJBkLs7V.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-CDU05fwN.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:q,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(q)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,j={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[j]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as ln,V as an,W as z,X as q,Y as X,$ as un,a0 as y,a1 as tn,a2 as F,a3 as _,a4 as rn,a5 as o,a6 as on,a7 as sn,a8 as fn}from"./mermaid.core-
|
|
1
|
+
import{T as ln,V as an,W as z,X as q,Y as X,$ as un,a0 as y,a1 as tn,a2 as F,a3 as _,a4 as rn,a5 as o,a6 as on,a7 as sn,a8 as fn}from"./mermaid.core-BDMalRpc.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,Y,a){var O=I-l,i=D-h,n=Y-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function M(l,h,I,D,v,A,Y){var a=l-I,O=h-D,i=(Y?A:-A)/F(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,$=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*F(on(0,T*T*R-P*P)),V=(P*g-m*S)/R,W=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=V-$,e=W-t,r=w-$,j=p-t;return x*x+e*e>r*r+j*j&&(V=w,W=p),{cx:V,cy:W,x01:-n,y01:-d,x11:V*(v/T-1),y11:W*(v/T-1)}}function hn(){var l=cn,h=yn,I=X(0),D=null,v=gn,A=dn,Y=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,$=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if($>tn-y)a.moveTo(s*z(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=$,S=$,V=Y.apply(this,arguments)/2,W=V>y&&(D?+D.apply(this,arguments):F(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(W>y){var j=sn(W/u*q(V)),G=sn(W/s*q(V));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(S-=G*2)>y?(G*=t?1:-1,m+=G,g-=G):(S=0,m=g=(f+c)/2)}var B=s*z(m),C=s*q(m),H=u*z(T),J=u*q(T);if(w>y){var K=s*z(g),L=s*q(g),N=u*z(R),Q=u*q(R),E;if($<an)if(E=pn(B,C,N,Q,K,L,H,J)){var U=B-E[0],Z=C-E[1],k=K-E[0],b=L-E[1],nn=1/q(fn((U*k+Z*b)/(F(U*U+Z*Z)*F(k*k+b*b)))/2),en=F(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=M(N,Q,B,C,s,x,t),r=M(K,L,H,J,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(H,J):p>y?(e=M(H,J,K,L,u,-p,t),r=M(B,C,N,Q,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:X(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:X(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:X(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:X(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:X(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:X(+n),i):A},i.padAngle=function(n){return arguments.length?(Y=typeof n=="function"?n:X(+n),i):Y},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|