@pi-chamber/web 1.0.8-rc.2 → 1.0.8-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentsSurface-CcWBqAWV.js → AgentsSurface-wsW9VCRp.js} +1 -1
- package/dist/assets/{ChoicesArtifact-Kk-qvrSB.js → ChoicesArtifact-EwCf4Yxu.js} +1 -1
- package/dist/assets/{DiagramView-DZUBo1uP.js → DiagramView-BX6N99cQ.js} +1 -1
- package/dist/assets/{DiffView-CiZy4jFA.js → DiffView-CI0eSnPP.js} +1 -1
- package/dist/assets/{FileSaveConflictDialog-DZ9NDwOO.js → FileSaveConflictDialog-GLj2W7VE.js} +1 -1
- package/dist/assets/{FilesView-DqiZ9kw9.js → FilesView-CI0tfZQL.js} +1 -1
- package/dist/assets/{GitHubDetailScaffold-DM2DH7o8.js → GitHubDetailScaffold-B85tZ9m7.js} +1 -1
- package/dist/assets/{GitHubLinkPicker-ChB8NZ1h.js → GitHubLinkPicker-Y6AuNiGl.js} +1 -1
- package/dist/assets/{GitHubListPrimitives-CibDiJGq.js → GitHubListPrimitives-BJHBud6i.js} +1 -1
- package/dist/assets/{GitView--EaZQrBr.js → GitView-DueE69kW.js} +3 -3
- package/dist/assets/{IssuesSurface-CySTpaD1.js → IssuesSurface-Cg-xkdIu.js} +2 -2
- package/dist/assets/{JsonTreeView-_yMHKKQZ.js → JsonTreeView-Cvg6lc40.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-D_-2fQw0.js → MarkdownRendererImpl-DExPx-QM.js} +1 -1
- package/dist/assets/{PatchDiff-bHObDlhD.js → PatchDiff-_c3HZ34I.js} +1 -1
- package/dist/assets/{PierreDiffViewer-UY7Cse-s.js → PierreDiffViewer-CZnaqO-_.js} +1 -1
- package/dist/assets/{PullRequestsSurface-iXy6chwc.js → PullRequestsSurface-C9AYPiwo.js} +2 -2
- package/dist/assets/{SessionSwitcherContent-DJGCa_wN.js → SessionSwitcherContent-DOpnN-8S.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-CDOX-5Y2.js → SessionSwitcherDropdown-CmHMPZ69.js} +2 -2
- package/dist/assets/{SessionUnreadDot-Dwc3MdvA.js → SessionUnreadDot-CZCQ4t1J.js} +1 -1
- package/dist/assets/SettingsView-D5PO5M3z.js +11 -0
- package/dist/assets/{SettingsWindow-CUg49Mfh.js → SettingsWindow-DXV5UOE8.js} +1 -1
- package/dist/assets/{SubagentsArtifact-DUZX9tDe.js → SubagentsArtifact-CO1ZiI1x.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BuZZaRw4.js → ToolOutputDialog-GOwNLj-y.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-CKncG6i2.js → ToolPartDiffPreview-BoaiZji6.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-BGZiLPe_.js → VirtualizedFileDiff-Chq1X8nw.js} +1 -1
- package/dist/assets/VisualFrame-u7aRcX7O.js +22 -0
- package/dist/assets/{VisualsArtifact-Bq0vMO-i.js → VisualsArtifact-D9vPjihW.js} +1 -1
- package/dist/assets/{collapsible-Bro9KrfM.js → collapsible-BjpDEohv.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-DJQqK49u.js → computeVirtualFileMetrics-DmPCxbok.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-ByWK3Sru.js → contextFileOpenGuard-CukNcUeY.js} +1 -1
- package/dist/assets/{fileTreeStatus-CyJ3TOYD.js → fileTreeStatus-CDyfNPYO.js} +1 -1
- package/dist/assets/{gitStatusPredicates-BsXrwngT.js → gitStatusPredicates-uI7Y7L5k.js} +1 -1
- package/dist/assets/{githubLink-g2bmC0qi.js → githubLink-B9Mxac4R.js} +1 -1
- package/dist/assets/{index-C9rUUQ_Y.js → index-BWq2ibCw.js} +1 -1
- package/dist/assets/{index-CKKWVoND.js → index-BxKPJ9uG.js} +9 -9
- package/dist/assets/index-C5JgjS20.css +1 -0
- package/dist/assets/{main-DsLMU9CT.js → main-CWfC-9xT.js} +4 -4
- package/dist/assets/{main-DT-4_fhe.js → main-ckQ0ciIN.js} +2 -2
- package/dist/assets/{markdownCore-QmM_aOnZ.js → markdownCore-p2q2Kxwo.js} +1 -1
- package/dist/assets/{miniChat-BqGslD2z.js → miniChat-x2TrwRYA.js} +2 -2
- package/dist/assets/{mobile-C5JOcDIC.js → mobile-B0x2G8h1.js} +2 -2
- package/dist/assets/{nativeFileSave-DSMsJqXM.js → nativeFileSave-D542OJlG.js} +1 -1
- package/dist/assets/{pi-session-focus-preference-Cc_S4zi1.js → pi-session-focus-preference-Q_RZUCnt.js} +1 -1
- package/dist/assets/{renderDiffWithHighlighter-BXhnIAHg.js → renderDiffWithHighlighter-CSFGSknx.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-CiSkecEE.js → renderElectronMiniChatApp-CFIdesZT.js} +2 -2
- package/dist/assets/{renderFileWithHighlighter-CK29YZtC.js → renderFileWithHighlighter-C5JE0mRX.js} +1 -1
- package/dist/assets/{renderMobileApp-C4JuoxsZ.js → renderMobileApp-B1ybjcGM.js} +3 -3
- package/dist/assets/{runtimeEndpointReset-Dwj-jCDS.js → runtimeEndpointReset-DyZSKCYM.js} +7 -7
- package/dist/assets/{runtimeSurface-0K7vuUpd.js → runtimeSurface-BR_dhe7_.js} +1 -1
- package/dist/assets/{selection-CnYkEsu_.js → selection-CfOpW4rA.js} +1 -1
- package/dist/assets/{useAppFontEffects-CV5UyTRw.js → useAppFontEffects-COMvkffC.js} +97 -97
- package/dist/assets/{useGitHubRemoteSearch-CgP-zEBj.js → useGitHubRemoteSearch-M1AE2YuX.js} +1 -1
- package/dist/assets/{useSwitcherItems-C8G5F0hs.js → useSwitcherItems-D0i2BYYP.js} +1 -1
- package/dist/assets/{web-components-BpncHjnV.js → web-components-wOQkOurQ.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/plugins/visuals/extension.js +2 -2
- package/server/index.js +4 -0
- package/server/lib/pi/ui-settings-store.js +2 -1
- package/server/lib/wallpaper/DOCUMENTATION.md +25 -0
- package/server/lib/wallpaper/routes.js +63 -0
- package/server/lib/wallpaper/routes.test.js +109 -0
- package/server/lib/wallpaper/store.js +87 -0
- package/dist/assets/SettingsView-DA-U9lsj.js +0 -11
- package/dist/assets/VisualFrame-DBZkHFnG.js +0 -22
- package/dist/assets/index-B_L9GVYw.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./vendor-boot-D-KEJjsM.js";import{R as h}from"./vendor-react-Bz1tRBxM.js";import{af as z,I as f,ag as q,ah as O,a2 as I,t as S,ai as B,B as x}from"./useAppFontEffects-
|
|
1
|
+
import{j as a}from"./vendor-boot-D-KEJjsM.js";import{R as h}from"./vendor-react-Bz1tRBxM.js";import{af as z,I as f,ag as q,ah as O,a2 as I,t as S,ai as B,B as x}from"./useAppFontEffects-COMvkffC.js";import{p as T}from"./vendor-dompurify-BGCr_sdL.js";import{c as m}from"./index-BxKPJ9uG.js";const ve=(e,t)=>!e||!t?!1:e.toLowerCase()===t.toLowerCase(),v=e=>!e||e.permissionFallback?!1:e.capabilities?.canPush!==!0,j=e=>!e||e.permissionFallback||e.isAuthor?!1:e.capabilities?.canPush!==!0,D=e=>!e||e.permissionFallback?{allowed:!0,reason:null}:e.capabilities?.canComment!==!0?{allowed:!1,reason:"You need read access to comment"}:{allowed:!0,reason:null},F=(e,t)=>e.trim()?e.trim().length>t?`Title is too long (max ${t} characters)`:null:"Enter a title",Ne=[{id:"open",label:"Open"},{id:"closed",label:"Closed"},{id:"merged",label:"Merged"},{id:"all",label:"All"}],ke=[{id:"all",label:"All"},{id:"mine",label:"Created by me"},{id:"review",label:"Review requested"},{id:"assigned",label:"Assigned"}],je=[{id:"updated",label:"Recently updated"},{id:"newest",label:"Newest"},{id:"oldest",label:"Oldest"}],U=e=>{const t=(e.conclusion??e.state??e.status??"").toLowerCase();return t.includes("fail")||t.includes("error")||t.includes("cancel")||t==="timed_out"||t==="action_required"},W=e=>{const t={failed:{runs:0,statuses:0},pending:{runs:0,statuses:0},passed:{runs:0,statuses:0},other:{runs:0,statuses:0}};if(!e)return t;for(const r of e.runs??[]){const s=(r.conclusion??r.state??r.status??"").toLowerCase();U(r)?t.failed.runs+=1:s.includes("success")||s==="neutral"||s==="skipped"?t.passed.runs+=1:t.pending.runs+=1}for(const r of e.statuses??[]){const s=(r.state??"").toLowerCase();s==="failure"||s==="error"?t.failed.statuses+=1:s==="success"?t.passed.statuses+=1:s==="pending"?t.pending.statuses+=1:t.other.statuses+=1}return t},Ce=[{id:"merge",label:"Merge commit",description:"Add all commits with a merge commit"},{id:"squash",label:"Squash and merge",description:"Combine commits into one commit"},{id:"rebase",label:"Rebase and merge",description:"Replay commits onto the base branch"}],$e=e=>!e||e.state!=="open"?null:e.mergeableState==="behind"?{tone:"warning",icon:"error-warning",title:"This branch is out of date with",detail:"Merge the latest changes from the base branch into this branch.",canUpdate:!0}:e.mergeableState==="dirty"?{tone:"error",icon:"alert",title:"This branch has conflicts with",detail:"Resolve conflicts locally or on GitHub before merging.",canUpdate:!1}:null,Ae=(e,t,r)=>{const s=r?`“${r}”`:"this branch",n=t?`“${t}”`:"the base branch";switch(e){case"merge":return{title:"Merge this pull request?",detail:`Every commit from ${s} will be added to ${n} with a merge commit.`,confirm:"Merge pull request",progress:"Merging…"};case"squash":return{title:"Squash and merge?",detail:`The commits from ${s} will be combined into one commit on ${n}.`,confirm:"Squash and merge",progress:"Merging…"};case"rebase":return{title:"Rebase and merge?",detail:`The commits from ${s} will be replayed onto ${n} without a merge commit.`,confirm:"Rebase and merge",progress:"Merging…"};case"draft":return{title:"Convert to draft?",detail:"Reviewers will see that this pull request is not ready to merge.",confirm:"Convert to draft",progress:"Converting…"};case"ready":return{title:"Mark as ready for review?",detail:"Reviewers will be asked to review this pull request.",confirm:"Ready for review",progress:"Updating…"};case"close":return{title:"Close this pull request?",detail:"The pull request will close without merging. You can reopen it later.",confirm:"Close pull request",progress:"Closing…"};case"reopen":return{title:"Reopen this pull request?",detail:"The pull request will return to its previous open state.",confirm:"Reopen pull request",progress:"Reopening…"};case"update-branch":return{title:"Update this branch?",detail:`This brings ${s} up to date with ${n}. History may be rewritten.`,confirm:"Update branch",progress:"Updating…"};default:return{title:"Continue?",detail:"This action cannot be undone from here.",confirm:"Confirm",progress:"Working…"}}},Se=e=>{if(!e)return null;const t=W(e),r=t.failed.runs+t.failed.statuses,s=t.pending.runs+t.pending.statuses,n=t.passed.runs+t.passed.statuses,i=e.runs.length+e.statuses.length;return{text:`${r} failing · ${s} pending · ${n} passed`,failed:r,pending:s,passed:n,total:i}},Te=(e,t,r)=>{if(!t)return{allowed:!1,reason:"Pull request is still loading"};const s=t.state==="merged",n=t.state==="open";switch(e){case"merge":case"squash":case"rebase":return n?t.draft?{allowed:!1,reason:"Marked as draft"}:t.mergeable===!1||t.mergeableState==="dirty"?{allowed:!1,reason:"Has merge conflicts"}:t.mergeableState==="blocked"?{allowed:!1,reason:"Blocked by required checks"}:v(r)?{allowed:!1,reason:"You need write access to merge"}:{allowed:!0,reason:null}:{allowed:!1,reason:s?"Already merged":"Pull request is closed"};case"ready":return n?t.draft?v(r)?{allowed:!1,reason:"You need write access to mark ready"}:{allowed:!0,reason:null}:{allowed:!1,reason:"Already ready for review"}:{allowed:!1,reason:"Pull request is not open"};case"draft":return n?t.draft?{allowed:!1,reason:"Already a draft"}:v(r)?{allowed:!1,reason:"You need write access to convert to draft"}:{allowed:!0,reason:null}:{allowed:!1,reason:"Pull request is not open"};case"close":return n?j(r)?{allowed:!1,reason:"You need write access or be the author to close"}:{allowed:!0,reason:null}:{allowed:!1,reason:s?"Already merged":"Already closed"};case"reopen":return n?{allowed:!1,reason:"Already open"}:s?{allowed:!1,reason:"Already merged"}:j(r)?{allowed:!1,reason:"You need write access or be the author to reopen"}:{allowed:!0,reason:null};case"update-branch":return n?v(r)?{allowed:!1,reason:"You need write access to update the branch"}:{allowed:!0,reason:null}:{allowed:!1,reason:"Pull request is not open"};default:return{allowed:!0,reason:null}}},Re=e=>H(e).allowed!==!0?[]:e&&!e.permissionFallback&&e.isAuthor===!0?["comment"]:["comment","approve","request-changes"],He=e=>e.verdict==="approve"?!0:e.summary.trim().length>0||e.pendingCount>0,_e=e=>H(e),Me=e=>!e||e.permissionFallback?{allowed:!0,reason:null}:e.capabilities?.canPush!==!0?{allowed:!1,reason:"You need write access to resolve threads"}:{allowed:!0,reason:null},Y=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Ge=e=>{if(!e)return{original:"",modified:""};const t=[],r=[];let s=!1;for(const n of e.split(`
|
|
2
2
|
`)){if(n.startsWith("@@")){s&&(t.push("…"),r.push("…")),s=!0;continue}if(!s||n.startsWith("\\"))continue;const i=n[0],l=n.slice(1);i===" "?(t.push(l),r.push(l)):i==="-"?t.push(l):i==="+"?r.push(l):(t.push(n),r.push(n))}return{original:t.join(`
|
|
3
3
|
`),modified:r.join(`
|
|
4
4
|
`)}},Le=e=>{switch(e.split(".").pop()?.toLowerCase()??""){case"ts":case"tsx":return"typescript";case"js":case"jsx":case"mjs":case"cjs":return"javascript";case"json":return"json";case"md":case"mdx":return"markdown";case"py":return"python";case"rb":return"ruby";case"go":return"go";case"rs":return"rust";case"css":case"scss":return"css";case"html":return"html";case"yaml":case"yml":return"yaml";case"sh":return"shell";default:return"text"}},Pe=e=>{const t={newToSynthetic:new Map,oldToSynthetic:new Map,syntheticToNew:new Map,syntheticToOld:new Map};if(!e)return t;let r=!1,s=0,n=0,i=0,l=0;for(const o of e.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-boot-D-KEJjsM.js";import{R as r}from"./vendor-react-Bz1tRBxM.js";import{j as z,k as K,l as F,t as L,m as Q,n as W,o as J,p as V,q as X,B as Y,I as Z}from"./useAppFontEffects-
|
|
1
|
+
import{j as s}from"./vendor-boot-D-KEJjsM.js";import{R as r}from"./vendor-react-Bz1tRBxM.js";import{j as z,k as K,l as F,t as L,m as Q,n as W,o as J,p as V,q as X,B as Y,I as Z}from"./useAppFontEffects-COMvkffC.js";import{G as _,a as ee}from"./GitHubListPrimitives-BJHBud6i.js";import{G as se}from"./GitHubDetailScaffold-B85tZ9m7.js";import{p as P,i as te,c as re}from"./githubLink-B9Mxac4R.js";import"./vendor-clsx-B-dksMZM.js";import"./index-BxKPJ9uG.js";import"./vendor-zustand-CXhN0IMY.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-fuse.js-t_7AcMTv.js";import"./runtimeSurface-BR_dhe7_.js";import"./nativeFileSave-D542OJlG.js";import"./vendor-dompurify-BGCr_sdL.js";const je=({directory:n,open:p,onClose:j})=>{const i=z().github??null,R=K(e=>e.entriesByDirectory[n]??null),C=K(e=>e.ensureScope),G=F(n||null),[m,B]=r.useState("issue"),[h,q]=r.useState(null),[d,A]=r.useState(""),[H,k]=r.useState([]),[M,S]=r.useState(!1),[$,w]=r.useState(null),[D,E]=r.useState(!1),[g,I]=r.useState(null);r.useEffect(()=>{!p||!i||C(n,i)},[p,n,i,C]);const a=r.useMemo(()=>(R?.scope?.repositories??[]).filter(t=>t.host&&t.owner&&t.repo&&!t.disabledReason).map(t=>({owner:t.owner,repo:t.repo,ref:`${t.host}/${t.owner}/${t.repo}`})),[R]);r.useEffect(()=>{p&&q(G??a[0]?.ref??null)},[p,G,a]);const o=r.useMemo(()=>P(d,a),[d,a]),b=r.useRef(0),T=r.useCallback(async(e,t,c)=>{if(!i)return;const x=b.current+=1,u=e.trim(),v=P(u,a);if(!u||v.link||v.outOfScope){k([]),w(null),S(!1);return}S(!0),w(null);try{if(c==="issue"){const f=await i.issuesList(n,t,{state:"all",q:u});if(b.current!==x)return;k(f.items.slice(0,60).map(l=>({kind:"issue",number:l.number,title:l.title,url:l.url,repo:t})))}else{const f=await i.pullsList(n,t,{state:"all",q:u});if(b.current!==x)return;k(f.items.slice(0,60).map(l=>({kind:"pr",number:l.number,title:l.title,url:l.url,repo:t})))}}catch(f){if(b.current!==x)return;k([]),w(f instanceof Error?f.message:"Search failed")}finally{b.current===x&&S(!1)}},[i,n,a]);r.useEffect(()=>{if(!p||!h)return;const e=setTimeout(()=>{T(d,h,m)},250);return()=>clearTimeout(e)},[p,d,h,m,T]);const U=r.useCallback(async()=>{if(!i||!o.link)return null;const{kind:e,number:t,owner:c,repo:x}=o.link,u=c&&x?a.find(l=>l.owner?.toLowerCase()===c.toLowerCase()&&l.repo?.toLowerCase()===x.toLowerCase())?.ref??null:h;if(!u)return null;const f=/^https?:\/\//i.test(d.trim())?e:m;E(!0);try{if(f==="pr"){const N=await i.pullGet(n,u,t);return N.pr?{kind:"pr",number:t,title:N.pr.title,url:N.pr.url,repo:u}:null}const l=await i.issueGet(n,u,t);return l.issue?{kind:"issue",number:t,title:l.issue.title,url:l.issue.url,repo:u}:null}finally{E(!1)}},[i,o.link,n,m,d,h,a]),y=r.useCallback(async e=>{if(!i)return;const t=`${e.repo}#${e.number}`;I(t);try{const c=await i.agentContext(n,e.repo,e.kind==="pr"?"pr":"issue",e.number);te({kind:e.kind,number:e.number,title:e.title,url:e.url,contextText:c.text},re()),L.success(e.kind==="pr"?"Pull request linked":"Issue linked"),j()}catch(c){L.error(c instanceof Error?c.message:"Failed to link")}finally{I(null)}},[i,n,j]),O=r.useCallback(async()=>{const e=await U();if(!e){L.error("Not found in this repository");return}await y(e)},[U,y]);return p?s.jsx(Q,{open:p,onOpenChange:e=>{e||j()},children:s.jsxs(W,{className:"max-w-md w-[calc(100vw-2rem)]",children:[s.jsxs(J,{children:[s.jsx(V,{children:"Link issue or pull request"}),s.jsx(X,{children:"Search, type #123, or paste a GitHub URL for a repository in scope."})]}),i?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(_,{ariaLabel:"Link kind",value:m,onChange:e=>B(e),options:[{id:"issue",label:"Issues"},{id:"pr",label:"Pull requests"}]}),a.length>1?s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"sr-only",children:"Repository"}),s.jsx("select",{"aria-label":"Repository",value:h??"",onChange:e=>q(e.target.value||null),className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-[var(--surface-elevated)] px-2 typography-micro text-foreground",children:a.map(e=>s.jsxs("option",{value:e.ref,children:[e.owner,"/",e.repo]},e.ref))})]}):null,s.jsx(ee,{value:d,onChange:A,placeholder:m==="issue"?"Search issues, #123, or paste a URL":"Search pull requests, #123, or paste a URL",ariaLabel:m==="issue"?"Search issues":"Search pull requests"}),o.outOfScope?s.jsx("p",{className:"typography-micro text-muted-foreground",role:"note",children:"That repository is outside this session's scope. Pick a repository listed above."}):null,o.link?s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:O,disabled:D||g!==null||!h&&!(o.link.owner&&o.link.repo),"aria-label":`Link ${m==="pr"?"pull request":"issue"} number ${o.link.number}`,children:D||g?"Working…":`Link #${o.link.number}`}):null,$?s.jsx("p",{className:"typography-micro text-[var(--status-error)]",role:"alert",children:$}):null,s.jsx("div",{className:"max-h-64 min-h-0 overflow-y-auto",role:"list","aria-label":"Matches",children:M?s.jsxs("p",{className:"flex items-center gap-2 p-2 typography-ui text-muted-foreground",children:[s.jsx(Z,{name:"loader-4",className:"size-4 animate-spin"})," Searching…"]}):H.length===0&&d.trim()&&!o.link?s.jsx("p",{className:"p-2 typography-ui text-muted-foreground",children:"No matches. Try #123 or a GitHub URL."}):s.jsx("ul",{className:"flex flex-col gap-0.5",children:H.map(e=>{const t=`${e.repo}#${e.number}`;return s.jsx("li",{role:"listitem",children:s.jsxs("button",{type:"button",onClick:()=>{y(e)},disabled:g!==null,"aria-label":`Link ${e.kind==="pr"?"pull request":"issue"} #${e.number} ${e.title}`,className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left hover:bg-interactive-hover disabled:opacity-60",children:[s.jsx("span",{className:"mt-0.5 shrink-0",children:s.jsx(se,{kind:e.kind,state:"open"})}),s.jsx("span",{className:"min-w-0 flex-1",children:s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsxs("span",{className:"shrink-0 font-mono typography-micro text-muted-foreground",children:["#",e.number]}),s.jsx("span",{className:"min-w-0 flex-1 truncate typography-ui-label text-foreground",title:e.title,children:g===t?"Linking…":e.title})]})})]})},t)})})})]}):s.jsx("p",{className:"typography-ui text-muted-foreground",children:"GitHub is not available in this runtime."})]})}):null};export{je as GitHubLinkPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-boot-D-KEJjsM.js";import{R as u}from"./vendor-react-Bz1tRBxM.js";import{I as o,B as l,f}from"./useAppFontEffects-
|
|
1
|
+
import{j as e}from"./vendor-boot-D-KEJjsM.js";import{R as u}from"./vendor-react-Bz1tRBxM.js";import{I as o,B as l,f}from"./useAppFontEffects-COMvkffC.js";import{c as m}from"./index-BxKPJ9uG.js";import{s as b,d as g}from"./GitHubDetailScaffold-B85tZ9m7.js";const G=({options:r,value:s,onChange:t,ariaLabel:a})=>e.jsx("div",{role:"tablist","aria-label":a,className:"flex flex-wrap gap-1",children:r.map(i=>{const n=i.id===s;return e.jsx(l,{type:"button",variant:"chip",size:"xs",role:"tab","aria-selected":n,"aria-pressed":n,onClick:()=>t(i.id),className:m(n&&"bg-interactive-selection text-interactive-selection-foreground"),children:i.label},i.id)})}),S=({value:r,onChange:s,placeholder:t,ariaLabel:a})=>{const[i,n]=u.useState(r);u.useEffect(()=>n(r),[r]);const c=u.useRef(s);return c.current=s,u.useEffect(()=>{if(i===r)return;const d=setTimeout(()=>c.current(i),80);return()=>clearTimeout(d)},[i,r]),e.jsxs("span",{className:"relative block min-w-0 flex-1",children:[e.jsx(o,{name:"search","aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(f,{value:i,onChange:d=>n(d.target.value),placeholder:t??"Search","aria-label":a??"Search",className:"h-8 pl-7"})]})},H=({rows:r=7,label:s})=>{const t=["w-3/5","w-2/5","w-1/2","w-2/3","w-2/5","w-3/5","w-1/2"],a=["w-2/5","w-1/3","w-2/5","w-1/4","w-1/3","w-2/5","w-1/3"];return e.jsx("div",{role:"status","aria-label":s,className:"flex animate-pulse flex-col p-1",children:Array.from({length:r},(i,n)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-2",children:[e.jsx("span",{"aria-hidden":"true",className:"size-4 shrink-0 rounded-full bg-muted-foreground/15"}),e.jsxs("span",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsx("span",{"aria-hidden":"true",className:m("block h-3.5 rounded bg-muted-foreground/15",t[n%t.length])}),e.jsx("span",{"aria-hidden":"true",className:m("block h-3 rounded bg-muted-foreground/15",a[n%a.length])})]}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[e.jsx("span",{"aria-hidden":"true",className:"block h-3 w-12 rounded bg-muted-foreground/15"}),e.jsx("span",{"aria-hidden":"true",className:"block h-3 w-10 rounded bg-muted-foreground/15"})]})]},n))})},p=({icon:r,title:s,description:t,action:a})=>e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1.5 p-6 text-center",children:[e.jsx(o,{name:r,"aria-hidden":"true",className:"size-6 text-subtle-foreground"}),e.jsx("p",{className:"typography-ui-label font-medium text-foreground",children:s}),t?e.jsx("p",{className:"max-w-60 typography-micro text-muted-foreground",children:t}):null,a]}),j=({hasMore:r,isLoading:s,onLoadMore:t,label:a})=>r?e.jsx("div",{className:"flex justify-center px-2 py-2",children:e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:t,disabled:s,children:s?"Loading…":a??"Load more"})}):null,z=({matchSummary:r,searching:s,onSearchAll:t})=>e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-border/60 px-2 py-1.5 typography-micro text-muted-foreground",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",title:r,children:r}),e.jsx(l,{type:"button",variant:"ghost",size:"xs",onClick:t,disabled:s,children:s?"Searching…":"Search all on GitHub"})]}),C=({title:r,isSearching:s,error:t,hasResults:a,hasMore:i,isLoadingMore:n,onRetry:c,onLoadMore:d,children:h})=>{const x=t?.kind==="rate-limited"?"GitHub rate limit reached — try again in a little while.":"Couldn't search GitHub.";return e.jsxs("section",{"aria-label":r,className:"border-t border-border/60",children:[e.jsx("p",{className:"px-3 pb-0.5 pt-1.5 typography-micro font-medium text-muted-foreground",children:r}),t&&!a?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2 typography-micro text-muted-foreground",children:[e.jsx(o,{name:"error-warning",className:"size-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 flex-1",children:x}),e.jsx(l,{type:"button",variant:"outline",size:"xs",onClick:c,children:"Retry"})]}):null,t&&a?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-1 typography-micro text-muted-foreground",children:[e.jsx("span",{className:"min-w-0 flex-1",children:x}),e.jsx(l,{type:"button",variant:"ghost",size:"xs",onClick:c,children:"Retry"})]}):null,!t&&s&&!a?e.jsx("p",{className:"px-3 py-2 typography-micro text-muted-foreground",role:"status",children:"Searching GitHub…"}):null,a?e.jsx("div",{className:"flex flex-col p-1 pt-0.5",children:h}):null,!t&&a?e.jsx(j,{hasMore:i,isLoading:n,onLoadMore:d,label:"Load more results"}):null]})},R=({error:r,onRetry:s,label:t})=>{if(!b(r))return null;const a=g(r);return e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-[var(--status-error-border)] bg-[var(--status-error-background)] px-3 py-2 typography-micro text-foreground",role:"alert","aria-label":`${t} failed to load`,children:[e.jsx(o,{name:"error-warning",className:"size-4 shrink-0 text-[var(--status-error)]"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[t," failed to load",r?` — ${a}`:""]}),e.jsx(l,{type:"button",variant:"outline",size:"xs",onClick:s,children:"Retry"})]})},E=({number:r,kindLabel:s,onOpen:t})=>e.jsx("div",{className:"flex flex-col p-1",children:e.jsxs("button",{type:"button",onClick:t,"aria-label":`Open ${s} #${r}`,className:"group/github-row flex w-full items-center gap-2 rounded-md px-2 py-1 text-left hover:bg-interactive-hover",children:[e.jsx("span",{className:"inline-flex w-4 shrink-0 items-center justify-center",children:e.jsx(o,{name:"external-link",className:"size-3.5 text-muted-foreground","aria-hidden":"true"})}),e.jsxs("span",{className:"min-w-0 flex-1 truncate typography-ui-label text-foreground",children:["Open #",r]}),e.jsx("span",{className:"shrink-0 typography-micro text-muted-foreground",children:"Not in the loaded list"})]})}),I=({onRetry:r})=>e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[var(--status-warning-border)] bg-[var(--status-warning-background)] px-3 py-1.5 typography-micro text-foreground",children:[e.jsx(o,{name:"error-warning",className:"size-3.5 shrink-0 text-[var(--status-warning)]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:"Showing saved results — last refresh failed"}),e.jsx("button",{type:"button",onClick:r,className:"shrink-0 underline","aria-label":"Retry GitHub refresh",children:"Retry"})]}),L=({kind:r,noItemsTitle:s,noItemsBody:t,noItemsIcon:a,noItemsAction:i,onClearFilters:n})=>r==="no-match"?e.jsx(p,{icon:"search",title:"Nothing matches these filters",description:"Try fewer words, or search by number, author, or label.",action:n?e.jsx(l,{type:"button",variant:"outline",size:"sm",onClick:n,children:"Clear filters"}):void 0}):e.jsx(p,{icon:a??"git-pull-request",title:s,description:t,action:i});export{G,R as S,S as a,p as b,j as c,H as d,I as e,L as f,E as g,C as h,z as i};
|