@marimo-team/frontend 0.21.2-dev63 → 0.21.2-dev64

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 (22) hide show
  1. package/dist/assets/{JsonOutput-Ca8qF0Zd.js → JsonOutput-C6G83us5.js} +9 -9
  2. package/dist/assets/{agent-panel-lhTAqQ2T.js → agent-panel-CEBChEgo.js} +1 -1
  3. package/dist/assets/{cell-editor-DlHW5qr3.js → cell-editor-By2GGVYQ.js} +1 -1
  4. package/dist/assets/{column-preview-ClCjoT33.js → column-preview-Bxza9N1V.js} +1 -1
  5. package/dist/assets/{command-palette-CF05xO-u.js → command-palette-Dx3dFDHn.js} +1 -1
  6. package/dist/assets/{context-aware-panel-BNcqd7JQ.js → context-aware-panel-BAsDUfG1.js} +1 -1
  7. package/dist/assets/{edit-page-CZshKgxH.js → edit-page-D2jHQ99Z.js} +3 -3
  8. package/dist/assets/{file-explorer-panel-DSpZ25B3.js → file-explorer-panel-Dxy2wacg.js} +1 -1
  9. package/dist/assets/{hooks-CpTBKWcv.js → hooks-DVW0qFsD.js} +1 -1
  10. package/dist/assets/{index-DIqPLE1R.js → index-BUi88mQ-.js} +15 -15
  11. package/dist/assets/{layout-am3J4ZNA.js → layout-b4TrkjtJ.js} +1 -1
  12. package/dist/assets/{panels-cRpwb1m4.js → panels-DxPykKF0.js} +1 -1
  13. package/dist/assets/{run-page-CUq8ZpoZ.js → run-page-Ce8MQ2gg.js} +1 -1
  14. package/dist/assets/{scratchpad-panel-CaZOnp24.js → scratchpad-panel-OulpXAJO.js} +1 -1
  15. package/dist/assets/{session-panel-B5exQEib.js → session-panel-BBXXuMQG.js} +1 -1
  16. package/dist/assets/{useNotebookActions-DH_ihkjl.js → useNotebookActions-BqjNClzw.js} +1 -1
  17. package/dist/index.html +4 -4
  18. package/package.json +1 -1
  19. package/src/components/data-table/__tests__/columns.test.tsx +138 -0
  20. package/src/components/data-table/columns.tsx +44 -4
  21. package/src/components/data-table/filters.ts +1 -0
  22. package/src/plugins/impl/DataTablePlugin.tsx +27 -0
@@ -1,4 +1,4 @@
1
- var $t=Object.defineProperty;var Tt=(t,e,n)=>e in t?$t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var L=(t,e,n)=>Tt(t,typeof e!="symbol"?e+"":e,n);import{s as Ae}from"./chunk-LvLJmgfZ.js";import{i as Rt,l as me,n as B,p as Ee,u as se}from"./useEvent-O0nX5vok.js";import{t as At}from"./react-Bj1aDYRI.js";import{E as Et,Sn as It,Tn as Ie,cr as Bt,li as Be,oi as Lt}from"./cells-BZ2tqr8k.js";import"./react-dom-CSu739Rf.js";import{t as ae}from"./compiler-runtime-B3qBwwSJ.js";import"./utils-BGl6s90X.js";import{i as Le,r as Vt,t as Ve}from"./add-connection-dialog-S-Hiw5Sn.js";import{h as Ht,m as ye}from"./useEventListener-Dy81QR4n.js";import{t as Ut}from"./invariant-CQUIhlu2.js";import{p as qt,u as He}from"./utils-tNbLd14P.js";import{S as he}from"./config-DRN1Q5Ol.js";import{t as Wt}from"./jsx-runtime-icT_Ltz2.js";import{n as Kt,t as $}from"./button-Ej3vmCIF.js";import{t as W}from"./cn-BoaCR37F.js";import{St as Gt}from"./dist-B_cxg-E4.js";import{a as Jt,i as Ue,o as pe}from"./JsonOutput-Ca8qF0Zd.js";import"./cjs-BU2qXMKx.js";import"./main-DrBRErTM.js";import"./useNonce-BtW-rR_1.js";import{n as Yt,r as je}from"./requests-Bgjtqo_1.js";import{t as H}from"./createLucideIcon-Cm-Z7dYr.js";import{a as qe,c as We,i as Ke,n as fe,o as be,r as Zt,t as Qt}from"./state-BIoNQTz5.js";import{n as Xt}from"./LazyAnyLanguageCodeMirror-BLyxzRTe.js";import{t as ea}from"./x-CdLP7-v3.js";import{c as ta,i as ve,r as xe}from"./download-BX5RBVL8.js";import{n as we}from"./maps-DQ4X82OB.js";import{n as Ne}from"./markdown-renderer-CGLrhCH1.js";import{u as aa}from"./toDate-Cfp9W_O9.js";import{a as O,c as ne,p as Ge,r as Je,t as Ye}from"./dropdown-menu-CA9akLlF.js";import{t as ke}from"./copy-CkudG0Ej.js";import{t as Ce}from"./download-DBW9RXtT.js";import{t as na}from"./eye-off-vwi9L975.js";import{a as sa,i as Ze,n as Qe,r as ra,t as ia}from"./file-icons-zT5xSrpN.js";import{t as Xe}from"./file-plus-corner-lLQw9OnR.js";import{t as et}from"./file-DzHkbIdO.js";import{n as Fe,t as la}from"./spinner-C5JoisA7.js";import{t as tt}from"./plus-D1HlXYzG.js";import{t as at}from"./refresh-cw-Dd8FlTmm.js";import{t as oa}from"./save-BNIs1Xrf.js";import{t as ca}from"./trash-2-B7Q-bnsg.js";import{t as da}from"./triangle-alert-C6CmrCxa.js";import{i as ma,n as ha,t as pa}from"./es-BJ4lyGGc.js";import"./dist-1ZGGzJka.js";import"./dist-DA4gn7fy.js";import"./dist-Bh-vrbeU.js";import"./dist-4rKUx1vk.js";import"./dist-BXtR56No.js";import{t as A}from"./use-toast-BhMe50aT.js";import{t as _e}from"./paths-bMgYkaP2.js";import"./session-DKzpcHdK.js";import"./Combination-CXstThSr.js";import{t as R}from"./tooltip-BCGmr4TU.js";import"./purify.es-ByGlPBcv.js";import"./dates-Bh1ltXGt.js";import{o as fa}from"./alert-dialog-BfHy00ko.js";import{t as nt}from"./context-BPhh8SWw.js";import"./popover-C5P0DZBj.js";import{n as st}from"./ImperativeModal-DyRrGcKH.js";import{r as xa}from"./errors-Bhwg_4_Q.js";import{n as ua,t as rt}from"./blob-BTrKZERf.js";import"./vega-loader.browser-W8QXhYr5.js";import"./defaultLocale-D_LmbLH5.js";import"./defaultLocale-CvLIK2MU.js";import{n as re}from"./copy-CIPmwSuj.js";import{t as ga}from"./copy-icon-BNQYrUYC.js";import{n as ya}from"./multi-map-1zWiWMZF.js";import{a as ja,i as ba,n as Se,r as va,t as wa}from"./tree-CG4dRTEj.js";import{n as Na,t as ka}from"./alert-Cv0TRjV-.js";import{n as it}from"./error-banner-D6woGaqN.js";import{n as Pe}from"./useAsyncData-VEt7lMhG.js";import{a as Ca,o as lt,t as Fa,u as _a}from"./command-BeKqRjOY.js";import"./chunk-5FQGJX7Z-Fb8WLBdo.js";import"./katex-BrOUG02-.js";import"./html-to-image-D_3oFpSp.js";import{o as Sa}from"./focus-CpM6NAz2.js";import{a as Pa}from"./renderShortcut-DKHsNYY8.js";import{t as Da}from"./bundle.esm-idScn0w0.js";import{t as ot}from"./useAddCell-Dluq9z9F.js";import{a as za,c as De,d as ze,l as ct,u as dt}from"./components-4-hSIFip.js";import{t as Ma}from"./empty-state-GQ-H0WrT.js";import{t as Me}from"./formatting-D99dzYue.js";import{a as Oa,i as $a,n as mt,r as ht,t as pt}from"./components-DlVdNzZL.js";import{n as ft,t as Ta}from"./marimo-icons-xeZXdanj.js";import{t as Ra}from"./links-BpU-Tgoi.js";var Aa=H("book-plus",[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]),Ea=H("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Ia=H("file-symlink",[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7",key:"huwfnr"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 18 3-3-3-3",key:"18f6ys"}]]),xt=H("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),ut=H("list-tree",[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]),Ba=H("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),La=H("square-play",[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]]),gt=H("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),z=Ae(At(),1),Va=ae(),a=Ae(Wt(),1);const yt=t=>{let e=(0,Va.c)(17),{filename:n,filenameIcon:i,onBack:r,onRefresh:s,onDownload:c,actions:o}=t,m;e[0]===r?m=e[1]:(m=r&&(0,a.jsx)(R,{content:"Back to file list",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:r,children:(0,a.jsx)(We,{className:"h-4 w-4"})})}),e[0]=r,e[1]=m);let l;e[2]!==n||e[3]!==i?(l=n?(0,a.jsxs)("span",{className:"flex items-center gap-1.5 flex-1 min-w-0 text-xs font-semibold truncate",children:[i,n]}):(0,a.jsx)("span",{className:"flex-1"}),e[2]=n,e[3]=i,e[4]=l):l=e[4];let f;e[5]===s?f=e[6]:(f=s&&(0,a.jsx)(R,{content:"Refresh",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:s,children:(0,a.jsx)(at,{className:"h-3.5 w-3.5"})})}),e[5]=s,e[6]=f);let x;e[7]===c?x=e[8]:(x=c&&(0,a.jsx)(R,{content:"Download",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:c,children:(0,a.jsx)(Ce,{className:"h-3.5 w-3.5"})})}),e[7]=c,e[8]=x);let j;e[9]!==o||e[10]!==f||e[11]!==x?(j=(0,a.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[f,o,x]}),e[9]=o,e[10]=f,e[11]=x,e[12]=j):j=e[12];let g;return e[13]!==m||e[14]!==l||e[15]!==j?(g=(0,a.jsxs)("div",{className:"flex items-center shrink-0 border-b px-1 gap-1",children:[m,l,j]}),e[13]=m,e[14]=l,e[15]=j,e[16]=g):g=e[16],g};var Ha=new Set(["http","file","in-memory"]);function Oe(t){return JSON.stringify(t).slice(1,-1)}const jt=[{id:"read-file",label:"Insert read snippet",icon:Aa,getCode:t=>{if(t.entry.kind==="directory")return null;let e=Oe(t.entry.path);return t.backendType==="obstore"?`_data = ${t.variableName}.get("${e}").bytes()
1
+ var $t=Object.defineProperty;var Tt=(t,e,n)=>e in t?$t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var L=(t,e,n)=>Tt(t,typeof e!="symbol"?e+"":e,n);import{s as Ae}from"./chunk-LvLJmgfZ.js";import{i as Rt,l as me,n as B,p as Ee,u as se}from"./useEvent-O0nX5vok.js";import{t as At}from"./react-Bj1aDYRI.js";import{E as Et,Sn as It,Tn as Ie,cr as Bt,li as Be,oi as Lt}from"./cells-BZ2tqr8k.js";import"./react-dom-CSu739Rf.js";import{t as ae}from"./compiler-runtime-B3qBwwSJ.js";import"./utils-BGl6s90X.js";import{i as Le,r as Vt,t as Ve}from"./add-connection-dialog-S-Hiw5Sn.js";import{h as Ht,m as ye}from"./useEventListener-Dy81QR4n.js";import{t as Ut}from"./invariant-CQUIhlu2.js";import{p as qt,u as He}from"./utils-tNbLd14P.js";import{S as he}from"./config-DRN1Q5Ol.js";import{t as Wt}from"./jsx-runtime-icT_Ltz2.js";import{n as Kt,t as $}from"./button-Ej3vmCIF.js";import{t as W}from"./cn-BoaCR37F.js";import{St as Gt}from"./dist-B_cxg-E4.js";import{a as Jt,i as Ue,o as pe}from"./JsonOutput-C6G83us5.js";import"./cjs-BU2qXMKx.js";import"./main-DrBRErTM.js";import"./useNonce-BtW-rR_1.js";import{n as Yt,r as je}from"./requests-Bgjtqo_1.js";import{t as H}from"./createLucideIcon-Cm-Z7dYr.js";import{a as qe,c as We,i as Ke,n as fe,o as be,r as Zt,t as Qt}from"./state-BIoNQTz5.js";import{n as Xt}from"./LazyAnyLanguageCodeMirror-BLyxzRTe.js";import{t as ea}from"./x-CdLP7-v3.js";import{c as ta,i as ve,r as xe}from"./download-BX5RBVL8.js";import{n as we}from"./maps-DQ4X82OB.js";import{n as Ne}from"./markdown-renderer-CGLrhCH1.js";import{u as aa}from"./toDate-Cfp9W_O9.js";import{a as O,c as ne,p as Ge,r as Je,t as Ye}from"./dropdown-menu-CA9akLlF.js";import{t as ke}from"./copy-CkudG0Ej.js";import{t as Ce}from"./download-DBW9RXtT.js";import{t as na}from"./eye-off-vwi9L975.js";import{a as sa,i as Ze,n as Qe,r as ra,t as ia}from"./file-icons-zT5xSrpN.js";import{t as Xe}from"./file-plus-corner-lLQw9OnR.js";import{t as et}from"./file-DzHkbIdO.js";import{n as Fe,t as la}from"./spinner-C5JoisA7.js";import{t as tt}from"./plus-D1HlXYzG.js";import{t as at}from"./refresh-cw-Dd8FlTmm.js";import{t as oa}from"./save-BNIs1Xrf.js";import{t as ca}from"./trash-2-B7Q-bnsg.js";import{t as da}from"./triangle-alert-C6CmrCxa.js";import{i as ma,n as ha,t as pa}from"./es-BJ4lyGGc.js";import"./dist-1ZGGzJka.js";import"./dist-DA4gn7fy.js";import"./dist-Bh-vrbeU.js";import"./dist-4rKUx1vk.js";import"./dist-BXtR56No.js";import{t as A}from"./use-toast-BhMe50aT.js";import{t as _e}from"./paths-bMgYkaP2.js";import"./session-DKzpcHdK.js";import"./Combination-CXstThSr.js";import{t as R}from"./tooltip-BCGmr4TU.js";import"./purify.es-ByGlPBcv.js";import"./dates-Bh1ltXGt.js";import{o as fa}from"./alert-dialog-BfHy00ko.js";import{t as nt}from"./context-BPhh8SWw.js";import"./popover-C5P0DZBj.js";import{n as st}from"./ImperativeModal-DyRrGcKH.js";import{r as xa}from"./errors-Bhwg_4_Q.js";import{n as ua,t as rt}from"./blob-BTrKZERf.js";import"./vega-loader.browser-W8QXhYr5.js";import"./defaultLocale-D_LmbLH5.js";import"./defaultLocale-CvLIK2MU.js";import{n as re}from"./copy-CIPmwSuj.js";import{t as ga}from"./copy-icon-BNQYrUYC.js";import{n as ya}from"./multi-map-1zWiWMZF.js";import{a as ja,i as ba,n as Se,r as va,t as wa}from"./tree-CG4dRTEj.js";import{n as Na,t as ka}from"./alert-Cv0TRjV-.js";import{n as it}from"./error-banner-D6woGaqN.js";import{n as Pe}from"./useAsyncData-VEt7lMhG.js";import{a as Ca,o as lt,t as Fa,u as _a}from"./command-BeKqRjOY.js";import"./chunk-5FQGJX7Z-Fb8WLBdo.js";import"./katex-BrOUG02-.js";import"./html-to-image-D_3oFpSp.js";import{o as Sa}from"./focus-CpM6NAz2.js";import{a as Pa}from"./renderShortcut-DKHsNYY8.js";import{t as Da}from"./bundle.esm-idScn0w0.js";import{t as ot}from"./useAddCell-Dluq9z9F.js";import{a as za,c as De,d as ze,l as ct,u as dt}from"./components-4-hSIFip.js";import{t as Ma}from"./empty-state-GQ-H0WrT.js";import{t as Me}from"./formatting-D99dzYue.js";import{a as Oa,i as $a,n as mt,r as ht,t as pt}from"./components-DlVdNzZL.js";import{n as ft,t as Ta}from"./marimo-icons-xeZXdanj.js";import{t as Ra}from"./links-BpU-Tgoi.js";var Aa=H("book-plus",[["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]),Ea=H("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Ia=H("file-symlink",[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7",key:"huwfnr"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 18 3-3-3-3",key:"18f6ys"}]]),xt=H("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),ut=H("list-tree",[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]),Ba=H("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),La=H("square-play",[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]]),gt=H("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),z=Ae(At(),1),Va=ae(),a=Ae(Wt(),1);const yt=t=>{let e=(0,Va.c)(17),{filename:n,filenameIcon:i,onBack:r,onRefresh:s,onDownload:c,actions:o}=t,m;e[0]===r?m=e[1]:(m=r&&(0,a.jsx)(R,{content:"Back to file list",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:r,children:(0,a.jsx)(We,{className:"h-4 w-4"})})}),e[0]=r,e[1]=m);let l;e[2]!==n||e[3]!==i?(l=n?(0,a.jsxs)("span",{className:"flex items-center gap-1.5 flex-1 min-w-0 text-xs font-semibold truncate",children:[i,n]}):(0,a.jsx)("span",{className:"flex-1"}),e[2]=n,e[3]=i,e[4]=l):l=e[4];let f;e[5]===s?f=e[6]:(f=s&&(0,a.jsx)(R,{content:"Refresh",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:s,children:(0,a.jsx)(at,{className:"h-3.5 w-3.5"})})}),e[5]=s,e[6]=f);let x;e[7]===c?x=e[8]:(x=c&&(0,a.jsx)(R,{content:"Download",children:(0,a.jsx)($,{variant:"text",size:"xs",onClick:c,children:(0,a.jsx)(Ce,{className:"h-3.5 w-3.5"})})}),e[7]=c,e[8]=x);let j;e[9]!==o||e[10]!==f||e[11]!==x?(j=(0,a.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[f,o,x]}),e[9]=o,e[10]=f,e[11]=x,e[12]=j):j=e[12];let g;return e[13]!==m||e[14]!==l||e[15]!==j?(g=(0,a.jsxs)("div",{className:"flex items-center shrink-0 border-b px-1 gap-1",children:[m,l,j]}),e[13]=m,e[14]=l,e[15]=j,e[16]=g):g=e[16],g};var Ha=new Set(["http","file","in-memory"]);function Oe(t){return JSON.stringify(t).slice(1,-1)}const jt=[{id:"read-file",label:"Insert read snippet",icon:Aa,getCode:t=>{if(t.entry.kind==="directory")return null;let e=Oe(t.entry.path);return t.backendType==="obstore"?`_data = ${t.variableName}.get("${e}").bytes()
2
2
  _data`:`_data = ${t.variableName}.cat_file("${e}")
3
3
  _data`}},{id:"download-file",label:"Insert download snippet",icon:Ia,getCode:t=>{if(t.entry.kind==="directory")return null;let e=Oe(t.entry.path);if(t.backendType==="obstore")return Ha.has(t.protocol)?null:`from datetime import timedelta
4
4
  from obstore import sign
@@ -1 +1 @@
1
- var O=Object.defineProperty;var V=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var b=(t,e,i)=>V(t,typeof e!="symbol"?e+"":e,i);import{u as I}from"./useEvent-O0nX5vok.js";import{o as j}from"./cells-BZ2tqr8k.js";import{t as T}from"./compiler-runtime-B3qBwwSJ.js";import{c as k,m as E}from"./useEventListener-Dy81QR4n.js";import{i as N}from"./utils-tNbLd14P.js";import{h as P,x as _}from"./config-DRN1Q5Ol.js";import{r as z}from"./requests-Bgjtqo_1.js";import{f as D}from"./layout-am3J4ZNA.js";import{s as $,u as B}from"./download-BX5RBVL8.js";import{t as H}from"./Deferred-D2igisxY.js";import{t as L}from"./use-toast-BhMe50aT.js";import{t as x}from"./useInterval-THXC3A8S.js";var R=class{constructor(){b(this,"capturedInputs",new Map);b(this,"inFlight",new Map)}cancelEntry(t){t.controller.abort(),t.deferred.status==="pending"&&t.deferred.resolve(void 0)}needsCapture(t,e){if(this.capturedInputs.get(t)===e)return!1;let i=this.inFlight.get(t);return!(i&&i.inputValue===e)}waitForInFlight(t,e){let i=this.inFlight.get(t);return i&&i.inputValue===e?i.deferred.promise:null}startCapture(t,e){let i=this.inFlight.get(t);i&&this.cancelEntry(i);let n=new AbortController,l=new H,u={controller:n,inputValue:e,deferred:l};return this.inFlight.set(t,u),{signal:n.signal,markCaptured:p=>{this.inFlight.get(t)===u&&(l.resolve(p),this.capturedInputs.set(t,e),this.inFlight.delete(t))},markFailed:()=>{this.inFlight.get(t)===u&&(l.resolve(void 0),this.inFlight.delete(t))}}}prune(t){for(let e of this.capturedInputs.keys())t.has(e)||this.capturedInputs.delete(e);for(let[e,i]of this.inFlight)t.has(e)||(this.cancelEntry(i),this.inFlight.delete(e))}get isCapturing(){return this.inFlight.size>0}abort(){for(let t of this.inFlight.values())this.cancelEntry(t);this.inFlight.clear()}reset(){this.abort(),this.capturedInputs.clear()}},Y=T(),M=5e3;function q(){let t=(0,Y.c)(14),e=I(N),{state:i}=I(P),n=e.auto_download.includes("markdown"),l=e.auto_download.includes("html"),u=e.auto_download.includes("ipynb"),p=i===_.OPEN,m=!n||!p,d=!l||!p,h=!u||!p,{autoExportAsHTML:a,autoExportAsIPYNB:s,autoExportAsMarkdown:r,updateCellOutputs:o}=z(),c=S(),f;t[0]===r?f=t[1]:(f=async()=>{await r({download:!1})},t[0]=r,t[1]=f);let g;t[2]===m?g=t[3]:(g={delayMs:M,whenVisible:!0,disabled:m},t[2]=m,t[3]=g),x(f,g);let w;t[4]===a?w=t[5]:(w=async()=>{await a({download:!1,includeCode:!0,files:D.INSTANCE.filenames()})},t[4]=a,t[5]=w);let v;t[6]===d?v=t[7]:(v={delayMs:M,whenVisible:!0,disabled:d},t[6]=d,t[7]=v),x(w,v);let F;t[8]!==s||t[9]!==c||t[10]!==o?(F=async()=>{await A({takeScreenshots:()=>c({progress:B.indeterminate()}),updateCellOutputs:o}),await s({download:!1})},t[8]=s,t[9]=c,t[10]=o,t[11]=F):F=t[11];let y;t[12]===h?y=t[13]:(y={delayMs:M,whenVisible:!0,disabled:h,skipIfRunning:!0},t[12]=h,t[13]=y),x(F,y)}var G=new Set(["text/html","application/vnd.vegalite.v5+json","application/vnd.vega.v5+json","application/vnd.vegalite.v6+json","application/vnd.vega.v6+json"]);const C=new R;function S(){let t=I(j);return async e=>{var d,h;let{progress:i}=e,n=new Set(k.keys(t));C.prune(n);let l=[],u=[];for(let[a,s]of k.entries(t)){let r=(d=s.output)==null?void 0:d.data;if((h=s.output)!=null&&h.mimetype&&G.has(s.output.mimetype)&&r)if(C.needsCapture(a,r))l.push([a,r]);else{let o=C.waitForInFlight(a,r);o&&u.push({cellId:a,promise:o})}}if(l.length===0&&u.length===0)return{};l.length>0&&i.addTotal(l.length);let p={};for(let[a,s]of l){let r=C.startCapture(a,s);try{let o=await $(a);if(r.signal.aborted)continue;if(!o){E.error(`Failed to capture screenshot for cell ${a}`),r.markFailed();continue}let c=["image/png",o];p[a]=c,r.markCaptured(c)}catch(o){E.error(`Error screenshotting cell ${a}:`,o),r.markFailed()}finally{i.increment(1)}}let m=await Promise.allSettled(u.map(({promise:a})=>a));for(let[a,{cellId:s}]of u.entries()){let r=m[a];r.status==="fulfilled"&&r.value&&(p[s]=r.value)}return p}}async function A(t){let{takeScreenshots:e,updateCellOutputs:i}=t;try{let n=await e();k.size(n)>0&&await i({cellIdsToOutput:n})}catch(n){E.error("Error updating cell outputs with screenshots:",n),L({title:"Failed to capture cell outputs",description:"Some outputs may not appear in the PDF. Continuing with export.",variant:"danger"})}}export{q as n,S as r,A as t};
1
+ var O=Object.defineProperty;var V=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var b=(t,e,i)=>V(t,typeof e!="symbol"?e+"":e,i);import{u as I}from"./useEvent-O0nX5vok.js";import{o as j}from"./cells-BZ2tqr8k.js";import{t as T}from"./compiler-runtime-B3qBwwSJ.js";import{c as k,m as E}from"./useEventListener-Dy81QR4n.js";import{i as N}from"./utils-tNbLd14P.js";import{h as P,x as _}from"./config-DRN1Q5Ol.js";import{r as z}from"./requests-Bgjtqo_1.js";import{f as D}from"./layout-b4TrkjtJ.js";import{s as $,u as B}from"./download-BX5RBVL8.js";import{t as H}from"./Deferred-D2igisxY.js";import{t as L}from"./use-toast-BhMe50aT.js";import{t as x}from"./useInterval-THXC3A8S.js";var R=class{constructor(){b(this,"capturedInputs",new Map);b(this,"inFlight",new Map)}cancelEntry(t){t.controller.abort(),t.deferred.status==="pending"&&t.deferred.resolve(void 0)}needsCapture(t,e){if(this.capturedInputs.get(t)===e)return!1;let i=this.inFlight.get(t);return!(i&&i.inputValue===e)}waitForInFlight(t,e){let i=this.inFlight.get(t);return i&&i.inputValue===e?i.deferred.promise:null}startCapture(t,e){let i=this.inFlight.get(t);i&&this.cancelEntry(i);let n=new AbortController,l=new H,u={controller:n,inputValue:e,deferred:l};return this.inFlight.set(t,u),{signal:n.signal,markCaptured:p=>{this.inFlight.get(t)===u&&(l.resolve(p),this.capturedInputs.set(t,e),this.inFlight.delete(t))},markFailed:()=>{this.inFlight.get(t)===u&&(l.resolve(void 0),this.inFlight.delete(t))}}}prune(t){for(let e of this.capturedInputs.keys())t.has(e)||this.capturedInputs.delete(e);for(let[e,i]of this.inFlight)t.has(e)||(this.cancelEntry(i),this.inFlight.delete(e))}get isCapturing(){return this.inFlight.size>0}abort(){for(let t of this.inFlight.values())this.cancelEntry(t);this.inFlight.clear()}reset(){this.abort(),this.capturedInputs.clear()}},Y=T(),M=5e3;function q(){let t=(0,Y.c)(14),e=I(N),{state:i}=I(P),n=e.auto_download.includes("markdown"),l=e.auto_download.includes("html"),u=e.auto_download.includes("ipynb"),p=i===_.OPEN,m=!n||!p,d=!l||!p,h=!u||!p,{autoExportAsHTML:a,autoExportAsIPYNB:s,autoExportAsMarkdown:r,updateCellOutputs:o}=z(),c=S(),f;t[0]===r?f=t[1]:(f=async()=>{await r({download:!1})},t[0]=r,t[1]=f);let g;t[2]===m?g=t[3]:(g={delayMs:M,whenVisible:!0,disabled:m},t[2]=m,t[3]=g),x(f,g);let w;t[4]===a?w=t[5]:(w=async()=>{await a({download:!1,includeCode:!0,files:D.INSTANCE.filenames()})},t[4]=a,t[5]=w);let v;t[6]===d?v=t[7]:(v={delayMs:M,whenVisible:!0,disabled:d},t[6]=d,t[7]=v),x(w,v);let F;t[8]!==s||t[9]!==c||t[10]!==o?(F=async()=>{await A({takeScreenshots:()=>c({progress:B.indeterminate()}),updateCellOutputs:o}),await s({download:!1})},t[8]=s,t[9]=c,t[10]=o,t[11]=F):F=t[11];let y;t[12]===h?y=t[13]:(y={delayMs:M,whenVisible:!0,disabled:h,skipIfRunning:!0},t[12]=h,t[13]=y),x(F,y)}var G=new Set(["text/html","application/vnd.vegalite.v5+json","application/vnd.vega.v5+json","application/vnd.vegalite.v6+json","application/vnd.vega.v6+json"]);const C=new R;function S(){let t=I(j);return async e=>{var d,h;let{progress:i}=e,n=new Set(k.keys(t));C.prune(n);let l=[],u=[];for(let[a,s]of k.entries(t)){let r=(d=s.output)==null?void 0:d.data;if((h=s.output)!=null&&h.mimetype&&G.has(s.output.mimetype)&&r)if(C.needsCapture(a,r))l.push([a,r]);else{let o=C.waitForInFlight(a,r);o&&u.push({cellId:a,promise:o})}}if(l.length===0&&u.length===0)return{};l.length>0&&i.addTotal(l.length);let p={};for(let[a,s]of l){let r=C.startCapture(a,s);try{let o=await $(a);if(r.signal.aborted)continue;if(!o){E.error(`Failed to capture screenshot for cell ${a}`),r.markFailed();continue}let c=["image/png",o];p[a]=c,r.markCaptured(c)}catch(o){E.error(`Error screenshotting cell ${a}:`,o),r.markFailed()}finally{i.increment(1)}}let m=await Promise.allSettled(u.map(({promise:a})=>a));for(let[a,{cellId:s}]of u.entries()){let r=m[a];r.status==="fulfilled"&&r.value&&(p[s]=r.value)}return p}}async function A(t){let{takeScreenshots:e,updateCellOutputs:i}=t;try{let n=await e();k.size(n)>0&&await i({cellIdsToOutput:n})}catch(n){E.error("Error updating cell outputs with screenshots:",n),L({title:"Failed to capture cell outputs",description:"Some outputs may not appear in the PDF. Continuing with export.",variant:"danger"})}}export{q as n,S as r,A as t};