litepaseo 0.14.2 → 0.14.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/CHANGELOG.md +6 -0
- package/dist/server/cli.mjs +2 -2
- package/dist/server/{worker-Bncuyaw7.mjs → worker-BTFquFtd.mjs} +5 -0
- package/dist/web/assets/{AddProjectDialog-Bftvd3Yz.js → AddProjectDialog-B-r008IH.js} +1 -1
- package/dist/web/assets/AddProjectDialog-B-r008IH.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-B-r008IH.js.gz +0 -0
- package/dist/web/assets/{ArchivedWorkspaces-DAtKiAKb.js → ArchivedWorkspaces-CE0ZiFNN.js} +1 -1
- package/dist/web/assets/ArchivedWorkspaces-CE0ZiFNN.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-CE0ZiFNN.js.gz +0 -0
- package/dist/web/assets/{ChangesPanel-LDYyiOkA.js → ChangesPanel-2dFqPKh-.js} +1 -1
- package/dist/web/assets/ChangesPanel-2dFqPKh-.js.br +0 -0
- package/dist/web/assets/ChangesPanel-2dFqPKh-.js.gz +0 -0
- package/dist/web/assets/{CodeBlockNode-Ubb_GmEN.js → CodeBlockNode-CCsuwj3e.js} +1 -1
- package/dist/web/assets/CodeBlockNode-CCsuwj3e.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CCsuwj3e.js.gz +0 -0
- package/dist/web/assets/{CommandCenter-C9e_MHP7.js → CommandCenter-BVWL6A1k.js} +1 -1
- package/dist/web/assets/CommandCenter-BVWL6A1k.js.br +0 -0
- package/dist/web/assets/CommandCenter-BVWL6A1k.js.gz +0 -0
- package/dist/web/assets/{ConversationSearch-BVkg07Q4.js → ConversationSearch-DnimOmMN.js} +1 -1
- package/dist/web/assets/ConversationSearch-DnimOmMN.js.br +0 -0
- package/dist/web/assets/ConversationSearch-DnimOmMN.js.gz +0 -0
- package/dist/web/assets/{FileViewer-IobGwtBO.js → FileViewer-lhTEo-fK.js} +1 -1
- package/dist/web/assets/FileViewer-lhTEo-fK.js.br +0 -0
- package/dist/web/assets/FileViewer-lhTEo-fK.js.gz +0 -0
- package/dist/web/assets/{FilesPanel-DRE6I9Zu.js → FilesPanel-D3anmEzt.js} +1 -1
- package/dist/web/assets/FilesPanel-D3anmEzt.js.br +0 -0
- package/dist/web/assets/FilesPanel-D3anmEzt.js.gz +0 -0
- package/dist/web/assets/{HostSettings-DUReTPzX.js → HostSettings-CwRQdQMg.js} +1 -1
- package/dist/web/assets/HostSettings-CwRQdQMg.js.br +0 -0
- package/dist/web/assets/HostSettings-CwRQdQMg.js.gz +0 -0
- package/dist/web/assets/{ImportSessionDialog-Bg9XZ_ab.js → ImportSessionDialog-B7yNNHSp.js} +1 -1
- package/dist/web/assets/ImportSessionDialog-B7yNNHSp.js.br +0 -0
- package/dist/web/assets/ImportSessionDialog-B7yNNHSp.js.gz +0 -0
- package/dist/web/assets/{KanbanPage-lKwsQfA_.js → KanbanPage-BxpwweZd.js} +1 -1
- package/dist/web/assets/KanbanPage-BxpwweZd.js.br +0 -0
- package/dist/web/assets/KanbanPage-BxpwweZd.js.gz +0 -0
- package/dist/web/assets/{LabelsDialog-DgPisIev.js → LabelsDialog-CnVEGFiE.js} +1 -1
- package/dist/web/assets/LabelsDialog-CnVEGFiE.js.br +0 -0
- package/dist/web/assets/LabelsDialog-CnVEGFiE.js.gz +0 -0
- package/dist/web/assets/{MarkdownMessage-4Jj7wE3O.js → MarkdownMessage--VLk0ibg.js} +5 -5
- package/dist/web/assets/MarkdownMessage--VLk0ibg.js.br +0 -0
- package/dist/web/assets/MarkdownMessage--VLk0ibg.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-CPJuGkN0.js → PreCodeBlock-CTyy9U9T.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js → PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js.gz +0 -0
- package/dist/web/assets/{SubagentsPanel-COknYf0L.js → SubagentsPanel-DFNQpfOj.js} +1 -1
- package/dist/web/assets/SubagentsPanel-DFNQpfOj.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-DFNQpfOj.js.gz +0 -0
- package/dist/web/assets/{TerminalPanel-Dbx2lKSi.js → TerminalPanel-CQ1613aI.js} +1 -1
- package/dist/web/assets/TerminalPanel-CQ1613aI.js.br +0 -0
- package/dist/web/assets/TerminalPanel-CQ1613aI.js.gz +0 -0
- package/dist/web/assets/{Tooltip-DtQZvsaN.js → Tooltip-CN-JPsWb.js} +1 -1
- package/dist/web/assets/Tooltip-CN-JPsWb.js.br +0 -0
- package/dist/web/assets/Tooltip-CN-JPsWb.js.gz +0 -0
- package/dist/web/assets/index-DqH6slDK.js +45 -0
- package/dist/web/assets/index-DqH6slDK.js.br +0 -0
- package/dist/web/assets/index-DqH6slDK.js.gz +0 -0
- package/dist/web/assets/index-hKmVNfdU.css +1 -0
- package/dist/web/assets/index-hKmVNfdU.css.br +0 -0
- package/dist/web/assets/index-hKmVNfdU.css.gz +0 -0
- package/dist/web/assets/{index10-BTkpIIYS.js → index10-ExQJARIx.js} +1 -1
- package/dist/web/assets/index10-ExQJARIx.js.br +0 -0
- package/dist/web/assets/index10-ExQJARIx.js.gz +0 -0
- package/dist/web/assets/index3-BJdA_lu3.js +1 -0
- package/dist/web/assets/index4-BILJ5L4s.js +1 -0
- package/dist/web/assets/{index5-CkCxVfaP.js → index5-CQngjG8A.js} +1 -1
- package/dist/web/assets/index5-CQngjG8A.js.br +0 -0
- package/dist/web/assets/index5-CQngjG8A.js.gz +0 -0
- package/dist/web/assets/{index6-SCztOIu6.js → index6-BKvbo_v2.js} +1 -1
- package/dist/web/assets/index6-BKvbo_v2.js.br +0 -0
- package/dist/web/assets/index6-BKvbo_v2.js.gz +0 -0
- package/dist/web/assets/{index7-HKApXTNK.js → index7-DFuP_VHe.js} +1 -1
- package/dist/web/assets/index7-DFuP_VHe.js.br +0 -0
- package/dist/web/assets/index7-DFuP_VHe.js.gz +0 -0
- package/dist/web/assets/{index8-CCdHj2vL.js → index8-4EOYGS9L.js} +1 -1
- package/dist/web/assets/index8-4EOYGS9L.js.br +0 -0
- package/dist/web/assets/index8-4EOYGS9L.js.gz +0 -0
- package/dist/web/assets/{index9-rtEtkGH0.js → index9-BTjkNo53.js} +1 -1
- package/dist/web/assets/index9-BTjkNo53.js.br +0 -0
- package/dist/web/assets/{index9-rtEtkGH0.js.gz → index9-BTjkNo53.js.gz} +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +1 -1
- package/dist/web/assets/AddProjectDialog-Bftvd3Yz.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-Bftvd3Yz.js.gz +0 -0
- package/dist/web/assets/ArchivedWorkspaces-DAtKiAKb.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-DAtKiAKb.js.gz +0 -0
- package/dist/web/assets/ChangesPanel-LDYyiOkA.js.br +0 -0
- package/dist/web/assets/ChangesPanel-LDYyiOkA.js.gz +0 -0
- package/dist/web/assets/CodeBlockNode-Ubb_GmEN.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-Ubb_GmEN.js.gz +0 -0
- package/dist/web/assets/CommandCenter-C9e_MHP7.js.br +0 -0
- package/dist/web/assets/CommandCenter-C9e_MHP7.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-BVkg07Q4.js.br +0 -0
- package/dist/web/assets/ConversationSearch-BVkg07Q4.js.gz +0 -0
- package/dist/web/assets/FileViewer-IobGwtBO.js.br +0 -0
- package/dist/web/assets/FileViewer-IobGwtBO.js.gz +0 -0
- package/dist/web/assets/FilesPanel-DRE6I9Zu.js.br +0 -0
- package/dist/web/assets/FilesPanel-DRE6I9Zu.js.gz +0 -0
- package/dist/web/assets/HostSettings-DUReTPzX.js.br +0 -0
- package/dist/web/assets/HostSettings-DUReTPzX.js.gz +0 -0
- package/dist/web/assets/ImportSessionDialog-Bg9XZ_ab.js.br +0 -0
- package/dist/web/assets/ImportSessionDialog-Bg9XZ_ab.js.gz +0 -0
- package/dist/web/assets/KanbanPage-lKwsQfA_.js.br +0 -0
- package/dist/web/assets/KanbanPage-lKwsQfA_.js.gz +0 -0
- package/dist/web/assets/LabelsDialog-DgPisIev.js.br +0 -0
- package/dist/web/assets/LabelsDialog-DgPisIev.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-4Jj7wE3O.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-4Jj7wE3O.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-DyY0Ilsi.js.gz +0 -0
- package/dist/web/assets/SubagentsPanel-COknYf0L.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-COknYf0L.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-Dbx2lKSi.js.br +0 -0
- package/dist/web/assets/TerminalPanel-Dbx2lKSi.js.gz +0 -0
- package/dist/web/assets/Tooltip-DtQZvsaN.js.br +0 -0
- package/dist/web/assets/Tooltip-DtQZvsaN.js.gz +0 -0
- package/dist/web/assets/index--Uzu2A_h.js +0 -45
- package/dist/web/assets/index--Uzu2A_h.js.br +0 -0
- package/dist/web/assets/index--Uzu2A_h.js.gz +0 -0
- package/dist/web/assets/index-5kxjCia8.css +0 -1
- package/dist/web/assets/index-5kxjCia8.css.br +0 -0
- package/dist/web/assets/index-5kxjCia8.css.gz +0 -0
- package/dist/web/assets/index10-BTkpIIYS.js.br +0 -0
- package/dist/web/assets/index10-BTkpIIYS.js.gz +0 -0
- package/dist/web/assets/index3-BSWvERvY.js +0 -1
- package/dist/web/assets/index4-D6dsLD5o.js +0 -1
- package/dist/web/assets/index5-CkCxVfaP.js.br +0 -0
- package/dist/web/assets/index5-CkCxVfaP.js.gz +0 -0
- package/dist/web/assets/index6-SCztOIu6.js.br +0 -0
- package/dist/web/assets/index6-SCztOIu6.js.gz +0 -0
- package/dist/web/assets/index7-HKApXTNK.js.br +0 -0
- package/dist/web/assets/index7-HKApXTNK.js.gz +0 -0
- package/dist/web/assets/index8-CCdHj2vL.js.br +0 -0
- package/dist/web/assets/index8-CCdHj2vL.js.gz +0 -0
- package/dist/web/assets/index9-rtEtkGH0.js.br +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as default}from"./PreCodeBlock.vue_vue_type_style_index_0_lang-
|
|
1
|
+
export{t as default}from"./PreCodeBlock.vue_vue_type_style_index_0_lang-DK6DBQ5b.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,P as t,Q as n,T as r,U as i,Z as a,_ as o,b as s,ct as c,d as l,dt as u,f as d,g as f,h as p,it as m,j as h,k as g,l as _,n as v,q as y,st as b,ut as x,v as S,x as C,y as w,z as T}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{G as E,J as D,K as O,S as k,U as A,Y as j,ct as M,dt as N,f as P,ht as F,mt as ee,ot as I,p as L,pt as te,q as R,ut as ne,v as z,w as B}from"./MarkdownMessage-4Jj7wE3O.js";var re=Object.defineProperty,V=Object.defineProperties,H=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,K=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||={})W.call(t,n)&&K(e,n,t[n]);if(U)for(var n of U(t))G.call(t,n)&&K(e,n,t[n]);return e},J=(e,t)=>V(e,H(t)),Y=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function X(e,t){if(t===void 0)return O(e);if(t){let n=t(e);if(n!=null&&n!==``)return n}let n=A(e);return R(n)||D()}var Z={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)]`},ie={class:`flex items-center gap-0.5`},Q=[`aria-label`],$={class:`code-diff-stat removed`},ae={class:`code-diff-stat added`},oe=[`aria-label`],se={key:0,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},ce={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=[`aria-pressed`],ue={key:3,class:`relative flex`},de=[`aria-expanded`],fe=[`disabled`],pe=[`disabled`],me=[`disabled`],he={key:0,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},ge={key:1,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},_e={class:`code-loading-placeholder`},ve={class:`sr-only`,"aria-live":`polite`,role:`status`},ye=r({__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(t,{emit:r}){let o=t,s=r,h=m(!1),g=m(null),y=m(null);function E(){k(!0),h.value=!h.value,h.value&&document.addEventListener(`click`,O,{once:!0,capture:!0})}function D(){k(!0),h.value=!1}function O(e){let t=e.target;g.value?.contains(t)||y.value?.contains(t)?document.addEventListener(`click`,O,{once:!0,capture:!0}):D()}let A=p(()=>o.showFontSizeButtons&&o.enableFontSizeControl||o.showExpandButton||o.isPreviewable&&o.showPreviewButton),{t:j}=z(),M=p(()=>!1!==o.showTooltips);function N(e,t){M.value&&B(e.currentTarget,t,`top`,!1,void 0,o.isDark)}function P(){M.value&&k()}function F(e){N(e,o.copyText?j(`common.copied`)||`Copied`:j(`common.copy`)||`Copy`)}let ee=p(()=>!!Number.isFinite(o.codeFontSize)&&(o.codeFontSize??0)<=(o.codeFontMin??0)),I=p(()=>!o.fontBaselineReady||o.codeFontSize===o.defaultCodeFontSize),L=p(()=>!!Number.isFinite(o.codeFontSize)&&(o.codeFontSize??0)>=(o.codeFontMax??100));return(r,p)=>(T(),w(d,null,[o.showHeader?(T(),w(`div`,Z,[i(r.$slots,`header-left`),i(r.$slots,`header-right`,{},()=>[f(`div`,ie,[t.diffStats?(T(),w(`div`,{key:0,class:`code-diff-stats`,"aria-label":t.diffStatsAriaLabel},[f(`span`,$,`-`+u(t.diffStats.removed),1),f(`span`,ae,`+`+u(t.diffStats.added),1)],8,Q)):S(``,!0),o.showCopyButton?(T(),w(`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":t.copyText?b(j)(`common.copied`)||`Copied`:b(j)(`common.copy`)||`Copy`,onClick:p[0]||=e=>s(`copy`),onMouseenter:p[1]||=e=>F(e),onFocus:p[2]||=e=>F(e),onMouseleave:P,onBlur:P},[t.copyText?(T(),w(`svg`,ce,[...p[14]||=[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`},null,-1)]])):(T(),w(`svg`,se,[...p[13]||=[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),f(`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,oe)):S(``,!0),o.showCollapseButton?(T(),w(`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":t.isCollapsed,onClick:p[3]||=e=>s(`toggleCollapse`),onMouseenter:p[4]||=e=>N(e,t.isCollapsed?b(j)(`common.expand`)||`Expand`:b(j)(`common.collapse`)||`Collapse`),onFocus:p[5]||=e=>N(e,t.isCollapsed?b(j)(`common.expand`)||`Expand`:b(j)(`common.collapse`)||`Collapse`),onMouseleave:P,onBlur:P},[(T(),w(`svg`,{style:x({rotate:t.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`},[...p[15]||=[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`},null,-1)]],4))],40,le)):S(``,!0),A.value?(T(),w(`div`,ue,[f(`button`,{ref_key:`moreBtnRef`,ref:y,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":h.value,"aria-haspopup":`true`,onClick:l(E,[`stop`]),onMouseenter:p[6]||=e=>N(e,b(j)(`common.more`)||`More`),onFocus:p[7]||=e=>N(e,b(j)(`common.more`)||`More`),onMouseleave:P,onBlur:P},[...p[16]||=[C(`<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,de),e(v,{name:`code-menu`},{default:a(()=>[h.value?(T(),w(`div`,{key:0,ref_key:`moreMenuRef`,ref:g,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`},[o.showFontSizeButtons&&o.enableFontSizeControl?(T(),w(d,{key:0},[f(`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:ee.value,onClick:p[8]||=e=>{b(k)(!0),s(`decreaseFont`)}},[p[17]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`})],-1),f(`span`,null,u(b(j)(`common.fontSmaller`)||`Font size −`),1)],8,fe),f(`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:I.value,onClick:p[9]||=e=>{b(k)(!0),s(`resetFont`)}},[p[18]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),f(`path`,{d:`M3 3v5h5`})])],-1),f(`span`,null,u(b(j)(`common.fontReset`)||`Font size reset`),1)],8,pe),f(`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:p[10]||=e=>{b(k)(!0),s(`increaseFont`)}},[p[19]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`})],-1),f(`span`,null,u(b(j)(`common.fontLarger`)||`Font size +`),1)],8,me)],64)):S(``,!0),o.showExpandButton?(T(),w(`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:p[11]||=e=>{D(),s(`toggleExpand`)}},[t.isExpanded?(T(),w(`svg`,he,[...p[20]||=[f(`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)]])):(T(),w(`svg`,ge,[...p[21]||=[f(`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(`span`,null,u(t.isExpanded?b(j)(`common.collapse`)||`Collapse`:b(j)(`common.expand`)||`Expand`),1)])):S(``,!0),t.isPreviewable&&o.showPreviewButton?(T(),w(`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:p[12]||=e=>{D(),s(`preview`)}},[p[22]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`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`}),f(`circle`,{cx:`12`,cy:`12`,r:`3`})])],-1),f(`span`,null,u(b(j)(`common.preview`)||`Preview`),1)])):S(``,!0)],512)):S(``,!0)]),_:1})])):S(``,!0)])])])):S(``,!0),n(f(`div`,{class:c([`code-block-shell-content`,{"code-block-shell-content--collapsed":t.isCollapsed}])},[i(r.$slots,`default`)],2),[[_,!!t.stream||!t.loading]]),n(f(`div`,_e,[i(r.$slots,`loading`,{},()=>[p[23]||=f(`div`,{class:`loading-skeleton`},[f(`div`,{class:`skeleton-line`}),f(`div`,{class:`skeleton-line`}),f(`div`,{class:`skeleton-line short`})],-1)])],512),[[_,!t.stream&&t.loading]]),f(`span`,ve,u(t.copyText?b(j)(`common.copied`)||`Copied`:``),1)],64))}}),be={class:`code-header-main`},xe=[`innerHTML`],Se={class:`code-header-copy`},Ce={class:`code-header-title`},we={key:0,class:`code-header-caption`},Te=r(J(q({},{inheritAttrs:!1}),{__name:`PreCodeBlock`,props:{codeBlockOptions:{},clipboardWriter:{},darkTheme:{},isDark:{type:Boolean,default:!1},lightTheme:{},resolvedVisualOptions:{},showCopyButton:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},theme:{},themes:{},node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean,default:!0},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},emits:[`copy`],setup(n,{emit:r}){let c=n,l=r,d=y(),_=p(()=>{let e=d,{class:t,style:n}=e;return((e,t)=>{var n={};for(var r in e)W.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&U)for(var r of U(e))t.indexOf(r)<0&&G.call(e,r)&&(n[r]=e[r]);return n})(e,[`class`,`style`])}),v=m(null),C=m(!1),D,O=g(L,void 0),k=p(()=>c.showLineNumbers??!0!==c.codeBlockOptions?.disableLineNumbers),R=p(()=>I(c.node)),z=p(()=>!0===c.diffInline||R.value&&ne(c.codeBlockOptions??{})),B=p(()=>A(String(c.node?.language??``))),re=p(()=>{let e=B.value;return e?j[e]||e.charAt(0).toUpperCase()+e.slice(1):j[``]||`Plain Text`}),V=p(()=>M(String(c.node?.raw??``),re.value,I(c.node))),H=p(()=>(E.value,X(B.value,O))),K=p(()=>c.resolvedVisualOptions??F(c.codeBlockOptions)),Z=p(()=>te({darkTheme:c.darkTheme,isDark:c.isDark,lightTheme:c.lightTheme,theme:c.theme,themes:c.themes})),ie=p(()=>J(q({"--markstream-code-fallback-bg":Z.value.background,"--markstream-code-fallback-fg":Z.value.foreground},Z.value.builtin?{"--markstream-code-theme-bg":Z.value.background,"--markstream-code-theme-fg":Z.value.foreground,"--markstream-code-theme-line-number":Z.value.lineNumber}:{}),{"--markstream-diff-added-line-fill":Z.value.diffAddedLine,"--markstream-diff-added-number-fill":Z.value.diffAddedNumber,"--markstream-diff-editor-bg":Z.value.background,"--markstream-diff-removed-line-fill":Z.value.diffRemovedLine,"--markstream-diff-removed-number-fill":Z.value.diffRemovedNumber,"--markstream-diff-shell-bg":Z.value.background,"--markstream-pre-resolved-theme-bg":Z.value.background,"--markstream-pre-resolved-theme-fg":Z.value.foreground,"--markstream-pre-resolved-theme-line-number":Z.value.lineNumber,backgroundColor:Z.value.background,color:Z.value.foreground})),Q=p(()=>[`code-pre-fallback`,d.class,{"is-wrap":K.value.overflow===`wrap`}]),$=p(()=>{let e=K.value,t=R.value&&typeof c.reservedHeightPx==`number`&&Number.isFinite(c.reservedHeightPx)&&c.reservedHeightPx>0?`${Math.ceil(c.reservedHeightPx)}px`:void 0;return q(J(q(q({},N(e,{padding:c.codeBlockOptions?.padding,showLineNumbers:k.value,diff:R.value})),ee(Z.value)),{"--markstream-diff-fallback-handoff-height":t??`auto`}),t?{height:t,minHeight:t,maxHeight:t}:{})});function ae(){return Y(this,null,function*(){let e=String((n=(t=c.node)?.code)??``);var t,n;try{yield function(e){return Y(this,null,function*(){if(c.clipboardWriter)return void(yield c.clipboardWriter(e));if(typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return void(yield navigator.clipboard.writeText(e));if(typeof document>`u`||!document.body)throw Error(`Clipboard API is unavailable`);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{if(!document.execCommand(`copy`))throw Error(`Clipboard copy command failed`)}finally{t.remove()}})}(e),C.value=!0,l(`copy`,e),D&&clearTimeout(D),D=setTimeout(()=>{C.value=!1,D=void 0},1e3)}catch(e){C.value=!1,console.error(`[markstream-vue] Failed to copy preformatted code.`,e)}})}return t(()=>{D&&clearTimeout(D)}),(t,n)=>c.showToolbar?(T(),w(`div`,{key:0,style:x(ie.value),class:`code-block-container rounded-lg border`},[e(ye,{"show-header":c.showHeader,"show-copy-button":c.showCopyButton,"show-collapse-button":!1,"show-font-size-buttons":!1,"show-expand-button":!1,"show-preview-button":!1,"show-tooltips":c.showTooltips,"copy-text":C.value,stream:``,onCopy:ae},s({"header-left":a(()=>[i(t.$slots,`header-left`,{},()=>[f(`div`,be,[f(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,innerHTML:H.value},null,8,xe),f(`div`,Se,[f(`div`,Ce,u(V.value.title),1),V.value.caption?(T(),w(`div`,we,u(V.value.caption),1)):S(``,!0)])])])]),default:a(()=>[e(P,h({ref_key:`preNodeRef`,ref:v},_.value,{class:Q.value,style:[b(d).style,$.value],node:c.node,loading:c.loading,"show-line-numbers":k.value,"diff-inline":z.value,"diff-hide-unchanged-regions":c.diffHideUnchangedRegions,"reserved-height-px":c.reservedHeightPx,"data-markstream-code-theme":Z.value.name}),null,16,[`class`,`style`,`node`,`loading`,`show-line-numbers`,`diff-inline`,`diff-hide-unchanged-regions`,`reserved-height-px`,`data-markstream-code-theme`])]),_:2},[t.$slots[`header-right`]?{name:`header-right`,fn:a(()=>[i(t.$slots,`header-right`)]),key:`0`}:void 0]),1032,[`show-header`,`show-copy-button`,`show-tooltips`,`copy-text`])],4)):(T(),o(P,h({key:1,ref_key:`preNodeRef`,ref:v},_.value,{class:Q.value,style:[b(d).style,$.value],node:c.node,loading:c.loading,"show-line-numbers":k.value,"diff-inline":z.value,"diff-hide-unchanged-regions":c.diffHideUnchangedRegions,"reserved-height-px":c.reservedHeightPx,"data-markstream-code-theme":Z.value.name}),null,16,[`class`,`style`,`node`,`loading`,`show-line-numbers`,`diff-inline`,`diff-hide-unchanged-regions`,`reserved-height-px`,`data-markstream-code-theme`]))}}));export{ye as n,X as r,Te as t};
|
|
1
|
+
import{C as e,P as t,Q as n,T as r,U as i,Z as a,_ as o,b as s,ct as c,d as l,dt as u,f as d,g as f,h as p,it as m,j as h,k as g,l as _,n as v,q as y,st as b,ut as x,v as S,x as C,y as w,z as T}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{G as E,J as D,K as O,S as k,U as A,Y as j,ct as M,dt as N,f as P,ht as F,mt as ee,ot as I,p as L,pt as te,q as R,ut as ne,v as z,w as B}from"./MarkdownMessage--VLk0ibg.js";var re=Object.defineProperty,V=Object.defineProperties,H=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,K=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||={})W.call(t,n)&&K(e,n,t[n]);if(U)for(var n of U(t))G.call(t,n)&&K(e,n,t[n]);return e},J=(e,t)=>V(e,H(t)),Y=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function X(e,t){if(t===void 0)return O(e);if(t){let n=t(e);if(n!=null&&n!==``)return n}let n=A(e);return R(n)||D()}var Z={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)]`},ie={class:`flex items-center gap-0.5`},Q=[`aria-label`],$={class:`code-diff-stat removed`},ae={class:`code-diff-stat added`},oe=[`aria-label`],se={key:0,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},ce={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=[`aria-pressed`],ue={key:3,class:`relative flex`},de=[`aria-expanded`],fe=[`disabled`],pe=[`disabled`],me=[`disabled`],he={key:0,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},ge={key:1,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},_e={class:`code-loading-placeholder`},ve={class:`sr-only`,"aria-live":`polite`,role:`status`},ye=r({__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(t,{emit:r}){let o=t,s=r,h=m(!1),g=m(null),y=m(null);function E(){k(!0),h.value=!h.value,h.value&&document.addEventListener(`click`,O,{once:!0,capture:!0})}function D(){k(!0),h.value=!1}function O(e){let t=e.target;g.value?.contains(t)||y.value?.contains(t)?document.addEventListener(`click`,O,{once:!0,capture:!0}):D()}let A=p(()=>o.showFontSizeButtons&&o.enableFontSizeControl||o.showExpandButton||o.isPreviewable&&o.showPreviewButton),{t:j}=z(),M=p(()=>!1!==o.showTooltips);function N(e,t){M.value&&B(e.currentTarget,t,`top`,!1,void 0,o.isDark)}function P(){M.value&&k()}function F(e){N(e,o.copyText?j(`common.copied`)||`Copied`:j(`common.copy`)||`Copy`)}let ee=p(()=>!!Number.isFinite(o.codeFontSize)&&(o.codeFontSize??0)<=(o.codeFontMin??0)),I=p(()=>!o.fontBaselineReady||o.codeFontSize===o.defaultCodeFontSize),L=p(()=>!!Number.isFinite(o.codeFontSize)&&(o.codeFontSize??0)>=(o.codeFontMax??100));return(r,p)=>(T(),w(d,null,[o.showHeader?(T(),w(`div`,Z,[i(r.$slots,`header-left`),i(r.$slots,`header-right`,{},()=>[f(`div`,ie,[t.diffStats?(T(),w(`div`,{key:0,class:`code-diff-stats`,"aria-label":t.diffStatsAriaLabel},[f(`span`,$,`-`+u(t.diffStats.removed),1),f(`span`,ae,`+`+u(t.diffStats.added),1)],8,Q)):S(``,!0),o.showCopyButton?(T(),w(`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":t.copyText?b(j)(`common.copied`)||`Copied`:b(j)(`common.copy`)||`Copy`,onClick:p[0]||=e=>s(`copy`),onMouseenter:p[1]||=e=>F(e),onFocus:p[2]||=e=>F(e),onMouseleave:P,onBlur:P},[t.copyText?(T(),w(`svg`,ce,[...p[14]||=[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`},null,-1)]])):(T(),w(`svg`,se,[...p[13]||=[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),f(`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,oe)):S(``,!0),o.showCollapseButton?(T(),w(`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":t.isCollapsed,onClick:p[3]||=e=>s(`toggleCollapse`),onMouseenter:p[4]||=e=>N(e,t.isCollapsed?b(j)(`common.expand`)||`Expand`:b(j)(`common.collapse`)||`Collapse`),onFocus:p[5]||=e=>N(e,t.isCollapsed?b(j)(`common.expand`)||`Expand`:b(j)(`common.collapse`)||`Collapse`),onMouseleave:P,onBlur:P},[(T(),w(`svg`,{style:x({rotate:t.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`},[...p[15]||=[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`},null,-1)]],4))],40,le)):S(``,!0),A.value?(T(),w(`div`,ue,[f(`button`,{ref_key:`moreBtnRef`,ref:y,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":h.value,"aria-haspopup":`true`,onClick:l(E,[`stop`]),onMouseenter:p[6]||=e=>N(e,b(j)(`common.more`)||`More`),onFocus:p[7]||=e=>N(e,b(j)(`common.more`)||`More`),onMouseleave:P,onBlur:P},[...p[16]||=[C(`<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,de),e(v,{name:`code-menu`},{default:a(()=>[h.value?(T(),w(`div`,{key:0,ref_key:`moreMenuRef`,ref:g,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`},[o.showFontSizeButtons&&o.enableFontSizeControl?(T(),w(d,{key:0},[f(`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:ee.value,onClick:p[8]||=e=>{b(k)(!0),s(`decreaseFont`)}},[p[17]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`})],-1),f(`span`,null,u(b(j)(`common.fontSmaller`)||`Font size −`),1)],8,fe),f(`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:I.value,onClick:p[9]||=e=>{b(k)(!0),s(`resetFont`)}},[p[18]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),f(`path`,{d:`M3 3v5h5`})])],-1),f(`span`,null,u(b(j)(`common.fontReset`)||`Font size reset`),1)],8,pe),f(`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:p[10]||=e=>{b(k)(!0),s(`increaseFont`)}},[p[19]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`})],-1),f(`span`,null,u(b(j)(`common.fontLarger`)||`Font size +`),1)],8,me)],64)):S(``,!0),o.showExpandButton?(T(),w(`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:p[11]||=e=>{D(),s(`toggleExpand`)}},[t.isExpanded?(T(),w(`svg`,he,[...p[20]||=[f(`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)]])):(T(),w(`svg`,ge,[...p[21]||=[f(`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(`span`,null,u(t.isExpanded?b(j)(`common.collapse`)||`Collapse`:b(j)(`common.expand`)||`Expand`),1)])):S(``,!0),t.isPreviewable&&o.showPreviewButton?(T(),w(`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:p[12]||=e=>{D(),s(`preview`)}},[p[22]||=f(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`action-icon`},[f(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[f(`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`}),f(`circle`,{cx:`12`,cy:`12`,r:`3`})])],-1),f(`span`,null,u(b(j)(`common.preview`)||`Preview`),1)])):S(``,!0)],512)):S(``,!0)]),_:1})])):S(``,!0)])])])):S(``,!0),n(f(`div`,{class:c([`code-block-shell-content`,{"code-block-shell-content--collapsed":t.isCollapsed}])},[i(r.$slots,`default`)],2),[[_,!!t.stream||!t.loading]]),n(f(`div`,_e,[i(r.$slots,`loading`,{},()=>[p[23]||=f(`div`,{class:`loading-skeleton`},[f(`div`,{class:`skeleton-line`}),f(`div`,{class:`skeleton-line`}),f(`div`,{class:`skeleton-line short`})],-1)])],512),[[_,!t.stream&&t.loading]]),f(`span`,ve,u(t.copyText?b(j)(`common.copied`)||`Copied`:``),1)],64))}}),be={class:`code-header-main`},xe=[`innerHTML`],Se={class:`code-header-copy`},Ce={class:`code-header-title`},we={key:0,class:`code-header-caption`},Te=r(J(q({},{inheritAttrs:!1}),{__name:`PreCodeBlock`,props:{codeBlockOptions:{},clipboardWriter:{},darkTheme:{},isDark:{type:Boolean,default:!1},lightTheme:{},resolvedVisualOptions:{},showCopyButton:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},theme:{},themes:{},node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean,default:!0},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},emits:[`copy`],setup(n,{emit:r}){let c=n,l=r,d=y(),_=p(()=>{let e=d,{class:t,style:n}=e;return((e,t)=>{var n={};for(var r in e)W.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&U)for(var r of U(e))t.indexOf(r)<0&&G.call(e,r)&&(n[r]=e[r]);return n})(e,[`class`,`style`])}),v=m(null),C=m(!1),D,O=g(L,void 0),k=p(()=>c.showLineNumbers??!0!==c.codeBlockOptions?.disableLineNumbers),R=p(()=>I(c.node)),z=p(()=>!0===c.diffInline||R.value&&ne(c.codeBlockOptions??{})),B=p(()=>A(String(c.node?.language??``))),re=p(()=>{let e=B.value;return e?j[e]||e.charAt(0).toUpperCase()+e.slice(1):j[``]||`Plain Text`}),V=p(()=>M(String(c.node?.raw??``),re.value,I(c.node))),H=p(()=>(E.value,X(B.value,O))),K=p(()=>c.resolvedVisualOptions??F(c.codeBlockOptions)),Z=p(()=>te({darkTheme:c.darkTheme,isDark:c.isDark,lightTheme:c.lightTheme,theme:c.theme,themes:c.themes})),ie=p(()=>J(q({"--markstream-code-fallback-bg":Z.value.background,"--markstream-code-fallback-fg":Z.value.foreground},Z.value.builtin?{"--markstream-code-theme-bg":Z.value.background,"--markstream-code-theme-fg":Z.value.foreground,"--markstream-code-theme-line-number":Z.value.lineNumber}:{}),{"--markstream-diff-added-line-fill":Z.value.diffAddedLine,"--markstream-diff-added-number-fill":Z.value.diffAddedNumber,"--markstream-diff-editor-bg":Z.value.background,"--markstream-diff-removed-line-fill":Z.value.diffRemovedLine,"--markstream-diff-removed-number-fill":Z.value.diffRemovedNumber,"--markstream-diff-shell-bg":Z.value.background,"--markstream-pre-resolved-theme-bg":Z.value.background,"--markstream-pre-resolved-theme-fg":Z.value.foreground,"--markstream-pre-resolved-theme-line-number":Z.value.lineNumber,backgroundColor:Z.value.background,color:Z.value.foreground})),Q=p(()=>[`code-pre-fallback`,d.class,{"is-wrap":K.value.overflow===`wrap`}]),$=p(()=>{let e=K.value,t=R.value&&typeof c.reservedHeightPx==`number`&&Number.isFinite(c.reservedHeightPx)&&c.reservedHeightPx>0?`${Math.ceil(c.reservedHeightPx)}px`:void 0;return q(J(q(q({},N(e,{padding:c.codeBlockOptions?.padding,showLineNumbers:k.value,diff:R.value})),ee(Z.value)),{"--markstream-diff-fallback-handoff-height":t??`auto`}),t?{height:t,minHeight:t,maxHeight:t}:{})});function ae(){return Y(this,null,function*(){let e=String((n=(t=c.node)?.code)??``);var t,n;try{yield function(e){return Y(this,null,function*(){if(c.clipboardWriter)return void(yield c.clipboardWriter(e));if(typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return void(yield navigator.clipboard.writeText(e));if(typeof document>`u`||!document.body)throw Error(`Clipboard API is unavailable`);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{if(!document.execCommand(`copy`))throw Error(`Clipboard copy command failed`)}finally{t.remove()}})}(e),C.value=!0,l(`copy`,e),D&&clearTimeout(D),D=setTimeout(()=>{C.value=!1,D=void 0},1e3)}catch(e){C.value=!1,console.error(`[markstream-vue] Failed to copy preformatted code.`,e)}})}return t(()=>{D&&clearTimeout(D)}),(t,n)=>c.showToolbar?(T(),w(`div`,{key:0,style:x(ie.value),class:`code-block-container rounded-lg border`},[e(ye,{"show-header":c.showHeader,"show-copy-button":c.showCopyButton,"show-collapse-button":!1,"show-font-size-buttons":!1,"show-expand-button":!1,"show-preview-button":!1,"show-tooltips":c.showTooltips,"copy-text":C.value,stream:``,onCopy:ae},s({"header-left":a(()=>[i(t.$slots,`header-left`,{},()=>[f(`div`,be,[f(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,innerHTML:H.value},null,8,xe),f(`div`,Se,[f(`div`,Ce,u(V.value.title),1),V.value.caption?(T(),w(`div`,we,u(V.value.caption),1)):S(``,!0)])])])]),default:a(()=>[e(P,h({ref_key:`preNodeRef`,ref:v},_.value,{class:Q.value,style:[b(d).style,$.value],node:c.node,loading:c.loading,"show-line-numbers":k.value,"diff-inline":z.value,"diff-hide-unchanged-regions":c.diffHideUnchangedRegions,"reserved-height-px":c.reservedHeightPx,"data-markstream-code-theme":Z.value.name}),null,16,[`class`,`style`,`node`,`loading`,`show-line-numbers`,`diff-inline`,`diff-hide-unchanged-regions`,`reserved-height-px`,`data-markstream-code-theme`])]),_:2},[t.$slots[`header-right`]?{name:`header-right`,fn:a(()=>[i(t.$slots,`header-right`)]),key:`0`}:void 0]),1032,[`show-header`,`show-copy-button`,`show-tooltips`,`copy-text`])],4)):(T(),o(P,h({key:1,ref_key:`preNodeRef`,ref:v},_.value,{class:Q.value,style:[b(d).style,$.value],node:c.node,loading:c.loading,"show-line-numbers":k.value,"diff-inline":z.value,"diff-hide-unchanged-regions":c.diffHideUnchangedRegions,"reserved-height-px":c.reservedHeightPx,"data-markstream-code-theme":Z.value.name}),null,16,[`class`,`style`,`node`,`loading`,`show-line-numbers`,`diff-inline`,`diff-hide-unchanged-regions`,`reserved-height-px`,`data-markstream-code-theme`]))}}));export{ye as n,X as r,Te as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,C as t,H as n,L as r,M as i,S as a,T as o,Y as s,_ as c,at as l,ct as u,dt as d,f,g as p,h as m,it as h,k as g,v as _,y as v,z as y}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as b,b as x,c as S,n as C,s as w,u as T,w as E}from"./index
|
|
1
|
+
import{B as e,C as t,H as n,L as r,M as i,S as a,T as o,Y as s,_ as c,at as l,ct as u,dt as d,f,g as p,h as m,it as h,k as g,v as _,y as v,z as y}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as b,b as x,c as S,n as C,s as w,u as T,w as E}from"./index-DqH6slDK.js";var D={class:`timeline-inner`},O={key:0,class:`older`},k={key:0,class:`older-loading`,role:`status`},A={key:1,class:`notice`},j={key:2,class:`older`},M={key:3,class:`timeline-working`,role:`status`},N={key:4,class:`timeline-empty`},P={key:0,class:`spinner`},F=b(o({__name:`SubagentConversation`,props:{base:{},api:{type:Function},running:{type:Boolean}},setup(t){let o=t,u=g(T,null),b=l({base:``,cwd:``});s(()=>u?.value,e=>{b.value={...e??{base:``,cwd:``},rewindModes:[],rewind:void 0,subagents:void 0,openSubagent:void 0}},{immediate:!0}),e(T,b);let x=l(new S),F=h(0),I=l(null),L=h(!1),R=h(!1),z=h(``),B=h(null),V=m(()=>(F.value,I.value?I.value:(x.value.membership.value,x.value.rows.slice(-150)))),H=m(()=>(F.value,I.value?L.value:(x.value.membership.value,x.value.rows.length>150||x.value.hasOlder))),U=m(()=>(F.value,x.value.membership.value,x.value.rows.at(-1)?.seqStart??-1)),W=()=>{let e=B.value;return!e||e.scrollHeight-e.scrollTop-e.clientHeight<120},G=()=>void i(()=>{let e=B.value;e&&(e.scrollTop=e.scrollHeight)}),K=0,q=E({url:()=>{let e=x.value.resumePoint(),t=e?`?epoch=${encodeURIComponent(e.epoch)}${e.view?`&view=${encodeURIComponent(e.view)}`:``}&seq=${e.seq}&from=${e.from}`:``;return`/api`+o.base+`/timeline/stream`+t},onMessage:e=>{let t=e;if(t.type!==`ops`||!Array.isArray(t.ops))return;let n=x.value,r=!I.value&&(W()||!n.ready),i=t.ops.find(e=>e.type===`error`);z.value=i?.type===`error`?i.message:``;let a=n.epoch,o=n.membership.value,s=n.ready;n.apply(t.ops),a&&a!==n.epoch&&(K++,R.value=!1,I.value=null),(o!==n.membership.value||s!==n.ready||a!==n.epoch)&&F.value++,r&&G()}});r(()=>{K++,q.close()});function J(){K++,R.value=!1,I.value=null,L.value=!1,G()}async function Y(){let e=x.value,t=V.value.slice(),n=t[0];if(!n||R.value)return;let r=++K;R.value=!0,z.value=``;try{let a=JSON.stringify({epoch:e.epoch,seq:n.seqStart}),s=await o.api(o.base+`/timeline?cursor=`+encodeURIComponent(a));if(r!==K||x.value!==e||s.epoch!==e.epoch)return;let c=B.value,u=c?c.scrollHeight-c.scrollTop:0,d=t.map(e=>({seqStart:e.seqStart,row:l(e.row.value)})),f=w(d,s,`before`);I.value=f.rows,L.value=f.hasOlder,await i(),c&&(c.scrollTop=Math.max(0,c.scrollHeight-u))}catch(e){r===K&&(z.value=e.message||`Could not load earlier messages.`)}finally{r===K&&(R.value=!1)}}return(e,r)=>(y(),v(`div`,{ref_key:`element`,ref:B,class:`timeline subagent-timeline`},[p(`div`,D,[H.value?(y(),v(`div`,O,[R.value?(y(),v(`span`,k,[...r[0]||=[p(`span`,{class:`spinner`},null,-1),a(`Loading earlier messages…`,-1)]])):(y(),v(`button`,{key:1,class:`btn btn-ghost`,onClick:Y},`Show earlier messages`))])):_(``,!0),z.value?(y(),v(`p`,A,d(z.value),1)):_(``,!0),(y(!0),v(f,null,n(V.value,e=>(y(),c(C,{key:x.value.epoch+`:`+e.seqStart,entry:e.row,final:e.seqStart!==U.value||!t.running},null,8,[`entry`,`final`]))),128)),I.value?(y(),v(`div`,j,[p(`button`,{class:`btn btn-ghost`,onClick:J},`Back to latest`)])):_(``,!0),t.running&&x.value.ready&&!I.value?(y(),v(`div`,M,[...r[1]||=[p(`span`,{class:`spinner`},null,-1),p(`span`,null,`Working…`,-1)]])):_(``,!0),V.value.length?_(``,!0):(y(),v(`div`,N,[x.value.ready?_(``,!0):(y(),v(`span`,P)),a(` `+d(x.value.ready?`No messages yet.`:`Loading conversation…`),1)]))])],512))}}),[[`__scopeId`,`data-v-1337031c`]]),I={class:`subagents-panel`},L={class:`subagent-head`},R=[`title`],z=[`title`],B={key:1,class:`subagent-meta`},V={key:1,class:`subagent-list`},H={key:0,class:`subagent-empty`},U=[`onClick`],W={class:`subagent-text`},G={class:`subagent-name`},K={class:`subagent-sub`},q=[`onClick`],J={class:`subagent-text`},Y={class:`subagent-name`},X={class:`subagent-sub`},Z=b(o({__name:`SubagentsPanel`,props:{agents:{},subagents:{},base:{},api:{type:Function},opened:{}},emits:[`update:opened`,`select`],setup(e,{emit:r}){let i=e,o=r,l=m(()=>i.opened?i.subagents.find(e=>e.id===i.opened)??null:null),h=!1;s([()=>i.opened,l],([e,t],[n])=>{e===n?t?h=!0:e&&h&&(h=!1,o(`update:opened`,null)):h=!!t},{immediate:!0});let g=e=>e.attention?`attention`:e.state===`failed`?`error`:e.state===`running`?`running`:e.unread?`unread`:`idle`,b=e=>e.attention?`Needs input`:e.state===`failed`?`Failed`:e.state===`running`?`Working`:e.unread?`Ready to review`:`Idle`,S=e=>e.status===`running`?`running`:e.status===`failed`?`error`:`idle`,C=e=>e.status===`running`?`Working`:e.status===`failed`?`Failed`:e.status===`canceled`?`Canceled`:`Done`,w=e=>e.description?.trim()||e.title?.trim()||`Subagent`,T=e=>{let t=e.description?.trim();return e.subtitle?.trim()||(t?e.title?.trim():``)||``};return(r,i)=>(y(),v(`section`,I,[e.opened?(y(),v(f,{key:0},[p(`header`,L,[p(`button`,{class:`icon-btn`,"aria-label":`All subagents`,title:`All subagents`,onClick:i[0]||=e=>o(`update:opened`,null)},[t(x,{name:`back`,size:16})]),l.value?(y(),v(`span`,{key:0,class:u([`status-dot`,`is-`+S(l.value)]),title:C(l.value)},null,10,R)):_(``,!0),p(`span`,{class:`subagent-title`,title:l.value?w(l.value):``},d(l.value?w(l.value):`Subagent`),9,z),l.value?(y(),v(`span`,B,d(C(l.value)),1)):_(``,!0)]),(y(),c(F,{key:e.base+`:`+e.opened,base:e.base+`/subagents/`+encodeURIComponent(e.opened),api:e.api,running:l.value?.status===`running`},null,8,[`base`,`api`,`running`]))],64)):(y(),v(`div`,V,[!e.agents.length&&!e.subagents.length?(y(),v(`p`,H,`No subagents yet.`)):_(``,!0),e.agents.length?(y(),v(f,{key:1},[i[1]||=p(`h3`,null,`Delegated agents`,-1),(y(!0),v(f,null,n(e.agents,e=>(y(),v(`button`,{key:e.key,class:`subagent-row`,onClick:t=>o(`select`,e.key)},[p(`span`,{class:u([`status-dot`,`is-`+g(e)])},null,2),p(`span`,W,[p(`span`,G,d(e.title||`Untitled session`),1),p(`span`,K,d(b(e))+` · `+d(e.provider),1)]),t(x,{name:`chevron`,size:12,class:`subagent-go`})],8,U))),128))],64)):_(``,!0),e.subagents.length?(y(),v(f,{key:2},[i[2]||=p(`h3`,null,`Provider subagents`,-1),(y(!0),v(f,null,n(e.subagents,e=>(y(),v(`button`,{key:e.id,class:u([`subagent-row`,{nested:!!e.parentSubagentId}]),onClick:t=>o(`update:opened`,e.id)},[p(`span`,{class:u([`status-dot`,`is-`+S(e)])},null,2),p(`span`,J,[p(`span`,Y,d(w(e)),1),p(`span`,X,[a(d(C(e)),1),T(e)?(y(),v(f,{key:0},[a(` · `+d(T(e)),1)],64)):_(``,!0)])]),t(x,{name:`chevron`,size:12,class:`subagent-go`})],10,q))),128))],64)):_(``,!0)]))]))}}),[[`__scopeId`,`data-v-88898efc`]]);export{Z as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as e,H as t,I as n,L as r,M as i,Q as a,S as o,T as s,Y as c,at as l,ct as u,dt as d,f,g as p,i as ee,it as m,s as h,st as te,v as g,y as _,z as v}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as y,a as b,b as x,l as S,w as C}from"./index
|
|
1
|
+
import{C as e,H as t,I as n,L as r,M as i,Q as a,S as o,T as s,Y as c,at as l,ct as u,dt as d,f,g as p,i as ee,it as m,s as h,st as te,v as g,y as _,z as v}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as y,a as b,b as x,l as S,w as C}from"./index-DqH6slDK.js";var ne={class:`terminals`},re={class:`term-tabs`},w=[`title`,`aria-current`,`onClick`],T=[`aria-label`,`onClick`],ie=[`value`],ae=[`disabled`],oe={key:0,class:`term-error`},E={class:`term-body`},se={key:0,class:`term-empty`},ce=[`disabled`],D=y(s({__name:`TerminalPanel`,props:{hostId:{},cwd:{},visible:{type:Boolean},api:{type:Function}},setup(s){ee(e=>({v5c5e7b0a:te(S)?`#141517`:`#fbfbfc`}));let y=s,D=m([]),O=m([]),k=m(``),A=m(null),j=m(``),M=m(!1),N=m(null),P=()=>`/hosts/${encodeURIComponent(y.hostId)}/terminals`,F=l(null),I=null,L=null,R,z=``,B=!1,V=null,H={dark:{background:`#141517`,foreground:`#e4e4e7`,cursor:`#e4e4e7`,selectionBackground:`#3a3b42`},light:{background:`#fbfbfc`,foreground:`#18181b`,cursor:`#18181b`,selectionBackground:`#d6d6dc`}};async function U(){if(!(F.value||!N.value||B))return V||(V=W().finally(()=>{V=null}),V)}async function W(){let[{Terminal:e},{FitAddon:t},{Unicode11Addon:n},{WebglAddon:r}]=await Promise.all([b(()=>import(`./xterm-BMsy1fDS.js`),[]),b(()=>import(`./addon-fit-DIOBYJe3.js`),[]),b(()=>import(`./addon-unicode11-C82cyeHQ.js`),[]),b(()=>import(`./addon-webgl-C3a5wC6k.js`),[])]);if(await document.fonts.ready,B||!N.value)return;let i=new e({fontFamily:getComputedStyle(document.documentElement).getPropertyValue(`--mono`)||`monospace`,fontSize:14,lineHeight:1.2,scrollback:5e3,cursorBlink:!1,allowProposedApi:!0,theme:S.value?H.dark:H.light});I=new t,i.loadAddon(I),i.loadAddon(new n),i.unicode.activeVersion=`11`,i.open(N.value);let a=new r;try{i.loadAddon(a),a.onContextLoss(()=>a.dispose())}catch{a.dispose()}i.onData(le),F.value=i,R=new ResizeObserver(()=>q()),R.observe(N.value),q()}c(()=>y.visible,async e=>{e?(await i(),!B&&y.visible&&(A.value&&!L?J(A.value):(q(),F.value?.focus()))):(L?.close(),L=null)}),c(S,e=>F.value&&(F.value.options.theme=e?H.dark:H.light));let G=[],K=!1;function le(e){if(!A.value)return;let t=`${P()}/${A.value}/input`,n=G[G.length-1];n?.url===t?n.data+=e:G.push({url:t,data:e}),ue()}async function ue(){if(!K){for(K=!0;G.length;){let e=G[0],t=e.data.slice(0,32768);e.data=e.data.slice(t.length),e.data||G.shift();try{await y.api(e.url,`POST`,{data:t})}catch(t){j.value=t.message,G=G.filter(t=>t.url!==e.url)}}K=!1}}function q(){if(!F.value||!I||!N.value?.clientWidth)return;I.fit();let e=`${F.value.rows}x${F.value.cols}`;e!==z&&A.value&&(z=e,y.api(`${P()}/${A.value}/input`,`POST`,{rows:F.value.rows,cols:F.value.cols}).catch(()=>{}))}function J(e){if(L?.close(),L=null,B)return;let t=A.value!==e;A.value=e,z=``,t&&F.value?.reset(),y.visible&&(L=C({url:()=>`/api${P()}/${e}/stream?rows=${F.value?.rows??24}&cols=${F.value?.cols??80}`,onMessage:e=>{let t=e;if(t.t===`reset`)F.value?.reset();else if(t.t===`o`&&t.d){let e;try{e=Uint8Array.from(atob(t.d),e=>e.charCodeAt(0))}catch{return}F.value?.write(e)}else t.t===`exit`&&(F.value?.write(`\r
|
|
2
2
|
\x1B[2m[process exited]\x1B[0m\r
|
|
3
3
|
`),X())}}),q(),F.value?.focus())}let Y=()=>`${P()}?cwd=${encodeURIComponent(y.cwd)}`;async function X(){let e=Y();try{let t=await y.api(e);if(B||e!==Y())return;D.value=t,j.value=``}catch(t){!B&&e===Y()&&(j.value=t.message)}}async function Z(){M.value=!0;try{if(await U(),B)return;let e=Y(),t=await y.api(P(),`POST`,{cwd:y.cwd,...k.value?{profileId:k.value}:{},rows:F.value?.rows??24,cols:F.value?.cols??80});if(B||e!==Y())return;D.value=[...D.value,t],J(t.id)}catch(e){B||(j.value=e.message)}finally{B||(M.value=!1)}}async function de(e){let t=Y();try{await y.api(`${P()}/${e}`,`DELETE`)}catch{}B||t!==Y()||(D.value=D.value.filter(t=>t.id!==e),A.value===e&&(L?.close(),L=null,A.value=null,F.value?.reset(),D.value[0]&&J(D.value[0].id)))}let Q=0;async function $(){let e=++Q;O.value=[],k.value=``,D.value=[];let t=y.hostId;y.api(`/hosts/${encodeURIComponent(t)}/settings`).then(e=>{t===y.hostId&&(O.value=e.config.terminalProfiles??[])}).catch(()=>{}),L?.close(),L=null,A.value=null,await X(),e===Q&&(await i(),await U(),B||e!==Q||D.value[0]&&J(D.value[0].id))}return n(()=>{$().catch(e=>{j.value=e.message})}),c(()=>[y.hostId,y.cwd],$),r(()=>{B=!0,L?.close(),R?.disconnect(),F.value?.dispose()}),(n,r)=>(v(),_(`div`,ne,[p(`div`,re,[(v(!0),_(f,null,t(D.value,(t,n)=>(v(),_(`div`,{key:t.id,class:u([`term-tab`,{chosen:t.id===A.value}])},[p(`button`,{type:`button`,class:`term-open`,title:t.title||t.name,"aria-current":t.id===A.value?`true`:void 0,onClick:e=>J(t.id)},[e(x,{name:`terminal`,size:12}),p(`span`,null,d(t.title||t.name||`Terminal ${n+1}`),1)],8,w),p(`button`,{type:`button`,class:`term-close`,"aria-label":`Close `+(t.title||t.name||`Terminal ${n+1}`),onClick:e=>de(t.id)},[e(x,{name:`close`,size:11})],8,T)],2))),128)),O.value.length?a((v(),_(`select`,{key:0,"onUpdate:modelValue":r[0]||=e=>k.value=e,"aria-label":`New terminal profile`,style:{"max-width":`150px`}},[r[1]||=p(`option`,{value:``},`Default shell`,-1),(v(!0),_(f,null,t(O.value,e=>(v(),_(`option`,{key:e.id,value:e.id},d(e.name),9,ie))),128))],512)),[[h,k.value]]):g(``,!0),p(`button`,{class:`icon-btn term-new`,title:`New terminal`,"aria-label":`New terminal`,disabled:M.value,onClick:Z},[e(x,{name:`plus`,size:14})],8,ae)]),j.value?(v(),_(`p`,oe,[e(x,{name:`alert`,size:13}),o(d(j.value),1)])):g(``,!0),p(`div`,E,[p(`div`,{ref_key:`host`,ref:N,class:u([`term-host`,{hidden:!A.value}])},null,2),A.value?g(``,!0):(v(),_(`div`,se,[r[3]||=p(`p`,null,`No terminal open in this workspace.`,-1),p(`button`,{class:`btn btn-outline`,disabled:M.value,onClick:Z},[e(x,{name:`terminal`,size:14}),r[2]||=o(`Open terminal`,-1)],8,ce)]))])]))}}),[[`__scopeId`,`data-v-9aaf0957`]]);export{D as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,M as t,P as n,Q as r,S as i,T as a,Y as o,Z as s,_ as c,ct as l,dt as u,g as d,it as f,l as p,m,n as h,ut as g,z as _}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as v}from"./MarkdownMessage
|
|
1
|
+
import{C as e,M as t,P as n,Q as r,S as i,T as a,Y as o,Z as s,_ as c,ct as l,dt as u,g as d,it as f,l as p,m,n as h,ut as g,z as _}from"./vue.runtime.esm-bundler-Dph2MMo9.js";import{_ as v}from"./MarkdownMessage--VLk0ibg.js";import{a as y}from"./index-DqH6slDK.js";var b=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),x=[`id`],S=[`data-placement`],C=v(a({__name:`Tooltip`,props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(a){let v=a,C=f(null),w=f(null),T=f({transform:`translate3d(0px, 0px, 0px)`,left:`0px`,top:`0px`}),E=f({}),D=f(v.placement??`top`),O=f(!1),k=null,A=null,j=null,M=null,N=null,P=0;function F(){return M?Promise.resolve(M):(N||=y(()=>import(`./floating-ui.dom-WZBoikmf.js`).then(e=>(M=e,e)),[]).catch(e=>{throw N=null,e}),N)}function I(){k&&=(k(),null),A=null,j=null}function L(e){return b(this,null,function*(){let t=v.anchorEl,n=C.value;if(!v.visible||!t||!n||A===t&&j===n)return;let{autoUpdate:r}=yield F();e()&&v.visible&&v.anchorEl===t&&C.value===n&&(I(),A=t,j=n,k=r(t,n,()=>{R().catch(()=>{z()})}))})}function R(){return b(this,null,function*(){let e=v.anchorEl,t=C.value;if(!v.visible||!e||!t)return!1;let{arrow:n,computePosition:r,flip:i,offset:a,shift:o}=yield F();if(!v.visible||v.anchorEl!==e||C.value!==t)return!1;let s=[a(v.offset??6),i(),o({padding:6}),...w.value?[n({element:w.value,padding:4})]:[]],{x:c,y:l,placement:u,middlewareData:d}=yield r(e,t,{placement:v.placement??`top`,middleware:s,strategy:`fixed`});if(!v.visible||v.anchorEl!==e||C.value!==t)return!1;if(T.value.transform=`translate3d(${Math.round(c)}px, ${Math.round(l)}px, 0)`,T.value.left=`0px`,T.value.top=`0px`,D.value=u,d.arrow&&w.value){let{x:e,y:t}=d.arrow,n={top:`bottom`,bottom:`top`,left:`right`,right:`left`}[u.split(`-`)[0]];E.value={left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`-3px`}}return!0})}function z(){let e=v.anchorEl,t=C.value;if(!e||!t)return!1;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=v.offset??6,a=v.placement??`top`,o=n.left,s=n.top;return a===`bottom`?s=n.bottom+i:a===`left`?o=n.left-r.width-i:a===`right`?o=n.right+i:s=n.top-r.height-i,T.value.transform=`translate3d(${Math.round(Math.max(0,o))}px, ${Math.round(Math.max(0,s))}px, 0)`,T.value.left=`0px`,T.value.top=`0px`,D.value=a,E.value={},!0}o(()=>v.visible,e=>b(null,null,function*(){let n=++P;if(e){if(O.value=!1,yield t(),n!==P||!v.visible)return;if(v.anchorEl&&C.value)try{let e=v.anchorEl,r=C.value,i=e.getBoundingClientRect();if(!(yield R())||n!==P||!v.visible||v.anchorEl!==e||C.value!==r)return;let a=T.value.transform;if(v.originX!=null&&v.originY!=null){let e=Math.abs(Number(v.originX)-i.left),r=Math.abs(Number(v.originY)-i.top);if(Math.hypot(e,r)>120){if(T.value.transform=`translate3d(${Math.round(v.originX)}px, ${Math.round(v.originY)}px, 0)`,yield t(),n!==P||!v.visible||(O.value=!0,yield t(),n!==P||!v.visible))return;T.value.transform=a}else O.value=!0}else O.value=!0;yield L(()=>n===P)}catch{if(n!==P||!v.visible)return;if(O.value=z(),v.anchorEl&&C.value)try{yield L(()=>n===P)}catch{}}else O.value=!0}else O.value=!1,I()}));let B=0;return o([()=>v.anchorEl,()=>v.placement,()=>v.content],()=>b(null,null,function*(){let e=++B;if(v.visible&&v.anchorEl&&C.value){if(yield t(),e!==B||!v.visible||!v.anchorEl||!C.value)return;try{let t=yield R();if(e!==B||!v.visible||!v.anchorEl||!C.value)return;t||z()}catch{z()}yield L(()=>e===B)}})),n(()=>{P+=1,I()}),(t,n)=>(_(),c(m,{to:`body`},[d(`div`,{class:l([`markstream-vue`,{dark:a.isDark}])},[e(h,{name:`tooltip`,appear:``},{default:s(()=>[r(d(`div`,{id:v.id,ref_key:`tooltip`,ref:C,style:g({position:`fixed`,left:T.value.left,top:T.value.top,transform:T.value.transform,visibility:O.value?`visible`:`hidden`,pointerEvents:O.value?void 0:`none`}),class:`tooltip-element`,role:`tooltip`},[i(u(a.content)+` `,1),d(`div`,{ref_key:`arrowEl`,ref:w,class:`tooltip-arrow`,"data-placement":D.value,style:g(E.value)},null,12,S)],12,x),[[p,a.visible]])]),_:1})],2)]))}}),[[`__scopeId`,`data-v-c606ee4c`]]);export{C as default};
|
|
Binary file
|
|
Binary file
|