@marimo-team/frontend 0.25.2-dev56 → 0.25.2-dev61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-C5UW0p9I.js +1 -0
  2. package/dist/assets/JsonOutput-nqqzL-n0.js +11 -0
  3. package/dist/assets/{agent-panel-9FeJ9hAg.js → agent-panel-Bkcf1sED.js} +1 -1
  4. package/dist/assets/{cell-editor-BNIogYsY.js → cell-editor-Cmqe3QmM.js} +1 -1
  5. package/dist/assets/{column-preview-D2Um0Qe3.js → column-preview-DtrgJzVI.js} +1 -1
  6. package/dist/assets/{command-palette-ChCapZF9.js → command-palette-DUPyVGsq.js} +1 -1
  7. package/dist/assets/{edit-page-DIBiWEli.js → edit-page-DMsRAPsr.js} +4 -4
  8. package/dist/assets/{file-explorer-panel-CxBxvZDk.js → file-explorer-panel-BQi88S1o.js} +1 -1
  9. package/dist/assets/{hooks-5owWOOnf.js → hooks-BHoInJWN.js} +1 -1
  10. package/dist/assets/{index-D9fmFCuc.js → index-C968xQuz.js} +7 -7
  11. package/dist/assets/index-CF8Gfz1R.css +2 -0
  12. package/dist/assets/{layout-giNu7tsO.js → layout-CzNq5YtR.js} +3 -3
  13. package/dist/assets/{panels-DftjTXK1.js → panels-Dsf6yEsA.js} +1 -1
  14. package/dist/assets/{reveal-component-C72HbbmJ.js → reveal-component-CJxdWpbj.js} +1 -1
  15. package/dist/assets/{run-page-BOSkpSu_.js → run-page-DCu4YGwW.js} +1 -1
  16. package/dist/assets/{scratchpad-panel-C3gu3_1_.js → scratchpad-panel-BSlnM0TK.js} +1 -1
  17. package/dist/assets/{session-panel-CNK8FDu3.js → session-panel-BdN43Lzi.js} +1 -1
  18. package/dist/assets/spec-D9d9nT0z.js +1 -0
  19. package/dist/assets/{list-filter-CTg19675.js → table-B7KYyTxw.js} +1 -1
  20. package/dist/assets/{useNotebookActions-ByyEgzc-.js → useNotebookActions-BDD321Hs.js} +1 -1
  21. package/dist/index.html +6 -6
  22. package/package.json +1 -1
  23. package/src/components/data-table/TableTopBar.tsx +4 -0
  24. package/src/components/data-table/__tests__/export-actions.test.tsx +1111 -14
  25. package/src/components/data-table/__tests__/schemas.test.ts +57 -0
  26. package/src/components/data-table/data-table.tsx +3 -0
  27. package/src/components/data-table/export-actions.tsx +365 -81
  28. package/src/components/data-table/schemas.ts +90 -14
  29. package/src/plugins/impl/DataTablePlugin.tsx +23 -2
  30. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +65 -8
  31. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +15 -3
  32. package/src/stories/dataframe.stories.tsx +7 -0
  33. package/dist/assets/ConnectedDataExplorerComponent-Jv_dljLQ.js +0 -1
  34. package/dist/assets/JsonOutput-Dmq_45PS.js +0 -11
  35. package/dist/assets/index-BGdpHNhZ.css +0 -2
  36. package/dist/assets/spec-SOFn9xEK.js +0 -1
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-rHn2EdoM.js";import{a as t}from"./useLifecycle-DKSBdWUf.js";import{t as n}from"./chart-no-axes-column-B6FT5Xvu.js";import{n as r}from"./list-filter-CTg19675.js";import{t as i}from"./square-function-DyFIOFp5.js";import{i as a}from"./strings-hlCLC-K1.js";var o=e(`align-center-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]),s=e(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),c=e(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),l=e(`baseline`,[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),u=e(`chart-area`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z`,key:`q0gr47`}]]),d=e(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),f=e(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),p=e(`chart-no-axes-column-increasing`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V9`,key:`uvy0l4`}],[`path`,{d:`M19 21V3`,key:`11j9sm`}]]),m=e(`chart-scatter`,[[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}],[`circle`,{cx:`18.5`,cy:`5.5`,r:`.5`,fill:`currentColor`,key:`lysivs`}],[`circle`,{cx:`11.5`,cy:`11.5`,r:`.5`,fill:`currentColor`,key:`byv1b8`}],[`circle`,{cx:`7.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`nkw3mc`}],[`circle`,{cx:`17.5`,cy:`14.5`,r:`.5`,fill:`currentColor`,key:`1gjh6j`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}]]),h=e(`ruler-dimension-line`,[[`path`,{d:`M10 15v-3`,key:`1pjskw`}],[`path`,{d:`M14 15v-3`,key:`1o1mqj`}],[`path`,{d:`M18 15v-3`,key:`cws6he`}],[`path`,{d:`M2 8V4`,key:`3jv1jz`}],[`path`,{d:`M22 6H2`,key:`1iqbfk`}],[`path`,{d:`M22 8V4`,key:`16f4ou`}],[`path`,{d:`M6 15v-3`,key:`1ij1qe`}],[`rect`,{x:`2`,y:`12`,width:`20`,height:`8`,rx:`2`,key:`1tqiko`}]]),g=e(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),_=e(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]);function v(e){return e&&e.replaceAll(`.`,`\\.`).replaceAll(`[`,`\\[`).replaceAll(`]`,`\\]`).replaceAll(`:`,`\\:`)}var y=`__count__`,b=`default`,ee=`yearmonthdate`,x={line:f,bar:p,pie:r,scatter:m,heatmap:_,area:u},S=`mean`,te={none:i,count:t,sum:g,mean:l,median:o,min:s,max:c,distinct:t,valid:t,stdev:n,stdevp:n,variance:d,variancep:d,bin:h},ne={none:`No aggregation`,count:`Count of records`,sum:`Sum of values`,mean:`Mean of values`,median:`Median of values`,min:`Minimum value`,max:`Maximum value`,distinct:`Count of distinct records`,valid:`Count non-null records`,stdev:`Standard deviation`,stdevp:`Standard deviation of population`,variance:`Variance`,variancep:`Variance of population`,bin:`Group values into bins`},re=[b,`accent`,`category10`,`category20`,`category20b`,`category20c`,`dark2`,`paired`,`pastel1`,`pastel2`,`set1`,`set2`,`set3`,`tableau10`,`tableau20`,`blues`,`greens`,`greys`,`oranges`,`purples`,`reds`,`bluegreen`,`bluepurple`,`goldgreen`,`goldorange`,`goldred`,`greenblue`,`orangered`,`purplebluegreen`,`purplered`,`redpurple`,`yellowgreenblue`,`yelloworangered`,`blueorange`,`brownbluegreen`,`purplegreen`,`pinkyellowgreen`,`purpleorange`,`redblue`,`redgrey`,`redyellowblue`,`redyellowgreen`,`spectral`,`rainbow`,`sinebow`],C={number:`Continuous numerical scale`,string:`Discrete categorical scale (inputs treated as strings)`,temporal:`Continuous temporal scale`},w={year:[`Year`,`2025`],quarter:[`Quarter of year`,`Q1`],month:[`Month of year`,`Jan`],week:[`Week of year`,`Week 1`],day:[`Day of week`,`Sunday`],hours:[`Hour of day`,`12:00`],minutes:[`Minute of hour`,`34`],seconds:[`Second of minute`,`56`],milliseconds:[`Millisecond of second`,`789`],date:[`Day of month`,`1`],dayofyear:[`Day of year`,`Day 1`],yearmonth:[`Year Month`,`Jan 2025`],yearmonthdate:[`Year Month Date`,`Jan 01, 2025`],yearmonthdatehours:[`Year Month Date Hours`,`Jan 01, 2025 12:00`],monthdate:[`Month Date`,`Jan 01`]},T=[`number`,`string`,`temporal`],E=[`year`,`quarter`,`month`,`date`,`week`,`day`,`dayofyear`,`hours`,`minutes`,`seconds`,`milliseconds`],D=[`yearmonth`,`yearmonthdate`,`yearmonthdatehours`,`monthdate`],O=[...E,...D];[...O];var k=[`ascending`,`descending`],A=`none`,j=[A,`bin`,`count`,`sum`,`mean`,`median`,`min`,`max`,`distinct`,`valid`,`stdev`,`stdevp`,`variance`,`variancep`],M=[A,`count`,`distinct`,`valid`],N={LINE:`line`,BAR:`bar`,PIE:`pie`,SCATTER:`scatter`,HEATMAP:`heatmap`,AREA:`area`},P=Object.values(N),ie=[`X`,`Y`,`Color`,A];function F(e){switch(e){case`number`:case`integer`:return`quantitative`;case`string`:case`boolean`:case`geometry`:case`unknown`:return`nominal`;case`date`:case`datetime`:case`time`:case`temporal`:return`temporal`;default:return a(e),`nominal`}}function I(e){switch(e){case`number`:case`integer`:return`number`;case`string`:case`boolean`:case`geometry`:case`unknown`:return`string`;case`date`:case`datetime`:case`time`:return`temporal`;default:return a(e),`string`}}function L(e){switch(e){case N.PIE:return`arc`;case N.SCATTER:return`point`;case N.HEATMAP:return`rect`;default:return e}}function R(e,t,n,r){if(e===N.HEATMAP)return n?.maxbins?{maxbins:n?.maxbins}:void 0;if(t!==`number`)return;if(!n?.binned)return r;let i={};return n.step!==void 0&&(i.step=n.step),n.maxbins!==void 0&&(i.maxbins=n.maxbins),Object.keys(i).length===0||i}function z(e){let t=e.color?.range;if(t?.length)return{range:t};let n=e.color?.scheme;if(n&&n!=="default")return{scheme:n}}function B(e,t){if(e===N.PIE)return;let n;if(Q(t.general?.colorByColumn?.field))n=t.general?.colorByColumn;else if(Q(t.color?.field))switch(t.color?.field){case`X`:n=t.general?.xColumn;break;case`Y`:n=t.general?.yColumn;break;case`Color`:n=t.general?.colorByColumn;break;default:return}else return;if(!n||!Q(n.field)||n.field===`none`)return;if(n.field===`__count__`)return{aggregate:`count`,type:`quantitative`};let r=t.color?.bin,i=n.selectedDataType||`string`,a=n?.aggregate;return{field:v(n.field),type:F(i),scale:z(t),aggregate:H(a,i),bin:R(e,i,r)}}function V(e,t){if(!(t.general?.stacking||!Q(t.general?.colorByColumn?.field)||e!==N.BAR))return{field:v(t.general?.colorByColumn?.field)}}function H(e,t,n){if(t!==`temporal`&&e!==`none`&&e!==`bin`)return e?t===`string`?M.includes(e)?e:void 0:e:n||void 0}function U(e){switch(e){case`integer`:return`,.0f`;case`number`:return`,.2f`;default:return}}function W(e){let{formValues:t,xEncoding:n,yEncoding:r,colorByEncoding:i}=e;if(!t.tooltips)return;function a(e,t,n){if(`aggregate`in e&&e.aggregate===`count`&&!Q(e.field))return{aggregate:`count`};if(e&&`field`in e&&Q(e.field))return e.timeUnit&&!n&&(n=e.field),{field:e.field,aggregate:e.aggregate,timeUnit:e.timeUnit,format:U(t),title:n,bin:e.bin}}if(t.tooltips.auto){let e=[],o=a(n,t.general?.xColumn?.type||`string`,t.xAxis?.label);o&&e.push(o);let s=a(r,t.general?.yColumn?.type||`string`,t.yAxis?.label);s&&e.push(s);let c=a(i||{},t.general?.colorByColumn?.type||`string`);return c&&e.push(c),e}let o=t.tooltips.fields??[],s=[];for(let e of o){if(`field`in n&&Q(n.field)&&n.field===e.field){let e=a(n,t.general?.xColumn?.type||`string`,t.xAxis?.label);e&&s.push(e);continue}if(`field`in r&&Q(r.field)&&r.field===e.field){let e=a(r,t.general?.yColumn?.type||`string`,t.yAxis?.label);e&&s.push(e);continue}if(i&&`field`in i&&Q(i.field)&&i.field===e.field){let e=a(i,t.general?.colorByColumn?.type||`string`);e&&s.push(e);continue}let o={field:v(e.field)};s.push(o)}return s}var G=`X-axis column is required`,K=`Y-axis column is required`;function q(e,t,n,r,i){let{xColumn:a,yColumn:o,colorByColumn:s,horizontal:c,stacking:l,title:u,facet:d}=t.general??{};if(e===N.PIE)return ae(t,n,r,i);if(!Q(a?.field))return G;if(!Q(o?.field))return K;let f=Y(a,t.xAxis?.bin,$(t.xAxis?.label),s?.field&&c?l:void 0,e),p=S;o?.selectedDataType===`string`&&(p=`count`);let m=Y(o,t.yAxis?.bin,$(t.yAxis?.label),s?.field&&!c?l:void 0,e,p),h=d?.row.field?X(d.row,e):void 0,g=d?.column.field?X(d.column,e):void 0,_=B(e,t),v=Z(e,t,n,r,i,u),y={x:c?m:f,y:c?f:m,xOffset:V(e,t),color:_,tooltip:W({formValues:t,xEncoding:f,yEncoding:m,colorByEncoding:_}),...h&&{row:h},...g&&{column:g}},b=ce(d?.column,d?.row);return{...v,mark:{type:L(e)},encoding:y,...b}}function J(e,t){return{...e,data:{values:t}}}function Y(e,t,n,r,i,a){let o=e.selectedDataType||`string`;return e.field===`__count__`?{aggregate:`count`,type:`quantitative`,bin:R(i,o,t),title:n===`__count__`?void 0:n,stack:r}:{field:v(e.field),type:F(e.selectedDataType||`unknown`),bin:R(i,o,t),title:n,stack:r,aggregate:H(e.aggregate,o,a),sort:e.sort,timeUnit:oe(e)}}function X(e,t){let n=R(t,e.selectedDataType||`string`,{maxbins:e.maxbins,binned:e.binned},{maxbins:6});return{field:v(e.field),sort:e.sort,timeUnit:se(e),type:F(e.selectedDataType||`unknown`),bin:n}}function ae(e,t,n,r){let{yColumn:i,colorByColumn:a,title:o}=e.general??{};if(!Q(a?.field))return`Color by column is required`;if(!Q(i?.field))return`Size by column is required`;let s=Y(i,e.xAxis?.bin,$(e.xAxis?.label),void 0,N.PIE),c={field:v(a.field),type:F(a.selectedDataType||`unknown`),scale:z(e),title:$(e.yAxis?.label)};return{...Z(N.PIE,e,t,n,r,o),mark:{type:L(N.PIE),innerRadius:e.style?.innerRadius},encoding:{theta:s,color:c,tooltip:W({formValues:e,xEncoding:s,yEncoding:s,colorByEncoding:c})}}}function Z(e,t,n,r,i,a){let o=t.style?.gridLines??!1;return e===N.SCATTER&&(o=!0),{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,background:n===`dark`?`dark`:`white`,title:a,data:{values:[]},height:t.yAxis?.height??i,width:t.xAxis?.width??r,config:{axis:{grid:o}}}}function Q(e){return e!==void 0&&e.trim()!==``}function $(e){let t=e?.trim();return t===``?void 0:t}function oe(e){if(e.selectedDataType===`temporal`)return e.timeUnit??`yearmonthdate`}function se(e){if(e.selectedDataType===`temporal`)return e.timeUnit??`yearmonthdate`}function ce(e,t){let n={};return e?.linkXAxis===!1&&(n.x=`independent`),t?.linkYAxis===!1&&(n.y=`independent`),Object.keys(n).length>0?{resolve:{axis:n}}:void 0}export{ee as C,d as D,v as E,b as S,w as T,te as _,j as a,y as b,D as c,T as d,E as f,ne as g,O as h,I as i,N as l,M as m,q as n,P as o,k as p,Q as r,ie as s,J as t,A as u,x as v,C as w,S as x,re as y};