@marimo-team/frontend 0.23.11-dev7 → 0.23.11-dev8

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.
@@ -0,0 +1 @@
1
+ import{s as I}from"./chunk-LvLJmgfZ.js";import{u as G}from"./useEvent-D91BmmQi.js";import{t as J}from"./react-Bj1aDYRI.js";import{D as K,Gr as q,Kr as R,Ur as U}from"./cells-DGi-ohLl.js";import{t as H}from"./compiler-runtime-B3qBwwSJ.js";import{c as V}from"./utils-CvI-39U6.js";import{t as W}from"./jsx-runtime-BqBOg78p.js";import{c as X,d as Y,gt as Z}from"./JsonOutput-CbiJ_QRH.js";import{t as L}from"./tooltip-B_PkSKN3.js";import{r as A,t as D}from"./button-BbCh-29a.js";import{r as $}from"./requests-DIwGYs0l.js";import{t as ee}from"./createLucideIcon-D5guW7EU.js";import{t as te}from"./useLifecycle-DieWOfXE.js";import{t as ae}from"./spinner-Bhir8k53.js";import{r as re}from"./useTheme-CI2eq4XN.js";import{t as se}from"./copy-icon-BuRdHNPA.js";import{t as oe}from"./context-QkTujrKn.js";import{i as ne}from"./numbers-DGxQfQ-A.js";import{n as ce}from"./html-to-image-Cso6uxBX.js";import{o as le}from"./focus-cLz6vpFk.js";var P=ee("square-plus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),M=H(),ie=I(J(),1),s=I(W(),1);const me=i=>{let e=(0,M.c)(53),{table:t,column:a,preview:r,onAddColumnChart:c,sqlTableContext:n}=i,{theme:u}=re(),{previewDatasetColumn:l}=$(),{locale:d}=oe(),m;e[0]!==a.name||e[1]!==l||e[2]!==n||e[3]!==t.name||e[4]!==t.source||e[5]!==t.source_type?(m=()=>{l({source:t.source,tableName:t.name,columnName:a.name,sourceType:t.source_type,fullyQualifiedTableName:R(n,t.name)})},e[0]=a.name,e[1]=l,e[2]=n,e[3]=t.name,e[4]=t.source,e[5]=t.source_type,e[6]=m):m=e[6];let p=m,h;if(e[7]!==r||e[8]!==p||e[9]!==t.source_type?(h=()=>{r||t.source_type==="connection"||t.source_type==="catalog"||p()},e[7]=r,e[8]=p,e[9]=t.source_type,e[10]=h):h=e[10],te(h),t.source_type==="connection"){let o=a.name,F=a.external_type,x;e[11]!==a.name||e[12]!==c||e[13]!==n||e[14]!==t?(x=A.stopPropagation(()=>{c(q({table:t,columnName:a.name,sqlTableContext:n}))}),e[11]=a.name,e[12]=c,e[13]=n,e[14]=t,e[15]=x):x=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(P,{className:"h-3 w-3 mr-1"}),e[16]=C):C=e[16];let f;e[17]===x?f=e[18]:(f=(0,s.jsxs)(D,{variant:"outline",size:"xs",onClick:x,children:[C," Add SQL cell"]}),e[17]=x,e[18]=f);let S;return e[19]!==a.external_type||e[20]!==a.name||e[21]!==f?(S=(0,s.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[o," (",F,")",f]}),e[19]=a.external_type,e[20]=a.name,e[21]=f,e[22]=S):S=e[22],S}if(t.source_type==="catalog"){let o;return e[23]!==a.external_type||e[24]!==a.name?(o=(0,s.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[a.name," (",a.external_type,")"]}),e[23]=a.external_type,e[24]=a.name,e[25]=o):o=e[25],o}if(!r){let o;return e[26]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[26]=o):o=e[26],o}let g;e[27]!==r.error||e[28]!==r.missing_packages||e[29]!==p?(g=r.error&&O({error:r.error,missingPackages:r.missing_packages,refetchPreview:p}),e[27]=r.error,e[28]=r.missing_packages,e[29]=p,e[30]=g):g=e[30];let y=g,_;e[31]!==a.type||e[32]!==d||e[33]!==r.stats?(_=r.stats&&Q({stats:r.stats,dataType:a.type,locale:d}),e[31]=a.type,e[32]=d,e[33]=r.stats,e[34]=_):_=e[34];let b=_,j;e[35]!==r.chart_spec||e[36]!==u?(j=r.chart_spec&&B(r.chart_spec,u),e[35]=r.chart_spec,e[36]=u,e[37]=j):j=e[37];let N=j,k;e[38]!==r.chart_code||e[39]!==t.source_type?(k=r.chart_code&&t.source_type==="local"&&(0,s.jsx)(E,{chartCode:r.chart_code}),e[38]=r.chart_code,e[39]=t.source_type,e[40]=k):k=e[40];let T=k,w;e[41]!==a.name||e[42]!==c||e[43]!==n||e[44]!==t?(w=t.source_type==="duckdb"&&(0,s.jsx)(L,{content:"Add SQL cell",delayDuration:400,children:(0,s.jsx)(D,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:A.stopPropagation(()=>{c(q({table:t,columnName:a.name,sqlTableContext:n}))}),children:(0,s.jsx)(P,{className:"h-3 w-3"})})}),e[41]=a.name,e[42]=c,e[43]=n,e[44]=t,e[45]=w):w=e[45];let z=w;if(!y&&!b&&!N){let o;return e[46]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[46]=o):o=e[46],o}let v;return e[47]!==T||e[48]!==z||e[49]!==N||e[50]!==y||e[51]!==b?(v=(0,s.jsxs)(Y,{children:[y,T,z,N,b]}),e[47]=T,e[48]=z,e[49]=N,e[50]=y,e[51]=b,e[52]=v):v=e[52],v};function O({error:i,missingPackages:e,refetchPreview:t}){return(0,s.jsxs)("div",{className:"text-xs text-muted-foreground p-2 border border-border rounded flex items-center justify-between",children:[(0,s.jsx)("span",{children:i}),e&&(0,s.jsx)(X,{packages:e,showMaxPackages:1,className:"w-32",onInstall:t})]})}function Q({stats:i,dataType:e,locale:t}){return(0,s.jsx)("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(i).map(([a,r])=>r==null?null:(0,s.jsxs)("div",{className:"flex items-center gap-1 group",children:[(0,s.jsx)("span",{className:"text-xs min-w-[60px] capitalize",children:U(a,e)}),(0,s.jsx)("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:ne(r,t)}),(0,s.jsx)(se,{className:"h-3 w-3 invisible group-hover:visible",value:String(r)})]},a))})}var pe=(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(ae,{className:"size-4"})});function B(i,e){let t=a=>({...a,background:"transparent",config:{...a.config,background:"transparent"}});return(0,s.jsx)(ie.Suspense,{fallback:pe,children:(0,s.jsx)(Z,{"data-container-width":"container",spec:t(JSON.parse(i)),options:{theme:e==="dark"?"dark":"vox",height:100,width:"container",actions:!1,renderer:"canvas"}})})}const E=i=>{let e=(0,M.c)(10),{chartCode:t}=i,a=G(V),r=le(),{createNewCell:c}=K(),n;e[0]!==a||e[1]!==c||e[2]!==r?(n=p=>{p.includes("alt")&&ce({autoInstantiate:a,createNewCell:c,fromCellId:r}),c({code:p,before:!1,cellId:r??"__end__"})},e[0]=a,e[1]=c,e[2]=r,e[3]=n):n=e[3];let u=n,l;e[4]!==t||e[5]!==u?(l=A.stopPropagation(()=>u(t)),e[4]=t,e[5]=u,e[6]=l):l=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(P,{className:"h-3 w-3"}),e[7]=d):d=e[7];let m;return e[8]===l?m=e[9]:(m=(0,s.jsx)(L,{content:"Add chart to notebook",delayDuration:400,children:(0,s.jsx)(D,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-0.5",onClick:l,children:d})}),e[8]=l,e[9]=m),m};export{Q as a,O as i,me as n,P as o,B as r,E as t};