@hienlh/ppm 0.11.12 → 0.11.14

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/web/assets/{audio-preview-D8nR9F8d.js → audio-preview-DNMaA2Iy.js} +1 -1
  3. package/dist/web/assets/chat-tab-C1bWBIuO.js +12 -0
  4. package/dist/web/assets/{code-editor-CKcPOXZV.js → code-editor-bumY3csF.js} +2 -2
  5. package/dist/web/assets/{conflict-editor-DtzPzxR5.js → conflict-editor-C4vVGggc.js} +1 -1
  6. package/dist/web/assets/{database-viewer-DeiJYxBj.js → database-viewer-C2R4BmYb.js} +1 -1
  7. package/dist/web/assets/{diff-viewer-Dve9ga_f.js → diff-viewer-BkLjsOlF.js} +1 -1
  8. package/dist/web/assets/{extension-webview-DrL4qHNy.js → extension-webview-CYdFTUiW.js} +1 -1
  9. package/dist/web/assets/{image-preview-D3IgZDRo.js → image-preview-D7GaiqMk.js} +1 -1
  10. package/dist/web/assets/{index-8Mwobh7l.js → index-DDyfOgAn.js} +2 -2
  11. package/dist/web/assets/{markdown-renderer-zaluanbN.js → markdown-renderer-BUP7_3I1.js} +1 -1
  12. package/dist/web/assets/{pdf-preview-Yty6yXJU.js → pdf-preview-7pWtxUJf.js} +1 -1
  13. package/dist/web/assets/{port-forwarding-tab-Ddlryv9D.js → port-forwarding-tab-CJgjwcA4.js} +1 -1
  14. package/dist/web/assets/{postgres-viewer-CUFg5d8S.js → postgres-viewer-CCr2drUV.js} +1 -1
  15. package/dist/web/assets/{settings-tab-DIJMW_ZS.js → settings-tab-CJ9mBPMc.js} +1 -1
  16. package/dist/web/assets/{sqlite-viewer-BA2uk_fo.js → sqlite-viewer-W17NY9K0.js} +1 -1
  17. package/dist/web/assets/{terminal-tab-Bm0P3LZ7.js → terminal-tab-CPZdKlsT.js} +1 -1
  18. package/dist/web/assets/use-blob-url-BSltfg79.js +1 -0
  19. package/dist/web/assets/{video-preview-B2VaDLhw.js → video-preview-DDqJpn2U.js} +1 -1
  20. package/dist/web/index.html +1 -1
  21. package/dist/web/sw.js +1 -1
  22. package/package.json +1 -1
  23. package/src/services/slash-discovery/fuzzy-search.ts +7 -75
  24. package/src/shared/fuzzy-search.ts +87 -0
  25. package/src/web/components/chat/chat-tab.tsx +1 -5
  26. package/src/web/components/chat/message-input.tsx +5 -48
  27. package/src/web/components/chat/slash-command-picker.tsx +10 -20
  28. package/src/web/components/editor/use-blob-url.ts +6 -2
  29. package/dist/web/assets/chat-tab-yxo8oBYc.js +0 -12
  30. package/dist/web/assets/use-blob-url-BK7zshV7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{t as r}from"./createLucideIcon-BjHrJDVb.js";import{t as i}from"./columns-2-4fQcE4PF.js";import{t as a}from"./text-wrap-Cn6BNQfq.js";import{i as o,t as s}from"./api-client-Bn-Pi9k5.js";import"./vendor-mermaid-BlWh9BJO.js";import{n as c}from"./settings-store-B9axDbuA.js";import{A as l,N as u,h as d,z as f}from"./index-8Mwobh7l.js";import{r as p,t as m}from"./use-monaco-theme-BERjR8IA.js";var h=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),g=e(n(),1),_=t();function v(e){return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,py:`python`,html:`html`,css:`css`,scss:`scss`,json:`json`,md:`markdown`,mdx:`markdown`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function y({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.ref1,y=e?.ref2,x=e?.file1,S=e?.file2,C=e?.original,w=e?.modified,T=C!=null||w!=null,E=!!(x&&S),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),[j,M]=(0,g.useState)(!T),[N,P]=(0,g.useState)(null),[F,I]=(0,g.useState)(`both`),{wordWrap:L,toggleWordWrap:R}=c(d(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap}))),z=m(),B=(0,g.useRef)(null),[V,H]=(0,g.useState)();(0,g.useEffect)(()=>{let e=B.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&H(Math.floor(e.contentRect.height))});return t.observe(e),()=>t.disconnect()},[j,N]),(0,g.useEffect)(()=>{if(T||!n)return;if(M(!0),P(null),x&&S){let e=new URLSearchParams({file1:x,file2:S});s.get(`${o(n)}/files/compare?${e}`).then(e=>{A(e),M(!1)}).catch(e=>{P(e instanceof Error?e.message:`Failed to compare files`),M(!1)});return}let e;if(t){let i=new URLSearchParams({file:t});r&&i.set(`ref`,r),e=`${o(n)}/git/file-diff?${i}`}else if(r||y){let t=new URLSearchParams;r&&t.set(`ref1`,r),y&&t.set(`ref2`,y),e=`${o(n)}/git/diff?${t}`}else e=`${o(n)}/git/diff`;s.get(e).then(e=>{O(e.diff),M(!1)}).catch(e=>{P(e instanceof Error?e.message:`Failed to load diff`),M(!1)})},[t,n,r,y,x,S,T]);let{original:U,modified:W}=(0,g.useMemo)(()=>T?{original:C??``,modified:w??``}:E&&k?k:D?b(D):{original:``,modified:``},[D,T,C,w,E,k]),G=(0,g.useMemo)(()=>{let e=t??S??x;return e?v(e):`plaintext`},[t,x,S]),K=typeof window<`u`&&window.innerWidth<768,q=!K&&F===`both`;return!n&&!T?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`No project selected.`}):j?(0,_.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,_.jsx)(u,{className:`size-5 animate-spin`}),(0,_.jsx)(`span`,{className:`text-sm`,children:`Loading diff...`})]}):N?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-destructive text-sm`,children:N}):!T&&!E&&!U&&!W?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,_.jsx)(f,{className:`size-8`}),(0,_.jsx)(`p`,{className:`text-sm`,children:`No content changes`}),t&&(0,_.jsx)(`p`,{className:`text-xs font-mono`,children:t})]}):(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[!K&&(0,_.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(F===`left`?`both`:`left`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`left`?`bg-muted text-foreground`:``}`,title:`Expand original`,children:(0,_.jsx)(l,{className:`size-3.5`})}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(`both`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`both`?`bg-muted text-foreground`:``}`,title:`Side by side`,children:(0,_.jsx)(i,{className:`size-3.5`})}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(F===`right`?`both`:`right`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`right`?`bg-muted text-foreground`:``}`,title:`Expand modified`,children:(0,_.jsx)(h,{className:`size-3.5`})}),(0,_.jsx)(`div`,{className:`w-px h-3.5 bg-border mx-0.5 shrink-0`}),(0,_.jsx)(`button`,{type:`button`,onClick:R,title:`Toggle word wrap`,className:`p-1 rounded hover:bg-muted transition-colors ${L?`bg-muted text-foreground`:``}`,children:(0,_.jsx)(a,{className:`size-3.5`})})]}),(0,_.jsx)(`div`,{ref:B,className:`flex-1 overflow-hidden`,children:V&&V>0?(0,_.jsx)(p,{height:V,language:G,original:U,modified:W,theme:z,options:{fontSize:K?11:13,fontFamily:`Menlo, Monaco, Consolas, monospace`,wordWrap:K||L?`on`:`off`,renderSideBySide:q,readOnly:!0,automaticLayout:!0,scrollBeyondLastLine:!1},loading:(0,_.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})})})]})}function b(e){let t=e.split(`
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{t as r}from"./createLucideIcon-BjHrJDVb.js";import{t as i}from"./columns-2-4fQcE4PF.js";import{t as a}from"./text-wrap-Cn6BNQfq.js";import{i as o,t as s}from"./api-client-Bn-Pi9k5.js";import"./vendor-mermaid-BlWh9BJO.js";import{n as c}from"./settings-store-B9axDbuA.js";import{A as l,N as u,h as d,z as f}from"./index-DDyfOgAn.js";import{r as p,t as m}from"./use-monaco-theme-BERjR8IA.js";var h=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),g=e(n(),1),_=t();function v(e){return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,py:`python`,html:`html`,css:`css`,scss:`scss`,json:`json`,md:`markdown`,mdx:`markdown`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function y({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.ref1,y=e?.ref2,x=e?.file1,S=e?.file2,C=e?.original,w=e?.modified,T=C!=null||w!=null,E=!!(x&&S),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),[j,M]=(0,g.useState)(!T),[N,P]=(0,g.useState)(null),[F,I]=(0,g.useState)(`both`),{wordWrap:L,toggleWordWrap:R}=c(d(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap}))),z=m(),B=(0,g.useRef)(null),[V,H]=(0,g.useState)();(0,g.useEffect)(()=>{let e=B.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&H(Math.floor(e.contentRect.height))});return t.observe(e),()=>t.disconnect()},[j,N]),(0,g.useEffect)(()=>{if(T||!n)return;if(M(!0),P(null),x&&S){let e=new URLSearchParams({file1:x,file2:S});s.get(`${o(n)}/files/compare?${e}`).then(e=>{A(e),M(!1)}).catch(e=>{P(e instanceof Error?e.message:`Failed to compare files`),M(!1)});return}let e;if(t){let i=new URLSearchParams({file:t});r&&i.set(`ref`,r),e=`${o(n)}/git/file-diff?${i}`}else if(r||y){let t=new URLSearchParams;r&&t.set(`ref1`,r),y&&t.set(`ref2`,y),e=`${o(n)}/git/diff?${t}`}else e=`${o(n)}/git/diff`;s.get(e).then(e=>{O(e.diff),M(!1)}).catch(e=>{P(e instanceof Error?e.message:`Failed to load diff`),M(!1)})},[t,n,r,y,x,S,T]);let{original:U,modified:W}=(0,g.useMemo)(()=>T?{original:C??``,modified:w??``}:E&&k?k:D?b(D):{original:``,modified:``},[D,T,C,w,E,k]),G=(0,g.useMemo)(()=>{let e=t??S??x;return e?v(e):`plaintext`},[t,x,S]),K=typeof window<`u`&&window.innerWidth<768,q=!K&&F===`both`;return!n&&!T?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`No project selected.`}):j?(0,_.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,_.jsx)(u,{className:`size-5 animate-spin`}),(0,_.jsx)(`span`,{className:`text-sm`,children:`Loading diff...`})]}):N?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-destructive text-sm`,children:N}):!T&&!E&&!U&&!W?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,_.jsx)(f,{className:`size-8`}),(0,_.jsx)(`p`,{className:`text-sm`,children:`No content changes`}),t&&(0,_.jsx)(`p`,{className:`text-xs font-mono`,children:t})]}):(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[!K&&(0,_.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(F===`left`?`both`:`left`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`left`?`bg-muted text-foreground`:``}`,title:`Expand original`,children:(0,_.jsx)(l,{className:`size-3.5`})}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(`both`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`both`?`bg-muted text-foreground`:``}`,title:`Side by side`,children:(0,_.jsx)(i,{className:`size-3.5`})}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>I(F===`right`?`both`:`right`),className:`p-1 rounded hover:bg-muted transition-colors ${F===`right`?`bg-muted text-foreground`:``}`,title:`Expand modified`,children:(0,_.jsx)(h,{className:`size-3.5`})}),(0,_.jsx)(`div`,{className:`w-px h-3.5 bg-border mx-0.5 shrink-0`}),(0,_.jsx)(`button`,{type:`button`,onClick:R,title:`Toggle word wrap`,className:`p-1 rounded hover:bg-muted transition-colors ${L?`bg-muted text-foreground`:``}`,children:(0,_.jsx)(a,{className:`size-3.5`})})]}),(0,_.jsx)(`div`,{ref:B,className:`flex-1 overflow-hidden`,children:V&&V>0?(0,_.jsx)(p,{height:V,language:G,original:U,modified:W,theme:z,options:{fontSize:K?11:13,fontFamily:`Menlo, Monaco, Consolas, monospace`,wordWrap:K||L?`on`:`off`,renderSideBySide:q,readOnly:!0,automaticLayout:!0,scrollBeyondLastLine:!1},loading:(0,_.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})})})]})}function b(e){let t=e.split(`
2
2
  `),n=[],r=[],i=!1;for(let e of t)if(!(e.startsWith(`diff --git`)||e.startsWith(`diff --no-index`)||e.startsWith(`index `)||e.startsWith(`new file`)||e.startsWith(`deleted file`)||e.startsWith(`old mode`)||e.startsWith(`new mode`)||e.startsWith(`---`)||e.startsWith(`+++`)||e.startsWith(`Binary files`)||e.startsWith(`\\ No newline`))){if(e.startsWith(`@@`)){i=!0;continue}if(i)if(e.startsWith(`-`))n.push(e.slice(1));else if(e.startsWith(`+`))r.push(e.slice(1));else{let t=e.startsWith(` `)?e.slice(1):e;n.push(t),r.push(t)}}return{original:n.join(`
3
3
  `),modified:r.join(`
4
4
  `)}}export{y as DiffViewer};
@@ -1,3 +1,3 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{r}from"./api-client-Bn-Pi9k5.js";import{t as i}from"./tab-store-B3M9hjho.js";import{t as a}from"./extension-store-3yZYn07W.js";import{N as o}from"./index-8Mwobh7l.js";var s=e(n(),1),c=t(),l=`<script>
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{r}from"./api-client-Bn-Pi9k5.js";import{t as i}from"./tab-store-B3M9hjho.js";import{t as a}from"./extension-store-3yZYn07W.js";import{N as o}from"./index-DDyfOgAn.js";var s=e(n(),1),c=t(),l=`<script>
2
2
  function acquireVsCodeApi(){return{postMessage:function(m){window.parent.postMessage(m,"*")},getState:function(){try{return JSON.parse(sessionStorage.getItem("vscode-state")||"null")}catch{return null}},setState:function(s){sessionStorage.setItem("vscode-state",JSON.stringify(s));return s}}}
3
3
  <\/script>`;function u(e){if(!e)return e;let t=e.indexOf(`<head>`);return t===-1?l+e:e.slice(0,t+6)+l+e.slice(t+6)}function d({metadata:e}){let t=e?.panelId,n=e?.viewType,l=i(e=>e.currentProject)||e?.projectName||void 0,[d,f]=(0,s.useState)(!1),p=a(e=>e.contributions!==null),m=a(e=>{if(t&&e.webviewPanels[t])return e.webviewPanels[t];if(n){let t=n.includes(`.`)?n:`${n}.view`;return Object.values(e.webviewPanels).find(e=>e.viewType===n||e.viewType===t)}}),h=m?.id??t,g=(0,s.useRef)(null),_=m?.html??``,v=u(_),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(m||!n||!p||l&&l===y.current)return;l&&(y.current=l);let e=n.includes(`.`)?n:`${n}.view`,t=!1;async function i(){let n=[];if(l)try{let e=r(),t=(await(await fetch(`/api/projects`,e?{headers:{Authorization:`Bearer ${e}`}}:{})).json()).data?.find(e=>e.name===l);t&&(n=[t.path])}catch{}t||window.dispatchEvent(new CustomEvent(`ext:command:execute`,{detail:{command:e,args:n}}))}return i(),()=>{t=!0}},[m,n,l,p]),(0,s.useEffect)(()=>{if(!m||!n||!l||l===y.current)return;y.current=l;let e=n.includes(`.`)?n:`${n}.view`;(async()=>{try{let t=r(),n=(await(await fetch(`/api/projects`,t?{headers:{Authorization:`Bearer ${t}`}}:{})).json()).data?.find(e=>e.name===l);n&&window.dispatchEvent(new CustomEvent(`ext:command:execute`,{detail:{command:e,args:[n.path]}}))}catch{}})()},[m,n,l]);let b=e?.extensionId,x=a(e=>{if(b&&e.activationErrors[b])return e.activationErrors[b];if(n){for(let[t,r]of Object.entries(e.activationErrors))if(t===`ext-${n}`)return r}}),S=(0,s.useCallback)(()=>{if(f(!1),!n)return;let e=n.includes(`.`)?n:`${n}.view`;(async()=>{try{let t=r(),n=(await(await fetch(`/api/projects`,t?{headers:{Authorization:`Bearer ${t}`}}:{})).json()).data?.find(e=>e.name===l),i=n?[n.path]:[];window.dispatchEvent(new CustomEvent(`ext:command:execute`,{detail:{command:e,args:i}}))}catch{}})()},[n,l]),C=(0,s.useRef)(null);return(0,s.useEffect)(()=>{C.current=h??null},[h]),(0,s.useEffect)(()=>()=>{let e=C.current;e&&(a.getState().removeWebviewPanel(e),window.dispatchEvent(new CustomEvent(`ext:webview:close`,{detail:{panelId:e}})))},[]),(0,s.useEffect)(()=>{if(m){f(!1);return}if(!p||!n)return;let e=0,t=setInterval(()=>{if(e++,e>3){clearInterval(t),f(!0);return}S()},2e3);return()=>clearInterval(t)},[m,p,n,S]),(0,s.useEffect)(()=>{if(!h)return;let e=e=>{g.current&&e.source===g.current.contentWindow&&window.dispatchEvent(new CustomEvent(`ext:webview:send`,{detail:{panelId:h,message:e.data}}))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[h]),(0,s.useEffect)(()=>{if(!h)return;let e=e=>{let{panelId:t,message:n}=e.detail;t===h&&g.current?.contentWindow?.postMessage(n,`*`)};return window.addEventListener(`ext:webview:message`,e),()=>window.removeEventListener(`ext:webview:message`,e)},[h]),!m||!_?(0,c.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-sm text-text-subtle`,children:d?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`span`,{className:`text-destructive font-medium`,children:`Extension failed to load`}),x&&(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground max-w-md text-center`,children:x}),(0,c.jsx)(`button`,{onClick:S,className:`text-xs text-primary hover:underline`,children:`Retry`})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o,{className:`size-5 animate-spin`}),(0,c.jsx)(`span`,{children:`Loading extension...`})]})}):(0,c.jsx)(`div`,{className:`h-full w-full relative`,children:(0,c.jsx)(`iframe`,{ref:g,srcDoc:v,sandbox:`allow-scripts`,className:`w-full h-full border-0 bg-white dark:bg-zinc-900`,title:m.title},h)})}export{d as ExtensionWebview};
@@ -1 +1 @@
1
- import{b as e}from"./vendor-markdown-0Mxgxy0L.js";import{t}from"./file-exclamation-point-BwzaQ50n.js";import"./api-client-Bn-Pi9k5.js";import{N as n}from"./index-8Mwobh7l.js";import{t as r}from"./use-blob-url-BK7zshV7.js";var i=e();function a({filePath:e,projectName:a}){let{blobUrl:o,error:s}=r(e,a);return s?(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,i.jsx)(t,{className:`size-10 text-text-subtle`}),(0,i.jsx)(`p`,{className:`text-sm`,children:`Failed to load image.`})]}):o?(0,i.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 bg-surface overflow-auto`,children:(0,i.jsx)(`img`,{src:o,alt:e,className:`max-w-full max-h-full object-contain`})}):(0,i.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,i.jsx)(n,{className:`size-5 animate-spin text-text-subtle`})})}export{a as ImagePreview};
1
+ import{b as e}from"./vendor-markdown-0Mxgxy0L.js";import{t}from"./file-exclamation-point-BwzaQ50n.js";import"./api-client-Bn-Pi9k5.js";import{N as n}from"./index-DDyfOgAn.js";import{t as r}from"./use-blob-url-BSltfg79.js";var i=e();function a({filePath:e,projectName:a}){let{blobUrl:o,error:s}=r(e,a);return s?(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,i.jsx)(t,{className:`size-10 text-text-subtle`}),(0,i.jsx)(`p`,{className:`text-sm`,children:`Failed to load image.`})]}):o?(0,i.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 bg-surface overflow-auto`,children:(0,i.jsx)(`img`,{src:o,alt:e,className:`max-w-full max-h-full object-contain`})}):(0,i.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,i.jsx)(n,{className:`size-5 animate-spin text-text-subtle`})})}export{a as ImagePreview};