@malloy-publisher/sdk 0.0.84 → 0.0.85

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/index.cjs.js CHANGED
@@ -32,7 +32,7 @@ export default theme;`}function No(e={},...t){const{breakpoints:n,mixins:r={},sp
32
32
  `;function Hx({cell:e,notebookPath:t,expandCodeCell:n,hideCodeCellIcon:r,expandEmbedding:i,hideEmbeddingIcon:s}){const[a,o]=P.useState(n),[u,l]=P.useState(i),[d,c]=P.useState(),[m,p]=P.useState(),[g,b]=P.useState(!1),{packageName:T,projectName:y}=pt(),C=Uu({modelPath:t,query:e.text,optionalPackageName:T,optionalProjectName:y});return P.useEffect(()=>{e.type==="code"&&nr(e.text,"malloy").then(S=>{c(S)})},[e]),P.useEffect(()=>{nr(C,"typescript").then(S=>{p(S)})},[C]),e.type==="markdown"&&h.jsx(ut,{variant:"outlined",children:h.jsx(Ut,{children:h.jsx(mu,{children:e.text})})})||e.type==="code"&&h.jsxs(ut,{variant:"outlined",sx:{height:"auto"},children:[(!r||!s&&e.result)&&h.jsxs(x.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",ml:"8px"},children:[h.jsxs(x.Stack,{sx:{flexDirection:"row"},children:[e.newSources&&e.newSources.length>0&&h.jsx(x.Typography,{variant:"overline",children:h.jsx("b",{children:"Data source"})}),e.result&&h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Results"})]}),h.jsx(x.Stack,{sx:{flexDirection:"row"},children:h.jsxs(x.CardActions,{sx:{padding:"0px 8px 0px 8px",mb:"auto",mt:"auto"},children:[e.newSources&&e.newSources.length>0&&h.jsx(x.Tooltip,{title:"Explore Data Sources",children:h.jsx(x.IconButton,{size:"small",onClick:()=>{b(!g),l(!1),o(!1)},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M3 3h18v18H3V3zm2 2v14h14V5H5zm2 2h10v2H7V7zm0 4h10v2H7v-2zm0 4h10v2H7v-2z",fill:"currentColor"})})})}),!r&&h.jsx(x.Tooltip,{title:a?"Hide Code":"View Code",children:h.jsx(x.IconButton,{size:"small",onClick:()=>{o(!a)},children:h.jsx(_f,{})})}),!s&&e.result&&h.jsx(x.Tooltip,{title:u?"Hide Embedding":"View Embedding",children:h.jsx(x.IconButton,{size:"small",onClick:()=>{l(!u)},children:h.jsx($i,{})})})]})})]}),h.jsx(x.Collapse,{in:u,timeout:"auto",unmountOnExit:!0,children:h.jsxs(x.Stack,{sx:{p:"8px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:[h.jsx(x.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:m}}),h.jsx(x.Tooltip,{title:"Copy Embeddable Code",children:h.jsx(x.IconButton,{sx:{width:"24px",height:"24px"},onClick:()=>{navigator.clipboard.writeText(C)},children:h.jsx(ma,{})})})]})}),h.jsxs(x.Collapse,{in:a,timeout:"auto",unmountOnExit:!0,children:[h.jsx("style",{children:jx}),h.jsx(x.Stack,{sx:{mx:"8px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:h.jsx("div",{className:"code-display",style:{fontSize:"12px",width:"800px",border:"1px solid rgb(220,220,220)"},dangerouslySetInnerHTML:{__html:d}})})]}),h.jsx(x.Collapse,{in:g,timeout:"auto",unmountOnExit:!0,sx:{p:"5px"},children:h.jsx(Ju,{sourceAndPaths:e.newSources.map(S=>({sourceInfo:JSON.parse(S),modelPath:t}))})}),e.result&&!g&&h.jsx(h.Fragment,{children:h.jsx(vf,{result:e.result,minHeight:300,maxHeight:700})})]})}const Ux=new Cf(new Et);function Df({notebookPath:e,expandResults:t,hideResultIcons:n,expandEmbeddings:r,hideEmbeddingIcons:i}){const[s,a]=P.useState(!1),[o,u]=P.useState(),{projectName:l,packageName:d,versionId:c}=pt(),m=zx(e,!0);P.useEffect(()=>{nr(m,"typescript").then(y=>{u(y)})},[s,m]);const{data:p,isSuccess:g,isError:b,error:T}=xt({queryKey:["notebook",l,d,e,c],queryFn:async y=>(await Ux.getNotebook(l,d,e,c,y)).data});return h.jsxs(ut,{variant:"outlined",children:[h.jsxs(Ut,{children:[h.jsxs(x.Stack,{sx:{flexDirection:"row",justifyContent:"space-between"},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Notebook"}),!i&&h.jsx(x.CardActions,{sx:{padding:"0px 10px 0px 10px",mb:"auto",mt:"auto"},children:h.jsx(x.Tooltip,{title:s?"Hide Embedding":"View Embedding",children:h.jsx(x.IconButton,{size:"small",onClick:()=>{a(!s)},children:h.jsx($i,{})})})})]}),h.jsx(x.Collapse,{in:s,timeout:"auto",unmountOnExit:!0,children:h.jsxs(x.Stack,{sx:{borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:[h.jsx(x.Typography,{sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:h.jsx("div",{dangerouslySetInnerHTML:{__html:o}})}),h.jsx(x.Tooltip,{title:"Copy Embeddable Code",children:h.jsx(x.IconButton,{sx:{width:"24px",height:"24px"},onClick:()=>{navigator.clipboard.writeText(m)},children:h.jsx(ma,{})})})]})})]}),h.jsx(Mu,{children:h.jsxs(x.Stack,{spacing:2,component:"section",children:[!g&&!b&&h.jsx(bt,{text:"Fetching Notebook..."}),g&&p.notebookCells?.map((y,C)=>h.jsx(Hx,{cell:y,notebookPath:e,expandCodeCell:t,hideCodeCellIcon:n,expandEmbedding:r,hideEmbeddingIcon:i},C)),b&&T.status===404&&h.jsxs(x.Typography,{variant:"body2",children:[h.jsx("code",{children:`${l} > ${d} > ${e}`})," ","not found."]}),b&&T.status!==404&&h.jsx(gt,{error:T,context:`${l} > ${d} > ${e}`})]})})]})}function zx(e,t){return`<Notebook
33
33
  notebookPath="${e}"
34
34
  expandCodeCells={${t}}
35
- />`}const wf=Oe(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),$x=new Sf(new Et);function qx(){const{projectName:e,packageName:t,versionId:n}=pt(),{data:r,isSuccess:i,isError:s,error:a}=xt({queryKey:["package",e,t,n],queryFn:o=>$x.getPackage(e,t,n,!1,o)});return h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Package Config"}),h.jsx(x.Divider,{}),h.jsx(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:h.jsxs(x.List,{dense:!0,disablePadding:!0,children:[h.jsx(x.ListItem,{dense:!0,disablePadding:!0,children:h.jsx(x.ListItemText,{primary:"Name",primaryTypographyProps:{fontWeight:"500"},secondary:t})}),!i&&!s&&h.jsx(x.ListItem,{children:h.jsx(bt,{text:"Fetching Package Metadata..."})}),i&&(r.data&&h.jsx(x.ListItem,{dense:!0,disablePadding:!0,children:h.jsx(x.ListItemText,{primary:"Description",primaryTypographyProps:{fontWeight:"500"},secondary:r.data.description})})||h.jsxs(x.ListItem,{disablePadding:!0,dense:!0,sx:{mt:"20px"},children:[h.jsx(wf,{sx:{color:"grey.600",mr:"10px"}}),h.jsx(x.ListItemText,{primary:"No package manifest"})]})),s&&h.jsx(gt,{error:a,context:`${e} > ${t} > ${n}`})]})})]})})}const Vx=Oe(h.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Wx=new Af(new Et);function Gx(){const{projectName:e}=$r(),{data:t,isSuccess:n,isError:r,error:i}=xt({queryKey:["about",e],queryFn:s=>Wx.getProject(e,!1,s)});return h.jsxs(h.Fragment,{children:[!n&&!r&&h.jsx(bt,{text:"Fetching About..."}),n&&h.jsxs(ut,{variant:"outlined",sx:{p:2},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",sx:{mb:1},children:"Readme"}),h.jsx(ut,{sx:{p:1},children:h.jsx(mu,{children:t.data.readme})})]}),r&&h.jsx(gt,{error:i,context:`${e} > About`})]})}const Yx=new Sf(new Et);function Nf({navigate:e}){const{projectName:t}=$r(),{data:n,isSuccess:r,isError:i,error:s}=xt({queryKey:["packages",t],queryFn:a=>Yx.listPackages(t,a)});return h.jsxs(h.Fragment,{children:[!r&&!i&&h.jsx(bt,{text:"Fetching Packages..."}),r&&h.jsxs(ut,{variant:"outlined",sx:{p:2},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",sx:{mb:1},children:"Packages"}),h.jsx(x.Grid,{container:!0,spacing:2,columns:12,children:n.data.sort((a,o)=>a.name.localeCompare(o.name)).map(a=>h.jsx(x.Grid,{size:{xs:12,sm:12,md:12,lg:4},children:h.jsx(ut,{variant:"outlined",sx:{cursor:"pointer",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",transform:"translateY(-2px)"}},onClick:o=>e(a.name+"/",o),children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",color:"primary.main",children:a.name}),h.jsx(x.Box,{sx:{maxHeight:"120px",overflowY:"auto"},children:h.jsx(x.Typography,{variant:"body2",children:a.description})})]})})},a.name))})]}),i&&h.jsx(gt,{error:s,context:`${t} > Packages`})]})}const Pf=P.createContext(void 0);function $r(){const e=P.useContext(Pf);if(!e)throw new Error("useProject must be used within a ProjectProvider");return e}function Rf({children:e,projectName:t}){return h.jsx(Pf.Provider,{value:{projectName:t},children:e})}function Kx({navigate:e}){return h.jsxs(x.Grid,{container:!0,spacing:2,columns:12,children:[h.jsx(x.Grid,{size:{xs:12,md:12},children:h.jsx(Nf,{navigate:e})}),h.jsx(x.Grid,{size:{xs:12,md:12},children:h.jsx(Gx,{})})]})}const $u=new Tf(new Et);function Lf({connectionName:e}){const{projectName:t}=$r(),[n,r]=P.useState(void 0),[i,s]=P.useState(null),[a,o]=P.useState(!1),{data:u,isSuccess:l,isError:d,error:c,isLoading:m}=xt({queryKey:["tablePath",t,e],queryFn:p=>$u.listSchemas(t,e,p)});return h.jsxs(x.Grid,{container:!0,spacing:2,children:[h.jsx(x.Grid,{size:{xs:12,md:6},children:h.jsxs(x.Paper,{sx:{p:2},children:[h.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),h.jsx(x.FormControlLabel,{control:h.jsx(x.Switch,{checked:a,onChange:p=>o(p.target.checked)}),label:"Hidden Schemas"})]}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:[m&&h.jsx(bt,{text:"Fetching Table Paths..."}),d&&h.jsx(gt,{error:c,context:`${t} > ${e}`}),l&&u.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Schemas"}),l&&u.data.length>0&&h.jsx(x.List,{dense:!0,disablePadding:!0,children:u.data.filter(({isHidden:p})=>a||!p).sort((p,g)=>p.isDefault===g.isDefault?0:p.isDefault?-1:1).map(p=>h.jsx(x.ListItemButton,{selected:i===p.name,onClick:()=>s(p.name),children:h.jsx(x.ListItemText,{primary:p.name})},p.name))})]})]})}),h.jsx(x.Grid,{size:{xs:12,md:6},children:i&&h.jsx(x.Paper,{sx:{p:2},children:h.jsx(Xx,{connectionName:e,schemaName:i,onTableClick:p=>{r(p)}})})}),n&&h.jsx(Qx,{connectionName:e,schemaName:i,tableName:n,onClose:()=>r(void 0)})]})}function Qx({connectionName:e,schemaName:t,tableName:n,onClose:r}){const{projectName:i}=$r(),{data:s,isSuccess:a,isError:o,error:u,isLoading:l}=xt({queryKey:["tablePathSchema",i,e,t,n],queryFn:d=>$u.getTablesource(i,e,n,`${t}.${n}`,d)});return a&&s&&console.log(s),h.jsxs(x.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[h.jsxs(x.DialogTitle,{children:[h.jsxs(x.Typography,{fontSize:"large",variant:"body2",fontFamily:"monospace",component:"span",style:{textTransform:"uppercase"},children:[t,".",n]}),h.jsx(x.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:h.jsx(x.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),h.jsxs(x.DialogContent,{children:[l&&h.jsx(bt,{text:"Fetching Table Details..."}),o&&h.jsx(gt,{error:u,context:`${i} > ${e} > ${t}.${n}`}),a&&s&&h.jsx(x.TableContainer,{children:h.jsxs(x.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"NAME"}),h.jsx(x.TableCell,{children:"TYPE"})]})}),h.jsx(x.TableBody,{children:s.data.columns?.map(d=>h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:d.name}),h.jsx(x.TableCell,{children:d.type})]},d.name))})]})})]})]})}function Xx({connectionName:e,schemaName:t,onTableClick:n}){const{projectName:r}=$r(),{data:i,isSuccess:s,isError:a,error:o,isLoading:u}=xt({queryKey:["tablesInSchema",r,e,t],queryFn:l=>$u.listTables(r,e,t,l)});return h.jsxs(h.Fragment,{children:[h.jsxs(x.Typography,{variant:"overline",fontWeight:"bold",children:["Tables in ",t]}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:[u&&h.jsx(bt,{text:"Fetching Tables..."}),a&&h.jsx(gt,{error:o,context:`${r} > ${e} > ${t}`}),s&&i.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Tables"}),s&&i.data.length>0&&h.jsx(x.List,{dense:!0,disablePadding:!0,children:i.data.map(l=>h.jsx(x.ListItemButton,{onClick:()=>n(l),children:h.jsx(x.ListItemText,{primary:l})},l))})]})]})}const Zx=new Tf(new Et);function Jx({connection:e,onClick:t}){return h.jsxs(x.TableRow,{onClick:t,sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:[h.jsx(x.TableCell,{children:h.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(x.Typography,{variant:"body2",children:e.name}),h.jsx(Vx,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"body2",children:e.type})})]},e.name)}function ey(){const{projectName:e}=pt(),[t,n]=P.useState(null),{data:r,isSuccess:i,isError:s,error:a}=xt({queryKey:["connections",e],queryFn:l=>Zx.listConnections(e,l)}),o=l=>{n(l)},u=()=>{n(null)};return h.jsxs(Rf,{projectName:e,children:[h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Database Connections"}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!i&&!s&&h.jsx(x.Typography,{variant:"body2",sx:{m:"auto"},children:"Fetching Connections..."}),i&&r.data.length>0&&h.jsx(x.Table,{size:"small",children:h.jsxs(x.TableBody,{children:[h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"subtitle2",fontWeight:"bold",children:"Connection Name"})}),h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"subtitle2",fontWeight:"bold",children:"Type"})})]}),r.data.map(l=>h.jsx(Jx,{connection:l,onClick:()=>o(l.name)},l.name))]})}),i&&r.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Connections"}),s&&h.jsx(gt,{error:a,context:`${e} > Connections`})]})]})}),h.jsxs(x.Dialog,{open:t!==null,onClose:u,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(x.DialogTitle,{children:["Connection Explorer: ",t,h.jsx(x.IconButton,{"aria-label":"close",onClick:u,sx:{position:"absolute",right:8,top:8},children:h.jsx(x.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),h.jsx(x.DialogContent,{children:t&&h.jsx(Lf,{connectionName:t})})]})]})}const ty=new Ax(new Et);function ny(){const{projectName:e,packageName:t,versionId:n}=pt(),[r,i]=P.useState(!1),[s,a]=P.useState(null),o=g=>{a(g),i(!0)},u=()=>{i(!1),a(null)},{data:l,isError:d,error:c,isSuccess:m}=xt({queryKey:["databases",e,t,n],queryFn:g=>ty.listDatabases(e,t,n,g)}),p=g=>g>=1024*1024*1024*1024?`${(g/(1024*1024*1024)).toFixed(2)} T`:g>=1024*1024*1024?`${(g/(1024*1024*1024)).toFixed(2)} G`:g>=1024*1024?`${(g/(1024*1024)).toFixed(2)} M`:`${(g/1024).toFixed(2)} K`;return h.jsxs(h.Fragment,{children:[h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Embedded Databases"}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!m&&!d&&h.jsx(bt,{text:"Fetching Databases..."}),d&&h.jsx(gt,{error:c,context:`${e} > ${t} > Databases`}),m&&l.data.length>0&&h.jsxs(x.Table,{size:"small",children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"Name"}),h.jsx(x.TableCell,{align:"right",children:"Rows"})]})}),h.jsx(x.TableBody,{children:l.data.map(g=>h.jsxs(x.TableRow,{onClick:()=>o(g),sx:{cursor:"pointer"},children:[h.jsx(x.TableCell,{component:"th",scope:"row",children:g.path}),h.jsx(x.TableCell,{align:"right",children:p(g.info.rowCount)})]},g.path))})]}),m&&l.data.length===0&&h.jsx(x.Typography,{variant:"body2",sx:{m:"auto"},children:"No databases found"})]})]})}),h.jsxs(x.Dialog,{open:r,onClose:u,maxWidth:"sm",fullWidth:!0,children:[h.jsx(x.DialogTitle,{children:s?.path}),h.jsx(x.DialogContent,{children:s?.info?.columns&&h.jsx(x.TableContainer,{children:h.jsxs(x.Table,{size:"small",children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"Column"}),h.jsx(x.TableCell,{children:"Type"})]})}),h.jsx(x.TableBody,{children:s.info.columns.map(g=>h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{component:"th",scope:"row",children:g.name}),h.jsx(x.TableCell,{children:g.type})]},g.name))})]})})})]})]})}function Cn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},le.apply(null,arguments)}function ry(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Ls(t.components[n].defaultProps,r)}const iy=Au();function sy(e=iy){return dg(e)}function ay({props:e,name:t,defaultTheme:n,themeId:r}){let i=sy(n);return i=i[r]||i,ry({theme:i,name:t,props:e})}function oy({props:e,name:t}){return ay({props:e,name:t,defaultTheme:ku,themeId:Iu})}function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vo.apply(null,arguments)}function Of(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Wo(e,t){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wo(e,t)}function Ff(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wo(e,t)}const Dc={disabled:!1},Gs=P.createContext(null);var uy=function(t){return t.scrollTop},fi="unmounted",Vn="exited",Wn="entering",yr="entered",Go="exiting",_n=function(e){Ff(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var a=i,o=a&&!a.isMounting?r.enter:r.appear,u;return s.appearStatus=null,r.in?o?(u=Vn,s.appearStatus=Wn):u=yr:r.unmountOnExit||r.mountOnEnter?u=fi:u=Vn,s.state={status:u},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var a=i.in;return a&&s.status===fi?{status:Vn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Wn&&a!==yr&&(s=Wn):(a===Wn||a===yr)&&(s=Go)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,a,o;return s=a=o=i,i!=null&&typeof i!="number"&&(s=i.exit,a=i.enter,o=i.appear!==void 0?i.appear:a),{exit:s,enter:a,appear:o}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Wn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ns.findDOMNode(this);a&&uy(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vn&&this.setState({status:fi})},n.performEnter=function(i){var s=this,a=this.props.enter,o=this.context?this.context.isMounting:i,u=this.props.nodeRef?[o]:[ns.findDOMNode(this),o],l=u[0],d=u[1],c=this.getTimeouts(),m=o?c.appear:c.enter;if(!i&&!a||Dc.disabled){this.safeSetState({status:yr},function(){s.props.onEntered(l)});return}this.props.onEnter(l,d),this.safeSetState({status:Wn},function(){s.props.onEntering(l,d),s.onTransitionEnd(m,function(){s.safeSetState({status:yr},function(){s.props.onEntered(l,d)})})})},n.performExit=function(){var i=this,s=this.props.exit,a=this.getTimeouts(),o=this.props.nodeRef?void 0:ns.findDOMNode(this);if(!s||Dc.disabled){this.safeSetState({status:Vn},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:Go},function(){i.props.onExiting(o),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Vn},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,a=!0;return this.nextCallback=function(o){a&&(a=!1,s.nextCallback=null,i(o))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:ns.findDOMNode(this),o=i==null&&!this.props.addEndListener;if(!a||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],l=u[0],d=u[1];this.props.addEndListener(l,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===fi)return null;var s=this.props,a=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var o=Of(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return P.createElement(Gs.Provider,{value:null},typeof a=="function"?a(i,o):P.cloneElement(P.Children.only(a),o))},t}(P.Component);_n.contextType=Gs;_n.propTypes={};function mr(){}_n.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:mr,onEntering:mr,onEntered:mr,onExit:mr,onExiting:mr,onExited:mr};_n.UNMOUNTED=fi;_n.EXITED=Vn;_n.ENTERING=Wn;_n.ENTERED=yr;_n.EXITING=Go;function ly(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qu(e,t){var n=function(s){return t&&P.isValidElement(s)?t(s):s},r=Object.create(null);return e&&P.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function cy(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),i=[];for(var s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var a,o={};for(var u in t){if(r[u])for(a=0;a<r[u].length;a++){var l=r[u][a];o[r[u][a]]=n(l)}o[u]=n(u)}for(a=0;a<i.length;a++)o[i[a]]=n(i[a]);return o}function Kn(e,t,n){return n[t]!=null?n[t]:e.props[t]}function dy(e,t){return qu(e.children,function(n){return P.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Kn(n,"appear",e),enter:Kn(n,"enter",e),exit:Kn(n,"exit",e)})})}function hy(e,t,n){var r=qu(e.children),i=cy(t,r);return Object.keys(i).forEach(function(s){var a=i[s];if(P.isValidElement(a)){var o=s in t,u=s in r,l=t[s],d=P.isValidElement(l)&&!l.props.in;u&&(!o||d)?i[s]=P.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:Kn(a,"exit",e),enter:Kn(a,"enter",e)}):!u&&o&&!d?i[s]=P.cloneElement(a,{in:!1}):u&&o&&P.isValidElement(l)&&(i[s]=P.cloneElement(a,{onExited:n.bind(null,a),in:l.props.in,exit:Kn(a,"exit",e),enter:Kn(a,"enter",e)}))}}),i}var fy=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},py={component:"div",childFactory:function(t){return t}},Vu=function(e){Ff(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var a=s.handleExited.bind(ly(s));return s.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,s){var a=s.children,o=s.handleExited,u=s.firstRender;return{children:u?dy(i,o):hy(i,a,o),firstRender:!1}},n.handleExited=function(i,s){var a=qu(this.props.children);i.key in a||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(o){var u=Vo({},o.children);return delete u[i.key],{children:u}}))},n.render=function(){var i=this.props,s=i.component,a=i.childFactory,o=Of(i,["component","childFactory"]),u=this.state.contextValue,l=fy(this.state.children).map(a);return delete o.appear,delete o.enter,delete o.exit,s===null?P.createElement(Gs.Provider,{value:u},l):P.createElement(Gs.Provider,{value:u},P.createElement(s,o,l))},t}(P.Component);Vu.propTypes={};Vu.defaultProps=py;const wc={};function Mf(e,t){const n=$.useRef(wc);return n.current===wc&&(n.current=e(t)),n}const my=[];function gy(e){$.useEffect(e,my)}class Wu{static create(){return new Wu}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Bf(){const e=Mf(Wu.create).current;return gy(e.disposeEffect),e}function Nc(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function by(e){return Mr("MuiCollapse",e)}jr("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Ey=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Hi(r,by,n)},xy=Be("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(vu(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),yy=Be("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Ty=Be("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Li=$.forwardRef(function(t,n){const r=Br({props:t,name:"MuiCollapse"}),{addEndListener:i,children:s,className:a,collapsedSize:o="0px",component:u,easing:l,in:d,onEnter:c,onEntered:m,onEntering:p,onExit:g,onExited:b,onExiting:T,orientation:y="vertical",style:C,timeout:S=Ih.standard,TransitionComponent:N=_n,...D}=r,w={...r,orientation:y,collapsedSize:o},B=Ey(w),V=Xg(),Q=Bf(),E=$.useRef(null),L=$.useRef(),O=typeof o=="number"?`${o}px`:o,z=y==="horizontal",M=z?"width":"height",J=$.useRef(null),oe=Os(n,J),he=q=>re=>{if(q){const te=J.current;re===void 0?q(te):q(te,re)}},fe=()=>E.current?E.current[z?"clientWidth":"clientHeight"]:0,G=he((q,re)=>{E.current&&z&&(E.current.style.position="absolute"),q.style[M]=O,c&&c(q,re)}),_=he((q,re)=>{const te=fe();E.current&&z&&(E.current.style.position="");const{duration:we,easing:ne}=Nc({style:C,timeout:S,easing:l},{mode:"enter"});if(S==="auto"){const U=V.transitions.getAutoHeightDuration(te);q.style.transitionDuration=`${U}ms`,L.current=U}else q.style.transitionDuration=typeof we=="string"?we:`${we}ms`;q.style[M]=`${te}px`,q.style.transitionTimingFunction=ne,p&&p(q,re)}),Ee=he((q,re)=>{q.style[M]="auto",m&&m(q,re)}),ue=he(q=>{q.style[M]=`${fe()}px`,g&&g(q)}),I=he(b),de=he(q=>{const re=fe(),{duration:te,easing:we}=Nc({style:C,timeout:S,easing:l},{mode:"exit"});if(S==="auto"){const ne=V.transitions.getAutoHeightDuration(re);q.style.transitionDuration=`${ne}ms`,L.current=ne}else q.style.transitionDuration=typeof te=="string"?te:`${te}ms`;q.style[M]=O,q.style.transitionTimingFunction=we,T&&T(q)}),pe=q=>{S==="auto"&&Q.start(L.current||0,q),i&&i(J.current,q)};return h.jsx(N,{in:d,onEnter:G,onEntered:Ee,onEntering:_,onExit:ue,onExited:I,onExiting:de,addEndListener:pe,nodeRef:J,timeout:S==="auto"?null:S,...D,children:(q,{ownerState:re,...te})=>h.jsx(xy,{as:u,className:Ye(B.root,a,{entered:B.entered,exited:!d&&O==="0px"&&B.hidden}[q]),style:{[z?"minWidth":"minHeight"]:O,...C},ref:oe,ownerState:{...w,state:q},...te,children:h.jsx(yy,{ownerState:{...w,state:q},className:B.wrapper,ref:E,children:h.jsx(Ty,{ownerState:{...w,state:q},className:B.wrapperInner,children:s})})})})});Li&&(Li.muiSupportAuto=!0);const Cy=$.createContext(void 0);function Sy(){return $.useContext(Cy)}function Pc(e){try{return e.matches(":focus-visible")}catch{}return!1}class Ys{static create(){return new Ys}static use(){const t=Mf(Ys.create).current,[n,r]=$.useState(!1);return t.shouldMount=n,t.setShouldMount=r,$.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=ky(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Ay(){return Ys.use()}function ky(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function Iy(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:s,rippleSize:a,in:o,onExited:u,timeout:l}=e,[d,c]=$.useState(!1),m=Ye(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+s,left:-(a/2)+i},g=Ye(n.child,d&&n.childLeaving,r&&n.childPulsate);return!o&&!d&&c(!0),$.useEffect(()=>{if(!o&&u!=null){const b=setTimeout(u,l);return()=>{clearTimeout(b)}}},[u,o,l]),h.jsx("span",{className:m,style:p,children:h.jsx("span",{className:g})})}const Wt=jr("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Yo=550,_y=80,vy=We.keyframes`
35
+ />`}const wf=Oe(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),$x=new Sf(new Et);function qx(){const{projectName:e,packageName:t,versionId:n}=pt(),{data:r,isSuccess:i,isError:s,error:a}=xt({queryKey:["package",e,t,n],queryFn:o=>$x.getPackage(e,t,n,!1,o)});return h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Package Config"}),h.jsx(x.Divider,{}),h.jsx(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:h.jsxs(x.List,{dense:!0,disablePadding:!0,children:[h.jsx(x.ListItem,{dense:!0,disablePadding:!0,children:h.jsx(x.ListItemText,{primary:"Name",primaryTypographyProps:{fontWeight:"500"},secondary:t})}),!i&&!s&&h.jsx(x.ListItem,{children:h.jsx(bt,{text:"Fetching Package Metadata..."})}),i&&(r.data&&h.jsx(x.ListItem,{dense:!0,disablePadding:!0,children:h.jsx(x.ListItemText,{primary:"Description",primaryTypographyProps:{fontWeight:"500"},secondary:r.data.description})})||h.jsxs(x.ListItem,{disablePadding:!0,dense:!0,sx:{mt:"20px"},children:[h.jsx(wf,{sx:{color:"grey.600",mr:"10px"}}),h.jsx(x.ListItemText,{primary:"No package manifest"})]})),s&&h.jsx(gt,{error:a,context:`${e} > ${t} > ${n}`})]})})]})})}const Vx=Oe(h.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Wx=new Af(new Et);function Gx(){const{projectName:e}=$r(),{data:t,isSuccess:n,isError:r,error:i}=xt({queryKey:["about",e],queryFn:s=>Wx.getProject(e,!1,s)});return h.jsxs(h.Fragment,{children:[!n&&!r&&h.jsx(bt,{text:"Fetching About..."}),n&&t.data?.readme&&h.jsxs(ut,{variant:"outlined",sx:{p:2},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",sx:{mb:1},children:"Readme"}),h.jsx(ut,{sx:{p:1},children:h.jsx(mu,{children:t.data.readme})})]}),r&&h.jsx(gt,{error:i,context:`${e} > About`})]})}const Yx=new Sf(new Et);function Nf({navigate:e}){const{projectName:t}=$r(),{data:n,isSuccess:r,isError:i,error:s}=xt({queryKey:["packages",t],queryFn:a=>Yx.listPackages(t,a)});return h.jsxs(h.Fragment,{children:[!r&&!i&&h.jsx(bt,{text:"Fetching Packages..."}),r&&h.jsxs(ut,{variant:"outlined",sx:{p:2},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",sx:{mb:1},children:"Packages"}),h.jsx(x.Grid,{container:!0,spacing:2,columns:12,children:n.data.sort((a,o)=>a.name.localeCompare(o.name)).map(a=>{const o=a.resource.replace("/api/v0/projects","").replace("/packages","");return h.jsx(x.Grid,{size:{xs:12,sm:12,md:12,lg:4},children:h.jsx(ut,{variant:"outlined",sx:{cursor:"pointer",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",transform:"translateY(-2px)"}},onClick:u=>e(o,u),children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",color:"primary.main",children:a.name}),h.jsx(x.Box,{sx:{maxHeight:"120px",overflowY:"auto"},children:h.jsx(x.Typography,{variant:"body2",children:a.description})})]})})},a.name)})})]}),i&&h.jsx(gt,{error:s,context:`${t} > Packages`})]})}const Pf=P.createContext(void 0);function $r(){const e=P.useContext(Pf);if(!e)throw new Error("useProject must be used within a ProjectProvider");return e}function Rf({children:e,projectName:t}){return h.jsx(Pf.Provider,{value:{projectName:t},children:e})}function Kx({navigate:e}){return h.jsxs(x.Grid,{container:!0,spacing:2,columns:12,children:[h.jsx(x.Grid,{size:{xs:12,md:12},children:h.jsx(Nf,{navigate:e})}),h.jsx(x.Grid,{size:{xs:12,md:12},children:h.jsx(Gx,{})})]})}const $u=new Tf(new Et);function Lf({connectionName:e}){const{projectName:t}=$r(),[n,r]=P.useState(void 0),[i,s]=P.useState(null),[a,o]=P.useState(!1),{data:u,isSuccess:l,isError:d,error:c,isLoading:m}=xt({queryKey:["tablePath",t,e],queryFn:p=>$u.listSchemas(t,e,p)});return h.jsxs(x.Grid,{container:!0,spacing:2,children:[h.jsx(x.Grid,{size:{xs:12,md:6},children:h.jsxs(x.Paper,{sx:{p:2},children:[h.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),h.jsx(x.FormControlLabel,{control:h.jsx(x.Switch,{checked:a,onChange:p=>o(p.target.checked)}),label:"Hidden Schemas"})]}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:[m&&h.jsx(bt,{text:"Fetching Table Paths..."}),d&&h.jsx(gt,{error:c,context:`${t} > ${e}`}),l&&u.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Schemas"}),l&&u.data.length>0&&h.jsx(x.List,{dense:!0,disablePadding:!0,children:u.data.filter(({isHidden:p})=>a||!p).sort((p,g)=>p.isDefault===g.isDefault?0:p.isDefault?-1:1).map(p=>h.jsx(x.ListItemButton,{selected:i===p.name,onClick:()=>s(p.name),children:h.jsx(x.ListItemText,{primary:p.name})},p.name))})]})]})}),h.jsx(x.Grid,{size:{xs:12,md:6},children:i&&h.jsx(x.Paper,{sx:{p:2},children:h.jsx(Xx,{connectionName:e,schemaName:i,onTableClick:p=>{r(p)}})})}),n&&h.jsx(Qx,{connectionName:e,schemaName:i,tableName:n,onClose:()=>r(void 0)})]})}function Qx({connectionName:e,schemaName:t,tableName:n,onClose:r}){const{projectName:i}=$r(),{data:s,isSuccess:a,isError:o,error:u,isLoading:l}=xt({queryKey:["tablePathSchema",i,e,t,n],queryFn:d=>$u.getTablesource(i,e,n,`${t}.${n}`,d)});return a&&s&&console.log(s),h.jsxs(x.Dialog,{open:!0,onClose:r,maxWidth:"sm",fullWidth:!0,children:[h.jsxs(x.DialogTitle,{children:[h.jsxs(x.Typography,{fontSize:"large",variant:"body2",fontFamily:"monospace",component:"span",style:{textTransform:"uppercase"},children:[t,".",n]}),h.jsx(x.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:h.jsx(x.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),h.jsxs(x.DialogContent,{children:[l&&h.jsx(bt,{text:"Fetching Table Details..."}),o&&h.jsx(gt,{error:u,context:`${i} > ${e} > ${t}.${n}`}),a&&s&&h.jsx(x.TableContainer,{children:h.jsxs(x.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"NAME"}),h.jsx(x.TableCell,{children:"TYPE"})]})}),h.jsx(x.TableBody,{children:s.data.columns?.map(d=>h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:d.name}),h.jsx(x.TableCell,{children:d.type})]},d.name))})]})})]})]})}function Xx({connectionName:e,schemaName:t,onTableClick:n}){const{projectName:r}=$r(),{data:i,isSuccess:s,isError:a,error:o,isLoading:u}=xt({queryKey:["tablesInSchema",r,e,t],queryFn:l=>$u.listTables(r,e,t,l)});return h.jsxs(h.Fragment,{children:[h.jsxs(x.Typography,{variant:"overline",fontWeight:"bold",children:["Tables in ",t]}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:[u&&h.jsx(bt,{text:"Fetching Tables..."}),a&&h.jsx(gt,{error:o,context:`${r} > ${e} > ${t}`}),s&&i.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Tables"}),s&&i.data.length>0&&h.jsx(x.List,{dense:!0,disablePadding:!0,children:i.data.map(l=>h.jsx(x.ListItemButton,{onClick:()=>n(l),children:h.jsx(x.ListItemText,{primary:l})},l))})]})]})}const Zx=new Tf(new Et);function Jx({connection:e,onClick:t}){return h.jsxs(x.TableRow,{onClick:t,sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:[h.jsx(x.TableCell,{children:h.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(x.Typography,{variant:"body2",children:e.name}),h.jsx(Vx,{sx:{fontSize:"1rem",color:"action.active",opacity:.7}})]})}),h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"body2",children:e.type})})]},e.name)}function ey(){const{projectName:e}=pt(),[t,n]=P.useState(null),{data:r,isSuccess:i,isError:s,error:a}=xt({queryKey:["connections",e],queryFn:l=>Zx.listConnections(e,l)}),o=l=>{n(l)},u=()=>{n(null)};return h.jsxs(Rf,{projectName:e,children:[h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Database Connections"}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!i&&!s&&h.jsx(x.Typography,{variant:"body2",sx:{m:"auto"},children:"Fetching Connections..."}),i&&r.data.length>0&&h.jsx(x.Table,{size:"small",children:h.jsxs(x.TableBody,{children:[h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"subtitle2",fontWeight:"bold",children:"Connection Name"})}),h.jsx(x.TableCell,{children:h.jsx(x.Typography,{variant:"subtitle2",fontWeight:"bold",children:"Type"})})]}),r.data.map(l=>h.jsx(Jx,{connection:l,onClick:()=>o(l.name)},l.name))]})}),i&&r.data.length===0&&h.jsx(x.Typography,{variant:"body2",children:"No Connections"}),s&&h.jsx(gt,{error:a,context:`${e} > Connections`})]})]})}),h.jsxs(x.Dialog,{open:t!==null,onClose:u,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(x.DialogTitle,{children:["Connection Explorer: ",t,h.jsx(x.IconButton,{"aria-label":"close",onClick:u,sx:{position:"absolute",right:8,top:8},children:h.jsx(x.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),h.jsx(x.DialogContent,{children:t&&h.jsx(Lf,{connectionName:t})})]})]})}const ty=new Ax(new Et);function ny(){const{projectName:e,packageName:t,versionId:n}=pt(),[r,i]=P.useState(!1),[s,a]=P.useState(null),o=g=>{a(g),i(!0)},u=()=>{i(!1),a(null)},{data:l,isError:d,error:c,isSuccess:m}=xt({queryKey:["databases",e,t,n],queryFn:g=>ty.listDatabases(e,t,n,g)}),p=g=>g>=1024*1024*1024*1024?`${(g/(1024*1024*1024)).toFixed(2)} T`:g>=1024*1024*1024?`${(g/(1024*1024*1024)).toFixed(2)} G`:g>=1024*1024?`${(g/(1024*1024)).toFixed(2)} M`:`${(g/1024).toFixed(2)} K`;return h.jsxs(h.Fragment,{children:[h.jsx(ut,{variant:"outlined",sx:{width:"100%"},children:h.jsxs(Ut,{children:[h.jsx(x.Typography,{variant:"overline",fontWeight:"bold",children:"Embedded Databases"}),h.jsx(x.Divider,{}),h.jsxs(x.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!m&&!d&&h.jsx(bt,{text:"Fetching Databases..."}),d&&h.jsx(gt,{error:c,context:`${e} > ${t} > Databases`}),m&&l.data.length>0&&h.jsxs(x.Table,{size:"small",children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"Name"}),h.jsx(x.TableCell,{align:"right",children:"Rows"})]})}),h.jsx(x.TableBody,{children:l.data.map(g=>h.jsxs(x.TableRow,{onClick:()=>o(g),sx:{cursor:"pointer"},children:[h.jsx(x.TableCell,{component:"th",scope:"row",children:g.path}),h.jsx(x.TableCell,{align:"right",children:p(g.info.rowCount)})]},g.path))})]}),m&&l.data.length===0&&h.jsx(x.Typography,{variant:"body2",sx:{m:"auto"},children:"No databases found"})]})]})}),h.jsxs(x.Dialog,{open:r,onClose:u,maxWidth:"sm",fullWidth:!0,children:[h.jsx(x.DialogTitle,{children:s?.path}),h.jsx(x.DialogContent,{children:s?.info?.columns&&h.jsx(x.TableContainer,{children:h.jsxs(x.Table,{size:"small",children:[h.jsx(x.TableHead,{children:h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{children:"Column"}),h.jsx(x.TableCell,{children:"Type"})]})}),h.jsx(x.TableBody,{children:s.info.columns.map(g=>h.jsxs(x.TableRow,{children:[h.jsx(x.TableCell,{component:"th",scope:"row",children:g.name}),h.jsx(x.TableCell,{children:g.type})]},g.name))})]})})})]})]})}function Cn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},le.apply(null,arguments)}function ry(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:Ls(t.components[n].defaultProps,r)}const iy=Au();function sy(e=iy){return dg(e)}function ay({props:e,name:t,defaultTheme:n,themeId:r}){let i=sy(n);return i=i[r]||i,ry({theme:i,name:t,props:e})}function oy({props:e,name:t}){return ay({props:e,name:t,defaultTheme:ku,themeId:Iu})}function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vo.apply(null,arguments)}function Of(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Wo(e,t){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wo(e,t)}function Ff(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wo(e,t)}const Dc={disabled:!1},Gs=P.createContext(null);var uy=function(t){return t.scrollTop},fi="unmounted",Vn="exited",Wn="entering",yr="entered",Go="exiting",_n=function(e){Ff(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var a=i,o=a&&!a.isMounting?r.enter:r.appear,u;return s.appearStatus=null,r.in?o?(u=Vn,s.appearStatus=Wn):u=yr:r.unmountOnExit||r.mountOnEnter?u=fi:u=Vn,s.state={status:u},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var a=i.in;return a&&s.status===fi?{status:Vn}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Wn&&a!==yr&&(s=Wn):(a===Wn||a===yr)&&(s=Go)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,a,o;return s=a=o=i,i!=null&&typeof i!="number"&&(s=i.exit,a=i.enter,o=i.appear!==void 0?i.appear:a),{exit:s,enter:a,appear:o}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Wn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ns.findDOMNode(this);a&&uy(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vn&&this.setState({status:fi})},n.performEnter=function(i){var s=this,a=this.props.enter,o=this.context?this.context.isMounting:i,u=this.props.nodeRef?[o]:[ns.findDOMNode(this),o],l=u[0],d=u[1],c=this.getTimeouts(),m=o?c.appear:c.enter;if(!i&&!a||Dc.disabled){this.safeSetState({status:yr},function(){s.props.onEntered(l)});return}this.props.onEnter(l,d),this.safeSetState({status:Wn},function(){s.props.onEntering(l,d),s.onTransitionEnd(m,function(){s.safeSetState({status:yr},function(){s.props.onEntered(l,d)})})})},n.performExit=function(){var i=this,s=this.props.exit,a=this.getTimeouts(),o=this.props.nodeRef?void 0:ns.findDOMNode(this);if(!s||Dc.disabled){this.safeSetState({status:Vn},function(){i.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:Go},function(){i.props.onExiting(o),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Vn},function(){i.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,a=!0;return this.nextCallback=function(o){a&&(a=!1,s.nextCallback=null,i(o))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:ns.findDOMNode(this),o=i==null&&!this.props.addEndListener;if(!a||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],l=u[0],d=u[1];this.props.addEndListener(l,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===fi)return null;var s=this.props,a=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var o=Of(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return P.createElement(Gs.Provider,{value:null},typeof a=="function"?a(i,o):P.cloneElement(P.Children.only(a),o))},t}(P.Component);_n.contextType=Gs;_n.propTypes={};function mr(){}_n.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:mr,onEntering:mr,onEntered:mr,onExit:mr,onExiting:mr,onExited:mr};_n.UNMOUNTED=fi;_n.EXITED=Vn;_n.ENTERING=Wn;_n.ENTERED=yr;_n.EXITING=Go;function ly(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qu(e,t){var n=function(s){return t&&P.isValidElement(s)?t(s):s},r=Object.create(null);return e&&P.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function cy(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),i=[];for(var s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var a,o={};for(var u in t){if(r[u])for(a=0;a<r[u].length;a++){var l=r[u][a];o[r[u][a]]=n(l)}o[u]=n(u)}for(a=0;a<i.length;a++)o[i[a]]=n(i[a]);return o}function Kn(e,t,n){return n[t]!=null?n[t]:e.props[t]}function dy(e,t){return qu(e.children,function(n){return P.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Kn(n,"appear",e),enter:Kn(n,"enter",e),exit:Kn(n,"exit",e)})})}function hy(e,t,n){var r=qu(e.children),i=cy(t,r);return Object.keys(i).forEach(function(s){var a=i[s];if(P.isValidElement(a)){var o=s in t,u=s in r,l=t[s],d=P.isValidElement(l)&&!l.props.in;u&&(!o||d)?i[s]=P.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:Kn(a,"exit",e),enter:Kn(a,"enter",e)}):!u&&o&&!d?i[s]=P.cloneElement(a,{in:!1}):u&&o&&P.isValidElement(l)&&(i[s]=P.cloneElement(a,{onExited:n.bind(null,a),in:l.props.in,exit:Kn(a,"exit",e),enter:Kn(a,"enter",e)}))}}),i}var fy=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},py={component:"div",childFactory:function(t){return t}},Vu=function(e){Ff(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var a=s.handleExited.bind(ly(s));return s.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,s){var a=s.children,o=s.handleExited,u=s.firstRender;return{children:u?dy(i,o):hy(i,a,o),firstRender:!1}},n.handleExited=function(i,s){var a=qu(this.props.children);i.key in a||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(o){var u=Vo({},o.children);return delete u[i.key],{children:u}}))},n.render=function(){var i=this.props,s=i.component,a=i.childFactory,o=Of(i,["component","childFactory"]),u=this.state.contextValue,l=fy(this.state.children).map(a);return delete o.appear,delete o.enter,delete o.exit,s===null?P.createElement(Gs.Provider,{value:u},l):P.createElement(Gs.Provider,{value:u},P.createElement(s,o,l))},t}(P.Component);Vu.propTypes={};Vu.defaultProps=py;const wc={};function Mf(e,t){const n=$.useRef(wc);return n.current===wc&&(n.current=e(t)),n}const my=[];function gy(e){$.useEffect(e,my)}class Wu{static create(){return new Wu}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Bf(){const e=Mf(Wu.create).current;return gy(e.disposeEffect),e}function Nc(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function by(e){return Mr("MuiCollapse",e)}jr("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Ey=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Hi(r,by,n)},xy=Be("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(vu(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),yy=Be("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Ty=Be("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Li=$.forwardRef(function(t,n){const r=Br({props:t,name:"MuiCollapse"}),{addEndListener:i,children:s,className:a,collapsedSize:o="0px",component:u,easing:l,in:d,onEnter:c,onEntered:m,onEntering:p,onExit:g,onExited:b,onExiting:T,orientation:y="vertical",style:C,timeout:S=Ih.standard,TransitionComponent:N=_n,...D}=r,w={...r,orientation:y,collapsedSize:o},B=Ey(w),V=Xg(),Q=Bf(),E=$.useRef(null),L=$.useRef(),O=typeof o=="number"?`${o}px`:o,z=y==="horizontal",M=z?"width":"height",J=$.useRef(null),oe=Os(n,J),he=q=>re=>{if(q){const te=J.current;re===void 0?q(te):q(te,re)}},fe=()=>E.current?E.current[z?"clientWidth":"clientHeight"]:0,G=he((q,re)=>{E.current&&z&&(E.current.style.position="absolute"),q.style[M]=O,c&&c(q,re)}),_=he((q,re)=>{const te=fe();E.current&&z&&(E.current.style.position="");const{duration:we,easing:ne}=Nc({style:C,timeout:S,easing:l},{mode:"enter"});if(S==="auto"){const U=V.transitions.getAutoHeightDuration(te);q.style.transitionDuration=`${U}ms`,L.current=U}else q.style.transitionDuration=typeof we=="string"?we:`${we}ms`;q.style[M]=`${te}px`,q.style.transitionTimingFunction=ne,p&&p(q,re)}),Ee=he((q,re)=>{q.style[M]="auto",m&&m(q,re)}),ue=he(q=>{q.style[M]=`${fe()}px`,g&&g(q)}),I=he(b),de=he(q=>{const re=fe(),{duration:te,easing:we}=Nc({style:C,timeout:S,easing:l},{mode:"exit"});if(S==="auto"){const ne=V.transitions.getAutoHeightDuration(re);q.style.transitionDuration=`${ne}ms`,L.current=ne}else q.style.transitionDuration=typeof te=="string"?te:`${te}ms`;q.style[M]=O,q.style.transitionTimingFunction=we,T&&T(q)}),pe=q=>{S==="auto"&&Q.start(L.current||0,q),i&&i(J.current,q)};return h.jsx(N,{in:d,onEnter:G,onEntered:Ee,onEntering:_,onExit:ue,onExited:I,onExiting:de,addEndListener:pe,nodeRef:J,timeout:S==="auto"?null:S,...D,children:(q,{ownerState:re,...te})=>h.jsx(xy,{as:u,className:Ye(B.root,a,{entered:B.entered,exited:!d&&O==="0px"&&B.hidden}[q]),style:{[z?"minWidth":"minHeight"]:O,...C},ref:oe,ownerState:{...w,state:q},...te,children:h.jsx(yy,{ownerState:{...w,state:q},className:B.wrapper,ref:E,children:h.jsx(Ty,{ownerState:{...w,state:q},className:B.wrapperInner,children:s})})})})});Li&&(Li.muiSupportAuto=!0);const Cy=$.createContext(void 0);function Sy(){return $.useContext(Cy)}function Pc(e){try{return e.matches(":focus-visible")}catch{}return!1}class Ys{static create(){return new Ys}static use(){const t=Mf(Ys.create).current,[n,r]=$.useState(!1);return t.shouldMount=n,t.setShouldMount=r,$.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=ky(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Ay(){return Ys.use()}function ky(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function Iy(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:s,rippleSize:a,in:o,onExited:u,timeout:l}=e,[d,c]=$.useState(!1),m=Ye(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+s,left:-(a/2)+i},g=Ye(n.child,d&&n.childLeaving,r&&n.childPulsate);return!o&&!d&&c(!0),$.useEffect(()=>{if(!o&&u!=null){const b=setTimeout(u,l);return()=>{clearTimeout(b)}}},[u,o,l]),h.jsx("span",{className:m,style:p,children:h.jsx("span",{className:g})})}const Wt=jr("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Yo=550,_y=80,vy=We.keyframes`
36
36
  0% {
37
37
  transform: scale(0);
38
38
  opacity: 0.1;
package/dist/index.es.js CHANGED
@@ -12879,7 +12879,7 @@ function J3() {
12879
12879
  });
12880
12880
  return /* @__PURE__ */ R(Ze, { children: [
12881
12881
  !n && !r && /* @__PURE__ */ m(Rt, { text: "Fetching About..." }),
12882
- n && /* @__PURE__ */ R(gt, { variant: "outlined", sx: { p: 2 }, children: [
12882
+ n && t.data?.readme && /* @__PURE__ */ R(gt, { variant: "outlined", sx: { p: 2 }, children: [
12883
12883
  /* @__PURE__ */ m(ee, { variant: "overline", fontWeight: "bold", sx: { mb: 1 }, children: "Readme" }),
12884
12884
  /* @__PURE__ */ m(gt, { sx: { p: 1 }, children: /* @__PURE__ */ m(Zu, { children: t.data.readme }) })
12885
12885
  ] }),
@@ -12896,48 +12896,51 @@ function tT({ navigate: e }) {
12896
12896
  !r && !i && /* @__PURE__ */ m(Rt, { text: "Fetching Packages..." }),
12897
12897
  r && /* @__PURE__ */ R(gt, { variant: "outlined", sx: { p: 2 }, children: [
12898
12898
  /* @__PURE__ */ m(ee, { variant: "overline", fontWeight: "bold", sx: { mb: 1 }, children: "Packages" }),
12899
- /* @__PURE__ */ m(Xe, { container: !0, spacing: 2, columns: 12, children: n.data.sort((o, s) => o.name.localeCompare(s.name)).map((o) => /* @__PURE__ */ m(
12900
- Xe,
12901
- {
12902
- size: { xs: 12, sm: 12, md: 12, lg: 4 },
12903
- children: /* @__PURE__ */ m(
12904
- gt,
12905
- {
12906
- variant: "outlined",
12907
- sx: {
12908
- cursor: "pointer",
12909
- transition: "all 0.2s ease-in-out",
12910
- "&:hover": {
12911
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
12912
- transform: "translateY(-2px)"
12913
- }
12914
- },
12915
- onClick: (s) => e(o.name + "/", s),
12916
- children: /* @__PURE__ */ R(Zt, { children: [
12917
- /* @__PURE__ */ m(
12918
- ee,
12919
- {
12920
- variant: "overline",
12921
- color: "primary.main",
12922
- children: o.name
12923
- }
12924
- ),
12925
- /* @__PURE__ */ m(
12926
- Ie,
12927
- {
12928
- sx: {
12929
- maxHeight: "120px",
12930
- overflowY: "auto"
12931
- },
12932
- children: /* @__PURE__ */ m(ee, { variant: "body2", children: o.description })
12899
+ /* @__PURE__ */ m(Xe, { container: !0, spacing: 2, columns: 12, children: n.data.sort((o, s) => o.name.localeCompare(s.name)).map((o) => {
12900
+ const s = o.resource.replace("/api/v0/projects", "").replace("/packages", "");
12901
+ return /* @__PURE__ */ m(
12902
+ Xe,
12903
+ {
12904
+ size: { xs: 12, sm: 12, md: 12, lg: 4 },
12905
+ children: /* @__PURE__ */ m(
12906
+ gt,
12907
+ {
12908
+ variant: "outlined",
12909
+ sx: {
12910
+ cursor: "pointer",
12911
+ transition: "all 0.2s ease-in-out",
12912
+ "&:hover": {
12913
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
12914
+ transform: "translateY(-2px)"
12933
12915
  }
12934
- )
12935
- ] })
12936
- }
12937
- )
12938
- },
12939
- o.name
12940
- )) })
12916
+ },
12917
+ onClick: (u) => e(s, u),
12918
+ children: /* @__PURE__ */ R(Zt, { children: [
12919
+ /* @__PURE__ */ m(
12920
+ ee,
12921
+ {
12922
+ variant: "overline",
12923
+ color: "primary.main",
12924
+ children: o.name
12925
+ }
12926
+ ),
12927
+ /* @__PURE__ */ m(
12928
+ Ie,
12929
+ {
12930
+ sx: {
12931
+ maxHeight: "120px",
12932
+ overflowY: "auto"
12933
+ },
12934
+ children: /* @__PURE__ */ m(ee, { variant: "body2", children: o.description })
12935
+ }
12936
+ )
12937
+ ] })
12938
+ }
12939
+ )
12940
+ },
12941
+ o.name
12942
+ );
12943
+ }) })
12941
12944
  ] }),
12942
12945
  i && /* @__PURE__ */ m(
12943
12946
  kt,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.84",
4
+ "version": "0.0.85",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -20,7 +20,7 @@ export default function About() {
20
20
  return (
21
21
  <>
22
22
  {!isSuccess && !isError && <Loading text="Fetching About..." />}
23
- {isSuccess && (
23
+ {isSuccess && data.data?.readme && (
24
24
  <StyledCard variant="outlined" sx={{ p: 2 }}>
25
25
  <Typography variant="overline" fontWeight="bold" sx={{ mb: 1 }}>
26
26
  Readme
@@ -33,44 +33,50 @@ export default function Packages({ navigate }: PackagesProps) {
33
33
  .sort((a, b) => {
34
34
  return a.name.localeCompare(b.name);
35
35
  })
36
- .map((p) => (
37
- <Grid
38
- size={{ xs: 12, sm: 12, md: 12, lg: 4 }}
39
- key={p.name}
40
- >
41
- <StyledCard
42
- variant="outlined"
43
- sx={{
44
- cursor: "pointer",
45
- transition: "all 0.2s ease-in-out",
46
- "&:hover": {
47
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
48
- transform: "translateY(-2px)",
49
- },
50
- }}
51
- onClick={(event) => navigate(p.name + "/", event)}
36
+ .map((p) => {
37
+ const href = p.resource
38
+ .replace("/api/v0/projects", "")
39
+ .replace("/packages", "");
40
+ return (
41
+ <Grid
42
+ size={{ xs: 12, sm: 12, md: 12, lg: 4 }}
43
+ key={p.name}
52
44
  >
53
- <StyledCardContent>
54
- <Typography
55
- variant="overline"
56
- color="primary.main"
57
- >
58
- {p.name}
59
- </Typography>
60
- <Box
61
- sx={{
62
- maxHeight: "120px",
63
- overflowY: "auto",
64
- }}
65
- >
66
- <Typography variant="body2">
67
- {p.description}
45
+ <StyledCard
46
+ variant="outlined"
47
+ sx={{
48
+ cursor: "pointer",
49
+ transition: "all 0.2s ease-in-out",
50
+ "&:hover": {
51
+ boxShadow:
52
+ "0 4px 12px rgba(0, 0, 0, 0.1)",
53
+ transform: "translateY(-2px)",
54
+ },
55
+ }}
56
+ onClick={(event) => navigate(href, event)}
57
+ >
58
+ <StyledCardContent>
59
+ <Typography
60
+ variant="overline"
61
+ color="primary.main"
62
+ >
63
+ {p.name}
68
64
  </Typography>
69
- </Box>
70
- </StyledCardContent>
71
- </StyledCard>
72
- </Grid>
73
- ))}
65
+ <Box
66
+ sx={{
67
+ maxHeight: "120px",
68
+ overflowY: "auto",
69
+ }}
70
+ >
71
+ <Typography variant="body2">
72
+ {p.description}
73
+ </Typography>
74
+ </Box>
75
+ </StyledCardContent>
76
+ </StyledCard>
77
+ </Grid>
78
+ );
79
+ })}
74
80
  </Grid>
75
81
  </StyledCard>
76
82
  )}