nx-kv 0.56.2 → 0.57.0
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 +34 -0
- package/assets/nx-kv/references/A03-/346/226/207/346/241/243/344/270/216/345/275/222/345/261/236.md +4 -3
- package/assets/nx-kv/references/A04-/344/273/223/345/272/223/344/270/216/351/241/271/347/233/256/347/273/204.md +7 -2
- package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +2 -2
- package/package.json +1 -1
- package/src/modules/docs/link-note.ts +171 -0
- package/src/modules/localtask/actions/_manifest.generated.ts +3 -0
- package/src/modules/localtask/actions/localtask-boardtasks.ts +156 -0
- package/src/modules/localtask/actions/localtask-tasks.ts +12 -2
- package/src/modules/repos/actions/repo-ref-note.ts +9 -5
- package/src/modules/repos/link-note.ts +111 -0
- package/src/modules/repos/ref.ts +40 -71
- package/src/web/frontend/api/cli-tree.json +17 -2
- package/src/web/frontend/api/client.generated.ts +15 -2
- package/src/web/frontend/page/repos/api.ts +0 -5
- package/src/web/frontend/page/repos/bind-modals.tsx +6 -55
- package/src/web/frontend/page/repos/board-refs.tsx +8 -18
- package/src/web/frontend/page/repos/index.tsx +2 -20
- package/src/web/frontend/page/repos/ref-panel.tsx +4 -8
- package/src/web/frontend/refs/api.ts +0 -5
- package/src/web/frontend/styles/modals.css +0 -30
- package/src/web/public/assets/{composer-panel-CzUeT8Wm.js → composer-panel-qX7uVyLW.js} +1 -1
- package/src/web/public/assets/{dir-T3tJ6mj6.js → dir-B360Miyq.js} +1 -1
- package/src/web/public/assets/{group-D5sEX31u.js → group-CCcRCEjR.js} +1 -1
- package/src/web/public/assets/{index-ChaDvo2D.js → index-BLrw-ZQc.js} +2 -2
- package/src/web/public/assets/index-BPxgsnXM.css +1 -0
- package/src/web/public/assets/repo-form-modal-pyqiC7pB.js +1 -0
- package/src/web/public/assets/repos-CeyrjSQ_.js +11 -0
- package/src/web/public/assets/{settings-bvwdOF-n.js → settings-DhX_fRMm.js} +1 -1
- package/src/web/public/assets/{task-D7taZbrH.js → task-XXG4USTn.js} +1 -1
- package/src/web/public/assets/{templates-CRHBAwpm.js → templates-C9a5CUFd.js} +1 -1
- package/src/web/public/index.html +3 -3
- package/src/web/public/assets/index-CLGiMYZc.css +0 -1
- package/src/web/public/assets/repo-form-modal-DxEqerLy.js +0 -1
- package/src/web/public/assets/repos-CKbhG3cI.js +0 -14
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{C as e,_ as t,b as n,g as r,p as i,u as a,v as o,y as s}from"./frontmatter-DEIM0yF2.js";import{r as c}from"./workspace-C0PPPfA1.js";import{C as l,D as u,E as d,O as f,S as p,T as m,_ as h,a as g,b as _,c as v,d as y,f as b,g as x,h as S,i as C,k as w,l as T,m as E,n as D,o as O,p as k,r as A,s as j,t as M,u as N,v as P,w as F,x as I,y as L}from"./repo-form-modal-pyqiC7pB.js";import{n as R}from"./app-context-CR7f0AtI.js";import{a as z,i as B,n as V}from"./doc-CKkCGsZ4.js";import{t as H}from"./route-crumb-CkhC1zw2.js";import{t as U}from"./bar-CmzzOYQi.js";import{t as ee}from"./member-picker-B_LsCqNq.js";var W=e(n(),1),G=s(),K={new:{label:`新增`,cls:`new`},changed:{label:`有差异`,cls:`changed`},same:{label:`一致`,cls:`same`}};function te({onClose:e,onChanged:n,repos:i,boards:a}){let s=r(),c=t(),[l,u]=(0,W.useState)(`import`),[d,f]=(0,W.useState)({}),[p,m]=(0,W.useState)({}),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(``),[y,b]=(0,W.useState)(``),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)({}),[T,E]=(0,W.useState)({}),[D,O]=(0,W.useState)(`ours`),[k,A]=(0,W.useState)(`none`),[j,M]=(0,W.useState)(``),[N,P]=(0,W.useState)(null),[F,I]=(0,W.useState)(!1),L=(0,W.useMemo)(()=>i||[],[i]),R=(0,W.useMemo)(()=>L.map(e=>e.key),[L]),z=(0,W.useMemo)(()=>(a||[]).map(e=>e.name),[a]),B=e=>{let t={};for(let n of R)t[n]=e;f(t)},V=e=>{let t={};for(let n of z)t[n]=e;m(t)},H=()=>{let e={};for(let t of R)e[t]=!d[t];f(e)},U=()=>s(async()=>{let e=Object.keys(d).filter(e=>d[e]),t=Object.keys(p).filter(e=>p[e]),n={repos:e.length&&e.length!==R.length?e:void 0,boards:t.length&&t.length!==z.length?t.map(e=>`board/${e}`):void 0,noUnassigned:h},r=new URLSearchParams;n.repos?.length&&r.set(`repos`,n.repos.join(`,`)),n.boards?.length&&r.set(`boards`,n.boards.join(`,`)),h&&r.set(`no-unassigned`,`1`);let i=await o(`/api/repos/export`+(r.toString()?`?`+r:``));v(JSON.stringify(i,null,2)),c(`已生成布局:${i.repos.length} 个仓库 / ${i.boards.length} 个看板`)}),ee=()=>{if(!_)return;let e=new Blob([_],{type:`application/json`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`nx-kv-layout-${new Date().toISOString().slice(0,10)}.json`,t.click(),URL.revokeObjectURL(t.href)},te=async e=>{let t=e.target.files?.[0];t&&(b(await t.text()),S(null),P(null))},q=()=>s(async()=>{if(y.trim()){I(!0);try{let e=await o(`/api/repos/import/diff`,{method:`POST`,body:{json:y}});S(e);let t={};for(let n of e.repos)t[n.key]=n.status!==`same`;w(t);let n={};for(let t of e.boards)n[t.key]=t.status!==`same`;E(n),P(null),c(`差异:新增 ${e.summary.new} · 有差异 ${e.summary.changed} · 一致 ${e.summary.same} · 本地未拥有 ${e.summary.missing}`)}finally{I(!1)}}}),ne=()=>s(async()=>{let e=Object.keys(C).filter(e=>C[e]),t=Object.keys(T).filter(e=>T[e]);I(!0);try{let r=await o(`/api/repos/import`,{method:`POST`,body:{json:y,strategy:D,clone:k,selection:e.length?e:void 0,boards:t.length?t:void 0}});P(r),c(`导入完成:新建 ${r.created.length} · 覆盖 ${r.updated.length} · 另存 ${r.duplicated.length}`),await J(),n&&await n()}finally{I(!1)}}),J=(0,W.useCallback)(async()=>{try{let e=await o(`/api/repos/import/diff`,{method:`POST`,body:{json:y}});S(e);let t={};for(let n of e.repos)t[n.key]=n.status!==`same`;w(t)}catch{}},[y]),Y=(0,W.useMemo)(()=>x?j?x.repos.filter(e=>e.status===j):x.repos:[],[x,j]),re=(e,t)=>s(async()=>{if(t){I(!0);try{await o(`/api/repos/clone`,{method:`POST`,body:{remote:t,key:e,type:`ref`,depth:1}}),c(`已克隆: ${e}`),await J(),n&&await n()}finally{I(!1)}}}),X=e=>{let t={...C};for(let n of Y)t[n.key]=e;w(t)};(0,W.useEffect)(()=>{let t=t=>{t.key===`Escape`&&(t.stopImmediatePropagation(),e())};return document.addEventListener(`keydown`,t,!0),()=>document.removeEventListener(`keydown`,t,!0)},[e]);let ie=(0,W.useMemo)(()=>{let e={new:0,changed:0,same:0};if(!x)return e;for(let t of x.repos)e[t.status]=(e[t.status]||0)+1;return e},[x]);return(0,G.jsx)(`div`,{className:`rp-full`,onMouseDown:t=>{t.target===t.currentTarget&&e()},children:(0,G.jsxs)(`div`,{className:`rp-full-box`,children:[(0,G.jsxs)(`div`,{className:`rp-full-head`,children:[(0,G.jsxs)(`div`,{className:`rp-full-title`,children:[`导入导出`,(0,G.jsx)(`span`,{className:`muted`,children:`以全局 key 为身份 · 不含本地路径 · 逐条选择与冲突方案`})]}),(0,G.jsxs)(`div`,{className:`rp-full-tabs`,children:[(0,G.jsx)(`button`,{className:`rp-tab`+(l===`import`?` on`:``),onClick:()=>u(`import`),children:`导入`}),(0,G.jsx)(`button`,{className:`rp-tab`+(l===`export`?` on`:``),onClick:()=>u(`export`),children:`导出`})]}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:e,children:`关闭`})]}),l===`export`?(0,G.jsxs)(`div`,{className:`rp-full-body`,children:[(0,G.jsxs)(`div`,{className:`rp-full-col`,children:[(0,G.jsxs)(`div`,{className:`rp-full-colhead`,children:[(0,G.jsx)(`span`,{children:`导出范围`}),(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>B(!0),children:`全选仓库`}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>B(!1),children:`全不选`}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:H,children:`反选`})]})]}),(0,G.jsxs)(`div`,{className:`rp-full-sel`,children:[L.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!d[e.key],onChange:t=>f(n=>({...n,[e.key]:t.target.checked}))}),(0,G.jsx)(`span`,{className:e.type===`ref`?`rp-full-tag-ref`:``,children:e.name}),(0,G.jsx)(`span`,{className:`muted rp-full-key`,title:e.key,children:e.key})]},e.key)),L.length?null:(0,G.jsx)(`div`,{className:`muted`,children:`还没有仓库`})]}),(0,G.jsxs)(`div`,{className:`rp-full-colhead`,style:{marginTop:10},children:[(0,G.jsx)(`span`,{children:`看板`}),(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>V(!0),children:`全选`}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>V(!1),children:`全不选`})]})]}),(0,G.jsxs)(`div`,{className:`rp-full-sel`,children:[(a||[]).map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!p[e.name],onChange:t=>m(n=>({...n,[e.name]:t.target.checked}))}),(0,G.jsx)(`span`,{children:e.name})]},e.name)),a?.length?null:(0,G.jsx)(`div`,{className:`muted`,children:`还没有看板`})]}),(0,G.jsxs)(`label`,{className:`rp-pick-item`,style:{marginTop:10},children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),(0,G.jsx)(`span`,{children:`不带未分组的仓库`})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(`button`,{className:`btn`,onClick:U,children:`生成布局`}),(0,G.jsx)(`button`,{className:`btn ghost`,disabled:!_,onClick:ee,children:`下载 JSON`})]})]}),(0,G.jsxs)(`div`,{className:`rp-full-col`,children:[(0,G.jsx)(`div`,{className:`rp-full-colhead`,children:(0,G.jsx)(`span`,{children:`导出结果`})}),(0,G.jsx)(`textarea`,{className:`rp-full-out`,readOnly:!0,value:_,spellCheck:`false`,placeholder:`点「生成布局」后在这里预览 JSON(可直接复制或下载)`})]})]}):(0,G.jsxs)(`div`,{className:`rp-full-body`,children:[(0,G.jsxs)(`div`,{className:`rp-full-col`,children:[(0,G.jsx)(`div`,{className:`rp-full-colhead`,children:(0,G.jsx)(`span`,{children:`导入来源`})}),(0,G.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:te}),(0,G.jsx)(`textarea`,{className:`rp-full-input`,rows:7,spellCheck:`false`,placeholder:`粘贴布局 JSON,或选一个 .json 文件`,value:y,onChange:e=>{b(e.target.value),S(null)}}),(0,G.jsx)(`div`,{className:`form-hint`,children:`每个仓库的 key 必须有:文件里已写 key 就直接用;只写了远程地址就按 host/owner/repo 归一化; 两样都没有会在差异检查阶段直接报错(不会按名字猜 key)。要改 key 就改上面的 JSON 再检查。`}),(0,G.jsx)(`div`,{className:`form-acts`,children:(0,G.jsx)(`button`,{className:`btn`,disabled:!y.trim()||F,onClick:q,children:`差异检查`})}),x?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`rp-full-colhead`,style:{marginTop:12},children:(0,G.jsx)(`span`,{children:`冲突方案`})}),(0,G.jsx)(`div`,{className:`rp-strategy`,children:[[`ours`,`保留本地`,`本地已有的不动,只新建缺失的`],[`overwrite`,`强制覆盖`,`用导入文件覆盖本地字段(key 不变)`],[`duplicate`,`另存新 key`,`为冲突项新建 key-import-1/2/3,两条并存`]].map(([e,t,n])=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,title:n,children:[(0,G.jsx)(`input`,{type:`radio`,name:`strategy`,checked:D===e,onChange:()=>O(e)}),(0,G.jsx)(`span`,{children:t})]},e))}),(0,G.jsx)(`div`,{className:`rp-full-colhead`,style:{marginTop:10},children:(0,G.jsx)(`span`,{children:`克隆`})}),(0,G.jsxs)(`select`,{value:k,onChange:e=>A(e.target.value),children:[(0,G.jsx)(`option`,{value:`none`,children:`不克隆,只登记`}),(0,G.jsx)(`option`,{value:`ref`,children:`克隆参考仓库`}),(0,G.jsx)(`option`,{value:`dev`,children:`克隆开发仓库`}),(0,G.jsx)(`option`,{value:`all`,children:`全部克隆`})]}),(0,G.jsx)(`div`,{className:`form-acts`,children:(0,G.jsxs)(`button`,{className:`btn`,disabled:F,onClick:ne,children:[`执行导入(已选 `,Object.values(C).filter(Boolean).length,`)`]})})]}):null,N?(0,G.jsxs)(`div`,{className:`rp-import-result`,children:[(0,G.jsxs)(`div`,{children:[`新建 `,N.created.length,` · 覆盖 `,N.updated.length,` · 另存 `,N.duplicated.length,` · 跳过 `,N.skipped.length]}),(0,G.jsxs)(`div`,{className:`muted`,children:[`看板 新建 `,N.boardsCreated,` / 合并 `,N.boardsMerged,` · 参考关系 `,N.links]}),N.cloned.length?(0,G.jsxs)(`div`,{children:[`克隆 `,N.cloned.length,` 个`]}):null,N.unmatched.length?(0,G.jsxs)(`div`,{className:`rp-layout-warn`,children:[`本地未拥有 `,N.unmatched.length,` 条(见下方差异表)`]}):null]}):null]}),(0,G.jsx)(`div`,{className:`rp-full-col rp-full-col-wide`,children:x?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`rp-full-colhead`,children:[(0,G.jsxs)(`span`,{children:[`差异(新增 `,ie.new,` · 有差异 `,ie.changed,` · 一致 `,ie.same,x.summary.missing?` · 本地未拥有 ${x.summary.missing}`:``,`)`]}),(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(`button`,{className:`rp-chip`+(j===``?` on`:``),onClick:()=>M(``),children:`全部`}),(0,G.jsx)(`button`,{className:`rp-chip`+(j===`new`?` on`:``),onClick:()=>M(`new`),children:`新增`}),(0,G.jsx)(`button`,{className:`rp-chip`+(j===`changed`?` on`:``),onClick:()=>M(`changed`),children:`有差异`}),(0,G.jsx)(`button`,{className:`rp-chip`+(j===`same`?` on`:``),onClick:()=>M(`same`),children:`一致`}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>X(!0),children:`全选`}),(0,G.jsx)(`button`,{className:`btn small ghost`,onClick:()=>X(!1),children:`全不选`})]})]}),(0,G.jsx)(`div`,{className:`rp-diff-table-wrap`,children:(0,G.jsxs)(`table`,{className:`rp-diff-table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{style:{width:`32px`}}),(0,G.jsx)(`th`,{style:{width:`90px`},children:`状态`}),(0,G.jsx)(`th`,{children:`仓库 key`}),(0,G.jsx)(`th`,{children:`差异字段`})]})}),(0,G.jsxs)(`tbody`,{children:[Y.map(e=>(0,G.jsxs)(`tr`,{className:`rp-diff-row `+(K[e.status]?.cls??``),children:[(0,G.jsx)(`td`,{children:(0,G.jsx)(`input`,{type:`checkbox`,disabled:e.status===`same`,checked:!!C[e.key],onChange:t=>w(n=>({...n,[e.key]:t.target.checked}))})}),(0,G.jsx)(`td`,{children:(0,G.jsx)(`span`,{className:`rp-status `+(K[e.status]?.cls??``),children:K[e.status]?.label})}),(0,G.jsxs)(`td`,{className:`mono rp-diff-key`,children:[e.key,e.status===`new`&&e.canClone?(0,G.jsx)(`span`,{className:`rp-can-clone`,title:`导入时可克隆`,children:`可克隆`}):null,e.status===`new`&&e.canClone?(0,G.jsx)(`button`,{className:`btn small ghost rp-clone-btn`,title:`现在就克隆到本地(用这个 key 登记 → 组里的占位自动补齐)`,disabled:F,onClick:()=>re(e.key,e.incoming?.remote||``),children:`克隆到本地`}):null]}),(0,G.jsx)(`td`,{className:`rp-diff-fields`,children:e.fields.length?e.fields.map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`b`,{children:e.field}),`: `,(0,G.jsx)(`span`,{className:`rp-was`,children:JSON.stringify(e.local)}),` → `,(0,G.jsx)(`span`,{className:`rp-now`,children:JSON.stringify(e.incoming)})]},e.field)):(0,G.jsx)(`span`,{className:`muted`,children:`—`})})]},e.key)),x.missing.map(e=>(0,G.jsxs)(`tr`,{className:`rp-diff-row missing`,children:[(0,G.jsx)(`td`,{}),(0,G.jsx)(`td`,{children:(0,G.jsx)(`span`,{className:`rp-status missing`,children:`本地未拥有`})}),(0,G.jsx)(`td`,{className:`mono rp-diff-key`,children:e}),(0,G.jsx)(`td`,{className:`rp-diff-fields muted`,children:`文件里被引用,但文件与本地都没有定义`})]},`miss-`+e))]})]})}),x.boards.length?(0,G.jsxs)(`div`,{className:`rp-diff-boards`,children:[(0,G.jsx)(`div`,{className:`rp-full-colhead`,children:(0,G.jsx)(`span`,{children:`看板`})}),x.boards.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!T[e.key],onChange:t=>E(n=>({...n,[e.key]:t.target.checked}))}),(0,G.jsx)(`span`,{className:`rp-status `+(K[e.status]?.cls??``),children:K[e.status]?.label}),(0,G.jsx)(`span`,{children:e.key}),(0,G.jsxs)(`span`,{className:`muted`,children:[`(`,e.incoming.repos.length,` 个成员`,e.missingMembers?.length?`,本地未拥有 ${e.missingMembers.length}`:``,`)`]})]},e.key)),x.boards.flatMap(e=>e.missingMembers||[]).map(e=>(0,G.jsxs)(`div`,{className:`rp-missing-item`,children:[(0,G.jsx)(`span`,{className:`rp-status missing`,children:`本地未拥有`}),(0,G.jsx)(`span`,{className:`mono rp-missing-key`,children:e.key}),e.remote?(0,G.jsx)(`span`,{className:`muted rp-missing-remote`,title:e.remote,children:e.remote}):null,e.clonable?(0,G.jsx)(`button`,{className:`btn small`,disabled:F,onClick:()=>re(e.key,e.remote),children:`克隆到本地`}):(0,G.jsx)(`span`,{className:`muted`,title:`没有远程地址 —— 自行创建后用 repo key set 指定同一个 key`,children:`需手工创建`})]},e.key))]}):null]}):(0,G.jsx)(`div`,{className:`muted rp-full-empty`,children:`粘贴或选择一份布局 JSON,点「差异检查」后在这里逐条查看与勾选。`})})]})]})})}var q=10;function ne({repo:e,onClose:n,onSaved:r}){let i=R(),o=t(),s=e.getLoop&&typeof e.getLoop==`object`?e.getLoop:null,[c,l]=(0,W.useState)(!!(s&&s.enabled)),[u,d]=(0,W.useState)(s&&s.waitMinutes!==void 0&&s.waitMinutes!==null?String(s.waitMinutes):String(q)),[p,m]=(0,W.useState)(!1),h=e=>{let t=String(e??``).trim();if(t===``)return q;let n=Number(t);return Number.isFinite(n)&&n>=0?Math.min(Math.floor(n),600):q},g=async t=>{m(!0);try{let n=t&&t.enabled!==void 0?t.enabled:c;await f(e.id,{"get-loop":n?`on`:`off`,...n?{"get-loop-minutes":h(u)}:{}});let a=h(u);o(n?`已保存「${e.name}」的持续 get 设置(${a>0?`${a} 分钟阻塞窗口`:`不阻塞,没活立即返回`})`:`已关闭「${e.name}」的持续 get`),i.refreshRepos&&i.refreshRepos(),r&&r()}catch(e){o(String(e.message||e))}finally{m(!1)}},_=async e=>{l(e),await g({enabled:e})};return(0,G.jsx)(a,{title:`持续 get · ${e.name}`,onClose:n,size:`md`,children:(0,G.jsxs)(`div`,{className:`rp-gl`,children:[(0,G.jsxs)(`div`,{className:`rp-gl-head`,children:[(0,G.jsxs)(`div`,{className:`rp-gl-title`,children:[(0,G.jsx)(`span`,{className:`rp-gl-name`,children:`持续 get`}),(0,G.jsx)(`span`,{className:`rp-gl-desc`,children:`无任务时阻塞等待新任务回填(waitgoal)`})]}),(0,G.jsxs)(`button`,{className:`toggle`+(c?` on`:``),onClick:()=>_(!c),disabled:p,children:[(0,G.jsx)(`span`,{className:`dot`}),c?`开`:`关`]})]}),c&&(0,G.jsxs)(`div`,{className:`rp-gl-body`,children:[(0,G.jsxs)(`div`,{className:`rp-gl-row`,children:[(0,G.jsx)(`span`,{children:`阻塞窗口`}),(0,G.jsxs)(`span`,{className:`rp-gl-unit`,children:[(0,G.jsx)(`input`,{className:`rp-gl-min`,value:u,onChange:e=>d(e.target.value),inputMode:`numeric`,title:`0 = 不阻塞:没任务时 get 立即返回 timeout`}),`分钟`]})]}),(0,G.jsx)(`div`,{className:`rp-gl-note`,children:`这里只决定没有任务时 get 最多阻塞多久(0 = 不阻塞,立即返回 timeout)。领到任务后那段「继续 get 直到 timeout」的提示词是全局的,只有一份:要改文案去 设置 → 提示词模板 → 持续 get。`}),(0,G.jsxs)(`div`,{className:`rp-gl-acts`,children:[(0,G.jsx)(`span`,{className:`spacer`}),(0,G.jsx)(D,{variant:`primary`,disabled:p,onClick:()=>g(),children:`保存持续 get 设置`})]})]})]})})}function J({path:e}){let t=String(e||``),n=t.replace(/\\/g,`/`).lastIndexOf(`/`);return n<0?(0,G.jsx)(w,{text:t,title:void 0,children:t}):(0,G.jsxs)(w,{text:t,title:`点击复制完整路径`,children:[(0,G.jsx)(`span`,{className:`anc`,children:t.slice(0,n)}),t.slice(n)]})}function Y({docs:e,onOpen:t}){let n=e&&e.main,r=e&&e.links||[],i=+!!n+r.length,a=n&&n.exists?[n.title,n.summary&&`摘要:${n.summary}`].filter(Boolean).join(`
|
|
2
|
+
`):`查看完整文档列表(主篇 / 补充 / reference / 组内),可就地编辑`,o=(e,t)=>e.title||e.desc||`第 ${t+1} 篇`,s=[];return n&&n.exists&&s.push({id:`main`,label:o(n,0),kind:`repo`,main:!0,title:n.title||n.summary||``}),r.forEach((e,t)=>{s.push({id:(e.docId||e.refId||`link`)+`:`+t,label:o(e,t),kind:`repo`,note:e.note||``,title:[e.title||e.desc,e.note&&`备注:${e.note}`].filter(Boolean).join(`
|
|
3
|
+
`)})}),(0,G.jsxs)(`div`,{className:`rp-docs-entry`,role:`button`,tabIndex:0,title:a,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t()},children:[s.length?(0,G.jsx)(B,{items:s,onMore:t}):(0,G.jsx)(`span`,{className:`rp-docs-entry-main ghost`,children:`+ 写项目介绍`}),(0,G.jsx)(`span`,{className:`rp-docs-entry-n`,children:i>0?`${i} 篇 · 查看详情`:`查看详情`})]})}function re({chips:e,acts:t}){let[n,r]=(0,W.useState)(!1),i=n?e:e.slice(0,4);return(0,G.jsxs)(G.Fragment,{children:[i.map(e=>(0,G.jsx)(`span`,{className:`rp-link-chip rp-link-chip-repo`,children:(0,G.jsxs)(`button`,{className:`rp-link-chip-main`,title:[`本仓库直接绑定的参考仓库`,e.note,`点击跳到这个参考仓库`].filter(Boolean).join(`
|
|
4
|
+
`),onClick:()=>t.gotoRefRepo(e.key),children:[(0,G.jsx)(`b`,{children:`自`}),(0,G.jsx)(`span`,{className:`rp-link-chip-name`,children:e.name})]})},e.key)),e.length>4?(0,G.jsx)(`button`,{className:`rp-bind-more`,title:`展开本行全部参考仓库`,onClick:()=>r(e=>!e),children:n?`收起`:`+${e.length-4}`}):null]})}function X({r:e,showRef:t,showGroups:n,filterBoard:r,refRepoChipsByRepo:i,acts:a}){let o=i.get(e.key)||[];return(0,G.jsxs)(`tr`,{id:`rp-row-`+e.key,children:[(0,G.jsxs)(`td`,{className:`rp-name`,children:[(0,G.jsxs)(`strong`,{children:[e.icon?(0,G.jsx)(`span`,{className:`rp-icon`,"aria-hidden":!0,children:e.icon}):null,e.name,e.getLoop&&e.getLoop.enabled?(0,G.jsx)(`span`,{className:`rp-gl-dot`,title:`持续 get 已开启(${Number(e.getLoop.waitMinutes)>0?`${Number(e.getLoop.waitMinutes)} 分钟阻塞窗口`:`不阻塞,没活立即返回`})`,"aria-label":`持续 get 已开启`}):null]}),(0,G.jsx)(`span`,{className:`mono rp-name-path`,children:(0,G.jsx)(J,{path:e.path})})]}),(0,G.jsx)(`td`,{className:`rp-cell-docs`,children:(0,G.jsx)(Y,{docs:e.descDocs,onOpen:()=>a.docs(e)})}),t?(0,G.jsxs)(`td`,{className:`rp-refs`,children:[o.length?(0,G.jsx)(re,{chips:o,acts:a}):(0,G.jsx)(`span`,{className:`muted rp-refs-none`,children:`—`}),(0,G.jsx)(D,{small:!0,className:`rp-ref-bind`,title:`管理这个仓库所属组的参考仓库`,onClick:()=>a.bind(e),children:`绑定`})]}):null,n?(0,G.jsx)(`td`,{className:`rp-cell-groups`,children:(e.boards||[]).length?(0,G.jsx)(z,{moreTitle:`展开本行全部所属分组`,children:(e.boards||[]).map(e=>(0,G.jsx)(`button`,{className:`rp-group-chip`+(r?.id===e.id?` on`:``),title:`只看「${e.name}」${e.note?`\n组内描述:${e.note}`:``}`,onClick:()=>a.filter(e.id),children:e.name},e.id))}):(0,G.jsx)(`span`,{className:`muted rp-refs-none`,children:`—`})}):null,(0,G.jsx)(`td`,{className:`rp-acts`,children:(0,G.jsx)(U,{kind:`repos-row`,renderers:{edit:()=>(0,G.jsx)(D,{small:!0,onClick:()=>a.edit(e),children:`编辑`}),open:()=>(0,G.jsx)(D,{small:!0,title:`在文件管理器中打开`,onClick:()=>a.open(e),children:`打开`}),del:()=>(0,G.jsx)(D,{small:!0,danger:!0,onClick:()=>a.del(e),children:`删除`}),getloop:()=>(0,G.jsx)(D,{small:!0,title:`持续 get(waitgoal)配置`,onClick:()=>a.getloop(e),children:(0,G.jsxs)(`span`,{className:`rp-gl-menu-it`,children:[e.getLoop&&e.getLoop.enabled?(0,G.jsx)(`span`,{className:`rp-gl-dot`,"aria-hidden":!0}):null,`持续 get…`]})}),remote:()=>(0,G.jsx)(D,{small:!0,onClick:()=>a.remote(e),children:`对齐 remote`})},actions:{edit:()=>a.edit(e),open:()=>a.open(e),del:()=>a.del(e),getloop:()=>a.getloop(e),remote:()=>a.remote(e)},titles:{getloop:`持续 get(waitgoal)配置`,remote:`key 与远程 git 地址对齐`,del:`删除仓库登记(磁盘文件不受影响)`}})})]})}function ie({shown:e,devRepos:t,filterBoard:n,refRepoChipsByRepo:r,acts:i,onAddMember:a}){let o=!n,s=!n;return(0,G.jsx)(`div`,{className:`rp-table-wrap`,id:`rp-repos`,children:(0,G.jsxs)(`table`,{className:`rp-table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{scope:`col`,style:{width:`16%`},children:`仓库`}),(0,G.jsxs)(`th`,{scope:`col`,style:{width:`36%`},children:[`文档`,(0,G.jsx)(`span`,{className:`rp-th-hint`,children:`主篇标题 · 查看详情打开完整文档列表`})]}),o?(0,G.jsx)(`th`,{scope:`col`,style:{width:`18%`},children:`参考仓库`}):null,s?(0,G.jsx)(`th`,{scope:`col`,style:{width:`14%`},children:`分组`}):null,(0,G.jsx)(`th`,{scope:`col`,style:{width:`250px`},children:`操作`})]})}),(0,G.jsxs)(`tbody`,{children:[e.map(e=>(0,G.jsx)(X,{r:e,showRef:o,showGroups:s,filterBoard:n,refRepoChipsByRepo:r,acts:i},e.id)),e.length?null:(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:3+ +!!o+ +!!s,className:`muted rp-empty`,children:t.length?(0,G.jsxs)(G.Fragment,{children:[`这个分组还没有成员`,` `,n?(0,G.jsx)(D,{small:!0,onClick:()=>a(n.id),children:`添加成员`}):null]}):`还没有登记开发仓库 —— 点右上「登记仓库」加一条。`})})]})]})})}function ae({boards:e,filter:t,onFilter:n,devCount:r,shownCount:i,q:a,onQ:o,onOpenDocs:s}){return(0,G.jsxs)(`div`,{className:`rp-filters`,"data-testid":`rp-filters`,children:[(0,G.jsxs)(`div`,{className:`rp-filters-main`,children:[(0,G.jsxs)(`button`,{className:`rp-chip`+(t?``:` on`),onClick:()=>n(``),title:`显示全部开发仓库`,children:[`全部 `,(0,G.jsx)(`b`,{children:r})]}),e.map(e=>(0,G.jsxs)(`button`,{className:`rp-chip`+(t===e.id?` on`:``),onClick:()=>n(t===e.id?``:e.id),title:`只看「${e.name}」里的仓库(${(e.repos||[]).length} 个)`,children:[e.name,` `,(0,G.jsx)(`b`,{children:(e.repos||[]).length})]},e.id))]}),(0,G.jsxs)(`div`,{className:`rp-filters-side`,children:[(0,G.jsx)(`input`,{className:`rp-search`,type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:`搜仓库 / 路径 / 分组 / 文档…`,"aria-label":`检索仓库与文档`}),a?(0,G.jsx)(D,{small:!0,onClick:()=>o(``),children:`清空`}):null,(0,G.jsxs)(`span`,{className:`muted rp-search-count`,children:[i,` / `,r]}),(0,G.jsx)(D,{small:!0,title:`按仓库 / 组内 / 分组三档检索文档`,onClick:s,children:`文档检索`})]})]})}function oe({filterBoard:e,refRepos:t,checkOf:n,onOpenDoc:r,onOpenRefDocs:i,onAddMember:a,onSync:o,onOpen:s,onUnbind:c}){let l=(0,W.useMemo)(()=>{if(!e)return[];let n=new Map(t.map(e=>[e.key,e]));return(e.refs||[]).map(e=>n.get(e.id)||null).filter(e=>e!==null)},[t,e]),[u,d]=(0,W.useState)(null);(0,W.useEffect)(()=>{d(null)},[e?e.id:null]);let f=u===null?l.length<=8:u;return e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`rp-context`,"data-testid":`rp-context`,children:[(0,G.jsx)(`span`,{className:`rp-context-name`,children:e.name}),e.desc?(0,G.jsx)(`span`,{className:`rp-context-desc`,title:e.desc,children:e.desc}):(0,G.jsx)(`span`,{className:`muted rp-context-desc`,children:`还没有领域描述 —— 点「文档列表」新建一篇组介绍:侧重什么、谁配合谁、关键路径与搜索关键词在哪。`}),(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(D,{small:!0,title:`在右侧栏列出这个组的文档(组 → 组内仓库 → 仓库自己)`,onClick:()=>r(e),children:`文档列表`}),(0,G.jsx)(`a`,{className:`btn small ghost`,href:`#/group/`+encodeURIComponent(e.id),title:`组页里看这个组的成员与任务`,children:`组页 ↗`}),(0,G.jsx)(D,{small:!0,onClick:()=>a(e.id),children:`添加成员`})]})]}),(0,G.jsxs)(`div`,{className:`rp-ref-mounted`,"data-testid":`rp-board-refs`,children:[(0,G.jsxs)(`div`,{className:`rp-ref-mounted-head`,children:[(0,G.jsxs)(`span`,{className:`rp-ref-mounted-label`,children:[`「`,e.name,`」的参考仓库 `,(0,G.jsx)(`b`,{children:l.length})]}),(0,G.jsx)(`span`,{className:`muted`,children:`绑定在组上:组内所有仓库共享,不区分来源仓库`}),l.length?(0,G.jsx)(D,{small:!0,className:`rp-ref-mounted-toggle`,title:f?`收起这个组的参考仓库清单`:`展开这个组的参考仓库清单`,onClick:()=>d(!f),children:f?`收起`:`展开 ${l.length}`}):null]}),l.length?f?l.map(t=>{let r=n.get(t.id);return(0,G.jsxs)(`div`,{className:`rp-ref-mounted-item`,children:[(0,G.jsx)(`span`,{className:`rp-ref-dot`+(r?r.ok?` ok`:` bad`:``),title:r?r.ok?`检查通过`:(r.issues||[]).join(`
|
|
5
|
+
`):`尚未检查`}),(0,G.jsx)(w,{text:t.remote||t.name,title:`点击复制远程地址`,className:`rp-ref-mounted-name`,children:t.name}),(0,G.jsx)(Y,{docs:t.descDocs,onOpen:()=>i(t)}),t.desc?(0,G.jsx)(`span`,{className:`muted rp-ref-mounted-desc`,title:t.desc,children:t.desc}):null,(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(D,{small:!0,onClick:()=>o(t),children:`同步`}),(0,G.jsx)(D,{small:!0,onClick:()=>s(t),children:`打开`}),(0,G.jsx)(D,{small:!0,danger:!0,title:`只从本组摘除(不影响其它组)`,onClick:()=>c(t,e.id),children:`移出本组`})]})]},t.id)}):null:(0,G.jsx)(`div`,{className:`muted rp-refs-none`,children:`这个组还没有绑定的参考仓库 —— 在下方参考仓库面板里点「绑定」勾选本组。`})]})]}):null}function se({boards:e,devRepos:n,refRepos:a,reload:o}){let s=r(),c=t(),{dialog:u,node:d}=i(),f=(0,W.useMemo)(()=>{let t=new Map;for(let e of[...n,...a]){let n=String(e.path||``).split(/[\\/]/).filter(Boolean).pop()||``;for(let r of[e.name,n]){let n=String(r||``).toLowerCase();n&&!t.has(n)&&t.set(n,e)}}let r=[];for(let n of e&&e.boards||[])for(let e of n.repos||[]){if(e.present!==!1)continue;let i=String(e.key||``).split(`/`).filter(Boolean).pop()||``,a=t.get(String(e.name||``).toLowerCase())||t.get(i.toLowerCase())||null;r.push({...e,board:n.name,boardId:n.id,match:a})}return r},[e,n,a]),p=e=>s(async()=>{await O({remote:e.remote,key:e.key,name:e.name||void 0,type:`dev`}),c(`已克隆并登记:${e.name||e.key}`),o.repos(),o.boards()}),m=(e,t)=>s(async()=>{await l({from:e.key,to:t}),c(`已把「${e.name||e.key}」这个位置接到本机仓库`),o.repos(),o.boards()}),h=e=>s(async()=>{let t=await u({title:`把「${e.name||e.key}」接到哪个本机仓库?`,input:!0,placeholder:`本机仓库:id / key / 名称 / 绝对路径`});t&&(await l({from:e.key,to:t}),c(`已重绑——这个位置现在指向本机仓库`),o.repos(),o.boards())}),g=e=>s(async()=>{confirm(`把「${e.name||e.key}」从组「${e.board}」里移除?\n\n只摘这个组里的位置:本机仓库与看板本身都不动。`)&&(await A({key:e.key,board:e.boardId,remove:!0}),c(`已从组「${e.board}」移除`),o.boards())});return f.length?(0,G.jsxs)(`section`,{className:`rp-pending`,"data-testid":`rp-pending-init`,children:[(0,G.jsxs)(`header`,{className:`rp-pending-head`,children:[(0,G.jsxs)(`div`,{className:`rp-pending-head-main`,children:[(0,G.jsxs)(`h3`,{children:[`待初始化`,(0,G.jsx)(`span`,{className:`rp-pending-count`,children:f.length})]}),(0,G.jsx)(`p`,{children:`组里有位置、本机没有登记。接到本机仓库、克隆下来,或者直接移除。`})]}),(0,G.jsx)(D,{small:!0,onClick:()=>s(async()=>{let e=await _({apply:!1});if(!e?.total){c(`没有可清理的占位(有远程地址的那些留着等 clone)`);return}let t=e.items.map(e=>`· ${e.name}(组 ${e.board})`).join(`
|
|
6
|
+
`);confirm(`清理 ${e.total} 个无来源占位?\n\n${t}\n\n它们没有远程地址,克隆不回来,只能删。`)&&(await _({apply:!0}),c(`已清理 ${e.total} 个占位`),o.boards())}),children:`清理无来源占位`})]}),(0,G.jsx)(`div`,{className:`rp-pending-list`,children:f.map(e=>(0,G.jsxs)(`article`,{className:`rp-pending-card`,children:[(0,G.jsxs)(`div`,{className:`rp-pending-info`,children:[(0,G.jsxs)(`div`,{className:`rp-pending-title`,children:[(0,G.jsx)(`strong`,{children:e.name||e.key}),(0,G.jsxs)(`span`,{className:`rp-pending-board`,children:[`组 · `,e.board]}),e.remote?null:(0,G.jsx)(`span`,{className:`rp-pending-tag`,children:`无远程地址`})]}),(0,G.jsx)(`code`,{className:`rp-pending-key`,children:e.key}),e.desc?(0,G.jsx)(`p`,{className:`rp-pending-desc`,children:e.desc}):null]}),(0,G.jsxs)(`div`,{className:`rp-pending-acts`,children:[e.match?(0,G.jsxs)(D,{small:!0,title:`把组里这个位置指向本机仓库「${e.match.name}」(仓库身份不变)`,onClick:()=>e.match&&m(e,e.match.id),children:[`绑定到「`,e.match.name,`」`]}):null,e.remote?(0,G.jsx)(D,{small:!0,onClick:()=>p(e),children:`克隆到本地`}):null,(0,G.jsx)(D,{small:!0,onClick:()=>h(e),children:`选本机仓库`}),(0,G.jsx)(D,{small:!0,danger:!0,title:`只从组里摘掉这个位置,本机仓库与看板都不动`,onClick:()=>g(e),children:`移除`})]})]},e.key+`@`+e.boardId))}),d]}):null}function ce({refRepos:e,devRepos:n,boardList:i,checkOf:o,refRepoBackLinks:s,refBindOpen:c,onRefBindOpen:l,onClose:u,onSyncOne:f,onUnbind:m,onUnbindRepo:h,onGoBind:g,onDocs:_,onRowAct:v,reload:b}){let x=r(),S=t(),[T,E]=(0,W.useState)(null),[O,k]=(0,W.useState)(!1),[A,j]=(0,W.useState)({gitRepoRoot:``,gitDevRoot:``}),[M,N]=(0,W.useState)(!1),[P,F]=(0,W.useState)({url:``,name:``,desc:``,depth:`1`}),[L,R]=(0,W.useState)({}),[z,B]=(0,W.useState)(null),[V,H]=(0,W.useState)({}),U=(0,W.useCallback)(async()=>{E(await y().catch(()=>null))},[]);(0,W.useEffect)(()=>{U()},[U]);let ee=()=>x(async()=>{let e={};A.gitRepoRoot.trim()&&(e.gitRepoRoot=A.gitRepoRoot.trim()),A.gitDevRoot.trim()&&(e.gitDevRoot=A.gitDevRoot.trim()),Object.keys(e).length&&(E(await d(e)),k(!1),S(`已保存存储根目录`))}),K=()=>x(async()=>{let e=P.url.trim();if(!e)return;let t={url:e,name:P.name.trim()||void 0,desc:P.desc.trim()||void 0,depth:parseInt(P.depth,10)||1,"no-bind":!0},r=n.filter(e=>L[`repo:`+e.id]).map(e=>e.id),a=i.filter(e=>L[`board:`+e.id]).map(e=>e.id);r.length&&(t.bind=r),a.length&&(t.board=a);let o=await I(t);N(!1),F({url:``,name:``,desc:``,depth:`1`}),R({}),S(`已克隆: ${o.name} → ${o.dest||o.path}`),await b.all()}),te=()=>x(async()=>{let e=await p({all:!0}),t=e.results.filter(e=>e.status!==`updated`&&e.status!==`upToDate`);S(`同步 ${e.synced} 个${t.length?`,${t.length} 个有问题(见检查结果)`:`,全部完成`}`),await b.refCheck()}),q=e=>e.key||`board/${e.name}`,ne=e=>{let t={};for(let n of i)(n.refs||[]).some(t=>t.id===e.key)&&(t[`board:`+q(n)]=!0);for(let r of n)(r.linked||[]).some(t=>t&&t.kind===`ref`&&String(t.id)===e.key)&&(t[`repo:`+r.key]=!0);H(t),B(e)};return(0,G.jsxs)(a,{size:`wide`,title:`参考仓库 · ${e.length}`,onClose:u,children:[(0,G.jsx)(`div`,{className:`rp-modal-bar`,children:(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(D,{small:!0,onClick:()=>{R({}),N(!0)},children:`克隆参考仓库`}),(0,G.jsx)(D,{small:!0,onClick:te,children:`同步全部`}),(0,G.jsx)(D,{small:!0,onClick:b.refCheck,children:`检查`}),(0,G.jsx)(D,{small:!0,onClick:()=>{j({gitRepoRoot:T?.gitRepoRoot||``,gitDevRoot:T?.gitDevRoot||``}),k(!0)},children:`存储根`})]})}),T?.gitRepoRoot?null:(0,G.jsx)(`div`,{className:`rp-ref-warn`,children:`存储根未设置 —— 克隆会被拒绝。点「存储根」设一个非 C 盘目录(参考仓库体积不小,别放系统盘)。`}),(0,G.jsx)(`div`,{className:`rp-ref-table-wrap`,children:(0,G.jsxs)(`table`,{className:`rp-ref-table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{scope:`col`,style:{width:`30px`}}),(0,G.jsx)(`th`,{scope:`col`,style:{width:`17%`},children:`参考仓库`}),(0,G.jsx)(`th`,{scope:`col`,style:{width:`22%`},children:`远程地址`}),(0,G.jsx)(`th`,{scope:`col`,children:`绑定对象(仓库组 / 单独仓库 · 点击跳转)`}),(0,G.jsx)(`th`,{scope:`col`,style:{width:`220px`},children:`操作`})]})}),(0,G.jsxs)(`tbody`,{children:[e.map(e=>{let t=o.get(e.id),n=i.map(t=>{let n=(t.refs||[]).find(t=>t.id===e.key);return n?{board:t,note:n.note||``}:null}).filter(e=>e!==null);return(0,G.jsxs)(`tr`,{id:`rp-refrepo-row-`+e.key,children:[(0,G.jsx)(`td`,{children:(0,G.jsx)(`span`,{className:`rp-ref-dot`+(t?t.ok?` ok`:` bad`:``),title:t?t.ok?`检查通过`:(t.issues||[]).join(`
|
|
7
|
+
`):`尚未检查`})}),(0,G.jsxs)(`td`,{className:`rp-ref-cell-name`,children:[(0,G.jsx)(`strong`,{children:e.name}),(0,G.jsx)(Y,{docs:e.descDocs,onOpen:()=>_(e)})]}),(0,G.jsx)(`td`,{className:`mono rp-ref-cell-remote`,children:(0,G.jsx)(w,{text:e.remote||``,title:`点击复制远程地址`,children:e.remote||`(无)`})}),(0,G.jsx)(`td`,{className:`rp-ref-cell-links`,children:(()=>{let t=n,r=s.get(e.key)||[];if(!t.length&&!r.length)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`muted rp-refs-none`,children:`未绑定`}),(0,G.jsx)(D,{small:!0,className:`rp-ref-bind`,onClick:()=>ne(e),children:`绑定…`})]});let i=!!c[e.id],a=i?t:t.slice(0,4),o=i?r:r.slice(0,4),u=t.length>4||r.length>4;return(0,G.jsxs)(G.Fragment,{children:[t.length?(0,G.jsxs)(`div`,{className:`rp-bind-row`,children:[(0,G.jsx)(`span`,{className:`rp-bind-label`,children:`仓库组`}),a.map(t=>(0,G.jsxs)(`span`,{className:`rp-link-chip rp-link-chip-group`,children:[(0,G.jsxs)(`button`,{className:`rp-link-chip-main`,title:[`点击跳到这个组`,`组级绑定(组内共享)`].join(`
|
|
8
|
+
`),onClick:()=>g(`board`,t.board.id),children:[(0,G.jsx)(`b`,{children:`组`}),(0,G.jsx)(`span`,{className:`rp-link-chip-name`,children:t.board.name})]}),(0,G.jsx)(`button`,{className:`rp-link-chip-x`,title:`从本组摘除(不影响其它组、也不动仓库级绑定)`,onClick:()=>m(e,t.board.id),children:`×`})]},`board:`+t.board.id)),!i&&t.length>4?(0,G.jsxs)(`button`,{className:`rp-bind-more`,title:`展开本行全部绑定`,onClick:()=>l(t=>({...t,[e.id]:!0})),children:[`+`,t.length-4]}):null]}):null,r.length?(0,G.jsxs)(`div`,{className:`rp-bind-row`,children:[(0,G.jsx)(`span`,{className:`rp-bind-label`,children:`仓库`}),o.map(t=>(0,G.jsxs)(`span`,{className:`rp-link-chip rp-link-chip-repo`,children:[(0,G.jsxs)(`button`,{className:`rp-link-chip-main`,title:[t.note||`直接绑定到这个仓库(不经过组)`,`仓库 key: ${t.repo.key}`,`点击定位到仓库行`].join(`
|
|
9
|
+
`),onClick:()=>g(`repo`,t.repo.key),children:[(0,G.jsx)(`b`,{children:`仓`}),(0,G.jsx)(`span`,{className:`rp-link-chip-name`,children:t.repo.name}),(0,G.jsx)(`span`,{className:`mono rp-link-chip-key`,children:t.repo.key})]}),t.note?(0,G.jsx)(`i`,{className:`rp-link-chip-note`,title:t.note,children:t.note.split(`
|
|
10
|
+
`)[0]}):null,(0,G.jsx)(`button`,{className:`rp-link-chip-x`,title:`从这个仓库摘除(不影响组级绑定)`,onClick:()=>h(e,t.repo.key),children:`×`})]},`repo:`+t.repo.key)),!i&&r.length>4?(0,G.jsxs)(`button`,{className:`rp-bind-more`,title:`展开本行全部绑定`,onClick:()=>l(t=>({...t,[e.id]:!0})),children:[`+`,r.length-4]}):null]}):null,u?(0,G.jsx)(`button`,{className:`rp-bind-toggle`,onClick:()=>l(t=>({...t,[e.id]:!i})),children:i?`收起`:`展开全部 ${t.length+r.length}`}):null,(0,G.jsx)(D,{small:!0,className:`rp-ref-bind`,onClick:()=>ne(e),children:`绑定…`})]})})()}),(0,G.jsxs)(`td`,{className:`rp-acts`,children:[(0,G.jsx)(D,{small:!0,onClick:()=>f(e),children:`同步`}),(0,G.jsx)(D,{small:!0,onClick:()=>v(`open`,e),children:`打开`}),(0,G.jsx)(D,{small:!0,onClick:()=>v(`edit`,e),children:`编辑`}),(0,G.jsx)(D,{small:!0,danger:!0,onClick:()=>v(`del`,e),children:`删除`})]})]},e.id)}),e.length?null:(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:5,className:`muted rp-empty`,children:`还没有参考仓库 —— 点「克隆参考仓库」抓一个远程仓库下来(或用 CLI: nx-kv repo ref clone <url>)。`})})]})]})}),M?(0,G.jsx)(a,{title:`克隆参考仓库`,onClose:()=>{N(!1),R({})},children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`ref-url`,children:`远程 git 地址 *`}),(0,G.jsx)(`input`,{id:`ref-url`,spellCheck:`false`,placeholder:`git@github.com:lib/x.git 或 https://github.com/lib/x`,value:P.url,onChange:e=>F(t=>({...t,url:e.target.value}))})]}),(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`ref-name`,children:`名称`}),(0,G.jsx)(`input`,{id:`ref-name`,placeholder:`留空则用 URL 末段`,value:P.name,onChange:e=>F(t=>({...t,name:e.target.value}))})]}),(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`ref-desc`,children:`它参考什么`}),(0,G.jsx)(`input`,{id:`ref-desc`,spellCheck:`false`,placeholder:`如:liquid glass 的官方实现参考`,value:P.desc,onChange:e=>F(t=>({...t,desc:e.target.value}))})]}),(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{children:`克隆后绑定到(可多选)`}),(0,G.jsxs)(`div`,{className:`rp-pick-list`,children:[(0,G.jsxs)(`div`,{className:`rp-pick-group`,children:[(0,G.jsx)(`span`,{className:`rp-pick-group-label`,children:`开发仓库`}),n.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!L[`repo:`+e.id],onChange:t=>R(n=>({...n,[`repo:`+e.id]:t.target.checked}))}),(0,G.jsx)(`span`,{title:e.path,children:e.name})]},e.id)),n.length?null:(0,G.jsx)(`span`,{className:`muted`,children:`(还没有开发仓库)`})]}),(0,G.jsxs)(`div`,{className:`rp-pick-group`,children:[(0,G.jsx)(`span`,{className:`rp-pick-group-label`,children:`看板(项目组)`}),i.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!L[`board:`+e.id],onChange:t=>R(n=>({...n,[`board:`+e.id]:t.target.checked}))}),(0,G.jsx)(`span`,{title:e.desc||``,children:e.name})]},e.id)),i.length?null:(0,G.jsx)(`span`,{className:`muted`,children:`(还没有看板)`})]})]}),(0,G.jsx)(`div`,{className:`form-hint`,children:`一个参考可同时服务多个仓库/组;之后随时在「绑定…」里增删。`})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:()=>{N(!1),R({})},children:`取消`}),(0,G.jsx)(D,{disabled:!P.url.trim()||!T?.gitRepoRoot,title:T?.gitRepoRoot?`克隆到 ${T.gitRepoRoot}`:`先在「存储根」设置 gitRepoRoot`,onClick:K,children:`克隆`})]})]})}):null,z?(0,G.jsx)(a,{title:`绑定 · ${z.name}`,onClose:()=>B(null),children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`div`,{className:`form-hint`,children:`两类绑定并存、互不折算:勾「仓库组」= 组内共享(group_refs);勾「开发仓库」= 只绑这一个仓库(仓库级)。 取消勾选 = 摘除该维度(保存时对比差异)。`}),(0,G.jsxs)(`div`,{className:`rp-pick-list`,children:[(0,G.jsxs)(`div`,{className:`rp-pick-group`,children:[(0,G.jsx)(`span`,{className:`rp-pick-group-label`,children:`仓库组`}),i.map(e=>{let t=q(e);return(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!V[`board:`+t],onChange:e=>H(n=>({...n,[`board:`+t]:e.target.checked}))}),(0,G.jsx)(`span`,{title:e.desc||``,children:e.name})]},e.id)}),i.length?null:(0,G.jsx)(`span`,{className:`muted`,children:`(还没有看板)`})]}),(0,G.jsxs)(`div`,{className:`rp-pick-group`,children:[(0,G.jsx)(`span`,{className:`rp-pick-group-label`,children:`开发仓库(单独绑定)`}),n.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!V[`repo:`+e.key],onChange:t=>H(n=>({...n,[`repo:`+e.key]:t.target.checked}))}),(0,G.jsx)(`span`,{title:e.path,children:e.name}),(0,G.jsx)(`span`,{className:`muted mono rp-pick-desc`,children:e.key})]},e.id)),n.length?null:(0,G.jsx)(`span`,{className:`muted`,children:`(还没有开发仓库)`})]})]})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:()=>B(null),children:`取消`}),(0,G.jsx)(D,{onClick:()=>x(async()=>{if(!z)return;let e=e=>i.find(t=>q(t)===e.slice(6)),t=new Set([...i.filter(e=>(e.refs||[]).some(e=>e.id===z.key)).map(e=>`board:`+q(e)),...n.filter(e=>(e.linked||[]).some(e=>e&&e.kind===`ref`&&String(e.id)===z.key)).map(e=>`repo:`+e.key)]),r=new Set(Object.keys(V).filter(e=>V[e]));for(let n of r)if(!t.has(n)){if(n.startsWith(`board:`)){let t=e(n);if(!t)continue;await C({id:z.key,board:[t.id]})}else await C({id:z.key,repo:[n.slice(5)]})}for(let n of t)if(!r.has(n)){if(n.startsWith(`board:`)){let t=e(n);if(!t)continue;await C({id:z.key,board:[t.id],remove:!0})}else await C({id:z.key,repo:[n.slice(5)],remove:!0})}B(null),await Promise.all([b.repos(),b.boards(),b.refCheck()])}),children:`保存绑定`})]})]})}):null,O?(0,G.jsx)(a,{title:`参考仓库存储根`,onClose:()=>k(!1),children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`roots-ref`,children:`参考仓库存储根(gitRepoRoot)`}),(0,G.jsx)(`input`,{id:`roots-ref`,spellCheck:`false`,placeholder:`如 D:/gitrepo-ref(非 C 盘)`,value:A.gitRepoRoot,onChange:e=>j(t=>({...t,gitRepoRoot:e.target.value}))}),(0,G.jsx)(`div`,{className:`form-hint`,children:`repo ref clone 的落盘位置。不设 = 克隆被拒绝。`})]}),(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`roots-dev`,children:`开发仓库克隆根(gitDevRoot,可选)`}),(0,G.jsx)(`input`,{id:`roots-dev`,spellCheck:`false`,placeholder:`导入布局时开发仓库克隆到哪里`,value:A.gitDevRoot,onChange:e=>j(t=>({...t,gitDevRoot:e.target.value}))})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:()=>k(!1),children:`取消`}),(0,G.jsx)(D,{onClick:ee,children:`保存`})]})]})}):null]})}function le({repos:e,boardList:n,onClose:o,onFilter:s,reload:c}){let l=r(),u=t(),{dialog:d,node:f}=i(),{openByDocId:p}=V(),[m,h]=(0,W.useState)([]),[g,_]=(0,W.useState)([]),[v,y]=(0,W.useState)(`all`),[b,x]=(0,W.useState)(``),C=(0,W.useCallback)(async()=>{let[e,t]=await Promise.all([S().catch(()=>null),E().catch(()=>null)]);h(e&&e.docs||[]),_(t&&t.bindings||[])},[]);(0,W.useEffect)(()=>{C()},[C]);let w=(0,W.useMemo)(()=>{let t=new Map,r=t=>e.find(e=>e.key===t)?.name||t,i=e=>n.find(t=>t.id===e||t.key===e||t.name===e||`board/`+t.name===e),a=(e,n,r,i,a)=>{if(!e||!a)return;t.has(e)||t.set(e,[]);let o=t.get(e);o&&(o.some(e=>e.label===r)||o.push({key:e+`|`+r,kind:n,label:r,tip:i||r,target:a}))};for(let e of g)if(e&&e.refId){if(e.type===`repo`){let t=r(e.repoKey);a(e.refId,`repo`,`仓:${t}`,`「${t}」的${e.main?`项目介绍主篇`:`文档`}`,e.repoKey)}else if(e.type===`group`){let t=i(e.repoKey),n=t?t.name:e.repoKey;a(e.refId,`board`,`组:${n}`,`组「${n}」的${e.main?`介绍文档`:`文档`}`,t?t.id:``)}else if(e.type===`group_repo`){let t=i(String(e.groupKey||``)),n=t?t.name:String(e.groupKey||``),o=r(e.repoKey);a(e.refId,`scoped`,`组内:${n} / ${o}`,`「${o}」在组「${n}」里的描述`,t?t.id:``)}}return t},[g,e,n]),T=(0,W.useMemo)(()=>{let e=b.trim().toLowerCase(),t=m.map(e=>({d:e,hosts:w.get(e.refId||``)||[]})).filter(t=>!e||[t.d.title,t.d.desc,t.d.name].some(t=>t&&String(t).toLowerCase().includes(e))||t.hosts.some(t=>t.label.toLowerCase().includes(e)));return v===`orphan`?t.filter(e=>!e.hosts.length):v===`all`?t:t.filter(e=>e.hosts.some(e=>e.kind===v))},[m,w,v,b]),O=(0,W.useMemo)(()=>{let e={all:m.length,repo:0,board:0,scoped:0,orphan:0};for(let t of m){let n=w.get(t.refId||``)||[];n.length||(e.orphan+=1);for(let t of[`repo`,`board`,`scoped`])n.some(e=>e.kind===t)&&(e[t]+=1)}return e},[m,w]),k=(e,t=`start`)=>{if(!e)return;let n=e.parentElement;for(;n;){let e=getComputedStyle(n);if((e.overflowY===`auto`||e.overflowY===`scroll`)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}n||=document.scrollingElement||document.documentElement;let r=n.getBoundingClientRect?n.getBoundingClientRect().top:0,i=e.getBoundingClientRect().top-r,a=t===`center`?(n.clientHeight-e.offsetHeight)/2:12;n.scrollTop=Math.max(0,n.scrollTop+i-a)},A=e=>k(document.getElementById(e)),j=e=>{if(!e||!e.target)return;if(e.kind===`board`){s(e.target),A(`rp-repos`);return}s(``);let t=document.getElementById(`rp-row-`+e.target);if(!t){A(`rp-repos`);return}k(t,`center`),t.classList.add(`rp-row-flash`),setTimeout(()=>t.classList.remove(`rp-row-flash`),1400)},M=e=>e.title||e.desc||e.name||`未命名文档`,N=e=>l(async()=>{let t=M(e),n=w.get(e.refId||``)||[];await d({message:`删除文档「${t}」?正文与归属会一并删除,不可恢复。`+(n.length?`它正被 ${n.length} 处引用(${n.map(e=>e.label).join(`、`)})。`:``),danger:!0})&&(await F({ref:e.docId}),u(`已删除:${t}`),await Promise.all([C(),c.repos(),c.boards()]))});return(0,G.jsxs)(a,{size:`wide`,title:`文档检索 · ${m.length}`,onClose:o,children:[(0,G.jsxs)(`div`,{className:`rp-modal-bar rp-doc-bar`,children:[(0,G.jsx)(`input`,{className:`rp-search`,type:`search`,value:b,onChange:e=>x(e.target.value),placeholder:`搜标题 / 描述 / 组名 / 仓库名…`,"aria-label":`检索文档`}),b?(0,G.jsx)(D,{small:!0,onClick:()=>x(``),children:`清空`}):null]}),m.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`rp-doc-scopes`,children:[[`all`,`全部`,O.all],[`repo`,`仓库文档`,O.repo],[`scoped`,`组内文档`,O.scoped],[`board`,`分组文档`,O.board],[`orphan`,`未绑定`,O.orphan]].map(([e,t,n])=>(0,G.jsxs)(`button`,{className:`rp-chip`+(v===e?` on`:``),onClick:()=>y(e),children:[t,` `,(0,G.jsx)(`b`,{children:n})]},e))}),(0,G.jsxs)(`div`,{className:`rp-doc-rows rp-doc-rows-modal`,children:[T.map(({d:e,hosts:t})=>(0,G.jsxs)(`div`,{className:`rp-doc-row`,children:[(0,G.jsx)(`button`,{type:`button`,className:`rp-doc-row-title`,title:`打开「${M(e)}」`,onClick:()=>p(e.docId),children:M(e)}),e.desc&&e.title&&e.desc!==e.title?(0,G.jsx)(`span`,{className:`rp-doc-row-desc`,children:e.desc}):null,(0,G.jsx)(`span`,{className:`rp-doc-row-hosts`,children:t.length?t.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`rp-bind-chip `+e.kind,title:`${e.tip}\n点击跳到这个宿主`,onClick:()=>{j(e),o()},children:e.label},e.key)):(0,G.jsx)(`span`,{className:`rp-bind-chip none`,children:`未绑定`})}),(0,G.jsxs)(`span`,{className:`rp-doc-row-acts`,children:[(0,G.jsx)(D,{small:!0,onClick:()=>p(e.docId),children:`打开编辑`}),(0,G.jsx)(D,{small:!0,danger:!0,onClick:()=>N(e),children:`删除`})]})]},e.docId)),T.length?null:(0,G.jsx)(`div`,{className:`rp-board-empty muted`,children:`这一档没有匹配的文档。`})]})]}):(0,G.jsx)(`div`,{className:`rp-board-empty muted`,children:`还没有文档 —— 到右侧文档列表点 + 新建(直接写标题与描述); 或在仓库行上点「+ 写项目介绍」。`}),f]})}function ue({boardList:e,unassigned:n,onClose:o,onFilter:s,onMembers:c,onOpenDoc:l,reload:d}){let f=r(),p=t(),{dialog:m,node:h}=i(),[g,_]=(0,W.useState)(null),[y,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(``),[w,E]=(0,W.useState)(null),O=()=>f(async()=>{if(!g)return;let e={name:g.name.trim()};e.name&&(g.id||(e.desc=g.desc.trim()||void 0),g.id?await u(encodeURIComponent(g.id),e):await j(e),_(null),await d.boards())}),k=e=>f(async()=>{await m({message:`删看板「${e.name}」?它里面的 ${(e.repos||[]).length} 个仓库**仍留在中心清单里**(只是少了一份归属)。`,danger:!0})&&(await v(encodeURIComponent(e.id)),await Promise.all([d.repos(),d.boards()]))});return(0,G.jsxs)(a,{size:`wide`,title:`分组管理 · ${e.length}`,onClose:o,children:[(0,G.jsxs)(`div`,{className:`rp-modal-bar`,children:[(0,G.jsxs)(`span`,{className:`acts`,children:[(0,G.jsx)(D,{small:!0,onClick:()=>_({id:null,name:``,desc:``}),children:`新建分组`}),(0,G.jsx)(D,{small:!0,title:`粘贴/选择看板 JSON`,onClick:()=>x(!0),children:`导入`}),(0,G.jsx)(D,{small:!0,title:`导出全部看板为 JSON`,onClick:()=>f(async()=>{let e=await T();E(JSON.stringify(e,null,2))}),children:`导出`})]}),(0,G.jsx)(`span`,{className:`muted`,children:`一个分组 = 一个主题;同一个仓库可以同时在多个分组里。`})]}),e.length?(0,G.jsxs)(`div`,{className:`rp-board-admin`,children:[(0,G.jsxs)(`div`,{className:`rp-board-admin-head`,children:[(0,G.jsx)(`span`,{children:`分组`}),(0,G.jsx)(`span`,{children:`成员`}),(0,G.jsx)(`span`,{children:`组介绍`}),(0,G.jsx)(`span`,{children:`操作`})]}),e.map(e=>{let t=(e.repos||[]).filter(e=>e.present!==!1),n=(e.repos||[]).filter(e=>e.present===!1);return(0,G.jsxs)(`div`,{className:`rp-board-admin-row`,children:[(0,G.jsxs)(`span`,{className:`rp-board-admin-name`,children:[e.name,(0,G.jsx)(`button`,{className:`rp-mini-link`,title:`只看「${e.name}」里的仓库`,onClick:()=>{s(e.id),o()},children:`筛选`})]}),(0,G.jsxs)(`span`,{className:`rp-board-admin-members`,children:[t.slice(0,4).map(e=>(0,G.jsx)(`span`,{className:`rp-board-mchip`,title:e.note||e.key,children:e.name||e.key},e.key)),t.length>4?(0,G.jsxs)(`span`,{className:`rp-board-more`,children:[`+`,t.length-4]}):null,n.length?(0,G.jsxs)(`span`,{className:`rp-board-missing`,children:[n.length,` 待初始化`]}):null,(e.repos||[]).length?null:(0,G.jsx)(`span`,{className:`muted`,children:`—`})]}),(0,G.jsxs)(`span`,{className:`rp-board-admin-doc`,children:[(0,G.jsx)(D,{small:!0,title:`在右侧栏列出这个组的文档`,onClick:()=>l(e),children:`文档`}),e.docCount&&e.docCount>1?(0,G.jsxs)(`span`,{className:`muted`,children:[`+`,e.docCount-1]}):null]}),(0,G.jsxs)(`span`,{className:`rp-board-admin-acts`,children:[(0,G.jsx)(`a`,{className:`btn small ghost`,href:`#/group/`+encodeURIComponent(e.id),title:`组页:成员与任务`,children:`组页 ↗`}),(0,G.jsx)(D,{small:!0,onClick:()=>c(e.id),children:`成员`}),(0,G.jsx)(D,{small:!0,onClick:()=>_({id:e.id,name:e.name,desc:e.desc||``}),children:`编辑`}),(0,G.jsx)(D,{small:!0,danger:!0,onClick:()=>k(e),children:`删除`})]})]},e.id)}),n?.length?(0,G.jsxs)(`div`,{className:`rp-boards-unassigned`,children:[`未分组 `,(0,G.jsx)(`b`,{children:n.length}),` 个 —— 不属于任何分组,只在「全部」里可见。`]}):null]}):(0,G.jsx)(`div`,{className:`rp-board-empty muted`,children:`还没有分组 —— 点「新建分组」建一个当主题用(如「前端」「AI 工具」),再把仓库点选进去。`}),g?(0,G.jsx)(a,{title:g.id?`编辑看板`:`新建看板`,onClose:()=>_(null),children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`bd-name`,children:`看板名称 *`}),(0,G.jsx)(`input`,{id:`bd-name`,placeholder:`如 前端 / AI 工具`,value:g.name,onChange:e=>_(t=>t&&{...t,name:e.target.value})})]}),g.id?(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{children:`领域描述(文档)`}),(0,G.jsx)(`div`,{className:`rp-docpick`,children:(0,G.jsx)(`button`,{type:`button`,className:`rp-doc`+(g.desc?``:` ghost`),title:`打开右侧栏文档列表(组介绍在里面维护)`,onClick:()=>{let t=e.find(e=>e.id===g?.id);_(null),t&&l(t)},children:g.desc||`未写`})})]}):(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`bd-desc`,children:`初始描述`}),(0,G.jsx)(`textarea`,{id:`bd-desc`,rows:3,spellCheck:`false`,placeholder:`新建时给的介绍正文(之后在组介绍文档里继续维护)。
|
|
11
|
+
如:这组仓库在这个环境里的侧重、配合关系、关键路径与搜索关键词。`,value:g.desc,onChange:e=>_(t=>t&&{...t,desc:e.target.value})})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:()=>_(null),children:`取消`}),(0,G.jsx)(D,{disabled:!g.name.trim(),onClick:O,children:g.id?`保存`:`新建看板`})]})]})}):null,y?(0,G.jsx)(a,{title:`导入看板 JSON`,size:`lg`,onClose:()=>{x(!1),C(``)},children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{htmlFor:`bd-imp`,children:`看板 JSON`}),(0,G.jsxs)(`div`,{className:`form-hint`,children:[`结构 `,`{ boards:[{ name, repos:[{ path|name }] }] }`,` —— 按 path 或 name 匹配已登记仓库,匹配不上的会如实报告`]}),(0,G.jsx)(`input`,{id:`bd-imp-file`,type:`file`,accept:`.json,application/json`,onChange:async e=>{let t=e.target.files?.[0];t&&C(await t.text())}}),(0,G.jsx)(`textarea`,{id:`bd-imp`,rows:10,spellCheck:`false`,placeholder:`{"boards":[{"name":"前端","repos":[{"path":"D:/code/a_js/proj/nx-ft"}]}]}`,value:S,onChange:e=>C(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:()=>{x(!1),C(``)},children:`取消`}),(0,G.jsx)(D,{disabled:!S.trim(),onClick:()=>f(async()=>{if(!S.trim())return;let e=await b({json:S});x(!1),C(``),p(`已导入:新建 ${e.created} 个看板、合并 ${e.merged} 个、匹配仓库 ${e.matched} 个`+(e.unmatched.length?`;未匹配 ${e.unmatched.length} 条(见 CLI board import 输出)`:``)),await Promise.all([d.repos(),d.boards()])}),children:`导入`})]})]})}):null,w?(0,G.jsx)(a,{title:`看板 JSON(可回灌给导入)`,size:`lg`,onClose:()=>E(null),children:(0,G.jsx)(`textarea`,{className:`bd-exp`,rows:14,readOnly:!0,value:w,spellCheck:`false`})}):null,h]})}function de({repo:e,refRepos:n,boardList:i,currentRefs:o,onClose:s,onSaved:c}){let l=r(),u=t(),d=i.filter(t=>(t.repos||[]).some(t=>t.key===e.key)),[f,p]=(0,W.useState)(()=>{let e={};for(let t of o||[])e[t.key]=!0;return e});return(0,G.jsx)(a,{title:`「${e.name}」的参考仓库`,onClose:s,children:(0,G.jsxs)(`div`,{className:`form-grid`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsxs)(`div`,{className:`form-hint`,children:[`参考仓库绑定在组上,勾选 = 绑到「`,e.name,`」所属的组,组内所有仓库共享。仓库不属于任何组时请先把它加入组。`]}),(0,G.jsx)(`div`,{className:`rp-pick-list`,children:(0,G.jsxs)(`div`,{className:`rp-pick-group`,children:[(0,G.jsx)(`span`,{className:`rp-pick-group-label`,children:`参考仓库`}),n.map(e=>(0,G.jsxs)(`label`,{className:`rp-pick-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!f[e.key],onChange:t=>p(n=>({...n,[e.key]:t.target.checked}))}),(0,G.jsx)(`span`,{title:e.remote||``,children:e.name}),e.desc?(0,G.jsx)(`span`,{className:`muted rp-pick-desc`,children:e.desc}):null]},e.key)),n.length?null:(0,G.jsx)(`span`,{className:`muted`,children:`(还没有参考仓库 —— 先在参考面板里克隆)`})]})}),d.length?(0,G.jsxs)(`div`,{className:`form-hint`,children:[`将写入:`,d.map(e=>e.name).join(`、`)]}):(0,G.jsx)(`div`,{className:`form-hint rp-ref-warn`,children:`这个仓库不属于任何组,保存会被拒绝 —— 先把它加入组。`})]}),(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:s,children:`取消`}),(0,G.jsx)(D,{onClick:()=>l(async()=>{if(!d.length){u(`这个仓库不属于任何组 —— 参考绑定挂在组上;先把它加入组`);return}let e=new Set((o||[]).map(e=>e.key)),t=new Set(Object.keys(f).filter(e=>f[e]));for(let n of t)if(!e.has(n))for(let e of d)await C({id:n,board:[e.id]});for(let n of e)if(!t.has(n))for(let e of d)await C({id:n,board:[e.id],remove:!0});s(),await c()}),children:`保存绑定`})]})]})})}function fe({repo:e,onClose:n,onSaved:i}){let o=r(),s=t(),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),f=(0,W.useCallback)(async()=>{try{let t=await x(e.key);if(!t||!Array.isArray(t.remotes))throw Error(`远程地址读取失败`);l(t)}catch(e){s(String(e.message||e)),n()}},[e.key,s,n]);(0,W.useEffect)(()=>{f()},[f]);let p=e=>o(async()=>{c&&(await L({id:c.key,url:e}),n(),s(`已对齐 remote`),await i())}),m=async e=>{let t=c?c.key:``;if(!t){d({url:``,status:`unreachable`,detail:`没有仓库标识`});return}d({url:e||c?.current||``,status:`checking`,detail:`检查中…`});try{let n=await g(t,e);d(n)}catch(t){d({url:e||c?.current||``,status:`unreachable`,detail:String(t.message||t)})}};return c?(0,G.jsx)(a,{title:`对齐 remote · ${c.name}`,onClose:n,children:(0,G.jsxs)(`div`,{className:`form-grid`,"data-testid":`rp-remote-modal`,children:[(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsxs)(`div`,{className:`form-hint`,children:[`当前采纳:`,(0,G.jsx)(`b`,{children:c.current||`(无)`}),`。换一条即对齐(key 随之重算;自定义 key 不动)。`]}),(0,G.jsxs)(`div`,{className:`rp-remote-list`,children:[c.remotes.map(e=>(0,G.jsxs)(`div`,{className:`rp-remote-item`,children:[(0,G.jsx)(`span`,{className:`rp-remote-name`,children:e.name}),(0,G.jsx)(`span`,{className:`mono rp-remote-url`,children:e.url}),(0,G.jsx)(`span`,{className:`rp-remote-kind`,children:e.kind}),e.current?(0,G.jsx)(`span`,{className:`rp-remote-on`,children:`当前`}):null,(0,G.jsxs)(`span`,{className:`acts`,children:[e.current?null:(0,G.jsx)(D,{small:!0,onClick:()=>p(e.url),children:`对齐这条`}),(0,G.jsx)(D,{small:!0,onClick:()=>m(e.url),children:`检查`})]})]},e.name+`|`+e.url)),c.remotes.length?null:(0,G.jsx)(`div`,{className:`muted`,children:`这个仓库没有配置 remote —— 先在 git 里 git remote add`})]})]}),u?(0,G.jsxs)(`div`,{className:`form-field`,children:[(0,G.jsx)(`label`,{children:`存在性检查`}),(0,G.jsxs)(`div`,{className:`rp-remote-check`,children:[(0,G.jsx)(`span`,{className:`rp-status `+(u.status===`exists`?`same`:u.status===`missing`?`new`:u.status===`checking`?`checking`:`missing`),children:u.status===`exists`?`存在`:u.status===`missing`?`不存在`:u.status===`checking`?`检查中`:`不可达`}),(0,G.jsx)(`span`,{className:`mono rp-remote-url`,children:u.url}),(0,G.jsx)(`span`,{className:`muted`,children:u.detail})]})]}):null,(0,G.jsxs)(`div`,{className:`form-acts`,children:[(0,G.jsx)(D,{onClick:n,children:`关闭`}),(0,G.jsx)(D,{onClick:()=>m(``),children:`检查当前 remote`})]})]})}):null}function pe(){let e=r(),n=t(),{dialog:a,node:o}=i(),s=R(),[l,u]=(0,W.useState)([]),[d,f]=(0,W.useState)(null),[g,_]=(0,W.useState)(null),v=(0,W.useCallback)(async()=>{u(await h().catch(()=>[])||[])},[]),y=(0,W.useCallback)(async()=>{f(await k().catch(()=>null))},[]),b=(0,W.useCallback)(async()=>{_(await N().catch(()=>null))},[]);(0,W.useEffect)(()=>{v(),y(),b()},[v,y,b]);let x=(0,W.useMemo)(()=>({repos:v,boards:y,refCheck:b,all:async()=>{await Promise.all([v(),y(),b()])}}),[v,y,b]),[S,w]=(0,W.useState)(``),[T,E]=(0,W.useState)(``),[D,O]=(0,W.useState)(void 0),[A,j]=(0,W.useState)(!1),[F,I]=(0,W.useState)(!1),[L,z]=(0,W.useState)(``),[B,V]=(0,W.useState)({}),[K,q]=(0,W.useState)(!1),[J,Y]=(0,W.useState)(null),[re,X]=(0,W.useState)(!1),[pe,me]=(0,W.useState)(null),[he,ge]=(0,W.useState)(null),[_e,ve]=(0,W.useState)(null);(0,W.useEffect)(()=>{let e=()=>{let e=location.hash.split(`?`)[1]||``;if(!e)return;let t=new URLSearchParams(e),n=t.get(`board`);n&&(w(n),t.get(`add`)&&Y(n))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let Z=(0,W.useMemo)(()=>d&&d.boards||[],[d]),Q=(0,W.useMemo)(()=>l.filter(e=>(e.type||`dev`)!==`ref`),[l]),$=(0,W.useMemo)(()=>l.filter(e=>e.type===`ref`),[l]),ye=(0,W.useMemo)(()=>{let e=Q;S&&(e=e.filter(e=>(e.boards||[]).some(e=>e.id===S)));let t=T.trim().toLowerCase();if(!t)return e;let n=e=>{let n=e.descDocs&&e.descDocs.main;return n&&[n.title,n.summary,n.desc].some(e=>e&&String(e).toLowerCase().includes(t))?!0:(e.descDocs&&e.descDocs.links||[]).some(e=>[e.title,e.desc,e.tag,e.note].some(e=>e&&String(e).toLowerCase().includes(t)))};return e.filter(e=>[e.name,e.key,e.path,e.desc].some(e=>e&&String(e).toLowerCase().includes(t))||(e.boards||[]).some(e=>String(e.name||``).toLowerCase().includes(t))||n(e))},[Q,S,T]),be=(0,W.useMemo)(()=>Z.find(e=>e.id===S)||null,[Z,S]),xe=(0,W.useMemo)(()=>Z.find(e=>e.id===J)||null,[Z,J]),Se=(0,W.useMemo)(()=>{let e=new Map;return(g?.refRepos||[]).forEach(t=>e.set(t.id,t)),e},[g]),Ce=(0,W.useMemo)(()=>{let e=new Map,t=new Map($.map(e=>[e.key,e]));for(let n of Z){let r=n.key||`board/${n.name}`;for(let i of(n.repos||[]).map(e=>e.key))for(let a of n.refs||[]){let o=t.get(a.id);if(!o)continue;e.has(i)||e.set(i,[]);let s=e.get(i);if(!s)continue;let c=s.find(e=>e.key===o.key);if(c){c.group&&c.group.name!==n.name&&(c.alsoIn=[...c.alsoIn||[],n.name]);continue}s.push({key:o.key,id:o.id,name:o.name,remote:o.remote||``,note:a.note||``,group:{id:n.id,key:r,name:n.name}})}}return e},[Z,$]),we=(0,W.useMemo)(()=>{let e=new Map,t=new Map($.map(e=>[e.key,e]));for(let n of Q){let r=(n.linked||[]).filter(e=>e&&e.kind===`ref`).map(e=>{let n=t.get(e.id);return n?{key:n.key,name:n.name,note:e.note||``}:null}).filter(e=>e!==null);e.set(n.key,r)}return e},[Q,$]),Te=(0,W.useMemo)(()=>{let e=new Map;for(let t of Q)for(let n of t.linked||[]){if(!n||n.kind!==`ref`)continue;e.has(n.id)||e.set(n.id,[]);let r=e.get(n.id);r&&r.push({repo:t,note:n.note||``})}return e},[Q]);(0,W.useEffect)(()=>{if(!F||!L)return;let e=null,t=0,n=requestAnimationFrame(()=>{e=document.getElementById(`rp-refrepo-row-`+L),e&&(e.scrollIntoView({block:`center`}),e.classList.add(`rp-row-flash`),t=window.setTimeout(()=>e?.classList.remove(`rp-row-flash`),1600))});return()=>{cancelAnimationFrame(n),clearTimeout(t),e&&e.classList.remove(`rp-row-flash`)}},[F,L]);let Ee=t=>e(async()=>{let e=await p({id:t.id});n(e.status===`updated`?`已更新: ${e.name}`:e.status===`upToDate`?`${e.name} 已是最新`:`${e.name}: ${e.status} ${e.output||``}`)}),De=(t,n)=>e(async()=>{await C({id:t.key,board:[n],remove:!0}),await Promise.all([v(),y(),b()])}),Oe=(t,n)=>e(async()=>{await C({id:t.key,repo:[n],remove:!0}),await Promise.all([v(),y(),b()])}),ke=e=>{let t=s.model;if(!t){n(`工作区不可用,无法打开文档列表`);return}c(t,{component:`refs`,name:`文档列表`,config:{repoKey:e.key||``,repoName:e.name||``,scope:`repo`},location:`right`})},Ae=(t,n)=>e(async()=>{if(t===`open`)await P({id:n.id});else if(t===`del`){if(!await a({message:`删除仓库登记「${n.name}」?(仅移除登记,磁盘文件不受影响;各看板里的归属同步摘除)`,danger:!0}))return;await m(encodeURIComponent(n.id)),await x.all()}}),je=e=>{let t=s.model;if(!t){n(`工作区不可用,无法打开文档列表`);return}c(t,{component:`refs`,name:`文档列表`,config:{boardKey:e.key||e.id||``,boardName:e.name||``,scope:`all`},location:`right`})},Me=(e,t=`start`)=>{if(!e)return;let n=e.parentElement;for(;n;){let e=getComputedStyle(n);if((e.overflowY===`auto`||e.overflowY===`scroll`)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}n||=document.scrollingElement||document.documentElement;let r=n.getBoundingClientRect?n.getBoundingClientRect().top:0,i=e.getBoundingClientRect().top-r,a=t===`center`?(n.clientHeight-e.offsetHeight)/2:12;n.scrollTop=Math.max(0,n.scrollTop+i-a)},Ne=e=>Me(document.getElementById(e)),Pe=e=>{if(!e||!e.target)return;if(e.kind===`board`){w(e.target),Ne(`rp-repos`);return}w(``);let t=document.getElementById(`rp-row-`+e.target);if(!t){Ne(`rp-repos`);return}Me(t,`center`),t.classList.add(`rp-row-flash`),setTimeout(()=>t.classList.remove(`rp-row-flash`),1400)},Fe=(e,t)=>{I(!1),E(``),setTimeout(()=>Pe({kind:e,target:t}),60)},Ie={open:e=>Ae(`open`,e),edit:e=>O(e.id),del:e=>Ae(`del`,e),remote:e=>{if(!e.key){n(`这个仓库还没有 key —— 先 nx-kv repo key set <id> <key>`);return}ge(e)},getloop:e=>me(e),docs:e=>{let t=s.model;if(!t){n(`工作区不可用,无法打开文档列表`);return}c(t,{component:`refs`,name:`文档列表`,config:{repoKey:e.key||``,repoName:e.name||``,scope:`repo`},location:`right`})},filter:e=>w(t=>t===e?``:e),gotoRefRepo:e=>{z(e),I(!0)},bind:e=>ve(e)};return d===null?(0,G.jsxs)(`div`,{className:`rp-page`,children:[(0,G.jsx)(H,{}),(0,G.jsx)(`div`,{className:`muted`,style:{padding:20},children:`读取中…`}),o]}):(0,G.jsxs)(`div`,{className:`rp-page`,children:[(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsx)(`div`,{className:`title-block`,children:(0,G.jsx)(`h2`,{children:`仓库管理`})}),(0,G.jsx)(`div`,{className:`acts`,children:(0,G.jsx)(U,{kind:`repos`,titles:{add:`登记本机开发仓库`,boards:`分组管理:建组 / 成员 / 组介绍文档`,refs:`参考仓库面板:克隆 / 绑定 / 同步 / 检查 / 存储根`,transfer:`布局与仓库的导入导出(逐条选择 / 冲突方案 / 差异检查)`},actions:{add:()=>O(null),boards:()=>j(!0),refs:()=>I(!0),transfer:()=>X(!0)}})})]}),(0,G.jsx)(se,{boards:d,devRepos:Q,refRepos:$,reload:x}),(0,G.jsx)(ae,{boards:Z,filter:S,onFilter:w,devCount:Q.length,shownCount:ye.length,q:T,onQ:E,onOpenDocs:()=>q(!0)}),(0,G.jsx)(oe,{filterBoard:be,refRepos:$,checkOf:Se,onOpenDoc:je,onOpenRefDocs:ke,onAddMember:Y,onSync:Ee,onOpen:e=>Ae(`open`,e),onUnbind:De}),(0,G.jsx)(ie,{shown:ye,devRepos:Q,filterBoard:be,refRepoChipsByRepo:we,acts:Ie,onAddMember:Y}),F?(0,G.jsx)(ce,{refRepos:$,devRepos:Q,boardList:Z,checkOf:Se,refRepoBackLinks:Te,refBindOpen:B,onRefBindOpen:V,onClose:()=>I(!1),onSyncOne:Ee,onUnbind:De,onUnbindRepo:Oe,onGoBind:Fe,onDocs:Ie.docs,onRowAct:Ae,reload:x}):null,K?(0,G.jsx)(le,{repos:l,boardList:Z,onClose:()=>q(!1),onFilter:w,reload:x}):null,A?(0,G.jsx)(ue,{boardList:Z,unassigned:d.unassigned,onClose:()=>j(!1),onFilter:w,onMembers:Y,onOpenDoc:je,reload:x}):null,D===void 0?null:(0,G.jsx)(M,{editing:D,repos:l,onClose:()=>O(void 0),onSaved:x.all}),xe?(0,G.jsx)(ee,{board:xe,boards:Z,repos:l,onClose:()=>Y(null),onChanged:async()=>{await Promise.all([v(),y()])}}):null,_e?(0,G.jsx)(de,{repo:_e,refRepos:$,boardList:Z,currentRefs:Ce.get(_e.key)||[],onClose:()=>ve(null),onSaved:x.all}):null,re?(0,G.jsx)(te,{onClose:()=>X(!1),onChanged:x.all,repos:l,boards:Z}):null,pe?(0,G.jsx)(ne,{repo:l.find(e=>e.id===pe.id)||pe,onClose:()=>me(null),onSaved:v}):null,he?(0,G.jsx)(fe,{repo:he,onClose:()=>ge(null),onSaved:async()=>{await Promise.all([v(),b()])}}):null,o]})}export{pe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,_ as t,b as n,m as r,p as i,v as a,y as o}from"./frontmatter-DEIM0yF2.js";import{n as s}from"./repo-form-modal-
|
|
1
|
+
import{C as e,_ as t,b as n,m as r,p as i,v as a,y as o}from"./frontmatter-DEIM0yF2.js";import{n as s}from"./repo-form-modal-pyqiC7pB.js";import{n as c}from"./app-context-CR7f0AtI.js";import{a as l,t as u}from"./index-BLrw-ZQc.js";var d=e(n(),1);function f(){return a(`/api/setting`)}function p(e){return a(`/api/setting`,{method:`POST`,body:e})}function m(){return a(`/api/localtasks`)}function h(e){return a(`/api/localtasks/setting`,{method:`PATCH`,body:e})}function g(){return Promise.all([a(`/api/repos`),a(`/api/boards`)])}var _=Object.freeze([{id:`xml`,label:`XML 区块(默认)`,desc:`每段系统内容包进独立标签,agent 一眼分清任务原文与系统规则`},{id:`plain`,label:`正文直追加`,desc:`不包标签,按空行拼接(与改造前的 instruction 逐字一致)`}]),v=8e3,y=`builtin`,b=`系统内置`,x=`{{#if repo}},{{#if repo.intro}},〔项目介绍 · {{repo.name}}〕,{{repo.intro}},{{/if}},{{#if repo.docs}},〔项目文档〕按需取用:nx-kv docs get --ref <refId>,{{#each repo.docs}}, - {{#if desc}}{{desc}}{{else}}{{#if title}}{{title}}{{else}}未命名文档{{/if}}{{/if}}{{#if note}} # {{note}}{{/if}}, 取用:nx-kv docs get --ref {{refId}},{{/each}},{{/if}},{{#if repo.intro}}{{else}}{{#if repo.docs}}{{else}},〔项目上下文 · {{repo.name}}〕已登记为本机仓库({{repo.key}}),但没有项目介绍文档:nx-kv repo doc add {{repo.key}} --ref <refId>,{{/if}}{{/if}},{{/if}},{{#if repo}}{{else}}{{#if cwd}},〔项目上下文〕工作目录 {{cwd}} 未登记为本机仓库,本次交付没有项目介绍 / 组上下文。登记(不需要 .git,给 key 即可):nx-kv repo add "{{cwd}}" --key <key>,{{/if}}{{/if}},{{#if group}},〔项目组上下文 · {{group.name}}〕,{{#if group.desc}},组定位:{{group.desc}},{{/if}},{{#if group.note}},本项目在组里的位置:{{group.note}},{{/if}},{{#if group.introRefId}},组介绍:{{#if group.introDesc}}{{group.introDesc}}{{else}}(无描述){{/if}}, 取用:nx-kv docs get --ref {{group.introRefId}},{{/if}},{{#if group.peers}},组内成员:,{{#each group.peers}}, - {{name}}:{{#if note}}{{note}}{{else}}(无组内描述){{/if}}{{#if path}}({{path}}){{/if}},{{/each}},{{/if}},{{#if group.docs}},组文档(按需取用):,{{#each group.docs}}, - {{#if desc}}{{desc}}{{else}}{{#if title}}{{title}}{{else}}未命名文档{{/if}}{{/if}}{{#if note}} # {{note}}{{/if}}, 取用:nx-kv docs get --ref {{refId}},{{/each}},{{/if}},{{/if}},{{#if refRepos.count}},参考仓库(可直接读取,共 {{refRepos.count}} 个):,{{#each refRepos.list}}, - {{name}}{{#if path}}({{path}}){{/if}}{{#if note}} # {{note}}{{/if}},{{/each}},{{/if}}`.split(`,`).join(`
|
|
2
2
|
`),S=[`{{#if attach}}`,`〔附件〕本任务包含 {{attach.count}} 个附件(正文内嵌 {{attach.inlineCount}} · 附件区 {{attach.areaCount}})。请先识别附件内容(图片先看图、文档先读内容、文件夹先列目录)再开始处理,不要跳过附件。`,``,`附件清单:`,`{{#each attach.list}}`,` - [{{originLabel}}] {{kindLabel}} {{name}}{{#if sizeText}}({{sizeText}}){{/if}}:{{#if file}}{{#if file.exists}}{{file.localPath}}{{else}}未同步到本地(fileId {{file.fileId}}){{/if}}{{/if}}{{#if url}}{{url.href}}{{/if}}{{#if task}}{{#if task.resolved}}#{{task.seq}} {{task.title}} · 地址 {{task.address}}({{task.statusLabel}}){{else}}地址 {{task.address}}({{task.statusLabel}}){{/if}}{{/if}}{{#if ref}}{{ref.title}}{{/if}}{{#if mdfile}}{{mdfile.absPath}}{{#if mdfile.missing}}(源文件已不在){{/if}}{{/if}}{{#if folder}}{{folder.absPath}}{{#if folder.missing}}(目录已不在){{/if}}{{/if}}{{#if note}} # {{note}}{{/if}}`,`{{/each}}`,``,`取用方式:`,`{{#each attach.list}}`,` - {{kindLabel}} 《{{name}}》:{{usage}}`,`{{/each}}`,`{{#each attach.list}}{{#if mdfile}}{{#if mdfile.content}}〔外部 md · {{name}}〕({{mdfile.absPath}}{{#if mdfile.truncated}},已截断{{/if}}{{#if mdfile.stale}},内容有变化{{/if}}):`,``,`{{mdfile.content}}`,``,`{{/if}}{{/if}}{{/each}}`,`{{#each attach.list}}{{#if ref}}{{#if ref.content}}〔文档原文 · {{ref.title}}〕:`,``,`{{ref.content}}`,``,`{{/if}}{{/if}}{{/each}}`,`{{/if}}`].join(`
|
|
3
3
|
`),C=[`{{#if goal.check}}`,`{{goal.check}}`,`{{/if}}`,`{{#if goal.statusLine}}`,`{{goal.statusLine}}`,`{{/if}}`].join(`
|
|
4
4
|
`),w=[`{{#if goal.check}}`,`〔特殊功能提示 · 时间目标〕任务 #{{task.id}} 正在计时:持续 {{goal.durationHuman}},已过 {{goal.elapsedHuman}}({{percent goal.elapsedSec goal.durationSec}}%),{{#if goal.reached}}已到点(超时 {{formatDuration goal.overtimeSec}}){{else}}剩余 {{goal.remainingHuman}}{{/if}}。`,`{{#if goal.reached}}——时间已到:可以收口,把改动收敛成可交付状态,补验证与说明后按 ack 段 done。`,`{{else}}{{#if (gte (percent goal.elapsedSec goal.durationSec) 67)}}——已过 2/3:进入收尾整理(收敛改动 / 补验证 / 写清遗留),别开新战线。`,`{{else}}{{#if (gte (percent goal.elapsedSec goal.durationSec) 50)}}——已过半:先确认主线走到哪,剩余时间只做收尾必需项。`,`{{else}}——时间尚足:先做主线,再补细节。{{/if}}{{/if}}{{/if}}`,`{{/if}}`].join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,_ as t,b as n,m as r,n as i,p as a,r as o,t as s,u as c,y as l}from"./frontmatter-DEIM0yF2.js";import{r as u,t as d,v as f}from"./workspace-C0PPPfA1.js";import{n as p}from"./app-context-CR7f0AtI.js";import{a as m,c as h,d as g,i as _,l as v,n as y,o as b,r as x,s as S,t as C,x as w}from"./md-history-BF85zuFo.js";import{t as T}from"./status-tag-BKA9au1l.js";import{a as E,r as D}from"./md-parse-uaOFbIcA.js";import{f as O,i as ee,p as k,t as A}from"./use-rail-drag-B1RQzqcB.js";import{t as j}from"./board-view-CUeSVy9F.js";import{t as te}from"./route-crumb-CkhC1zw2.js";import{c as M,d as N,f as P,l as F,m as ne,o as I,p as L,s as re,u as ie}from"./index-
|
|
1
|
+
import{C as e,_ as t,b as n,m as r,n as i,p as a,r as o,t as s,u as c,y as l}from"./frontmatter-DEIM0yF2.js";import{r as u,t as d,v as f}from"./workspace-C0PPPfA1.js";import{n as p}from"./app-context-CR7f0AtI.js";import{a as m,c as h,d as g,i as _,l as v,n as y,o as b,r as x,s as S,t as C,x as w}from"./md-history-BF85zuFo.js";import{t as T}from"./status-tag-BKA9au1l.js";import{a as E,r as D}from"./md-parse-uaOFbIcA.js";import{f as O,i as ee,p as k,t as A}from"./use-rail-drag-B1RQzqcB.js";import{t as j}from"./board-view-CUeSVy9F.js";import{t as te}from"./route-crumb-CkhC1zw2.js";import{c as M,d as N,f as P,l as F,m as ne,o as I,p as L,s as re,u as ie}from"./index-BLrw-ZQc.js";import{a as R,i as z,n as ae,o as B}from"./composer-launch-h-8g0f8A.js";import{C as V,T as oe,_ as H,a as U,b as W,c as G,d as se,f as ce,g as K,h as le,l as ue,m as de,n as fe,o as pe,p as me,r as q,s as he,t as ge,v as _e,x as ve,y as ye}from"./task-utils-WfeuGNak.js";var J=e(n(),1),be=/^>\s*\[![A-Za-z][\w-]*\][ \t]*(.*)$/,xe=/完成总结/,Se=/反馈/,Ce=/第\s*(\d+)\s*轮/;function we(e){let t=String(e??``).split(`
|
|
2
2
|
`),n=t[0],r=n?n.match(be):null;if(!r)return null;let i=t.slice(1).map(e=>e.replace(/^>[ \t]?/,``)).filter(e=>e.trim()!==``).join(`
|
|
3
3
|
`);return{title:String(r[1]??``).trim(),body:i}}function Te(e){let t=S(String(e??``));if(!t.length)return[];let n=[],r=null,i=``;return t.forEach((e,t)=>{let a=String(e||``).trim(),o=we(a);if(o&&xe.test(o.title)){let e=Number((o.title.match(Ce)||[])[1]);r={round:Number.isFinite(e)&&e>0?e:n.length+1,blockIndex:t,feedbackBlockIndex:-1,ackText:o.body,feedbackText:``},n.push(r),i=`ack`;return}if(a===`## 上一轮完成总结`){r={round:n.length+1,blockIndex:t,feedbackBlockIndex:-1,ackText:``,feedbackText:``},n.push(r),i=`ack`;return}if(o&&Se.test(o.title)){r&&i===`ack`&&(r.feedbackBlockIndex=t,r.feedbackText=o.body,i=`feedback`);return}if(a===`## 验收反馈`){r&&i===`ack`&&(r.feedbackBlockIndex=t,i=`feedback`);return}a&&r&&(i===`ack`?r.ackText+=(r.ackText?`
|
|
4
4
|
`:``)+a:r.feedbackText+=(r.feedbackText?`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,_ as t,b as n,y as r}from"./frontmatter-DEIM0yF2.js";import{n as i,v as a}from"./workspace-C0PPPfA1.js";import{n as o}from"./app-context-CR7f0AtI.js";import{a as s,d as c,i as l,n as u,r as d,t as f}from"./md-history-BF85zuFo.js";import{n as p,t as m}from"./route-crumb-CkhC1zw2.js";import{r as h}from"./index-
|
|
1
|
+
import{C as e,_ as t,b as n,y as r}from"./frontmatter-DEIM0yF2.js";import{n as i,v as a}from"./workspace-C0PPPfA1.js";import{n as o}from"./app-context-CR7f0AtI.js";import{a as s,d as c,i as l,n as u,r as d,t as f}from"./md-history-BF85zuFo.js";import{n as p,t as m}from"./route-crumb-CkhC1zw2.js";import{r as h}from"./index-BLrw-ZQc.js";var g=e(n(),1),_=r(),v=e=>`tpl:${e||`new`}`;function y({templateId:e,initialName:n,initialBody:r,isNew:i,onSave:a,onClose:o,busy:p}){let h=t(),[y,b]=(0,g.useState)(n||``),[x,S]=(0,g.useState)(r||``),[C,w]=(0,g.useState)(`split`),[T,E]=(0,g.useState)(!1),D=(0,g.useRef)(null),O=(0,g.useRef)(new Map),k=v(i?`new`:e),A=(0,g.useMemo)(()=>c(x||``),[x]),j=(e,t,n=`typing`)=>{u(O.current,k,{title:y,body:x},n),b(e),S(t),E(!0)},M=(e,t=`typing`)=>j(e,x,t),N=(e,t=`op`)=>j(y,e,t),P=()=>{let e=l(O.current,k,{title:y,body:x});e&&(b(e.title||``),S(e.body||``),E(!0))},F=()=>{let e=d(O.current,k,{title:y,body:x});e&&(b(e.title||``),S(e.body||``),E(!0))},I=async()=>{if(!(y||``).trim()){h(`模板名不能为空(标题即名称)`);return}await a({name:y.trim(),body:x}),f(O.current,k),E(!1)};return(0,_.jsx)(`div`,{className:`mdw mdw-tpl-edpage`,"data-mode":C,children:(0,_.jsxs)(`div`,{className:`mdw-main`,children:[(0,_.jsxs)(`div`,{className:`mdw-top`,children:[(0,_.jsx)(m,{}),(0,_.jsxs)(`div`,{className:`mdw-head`,children:[(0,_.jsx)(`div`,{className:`mdw-title`,children:i?`新建模板`:`编辑模板`}),(0,_.jsxs)(`div`,{className:`mdw-path`,children:[`任务模板`,y?` / ${y}`:``,T?` · 未保存`:``]})]})]}),(0,_.jsxs)(`div`,{className:`mdw-toolbar`,children:[(0,_.jsx)(`div`,{className:`mdw-toolbar-left`,children:(0,_.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":`编辑模式`,children:[{id:`split`,label:`并排`},{id:`edit`,label:`源码`}].map(e=>(0,_.jsx)(`button`,{type:`button`,className:C===e.id?`on`:``,onClick:()=>w(e.id),children:e.label},e.id))})}),(0,_.jsxs)(`div`,{className:`mdw-actions`,role:`group`,"aria-label":`模板操作`,children:[(0,_.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:p,onClick:o,children:`关闭`}),(0,_.jsx)(`button`,{type:`button`,className:`btn sm primary`,disabled:p||!T,onClick:I,children:i?`创建`:`保存`})]})]}),(0,_.jsx)(s,{mode:C,title:y,body:x,previewHtml:A,onTitle:M,onBody:N,docKey:k,editorApiRef:D,onSave:I,onUndo:P,onRedo:F,attachments:[]})]})})}function b({config:e,model:n,tabId:r}){let s=o(),c=s.tpl,l=t(),[u,d]=(0,g.useState)(!1),f=e||{},v=(f.mode||(f.id?`edit`:``))===`new`,b=f.id||``,x=()=>{let e=p();if(e&&s.onNavigate){s.onNavigate(e);return}if(s.onNavigate){s.onNavigate(`#/overview`);return}if(n&&r)try{n.doAction(a.deleteTab(r))}catch{}};if(!c)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(m,{}),(0,_.jsx)(`div`,{className:`pad muted`,children:`模板服务未就绪 —— 面板还在装载。`})]});if(!v&&!b)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(m,{}),(0,_.jsxs)(`div`,{className:`pad stack`,children:[(0,_.jsx)(`div`,{children:`模板在「设置 → 任务模板」管理;这里只承载全屏编辑。`}),(0,_.jsx)(`div`,{children:(0,_.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>{n&&i(n,{component:`settings`,name:`设置`,config:{}}),x()},children:`打开设置`})})]})]});let S=v?null:(c.templates||[]).find(e=>e.id===b);if(!v&&!S)return(0,_.jsxs)(`div`,{className:`mdw-tpl-panel`,children:[(0,_.jsx)(m,{}),(0,_.jsxs)(`div`,{className:`pad muted`,children:[`找不到模板「`,b,`」——可能已删除。`]})]});let C=async({name:e,body:t})=>{d(!0);try{if(v){let n={};Array.isArray(f.scope)&&(n.scope=f.scope),f.topic&&(n.topic=f.topic),await c.add(e,t,!1,n),l(`已创建模板`)}else await c.update(b,{name:e,body:t}),l(`已保存模板`);x()}catch(e){l(String(e.message||e))}finally{d(!1)}},w=v?f.name||``:S?.name??``,T=v?``:h(S?.body||``,S?.values||{});return(0,_.jsx)(y,{templateId:b,initialName:w,initialBody:T,isNew:v,busy:u,onSave:C,onClose:x},v?`new:${f.topic||``}:${(f.scope||[]).join(`,`)}`:b)}export{b as default};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<!-- .ico 兜底:浏览器不认上面的 <link> 时会自己请求 /favicon.ico -->
|
|
13
13
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
14
14
|
<link rel="apple-touch-icon" sizes="512x512" href="/logo-rounded.png">
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-BLrw-ZQc.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/frontmatter-DEIM0yF2.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/workspace-C0PPPfA1.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/app-context-CR7f0AtI.js">
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/board-view-CUeSVy9F.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/route-crumb-CkhC1zw2.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/doc-CKkCGsZ4.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/repo-form-modal-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/repo-form-modal-pyqiC7pB.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/md-parse-uaOFbIcA.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/model-Co--HRvt.js">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/frontmatter-BZrdOH46.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/assets/use-rail-drag-1h2zairf.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/assets/doc-Iuxssa-b.css">
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/repo-form-modal-DA4lNJeC.css">
|
|
32
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BPxgsnXM.css">
|
|
33
33
|
</head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|