@moonshot-ai/kimi-code 0.21.1 → 0.22.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 +47455 -4202
- package/dist-web/assets/{CodeBlockNode-j7RGe-Ru.js → CodeBlockNode-BeQAAdW3.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-D274ciOI.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D-VEP4Fn.js} +1 -1
- package/dist-web/assets/{Tooltip-DtxNXMAM.js → Tooltip-ChsJyhEI.js} +1 -1
- package/dist-web/assets/{arc-DQs9uADf.js → arc-DrGcGe6d.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BlG2tTPz.js → architectureDiagram-3BPJPVTR-iQ9G25kx.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-nkQI5ZZa.js → blockDiagram-GPEHLZMM-CuzX8waX.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-DZN5-qYv.js → c4Diagram-AAUBKEIU-lWe0pssH.js} +1 -1
- package/dist-web/assets/channel-BbUnBXY4.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-ByD5PYWi.js → chunk-2J33WTMH-BcD2luAP.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-DPyg-S27.js → chunk-4BX2VUAB-ZTdMsiUw.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-CH4yuhZ8.js → chunk-55IACEB6-JOHB87lb.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-DGgZVtcA.js → chunk-727SXJPM-BKcvO8HJ.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-hJPUZ-_O.js → chunk-AQP2D5EJ-pRCfr-UT.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-Barfn9Db.js → chunk-FMBD7UC4-Dwc_LTGi.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-ByZWAnct.js → chunk-ND2GUHAM-BXa5VPW8.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-i-qEmEeB.js → chunk-QZHKN3VN-DImyhT7B.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-C-JqfdmA.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-C-JqfdmA.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Cb-FqQcD.js → cose-bilkent-S5V4N54A-CmvBDyEQ.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-vKebiMPC.js → dagre-BM42HDAG-BLlVemY_.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DkhIWqYP.js → diagram-2AECGRRQ-S_ZOnEGh.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DN4cTkR0.js → diagram-5GNKFQAL-VWugledA.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DI-TheQb.js → diagram-KO2AKTUF-BqrJi52N.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D39qCe0X.js → diagram-LMA3HP47-BRwG6VJ2.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-ChLxsS1Q.js → diagram-OG6HWLK6-B4h3lC_6.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-qvX9VJtw.js → erDiagram-TEJ5UH35-CoynqafK.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DYLFBHuf.js → flowDiagram-I6XJVG4X-mSrbhP6V.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-tnxpnL8N.js → ganttDiagram-6RSMTGT7-DB1PpBk0.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D8AoA9Eo.js → gitGraphDiagram-PVQCEYII-DAFYaHhJ.js} +1 -1
- package/dist-web/assets/index-BQvC0kGr.css +1 -0
- package/dist-web/assets/{index-16wIPHON.js → index-C8mys0NG.js} +2 -2
- package/dist-web/assets/index-DZSqyBof.js +279 -0
- package/dist-web/assets/{index-CfoTgIKh.js → index-DlpeCxLp.js} +1 -1
- package/dist-web/assets/{index10-ChP4b_K8.js → index10-DRCxutuy.js} +1 -1
- package/dist-web/assets/{index11-D6-PIcGb.js → index11-tnZiF2AO.js} +1 -1
- package/dist-web/assets/{index5-C_gkYwVK.js → index5-D2oq_xzS.js} +1 -1
- package/dist-web/assets/{index6-fL_9Ohtp.js → index6-1drcChs1.js} +1 -1
- package/dist-web/assets/{index7-DX_J7I3Z.js → index7-aHTOwsn3.js} +1 -1
- package/dist-web/assets/{index8-D_LvlNqi.js → index8-Dirigide.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-REaaEnj0.js → infoDiagram-5YYISTIA-Baaxoh0q.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BiPRDWgG.js → ishikawaDiagram-YF4QCWOH-B8gKWcN0.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-DrZSDIQL.js → journeyDiagram-JHISSGLW-BFLRc4vu.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BQZXHq9-.js → kanban-definition-UN3LZRKU-DMx7OMEF.js} +1 -1
- package/dist-web/assets/{linear-DqGsUakD.js → linear-BEozvq1i.js} +1 -1
- package/dist-web/assets/{mermaid.core-DYzdrsrJ.js → mermaid.core-WmeW05Ym.js} +66 -66
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-D69QyDIc.js → mindmap-definition-RKZ34NQL-4lvrad5M.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CQwY5Xfh.js → pieDiagram-4H26LBE5-CMLLNBXh.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CLVmtX4l.js → quadrantDiagram-W4KKPZXB-CqO6IFQw.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-8ptI5UBX.js → requirementDiagram-4Y6WPE33-BSLBSfd0.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CZjapjER.js → sankeyDiagram-5OEKKPKP-Wkno3RO7.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CWHjmftc.js → sequenceDiagram-3UESZ5HK-BGHwV3az.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-D2xCeXSD.js → stateDiagram-AJRCARHV-CCyVLSRK.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BiqQXX0_.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-CRlejYtd.js → timeline-definition-PNZ67QCA-CUeXNWjD.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CTv_68HS.js → vennDiagram-CIIHVFJN-xk-ZH7as.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-CQbR9uOv.js → vue.runtime.esm-bundler-Cka7aKLe.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-0vHHFPAt.js → wardley-L42UT6IY-DgiOtIwh.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CpO8VbUu.js → wardleyDiagram-YWT4CUSO-BAVBFC-Y.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-ClTcdHp2.js → xychartDiagram-2RQKCTM6-C3IYtAxp.js} +1 -1
- package/dist-web/design-system.html +2360 -0
- package/dist-web/index.html +4 -7
- package/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/package.json +10 -9
- package/dist-web/assets/channel-EUwKK__D.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DugUof1s.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DugUof1s.js +0 -1
- package/dist-web/assets/index-DFqBlS-2.css +0 -1
- package/dist-web/assets/index-DTBMRzx_.js +0 -284
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dn6bAjEF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bR as ao,ci as uo,bQ as Bl,M as El,bl as so,af as gl,bZ as co,c0 as Ol,aU as P,bT as fo,bE as q,az as vo,c1 as wl,c2 as mo,aI as Ll,aL as Xe,s as Nn,bk as Et,cj as bl,u as Sl,I as po,A as ho,bJ as Ln,aY as bt,bL as yo,v as A,aw as St,au as Hn,t as kt,bB as go,bb as Ot,q as w,ck as wo,c4 as bo,c5 as So,c8 as ko,a0 as Co,c3 as kl,aD as xo,bO as Mo,T as Po,as as V,b$ as Bo,cl as Eo}from"./index-
|
|
1
|
+
import{bR as ao,ci as uo,bQ as Bl,M as El,bl as so,af as gl,bZ as co,c0 as Ol,aU as P,bT as fo,bE as q,az as vo,c1 as wl,c2 as mo,aI as Ll,aL as Xe,s as Nn,bk as Et,cj as bl,u as Sl,I as po,A as ho,bJ as Ln,aY as bt,bL as yo,v as A,aw as St,au as Hn,t as kt,bB as go,bb as Ot,q as w,ck as wo,c4 as bo,c5 as So,c8 as ko,a0 as Co,c3 as kl,aD as xo,bO as Mo,T as Po,as as V,b$ as Bo,cl as Eo}from"./index-DZSqyBof.js";import{i as Z,t as Oo}from"./safeRaf-DGuzXxDK.js";import{V as Lo}from"./CodeBlockShell.vue_vue_type_style_index_0_lang-D-VEP4Fn.js";var Fn=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});let Cl=!1,fn=null,vn=null,Ct=!1,mn=null;function Fo(){return Fn(this,null,function*(){if(mn)return mn;mn=Fn(null,null,function*(){if(!vn){if(Ct)return null;try{if(vn=(function(x){const k=x;if(typeof k?.useMonaco=="function")return k;const M=x?.default;return typeof M?.useMonaco=="function"?M:null})(yield ao(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js"),[])),!vn)return Ct=!0,null}catch{return Ct=!0,null}}try{return yield(function(x){return Fn(this,null,function*(){return Cl?void 0:fn||(fn=Fn(null,null,function*(){const M=globalThis?.MonacoEnvironment;M&&(typeof M.getWorker=="function"||typeof M.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Cl=!0}).finally(()=>{fn=null}),fn)})})(vn),uo(),vn}catch{return null}});try{return yield mn}finally{mn=null}})}var $o=Object.defineProperty,No=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,xl=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable,Ml=(x,k,M)=>k in x?$o(x,k,{enumerable:!0,configurable:!0,writable:!0,value:M}):x[k]=M,_=(x,k)=>{for(var M in k||(k={}))zo.call(k,M)&&Ml(x,M,k[M]);if(xl)for(var M of xl(k))To.call(k,M)&&Ml(x,M,k[M]);return x},ye=(x,k)=>No(x,Ho(k)),H=(x,k,M)=>new Promise((i,de)=>{var Oe=B=>{try{ee(M.next(B))}catch(L){de(L)}},K=B=>{try{ee(M.throw(B))}catch(L){de(L)}},ee=B=>B.done?i(B.value):Promise.resolve(B.value).then(Oe,K);ee((M=M.apply(x,k)).next())});const Ro={class:"html-preview-frame__header"},_o={class:"html-preview-frame__title"},Do={class:"html-preview-frame__label"},Wo=["sandbox","srcdoc"],Ao=Bl(El({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const k=x,M=import.meta!==void 0&&!1;let i=null;const{t:de}=Ol(),Oe=w(()=>{const B=k.code||"",L=B.trim().toLowerCase();return L.startsWith("<!doctype")||L.startsWith("<html")||L.startsWith("<body")?B:`<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as V,c0 as N,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,c8 as q,c2 as G}from"./index-DTBMRzx_.js";const I={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"},K=["aria-label"],O={class:"code-diff-stat removed"},U={class:"code-diff-stat added"},Y=["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=V({__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}=N(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&q(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&G()}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",I,[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",O,"-"+p(a.diffStats.removed),1),o("span",U,"+"+p(a.diffStats.added),1)],8,K)):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,Y)):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 V,c0 as N,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,c8 as q,c2 as G}from"./index-DZSqyBof.js";const I={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"},K=["aria-label"],O={class:"code-diff-stat removed"},U={class:"code-diff-stat added"},Y=["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=V({__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}=N(),k=w(()=>t.showTooltips!==!1);function m(l,e){k.value&&q(l.currentTarget,e,"top",!1,void 0,t.isDark)}function h(){k.value&&G()}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",I,[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",O,"-"+p(a.diffStats.removed),1),o("span",U,"+"+p(a.diffStats.added),1)],8,K)):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,Y)):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-DZSqyBof.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:j,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(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-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{W as ln,X as an,Y as B,$ as q,a0 as Y,a1 as un,a2 as y,a3 as tn,a4 as G,a5 as _,a6 as rn,a7 as o,a8 as on,a9 as sn,aa as fn}from"./mermaid.core-
|
|
1
|
+
import{W as ln,X as an,Y as B,$ as q,a0 as Y,a1 as un,a2 as y,a3 as tn,a4 as G,a5 as _,a6 as rn,a7 as o,a8 as on,a9 as sn,aa as fn}from"./mermaid.core-WmeW05Ym.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,$,a){var O=I-l,i=D-h,n=$-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 N(l,h,I,D,v,A,$){var a=l-I,O=h-D,i=($?A:-A)/G(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,j=(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)*G(on(0,T*T*R-P*P)),W=(P*g-m*S)/R,X=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=W-j,e=X-t,r=w-j,z=p-t;return x*x+e*e>r*r+z*z&&(W=w,X=p),{cx:W,cy:X,x01:-n,y01:-d,x11:W*(v/T-1),y11:X*(v/T-1)}}function hn(){var l=cn,h=yn,I=Y(0),D=null,v=gn,A=dn,$=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,j=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(j>tn-y)a.moveTo(s*B(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=j,S=j,W=$.apply(this,arguments)/2,X=W>y&&(D?+D.apply(this,arguments):G(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(X>y){var z=sn(X/u*q(W)),H=sn(X/s*q(W));(P-=z*2)>y?(z*=t?1:-1,R+=z,T-=z):(P=0,R=T=(f+c)/2),(S-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(S=0,m=g=(f+c)/2)}var C=s*B(m),F=s*q(m),J=u*B(T),K=u*q(T);if(w>y){var L=s*B(g),M=s*q(g),Q=u*B(R),U=u*q(R),E;if(j<an)if(E=pn(C,F,Q,U,L,M,J,K)){var V=C-E[0],Z=F-E[1],k=L-E[0],b=M-E[1],nn=1/q(fn((V*k+Z*b)/(G(V*V+Z*Z)*G(k*k+b*b)))/2),en=G(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=N(Q,U,C,F,s,x,t),r=N(L,M,J,K,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(C,F),a.arc(0,0,s,m,g,!t)):a.moveTo(C,F),!(u>y)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,Q,U,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[B(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:Y(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:Y(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:Y(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:Y(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:Y(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:Y(+n),i):A},i.padAngle=function(n){return arguments.length?($=typeof n=="function"?n:Y(+n),i):$},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|