@opentig/cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/chunks/{cli-ABzC6-gR.mjs → cli-DCPhUVBb.mjs} +1 -1
- package/dist/client/assets/App-CGiS2z40.js +74 -0
- package/dist/client/assets/{CreatePullRequestDialog-W82oHjYm.js → CreatePullRequestDialog-dNbTTo9i.js} +2 -2
- package/dist/client/assets/{DiffWorkspace-BWkTIl5n.js → DiffWorkspace-XS025gbZ.js} +1 -1
- package/dist/client/assets/{EditableFileViewer-Cv3aNJBN.js → EditableFileViewer-Cve4V9RS.js} +1 -1
- package/dist/client/assets/{File-DiOOsHOl.js → File-BJuBDans.js} +1 -1
- package/dist/client/assets/{FilesView-DIqPfRbv.js → FilesView-BUAz46Qa.js} +1 -1
- package/dist/client/assets/GitHubAvatar-Depnd_JA.js +1 -0
- package/dist/client/assets/HistoryView-Dd4Kr4KN.js +1 -0
- package/dist/client/assets/{HtmlFileViewer-BsewwJtM.js → HtmlFileViewer-C3Qylr9B.js} +1 -1
- package/dist/client/assets/{IconEdit-CxvzMyLV.js → IconEdit-BHqlqze_.js} +1 -1
- package/dist/client/assets/{IconFolderPlus-1vLDIzhC.js → IconFolderPlus-BJIo1hfe.js} +1 -1
- package/dist/client/assets/{ImageFileViewer-CoQZkgET.js → ImageFileViewer-BJy0ptmR.js} +1 -1
- package/dist/client/assets/{LocalRefsDialog-sw-ROjfe.js → LocalRefsDialog-C1MWMkv1.js} +1 -1
- package/dist/client/assets/{MarkdownFileViewer-BedKCXTI.js → MarkdownFileViewer-pagMxv2y.js} +2 -2
- package/dist/client/assets/{PairingPage-CYJXzBZC.js → PairingPage-DOPAXy3a.js} +1 -1
- package/dist/client/assets/{PierreDiffViewer-uhTsb-F7.js → PierreDiffViewer-FmgbHdls.js} +1 -1
- package/dist/client/assets/{PierreEditBoundary-Bb4dONIq.js → PierreEditBoundary-mxtF7x3F.js} +1 -1
- package/dist/client/assets/{PierreWorkerPool-BuBzE8K1.js → PierreWorkerPool-B_NFnwU-.js} +1 -1
- package/dist/client/assets/{PullRequestDiff-CgY4QIHC.js → PullRequestDiff-Bcu8Gmrf.js} +1 -1
- package/dist/client/assets/PullRequestViewer-oeDoq-3g.js +2 -0
- package/dist/client/assets/PullRequestsView-DpTtagTX.js +1 -0
- package/dist/client/assets/{QuickOpenDialog-Cn-aQRAS.js → QuickOpenDialog-rjeV0l_J.js} +1 -1
- package/dist/client/assets/RepositoryProjectsDialog-QYXEt7Lg.js +1 -0
- package/dist/client/assets/{SearchView-BtKBEJ7e.js → SearchView-C-c6oCil.js} +1 -1
- package/dist/client/assets/{SettingsDialog-wfWhEzZY.js → SettingsDialog-DHmWkKYV.js} +2 -2
- package/dist/client/assets/Viewer-B6qUr83C.js +3 -0
- package/dist/client/assets/{abnfDiagram-N423BO3Z-DLBLFOdy.js → abnfDiagram-N423BO3Z-BxGW6tGd.js} +1 -1
- package/dist/client/assets/{arc-D-Yei3Vr.js → arc-CphVLv_F.js} +1 -1
- package/dist/client/assets/{architectureDiagram-T3A2C74G-BOgBvzWh.js → architectureDiagram-T3A2C74G-D9IDzZ6u.js} +1 -1
- package/dist/client/assets/base-ui-DT3JsyND.js +1 -0
- package/dist/client/assets/{blockDiagram-VBNYF7ZC-BQXRJDyR.js → blockDiagram-VBNYF7ZC-CzCatff9.js} +1 -1
- package/dist/client/assets/{c4Diagram-5PPSVZJV-DTZseD56.js → c4Diagram-5PPSVZJV-jvC7ACDE.js} +1 -1
- package/dist/client/assets/channel-BGbncBYv.js +1 -0
- package/dist/client/assets/{checkbox-BwbxYGgK.js → checkbox-DDpujnre.js} +1 -1
- package/dist/client/assets/{chunk-2GRJ4B5K-spRCgfPY.js → chunk-2GRJ4B5K-CNRn3w2y.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-CLVClH0M.js → chunk-2Q5K7J3B-CnTjXDS8.js} +1 -1
- package/dist/client/assets/{chunk-5RXB4S5H-CuQ5tYjB.js → chunk-5RXB4S5H-8QZZSU3J.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DyOEOe90.js → chunk-5VM5RSS4-B2MFN1L0.js} +1 -1
- package/dist/client/assets/{chunk-6Q2QTUOP-CgMtuJIx.js → chunk-6Q2QTUOP-BRGuFKSr.js} +1 -1
- package/dist/client/assets/{chunk-GF5L2VYU-BH63P4Vv.js → chunk-GF5L2VYU-CWTKyD7U.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-BANDbaPq.js → chunk-JWPE2WC7-rGurufZY.js} +1 -1
- package/dist/client/assets/{chunk-KBJHAD2P-Bfty2upo.js → chunk-KBJHAD2P-DOwIHyo0.js} +1 -1
- package/dist/client/assets/{chunk-RYQCIY6F-Cvu8BZS9.js → chunk-RYQCIY6F-qrVd0AV3.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-bnohf1yd.js → chunk-XXDRQBXY-BGvaybJK.js} +1 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-BoYriqPM.js +1 -0
- package/dist/client/assets/classDiagram-v2-OCEON4UE-BoYriqPM.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-DCTEAZwO.js → cose-bilkent-JH36ORCC-CHgOt-vq.js} +1 -1
- package/dist/client/assets/{cynefin-VYW2F7L2-Bp2wXvdt.js → cynefin-VYW2F7L2-DX7Kb3Ft.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-MW4NZA55-DRRWzuF0.js → cynefinDiagram-MW4NZA55-B4MgYgbV.js} +1 -1
- package/dist/client/assets/{dagre-VZM6K2ZE-DDvsotRK.js → dagre-VZM6K2ZE-xG9l95NU.js} +1 -1
- package/dist/client/assets/{diagram-7IWD3JNH-CMqhRNRq.js → diagram-7IWD3JNH-BQKb8ivh.js} +1 -1
- package/dist/client/assets/{diagram-B4RE2ZJO-D_PYI1ut.js → diagram-B4RE2ZJO-CyIMrtDr.js} +1 -1
- package/dist/client/assets/{diagram-LBJQPF4R-BSUx7mMM.js → diagram-LBJQPF4R-WuCMu4WW.js} +1 -1
- package/dist/client/assets/{diagram-Q27KOJAE-C8O3g6WT.js → diagram-Q27KOJAE--Oi1nRrR.js} +1 -1
- package/dist/client/assets/{diagram-UB23O5K3-C5-NDsgC.js → diagram-UB23O5K3-CP1DXsa_.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-BXEA7PRR-D71hx4Ww.js → ebnfDiagram-BXEA7PRR-C-7jJg9C.js} +1 -1
- package/dist/client/assets/{erDiagram-JOGREHBK-yd9B5d8I.js → erDiagram-JOGREHBK-FSyqgO_9.js} +1 -1
- package/dist/client/assets/{flowDiagram-UKHOOZJN-CWU5VVbw.js → flowDiagram-UKHOOZJN-y2e2HZHu.js} +1 -1
- package/dist/client/assets/{ganttDiagram-PKOTCBZU-D2siVjfa.js → ganttDiagram-PKOTCBZU-kZ3m3wwW.js} +1 -1
- package/dist/client/assets/{gh-utils-B0Nlmxep.js → gh-utils-DxPHIkD8.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-CIvIFcxR.js → gitGraphDiagram-DS77QQ5N-3Z9e4WPi.js} +1 -1
- package/dist/client/assets/{index-BOPi2b1j.js → index-ChKJF4C_.js} +3 -3
- package/dist/client/assets/index-WwGOu_aM.css +1 -0
- package/dist/client/assets/{infoDiagram-6WML65LV-DRvl8KfO.js → infoDiagram-6WML65LV-TfCo0Rhw.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-H5EQq6uE.js → ishikawaDiagram-WSZJBQD7-DaXI89rw.js} +1 -1
- package/dist/client/assets/{journeyDiagram-NVQOT4AX-CCwLmD-U.js → journeyDiagram-NVQOT4AX-C4jS6BVn.js} +1 -1
- package/dist/client/assets/{kanban-definition-27J2QSJJ-DS--XHEu.js → kanban-definition-27J2QSJJ-bwOtQiC8.js} +1 -1
- package/dist/client/assets/{linear-Q3JNM6CR.js → linear-DfZM9J6Z.js} +1 -1
- package/dist/client/assets/{mermaid.core-EwS_m22C.js → mermaid.core-B-iLnCqi.js} +4 -4
- package/dist/client/assets/{mindmap-definition-FAOFIHXS-D15nrwfe.js → mindmap-definition-FAOFIHXS-DAdKdypB.js} +1 -1
- package/dist/client/assets/{pegDiagram-VL7TDLO6-DOG19gxx.js → pegDiagram-VL7TDLO6-Bl95_ELH.js} +1 -1
- package/dist/client/assets/{pieDiagram-7S7Q4E2Y-Bstdr7Wh.js → pieDiagram-7S7Q4E2Y-DXf4GTLI.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-DfKs4qZW.js → quadrantDiagram-CIZ2JOQS-CDiwouFY.js} +1 -1
- package/dist/client/assets/{railroadDiagram-AXF67PYL-DJKxyuhV.js → railroadDiagram-AXF67PYL-CZAR7rja.js} +1 -1
- package/dist/client/assets/{render-markdown-C7X2TwRk.js → render-markdown-BiKX2Zdv.js} +1 -1
- package/dist/client/assets/{requirementDiagram-LRYGKXZP-SGJWVmBV.js → requirementDiagram-LRYGKXZP-BklWtcnl.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-W5VNT64P-CpZFct0O.js → sankeyDiagram-W5VNT64P-CpD7cM5j.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-SI44F4Z6-B7plRik9.js → sequenceDiagram-SI44F4Z6-BnHPNl9l.js} +1 -1
- package/dist/client/assets/{sizeCapture-X5ZJPWSS-CNbK285t.js → sizeCapture-X5ZJPWSS-D1eo0r-2.js} +1 -1
- package/dist/client/assets/{stateDiagram-OKZ733FA-BIHk9QCC.js → stateDiagram-OKZ733FA-ClTacl-d.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-DAo7Tfh9.js +1 -0
- package/dist/client/assets/{swimlanes-SLNWSIFB-7g_XCosC.js → swimlanes-SLNWSIFB-_PLbkM5u.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DHeOpgR_.js +8 -0
- package/dist/client/assets/{tanstack-B8_amOz8.js → tanstack-CtfgE41X.js} +1 -1
- package/dist/client/assets/{timeline-definition-Z64GVDOM-B-cgSggY.js → timeline-definition-Z64GVDOM-C9U6VikV.js} +1 -1
- package/dist/client/assets/{vennDiagram-T6HMQDX7-Bt5-8VZ2.js → vennDiagram-T6HMQDX7-Desj7KFU.js} +1 -1
- package/dist/client/assets/{viewer-tabs-DxCOe0ut.js → viewer-tabs-BwMhis6Q.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-T6FBY63Y-B5Imx6zh.js → wardleyDiagram-T6FBY63Y-rlMEd5tV.js} +1 -1
- package/dist/client/assets/{xychartDiagram-ELKLHX3M-CDaY4xFS.js → xychartDiagram-ELKLHX3M-CzFgA0NM.js} +1 -1
- package/dist/client/index.html +4 -4
- package/dist/dev.mjs +1 -1
- package/dist/manifest.json +1 -1
- package/dist/server.mjs +506 -212
- package/package.json +1 -1
- package/dist/client/assets/App-CBetJ5ZN.js +0 -74
- package/dist/client/assets/GitHubAvatar-DBc3Vxnk.js +0 -1
- package/dist/client/assets/HistoryView-DYxWYYVx.js +0 -1
- package/dist/client/assets/PullRequestViewer-KZl0osME.js +0 -2
- package/dist/client/assets/PullRequestsView-DkN3pW33.js +0 -1
- package/dist/client/assets/RepositoryProjectsDialog-F-EctLXx.js +0 -1
- package/dist/client/assets/Viewer-D-oFua7K.js +0 -3
- package/dist/client/assets/base-ui-qeHDA5zu.js +0 -1
- package/dist/client/assets/channel-DrMuSkDK.js +0 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-BKiL0hkR.js +0 -1
- package/dist/client/assets/classDiagram-v2-OCEON4UE-BKiL0hkR.js +0 -1
- package/dist/client/assets/index-CryuKDT3.css +0 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-Cqw0H5cq.js +0 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BzKpdiGK.js +0 -8
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./index-BOPi2b1j.js";import{r as n,j as a}from"./react-rd22PHbN.js";const r=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],u=e("outline","circle-check","CircleCheck",r);const i=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M10 10l4 4m0 -4l-4 4",key:"svg-1"}]],v=e("outline","circle-x","CircleX",i);const l=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],C=e("outline","clock","Clock",l);const d=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]],p=e("outline","user-circle","UserCircle",d);function g({src:c,className:t}){const[o,s]=n.useState(!1);return a.jsx("span",{className:t,"aria-hidden":"true",children:c&&!o?a.jsx("img",{src:c,alt:"",onError:()=>s(!0)}):a.jsx(p,{})})}export{g as G,u as I,v as a,C as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,j as e}from"./react-rd22PHbN.js";import{a as V}from"./tanstack-B8_amOz8.js";import{B as H,o as _,T as y,a as v,b as $,w as z,s as P}from"./index-BOPi2b1j.js";import{k as I,G as O,M as U,N as Y,O as B,P as W,Q as X,R as K}from"./App-CBetJ5ZN.js";import"./base-ui-qeHDA5zu.js";function Q(s){let n=[],t=0,c=1;const i=new Map,r=[];for(const u of s){let o=n.indexOf(u.oid);const j=o>=0;o<0&&(o=n.length,n=[...n,u.oid]);const x=n,g=q(i,u.oid,()=>t++),m=x.filter((l,h)=>h!==o);let d=Math.min(o,m.length);u.parentOids.forEach((l,h)=>{i.has(l)||i.set(l,h===0?g:t++),!m.includes(l)&&(m.splice(d,0,l),d+=1)});const N=[];x.forEach((l,h)=>{if(h===o){j&&N.push({fromLane:h,from:"top",toLane:o,to:"node",color:i.get(l)??g});return}const b=m.indexOf(l);b>=0&&N.push({fromLane:h,from:"top",toLane:b,to:"bottom",color:i.get(l)??0})}),u.parentOids.forEach(l=>{const h=m.indexOf(l);h>=0&&N.push({fromLane:o,from:"node",toLane:h,to:"bottom",color:i.get(l)??g})}),c=Math.max(c,x.length,m.length),r.push({lane:o,color:g,segments:N,continuations:m.map((l,h)=>({lane:h,color:i.get(l)??0}))}),n=m}return{rows:r,laneCount:c}}function q(s,n,t){const c=s.get(n);if(c!==void 0)return c;const i=t();return s.set(n,i),i}function pe({repositoryId:s,upstream:n,readOnly:t,operation:c,canPublish:i,pushBusy:r,onPublish:u,commits:o,nextCursor:j,loading:x,undoing:g,onSelectCommit:m,onSelectFile:d,onUndo:N,onMore:l}){const h=w.useRef(null),[b,R]=w.useState(new Set),E=w.useMemo(()=>Q(o??[]),[o]),T=Z(E.laneCount),C=V({count:o?.length??0,getScrollElement:()=>h.current,estimateSize:()=>52,getItemKey:p=>o?.[p]?.oid??p,overscan:8});return o===null?e.jsxs("div",{className:"view-loading",role:"status",children:[e.jsx(I,{className:"spinner"})," ",e.jsx(O,{text:"Loading history…"})]}):e.jsxs("div",{className:"history-list",children:[!n&&o.length>0&&e.jsxs("div",{className:"history-upstream-notice",role:"status",children:[e.jsx("span",{children:"Publish this branch to configure an upstream and distinguish local from published commits."}),i&&e.jsx(H,{variant:"outline",size:"xs",disabled:r||t||!!c,onClick:u,children:r?"Publishing…":"Publish branch"})]}),e.jsx("div",{ref:h,className:"history-scroll",role:"list","aria-label":"Commit history",children:o.length===0?e.jsx("p",{className:"empty-list",children:"This repository has no commits yet."}):e.jsxs("div",{className:"virtual-list",style:{height:C.getTotalSize()+(j?52:0)},children:[C.getVirtualItems().map(p=>{const a=o[p.index];return e.jsx("div",{ref:C.measureElement,"data-index":p.index,className:"virtual-row",style:{transform:`translateY(${p.start}px)`},children:e.jsx(J,{repositoryId:s,upstream:n,commit:a,graphRow:E.rows[p.index],graphWidth:T,expanded:b.has(a.oid),onExpandedChange:f=>R(G=>{const A=new Set(G);return f?A.add(a.oid):A.delete(a.oid),A}),canUndo:!t&&!c&&!g&&a.upstreamState==="local-only"&&a.isHead&&a.parentCount===1,onSelectCommit:m,onSelectFile:d,onUndo:N})},p.key)}),j&&e.jsx(H,{variant:"ghost",className:"history-more",style:{top:C.getTotalSize()},disabled:x,onClick:l,children:x?"Loading…":"Load more"})]})})]})}function J({repositoryId:s,upstream:n,commit:t,graphRow:c,graphWidth:i,expanded:r,onExpandedChange:u,canUndo:o,onSelectCommit:j,onSelectFile:x,onUndo:g}){const m=`${s}:${t.oid}`,[d,N]=w.useState(()=>U(m)??null),[l,h]=w.useState(null);w.useEffect(()=>{if(!r||d||l)return;let a=!0;return _.commits.files(s,t.oid).then(f=>{a&&(Y(m,f),N(f))}).catch(f=>{a&&h(ce(f))}),()=>{a=!1}},[m,t.oid,r,d,l,s]);const b=ne(t.decorations),R=b.slice(0,3),E=b.slice(3),T=d?.reduce((a,f)=>a+f.additions,0)??0,C=d?.reduce((a,f)=>a+f.deletions,0)??0,p=async()=>{try{await z(t.oid),P.success({title:"Hash copied",description:t.oid})}catch{P.error({title:"Could not copy hash"})}};return e.jsxs("div",{className:"commit-item",role:"listitem",children:[e.jsxs("div",{className:"commit-header",children:[e.jsx(ee,{graph:c,width:i}),e.jsx("button",{className:"commit-expand","aria-expanded":r,"aria-label":r?"Collapse commit":"Expand commit",onClick:()=>u(!r),children:e.jsx(B,{className:`folder-chevron ${r?"open":""}`})}),e.jsxs("div",{className:"commit-main",children:[e.jsxs("span",{className:"commit-title-row",children:[e.jsxs(y,{children:[e.jsx(v,{render:e.jsx("button",{className:"commit-subject",onClick:()=>j(t)}),children:t.subject||"(no subject)"}),e.jsx($,{side:"right",children:"View the full commit diff"})]}),e.jsxs(y,{children:[e.jsx(v,{render:e.jsx("span",{className:"commit-date"}),children:oe(t.date)}),e.jsx($,{children:re(t.date)})]})]}),e.jsxs("span",{className:"commit-meta",children:[e.jsxs(y,{children:[e.jsx(v,{render:e.jsx("button",{className:"commit-oid",onClick:()=>{p()},"aria-label":`Copiar hash ${t.shortOid}`}),children:t.shortOid}),e.jsx($,{children:"Copy full hash"})]}),e.jsx("span",{className:"commit-author",children:t.author}),(b.length>0||t.parentCount>1||t.upstreamState==="local-only")&&e.jsxs("span",{className:"commit-refs",children:[t.upstreamState==="local-only"&&e.jsxs(y,{children:[e.jsx(v,{render:e.jsx("span",{className:"ref-chip local-only"}),children:"Local"}),e.jsx($,{children:t.isHead?`Not in ${n??"the upstream"} according to the latest known remote state.`:"Not published. To avoid rewriting multiple commits, only the latest can be undone."})]}),t.parentCount>1&&e.jsx("span",{className:"ref-chip merge",children:"merge"}),R.map(a=>e.jsx("span",{className:`ref-chip ${a.kind}`,children:a.label},`${a.kind}:${a.label}`)),E.length>0&&e.jsxs(y,{children:[e.jsxs(v,{render:e.jsx("span",{className:"ref-chip more"}),children:["+",E.length]}),e.jsx($,{children:E.map(a=>a.label).join(" · ")})]})]})]})]}),o&&e.jsxs(y,{children:[e.jsx(v,{render:e.jsx(H,{variant:"ghost",size:"icon-xs",className:"change-action-button commit-undo",onClick:a=>{a.stopPropagation(),g(t)},"aria-label":`Undo commit ${t.shortOid}`}),children:e.jsx(W,{})}),e.jsx($,{children:"Undo commit and keep its changes staged"})]})]}),r&&c.continuations.length>0&&e.jsx(se,{graph:c,width:i}),r&&e.jsxs("div",{className:"commit-files",style:{paddingLeft:i+31},children:[t.body&&e.jsx("p",{className:"commit-description",children:t.body}),l&&e.jsx("div",{className:"commit-files-message error",children:l}),!d&&!l&&e.jsxs("div",{className:"commit-files-message",children:[e.jsx(I,{className:"spinner"})," ",e.jsx(O,{text:"Loading files…"})]}),d&&d.length===0&&e.jsx("div",{className:"commit-files-message",children:"This commit does not modify its own files (merge)."}),d&&d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"commit-files-summary",children:[d.length," ",d.length===1?"file":"files",(T>0||C>0)&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("span",{className:"add",children:["+",T]})," ",e.jsxs("span",{className:"del",children:["−",C]})]})]}),d.map(a=>e.jsx(te,{file:a,onSelect:()=>x(t.oid,a)},a.path))]})]})]})}const M=10,S=26,F=52,D=["var(--primary)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Z(s){return 14+Math.max(0,s-1)*M}function k(s){return 7+s*M}function L(s){return D[s%D.length]}function ee({graph:s,width:n}){return e.jsxs("svg",{className:"commit-graph",width:n,height:F,viewBox:`0 0 ${n} ${F}`,"aria-hidden":"true",children:[s.segments.map((t,c)=>{const i=k(t.fromLane),r=k(t.toLane),u=t.from==="top"?0:S,o=t.to==="node"?S:F,j=(u+o)/2,x=i===r?`M ${i} ${u} L ${r} ${o}`:`M ${i} ${u} C ${i} ${j}, ${r} ${j}, ${r} ${o}`;return e.jsx("path",{d:x,stroke:L(t.color)},`${c}:${x}`)}),e.jsx("circle",{cx:k(s.lane),cy:S,r:"4",fill:"var(--sidebar)",stroke:L(s.color)}),e.jsx("circle",{cx:k(s.lane),cy:S,r:"1.5",fill:L(s.color)})]})}function se({graph:s,width:n}){return e.jsx("svg",{className:"commit-graph-continuation",width:n,viewBox:`0 0 ${n} 100`,preserveAspectRatio:"none","aria-hidden":"true",children:s.continuations.map(t=>e.jsx("line",{x1:k(t.lane),y1:"0",x2:k(t.lane),y2:"100",stroke:L(t.color)},t.lane))})}function te({file:s,onSelect:n}){const t=w.useRef(null),c=s.path.lastIndexOf("/"),i=c<0?s.path:s.path.slice(c+1),r=s.oldPath?.split("/").pop();return e.jsxs("div",{ref:t,className:"commit-file-row",children:[e.jsxs(y,{children:[e.jsxs(v,{render:e.jsx("button",{className:"commit-file-label",onClick:n,"aria-label":`Ver el diff de ${s.path}`}),children:[e.jsx(le,{path:s.path,type:"file"}),e.jsxs("span",{className:"commit-file-text",children:[e.jsx("span",{children:i}),r&&e.jsxs("small",{className:"commit-file-rename",children:[r," →"]})]})]}),e.jsx($,{anchor:t,side:"right",sideOffset:10,children:s.oldPath?`${s.oldPath} → ${s.path}`:s.path})]}),e.jsx("span",{className:"commit-file-stats",children:s.binary?e.jsx("span",{className:"binary",children:"bin"}):e.jsxs(e.Fragment,{children:[s.additions>0&&e.jsxs("span",{className:"add",children:["+",s.additions]}),s.deletions>0&&e.jsxs("span",{className:"del",children:["−",s.deletions]})]})}),e.jsx("span",{className:"status-code","data-kind":s.kind,children:X(s.kind)})]})}function ne(s){return s.map(n=>n.startsWith("tag: ")?{label:n.slice(5),kind:"tag"}:n.startsWith("HEAD -> ")?{label:n.slice(8),kind:"head"}:n==="HEAD"?{label:"HEAD",kind:"head"}:{label:n,kind:n.includes("/")?"remote":"branch"})}const ae=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),ie=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function oe(s){const n=new Date(s);if(Number.isNaN(n.getTime()))return s;const t=Math.round((n.getTime()-Date.now())/1e3);for(const[c,i]of ie)if(Math.abs(t)>=i)return ae.format(Math.trunc(t/i),c);return"right now"}function re(s){const n=new Date(s);return Number.isNaN(n.getTime())?s:new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}).format(n)}function le({path:s}){return e.jsx("img",{className:"vscode-tree-icon",src:K(s),alt:"","aria-hidden":"true",draggable:!1})}function ce(s){return s instanceof Error?s.message:"An unexpected error occurred."}export{pe as HistoryView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestDiff-CgY4QIHC.js","assets/react-rd22PHbN.js","assets/tanstack-B8_amOz8.js","assets/base-ui-qeHDA5zu.js","assets/index-BOPi2b1j.js","assets/index-CryuKDT3.css","assets/App-CBetJ5ZN.js","assets/DiffWorkspace-BWkTIl5n.js","assets/PierreWorkerPool-BuBzE8K1.js","assets/platform-BMNQ8V5r.js","assets/one-light-CoLDteqg.js","assets/index-BgLrS_2D.js","assets/index-CtEztN1P.js","assets/EditContext-CvJWfVl1.js","assets/render-markdown-C7X2TwRk.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as D,B as C,T as S,a as H,b as F,_ as R,o as k,q as T}from"./index-BOPi2b1j.js";import{r as j,j as e}from"./react-rd22PHbN.js";import{u as q}from"./tanstack-B8_amOz8.js";import{l as V,k as h,G as p,B as I,h as M,t as $,z as O}from"./App-CBetJ5ZN.js";import{V as B,a as z,b as x}from"./viewer-tabs-DxCOe0ut.js";import{p as K,r as Q,o as U}from"./gh-utils-B0Nlmxep.js";import{G as _,I as X,a as J,b as W}from"./GitHubAvatar-DBc3Vxnk.js";/* empty css */import"./base-ui-qeHDA5zu.js";const Y=[["path",{d:"M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3",key:"svg-1"}]],Z=D("outline","tag","Tag",Y),ee=j.lazy(()=>R(()=>import("./PullRequestDiff-CgY4QIHC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function me({repositoryId:r,prNumber:i,diffView:n,themeType:d,wrapLines:l,onDiffViewChange:m,onWrapLinesChange:o,onClose:P}){const[v,E]=j.useState("summary"),t=q({queryKey:T.pullRequest(r,i),queryFn:async()=>{const a=await k.github.getPullRequest(r,i),A=a.body.trim()?await R(async()=>{const{renderMarkdown:u}=await import("./render-markdown-C7X2TwRk.js").then(G=>G.a);return{renderMarkdown:u}},__vite__mapDeps([14,6,4,1,2,3,5,10,11])).then(({renderMarkdown:u})=>u(a.body)).catch(()=>"<p>Could not render the description.</p>"):"";return{details:a,bodyHtml:A}}}),s=t.data?.details??null,f=t.data?.bodyHtml??"",N=t.error instanceof Error?t.error.message:t.error?"Could not load the pull request.":null,c=q({queryKey:T.pullRequestDiff(r,i),queryFn:()=>k.github.getPullRequestDiff(r,i),enabled:v==="diff"&&s!==null}),b=c.data??null,g=c.error instanceof Error?c.error.message:c.error?"Could not load the diff.":null;if(N)return e.jsxs("div",{className:"viewer-message flex-col gap-3",children:[e.jsx("p",{className:"text-destructive",children:N}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>{t.refetch()},children:[e.jsx(V,{})," Try again"]})]});if(!s)return e.jsxs("div",{className:"viewer-message",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(p,{text:`Loading pull request #${i}…`})]});const w=K(s),y=Q(s.reviewDecision);return e.jsxs(B,{value:v,onValueChange:a=>E(a),className:"pr-viewer",children:[e.jsxs("header",{className:"pr-viewer-header",children:[e.jsxs("div",{className:"pr-viewer-overview",children:[e.jsxs("div",{className:"pr-viewer-title",children:[e.jsx(I,{variant:s.state==="OPEN"&&!s.isDraft?"default":"secondary",className:`pr-state-badge ${w.toLowerCase().replace(/\s+/g,"-")}`,children:w}),e.jsxs("h2",{children:[s.title||"(no title)"," ",e.jsxs("span",{className:"pr-number",children:["#",s.number]})]})]}),e.jsxs("div",{className:"pr-viewer-meta",children:[e.jsxs("span",{className:"pr-author-with-avatar",children:[e.jsx(_,{src:s.authorAvatarUrl,className:"pr-author-avatar"},s.authorAvatarUrl),e.jsx("span",{className:"pr-author",children:s.author})]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{children:["updated ",L(s.updatedAt)]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{className:"pr-branches",children:[e.jsx(M,{"aria-hidden":"true"})," ",s.headRefName," → ",s.baseRefName]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{className:"pr-counters",children:[s.changedFiles," ",s.changedFiles===1?"file":"files"," ",e.jsxs("span",{className:"add",children:["+",s.additions]})," ",e.jsxs("span",{className:"del",children:["−",s.deletions]})]}),e.jsx(se,{state:s.checksState}),y&&e.jsx(I,{variant:"outline",className:"pr-review-badge",children:y}),e.jsx("span",{className:"pr-viewer-actions",children:e.jsxs(C,{variant:"outline",size:"xs",onClick:()=>U(s.url),children:[e.jsx($,{})," Open on GitHub"]})})]}),s.labels.length>0&&e.jsxs("div",{className:"pr-labels","aria-label":"Pull request labels",children:[e.jsx(Z,{"aria-hidden":"true"}),s.labels.map(a=>e.jsx("span",{className:"pr-label",style:{borderColor:`#${a.color}`,backgroundColor:`#${a.color}22`},children:a.name},`${a.name}-${a.color}`))]})]}),e.jsx(z,{label:"Pull request view",className:"markdown-viewer-tabs pr-viewer-tabs",items:[{value:"summary",label:"Summary"},{value:"timeline",label:"Timeline"},{value:"diff",label:"Code"}]})]}),e.jsx(x,{value:"summary",className:"markdown-preview-scroll pr-description-scroll",children:e.jsx("section",{className:"pr-summary-section",children:f?e.jsx("div",{className:"markdown-prose",dangerouslySetInnerHTML:{__html:f}}):e.jsx("p",{className:"pr-empty-description",children:"This pull request has no description."})})}),e.jsx(x,{value:"timeline",className:"markdown-preview-scroll pr-description-scroll",children:e.jsxs("section",{className:"pr-timeline standalone","aria-label":"Commit timeline",children:[e.jsxs("h3",{children:[e.jsx(O,{"aria-hidden":"true"})," Commits ",e.jsx("span",{children:s.commits.length})]}),s.commits.length?s.commits.map(a=>e.jsxs("article",{className:"pr-timeline-item",children:[e.jsx("span",{className:"pr-timeline-rail",children:e.jsx("span",{})}),e.jsx(_,{src:a.authorAvatarUrl,className:"pr-commit-avatar"}),e.jsxs("span",{className:"pr-commit-content",children:[e.jsx("strong",{children:a.messageHeadline||"(no commit message)"}),e.jsxs("span",{children:[e.jsx("b",{children:a.author})," committed ",L(a.authoredAt)]})]}),e.jsxs(S,{children:[e.jsx(H,{render:e.jsx("code",{}),children:a.oid.slice(0,7)}),e.jsx(F,{children:a.oid})]})]},a.oid)):e.jsx("p",{className:"pr-empty-description",children:"No commits were returned by GitHub."})]})}),e.jsx(x,{value:"diff",className:"pr-diff-panel",children:g?e.jsx("div",{className:"viewer-message text-destructive",children:g}):b?e.jsx(j.Suspense,{fallback:e.jsxs("div",{className:"viewer-message",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(p,{text:"Loading diff viewer…"})]}),children:e.jsx(ee,{diff:b,prNumber:s.number,repositoryId:r,commits:s.commits,diffView:n,themeType:d,wrapLines:l,onDiffViewChange:m,onWrapLinesChange:o,onClose:P})}):e.jsxs("div",{className:"viewer-message",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(p,{text:"Loading diff…"})]})})]})}function se({state:r}){if(r==="NONE")return null;const i=r==="PASSING"?X:r==="FAILING"?J:W,n=r==="PASSING"?"Checks passing":r==="FAILING"?"Checks failing":"Checks pending";return e.jsxs("span",{className:`pr-checks ${r.toLowerCase()}`,children:[e.jsx(i,{"aria-hidden":"true"})," ",n]})}function L(r){const i=Date.parse(r);if(!Number.isFinite(i))return r;const n=Math.round((i-Date.now())/1e3),d=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]],l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[m,o]of d)if(Math.abs(n)>=o)return l.format(Math.round(n/o),m);return l.format(n,"second")}export{me as PullRequestViewer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as b}from"./react-rd22PHbN.js";import{a as p}from"./tanstack-B8_amOz8.js";import{c as N,B as t,I as f,T as c,a as o,b as u}from"./index-BOPi2b1j.js";import{C as k}from"./checkbox-BwbxYGgK.js";import{k as h,G as x,l as j,a1 as I,T as y,t as S}from"./App-CBetJ5ZN.js";import{o as w}from"./gh-utils-B0Nlmxep.js";import{G,I as P,a as R,b as E}from"./GitHubAvatar-DBc3Vxnk.js";import{P as L,i as O,j as T,k as D,l as M}from"./base-ui-qeHDA5zu.js";const z=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],d=N("outline","brand-github","BrandGithub",z);const q=[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227",key:"svg-0"}]],$=N("outline","filter","Filter",q);const A=[["path",{d:"M5 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M5 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M7 8l0 8",key:"svg-3"}],["path",{d:"M7 8a4 4 0 0 0 4 4h4",key:"svg-4"}]],H=N("outline","git-merge","GitMerge",A);function ae(s){return s.info===null?e.jsxs("div",{className:"view-loading",role:"status",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(x,{text:"Checking repository…"})]}):s.info.isGitHub?s.ghStatus===null?e.jsxs("div",{className:"view-loading",role:"status",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(x,{text:"Checking GitHub CLI…"})]}):s.ghStatus.installed?s.ghStatus.authStatus==="unauthenticated"?e.jsxs(m,{icon:e.jsx(d,{}),title:"Sign in to GitHub CLI",children:["Run ",e.jsx("code",{children:"gh auth login"})," in a terminal to authenticate, then check again.",e.jsxs("span",{className:"pulls-notice-actions",children:[e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>s.onCopyCommand("gh auth login"),children:[e.jsx(f,{})," Copy command"]}),e.jsxs(t,{variant:"ghost",size:"sm",onClick:s.onRefresh,children:[e.jsx(j,{})," Check again"]})]})]}):e.jsx(F,{...s,nameWithOwner:s.info.nameWithOwner??""}):e.jsxs(m,{icon:e.jsx(d,{}),title:"GitHub CLI is required",children:["OpenTig uses your local ",e.jsx("code",{children:"gh"})," session to read and create pull requests. It does not copy or store credentials.",e.jsxs("span",{className:"pulls-notice-actions",children:[e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>s.onCopyCommand("winget install GitHub.cli"),children:[e.jsx(f,{})," Copy install command"]}),e.jsxs(t,{variant:"ghost",size:"sm",onClick:s.onRefresh,children:[e.jsx(j,{})," Check again"]})]}),e.jsx("small",{children:"Download from cli.github.com, then check again."})]}):e.jsxs(m,{icon:e.jsx(d,{}),title:"Not a GitHub repository",children:["The ",e.jsx("code",{children:"origin"})," remote does not point to github.com, so pull requests are unavailable here."]})}function F(s){const l=b.useRef(null),n=s.pulls,i=p({count:n?.length??0,getScrollElement:()=>l.current,estimateSize:()=>68,getItemKey:a=>n?.[a]?.number??a,overscan:8});return e.jsxs("div",{className:"pulls-view",children:[e.jsxs("div",{className:"pulls-toolbar",children:[e.jsxs(c,{children:[e.jsxs(o,{render:e.jsx("span",{className:"pulls-repo"}),children:[e.jsx(d,{"aria-hidden":"true"})," ",s.nameWithOwner]}),e.jsx(u,{children:s.nameWithOwner})]}),e.jsxs(c,{children:[e.jsx(o,{render:e.jsx(t,{variant:"ghost",size:"icon-xs",className:"change-action-button",disabled:s.loading,onClick:s.onRefresh,"aria-label":"Refresh pull requests"}),children:s.loading?e.jsx(h,{className:"animate-spin"}):e.jsx(j,{})}),e.jsx(u,{children:"Refresh pull requests"})]}),e.jsxs(L,{children:[e.jsx(O,{render:e.jsx(t,{variant:v(s.states)?"ghost":"secondary",size:"icon-xs",className:"change-action-button","aria-label":"Filter pull requests","aria-pressed":!v(s.states)}),children:e.jsx($,{})}),e.jsx(T,{children:e.jsx(D,{side:"bottom",align:"end",sideOffset:4,className:"isolate z-50 outline-none",children:e.jsxs(M,{className:"pulls-filter-popup",children:[e.jsx("span",{className:"pulls-filter-title",children:"State"}),["OPEN","CLOSED","MERGED"].map(a=>e.jsxs("label",{htmlFor:`pulls-state-${a.toLowerCase()}`,className:"pulls-filter-option",children:[e.jsx(k,{id:`pulls-state-${a.toLowerCase()}`,checked:s.states.includes(a),onCheckedChange:r=>s.onStateChange(a,r===!0)}),e.jsx(C,{state:a,className:a.toLowerCase()}),e.jsx("span",{children:a==="OPEN"?"Open":a==="CLOSED"?"Closed":"Merged"})]},a))]})})})]}),e.jsxs(c,{children:[e.jsxs(o,{render:e.jsx(t,{variant:"outline",size:"xs",disabled:!!s.createDisabledReason||s.loading,onClick:s.onCreate,"aria-label":"Create pull request"}),children:[e.jsx(I,{})," New"]}),e.jsx(u,{children:s.createDisabledReason??"Create a pull request from the current branch"})]})]}),s.error&&e.jsxs("div",{className:"pulls-error",role:"alert",children:[e.jsx("span",{children:s.error}),e.jsx(t,{variant:"ghost",size:"xs",onClick:s.onRefresh,children:"Retry"})]}),e.jsx("div",{ref:l,className:"pulls-scroll",role:"list","aria-label":`${s.states.map(g).join(", ")||"No"} pull requests`,children:n===null&&!s.error?e.jsxs("div",{className:"view-loading",role:"status",children:[e.jsx(h,{className:"spinner"})," ",e.jsx(x,{text:"Loading pull requests…"})]}):n!==null&&n.length===0?e.jsx("p",{className:"empty-list",children:s.states.length?`No ${s.states.map(a=>g(a).toLowerCase()).join(", ")} pull requests.`:"Select at least one PR state."}):n!==null&&e.jsx("div",{className:"virtual-list",style:{height:i.getTotalSize()},children:i.getVirtualItems().map(a=>{const r=n[a.index];return e.jsx("div",{ref:i.measureElement,"data-index":a.index,className:"virtual-row",style:{transform:`translateY(${a.start}px)`},children:e.jsx(_,{pr:r,active:s.activeNumber===r.number,onSelect:s.onSelect})},a.key)})})})]})}function _({pr:s,active:l,onSelect:n}){const i=s.state.toLowerCase(),a=W(s.updatedAt);return e.jsxs("div",{className:`pull-item ${l?"active":""}`,role:"listitem",children:[e.jsxs("button",{className:"pull-main",onClick:()=>n(s),"aria-label":`View pull request #${s.number}`,children:[e.jsx("span",{className:`pull-state-icon ${i}${s.isDraft?" draft":""}`,"aria-label":s.isDraft?"Draft":g(s.state),children:e.jsx(C,{state:s.state})}),e.jsxs("span",{className:"pull-content",children:[e.jsx("span",{className:"pull-title",children:s.title||"(no title)"}),e.jsxs("span",{className:"pull-meta",children:[e.jsxs("span",{className:"pull-number",children:["#",s.number]}),e.jsx(G,{src:s.authorAvatarUrl,className:"pull-avatar"}),e.jsx("span",{className:"pull-author",children:s.author}),e.jsx(V,{state:s.checksState}),s.isDraft&&e.jsx("span",{className:"pull-draft-label",children:"Draft"})]})]}),e.jsxs("span",{className:"pull-row-aside",children:[a&&e.jsx("span",{children:a}),e.jsxs("span",{className:"pull-line-stats",children:[e.jsxs("span",{className:"add",children:["+",s.additions]})," ",e.jsxs("span",{className:"del",children:["−",s.deletions]})]})]})]}),e.jsxs(c,{children:[e.jsx(o,{render:e.jsx(t,{variant:"ghost",size:"icon-xs",className:"change-action-button pull-open-external",onClick:()=>w(s.url),"aria-label":`Open #${s.number} on GitHub`}),children:e.jsx(S,{})}),e.jsx(u,{children:"Open on GitHub"})]})]})}function C({state:s,className:l}){return s==="MERGED"?e.jsx(H,{"aria-hidden":"true",className:l}):e.jsx(y,{"aria-hidden":"true",className:l})}function V({state:s}){if(s==="NONE")return null;const l=s==="PASSING"?"Checks passing":s==="FAILING"?"Checks failing":"Checks pending",n=s==="PASSING"?P:s==="FAILING"?R:E;return e.jsx("span",{className:`pull-checks ${s.toLowerCase()}`,"aria-label":l,children:e.jsx(n,{"aria-hidden":"true"})})}function g(s){return s==="OPEN"?"Open":s==="CLOSED"?"Closed":"Merged"}function v(s){return s.length===1&&s[0]==="OPEN"}function m({icon:s,title:l,children:n}){return e.jsxs("div",{className:"pulls-notice",children:[e.jsx("span",{className:"pulls-notice-icon","aria-hidden":"true",children:s}),e.jsx("strong",{children:l}),e.jsx("p",{children:n})]})}const B=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),U=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function W(s){const l=new Date(s);if(Number.isNaN(l.getTime()))return null;const n=Math.round((l.getTime()-Date.now())/1e3);for(const[i,a]of U)if(Math.abs(n)>=a)return B.format(Math.trunc(n/a),i);return"right now"}export{ae as PullRequestsView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./react-rd22PHbN.js";import{D as Z,c as q,d as Q,e as ee,g as I,I as se,m as k,Z as P,k as z,_,y as E,$ as ne,S as ae,C as ie,A as re,E as oe,F as O,a0 as te}from"./App-CBetJ5ZN.js";import{c as M,B as r,T as w,a as C,b as R,o as h}from"./index-BOPi2b1j.js";import{I as le}from"./IconFolderPlus-1vLDIzhC.js";import"./tanstack-B8_amOz8.js";import"./base-ui-qeHDA5zu.js";const ce=[["path",{d:"M3 21v-4a3 3 0 0 1 3 -3h5",key:"svg-0"}],["path",{d:"M8 17l3 -3l-3 -3",key:"svg-1"}],["path",{d:"M3 11v-5a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8",key:"svg-2"}]],de=M("outline","folder-symlink","FolderSymlink",ce);const me=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],he=M("outline","pencil","Pencil",me),B="__opentig_no_project__";function ve({open:l,projects:c,repositories:v,onOpenChange:L,onOrganizationChange:A,onForgetRepository:G,onRelocateRepository:S}){const[J,u]=o.useState(null),[x,f]=o.useState(null),[N,D]=o.useState(""),[g,d]=o.useState(null),[b,T]=o.useState(""),[K,p]=o.useState(null),[n,y]=o.useState(null),[$,m]=o.useState(null),V=o.useMemo(()=>new Map(c.flatMap(s=>s.repositoryKeys.map(a=>[a,s.id]))),[c]);o.useEffect(()=>{l||(u(null),f(null),d(null),p(null),m(null))},[l]);const j=async(s,a)=>{y(s),m(null);try{const t=await a();return A(t),!0}catch(t){return m(F(t)),!1}finally{y(null)}},W=async s=>{s.preventDefault();const a=N.trim();!a||n||await j("create",()=>h.projects.create(a))&&D("")},X=async s=>{s.preventDefault();const a=b.trim();!g||!a||n||await j(`rename:${g}`,()=>h.projects.rename(g,a))&&d(null)},H=async s=>{n||await j(`remove:${s}`,()=>h.projects.remove(s))&&p(null)},U=async(s,a)=>{n||await j(`assign:${s}`,()=>h.projects.assign(s,a))},Y=async s=>{if(!n){if(m(null),!window.opentigDesktop){f(s);return}y(`relocate:${s.key}`);try{const a=await h.repository.select(`Relocate ${s.name}`);a&&await S(s,a)}catch(a){m(F(a))}finally{y(null)}}};return e.jsxs(Z,{open:l,onOpenChange:s=>{n||L(s)},children:[e.jsxs(q,{className:"repository-projects-dialog w-[min(660px,calc(100vw-2.5rem))]",children:[e.jsxs("header",{className:"repository-projects-header",children:[e.jsxs("div",{children:[e.jsx(Q,{children:"Manage projects"}),e.jsx(ee,{children:"Group repositories, update their locations, or remove them from OpenTig. Files stay on disk."})]}),e.jsx(I,{render:e.jsx(r,{variant:"ghost",size:"icon-sm","aria-label":"Close project management",disabled:!!n}),children:e.jsx(se,{})})]}),e.jsxs("div",{className:"repository-projects-body",children:[$&&e.jsxs("div",{className:"repository-projects-error",role:"alert",children:[e.jsx(k,{"aria-hidden":"true"}),e.jsx("span",{children:$})]}),e.jsxs("section",{className:"repository-projects-section","aria-labelledby":"projects-heading",children:[e.jsxs("div",{className:"repository-projects-section-heading",children:[e.jsxs("h3",{id:"projects-heading",children:["Projects ",e.jsx("span",{children:c.length})]}),e.jsxs("form",{className:"repository-project-create",onSubmit:s=>{W(s)},children:[e.jsx("label",{className:"sr-only",htmlFor:"new-project-name",children:"Project name"}),e.jsx("input",{id:"new-project-name",value:N,maxLength:P,onChange:s=>D(s.target.value),placeholder:"New project name",disabled:!!n}),e.jsxs(r,{type:"submit",size:"sm",disabled:!N.trim()||!!n,children:[n==="create"?e.jsx(z,{className:"animate-spin"}):e.jsx(le,{})," Create"]})]})]}),e.jsxs("div",{className:"repository-project-list",children:[c.length===0&&e.jsx("p",{className:"repository-projects-empty",children:"No projects yet. Create one to group related repositories."}),c.map(s=>{const a=s.repositoryKeys.length,t=n===`rename:${s.id}`||n===`remove:${s.id}`;return e.jsx("div",{className:"repository-project-row","aria-busy":t||void 0,children:g===s.id?e.jsxs("form",{className:"repository-inline-form",onSubmit:i=>{X(i)},onKeyDown:i=>{i.key==="Escape"&&d(null)},children:[e.jsxs("label",{className:"sr-only",htmlFor:`rename-project-${s.id}`,children:["Rename ",s.name]}),e.jsx("input",{id:`rename-project-${s.id}`,autoFocus:!0,value:b,maxLength:P,onChange:i=>T(i.target.value),disabled:!!n}),e.jsx(r,{type:"submit",size:"xs",disabled:!b.trim()||!!n,children:"Save"}),e.jsx(r,{type:"button",variant:"ghost",size:"xs",onClick:()=>d(null),disabled:!!n,children:"Cancel"})]}):K===s.id?e.jsxs("div",{className:"repository-project-confirm",role:"alert",children:[e.jsx(k,{"aria-hidden":"true"}),e.jsxs("span",{children:["Delete ",e.jsx("strong",{children:s.name}),"? Its repositories stay available, just ungrouped."]}),e.jsx(r,{variant:"destructive",size:"xs",disabled:!!n,onClick:()=>{H(s.id)},children:"Delete"}),e.jsx(r,{variant:"ghost",size:"xs",disabled:!!n,onClick:()=>p(null),children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"repository-project-icon","aria-hidden":"true",children:e.jsx(_,{})}),e.jsxs("span",{className:"repository-project-copy",children:[e.jsx("strong",{children:s.name}),e.jsxs("small",{children:[a," ",a===1?"repository":"repositories"]})]}),e.jsxs("span",{className:"repository-row-actions",children:[e.jsx(r,{variant:"ghost",size:"icon-sm","aria-label":`Rename ${s.name}`,disabled:!!n,onClick:()=>{d(s.id),T(s.name),p(null)},children:e.jsx(he,{})}),e.jsx(r,{variant:"ghost",size:"icon-sm",className:"repository-row-delete","aria-label":`Delete ${s.name}`,disabled:!!n,onClick:()=>{p(s.id),d(null)},children:e.jsx(E,{})})]})]})},s.id)})]})]}),e.jsxs("section",{className:"repository-projects-section","aria-labelledby":"repository-assignments-heading",children:[e.jsxs("div",{className:"repository-projects-section-heading",children:[e.jsxs("h3",{id:"repository-assignments-heading",children:["Repositories ",e.jsx("span",{children:v.length})]}),e.jsx("p",{children:"One project per repository"})]}),e.jsxs("div",{className:"repository-assignment-list",children:[v.length===0&&e.jsx("p",{className:"repository-projects-empty",children:"No recent repositories to assign yet."}),v.map(s=>{const a=V.get(s.key)??B,t=n?.endsWith(`:${s.key}`);return e.jsx("div",{className:"repository-assignment-row","aria-busy":t||void 0,children:J===s.key?e.jsxs("div",{className:"repository-project-confirm",role:"alert",children:[e.jsx(k,{"aria-hidden":"true"}),e.jsxs("span",{children:["Remove ",e.jsx("strong",{children:s.name})," and its worktrees from OpenTig? Their folders and files stay on disk. You can open them again later."]}),e.jsx(r,{variant:"destructive",size:"xs",disabled:!!n,onClick:()=>{j(`forget:${s.key}`,()=>G(s)).then(i=>{i&&u(null)})},children:"Remove"}),e.jsx(r,{variant:"ghost",size:"xs",disabled:!!n,onClick:()=>u(null),children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx(_,{"aria-hidden":"true"}),e.jsxs("span",{className:"repository-assignment-copy",children:[e.jsx("strong",{children:s.name}),e.jsxs(w,{children:[e.jsx(C,{render:e.jsx("small",{}),children:ne(s.rootPath,4)}),e.jsx(R,{children:s.rootPath})]})]}),t&&e.jsx(z,{className:"repository-assignment-busy animate-spin","aria-hidden":"true"}),e.jsxs(ae,{value:a,onValueChange:i=>{U(s.key,i===B?null:i)},disabled:!!n,children:[e.jsx(ie,{size:"sm","aria-label":`Project for ${s.name}`,children:e.jsx(re,{children:c.find(i=>i.id===a)?.name??"No project"})}),e.jsxs(oe,{align:"end",alignItemWithTrigger:!1,children:[e.jsx(O,{value:B,children:"No project"}),c.map(i=>e.jsx(O,{value:i.id,children:i.name},i.id))]})]}),e.jsxs("span",{className:"repository-management-actions",children:[e.jsxs(w,{children:[e.jsx(C,{render:e.jsx(r,{variant:"ghost",size:"icon-sm","aria-label":`Relocate ${s.name}`,disabled:!!n,onClick:()=>{Y(s)}}),children:e.jsx(de,{})}),e.jsx(R,{children:"Relocate repository"})]}),e.jsxs(w,{children:[e.jsx(C,{render:e.jsx(r,{variant:"ghost",size:"icon-sm","aria-label":`Remove ${s.name} from OpenTig`,disabled:!!n,onClick:()=>{u(s.key),m(null)}}),children:e.jsx(E,{})}),e.jsx(R,{children:"Remove from OpenTig"})]})]})]})},s.key)})]})]})]}),e.jsx("footer",{className:"repository-projects-footer",children:e.jsx(I,{render:e.jsx(r,{variant:"outline",size:"sm",disabled:!!n}),children:"Done"})})]}),e.jsx(te,{open:x!==null,onOpenChange:s=>{s||f(null)},title:"Relocate repository",description:`Choose the existing server folder for ${x?.name??"this repository"}. This updates its saved location; it does not move files.`,confirmLabel:"Use this folder",onBrowse:h.repository.browseDirectories,onOpen:async s=>{x&&await S(x,s)}})]})}function F(l){return l instanceof Error?l.message:String(l)}export{ve as RepositoryProjectsDialog};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PierreDiffViewer-uhTsb-F7.js","assets/react-rd22PHbN.js","assets/PierreWorkerPool-BuBzE8K1.js","assets/platform-BMNQ8V5r.js","assets/one-light-CoLDteqg.js","assets/index-BgLrS_2D.js","assets/index-BOPi2b1j.js","assets/tanstack-B8_amOz8.js","assets/base-ui-qeHDA5zu.js","assets/index-CryuKDT3.css","assets/index-CtEztN1P.js","assets/File-DiOOsHOl.js","assets/EditContext-CvJWfVl1.js","assets/DiffWorkspace-BWkTIl5n.js","assets/App-CBetJ5ZN.js","assets/PierreEditBoundary-Bb4dONIq.js","assets/edit-ready-context-D77R8XU8.js","assets/MarkdownFileViewer-BedKCXTI.js","assets/viewer-tabs-DxCOe0ut.js","assets/viewer-tabs-D8o-L3pM.css","assets/EditableFileViewer-Cv3aNJBN.js","assets/EditableFileViewer-B2G3Xa33.css","assets/render-markdown-C7X2TwRk.js","assets/markdown-BpzjXclZ.css","assets/PullRequestViewer-KZl0osME.js","assets/gh-utils-B0Nlmxep.js","assets/GitHubAvatar-DBc3Vxnk.js","assets/HtmlFileViewer-BsewwJtM.js","assets/HtmlFileViewer-D6UPnZvW.css","assets/ImageFileViewer-CoQZkgET.js","assets/ImageFileViewer-D8TdwFTO.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as _,B as J,_ as x,T as se,a as ae,b as ne}from"./index-BOPi2b1j.js";import{r as n,j as t}from"./react-rd22PHbN.js";import{H as le,J as re,K as oe,k as R,L as fe,G as Y}from"./App-CBetJ5ZN.js";import"./tanstack-B8_amOz8.js";import"./base-ui-qeHDA5zu.js";class de{constructor(e){if(this.options=e,!Number.isInteger(e.maxEntries)||e.maxEntries<1)throw new RangeError("maxEntries must be a positive integer.");if(!Number.isFinite(e.maxBytes)||e.maxBytes<1)throw new RangeError("maxBytes must be a positive number.")}options;entries=new Map;totalBytes=0;get size(){return this.entries.size}get bytes(){return this.totalBytes}get(e){const o=this.entries.get(e);if(o)return this.entries.delete(e),this.entries.set(e,o),o.value}set(e,o){const d=ce(this.options.sizeOf(o)),v=this.entries.get(e);return v&&(this.entries.delete(e),this.totalBytes-=v.bytes),d>this.options.maxBytes?!1:(this.entries.set(e,{value:o,bytes:d}),this.totalBytes+=d,this.evictToBudget(),this.entries.has(e))}delete(e){const o=this.entries.get(e);return o?(this.entries.delete(e),this.totalBytes-=o.bytes,!0):!1}clear(){this.entries.clear(),this.totalBytes=0}evictToBudget(){for(;this.entries.size>this.options.maxEntries||this.totalBytes>this.options.maxBytes;){const e=this.entries.keys().next();if(e.done)break;this.delete(e.value)}}}function ce(i){if(!Number.isFinite(i)||i<0)throw new RangeError("sizeOf must return a finite, non-negative number.");return Math.ceil(i)}const U=n.lazy(()=>x(()=>import("./PierreDiffViewer-uhTsb-F7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),ue=n.lazy(()=>x(()=>import("./PierreEditBoundary-Bb4dONIq.js"),__vite__mapDeps([15,6,1,7,8,9,12,16])).then(i=>({default:i.PierreEditBoundary}))),me=n.lazy(()=>x(()=>import("./MarkdownFileViewer-BedKCXTI.js"),__vite__mapDeps([17,1,6,7,8,9,14,18,19,20,2,3,4,5,10,11,12,16,21,22,23])).then(i=>({default:i.MarkdownFileViewer}))),he=n.lazy(()=>x(()=>import("./PullRequestViewer-KZl0osME.js"),__vite__mapDeps([24,6,1,7,8,9,14,18,19,25,26,23])).then(i=>({default:i.PullRequestViewer}))),pe=n.lazy(()=>x(()=>import("./EditableFileViewer-Cv3aNJBN.js").then(i=>i.E),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,16,14,21])).then(i=>({default:i.EditableFileViewer}))),xe=n.lazy(()=>x(()=>import("./HtmlFileViewer-BsewwJtM.js"),__vite__mapDeps([27,1,18,6,7,8,9,19,20,2,3,4,5,10,11,12,16,14,21,28])).then(i=>({default:i.HtmlFileViewer}))),ve=n.lazy(()=>x(()=>import("./ImageFileViewer-CoQZkgET.js"),__vite__mapDeps([29,1,6,7,8,9,18,19,20,2,3,4,5,10,11,12,16,14,21,30])).then(i=>({default:i.ImageFileViewer}))),ye=n.lazy(()=>x(()=>import("./ImageFileViewer-CoQZkgET.js"),__vite__mapDeps([29,1,6,7,8,9,18,19,20,2,3,4,5,10,11,12,16,14,21,30])).then(i=>({default:i.SvgFileViewer}))),F=new de({maxEntries:8,maxBytes:16*1024*1024,sizeOf:i=>i.patch.length*2+i.path.length*2+256});let Q=null;function Se({repositoryId:i,selection:e,diffView:o,wrapLines:d,theme:v,revision:y,readOnly:g,commits:T,draftFor:E,onSelect:$,onOpenFile:Z,onDiffViewChange:K,onWrapLinesChange:M,onDraftChange:O,onDraftSaved:A,onUpdateConflict:W,onResolveConflict:I}){const[a,w]=n.useState(null),[ee,L]=n.useState(!1),[D,q]=n.useState(null),[V,H]=n.useState(!1),b=n.useRef(0),C=n.useRef(!1),u=je(i,e);n.useEffect(()=>{H(!1),C.current=!1},[e]),n.useEffect(()=>{Q!==i&&(F.clear(),Q=i);const s=++b.current;if(q(null),!e||e.type==="pull-request"){w(null),L(!1);return}L(!0),(async()=>{try{if(e.type==="file"||e.type==="conflict"){if(e.type==="file"&&fe(e.path)){const l=await _.repository.readImage(i,e.path);if(s!==b.current)return;w({docKey:u,type:"image",value:l});return}const f=await _.repository.readFile(i,e.path,e.type==="conflict"?!0:V);if(s!==b.current)return;if(e.type==="conflict"){w({docKey:u,type:"conflict",value:f});return}w(l=>l&&l.docKey===u&&l.type==="file"&&C.current||l&&l.docKey===u&&l.type==="file"&&l.value.content===f.content&&l.value.size===f.size&&l.value.binary===f.binary&&l.value.tooLarge===f.tooLarge?l:{docKey:u,type:"file",value:f})}else{const f=e.type!=="diff";let l=f?F.get(u):void 0;if(l||(l=e.type==="commit"?await _.diff.getCommit(i,e.oid):e.type==="commit-file"?await _.diff.getCommitFile(i,e.oid,e.path,e.oldPath):await _.diff.get({repositoryId:i,path:e.path,kind:e.kind}),f&&F.set(u,l)),s!==b.current)return;const p=l;w(c=>c&&c.docKey===u&&c.type==="diff"&&c.value.patch===p.patch&&c.value.binary===p.binary?c:{docKey:u,type:"diff",value:p})}}catch(f){s===b.current&&q(f instanceof Error?f.message:"Could not load the viewer.")}finally{s===b.current&&L(!1)}})()},[V,u,i,y,e]);const j=v==="system"?"system":v,te=d?"wrap":"scroll",N=n.useCallback(s=>{C.current=s},[]),S=n.useCallback(async(s,h,f)=>{const l=E(s),p=await _.repository.writeFile(i,s,h,l?.expectedContent??f);return p.status==="saved"&&(C.current=!1,A(s),w(c=>c?.type==="file"&&c.value.path===s?{...c,value:{...c.value,content:h,binary:!1,tooLarge:!1,size:p.size,mtimeMs:p.mtimeMs}}:c)),p},[E,A,i]),B=n.useCallback(s=>s.path,[]),k=n.useCallback(s=>E(s.path)?.content??s.content,[E]),z=n.useCallback(s=>h=>O(s.path,h,s.content,s.mtimeMs),[O]),ie=ee&&a!==null&&!D;let r,P=null;if(!e)r=t.jsx(we,{});else if(e.type==="pull-request")r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(he,{repositoryId:i,prNumber:e.number,diffView:o,themeType:j,wrapLines:d,onDiffViewChange:K,onWrapLinesChange:M,onClose:()=>$(null)},`${i}:${e.number}`)});else if(D)r=t.jsx("div",{className:"viewer-message text-destructive",children:D});else if(!a)r=t.jsxs("div",{className:"viewer-message",children:[t.jsx(R,{className:"spinner"})," ",t.jsx(Y,{text:"Loading…"})]});else if(a.type==="image")r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(ve,{image:a.value},`${a.value.path}:${a.value.mtimeMs}`)});else if(a.type!=="diff"&&a.value.binary)r=t.jsxs("div",{className:"viewer-message",children:["Binary file · ",X(a.value.size)]});else if(a.type==="file"&&a.value.tooLarge&&!V)r=t.jsxs("div",{className:"viewer-message flex-col gap-3",children:[t.jsxs("p",{children:["The file is ",X(a.value.size),". Preview is limited to protect performance."]}),t.jsx(J,{variant:"outline",onClick:()=>H(!0),children:"Load preview"})]});else if(a.type==="file"&&a.value.tooLarge)r=t.jsx("div",{className:"viewer-message text-destructive",children:"The file exceeds the built-in editor's 8 MB safety limit."});else if(a.type==="conflict"&&a.value.tooLarge)r=t.jsx("div",{className:"viewer-message text-destructive",children:"The conflicted file exceeds the viewer's safe limit. Open it in an external editor to resolve it."});else if(a.type==="conflict")r=null,P=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(U,{kind:"conflict",contentKey:a.docKey,file:a.value,themeType:j,overflow:te,onUpdate:W,onResolve:I})});else if(a.type==="file"&&le(a.value.path)){const s=a.value;r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(me,{file:s,initialContent:k(s),revision:y,themeType:j,wrapLines:d,readOnly:g||s.tooLarge,onOpenFile:Z,onDirtyChange:N,onDraftChange:z(s),onSave:S},B(s))})}else if(a.type==="file"&&re(a.value.path)){const s=a.value;r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(ye,{file:s,initialContent:k(s),themeType:j,wrapLines:d,readOnly:g||s.tooLarge,onDirtyChange:N,onDraftChange:z(s),onSave:S},B(s))})}else if(a.type==="file"&&oe(a.value.path)){const s=a.value;r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(xe,{file:s,initialContent:k(s),themeType:j,wrapLines:d,readOnly:g||s.tooLarge,onDirtyChange:N,onDraftChange:z(s),onSave:S},B(s))})}else if(a.type==="file"){const s=a.value;r=t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(pe,{file:s,initialContent:k(s),themeType:j,wrapLines:d,readOnly:g,onDirtyChange:N,onDraftChange:z(s),onSave:S},B(s))})}else if(a.type==="diff"&&a.value.patch){const s=e.type==="commit"||e.type==="commit-file"?e:null,h=s?T.find(l=>l.oid===s.oid):void 0,f=e.type==="commit-file"?t.jsx(J,{type:"button",variant:"outline",size:"xs",onClick:()=>$({type:"commit",oid:e.oid,subject:h?.subject??e.oid.slice(0,8)}),children:"All files"}):void 0;r=null,P=t.jsxs("div",{className:s?"commit-diff-viewer":"standalone-diff-viewer",children:[s&&t.jsx(ge,{commit:h,fallbackSubject:"subject"in s?s.subject:""},s.oid),t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(U,{kind:"diff",contentKey:a.docKey,value:a.value,diffView:o,themeType:j,wrapLines:d,initiallyCollapsed:e.type==="commit",compact:e.type==="diff",scopeControl:f,onDiffViewChange:K,onWrapLinesChange:M,onClose:()=>$(null)})})]})}else a.type==="diff"?r=t.jsx("div",{className:"viewer-message",children:"No differences to show."}):r=t.jsx("div",{className:"viewer-message",children:"This file cannot be edited."});const G=t.jsxs(t.Fragment,{children:[P??t.jsx("div",{className:"viewer-transition",children:r},a?a.docKey:u),ie&&t.jsx("span",{className:"viewer-reloading","aria-hidden":"true",children:t.jsx(R,{className:"spinner"})})]});return a?.type!=="file"?G:t.jsx(n.Suspense,{fallback:t.jsx(m,{}),children:t.jsx(ue,{enabled:!0,children:G})})}function ge({commit:i,fallbackSubject:e}){const o=i?.date?new Date(i.date):null,[d,v]=n.useState(!1),y=i?.body??"",g=y.length>240||y.split(`
|
|
3
|
-
`).length>3;return t.jsxs("header",{className:"commit-diff-header",children:[t.jsx("h2",{children:i?.subject||e||"(no subject)"}),y&&t.jsxs("div",{className:"commit-diff-description-wrap",children:[t.jsx("p",{className:`commit-diff-description ${g&&!d?"collapsed":""}`,children:y}),g&&t.jsx("button",{type:"button",className:"commit-description-toggle","aria-expanded":d,onClick:()=>v(T=>!T),children:d?"Show less":"Show full description"})]}),t.jsxs("div",{className:"commit-diff-meta",children:[t.jsx("code",{children:i?.shortOid??"commit"}),i?.author&&t.jsxs("span",{children:[i.author,i.email?` <${i.email}>`:""]}),o&&Number.isFinite(o.getTime())&&t.jsxs(se,{children:[t.jsx(ae,{render:t.jsx("time",{dateTime:i?.date}),children:o.toLocaleString()}),t.jsx(ne,{children:o.toLocaleString()})]}),i?.parentCount&&i.parentCount>1?t.jsx("span",{children:"Merge commit"}):null,i?.upstreamState==="local-only"&&t.jsx("span",{className:"commit-local-label",children:"Local only"})]})]})}function je(i,e){return e?e.type==="pull-request"?`${i}:pull:${e.number}`:e.type==="commit"?`${i}:commit:${e.oid}`:e.type==="commit-file"?`${i}:commit-file:${e.oid}:${e.oldPath??""}:${e.path}`:e.type==="diff"?`${i}:diff:${e.kind}:${e.path}`:`${i}:${e.type}:${e.path}`:`${i}:empty`}function m(){return t.jsxs("div",{className:"viewer-message",children:[t.jsx(R,{className:"spinner"})," ",t.jsx(Y,{text:"Loading viewer…"})]})}function we(){return t.jsxs("div",{className:"viewer-empty",children:[t.jsx("h2",{children:"Nothing selected"}),t.jsx("p",{children:"Select a change, file, commit, or pull request."})]})}function X(i){return i?i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`:"unknown size"}export{Se as default};
|