zdashboard 2.6.1 → 2.6.2

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.
Files changed (28) hide show
  1. package/dist/cli.js +157 -22
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/assets/FileIcon-Bc03q6Gz.js +279 -0
  4. package/dist/web/assets/{FilterPills-B6u1IBeC.js → FilterPills-CSZQenbh.js} +1 -1
  5. package/dist/web/assets/{ProgressBar-CbyvyLzw.js → ProgressBar-ycyJBwG-.js} +1 -1
  6. package/dist/web/assets/{Workspace-DQmfVJh6.js → Workspace-jCfxaTOM.js} +1 -1
  7. package/dist/web/assets/badge-DUO7nDks.js +1 -0
  8. package/dist/web/assets/index-4aiRmNbP.css +1 -0
  9. package/dist/web/assets/{index-BvuOeKbq.js → index-BrvOKJRF.js} +1 -1
  10. package/dist/web/assets/{index-BfA6l4to.js → index-Co_rMXPa.js} +2 -2
  11. package/dist/web/assets/web-BKh2HY35.js +2 -0
  12. package/dist/web/assets/web-BNjs9lCy.js +139 -0
  13. package/dist/web/assets/{web-BcTJQUKr.js → web-BrsVNrGk.js} +1 -1
  14. package/dist/web/assets/{web-BXCBKn6i.js → web-Bt0s1qFE.js} +1 -1
  15. package/dist/web/assets/{web-C8I10oqh.js → web-CCoznDNk.js} +1 -1
  16. package/dist/web/assets/web-DxK2pSVl.js +1 -0
  17. package/dist/web/assets/web-ShIDOvFD.js +1 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +1 -1
  20. package/dist/web/assets/FileIcon-B0-2gV6a.js +0 -10
  21. package/dist/web/assets/MdViewer-Cvh3TNQI.js +0 -270
  22. package/dist/web/assets/badge-DTb6qo3S.js +0 -1
  23. package/dist/web/assets/index-DQkehbup.css +0 -1
  24. package/dist/web/assets/web-5newSm97.js +0 -1
  25. package/dist/web/assets/web-BOg9UnpC.js +0 -1
  26. package/dist/web/assets/web-CLCAgjmg.js +0 -1
  27. package/dist/web/assets/web-CXE89yN1.js +0 -2
  28. /package/dist/web/assets/{MdViewer-BTcE7LSd.css → FileIcon-BTcE7LSd.css} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as C,d as N,u as de,j as f,B as O,e as ge,_ as pe}from"./index-BfA6l4to.js";import{F as me}from"./FilterPills-B6u1IBeC.js";function g(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function $(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function De(t,e){const r=g(t);return isNaN(e)?$(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function xe(t,e){const r=g(t);if(isNaN(e))return $(t,NaN);if(!e)return r;const s=r.getDate(),n=$(t,r.getTime());n.setMonth(r.getMonth()+e+1,0);const c=n.getDate();return s>=c?n:(r.setFullYear(n.getFullYear(),n.getMonth(),s),r)}function S(t,e){const{years:r=0,months:s=0,weeks:n=0,days:c=0,hours:i=0,minutes:o=0,seconds:l=0}=e,u=g(t),d=s||r?xe(u,s+r*12):u,a=c||n?De(d,c+n*7):d,p=o+i*60,m=(l+p*60)*1e3;return $(t,a.getTime()+m)}const Fe=864e5,be=6e4,ve=36e5;function V(t){const e=g(t);return e.setHours(0,0,0,0),e}function K(t){const e=g(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function ye(t,e){const r=V(t),s=V(e),n=+r-K(r),c=+s-K(s);return Math.round((n-c)/Fe)}function M(t,e){const r=g(t),s=g(e),n=r.getTime()-s.getTime();return n<0?-1:n>0?1:n}function Ee(t,e){const r=g(t),s=g(e),n=r.getFullYear()-s.getFullYear(),c=r.getMonth()-s.getMonth();return n*12+c}function Ce(t,e){const r=g(t),s=g(e);return r.getFullYear()-s.getFullYear()}function Ae(t,e){const r=g(t),s=g(e),n=Q(r,s),c=Math.abs(ye(r,s));r.setDate(r.getDate()-n*c);const i=+(Q(r,s)===-n),o=n*(c-i);return o===0?0:o}function Q(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function W(t){return e=>{const s=(t?Math[t]:Math.trunc)(e);return s===0?0:s}}function J(t,e){return+g(t)-+g(e)}function je(t,e,r){const s=J(t,e)/ve;return W(r==null?void 0:r.roundingMethod)(s)}function ze(t,e,r){const s=J(t,e)/be;return W(r==null?void 0:r.roundingMethod)(s)}function we(t){const e=g(t);return e.setHours(23,59,59,999),e}function ke(t){const e=g(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function Ne(t){const e=g(t);return+we(e)==+ke(e)}function Re(t,e){const r=g(t),s=g(e),n=M(r,s),c=Math.abs(Ee(r,s));let i;if(c<1)i=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-n*c);let o=M(r,s)===-n;Ne(g(t))&&c===1&&M(t,s)===1&&(o=!1),i=n*(c-Number(o))}return i===0?0:i}function Oe(t,e,r){const s=J(t,e)/1e3;return W(r==null?void 0:r.roundingMethod)(s)}function Se(t,e){const r=g(t),s=g(e),n=M(r,s),c=Math.abs(Ce(r,s));r.setFullYear(1584),s.setFullYear(1584);const i=M(r,s)===-n,o=n*(c-+i);return o===0?0:o}function Me(t){const e=g(t.start),r=g(t.end),s={},n=Se(r,e);n&&(s.years=n);const c=S(e,{years:s.years}),i=Re(r,c);i&&(s.months=i);const o=S(c,{months:s.months}),l=Ae(r,o);l&&(s.days=l);const u=S(o,{days:s.days}),d=je(r,u);d&&(s.hours=d);const a=S(u,{hours:s.hours}),p=ze(r,a);p&&(s.minutes=p);const F=S(a,{minutes:s.minutes}),m=Oe(r,F);return m&&(s.seconds=m),s}var ae={};const w=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],$e=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class R{static escapeForHtml(e){return new R().escapeForHtml(e)}static linkify(e){return new R().linkify(e)}static ansiToHtml(e,r){return new R().ansiToHtml(e,r)}static ansiToJson(e,r){return new R().ansiToJson(e,r)}static ansiToText(e){return new R().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let c=0;c<8;++c)this.PALETTE_COLORS.push(w[n][c].color);let e=[0,95,135,175,215,255],r=(n,c,i)=>e[n]+", "+e[c]+", "+e[i];for(let n=0;n<6;++n)for(let c=0;c<6;++c)for(let i=0;i<6;++i)this.PALETTE_COLORS.push(r(n,c,i));let s=8;for(let n=0;n<24;++n,s+=10)this.PALETTE_COLORS.push(s+", "+s+", "+s)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,r=>r=="&"?"&amp;":r=='"'?"&quot;":r=="<"?"&lt;":r==">"?"&gt;":"")}linkify(e){return e.replace($e,r=>`<a href="${r}">${r}</a>`)}ansiToHtml(e,r){return this.process(e,r,!0)}ansiToJson(e,r){return r=r||{},r.json=!0,r.clearLine=!1,this.process(e,r,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,r,s){let n=this,c=e.split(/\033\[/),i=c.shift();r==null&&(r={}),r.clearLine=/\r/.test(e);let o=c.map(l=>this.processChunk(l,r,s));if(r&&r.json){let l=n.processChunkJson("");return l.content=i,l.clearLine=r.clearLine,o.unshift(l),r.remove_empty&&(o=o.filter(u=>!u.isEmpty())),o}else o.unshift(i);return o.join("")}processChunkJson(e,r,s){r=typeof r>"u"?{}:r;let n=r.use_classes=typeof r.use_classes<"u"&&r.use_classes,c=r.key=n?"class":"color",i={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:r.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!i.content},o=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!o)return i;i.content=o[4];let l=o[2].split(";");if(o[1]!==""||o[3]!=="m"||!s)return i;let u=this;for(;l.length>0;){let d=l.shift(),a=parseInt(d);if(isNaN(a)||a===0)u.fg=u.bg=null,u.decorations=[];else if(a===1)u.decorations.push("bold");else if(a===2)u.decorations.push("dim");else if(a===3)u.decorations.push("italic");else if(a===4)u.decorations.push("underline");else if(a===5)u.decorations.push("blink");else if(a===7)u.decorations.push("reverse");else if(a===8)u.decorations.push("hidden");else if(a===9)u.decorations.push("strikethrough");else if(a===21)u.removeDecoration("bold");else if(a===22)u.removeDecoration("bold"),u.removeDecoration("dim");else if(a===23)u.removeDecoration("italic");else if(a===24)u.removeDecoration("underline");else if(a===25)u.removeDecoration("blink");else if(a===27)u.removeDecoration("reverse");else if(a===28)u.removeDecoration("hidden");else if(a===29)u.removeDecoration("strikethrough");else if(a===39)u.fg=null;else if(a===49)u.bg=null;else if(a>=30&&a<38)u.fg=w[0][a%10][c];else if(a>=90&&a<98)u.fg=w[1][a%10][c];else if(a>=40&&a<48)u.bg=w[0][a%10][c];else if(a>=100&&a<108)u.bg=w[1][a%10][c];else if(a===38||a===48){let p=a===38;if(l.length>=1){let F=l.shift();if(F==="5"&&l.length>=1){let m=parseInt(l.shift());if(m>=0&&m<=255)if(!n)this.PALETTE_COLORS||u.setupPalette(),p?u.fg=this.PALETTE_COLORS[m]:u.bg=this.PALETTE_COLORS[m];else{let A=m>=16?"ansi-palette-"+m:w[m>7?1:0][m%8].class;p?u.fg=A:u.bg=A}}else if(F==="2"&&l.length>=3){let m=parseInt(l.shift()),A=parseInt(l.shift()),v=parseInt(l.shift());if(m>=0&&m<=255&&A>=0&&A<=255&&v>=0&&v<=255){let j=m+", "+A+", "+v;n?p?(u.fg="ansi-truecolor",u.fg_truecolor=j):(u.bg="ansi-truecolor",u.bg_truecolor=j):p?u.fg=j:u.bg=j}}}}}return u.fg===null&&u.bg===null&&u.decorations.length===0||(i.fg=u.fg,i.bg=u.bg,i.fg_truecolor=u.fg_truecolor,i.bg_truecolor=u.bg_truecolor,i.decorations=u.decorations,i.decoration=u.decorations.slice(-1).pop()||null,i.was_processed=!0),i}processChunk(e,r,s){r=r||{};let n=this.processChunkJson(e,r,s),c=r.use_classes;if(n.decorations=n.decorations.filter(a=>{if(a==="reverse"){n.fg||(n.fg=w[0][7][c?"class":"color"]),n.bg||(n.bg=w[0][0][c?"class":"color"]);let p=n.fg;n.fg=n.bg,n.bg=p;let F=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=F,n.isInverted=!0,!1}return!0}),r.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let i=[],o=[],l=[],u={},d=a=>{let p=[],F;for(F in a)a.hasOwnProperty(F)&&p.push("data-"+F+'="'+this.escapeForHtml(a[F])+'"');return p.length>0?" "+p.join(" "):""};return n.isInverted&&(u["ansi-is-inverted"]="true"),n.fg&&(c?(i.push(n.fg+"-fg"),n.fg_truecolor!==null&&(u["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):i.push("color:rgb("+n.fg+")")),n.bg&&(c?(i.push(n.bg+"-bg"),n.bg_truecolor!==null&&(u["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):i.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(a=>{if(c){o.push("ansi-"+a);return}a==="bold"?o.push("font-weight:bold"):a==="dim"?o.push("opacity:0.5"):a==="italic"?o.push("font-style:italic"):a==="hidden"?o.push("visibility:hidden"):a==="strikethrough"?l.push("line-through"):l.push(a)}),l.length&&o.push("text-decoration:"+l.join(" ")),c?'<span class="'+i.concat(o).join(" ")+'"'+d(u)+">"+n.content+"</span>":'<span style="'+i.concat(o).join(";")+'"'+d(u)+">"+n.content+"</span>"}removeDecoration(e){const r=this.decorations.indexOf(e);r>=0&&this.decorations.splice(r,1)}}var Ie=R,T={exports:{}};function G(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
1
+ import{r as C,d as N,u as de,j as f,B as O,e as ge,_ as pe}from"./index-Co_rMXPa.js";import{F as me}from"./FilterPills-CSZQenbh.js";function g(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function $(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function De(t,e){const r=g(t);return isNaN(e)?$(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function xe(t,e){const r=g(t);if(isNaN(e))return $(t,NaN);if(!e)return r;const s=r.getDate(),n=$(t,r.getTime());n.setMonth(r.getMonth()+e+1,0);const c=n.getDate();return s>=c?n:(r.setFullYear(n.getFullYear(),n.getMonth(),s),r)}function S(t,e){const{years:r=0,months:s=0,weeks:n=0,days:c=0,hours:i=0,minutes:o=0,seconds:l=0}=e,u=g(t),d=s||r?xe(u,s+r*12):u,a=c||n?De(d,c+n*7):d,p=o+i*60,m=(l+p*60)*1e3;return $(t,a.getTime()+m)}const Fe=864e5,be=6e4,ve=36e5;function V(t){const e=g(t);return e.setHours(0,0,0,0),e}function K(t){const e=g(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function ye(t,e){const r=V(t),s=V(e),n=+r-K(r),c=+s-K(s);return Math.round((n-c)/Fe)}function M(t,e){const r=g(t),s=g(e),n=r.getTime()-s.getTime();return n<0?-1:n>0?1:n}function Ee(t,e){const r=g(t),s=g(e),n=r.getFullYear()-s.getFullYear(),c=r.getMonth()-s.getMonth();return n*12+c}function Ce(t,e){const r=g(t),s=g(e);return r.getFullYear()-s.getFullYear()}function Ae(t,e){const r=g(t),s=g(e),n=Q(r,s),c=Math.abs(ye(r,s));r.setDate(r.getDate()-n*c);const i=+(Q(r,s)===-n),o=n*(c-i);return o===0?0:o}function Q(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function W(t){return e=>{const s=(t?Math[t]:Math.trunc)(e);return s===0?0:s}}function J(t,e){return+g(t)-+g(e)}function je(t,e,r){const s=J(t,e)/ve;return W(r==null?void 0:r.roundingMethod)(s)}function ze(t,e,r){const s=J(t,e)/be;return W(r==null?void 0:r.roundingMethod)(s)}function we(t){const e=g(t);return e.setHours(23,59,59,999),e}function ke(t){const e=g(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function Ne(t){const e=g(t);return+we(e)==+ke(e)}function Re(t,e){const r=g(t),s=g(e),n=M(r,s),c=Math.abs(Ee(r,s));let i;if(c<1)i=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-n*c);let o=M(r,s)===-n;Ne(g(t))&&c===1&&M(t,s)===1&&(o=!1),i=n*(c-Number(o))}return i===0?0:i}function Oe(t,e,r){const s=J(t,e)/1e3;return W(r==null?void 0:r.roundingMethod)(s)}function Se(t,e){const r=g(t),s=g(e),n=M(r,s),c=Math.abs(Ce(r,s));r.setFullYear(1584),s.setFullYear(1584);const i=M(r,s)===-n,o=n*(c-+i);return o===0?0:o}function Me(t){const e=g(t.start),r=g(t.end),s={},n=Se(r,e);n&&(s.years=n);const c=S(e,{years:s.years}),i=Re(r,c);i&&(s.months=i);const o=S(c,{months:s.months}),l=Ae(r,o);l&&(s.days=l);const u=S(o,{days:s.days}),d=je(r,u);d&&(s.hours=d);const a=S(u,{hours:s.hours}),p=ze(r,a);p&&(s.minutes=p);const F=S(a,{minutes:s.minutes}),m=Oe(r,F);return m&&(s.seconds=m),s}var ae={};const w=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],$e=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class R{static escapeForHtml(e){return new R().escapeForHtml(e)}static linkify(e){return new R().linkify(e)}static ansiToHtml(e,r){return new R().ansiToHtml(e,r)}static ansiToJson(e,r){return new R().ansiToJson(e,r)}static ansiToText(e){return new R().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let c=0;c<8;++c)this.PALETTE_COLORS.push(w[n][c].color);let e=[0,95,135,175,215,255],r=(n,c,i)=>e[n]+", "+e[c]+", "+e[i];for(let n=0;n<6;++n)for(let c=0;c<6;++c)for(let i=0;i<6;++i)this.PALETTE_COLORS.push(r(n,c,i));let s=8;for(let n=0;n<24;++n,s+=10)this.PALETTE_COLORS.push(s+", "+s+", "+s)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,r=>r=="&"?"&amp;":r=='"'?"&quot;":r=="<"?"&lt;":r==">"?"&gt;":"")}linkify(e){return e.replace($e,r=>`<a href="${r}">${r}</a>`)}ansiToHtml(e,r){return this.process(e,r,!0)}ansiToJson(e,r){return r=r||{},r.json=!0,r.clearLine=!1,this.process(e,r,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,r,s){let n=this,c=e.split(/\033\[/),i=c.shift();r==null&&(r={}),r.clearLine=/\r/.test(e);let o=c.map(l=>this.processChunk(l,r,s));if(r&&r.json){let l=n.processChunkJson("");return l.content=i,l.clearLine=r.clearLine,o.unshift(l),r.remove_empty&&(o=o.filter(u=>!u.isEmpty())),o}else o.unshift(i);return o.join("")}processChunkJson(e,r,s){r=typeof r>"u"?{}:r;let n=r.use_classes=typeof r.use_classes<"u"&&r.use_classes,c=r.key=n?"class":"color",i={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:r.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!i.content},o=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!o)return i;i.content=o[4];let l=o[2].split(";");if(o[1]!==""||o[3]!=="m"||!s)return i;let u=this;for(;l.length>0;){let d=l.shift(),a=parseInt(d);if(isNaN(a)||a===0)u.fg=u.bg=null,u.decorations=[];else if(a===1)u.decorations.push("bold");else if(a===2)u.decorations.push("dim");else if(a===3)u.decorations.push("italic");else if(a===4)u.decorations.push("underline");else if(a===5)u.decorations.push("blink");else if(a===7)u.decorations.push("reverse");else if(a===8)u.decorations.push("hidden");else if(a===9)u.decorations.push("strikethrough");else if(a===21)u.removeDecoration("bold");else if(a===22)u.removeDecoration("bold"),u.removeDecoration("dim");else if(a===23)u.removeDecoration("italic");else if(a===24)u.removeDecoration("underline");else if(a===25)u.removeDecoration("blink");else if(a===27)u.removeDecoration("reverse");else if(a===28)u.removeDecoration("hidden");else if(a===29)u.removeDecoration("strikethrough");else if(a===39)u.fg=null;else if(a===49)u.bg=null;else if(a>=30&&a<38)u.fg=w[0][a%10][c];else if(a>=90&&a<98)u.fg=w[1][a%10][c];else if(a>=40&&a<48)u.bg=w[0][a%10][c];else if(a>=100&&a<108)u.bg=w[1][a%10][c];else if(a===38||a===48){let p=a===38;if(l.length>=1){let F=l.shift();if(F==="5"&&l.length>=1){let m=parseInt(l.shift());if(m>=0&&m<=255)if(!n)this.PALETTE_COLORS||u.setupPalette(),p?u.fg=this.PALETTE_COLORS[m]:u.bg=this.PALETTE_COLORS[m];else{let A=m>=16?"ansi-palette-"+m:w[m>7?1:0][m%8].class;p?u.fg=A:u.bg=A}}else if(F==="2"&&l.length>=3){let m=parseInt(l.shift()),A=parseInt(l.shift()),v=parseInt(l.shift());if(m>=0&&m<=255&&A>=0&&A<=255&&v>=0&&v<=255){let j=m+", "+A+", "+v;n?p?(u.fg="ansi-truecolor",u.fg_truecolor=j):(u.bg="ansi-truecolor",u.bg_truecolor=j):p?u.fg=j:u.bg=j}}}}}return u.fg===null&&u.bg===null&&u.decorations.length===0||(i.fg=u.fg,i.bg=u.bg,i.fg_truecolor=u.fg_truecolor,i.bg_truecolor=u.bg_truecolor,i.decorations=u.decorations,i.decoration=u.decorations.slice(-1).pop()||null,i.was_processed=!0),i}processChunk(e,r,s){r=r||{};let n=this.processChunkJson(e,r,s),c=r.use_classes;if(n.decorations=n.decorations.filter(a=>{if(a==="reverse"){n.fg||(n.fg=w[0][7][c?"class":"color"]),n.bg||(n.bg=w[0][0][c?"class":"color"]);let p=n.fg;n.fg=n.bg,n.bg=p;let F=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=F,n.isInverted=!0,!1}return!0}),r.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let i=[],o=[],l=[],u={},d=a=>{let p=[],F;for(F in a)a.hasOwnProperty(F)&&p.push("data-"+F+'="'+this.escapeForHtml(a[F])+'"');return p.length>0?" "+p.join(" "):""};return n.isInverted&&(u["ansi-is-inverted"]="true"),n.fg&&(c?(i.push(n.fg+"-fg"),n.fg_truecolor!==null&&(u["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):i.push("color:rgb("+n.fg+")")),n.bg&&(c?(i.push(n.bg+"-bg"),n.bg_truecolor!==null&&(u["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):i.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(a=>{if(c){o.push("ansi-"+a);return}a==="bold"?o.push("font-weight:bold"):a==="dim"?o.push("opacity:0.5"):a==="italic"?o.push("font-style:italic"):a==="hidden"?o.push("visibility:hidden"):a==="strikethrough"?l.push("line-through"):l.push(a)}),l.length&&o.push("text-decoration:"+l.join(" ")),c?'<span class="'+i.concat(o).join(" ")+'"'+d(u)+">"+n.content+"</span>":'<span style="'+i.concat(o).join(";")+'"'+d(u)+">"+n.content+"</span>"}removeDecoration(e){const r=this.decorations.indexOf(e);r>=0&&this.decorations.splice(r,1)}}var Ie=R,T={exports:{}};function G(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
2
2
  `);/\r./.test(t);)t=t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm,function(e,r,s){return s+r.slice(s.length)});return t}function Te(t){for(var e=0,r=0;r<t.length;r++)t[e].length<=t[r].length&&(e=r);return e}function X(t){if(!/\r/.test(t))return t;for(var e=t.split("\r"),r=[];e.length>0;){var s=Te(e);r.push(e[s]),e=e.slice(s+1)}return r.join("\r")}function Le(t){if(!t)return"";if(!/\r/.test(t))return t;if(!/\n/.test(t))return X(t);t=t.replace(/\r+\n/gm,`
3
3
  `);var e=t.lastIndexOf(`
4
4
  `);return G(t.slice(0,e))+`
@@ -1,2 +1,2 @@
1
- import{u as h,r as a,a as W,j as e,E as C,_ as O}from"./index-BfA6l4to.js";import{B as m}from"./badge-DTb6qo3S.js";import{P as $}from"./ProgressBar-CbyvyLzw.js";import{M as b,r as N}from"./index-BvuOeKbq.js";const k=/^\s*-\s*\[([ xX])\]\s*(.*)$/;function R(s){return s.split(`
1
+ import{u as h,r as a,a as W,j as e,E as C,_ as O}from"./index-Co_rMXPa.js";import{B as m}from"./badge-DUO7nDks.js";import{P as $}from"./ProgressBar-ycyJBwG-.js";import{M as b,r as N}from"./index-BrvOKJRF.js";const k=/^\s*-\s*\[([ xX])\]\s*(.*)$/;function R(s){return s.split(`
2
2
  `).filter(n=>k.test(n)).map(n=>{const t=n.match(k);return{text:((t==null?void 0:t[2])??n).trim(),checked:(t==null?void 0:t[1])!==" "}})}function w(s,n){return n===0?0:Math.round(s/n*100)}function y({done:s,total:n}){const t=w(s,n),o=t===100?"success":t>0?"warning":"neutral";return e.jsxs(m,{variant:o,children:[s,"/",n," · ",t,"%"]})}function v(){return e.jsx(m,{variant:"info",children:"worktree 执行中"})}function B(){return e.jsx(m,{variant:"info",children:"含测试策略"})}function I({name:s,pending:n}){const t=n?"neutral":"success";return e.jsx(m,{variant:t,children:n?`${s} · 等待前置`:s})}function A({tasks:s}){const n=R(s);if(!n.length)return e.jsx("p",{className:"text-xs text-muted-foreground",children:"无 tasks.md"});const t=n.findIndex(o=>!o.checked);return e.jsx("ul",{className:"space-y-1 text-xs",children:n.map((o,l)=>{const i=l===t;return e.jsxs("li",{className:`flex items-start gap-2 rounded px-1.5 -mx-1.5 py-0.5 ${i?"bg-warning/10 border-l-2 border-warning":""} ${o.checked?"text-foreground":"text-muted-foreground"}`,children:[o.checked?e.jsx("span",{className:"mt-0.5 h-3.5 w-3.5 shrink-0 rounded-full bg-success text-white flex items-center justify-center text-xs",children:"✓"}):e.jsx("span",{className:`mt-0.5 h-3.5 w-3.5 shrink-0 rounded-full border ${i?"border-warning":"border-muted-foreground/50"}`}),e.jsx("span",{children:o.text}),i&&e.jsx("span",{className:"ml-auto flex-none text-xs font-medium text-warning",children:"← 下一步"})]},l)})})}function L({item:s,onSelect:n}){const{icon:t}=h();return e.jsxs("button",{type:"button",onClick:n,className:"w-full text-left rounded-lg border bg-card p-4 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[t("folder-open","h-4 w-4 text-muted-foreground"),e.jsx("span",{className:"text-sm font-medium font-mono truncate",children:s.name}),e.jsx(y,{done:s.done,total:s.total}),s.inWorktree&&e.jsx(v,{})]}),e.jsx($,{value:w(s.done,s.total),className:"h-1 mb-2"}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[e.jsx("span",{className:s.hasProposal?"text-foreground":"",children:"proposal"}),e.jsx("span",{className:s.hasDesign?"text-foreground":"",children:"design"})]})]})}function M({refreshKey:s}){const{icon:n}=h(),[t,o]=a.useState([]);return a.useEffect(()=>{fetch("/__worktrees",{cache:"no-store"}).then(l=>l.json()).then(o).catch(()=>o([]))},[s]),t.length?e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n("git-branch","h-3.5 w-3.5 text-muted-foreground"),e.jsx("span",{className:"text-sm text-muted-foreground mr-1",children:"Worktree:"}),t.map(l=>e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded border text-xs font-mono bg-info/10 text-info border-info/30",title:l.head,children:[l.name,"@",l.branch||"detached"]},l.name))]}):null}function z({navTarget:s}){const{icon:n}=h(),[t,o]=a.useState([]),[l,i]=a.useState(0);a.useRef(!1),W(()=>{},()=>i(r=>r+1));const[S,_]=a.useState(null),[c,E]=a.useState(null),[f,x]=a.useState(!0),[p,g]=a.useState(null),[U,P]=a.useState(!1),j=a.useCallback(()=>{x(!0),fetch("/__apply",{cache:"no-store"}).then(r=>r.json()).then(o).catch(r=>g(r.message)).finally(()=>x(!1))},[]);a.useEffect(()=>{j()},[j,l]);const u=a.useCallback(r=>{x(!0),_(r),P(!0),fetch(`/__apply/change?name=${encodeURIComponent(r)}`,{cache:"no-store"}).then(d=>d.json()).then(E).catch(d=>g(d.message)).finally(()=>x(!1))},[]);return a.useEffect(()=>{if(!(s!=null&&s.wt)||!t.length)return;const r=t.find(d=>d.name===s.wt);r&&u(r.name)},[s==null?void 0:s.wt,s==null?void 0:s.navToken,t,u]),f&&!t.length?e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-3.5 grid h-14 w-14 place-items-center rounded-[var(--radius-lg)] bg-primary text-primary-foreground text-2xl font-bold animate-pulse",children:"⚙️"}),e.jsx("p",{children:"加载执行进度…"})]})}):p?e.jsx("div",{className:"flex h-full items-center justify-center text-destructive",children:e.jsx("p",{children:p})}):e.jsxs("div",{className:"mx-auto h-full max-w-6xl flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex-none px-4 py-3 border-b flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"OpenSpec 执行进度"}),e.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:"openspec/changes/"})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto p-4 space-y-4",children:[e.jsx(M,{refreshKey:l}),t.length?e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.map(r=>e.jsx(L,{item:r,onSelect:()=>u(r.name)},r.name))}):e.jsx(C,{icon:n("folder-git-2","h-6 w-6"),title:"没有进行中的 change",hint:"在 openspec/changes/ 下创建 change 后会显示在这里"}),S&&c&&!f&&e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-sm font-medium",children:c.name}),e.jsx(y,{done:c.done,total:c.total}),c.inWorktree&&e.jsx(v,{}),c.hasTestStrategy&&e.jsx(B,{})]}),c.dependsOn.length>0&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"依赖:"}),c.dependsOn.map(r=>e.jsx(I,{name:r,pending:t.some(d=>d.name===r)},r))]}),c.proposal&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1",children:[n("file-text","h-3 w-3")," proposal.md"]}),e.jsx("div",{className:"prose dark:prose-invert max-w-none text-xs border rounded-lg p-3 bg-card",children:e.jsx(b,{remarkPlugins:[N],children:c.proposal})})]}),c.design&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1",children:[n("file-text","h-3 w-3")," design.md"]}),e.jsx("div",{className:"prose dark:prose-invert max-w-none text-xs border rounded-lg p-3 bg-card",children:e.jsx(b,{remarkPlugins:[N],children:c.design})})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1",children:[n("file-text","h-3 w-3")," tasks.md"]}),e.jsx("div",{className:"border rounded-lg p-3 bg-card",children:e.jsx(A,{tasks:c.tasks})})]})]})]})]})}function D({navTarget:s}){return e.jsx(z,{navTarget:s})}const K=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),F={mode:"apply",label:"执行进度",icon:"⚙️",description:"OpenSpec change 执行进度 · zapply",Workspace:a.lazy(()=>O(()=>Promise.resolve().then(()=>K),void 0))};export{D as ApplyWorkspace,F as default};
@@ -0,0 +1 @@
1
+ import{u as h,r as c,j as e,E as S,_ as N}from"./index-Co_rMXPa.js";import{C as _,M as V,I,F as C}from"./FileIcon-Bc03q6Gz.js";import{F as E}from"./FilterPills-CSZQenbh.js";import"./index-BrvOKJRF.js";let w=null;const j=new Set,p={get:()=>w,set:t=>{w=t,j.forEach(o=>o(t))},subscribe:t=>(j.add(t),()=>{j.delete(t)})};function R({path:t}){return e.jsx("iframe",{src:"/"+encodeURI(t),title:"预览",className:"w-full h-full border-0 bg-white"})}function F({path:t}){const[o,d]=c.useState([]),[l,r]=c.useState(!0);return c.useEffect(()=>{let s=!1;return r(!0),d([]),fetch("/"+encodeURI(t),{cache:"no-store"}).then(n=>n.text()).then(n=>{if(s)return;const m=n.match(/--[A-Za-z0-9_-]+\s*:\s*[^;}\n]+/g)??[];if(!m.length){d([]),r(!1);return}const i=u=>/^(#([0-9a-fA-F]{3,8})\b|rgb|rgba|hsl|hsla|oklch|oklab|color\()/i.test(u.trim()),a=m.filter(u=>i(u)),x=m.filter(u=>/font|family|type/.test(u.toLowerCase())&&!i(u)),b=m.filter(u=>!a.includes(u)&&!x.includes(u)),g=u=>{const v=u.indexOf(":"),k=u.slice(0,v).trim(),y=u.slice(v+1).trim();return{name:k,value:y}},f=[];a.length&&f.push({label:`配色 · ${a.length}`,items:a.map(g)}),x.length&&f.push({label:`字体 · ${x.length}`,items:x.map(g)}),b.length&&f.push({label:`其他 · ${b.length}`,items:b.map(g)}),d(f),r(!1)}).catch(()=>{s||(d([]),r(!1))}),()=>{s=!0}},[t]),l?e.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"解析中…"}):o.length?e.jsx("div",{className:"p-8 flex flex-col gap-7",children:o.map(s=>{const n=s.items.some(i=>/^(#|rgb|rgba|hsl|hsla|oklch|oklab|color\()/i.test(i.value)),m=s.items.some(i=>/font|family|type/i.test(i.name));return e.jsxs("section",{children:[e.jsx("div",{className:"mb-3 text-sm font-semibold uppercase text-muted-foreground",children:s.label}),n?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(var(--token-card-min-w), 1fr))"},children:s.items.filter(i=>/^(#|rgb|rgba|hsl|hsla|oklch|oklab|color\()/i.test(i.value)).map(({name:i,value:a})=>e.jsxs("div",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsx("div",{className:"h-[var(--design-preview-h)] border-b",style:{background:a}}),e.jsx("div",{className:"px-2.5 pt-2 font-mono text-sm break-all",children:i}),e.jsx("div",{className:"px-2.5 pb-2 text-xs text-muted-foreground",children:a})]},i))}):m?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(var(--token-card-min-w), 1fr))"},children:s.items.map(({name:i,value:a})=>e.jsxs("div",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsx("div",{className:"grid h-[var(--design-preview-h)] place-items-center text-2xl",style:{fontFamily:a},children:"Aa"}),e.jsx("div",{className:"px-2.5 font-mono text-sm",children:i})]},i))}):e.jsx("div",{className:"flex flex-col gap-1",children:s.items.map(({name:i,value:a})=>e.jsxs("div",{className:"flex justify-between gap-3 px-2.5 py-1.5 rounded border bg-background text-xs",children:[e.jsx("span",{className:"font-mono",children:i}),e.jsx("span",{className:"text-muted-foreground",children:a})]},i))})]},s.label)})}):e.jsx("p",{className:"p-3 text-xs",children:"未发现 CSS 变量"})}function P({path:t}){return e.jsx("div",{className:"grid place-items-center p-8",children:e.jsx("video",{src:"/"+encodeURI(t),controls:!0,className:"max-w-full max-h-[80vh] rounded border"})})}function U({path:t}){return e.jsx("div",{className:"grid place-items-center p-8",children:e.jsx("audio",{src:"/"+encodeURI(t),controls:!0,className:"w-full max-w-2xl"})})}function O({path:t}){return e.jsx("div",{className:"grid place-items-center p-8 h-full",children:e.jsx("iframe",{src:"/"+encodeURI(t),title:"PDF",className:"w-full h-full max-h-[80vh] rounded border bg-white"})})}function L({path:t}){const[o,d]=c.useState("");return c.useEffect(()=>{let l=!1,r="",s=null;return fetch("/"+encodeURI(t)).then(n=>n.blob()).then(async n=>{var m;if(!l){if(r=URL.createObjectURL(n),s=new FontFace("zd-font-preview",`url(${r})`),await s.load(),l){(m=s.dispose)==null||m.call(s);return}document.fonts.add(s),d(t.split("/").pop()??t)}}).catch(()=>{l||d(t.split("/").pop()??t)}),()=>{var n;if(l=!0,s)try{document.fonts.delete(s),(n=s.dispose)==null||n.call(s)}catch{}r&&URL.revokeObjectURL(r)}},[t]),e.jsxs("div",{className:"h-full overflow-auto p-8 grid gap-6 place-content-center text-center",children:[e.jsx("div",{className:"text-xs text-muted-foreground font-mono break-all",children:t}),e.jsx("div",{className:"text-5xl",style:{fontFamily:o?"'zd-font-preview', serif":"serif"},children:"Aa 字体预览 0123"})]})}function $({path:t}){const{icon:o}=h();return e.jsx("div",{className:"grid place-items-center h-full text-center text-muted-foreground",children:e.jsxs("div",{children:[o("image-off","h-10 w-10 mx-auto mb-3 opacity-50"),e.jsx("p",{children:"该格式无法预览"}),e.jsx("p",{className:"mt-1 font-mono text-xs break-all",children:t})]})})}const z={page:R,icon:I,token:F,md:V,video:P,audio:U,pdf:O,component:_,font:L};function T(t){return z[t]??$}function W({mode:t,onMode:o,w:d,h:l,onW:r,onH:s}){const{icon:n}=h(),m=[{v:0,icon:n("monitor","h-3.5 w-3.5"),label:"桌面"},{v:768,icon:n("tablet","h-3.5 w-3.5"),label:"768"},{v:375,icon:n("smartphone","h-3.5 w-3.5"),label:"375"},{v:"custom",icon:n("sliders-horizontal","h-3.5 w-3.5"),label:"自定义"}],i="w-[var(--design-input-w)] h-7 px-1 text-center text-xs rounded border border-border bg-background text-foreground [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none focus:outline-none focus:border-primary";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border p-0.5 bg-muted",children:e.jsx(E,{items:m.map(a=>({key:String(a.v),label:a.label,renderLabel:()=>e.jsxs(e.Fragment,{children:[a.icon,e.jsx("span",{className:"hidden sm:inline",children:a.label})]})})),value:String(t),onChange:a=>o(a==="0"?0:a==="custom"?"custom":Number(a)),ariaLabel:"视口模式"})}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx("input",{type:"number",value:d,min:280,max:3e3,step:8,onChange:a=>r(Number(a.target.value)),"aria-label":"自定义宽度",className:i}),e.jsx("span",{className:"text-muted-foreground/70",children:"×"}),e.jsx("input",{type:"number",value:l,min:400,max:3e3,step:8,onChange:a=>s(Number(a.target.value)),"aria-label":"自定义高度",className:i}),e.jsx("span",{className:"text-sm text-muted-foreground/70",children:"px"})]})]})}function A(){const{icon:t}=h(),[o,d]=c.useState(()=>p.get()),[l,r]=c.useState(0),[s,n]=c.useState(1024),[m,i]=c.useState(768);c.useEffect(()=>p.subscribe(d),[]);const a=o?T(o.type):null,x=l===0?"桌面":l==="custom"?`${s} × ${m}`:`${l}px`;return e.jsx("div",{className:"mx-auto h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:o&&a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"h-[var(--design-toolbar-h)] flex-none flex items-center justify-between px-3.5 border-b bg-background text-xs",children:[e.jsx("span",{className:"font-mono truncate",children:o.path}),e.jsx("span",{className:"text-muted-foreground ml-3 flex-none",children:x}),e.jsx(W,{mode:l,onMode:r,w:s,h:m,onW:n,onH:i})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:o.type==="page"?e.jsx("div",{className:"mx-auto bg-background overflow-hidden",style:{maxWidth:l===0?void 0:l==="custom"?s:l,height:l==="custom"?m:"100%"},children:e.jsx(a,{path:o.path})}):e.jsx("div",{className:"mx-auto max-w-5xl h-full overflow-auto",children:e.jsx(a,{path:o.path})})})]}):e.jsx(S,{icon:t("palette","h-6 w-6"),title:"从左侧选择一个资产预览",hint:"点左侧折叠钮展开资产树 · 改文件即时刷新",tone:"primary"})})}const D=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),M={page:"monitor",component:"blocks",icon:"shapes",token:"palette",md:"book-open",video:"video",audio:"audio-lines",pdf:"file-text",font:"type"},G=[{key:"page",label:"页面"},{key:"component",label:"组件"},{key:"icon",label:"图标"},{key:"token",label:"Tokens"},{key:"md",label:"文档"},{key:"video",label:"视频"},{key:"audio",label:"音频"},{key:"pdf",label:"PDF"},{key:"font",label:"字体"}];function H(){const t=c.useSyncExternalStore(p.subscribe,p.get),[o,d]=c.useState(null);c.useEffect(()=>{fetch("/__design/assets",{cache:"no-store"}).then(r=>r.json()).then(d)},[]);const l=c.useMemo(()=>o?G.map(r=>({...r,items:o[r.key]??[]})).filter(r=>r.items.length>0):[],[o]);return o?e.jsxs("div",{children:[e.jsxs("div",{className:"p-3 text-xs text-muted-foreground",children:[l.reduce((r,s)=>r+s.items.length,0)," 个资产"]}),l.map(r=>e.jsx(Z,{group:r,current:t},r.key))]}):e.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载中…"})}function Z({group:t,current:o}){const[d,l]=c.useState(!0),{icon:r}=h(),s=M[t.key];return e.jsxs("div",{className:"mb-1.5 px-1",children:[e.jsxs("button",{onClick:()=>l(n=>!n),className:"w-full flex items-center gap-1.5 pt-2 pb-1 text-sm font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground rounded-md",children:[r("chevron-right",`h-3 w-3 shrink-0 transition-transform ${d?"rotate-90":""}`),s&&r(s,"h-3.5 w-3.5 shrink-0"),e.jsx("span",{className:"truncate",children:t.label}),e.jsx("span",{className:"ml-auto shrink-0 rounded-full bg-muted px-1.5 font-mono text-xs font-normal",children:t.items.length})]}),d&&t.items.map(n=>e.jsxs("button",{onClick:()=>p.set({path:n.path,type:n.type}),className:`w-full text-left flex items-center gap-2 px-2.5 py-1.5 text-xs hover:bg-muted rounded-md ${(o==null?void 0:o.path)===n.path?"bg-primary/10 text-foreground font-medium":"text-muted-foreground"}`,children:[e.jsx(C,{name:n.name,active:(o==null?void 0:o.path)===n.path}),e.jsx("span",{className:"truncate",children:n.name}),n.ext&&e.jsx("span",{className:"ml-auto font-mono text-xs text-muted-foreground/60",children:n.ext})]},n.path))]})}const q=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"})),X={mode:"design",label:"设计资产",icon:"🎨",description:"设计资产分类浏览 · zdesign",Sidebar:c.lazy(()=>N(()=>Promise.resolve().then(()=>q),void 0)),Workspace:c.lazy(()=>N(()=>Promise.resolve().then(()=>D),void 0))};export{H as DesignSidebar,A as DesignWorkspace,X as default};
@@ -0,0 +1 @@
1
+ import{u as k,j as t,r as c,E as B,_ as z}from"./index-Co_rMXPa.js";import{C as q,M as J,I as K,F as Q}from"./FileIcon-Bc03q6Gz.js";import"./index-BrvOKJRF.js";function T({path:e}){const{icon:s}=k();return t.jsx("div",{className:"grid place-items-center h-full text-center text-muted-foreground",children:t.jsxs("div",{children:[s("file-question","h-10 w-10 mx-auto mb-3 opacity-50"),t.jsx("p",{children:"该格式无法预览"}),t.jsx("p",{className:"mt-1 font-mono text-xs break-all",children:e})]})})}let G=null;const $=new Set,y={get:()=>G,set:e=>{G=e,$.forEach(s=>s(e))},subscribe:e=>($.add(e),()=>{$.delete(e)})};function X({containerRef:e}){const{icon:s}=k(),[r,f]=c.useState([]),[h,o]=c.useState(null);c.useEffect(()=>{const i=e.current;if(!i)return;let u=!1;const a=()=>{if(u)return;const l=i.querySelectorAll("h1[id], h2[id], h3[id]"),x=[];l.forEach(b=>{var g;x.push({id:b.id,text:((g=b.textContent)==null?void 0:g.trim())??"",level:parseInt(b.tagName[1],10)})}),f(x)};a();const n=new MutationObserver(a);return n.observe(i,{childList:!0,subtree:!0,characterData:!0}),()=>{u=!0,n.disconnect()}},[e]),c.useEffect(()=>{const i=e.current;if(!i||!r.length)return;const u=new IntersectionObserver(a=>{const n=a.filter(l=>l.isIntersecting);if(n.length){const l=n.reduce((x,b)=>x.boundingClientRect.top<b.boundingClientRect.top?x:b);o(l.target.id)}},{root:i,rootMargin:"-60px 0px -70% 0px",threshold:0});return r.forEach(({id:a})=>{const n=i.querySelector(`#${CSS.escape(a)}`);n&&u.observe(n)}),()=>u.disconnect()},[r,e]);const d=i=>{var a;const u=(a=e.current)==null?void 0:a.querySelector(`#${CSS.escape(i)}`);u==null||u.scrollIntoView({behavior:"smooth",block:"start"})};return r.length?t.jsxs("nav",{className:"hidden md:flex w-44 shrink-0 flex-col border-l pl-3 py-2 overflow-y-auto","aria-label":"文档大纲",children:[t.jsxs("div",{className:"flex items-center gap-1 mb-2 text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[s("file-text","h-3 w-3"),t.jsx("span",{children:"大纲"})]}),t.jsx("ul",{className:"space-y-0.5",children:r.map(i=>t.jsx("li",{children:t.jsx("button",{type:"button",onClick:()=>d(i.id),className:`w-full text-left text-sm leading-snug py-0.5 px-1.5 rounded truncate transition-colors ${h===i.id?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted/70"}`,style:{paddingLeft:6+(i.level-1)*10},children:i.text||i.id})},i.id))})]}):null}const Y=2500;function Z(e){const s=e.slice(e.lastIndexOf("/")+1).toLowerCase();if(s==="justfile"||s==="makefile")return q;const r=e.slice(e.lastIndexOf(".")).toLowerCase();return r===".md"||r===".markdown"?J:[".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].includes(r)?K:[".sql",".txt",".csv",".tsv",".json",".yaml",".yml",".xml",".py",".js",".ts",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".cs",".swift",".kt",".scala",".sh",".bash",".zsh",".fish",".env",".gitignore",".dockerfile"].includes(r)?q:T}function ee(e){const{icon:s}=k(),[r,f]=c.useState(()=>y.get()),[h,o]=c.useState(!1),d=c.useRef(null),i=r?Z(r):null;return c.useEffect(()=>y.subscribe(f),[]),c.useEffect(()=>{const u=d.current;if(!u)return;const a=()=>{var x;const l=((x=u.textContent)==null?void 0:x.length)??0;o(l>Y)};a();const n=new MutationObserver(a);return n.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},[r]),t.jsx("div",{className:"mx-auto h-full max-w-5xl bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:r&&i?t.jsxs("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[t.jsx("div",{ref:d,className:"flex-1 min-h-0 overflow-auto",children:t.jsx(i,{path:r})}),h&&t.jsx(X,{containerRef:d})]}):t.jsx(B,{icon:s("eye","h-6 w-6"),title:"从左侧选择文件预览",hint:"支持 Markdown、图片、代码等格式",tone:"primary"})})}const te=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));function re(e,s,r,f){var h=this,o=c.useRef(null),d=c.useRef(0),i=c.useRef(0),u=c.useRef(null),a=c.useRef([]),n=c.useRef(),l=c.useRef(),x=c.useRef(e),b=c.useRef(!0),g=c.useRef(),O=c.useRef();x.current=e;var L=typeof window<"u",N=!s&&s!==0&&L;if(typeof e!="function")throw new TypeError("Expected a function");s=+s||0;var R=!!(r=r||{}).leading,I=!("trailing"in r)||!!r.trailing,S=!!r.flushOnExit&&I,w="maxWait"in r,W="debounceOnServer"in r&&!!r.debounceOnServer,D=w?Math.max(+r.maxWait||0,s):null,A=c.useMemo(function(){var v=function(m){var p=a.current,j=n.current;return a.current=n.current=null,d.current=m,i.current=i.current||m,l.current=x.current.apply(j,p)},E=function(m,p){N&&cancelAnimationFrame(u.current),u.current=N?requestAnimationFrame(m):setTimeout(m,p)},F=function(m){if(!b.current)return!1;var p=m-o.current;return!o.current||p>=s||p<0||w&&m-d.current>=D},P=function(m){return u.current=null,I&&a.current?v(m):(a.current=n.current=null,l.current)},M=function m(){var p=Date.now();if(R&&i.current===d.current&&U(),F(p))return P(p);if(b.current){var j=s-(p-o.current),C=w?Math.min(j,D-(p-d.current)):j;E(m,C)}},U=function(){f&&f({})},_=function(){if(L||W){var m,p=Date.now(),j=F(p);if(a.current=[].slice.call(arguments),n.current=h,o.current=p,S&&!g.current&&(g.current=function(){var C;((C=globalThis.document)==null?void 0:C.visibilityState)==="hidden"&&O.current.flush()},(m=globalThis.document)==null||m.addEventListener==null||m.addEventListener("visibilitychange",g.current)),j){if(!u.current&&b.current)return d.current=o.current,E(M,s),R?v(o.current):l.current;if(w)return E(M,s),v(o.current)}return u.current||E(M,s),l.current}};return _.cancel=function(){var m=u.current;m&&(N?cancelAnimationFrame(u.current):clearTimeout(u.current)),d.current=0,a.current=o.current=n.current=u.current=null,m&&f&&f({})},_.isPending=function(){return!!u.current},_.flush=function(){return u.current?P(Date.now()):l.current},_},[R,w,s,D,I,S,N,L,W,f]);return O.current=A,c.useEffect(function(){return b.current=!0,function(){var v;S&&O.current.flush(),g.current&&((v=globalThis.document)==null||v.removeEventListener==null||v.removeEventListener("visibilitychange",g.current),g.current=null),b.current=!1}},[S]),A}function ne(e,s){return e===s}function se(e,s,r){var f=ne,h=c.useRef(e),o=c.useState({})[1],d=re(c.useCallback(function(u){h.current=u,o({})},[o]),s,r,o),i=c.useRef(e);return f(i.current,e)||(d(e),i.current=e),[h.current,d]}function V(e,s){return!s||e.name.toLowerCase().includes(s)?!0:(e.children??[]).some(r=>V(r,s))}function H({node:e,depth:s,filter:r,current:f,onSelectFile:h}){const o=(e.children??[]).filter(n=>V(n,r)),[d,i]=c.useState(!e.defaultCollapsed),u=r?!0:d;if(!o.length&&r)return null;const{icon:a}=k();return t.jsxs("div",{children:[(()=>{const n=e.name.match(/^([a-z]+)(?: \((\d+)\))?$/),l=n?a(n[1]):void 0;return t.jsxs("button",{onClick:()=>i(x=>!x),className:"w-full flex items-center gap-1.5 px-2 py-1 text-sm text-foreground hover:bg-muted rounded-md mx-1",style:{paddingLeft:8+s*14,width:"calc(100% - 8px)"},children:[t.jsx("span",{className:`h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-transform ${u?"rotate-90":""}`,children:a("chevron-right")}),l?t.jsx("span",{className:"h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center text-muted-foreground",children:l}):t.jsx("span",{className:"h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-colors",children:a(u?"folder-open":"folder")}),t.jsx("span",{className:"font-medium truncate",children:n?n[1]:e.name}),(n==null?void 0:n[2])&&t.jsx("span",{className:"ml-auto mr-1 shrink-0 rounded-full bg-muted px-1.5 text-xs font-mono text-muted-foreground",children:n[2]})]})})(),u&&o.map(n=>n.kind==="dir"?t.jsx(H,{node:n,depth:s+1,filter:r,current:f,onSelectFile:h},n.name+s):t.jsxs("button",{onClick:()=>n.path&&h(n.path),className:`w-full flex items-center gap-1.5 pr-2 py-1 text-sm hover:bg-muted rounded-md mx-1 ${f===n.path?"bg-primary/10 text-foreground font-medium":"text-muted-foreground"}`,style:{paddingLeft:20+s*14,width:"calc(100% - 8px)"},children:[t.jsx(Q,{name:n.name,active:f===n.path}),t.jsx("span",{className:"truncate",children:n.name})]},n.path))]})}function ce({worktrees:e}){const[s,r]=c.useState(!0),{icon:f}=k(),h=o=>{window.dispatchEvent(new CustomEvent("zd-dashboard-nav",{detail:{mode:"apply",wt:o.name}}))};return t.jsxs("div",{className:"mb-1",children:[t.jsxs("button",{onClick:()=>r(o=>!o),className:"w-full flex items-center gap-1 px-2 py-1.5 text-sm font-medium text-muted-foreground tracking-wide hover:text-foreground",children:[t.jsx("span",{className:`h-3 w-3 inline-flex items-center justify-center transition-transform ${s?"rotate-90":""}`,children:f("chevron-right")}),t.jsx("span",{className:"h-3 w-3 inline-flex items-center justify-center",children:f("git-branch")}),t.jsxs("span",{children:["Worktrees (",e.length,")"]})]}),s&&e.map(o=>t.jsxs("button",{onClick:()=>h(o),title:`${o.branch}${o.dirty?" · 有未提交变更":""}`,className:"w-full flex items-center gap-1.5 px-2 py-1 text-sm text-foreground hover:bg-muted border-l-2 border-transparent",style:{paddingLeft:14},children:[t.jsx("span",{className:"truncate font-mono text-sm",children:o.branch}),t.jsxs("span",{className:"text-muted-foreground truncate",children:["/",o.name]}),o.dirty&&t.jsx("span",{className:"ml-auto flex-none h-2 w-2 rounded-full bg-destructive shrink-0",title:"有未提交变更"})]},o.name))]})}function oe({navTarget:e}){const s=c.useSyncExternalStore(y.subscribe,y.get),[r,f]=c.useState(null),[h,o]=c.useState(""),[d]=se(h,150),[i,u]=c.useState([]);c.useEffect(()=>{e!=null&&e.filter&&o(e.filter)},[e==null?void 0:e.filter,e==null?void 0:e.navToken]),c.useEffect(()=>{fetch("/__files",{cache:"no-store"}).then(l=>l.json()).then(l=>f(l.tree??[]))},[]),c.useEffect(()=>{fetch("/__worktrees",{cache:"no-store"}).then(l=>l.json()).then(u).catch(()=>u([]))},[]);const a=c.useMemo(()=>r?r.filter(l=>V(l,d)):[],[r,d]),n=i.length>0;return t.jsxs("div",{className:"p-2",children:[t.jsx("input",{value:h,onChange:l=>o(l.target.value.toLowerCase()),placeholder:"过滤…",className:"w-full h-7 px-2 text-xs rounded border border-border bg-background focus:outline-none focus:border-primary"}),r?!a.length&&!n?t.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"无匹配"}):t.jsxs("div",{className:"py-1",children:[n&&t.jsx(ce,{worktrees:i}),a.map(l=>t.jsx(H,{node:l,depth:0,filter:d,current:s,onSelectFile:x=>y.set(x)},l.name))]}):t.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载中…"})]})}const ue=Object.freeze(Object.defineProperty({__proto__:null,default:oe},Symbol.toStringTag,{value:"Module"})),de={mode:"view",label:"项目浏览",icon:"👁️",description:"openspec / docs / 文档预览",Sidebar:c.lazy(()=>z(()=>Promise.resolve().then(()=>ue),void 0)),Workspace:c.lazy(()=>z(()=>Promise.resolve().then(()=>te),void 0))};export{oe as ViewSidebar,ee as ViewWorkspace,de as default};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" href="/__app/favicon.svg" type="image/svg+xml" />
7
7
  <title>zdashboard · 项目洞察</title>
8
- <script type="module" crossorigin src="/assets/index-BfA6l4to.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-DQkehbup.css">
8
+ <script type="module" crossorigin src="/assets/index-Co_rMXPa.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-4aiRmNbP.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zdashboard",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "ZCode skill dashboard platform — pluggable viewers for zdesign/zview/zreview/zgoal",
5
5
  "type": "module",
6
6
  "bin": {