zdashboard 2.11.2 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{r as a}from"./vendor-react-CDaMBvJU.js";import{e as v}from"./index-DkIxtopr.js";const f=new Map,s=new Map,o=new Set;function m(e){for(const i of[...o])i.event===e&&i.cb()}function w(e){return e instanceof Error?e.message:String(e)}function x(e,i,r){const g=a.useRef(i);a.useEffect(()=>{g.current=i}),v((r==null?void 0:r.subscribe)??"",()=>m((r==null?void 0:r.subscribe)??""));const[b,h]=a.useState(0),[d,c]=a.useState(()=>{const t=f.get(e);return t?{data:t.data,error:null,loading:!1}:{data:null,error:null,loading:!0}}),l=a.useCallback(t=>{if(t)f.delete(e),s.delete(e);else{const n=f.get(e);if(n){c({data:n.data,error:null,loading:!1});return}}let u=s.get(e);u||(u=Promise.resolve().then(()=>g.current()),s.set(e,u),u.then(n=>{f.set(e,{data:n,error:null})},()=>{}).finally(()=>{s.get(e)===u&&s.delete(e)})),c(n=>({...n,loading:n.loading||t,error:null})),u.then(n=>c({data:n,error:null,loading:!1}),n=>c(S=>({data:S.data,error:w(n),loading:!1})))},[e]);a.useEffect(()=>{l(!1)},[e,b,l]),a.useEffect(()=>{if(!(r!=null&&r.subscribe))return;const t={event:r.subscribe,cb:()=>{l(!0)}};return o.add(t),()=>{o.delete(t)}},[r==null?void 0:r.subscribe,l]);const E=a.useCallback(()=>{h(t=>t+1),l(!0)},[l]);return{...d,refreshing:d.loading&&d.data!==null,reload:E}}export{x as u};
1
+ import{r as a}from"./vendor-react-CDaMBvJU.js";import{e as v}from"./index-DJiq_38M.js";const f=new Map,s=new Map,o=new Set;function m(e){for(const i of[...o])i.event===e&&i.cb()}function w(e){return e instanceof Error?e.message:String(e)}function x(e,i,r){const g=a.useRef(i);a.useEffect(()=>{g.current=i}),v((r==null?void 0:r.subscribe)??"",()=>m((r==null?void 0:r.subscribe)??""));const[b,h]=a.useState(0),[d,c]=a.useState(()=>{const t=f.get(e);return t?{data:t.data,error:null,loading:!1}:{data:null,error:null,loading:!0}}),l=a.useCallback(t=>{if(t)f.delete(e),s.delete(e);else{const n=f.get(e);if(n){c({data:n.data,error:null,loading:!1});return}}let u=s.get(e);u||(u=Promise.resolve().then(()=>g.current()),s.set(e,u),u.then(n=>{f.set(e,{data:n,error:null})},()=>{}).finally(()=>{s.get(e)===u&&s.delete(e)})),c(n=>({...n,loading:n.loading||t,error:null})),u.then(n=>c({data:n,error:null,loading:!1}),n=>c(S=>({data:S.data,error:w(n),loading:!1})))},[e]);a.useEffect(()=>{l(!1)},[e,b,l]),a.useEffect(()=>{if(!(r!=null&&r.subscribe))return;const t={event:r.subscribe,cb:()=>{l(!0)}};return o.add(t),()=>{o.delete(t)}},[r==null?void 0:r.subscribe,l]);const E=a.useCallback(()=>{h(t=>t+1),l(!0)},[l]);return{...d,refreshing:d.loading&&d.data!==null,reload:E}}export{x as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-B519XBKX.js","assets/vendor-react-CDaMBvJU.js","assets/CodeViewer-C2VZQ2UQ.js","assets/vendor-ui-dpI0b3Ao.js","assets/fetchJson-D-dWeu1j.js","assets/index-DkIxtopr.js","assets/index-Bfe1AHR3.css","assets/CodeViewer-BTcE7LSd.css","assets/client-Cw4K1Nx3.js","assets/Sidebar-YR3_9vhn.js","assets/FileIcon-C-3sZoQF.js","assets/usePluginData-CDskp8Eo.js"])))=>i.map(i=>d[i]);
2
- import{_ as e}from"./index-DkIxtopr.js";import{r}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const o={mode:"view",label:"项目浏览",icon:"👁️",description:"openspec / docs / 文档预览",order:20},i=[{name:"wt",label:"Worktree 路径",type:"string",description:"worktree 绝对路径"},{name:"file",label:"文件路径",type:"string",description:"预览文件相对路径"},{name:"filter",label:"过滤词",type:"string",description:"文件树过滤词"}],a=t({manifest:o,params:i,workspace:r.lazy(()=>e(()=>import("./Workspace-B519XBKX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),sidebar:r.lazy(()=>e(()=>import("./Sidebar-YR3_9vhn.js"),__vite__mapDeps([9,1,5,3,6,10,11,4])))}),p=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as m,p as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-Cf7ZMclE.js","assets/vendor-react-CDaMBvJU.js","assets/CodeViewer-Dxlw7RnH.js","assets/vendor-ui-dpI0b3Ao.js","assets/fetchJson-D-dWeu1j.js","assets/index-DJiq_38M.js","assets/index-Bd4-oORn.css","assets/CodeViewer-BTcE7LSd.css","assets/client-Cw4K1Nx3.js","assets/Sidebar-CttCg64y.js","assets/FileIcon-DEXf9oCF.js","assets/usePluginData-BmlgMZle.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-DJiq_38M.js";import{r}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const o={mode:"view",label:"项目浏览",icon:"👁️",description:"openspec / docs / 文档预览",order:20},i=[{name:"wt",label:"Worktree 路径",type:"string",description:"worktree 绝对路径"},{name:"file",label:"文件路径",type:"string",description:"预览文件相对路径"},{name:"filter",label:"过滤词",type:"string",description:"文件树过滤词"}],a=t({manifest:o,params:i,workspace:r.lazy(()=>e(()=>import("./Workspace-Cf7ZMclE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),sidebar:r.lazy(()=>e(()=>import("./Sidebar-CttCg64y.js"),__vite__mapDeps([9,1,5,3,6,10,11,4])))}),p=Object.freeze(Object.defineProperty({__proto__:null,default:a},Symbol.toStringTag,{value:"Module"}));export{o as m,p as w};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-DG5fZnNW.js","assets/vendor-react-CDaMBvJU.js","assets/FilterPills-CNr38-5Y.js","assets/index-DkIxtopr.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bfe1AHR3.css","assets/CodeViewer-C2VZQ2UQ.js","assets/fetchJson-D-dWeu1j.js","assets/CodeViewer-BTcE7LSd.css","assets/client-Cw4K1Nx3.js","assets/Sidebar-9KOG4nkE.js","assets/FileIcon-C-3sZoQF.js","assets/usePluginData-CDskp8Eo.js"])))=>i.map(i=>d[i]);
2
- import{_ as e}from"./index-DkIxtopr.js";import{r as o}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const r={mode:"design",label:"设计资产",icon:"🎨",description:"设计资产分类浏览 · zdesign",order:30},i=[{name:"type",label:"资产类型",type:"string",description:"page/component/icon/token/md/video/audio/pdf/font"},{name:"asset",label:"选中资产",type:"string",description:"资产相对路径"},{name:"folder",label:"当前文件夹",type:"string",description:"限定展示的资产路径前缀"}],n=t({manifest:r,params:i,workspace:o.lazy(()=>e(()=>import("./Workspace-DG5fZnNW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),sidebar:o.lazy(()=>e(()=>import("./Sidebar-9KOG4nkE.js"),__vite__mapDeps([10,1,11,3,4,5,12,7])))}),p=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));export{r as m,p as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-B5Nn0L3J.js","assets/vendor-react-CDaMBvJU.js","assets/FilterPills-BZwzyDRQ.js","assets/index-DJiq_38M.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bd4-oORn.css","assets/CodeViewer-Dxlw7RnH.js","assets/fetchJson-D-dWeu1j.js","assets/CodeViewer-BTcE7LSd.css","assets/client-Cw4K1Nx3.js","assets/Sidebar-BLjYbvRT.js","assets/FileIcon-DEXf9oCF.js","assets/usePluginData-BmlgMZle.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-DJiq_38M.js";import{r as o}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const r={mode:"design",label:"设计资产",icon:"🎨",description:"设计资产分类浏览 · zdesign",order:30},i=[{name:"type",label:"资产类型",type:"string",description:"page/component/icon/token/md/video/audio/pdf/font"},{name:"asset",label:"选中资产",type:"string",description:"资产相对路径"},{name:"folder",label:"当前文件夹",type:"string",description:"限定展示的资产路径前缀"}],n=t({manifest:r,params:i,workspace:o.lazy(()=>e(()=>import("./Workspace-B5Nn0L3J.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),sidebar:o.lazy(()=>e(()=>import("./Sidebar-BLjYbvRT.js"),__vite__mapDeps([10,1,11,3,4,5,12,7])))}),p=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));export{r as m,p as w};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-DH3iHI4T.js","assets/vendor-react-CDaMBvJU.js","assets/index-DkIxtopr.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bfe1AHR3.css","assets/usePluginData-CDskp8Eo.js","assets/fetchJson-D-dWeu1j.js","assets/client-Cw4K1Nx3.js"])))=>i.map(i=>d[i]);
2
- import{_ as e}from"./index-DkIxtopr.js";import{r}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const o={mode:"stats",label:"项目统计",icon:"📊",description:"项目文件统计 · 扫描生成",order:10},a=[{name:"card",label:"钻取来源",type:"string",description:"钻取来源(worktree/dirty),view 侧读取后高亮"}],i=t({manifest:o,params:a,workspace:r.lazy(()=>e(()=>import("./Workspace-DH3iHI4T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])))}),l=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"}));export{o as m,l as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-Cn_qfesY.js","assets/vendor-react-CDaMBvJU.js","assets/index-DJiq_38M.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bd4-oORn.css","assets/usePluginData-BmlgMZle.js","assets/fetchJson-D-dWeu1j.js","assets/client-Cw4K1Nx3.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-DJiq_38M.js";import{r}from"./vendor-react-CDaMBvJU.js";import{d as t}from"./client-Cw4K1Nx3.js";const o={mode:"stats",label:"项目统计",icon:"📊",description:"项目文件统计 · 扫描生成",order:10},a=[{name:"card",label:"钻取来源",type:"string",description:"钻取来源(worktree/dirty),view 侧读取后高亮"}],i=t({manifest:o,params:a,workspace:r.lazy(()=>e(()=>import("./Workspace-Cn_qfesY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])))}),l=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"}));export{o as m,l as w};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-m0Ff-jIC.js","assets/vendor-react-CDaMBvJU.js","assets/index-DkIxtopr.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bfe1AHR3.css","assets/FilterPills-CNr38-5Y.js","assets/usePluginData-CDskp8Eo.js","assets/fetchJson-D-dWeu1j.js","assets/client-Cw4K1Nx3.js"])))=>i.map(i=>d[i]);
2
- import{_ as e}from"./index-DkIxtopr.js";import{r as t}from"./vendor-react-CDaMBvJU.js";import{d as r}from"./client-Cw4K1Nx3.js";const o={mode:"just",label:"Just Runner",icon:"📜",description:"Just 任务日志与执行",order:50},i=[{name:"recipe",label:"Recipe",type:"string",description:"选中的 recipe 名"},{name:"task",label:"任务",type:"string",description:"活跃任务 id"}],s=r({manifest:o,params:i,workspace:t.lazy(()=>e(()=>import("./Workspace-m0Ff-jIC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))}),c=Object.freeze(Object.defineProperty({__proto__:null,default:s},Symbol.toStringTag,{value:"Module"}));export{o as m,c as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Workspace-D71kFE3G.js","assets/vendor-react-CDaMBvJU.js","assets/index-DJiq_38M.js","assets/vendor-ui-dpI0b3Ao.js","assets/index-Bd4-oORn.css","assets/FilterPills-BZwzyDRQ.js","assets/usePluginData-BmlgMZle.js","assets/fetchJson-D-dWeu1j.js","assets/client-Cw4K1Nx3.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-DJiq_38M.js";import{r as t}from"./vendor-react-CDaMBvJU.js";import{d as r}from"./client-Cw4K1Nx3.js";const o={mode:"just",label:"Just Runner",icon:"📜",description:"Just 任务日志与执行",order:50},i=[{name:"recipe",label:"Recipe",type:"string",description:"选中的 recipe 名"},{name:"task",label:"任务",type:"string",description:"活跃任务 id"}],s=r({manifest:o,params:i,workspace:t.lazy(()=>e(()=>import("./Workspace-D71kFE3G.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))}),c=Object.freeze(Object.defineProperty({__proto__:null,default:s},Symbol.toStringTag,{value:"Module"}));export{o as m,c as w};
@@ -26,10 +26,10 @@
26
26
  } catch (e) { /* localStorage 不可用时放弃预置,交由 bundle 侧兜底 */ }
27
27
  })();
28
28
  </script>
29
- <script type="module" crossorigin src="/assets/index-DkIxtopr.js"></script>
29
+ <script type="module" crossorigin src="/assets/index-DJiq_38M.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-CDaMBvJU.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/vendor-ui-dpI0b3Ao.js">
32
- <link rel="stylesheet" crossorigin href="/assets/index-Bfe1AHR3.css">
32
+ <link rel="stylesheet" crossorigin href="/assets/index-Bd4-oORn.css">
33
33
  </head>
34
34
  <body>
35
35
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zdashboard",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "description": "ZCode skill dashboard platform — pluggable viewers for zdesign/zview/zreview/zgoal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- import{j as e,r as u}from"./vendor-react-CDaMBvJU.js";import{u as C,R as M,C as g,M as O,I as W}from"./CodeViewer-C2VZQ2UQ.js";import{u as b,R as L,a as R,P as V,c as _}from"./index-DkIxtopr.js";import{m as I}from"./web-BcUVoLfJ.js";import"./vendor-ui-dpI0b3Ao.js";import"./fetchJson-D-dWeu1j.js";import"./client-Cw4K1Nx3.js";function T({path:t,resolve:n}){const[o,r]=C(),f=t.split("/").pop(),c=n?n(t):"/"+encodeURI(t),d=o?`${c}${c.includes("?")?"&":"?"}v=${o}`:c;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-none px-4 py-2 border-b text-xs flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-foreground",children:f}),e.jsx("div",{className:"ml-auto",children:e.jsx(M,{onClick:r})})]}),e.jsx("iframe",{src:d,title:f,className:"flex-1 min-h-0 w-full bg-background"})]})}function U({path:t}){const{icon:n}=b();return e.jsx("div",{className:"grid place-items-center h-full text-center text-muted-foreground",children:e.jsxs("div",{children:[n("file-question","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 w=176,j=400,p=176,v="zd-outline-w",$=t=>Math.min(j,Math.max(w,t));function q(){try{const t=localStorage.getItem(v);if(t===null)return p;const n=Number(t);return Number.isFinite(n)&&n>=w&&n<=j?n:p}catch{return p}}function A({containerRef:t}){const{icon:n}=b(),[o,r]=u.useState([]),[f,c]=u.useState(null),[d,N]=u.useState(q),S=(s,l)=>{const i=$(s);if(N(i),l)try{localStorage.setItem(v,String(i))}catch{}},k=()=>{N(p);try{localStorage.removeItem(v)}catch{}};u.useEffect(()=>{const s=t.current;if(!s)return;let l=!1;const i=()=>{if(l)return;const x=s.querySelectorAll("h1[id], h2[id], h3[id]"),h=[];x.forEach(m=>{var y;h.push({id:m.id,text:((y=m.textContent)==null?void 0:y.trim())??"",level:parseInt(m.tagName[1],10)})}),r(h)};i();const a=new MutationObserver(i);return a.observe(s,{childList:!0,subtree:!0,characterData:!0}),()=>{l=!0,a.disconnect()}},[t]),u.useEffect(()=>{const s=t.current;if(!s||!o.length)return;const l=new IntersectionObserver(i=>{const a=i.filter(x=>x.isIntersecting);if(a.length){const x=a.reduce((h,m)=>h.boundingClientRect.top<m.boundingClientRect.top?h:m);c(x.target.id)}},{root:s,rootMargin:"-60px 0px -70% 0px",threshold:0});return o.forEach(({id:i})=>{const a=s.querySelector(`#${CSS.escape(i)}`);a&&l.observe(a)}),()=>l.disconnect()},[o,t]);const E=s=>{var i;const l=(i=t.current)==null?void 0:i.querySelector(`#${CSS.escape(s)}`);l==null||l.scrollIntoView({behavior:"smooth",block:"start"})};return o.length?e.jsxs("nav",{className:"hidden md:flex shrink-0 flex-col border-l py-2 overflow-hidden",style:{width:`${d}px`},"aria-label":"文档大纲",children:[e.jsx(L,{orientation:"vertical",min:w,max:j,value:d,onChange:S,onReset:k,label:"调整大纲宽度",className:"flex-none w-1.5 cursor-col-resize"}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pl-3",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[n("file-text","h-3 w-3"),e.jsx("span",{children:"大纲"})]}),e.jsx("ul",{className:"space-y-0.5",children:o.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",title:s.text,onClick:()=>E(s.id),className:`w-full text-left text-sm leading-snug py-0.5 px-1.5 rounded line-clamp-2 transition-colors ${f===s.id?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted/70"}`,style:{paddingLeft:6+Math.min(s.level-1,2)*10},children:s.text||s.id})},s.id))})]})]}):null}function F(t){const n=t.slice(t.lastIndexOf("/")+1).toLowerCase();if(n==="justfile"||n==="makefile")return g;const o=n.lastIndexOf("."),r=o>=0?n.slice(o):"";return r===".md"||r===".markdown"?O:[".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].includes(r)?W:[".pdf",".html",".htm"].includes(r)?T:[".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)?g:o===-1?g:U}function Y({params:t}){const{icon:n}=b(),o=R(I.mode,"h-5 w-5"),r=t.get("file"),f=t.get("wt"),c=u.useRef(null),d=r?F(r):null;return u.useEffect(()=>{c.current&&(c.current.scrollTop=0)},[r]),e.jsx(V,{manifest:I,icon:o,breadcrumb:["插件",f??"当前分支",...r?[r]:[]],children:e.jsx("div",{className:"mx-auto h-full max-w-5xl bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:r&&d?e.jsxs("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[e.jsx("div",{ref:c,className:"flex-1 min-h-0 overflow-auto",children:e.jsx(d,{path:r})}),e.jsx(A,{containerRef:c})]}):e.jsx(_,{icon:n("eye","h-6 w-6"),title:"从左侧选择文件预览",hint:"支持 Markdown、图片、代码等格式"})})})}export{Y as default};