@pi-chamber/web 0.3.2 → 0.3.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/{CommitSection-DLIvjYbM.js → CommitSection-BAYzLtBf.js} +1 -1
- package/dist/assets/{DiagramEditor-Tw3ZWHML.js → DiagramEditor-D1yc4joK.js} +1 -1
- package/dist/assets/{DiagramView-CK6R7taL.js → DiagramView-CAlJiG11.js} +1 -1
- package/dist/assets/{DiffView-vrxi5oWp.js → DiffView-DGD9DMS7.js} +1 -1
- package/dist/assets/{FilesView-BD_h3EVr.js → FilesView-DB5VI7EN.js} +1 -1
- package/dist/assets/{GitView-BwNKqK0K.js → GitView-CFlPcSn9.js} +3 -3
- package/dist/assets/{JsonTreeView-CmY7QgEX.js → JsonTreeView-CoX1ZscV.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-CpI-25Xk.js → MarkdownRendererImpl-V1HMFCjr.js} +1 -1
- package/dist/assets/{PatchDiff-CrIWbYj7.js → PatchDiff-D6Gs7K5B.js} +1 -1
- package/dist/assets/{PierreDiffViewer-B410mdbq.js → PierreDiffViewer-COYd5Qr-.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-DROjbyIu.js → SessionSwitcherDropdown-o1RjhCfF.js} +8 -8
- package/dist/assets/{SettingsView-CsJItYZh.js → SettingsView-BYqvfMTS.js} +3 -3
- package/dist/assets/{SettingsWindow-C9s4AX72.js → SettingsWindow-CtNS0tQn.js} +1 -1
- package/dist/assets/{ToolOutputDialog-b_R4tAZu.js → ToolOutputDialog-2zKUdGYL.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-CfnliaE9.js → ToolPartDiffPreview-CBFC9min.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-CQz2fSZI.js → VirtualizedFileDiff-UMgLcO4Q.js} +1 -1
- package/dist/assets/{collapsible-CR4U9tjw.js → collapsible-Kx4bmsQM.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-C7vXPUYT.js → computeVirtualFileMetrics-DdOCbMyK.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-DtTHRnq1.js → contextFileOpenGuard-BRldMp0d.js} +1 -1
- package/dist/assets/{index-DZG82DE1.js → index-CuSNEV7s.js} +1 -1
- package/dist/assets/{isDiffPlainText-zTq-4A04.js → isDiffPlainText-CGIf0q8p.js} +1 -1
- package/dist/assets/{isFilePlainText-CLgIdzE5.js → isFilePlainText-D4hgTRxT.js} +1 -1
- package/dist/assets/{main-BVWtJYSk.js → main-By_pvk90.js} +2 -2
- package/dist/assets/{main-DXYHsqzA.js → main-CmkRaMOR.js} +4 -4
- package/dist/assets/{markdownCore-CN0pApQE.js → markdownCore-CAVCyFnI.js} +1 -1
- package/dist/assets/{miniChat-BrbRq5NQ.js → miniChat-_XK2gGZE.js} +2 -2
- package/dist/assets/{mobile-DTPtCn5N.js → mobile-B4E4JqAf.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-CM8qBaye.js → renderElectronMiniChatApp-Ca4hZgIz.js} +1 -1
- package/dist/assets/{renderMobileApp-KS_pt-qc.js → renderMobileApp-ClA5Cnmw.js} +4 -4
- package/dist/assets/{useInlineCommentController-CwNNjgc7.js → useInlineCommentController-DD31jQNC.js} +1 -1
- package/dist/assets/{usePanelSlide-DkorgQJ5.js → usePanelSlide-a4c67FIY.js} +2 -2
- package/dist/assets/{useWindowTitle-B9wt_3ZQ.js → useWindowTitle-DoHrUC5r.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-x89A7Wy0.js → vendor-codemirror-language-data-Dp_Z-0GD.js} +2 -2
- package/dist/assets/{web-components-BEPfE4kU.js → web-components-Cct1r-wn.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/mini-chat.html +1 -1
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/lib/pi/session-daemon/session-daemon.js +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{be as U,f as F,B as E,I as w,as as J,at as W,au as Z,az as _,aQ as ee,h as O,E as te,aM as R,eA as se,eB as q,t as ne}from"./SessionSwitcherDropdown-
|
|
1
|
+
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{be as U,f as F,B as E,I as w,as as J,at as W,au as Z,az as _,aQ as ee,h as O,E as te,aM as R,eA as se,eB as q,t as ne}from"./SessionSwitcherDropdown-o1RjhCfF.js";import{p as oe,q as re,t as ae,v as Y,N as ie}from"./usePanelSlide-a4c67FIY.js";import{C as ce,a as le,b as de}from"./collapsible-Kx4bmsQM.js";import{a as me}from"./index-BAqpUCjs.js";function Ce({draft:n,onEdit:a,onDelete:r,className:h,maxWidth:d}){const p=U()?.currentTheme,[m,j]=N.useState(!1),[k,f]=N.useState(!1),u=typeof n.text=="string"?n.text:"",i=u.length>150||u.split(`
|
|
2
2
|
`).length>3;return t.jsxs(oe,{open:k,onOpenChange:f,children:[t.jsx(re,{render:t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden transition-all duration-200",h),style:{backgroundColor:p?.colors?.surface?.elevated,borderColor:p?.colors?.interactive?.border,maxWidth:d?`${Math.max(200,Math.floor(d))}px`:void 0},"data-comment-card":"true",onContextMenu:b=>{b.preventDefault(),f(!0)}}),children:t.jsxs("div",{className:"flex items-start justify-between gap-2 p-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-1.5",children:[t.jsx("span",{className:"truncate max-w-[200px]",title:n.fileLabel,children:n.fileLabel}),t.jsx("span",{children:"•"}),t.jsx("span",{children:`Lines ${n.startLine}-${n.endLine}`}),n.side&&t.jsxs("span",{children:["(",n.side,")"]})]}),t.jsxs(ce,{open:m||!i,onOpenChange:j,children:[t.jsx("div",{className:F("text-sm whitespace-pre-wrap break-words leading-relaxed",!m&&i&&"line-clamp-3"),children:u}),i&&t.jsx(le,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-6 px-0 mt-1 text-xs text-muted-foreground hover:text-foreground w-full justify-start",children:m?t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(de,{})]})]}),t.jsxs(J,{children:[t.jsx(W,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-foreground",children:t.jsx(w,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(_,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(_,{onClick:r,className:"text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(Y,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(Y,{onClick:r,className:"text-destructive focus:text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})}function ve({initialText:n="",onTextChange:a,onSave:r,onCancel:h,fileLabel:d,lineRange:l,isEditing:p=!1,className:m,maxWidth:j}){const f=U()?.currentTheme,{isMobile:u}=ee(),[i,b]=c.useState(n),D=N.useRef(null),M=e=>{b(e),a?.(e)},L=N.useRef(l);N.useEffect(()=>{l&&(L.current=l)},[l]);const v=e=>{if(!e)return;const o=Math.min(e.start,e.end),g=Math.max(e.start,e.end);return{...e,start:o,end:g}},x=v(l);N.useEffect(()=>{const e=D.current;if(!e)return;const o=e.closest(".overlay-scrollbar-container"),g=o?.scrollTop??window.scrollY,I=o?.scrollLeft??window.scrollX;if(u){e.scrollIntoView({behavior:"auto",block:"nearest"});try{e.focus({preventScroll:!0})}catch{e.focus()}return}try{e.focus({preventScroll:!0})}catch{e.focus()}const z=e.value.length;try{e.setSelectionRange(z,z)}catch{}requestAnimationFrame(()=>{o?(o.scrollTop=g,o.scrollLeft=I):window.scrollTo({top:g,left:I})})},[u]);const T=e=>{(e.metaKey||e.ctrlKey)&&e.key==="Enter"?(e.preventDefault(),i.trim()&&r(i,v(L.current))):e.key==="Escape"&&(e.preventDefault(),h())},y=e=>{e.stopPropagation(),i.trim()&&r(i,v(L.current))};return t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden animate-in fade-in zoom-in-95 duration-200",m),style:{backgroundColor:f?.colors?.surface?.elevated,borderColor:f?.colors?.interactive?.border,maxWidth:j?`${Math.max(200,Math.floor(j))}px`:void 0},"data-comment-input":"true",onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:t.jsxs("div",{className:"p-3",children:[(d||l)&&t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-2",children:[d&&t.jsx("span",{className:"truncate max-w-[200px]",children:d}),d&&l&&t.jsx("span",{children:"•"}),x&&t.jsx("span",{children:`Lines ${x.start}-${x.end}`})]}),t.jsx(ie,{simple:!0,ref:D,value:i,onChange:e=>M(e.target.value),onKeyDown:T,placeholder:u?"Add a comment...":"Add a comment... (Cmd+Enter to save)",outerClassName:"rounded-[var(--radius-xl)] bg-[var(--surface-subtle)] ring-1 ring-inset ring-border/60 focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]",className:"min-h-[80px] px-3 py-2.5 text-sm resize-y"}),t.jsxs("div",{className:"flex items-center justify-end gap-2 mt-3",children:[t.jsx(E,{variant:"ghost",size:"sm",onClick:h,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),className:"h-8 text-muted-foreground hover:text-foreground",children:"Cancel"}),t.jsx(E,{size:"sm",onClick:y,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),disabled:!i.trim(),className:"h-8 min-w-[80px]",style:{backgroundColor:f?.colors?.status?.success,color:f?.colors?.status?.successForeground},children:p?"Save":"Comment"})]})]})})}const ue=n=>{const a=Math.min(n.startLine,n.endLine),r=Math.max(n.startLine,n.endLine);return{...n,startLine:a,endLine:r}},Q=n=>{const a=Math.min(n.start,n.end),r=Math.max(n.start,n.end);return{...n,start:a,end:r}};function we(n){const{source:a,fileLabel:r,language:h,getCodeForRange:d,toStoreRange:l,fromDraftRange:p}=n,m=O(s=>s.currentSessionId),j=O(s=>s.newSessionDraft?.open),k=te(),f=O(c.useCallback(s=>m?s.getDirectoryForSession(m):null,[m])),u=R(s=>s.addDraft),i=R(s=>s.updateDraft),b=R(s=>s.removeDraft),[D,M]=c.useState(null),[L,v]=c.useState(""),[x,T]=c.useState(null),y=m??(j?"draft":null),e=f??k,o=c.useMemo(()=>!y||!e?null:{directory:e,sessionKey:y},[e,y]),g=o?se(me(),o.directory,o.sessionKey):null,I=R(c.useCallback(s=>g?s.drafts[g]??q:q,[g])),z=c.useMemo(()=>!o||!r?[]:I.filter(s=>s.source===a&&s.fileLabel===r),[r,I,a,o]),C=c.useCallback(()=>{M(null),v(""),T(null)},[]),V=c.useCallback(()=>{C()},[C]),X=c.useCallback(s=>{const P=Q(p(s));M(P),v(s.text),T(s.id)},[p]),G=c.useCallback(s=>{o&&(b(o,s.id),x===s.id&&C())},[x,b,C,o]),H=c.useCallback((s,P)=>{const $=P??D,K=s.trim();if(!$||!K||!r)return;if(!o){ne.error("Select a session to save comment");return}const A=Q($),S=ue(l(A)),B=d(A);x?i(o,x,{fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:B,language:h,text:K}):u(o,{source:a,fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:B,language:h,text:K}),C()},[u,x,r,d,h,C,D,a,o,l,i]);return{sessionKey:y,drafts:z,selection:D,setSelection:M,commentText:L,setCommentText:v,editingDraftId:x,setEditingDraftId:T,reset:C,cancel:V,startEdit:X,deleteDraft:G,saveComment:H,fromDraftRange:p}}export{ve as I,Ce as a,Q as n,we as u};
|