db-studio 1.7.12 → 1.8.0
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/core-dist/assets/{_pathlessLayout-XL9BaZh5.js → _pathlessLayout-CaHwrd7d.js} +2 -2
- package/dist/core-dist/assets/{_queryId-CAjVLs-F.js → _queryId-BvXfDRyN.js} +1 -1
- package/dist/core-dist/assets/{_table-DKnSwqFc.js → _table-C-cjSgPo.js} +1 -1
- package/dist/core-dist/assets/{_table-BI_XiC1K.js → _table-Dswhig7K.js} +1 -1
- package/dist/core-dist/assets/{cdoe-editor-Lwkji0wU.js → cdoe-editor-CiltAc4h.js} +1 -1
- package/dist/core-dist/assets/{chat-sidebar-DTwB3fym.js → chat-sidebar-_lfj2Fbh.js} +1 -1
- package/dist/core-dist/assets/{dist-C6mIPWhR.js → dist-BXjtz0JN.js} +1 -1
- package/dist/core-dist/assets/{dist-UBwYqP_w.js → dist-D2fkvd0U.js} +1 -1
- package/dist/core-dist/assets/{index-B8u-3J3b.js → index-B6AC45mT.js} +3 -3
- package/dist/core-dist/assets/{queries.store-BTgqNNws.js → queries.store-DHVvJtBW.js} +1 -1
- package/dist/core-dist/assets/{runner-CJikZjx7.js → runner-BMuLDN6J.js} +1 -1
- package/dist/core-dist/assets/{runner-tab-CSDL4L8O.js → runner-tab-DvRyphpg.js} +3 -3
- package/dist/core-dist/assets/{scroll-area-CnrU1Pgb.js → scroll-area-CUkrAzp4.js} +1 -1
- package/dist/core-dist/assets/tanstack-CGK2_6ff.js +9 -0
- package/dist/core-dist/assets/{tooltip-DttVuH4f.js → tooltip-Bl2D-B_-.js} +1 -1
- package/dist/core-dist/assets/{use-delete-column-CA96Lesz.js → use-delete-column-Bj0kvje3.js} +1 -1
- package/dist/core-dist/assets/{use-rate-limit-B1ivFudi.js → use-rate-limit-BLoyDbp7.js} +1 -1
- package/dist/core-dist/index.html +2 -2
- package/dist/index.js +291 -607
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/core-dist/assets/tanstack-CJpNvQIy.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as i,D as d,E as n,O as s,Ot as l,T as p,w as m}from"./radix-ui-C0u6gLux.js";import{Et as f}from"./index-
|
|
1
|
+
import{C as i,D as d,E as n,O as s,Ot as l,T as p,w as m}from"./radix-ui-C0u6gLux.js";import{Et as f}from"./index-B6AC45mT.js";var o=l();function u({delayDuration:t=0,...a}){return(0,o.jsx)(n,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function g({...t}){return(0,o.jsx)(u,{children:(0,o.jsx)(d,{"data-slot":"tooltip",...t})})}function j({...t}){return(0,o.jsx)(s,{"data-slot":"tooltip-trigger",...t})}function _({className:t,sideOffset:a=0,children:e,...r}){return(0,o.jsx)(p,{children:(0,o.jsxs)(m,{"data-slot":"tooltip-content",sideOffset:a,className:f("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",t),...r,children:[e,(0,o.jsx)(i,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]"})]})})}export{j as i,_ as n,u as r,g as t};
|
package/dist/core-dist/assets/{use-delete-column-CA96Lesz.js → use-delete-column-Bj0kvje3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p}from"./rolldown-runtime-Bnw7wDfq.js";import{i as y,n as g,r as C,t as x,v as h,x as b}from"./tanstack-
|
|
1
|
+
import{r as p}from"./rolldown-runtime-Bnw7wDfq.js";import{i as y,n as g,r as C,t as x,v as h,x as b}from"./tanstack-CGK2_6ff.js";import{K as v,P as z,nt as w}from"./icons-BywMJ5og.js";import{Ot as S}from"./radix-ui-C0u6gLux.js";import{Et as f,Ot as j,ot as R,rt as d,st as D}from"./index-B6AC45mT.js";import{t as E}from"./format-cell-value-DyKHFyYf.js";var m=p(w(),1),l=S(),_=({value:e,className:t})=>{const[o,r]=(0,m.useState)(!1),i=(0,m.useRef)(null);(0,m.useEffect)(()=>()=>{i.current&&window.clearTimeout(i.current)},[]);const n=E(e),s=(0,m.useCallback)(async u=>{u.stopPropagation();try{await navigator.clipboard.writeText(n),r(!0)}catch(a){console.error("Failed to copy cell value:",a);return}i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r(!1)},1200)},[n]);return n?(0,l.jsx)("button",{type:"button",className:f("absolute right-0.5 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center","text-muted-foreground opacity-0 transition-opacity","hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none","group-hover:opacity-100",t),onClick:s,"aria-label":o?"Copied":"Copy",children:o?(0,l.jsx)(v,{className:"size-3.5"}):(0,l.jsx)(z,{className:"size-3.5"})}):null},N=({columnVirtualizer:e,row:t,rowVirtualizer:o,virtualPaddingLeft:r,virtualPaddingRight:i,virtualRow:n})=>{const s=t.getVisibleCells(),u=e.getVirtualItems();return(0,l.jsxs)("tr",{"data-index":n.index,ref:a=>o.measureElement(a),className:"flex absolute w-fit border-b items-center text-sm hover:bg-accent/20 data-[state=open]:bg-accent/40 [&_svg]:size-4",style:{transform:`translateY(${n.start}px)`},children:[r?(0,l.jsx)("td",{style:{display:"flex",width:r}}):null,u.map(a=>{const c=s[a.index];return(0,l.jsxs)("td",{className:"group relative flex border-r border-zinc-800 h-8 items-center px-3 truncate",style:{width:c.column.getSize()},children:[g(c.column.columnDef.cell,c.getContext()),(0,l.jsx)(_,{value:c.getValue()})]},c.id)}),i?(0,l.jsx)("td",{style:{display:"flex",width:i}}):null]},t.id)},T=({columnVirtualizer:e,table:t,tableContainerRef:o,virtualPaddingLeft:r,virtualPaddingRight:i})=>{const{rows:n}=t.getRowModel(),s=x({count:n.length,estimateSize:()=>33,getScrollElement:()=>o.current,measureElement:typeof window<"u"&&navigator.userAgent.indexOf("Firefox")===-1?a=>a?.getBoundingClientRect().height:void 0,overscan:5}),u=s.getVirtualItems();return(0,l.jsx)("tbody",{style:{display:"grid",height:`${s.getTotalSize()}px`,position:"relative"},children:u.map(a=>{const c=n[a.index];return(0,l.jsx)(N,{columnVirtualizer:e,row:c,rowVirtualizer:s,virtualPaddingLeft:r,virtualPaddingRight:i,virtualRow:a},c.id)})})};function A({header:e,table:t,label:o}){const r=t._getDefaultColumnDef(),i=(0,m.useCallback)(()=>{t.setColumnSizing(n=>{const s={...n};return delete s[e.column.id],s})},[e.column.id,t]);return(0,l.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${o} column`,"aria-valuenow":e.column.getSize(),"aria-valuemin":r.minSize,"aria-valuemax":r.maxSize,tabIndex:0,className:f("after:-translate-x-1/2 -right-px absolute top-0 z-50 h-full w-0.5 cursor-ew-resize touch-none select-none bg-border transition-opacity after:absolute after:inset-y-0 after:left-1/2 after:h-full after:w-[18px] after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",e.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100"),onDoubleClick:i,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})}var I=(0,m.memo)(A,(e,t)=>{const o=e.header.column,r=t.header.column;return!(o.getIsResizing()!==r.getIsResizing()||o.getSize()!==r.getSize()||e.label!==t.label)}),V=({columnVirtualizer:e,table:t,virtualPaddingLeft:o,virtualPaddingRight:r})=>{const i=e.getVirtualItems(),n=t.getState().columnSizingInfo.isResizingColumn;return(0,l.jsx)("thead",{className:"h-9 grid sticky top-0 z-10",children:t.getHeaderGroups().map(s=>(0,l.jsxs)("tr",{className:f("flex w-fit bg-black border-b border-zinc-800 items-center text-sm [&_svg]:size-4",n&&"pointer-events-none"),children:[o?(0,l.jsx)("th",{style:{display:"flex",width:o}}):null,i.map(u=>{const a=s.headers[u.index];return(0,l.jsxs)("th",{className:"relative h-full flex items-center border-r border-zinc-800 text-xs font-medium text-zinc-500",style:{width:a.getSize()},children:[(0,l.jsx)("div",{className:"flex w-full h-full items-center px-3",children:g(a.column.columnDef.header,a.getContext())}),a.column.getCanResize()&&(0,l.jsx)(I,{header:a,table:t,label:a.column.id})]},a.id)}),r?(0,l.jsx)("th",{style:{display:"flex",width:r}}):null]},s.id))})},M=({table:e})=>{const t=e.getVisibleLeafColumns(),o=(0,m.useRef)(null),r=x({count:t.length,estimateSize:u=>t[u].getSize(),getScrollElement:()=>o.current,horizontal:!0,overscan:3}),i=r.getVirtualItems();let n,s;return r&&i?.length&&(n=i[0]?.start??0,s=r.getTotalSize()-(i[i.length-1]?.end??0)),(0,l.jsx)("div",{className:"w-full flex-1 overflow-auto",ref:o,style:{position:"relative"},children:(0,l.jsxs)("table",{style:{display:"grid"},children:[(0,l.jsx)(V,{columnVirtualizer:r,table:e,virtualPaddingLeft:n,virtualPaddingRight:s}),(0,l.jsx)(T,{columnVirtualizer:r,table:e,tableContainerRef:o,virtualPaddingLeft:n,virtualPaddingRight:s})]})})},L=({columns:e,data:t})=>(0,l.jsx)(M,{table:C({data:t,columns:e,getCoreRowModel:y(),enableColumnResizing:!0,columnResizeMode:"onChange"})}),O=()=>{const e=b(),{selectedDatabase:t}=R(),{mutateAsync:o,isPending:r}=h({mutationFn:async({tableName:n,columnName:s,cascade:u})=>{const a=new URLSearchParams({db:t??"",cascade:u?"true":"false"});return(await D.delete(`/tables/${encodeURIComponent(n)}/columns/${encodeURIComponent(s)}`,{params:a})).data.data},onSuccess:async(n,s)=>{await Promise.all([e.invalidateQueries({queryKey:[d.CACHE_KEYS.TABLE_COLUMNS,s.tableName],exact:!1}),e.invalidateQueries({queryKey:[d.CACHE_KEYS.TABLE_DATA,s.tableName],exact:!1}),e.invalidateQueries({queryKey:[d.CACHE_KEYS.TABLES_LIST],exact:!1})])},onError:n=>{console.error("Error deleting column:",n)}});return{deleteColumn:async({tableName:n,columnName:s,cascade:u})=>j.promise(o({tableName:n,columnName:s,cascade:u,db:""}),{loading:"Deleting column...",success:a=>a||"Column deleted successfully",error:a=>a.message||"Failed to delete column"}),isDeletingColumn:r}};export{L as n,_ as r,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as a}from"./tanstack-
|
|
1
|
+
import{y as a}from"./tanstack-CGK2_6ff.js";import{ct as m}from"./index-B6AC45mT.js";var s=()=>{const{data:t,isLoading:r,error:i,refetch:e}=a({queryKey:["rate-limit"],queryFn:async()=>{try{return(await m.get("/chat/limit")).data}catch{return{limit:0,used:0,remaining:0}}}});return{rateLimit:t,isLoadingRateLimit:r,errorRateLimit:i,refetchRateLimit:e}};export{s as t};
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/image.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>db-studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-B6AC45mT.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Bnw7wDfq.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/monaco-editor-B6TxHuqP.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/icons-BywMJ5og.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/radix-ui-C0u6gLux.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/tanstack-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-CGK2_6ff.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-DkNbwow-.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/react-dom-JJlWtX5O.js">
|
|
16
16
|
<link rel="stylesheet" crossorigin href="/assets/monaco-editor-DVSAlpqy.css">
|