@hienlh/ppm 0.13.8 → 0.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/ai-settings-section-CLNBWLS4.js +1 -0
- package/dist/web/assets/{audio-preview-DQbX8gfL.js → audio-preview-C1p-Q5XZ.js} +1 -1
- package/dist/web/assets/{chat-tab-BJQT9kie.js → chat-tab-BSJUkgxB.js} +8 -8
- package/dist/web/assets/code-editor-rNw5_pXh.js +8 -0
- package/dist/web/assets/{conflict-editor-BKwJLX0D.js → conflict-editor-Dcn3HuLD.js} +1 -1
- package/dist/web/assets/data-grid-nZfSIop5.js +5 -0
- package/dist/web/assets/database-DOWH9-Vv.js +1 -0
- package/dist/web/assets/database-viewer-CNoq5Uxp.js +1 -0
- package/dist/web/assets/{diff-viewer-SAtaBwNI.js → diff-viewer-NMLD4V8q.js} +1 -1
- package/dist/web/assets/{extension-webview-PiV4bKJ1.js → extension-webview-DW2dBswj.js} +1 -1
- package/dist/web/assets/{image-preview-CbFFD9BS.js → image-preview-Dqp1KSus.js} +1 -1
- package/dist/web/assets/index-CoMWx5VS.js +27 -0
- package/dist/web/assets/index-Dzb3OtrX.css +2 -0
- package/dist/web/assets/{input-BMvRUOr7.js → input-DYWhyaze.js} +1 -1
- package/dist/web/assets/keybindings-store-B7nlHmDh.js +1 -0
- package/dist/web/assets/{markdown-renderer-CHWA0KAo.js → markdown-renderer-DNIXdY0d.js} +1 -1
- package/dist/web/assets/{pdf-preview-DQMdjqa2.js → pdf-preview-ChC1gaaZ.js} +1 -1
- package/dist/web/assets/{port-forwarding-tab-9BpNC9_7.js → port-forwarding-tab-dLhH_g2l.js} +1 -1
- package/dist/web/assets/{postgres-viewer-Bm5T51n6.js → postgres-viewer-De0pzd1C.js} +2 -2
- package/dist/web/assets/{settings-tab-BUstSDLR.js → settings-tab-Mrs9uzCZ.js} +1 -1
- package/dist/web/assets/sqlite-viewer-BqtIjvil.js +1 -0
- package/dist/web/assets/{terminal-tab-Xtj6RN0d.js → terminal-tab-CeHEtoE2.js} +1 -1
- package/dist/web/assets/{video-preview-BLI_RruT.js → video-preview-CHPVrMtx.js} +1 -1
- package/dist/web/assets/x-OGGXhtlb.js +1 -0
- package/dist/web/index.html +8 -8
- package/dist/web/sw.js +1 -1
- package/package.json +2 -1
- package/src/web/components/database/data-grid.tsx +18 -2
- package/src/web/components/database/glide-grid-theme.ts +82 -0
- package/src/web/components/database/glide-grid-types.ts +79 -0
- package/src/web/components/database/use-glide-cell-content.ts +124 -0
- package/src/web/components/database/use-glide-columns.ts +61 -0
- package/src/web/components/database/use-glide-selection.ts +48 -0
- package/src/web/components/editor/code-editor.tsx +124 -7
- package/src/web/index.html +1 -0
- package/test.sql +1 -0
- package/dist/web/assets/ai-settings-section-CHgpQ_OP.js +0 -1
- package/dist/web/assets/code-editor-CeKTvfyz.js +0 -8
- package/dist/web/assets/database-DCT0OjgQ.js +0 -1
- package/dist/web/assets/database-viewer-DixWWvjx.js +0 -5
- package/dist/web/assets/index-C1RBJe0a.css +0 -2
- package/dist/web/assets/index-ZFyltHwi.js +0 -27
- package/dist/web/assets/keybindings-store-D0C-Pq2o.js +0 -1
- package/dist/web/assets/plus-51UQ45rf.js +0 -1
- package/dist/web/assets/sqlite-viewer-C7rhO4bn.js +0 -1
- package/dist/web/assets/x-BtqbfkR7.js +0 -1
- /package/dist/web/assets/{chevron-right-BzAdxJRG.js → chevron-right-DnHIvvcy.js} +0 -0
- /package/dist/web/assets/{code-CuravVys.js → code-DGBecc50.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-markdown-0Mxgxy0L.js";import"./api-client-Dvzcc_EO.js";import{E as e}from"./index-ZFyltHwi.js";export{e as useKeybindingsStore};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-BjHrJDVb.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),n=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),r=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{n,t as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
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"./chevron-right-BzAdxJRG.js";import{t as i}from"./database-DCT0OjgQ.js";import{t as a}from"./refresh-cw-CSFrDtiu.js";import{t as o}from"./table-Dq575bPF.js";import{t as s}from"./trash-2-CJYoLw7Q.js";import{i as c,t as l}from"./api-client-Dvzcc_EO.js";import"./settings-store-BHBb62gq.js";import"./vendor-mermaid-CMiurk2b.js";import{G as u,at as d,it as f}from"./index-ZFyltHwi.js";import"./use-monaco-theme-CP-vyTF8.js";import{t as p}from"./sql-query-editor-CMQpaOjA.js";import{n as m,r as h,t as g}from"./lib-D_kRA9p6.js";var _=e(n(),1);function v(e,t,n){let[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(null),[s,u]=(0,_.useState)(null),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(1),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),E=n?`/api/db/connections/${n}`:null,D=E??`${c(e)}/sqlite`,O=E?``:`path=${encodeURIComponent(t)}`,k=(0,_.useCallback)(async()=>{m(!0),g(null);try{let e=E?`?cached=1`:O?`?${O}`:``,t=await l.get(`${D}/tables${e}`);i(t),!E&&t.length>0&&!a&&o(t[0].name)}catch(e){g(e.message)}finally{m(!1)}},[D,O,E]);(0,_.useEffect)(()=>{k()},[k]);let A=(0,_.useCallback)(async()=>{if(a){m(!0);try{let e=O?`${O}&`:``,[t,n]=await Promise.all([l.get(`${D}/data?${e}table=${encodeURIComponent(a)}&page=${v}&limit=100`),l.get(`${D}/schema?${e}table=${encodeURIComponent(a)}`)]);u(t),f(n)}catch(e){g(e.message)}finally{m(!1)}}},[D,O,a,v]);return(0,_.useEffect)(()=>{A()},[A]),{tables:r,selectedTable:a,selectTable:(0,_.useCallback)(e=>{o(e),y(1),x(null)},[]),tableData:s,schema:d,loading:p,error:h,page:v,setPage:y,queryResult:b,queryError:S,queryLoading:w,executeQuery:(0,_.useCallback)(async e=>{T(!0),C(null);try{let n=E?{sql:e}:{path:t,sql:e},r=await l.post(`${D}/query`,n);x(r),r.changeType===`modify`&&A()}catch(e){C(e.message)}finally{T(!1)}},[D,E,t,A]),updateCell:(0,_.useCallback)(async(e,n,r)=>{if(a)try{E?await l.put(`${D}/cell`,{table:a,pkColumn:`rowid`,pkValue:e,column:n,value:r}):await l.put(`${D}/cell`,{path:t,table:a,rowid:e,column:n,value:r}),A()}catch(e){g(e.message)}},[D,E,t,a,A]),deleteRow:(0,_.useCallback)(async e=>{if(a)try{E?await l.del(`${D}/row`,{table:a,pkColumn:`rowid`,pkValue:e}):await l.del(`${D}/row`,{path:t,table:a,rowid:e}),A(),k()}catch(e){g(e.message)}},[D,E,t,a,A,k]),refreshTables:k,refreshData:A}}var y=t();function b({tables:e,selectedTable:t,onSelect:n,onRefresh:r}){return(0,y.jsxs)(`div`,{className:`w-48 shrink-0 flex flex-col bg-background overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,y.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Tables`}),(0,y.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground transition-colors`,title:`Refresh tables`,children:(0,y.jsx)(a,{className:`size-3`})})]}),(0,y.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[e.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${t===e.name?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[(0,y.jsx)(o,{className:`size-3 shrink-0`}),(0,y.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,y.jsx)(`span`,{className:`text-[10px] opacity-60`,children:e.rowCount})]},e.name)),e.length===0&&(0,y.jsx)(`p`,{className:`px-3 py-4 text-xs text-muted-foreground text-center`,children:`No tables found`})]})]})}function x({tableData:e,schema:t,loading:n,page:i,onPageChange:a,onCellUpdate:o,onRowDelete:s}){if(!e)return(0,y.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:n?(0,y.jsx)(u,{className:`size-4 animate-spin`}):`Select a table`});let c=Math.ceil(e.total/e.limit)||1;return(0,y.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,y.jsx)(S,{columns:e.columns,rows:e.rows,schema:t,onCellUpdate:o,onRowDelete:s})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 border-t border-border bg-background shrink-0 text-xs text-muted-foreground`,children:[(0,y.jsxs)(`span`,{children:[e.total.toLocaleString(),` rows`]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`button`,{type:`button`,disabled:i<=1,onClick:()=>a(i-1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,y.jsx)(d,{className:`size-3.5`})}),(0,y.jsxs)(`span`,{children:[i,` / `,c]}),(0,y.jsx)(`button`,{type:`button`,disabled:i>=c,onClick:()=>a(i+1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,y.jsx)(r,{className:`size-3.5`})})]})]})]})}function S({columns:e,rows:t,schema:n,onCellUpdate:r,onRowDelete:i}){let[a,o]=(0,_.useState)(null),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(null),f=(0,_.useMemo)(()=>new Set(n.filter(e=>e.pk).map(e=>e.name)),[n]),p=(0,_.useCallback)((e,t,n)=>{t!==`rowid`&&(o({rowIdx:e,col:t}),l(n==null?``:String(n)))},[]),v=(0,_.useCallback)(()=>{if(!a)return;let e=t[a.rowIdx];if(!e)return;let n=e.rowid,i=e[a.col];String(i??``)!==c&&r(n,a.col,c===``?null:c),o(null)},[a,c,t,r]),b=(0,_.useCallback)(()=>o(null),[]),x=(0,_.useCallback)(e=>{let n=t[e];!n||!i||(i(n.rowid),d(null))},[t,i]),S=m({data:t,columns:(0,_.useMemo)(()=>{let t=e.map(e=>({id:e,accessorFn:t=>t[e],header:()=>(0,y.jsx)(`span`,{className:`${f.has(e)?`font-bold`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,children:e}),cell:({row:t,getValue:n})=>{let r=t.index,i=a?.rowIdx===r&&a?.col===e,o=n();return i?(0,y.jsx)(`input`,{autoFocus:!0,className:`w-full bg-transparent border border-primary/50 rounded px-1 py-0 text-xs outline-none`,value:c,onChange:e=>l(e.target.value),onBlur:v,onKeyDown:e=>{e.key===`Enter`&&v(),e.key===`Escape`&&b()}}):(0,y.jsx)(`span`,{className:`cursor-pointer truncate block ${o==null?`text-muted-foreground/40 italic`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,onDoubleClick:()=>p(r,e,o),title:o==null?`NULL`:String(o),children:o==null?`NULL`:String(o)})}}));return i&&t.push({id:`_actions`,header:()=>null,cell:({row:e})=>{let t=e.index;return u===t?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 whitespace-nowrap`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>x(t),className:`text-destructive text-[10px] font-medium hover:underline`,children:`Confirm`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>d(null),className:`text-muted-foreground text-[10px] hover:underline`,children:`Cancel`})]}):(0,y.jsx)(`button`,{type:`button`,onClick:()=>d(t),className:`p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-destructive/10 hover:text-destructive transition-opacity`,title:`Delete row`,children:(0,y.jsx)(s,{className:`size-3`})})},size:60}),t},[e,f,a,c,v,b,p,i,u,x]),getCoreRowModel:h()});return(0,y.jsxs)(`table`,{className:`w-full text-xs border-collapse`,children:[(0,y.jsx)(`thead`,{className:`sticky top-0 z-10 bg-muted`,children:S.getHeaderGroups().map(e=>(0,y.jsx)(`tr`,{children:e.headers.map(e=>(0,y.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:g(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,y.jsxs)(`tbody`,{children:[S.getRowModel().rows.map(e=>(0,y.jsx)(`tr`,{className:`group hover:bg-muted/30 border-b border-border/50`,children:e.getVisibleCells().map(e=>(0,y.jsx)(`td`,{className:`px-2 py-1 max-w-[300px]`,children:g(e.column.columnDef.cell,e.getContext())},e.id))},e.id)),t.length===0&&(0,y.jsx)(`tr`,{children:(0,y.jsx)(`td`,{colSpan:e.length,className:`px-2 py-8 text-center text-muted-foreground`,children:`No data`})})]})]})}function C({onExecute:e,loading:t}){return(0,y.jsx)(p,{onExecute:e,loading:t})}function w({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.connectionId,a=e?.tableName,[o,s]=(0,_.useState)(!1);return r?(0,y.jsx)(T,{projectName:``,dbPath:``,connectionId:r,connectionName:e?.connectionName,initialTable:a,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e),hideTableList:!0}):!t||!n?(0,y.jsxs)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:[(0,y.jsx)(i,{className:`size-5 mr-2`}),` No database file selected.`]}):(0,y.jsx)(T,{projectName:n,dbPath:t,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e)})}function T({projectName:e,dbPath:t,connectionId:n,connectionName:r,initialTable:a,queryPanelOpen:o,onToggleQueryPanel:s,hideTableList:c}){let l=v(e,t,n),d=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{a&&!d.current&&l.tables.length>0&&(d.current=!0,l.selectTable(a))},[a,l.tables]),l.error&&l.tables.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,y.jsx)(f,{className:`size-10 text-destructive`}),(0,y.jsx)(`p`,{className:`text-sm`,children:l.error})]}):l.loading&&l.tables.length===0?(0,y.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,y.jsx)(u,{className:`size-5 animate-spin`}),(0,y.jsx)(`span`,{className:`text-sm`,children:`Loading database...`})]}):(0,y.jsxs)(`div`,{className:`flex h-full w-full overflow-hidden`,children:[!c&&(0,y.jsx)(b,{tables:l.tables,selectedTable:l.selectedTable,onSelect:l.selectTable,onRefresh:l.refreshTables}),(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden ${c?``:`border-l border-border`}`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,y.jsx)(i,{className:`size-3.5 text-muted-foreground`}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:r??t}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:l.selectedTable&&`/ ${l.selectedTable}`}),(0,y.jsx)(`div`,{className:`ml-auto`,children:(0,y.jsx)(`button`,{type:`button`,onClick:s,className:`px-2 py-1 rounded text-xs transition-colors ${o?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})})]}),(0,y.jsx)(`div`,{className:`flex-1 overflow-hidden ${o?`max-h-[60%]`:``}`,children:(0,y.jsx)(x,{tableData:l.tableData,schema:l.schema,loading:l.loading,page:l.page,onPageChange:l.setPage,onCellUpdate:l.updateCell,onRowDelete:l.deleteRow})}),o&&(0,y.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,y.jsx)(C,{onExecute:l.executeQuery,loading:l.queryLoading})})]})]})}export{w as SqliteViewer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-BjHrJDVb.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),n=e(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),r=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{n,t as r,r as t};
|
|
File without changes
|
|
File without changes
|