@marimo-team/frontend 0.21.2-dev1 → 0.21.2-dev12
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/assets/{JsonOutput-DKXKGKvX.js → JsonOutput-0OSBP9mW.js} +1 -1
- package/dist/assets/{add-cell-with-ai-DUn4LN4W.js → add-cell-with-ai-CngarziZ.js} +1 -1
- package/dist/assets/{agent-panel-u83dsDsM.js → agent-panel-BEDG3iXT.js} +1 -1
- package/dist/assets/{cell-editor-DX7IcqNr.js → cell-editor-DYbGTjbA.js} +1 -1
- package/dist/assets/{chat-display-D_Fuuy6r.js → chat-display-CQpJ2w8h.js} +1 -1
- package/dist/assets/{chat-panel-BO-JoQSp.js → chat-panel-DctJaHWw.js} +1 -1
- package/dist/assets/{column-preview-WsubyItX.js → column-preview-BRmbsSSX.js} +1 -1
- package/dist/assets/{command-palette-Bez4BqJF.js → command-palette-DR4A-wEc.js} +1 -1
- package/dist/assets/{context-aware-panel-CfsfBlhO.js → context-aware-panel-DpscNCjB.js} +1 -1
- package/dist/assets/{dependency-graph-panel-AOBcX2tP.js → dependency-graph-panel-C6qsCxd3.js} +1 -1
- package/dist/assets/{download-B9_ToVd4.js → download-CubygmCt.js} +4 -4
- package/dist/assets/{edit-page-otS-QvnC.js → edit-page-DEylVQeS.js} +3 -3
- package/dist/assets/{file-explorer-panel-CB8vF5ob.js → file-explorer-panel-POO8DT3e.js} +1 -1
- package/dist/assets/{hooks-CHx5dUUq.js → hooks-C6oI58kL.js} +1 -1
- package/dist/assets/html-to-image-D2AayAxp.js +2 -0
- package/dist/assets/{index-GjXovVsl.css → index-CkOKOnvu.css} +1 -1
- package/dist/assets/{index-0n92c_W7.js → index-DvEaAswC.js} +3 -3
- package/dist/assets/{layout-CwFtCyW8.js → layout-TQCb0upy.js} +1 -1
- package/dist/assets/{markdown-renderer-MR9df58W.js → markdown-renderer-Cq3Wh2i9.js} +1 -1
- package/dist/assets/{panels-wTweRyIv.js → panels-C_hjAdk2.js} +1 -1
- package/dist/assets/{readonly-python-code-DH-1xZGq.js → readonly-python-code-D4-6Eh-f.js} +1 -1
- package/dist/assets/{run-page-FCvGnICa.js → run-page-CFOIz6Rr.js} +1 -1
- package/dist/assets/{scratchpad-panel-k9lrm-rC.js → scratchpad-panel-CAzUtGTa.js} +1 -1
- package/dist/assets/{session-panel-WhN0qilM.js → session-panel-BDWXmSLj.js} +1 -1
- package/dist/assets/{useAddCell-YC7rpcmD.js → useAddCell-Q17XaFd_.js} +1 -1
- package/dist/assets/{useCellActionButton-GUb2fXU8.js → useCellActionButton-CQp_OE4x.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-nFVMlEx0.js → useDependencyPanelTab-DjgvHfyz.js} +1 -1
- package/dist/assets/{useNotebookActions-ChLHy-0O.js → useNotebookActions-DEOC7V-6.js} +1 -1
- package/dist/index.html +12 -12
- package/package.json +1 -1
- package/src/css/md.css +7 -0
- package/src/utils/__tests__/download.test.tsx +2 -2
- package/src/utils/download.ts +4 -3
- package/src/utils/html-to-image.ts +6 -0
- package/dist/assets/html-to-image-BnSc-Wa0.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-O0nX5vok.js";import{An as ne,E as de,Jn as se,Qn as re,Tn as ce,Xn as he,Yn as me,di as pe,mt as Q,v as ke,wn as fe}from"./cells-fq1RMGX_.js";import{t as ue}from"./compiler-runtime-B3qBwwSJ.js";import{a as ye,o as be,r as xe}from"./utils-tNbLd14P.js";import{t as je}from"./jsx-runtime-icT_Ltz2.js";import{r as ve}from"./requests-Bgjtqo_1.js";import{t as f}from"./createLucideIcon-Cm-Z7dYr.js";import{n as F,r as V}from"./x-BI1M8X_v.js";import{a as we,h as Ce}from"./download-
|
|
1
|
+
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-O0nX5vok.js";import{An as ne,E as de,Jn as se,Qn as re,Tn as ce,Xn as he,Yn as me,di as pe,mt as Q,v as ke,wn as fe}from"./cells-fq1RMGX_.js";import{t as ue}from"./compiler-runtime-B3qBwwSJ.js";import{a as ye,o as be,r as xe}from"./utils-tNbLd14P.js";import{t as je}from"./jsx-runtime-icT_Ltz2.js";import{r as ve}from"./requests-Bgjtqo_1.js";import{t as f}from"./createLucideIcon-Cm-Z7dYr.js";import{n as F,r as V}from"./x-BI1M8X_v.js";import{a as we,h as Ce}from"./download-CubygmCt.js";import{t as ge}from"./chevron-right-D0GQBpTb.js";import{t as G}from"./circle-plus-CGG-gArM.js";import{t as Ie}from"./code-xml-DwHPF_nL.js";import{t as ze}from"./eye-off-vwi9L975.js";import{t as We}from"./image-DXfkah9d.js";import{t as Me}from"./link-Cf10mh3t.js";import{t as _e}from"./play-DKSqmedg.js";import{a as Ae,n as Se}from"./state-3V5UxC3B.js";import{t as Te}from"./trash-2-CAoNMkjq.js";import{t as De}from"./use-toast-Hc8CXlvz.js";import{r as Ee}from"./mode-AcL8c6qH.js";import{a as Ne,c as Re,n as Be}from"./dialog-CVN1lcMF.js";import{n as He}from"./ImperativeModal-qEtcJ95s.js";import{n as Le}from"./copy-YwM0Pd7v.js";import{i as Pe}from"./useRunCells-5m6jCnyo.js";import{r as K}from"./html-to-image-D2AayAxp.js";import{t as qe}from"./label-TNNaT1M9.js";import{t as Oe}from"./useDeleteCell-DRUDRiy0.js";import{n as Ue,t as Qe}from"./icons-CrUXojcA.js";import{n as J}from"./name-cell-input-DVFEv_aO.js";import{t as X}from"./multi-icon-DEWnuZs2.js";import{t as Fe}from"./useSplitCell-DGD9smMq.js";var Y=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),$=f("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Z=f("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),Ve=f("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),ee=f("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),le=f("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ge(a){let e=new URL(window.location.href);return e.hash=`scrollTo=${encodeURIComponent(a)}`,e.toString()}function Ke(a){var c;let e=(c=a.match(/scrollTo=([^&]+)/))==null?void 0:c[1];return e?decodeURIComponent(e.split("&")[0]):null}function oe(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var Je=ue(),l=ae(je(),1);function Xe(a){let e=(0,Je.c)(47),{cell:c,closePopover:u}=a,{createNewCell:m,updateCellConfig:s,updateCellName:x,moveCell:p,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:A,markUntouched:S}=de(),T=Fe(),D=Pe(c==null?void 0:c.cellId),E=!b(ke),N=Oe(),{openModal:j}=He(),R=ie(Se),B=b(xe),v=b(be),te=b(Ee),y=b(ye),{saveCellConfig:r}=ve();if(!c||te){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],o}let{cellId:t,config:i,getEditorView:d,name:h,hasOutput:w,hasConsoleOutput:H,status:L}=c,C;e[1]!==t||e[2]!==i.disabled||e[3]!==r||e[4]!==s?(C=async()=>{let o={disabled:!i.disabled};await r({configs:{[t]:o}}),s({cellId:t,config:o})},e[1]=t,e[2]=i.disabled,e[3]=r,e[4]=s,e[5]=C):C=e[5];let P=C,g;e[6]!==t||e[7]!==i.hide_code||e[8]!==d||e[9]!==r||e[10]!==s?(g=async()=>{let o={hide_code:!i.hide_code};await r({configs:{[t]:o}}),s({cellId:t,config:o});let U=d();U&&(o.hide_code?U.contentDOM.blur():U.focus())},e[6]=t,e[7]=i.hide_code,e[8]=d,e[9]=r,e[10]=s,e[11]=g):g=e[11];let q=g,n=t===pe,I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(_e,{size:13,strokeWidth:1.5}),e[12]=I):I=e[12];let O=L==="running"||L==="queued"||L==="disabled-transitively"||i.disabled,k;e[13]===D?k=e[14]:(k=()=>D(),e[13]=D,e[14]=k);let z;return e[15]!==_||e[16]!==B||e[17]!==y||e[18]!==v||e[19]!==E||e[20]!==t||e[21]!==A||e[22]!==u||e[23]!==i.disabled||e[24]!==i.hide_code||e[25]!==m||e[26]!==N||e[27]!==d||e[28]!==H||e[29]!==w||e[30]!==n||e[31]!==S||e[32]!==p||e[33]!==h||e[34]!==j||e[35]!==r||e[36]!==M||e[37]!==W||e[38]!==R||e[39]!==T||e[40]!==O||e[41]!==k||e[42]!==P||e[43]!==q||e[44]!==s||e[45]!==x?(z=[[{icon:I,label:"Run cell",hotkey:"cell.run",hidden:O,redundant:!0,handle:k},{icon:(0,l.jsx)(Ae,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!B,handle:()=>{R(o=>(o==null?void 0:o.cellId)===t?null:{cellId:t})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Z,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>T({cellId:t})},{icon:(0,l.jsx)(Ie,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let o=d();o&&ne({[t]:o})}},{icon:i.hide_code?(0,l.jsx)(se,{size:13,strokeWidth:1.5}):(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:i.hide_code?"Show code":"Hide code",handle:q,hotkey:"cell.hideCode"},{icon:i.disabled?(0,l.jsx)(ee,{size:13,strokeWidth:1.5}):(0,l.jsx)(le,{size:13,strokeWidth:1.5}),label:i.disabled?"Enable execution":"Disable execution",handle:P,hidden:n}],[{icon:(0,l.jsx)(Qe,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:async()=>{let o=d();o&&(K({autoInstantiate:v,createNewCell:m}),Q(o,{language:"markdown",keepCodeAsIs:!1}),i.hide_code||(await r({configs:{[t]:{hide_code:!0}}}),s({cellId:t,config:{hide_code:!0}}),S({cellId:t})))},hidden:n},fe(d())==="sql"?{icon:(0,l.jsx)(Ue,{}),label:"View as Python",hotkey:"cell.viewAsSQL",handle:()=>{let o=d();o&&ce(o,"python",{force:!0})},hidden:n}:{icon:(0,l.jsx)(me,{size:13,strokeWidth:1.5}),label:"Convert to SQL",hotkey:"cell.viewAsSQL",handle:()=>{let o=d();o&&(K({autoInstantiate:v,createNewCell:m}),Q(o,{language:"sql",keepCodeAsIs:!1}))},hidden:n}],[{icon:(0,l.jsxs)(X,{children:[(0,l.jsx)(G,{size:13,strokeWidth:1.5}),(0,l.jsx)(F,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>m({cellId:t,before:!0}),hidden:n,redundant:!0},{icon:(0,l.jsxs)(X,{children:[(0,l.jsx)(G,{size:13,strokeWidth:1.5}),(0,l.jsx)(V,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>m({cellId:t,before:!1}),redundant:!0},{icon:(0,l.jsx)(F,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>p({cellId:t,before:!0}),hidden:n},{icon:(0,l.jsx)(V,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>p({cellId:t,before:!1}),hidden:n},{icon:(0,l.jsx)(Ce,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>p({cellId:t,direction:"left"}),hidden:y!=="columns"||n},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>p({cellId:t,direction:"right"}),hidden:y!=="columns"||n},{icon:(0,l.jsx)($,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:t,scroll:!1}),hidden:n},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:t,scroll:!1}),hidden:n},{icon:(0,l.jsx)(he,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:t}),hidden:y!=="columns"||n}],[{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!w,handle:()=>we(t,"result")},{icon:(0,l.jsx)(re,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(w||H),handle:()=>{A({cellId:t})}}],[{icon:(0,l.jsx)(Ve,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:el,handleHeadless:()=>{j((0,l.jsxs)(Be,{children:[(0,l.jsx)(Ne,{children:(0,l.jsx)(Re,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(qe,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)(J,{placeholder:"cell name",value:h,onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),o.stopPropagation(),j(null))},onChange:o=>x({cellId:t,name:o})})]})]}))},rightElement:(0,l.jsx)(J,{placeholder:"cell name",value:h,onChange:o=>x({cellId:t,name:o}),onEnterKey:()=>u==null?void 0:u()}),hidden:n},{icon:(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!oe(h),tooltip:oe(h)?void 0:"Only named cells can be linked to",handle:async()=>{await Le(Ge(h)),De({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!E,variant:"danger",icon:(0,l.jsx)(Te,{size:13,strokeWidth:1.5}),handle:()=>{N({cellId:t})}}]].map($e).filter(Ye),e[15]=_,e[16]=B,e[17]=y,e[18]=v,e[19]=E,e[20]=t,e[21]=A,e[22]=u,e[23]=i.disabled,e[24]=i.hide_code,e[25]=m,e[26]=N,e[27]=d,e[28]=H,e[29]=w,e[30]=n,e[31]=S,e[32]=p,e[33]=h,e[34]=j,e[35]=r,e[36]=M,e[37]=W,e[38]=R,e[39]=T,e[40]=O,e[41]=k,e[42]=P,e[43]=q,e[44]=s,e[45]=x,e[46]=z):z=e[46],z}function Ye(a){return a.length>0}function $e(a){return a.filter(Ze)}function Ze(a){return!a.hidden}function el(a){a==null||a.stopPropagation(),a==null||a.preventDefault()}export{Z as a,ee as i,Ke as n,$ as o,le as r,Y as s,Xe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as G}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as M,p as Z,u as $}from"./useEvent-O0nX5vok.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,yt as re}from"./cells-fq1RMGX_.js";import{t as V}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./jsx-runtime-icT_Ltz2.js";import{t as ae}from"./cn-BoaCR37F.js";import{t as ne}from"./createLucideIcon-Cm-Z7dYr.js";import{t as se}from"./useCellActionButton-
|
|
1
|
+
import{s as G}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as M,p as Z,u as $}from"./useEvent-O0nX5vok.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,yt as re}from"./cells-fq1RMGX_.js";import{t as V}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./jsx-runtime-icT_Ltz2.js";import{t as ae}from"./cn-BoaCR37F.js";import{t as ne}from"./createLucideIcon-Cm-Z7dYr.js";import{t as se}from"./useCellActionButton-CQp_OE4x.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-D9723Brr.js";import{d as de}from"./alert-dialog-9WfvUF7e.js";import{i as B,r as he,t as J}from"./popover-BPGG2gPG.js";import{a as pe,c as fe,i as ue,o as xe,r as je,t as be,u as ye}from"./command-rfxSsiHU.js";import{n as ve}from"./focus-DYwTiH9-.js";import{a as Ne,i as ge}from"./renderShortcut-CnD1Dah5.js";var we=ne("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),K=V(),h=G(ee(),1),t=G(le(),1);const L=h.memo(h.forwardRef((r,a)=>{let e=(0,K.c)(39),{children:n,showTooltip:c,...m}=r,p=c===void 0?!0:c,[d,I]=(0,h.useState)(!1),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>I(!1),e[0]=N):N=e[0];let W=N,D=(0,h.useRef)(null),E=se({cell:m,closePopover:W}).map(Ce).filter(_e),P=de(),g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{te(()=>{D.current&&D.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[1]=g):g=e[1];let T=M(g),w;e[2]===T?w=e[3]:(w=s=>{I(o=>{let l=typeof s=="function"?s(o):s;return l&&T(),l})},e[2]=T,e[3]=w);let i=M(w),k;e[4]===i?k=e[5]:(k=()=>({toggle:()=>i(Se)}),e[4]=i,e[5]=k),(0,h.useImperativeHandle)(a,k);let O=he,A=be,F=re(m.cellId),f;e[6]===F?f=e[7]:(f=(0,t.jsx)(pe,{placeholder:"Search actions...",className:"h-6 m-1",...F}),e[6]=F,e[7]=f);let H=ye,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(je,{children:"No results"}),e[8]=u):u=e[8];let R=E.map((s,o)=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(ue,{children:s.map(l=>{let z=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[l.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:l.icon}),(0,t.jsx)("div",{className:"flex-1",children:l.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[l.hotkey&&ge(l.hotkey),l.rightElement]})]});return l.tooltip&&(z=(0,t.jsx)(me,{content:l.tooltip,delayDuration:100,children:z})),(0,t.jsx)(xe,{className:ae(l.disabled&&"opacity-50!"),onSelect:()=>{l.disableClick||l.disabled||(l.handle(),I(!1))},variant:l.variant,children:z},l.label)})},o),o<E.length-1&&(0,t.jsx)(fe,{})]},o)),x;e[9]!==H||e[10]!==u||e[11]!==R?(x=(0,t.jsxs)(H,{children:[u,R]}),e[9]=H,e[10]=u,e[11]=R,e[12]=x):x=e[12];let j;e[13]!==A||e[14]!==x||e[15]!==f?(j=(0,t.jsxs)(A,{children:[f,x]}),e[13]=A,e[14]=x,e[15]=f,e[16]=j):j=e[16];let C;e[17]!==O||e[18]!==P||e[19]!==j?(C=(0,t.jsx)(O,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...P,children:j}),e[17]=O,e[18]=P,e[19]=j,e[20]=C):C=e[20];let b=C;if(!p){let s;e[21]===n?s=e[22]:(s=(0,t.jsx)(B,{asChild:!0,children:n}),e[21]=n,e[22]=s);let o;return e[23]!==b||e[24]!==i||e[25]!==d||e[26]!==s?(o=(0,t.jsxs)(J,{open:d,onOpenChange:i,children:[s,b]}),e[23]=b,e[24]=i,e[25]=d,e[26]=s,e[27]=o):o=e[27],o}let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(ie,{tabIndex:-1,children:Ne("cell.cellActions")}),e[28]=_):_=e[28];let q=!d&&_,y;e[29]===n?y=e[30]:(y=(0,t.jsx)(ce,{ref:D,children:(0,t.jsx)(B,{className:"flex",children:n})}),e[29]=n,e[30]=y);let v;e[31]!==q||e[32]!==y?(v=(0,t.jsxs)(oe,{delayDuration:200,disableHoverableContent:!0,children:[q,y]}),e[31]=q,e[32]=y,e[33]=v):v=e[33];let S;return e[34]!==b||e[35]!==i||e[36]!==d||e[37]!==v?(S=(0,t.jsxs)(J,{open:d,onOpenChange:i,children:[v,b]}),e[34]=b,e[35]=i,e[36]=d,e[37]=v,e[38]=S):S=e[38],S})),Q=h.memo(r=>{let a=(0,K.c)(5),{children:e,cellId:n}=r,c;a[0]===n?c=a[1]:(c=ve(n),a[0]=n,a[1]=c);let m=$(c);if(!m)return null;let p;return a[2]!==e||a[3]!==m?(p=(0,t.jsx)(L,{showTooltip:!1,...m,children:e}),a[2]=e,a[3]=m,a[4]=p):p=a[4],p});Q.displayName="ConnectionCellActionsDropdown";function ke(r){return!r.redundant}function Ce(r){return r.filter(ke)}function _e(r){return r.length>0}function Se(r){return!r}var Ie=V();const U=Z("minimap");function De(){let r=(0,Ie.c)(3),[a,e]=Y(U),n;return r[0]!==a||r[1]!==e?(n={dependencyPanelTab:a,setDependencyPanelTab:e},r[0]=a,r[1]=e,r[2]=n):n=r[2],n}function Pe(){return X(U)}export{we as a,Q as i,Pe as n,L as r,De as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Xe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cr as tt,E as ge,Ft as at,Qn as ot,Yn as nt,_ as it,dn as st,fn as lt,gn as rt,h as je,li as ce,pn as dt,qn as ct,rr as ht,t as pt}from"./cells-fq1RMGX_.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as mt}from"./assertNever-DWSyoPEi.js";import{s as ve}from"./useLifecycle-DA9DjSPo.js";import{i as ut,n as Ce}from"./add-connection-dialog-CBz0AUVX.js";import{n as ft,x as yt}from"./ai-model-dropdown-DPTa_EpU.js";import{c as ze,m as H}from"./useEventListener-Dy81QR4n.js";import{y as kt}from"./utils-tNbLd14P.js";import{n as A,t as Me}from"./constants-Rz_lD4HK.js";import{S as he,h as bt,x as xt}from"./config-3Aq84phF.js";import{t as wt}from"./jsx-runtime-icT_Ltz2.js";import{r as gt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as We,f as jt,i as Se,m as vt,p as De,u as _e}from"./layout-CwFtCyW8.js";import{t as Ae}from"./check-BE0hEwVo.js";import{c as Ne,d as me,n as Ct,o as zt,r as ue,t as Mt}from"./download-B9_ToVd4.js";import{f as Wt}from"./maps-OKerBHH8.js";import{r as St}from"./useCellActionButton-GUb2fXU8.js";import{t as Dt}from"./copy-CkudG0Ej.js";import{t as _t}from"./download-DBW9RXtT.js";import{t as At}from"./eye-off-vwi9L975.js";import{t as Nt}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Pt}from"./github-BVtI-3F1.js";import{m as It}from"./form-CrQYrsUC.js";import{n as Et,r as Lt,t as Ht}from"./youtube-DE-Ej6FR.js";import{n as Tt,t as qt}from"./square-CxAsQQ77.js";import{t as Rt}from"./image-DXfkah9d.js";import{t as Bt}from"./link-Cf10mh3t.js";import{r as Ft}from"./input-CUwqpKjd.js";import{t as Vt}from"./settings-CzQUw9rV.js";import{x as Yt}from"./azure-BTXHztTw.js";import{t as C}from"./use-toast-Hc8CXlvz.js";import{n as Pe,t as Ot}from"./paths-D2lG83Oh.js";import{o as Kt}from"./session-BrEm7qNv.js";import{a as Ut,c as $t,i as Gt,n as Jt,r as Qt,s as Zt,t as Xt}from"./select-CxT2Geqr.js";import{t as ea}from"./tooltip-D9723Brr.js";import{a as Ie,i as ta,r as aa}from"./mode-AcL8c6qH.js";import{o as oa}from"./alert-dialog-9WfvUF7e.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-CVN1lcMF.js";import{n as fe}from"./ImperativeModal-qEtcJ95s.js";import{r as da,t as ca}from"./share-BdH_5I58.js";import{n as Q}from"./copy-YwM0Pd7v.js";import{r as ha}from"./useRunCells-5m6jCnyo.js";import{a as pa}from"./cell-link-Q_UEP94Z.js";import{a as ma}from"./renderShortcut-CnD1Dah5.js";import{t as ua}from"./icons-CrUXojcA.js";import{t as fa}from"./links-CIQwYQ48.js";import{r as ya,t as Ee}from"./hooks-CHx5dUUq.js";import{t as Le}from"./types-BfP_kuAY.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ve=_(),ye=we(et(),1),a=we(wt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Ve.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let P=await r({download:!1,includeCode:!0,files:jt.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:P,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Ft,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await Q(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Ve.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=gt.stopPropagation(async m=>{m.preventDefault(),await Q(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(ea,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(Me.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Me.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ye(){let e=(0,Da.c)(2),t=L(Ie),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:ta(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Oe=Xe(!1);var Na=_();const Pa=()=>{let e=(0,Na.c)(7),{selectedLayout:t}=We(),{setLayoutView:n}=Se();if(he()&&!rt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Zt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Jt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Ut,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(Xt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Lt;case"slides":return Be;default:return mt(e),qt}}function Ue(e){return ve(e)}function Ea(e){return(0,a.jsx)(Gt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ot.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Pe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Pe.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=ze.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(bt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:xt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),N=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=st(),{selectedPanel:r}=lt(),[l]=Ze(Ie),i=de(aa),d=qa(),[m]=kt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Oe),P=L(ft),z=L(yt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(it),ne=de(pt),{selectedLayout:q}=We(),{setLayoutView:ie}=Se(),R=Ye(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,V;e[0]!==t||e[1]!==W||e[2]!==M?(V=async c=>{let{preset:p,title:E}=c;if(!t){X();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Ct})})},e[0]=t,e[1]=W,e[2]=M,e[3]=V):V=e[3];let S=V,Y;e[4]===S?Y=e[5]:(Y=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=Y);let O=Y,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){X();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(De,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){X();return}await _e({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==O||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==P||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:N,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){X();return}await _e({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:N,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:O},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:N,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await Q(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:N,dropdown:dt.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Qe}=c;return re?[]:{label:ve(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Qe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:N,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Ae,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await Q((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=tt(je());await ae({configs:ze.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(nt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ce,{onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ce,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ot,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Vt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>P(Xa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Resources",handle:N,dropdown:[{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Qa},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Oa).map(Va),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=O,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=P,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Va(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Ya)}:e}function Ya(e){return!e.hidden}function Oa(e){return!e.hidden}function Ka(){let e=Kt();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Qa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Xa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await zt({element:e,filename:document.title,prepare:Mt})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ae,{size:14})})}function X(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ye as a,qe as c,Oe as i,Te as l,$e as n,Fe as o,Pa as r,Re as s,Fa as t,He as u};
|
|
1
|
+
import{s as we}from"./chunk-LvLJmgfZ.js";import{d as L,l as Ze,p as Xe,u as de}from"./useEvent-O0nX5vok.js";import{t as et}from"./react-Bj1aDYRI.js";import{Cr as tt,E as ge,Ft as at,Qn as ot,Yn as nt,_ as it,dn as st,fn as lt,gn as rt,h as je,li as ce,pn as dt,qn as ct,rr as ht,t as pt}from"./cells-fq1RMGX_.js";import{t as _}from"./compiler-runtime-B3qBwwSJ.js";import{n as mt}from"./assertNever-DWSyoPEi.js";import{s as ve}from"./useLifecycle-DA9DjSPo.js";import{i as ut,n as Ce}from"./add-connection-dialog-CBz0AUVX.js";import{n as ft,x as yt}from"./ai-model-dropdown-DPTa_EpU.js";import{c as ze,m as H}from"./useEventListener-Dy81QR4n.js";import{y as kt}from"./utils-tNbLd14P.js";import{n as A,t as Me}from"./constants-Rz_lD4HK.js";import{S as he,h as bt,x as xt}from"./config-3Aq84phF.js";import{t as wt}from"./jsx-runtime-icT_Ltz2.js";import{r as gt,t as pe}from"./button-Ej3vmCIF.js";import{r as T}from"./requests-Bgjtqo_1.js";import{t as h}from"./createLucideIcon-Cm-Z7dYr.js";import{a as We,f as jt,i as Se,m as vt,p as De,u as _e}from"./layout-TQCb0upy.js";import{t as Ae}from"./check-BE0hEwVo.js";import{c as Ne,d as me,n as Ct,o as zt,r as ue,t as Mt}from"./download-CubygmCt.js";import{f as Wt}from"./maps-OKerBHH8.js";import{r as St}from"./useCellActionButton-CQp_OE4x.js";import{t as Dt}from"./copy-CkudG0Ej.js";import{t as _t}from"./download-DBW9RXtT.js";import{t as At}from"./eye-off-vwi9L975.js";import{t as Nt}from"./file-plus-corner-lLQw9OnR.js";import{t as J}from"./file-DzHkbIdO.js";import{t as Pt}from"./github-BVtI-3F1.js";import{m as It}from"./form-CrQYrsUC.js";import{n as Et,r as Lt,t as Ht}from"./youtube-DE-Ej6FR.js";import{n as Tt,t as qt}from"./square-CxAsQQ77.js";import{t as Rt}from"./image-DXfkah9d.js";import{t as Bt}from"./link-Cf10mh3t.js";import{r as Ft}from"./input-CUwqpKjd.js";import{t as Vt}from"./settings-CzQUw9rV.js";import{x as Yt}from"./azure-BTXHztTw.js";import{t as C}from"./use-toast-Hc8CXlvz.js";import{n as Pe,t as Ot}from"./paths-D2lG83Oh.js";import{o as Kt}from"./session-BrEm7qNv.js";import{a as Ut,c as $t,i as Gt,n as Jt,r as Qt,s as Zt,t as Xt}from"./select-CxT2Geqr.js";import{t as ea}from"./tooltip-D9723Brr.js";import{a as Ie,i as ta,r as aa}from"./mode-AcL8c6qH.js";import{o as oa}from"./alert-dialog-9WfvUF7e.js";import{a as na,c as ia,i as sa,n as la,r as ra}from"./dialog-CVN1lcMF.js";import{n as fe}from"./ImperativeModal-qEtcJ95s.js";import{r as da,t as ca}from"./share-BdH_5I58.js";import{n as Q}from"./copy-YwM0Pd7v.js";import{r as ha}from"./useRunCells-5m6jCnyo.js";import{a as pa}from"./cell-link-Q_UEP94Z.js";import{a as ma}from"./renderShortcut-CnD1Dah5.js";import{t as ua}from"./icons-CrUXojcA.js";import{t as fa}from"./links-CIQwYQ48.js";import{r as ya,t as Ee}from"./hooks-C6oI58kL.js";import{t as Le}from"./types-BfP_kuAY.js";var ka=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),ba=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),He=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Te=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),qe=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),xa=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),wa=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),ga=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Re=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ja=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),va=h("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ca=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Be=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),za=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ma=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Fe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ve=_(),ye=we(et(),1),a=we(wt(),1),Z="https://static.marimo.app";const Wa=e=>{let t=(0,Ve.c)(25),{onClose:n}=e,[o,s]=(0,ye.useState)(""),{exportAsHTML:r}=T(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Z}/static/${l}`,d;t[0]!==r||t[1]!==n||t[2]!==l?(d=async v=>{v.preventDefault(),n();let P=await r({download:!1,includeCode:!0,files:jt.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Z}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:P,path:l})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:A.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=l,t[3]=d):d=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(ia,{children:"Share static notebook"}),t[4]=m):m=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(na,{children:[m,(0,a.jsxs)(ra,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Z,target:"_blank",children:Z}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(Ft,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Sa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let y;t[11]!==u||t[12]!==f?(y=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=y):y=t[13];let k;t[14]===n?k=t[15]:(k=(0,a.jsx)(pe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=k);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(pe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await Q(i)},children:"Create"}),t[16]=i,t[17]=b);let x;t[18]!==k||t[19]!==b?(x=(0,a.jsxs)(sa,{children:[k,b]}),t[18]=k,t[19]=b,t[20]=x):x=t[20];let j;return t[21]!==d||t[22]!==x||t[23]!==y?(j=(0,a.jsx)(la,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,y,x]})}),t[21]=d,t[22]=x,t[23]=y,t[24]=j):j=t[24],j};var Sa=e=>{let t=(0,Ve.c)(8),[n,o]=ye.useState(!1),s;t[0]===e.text?s=t[1]:(s=gt.stopPropagation(async m=>{m.preventDefault(),await Q(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(pe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(ea,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},Da=_();function _a(){let e=document.getElementsByClassName(Me.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ce.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ce.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Aa(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ce.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Me.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ye(){let e=(0,Da.c)(2),t=L(Ie),n;return e[0]===t?n=e[1]:(n=()=>{let o=_a();t(s=>({mode:ta(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Aa(o)})})},e[0]=t,e[1]=n),n}const Oe=Xe(!1);var Na=_();const Pa=()=>{let e=(0,Na.c)(7),{selectedLayout:t}=We(),{setLayoutView:n}=Se();if(he()&&!rt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Zt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Jt,{children:(0,a.jsxs)(Qt,{children:[(0,a.jsx)(Ut,{children:"View as"}),Le.map(Ea)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(Xt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function Ia(e){return(0,a.jsx)(Ke(e),{className:"h-4 w-4"})}function Ke(e){switch(e){case"vertical":return ja;case"grid":return Lt;case"slides":return Be;default:return mt(e),qt}}function Ue(e){return ve(e)}function Ea(e){return(0,a.jsx)(Gt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ia(e),(0,a.jsx)("span",{children:Ue(e)})]})},e)}async function La(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ha=_();function Ta(e){let t=(0,Ha.c)(5),{openPrompt:n,closeModal:o}=fe(),{sendCopy:s}=T(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=Ot.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Pe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=l.join(Pe.dirname(e),i);s({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),fa(d)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const qa=()=>{let{updateCellConfig:e}=ge(),{saveCellConfig:t}=T();return(0,ye.useCallback)(async()=>{let n=new at,o=je(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:d,config:m}=o.cellData[i];m.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let l=ze.entries(r);if(l.length!==0){await t({configs:r});for(let[i,d]of l)e({cellId:i,config:d})}},[e])};var Ra=_();function $e(){let e=(0,Ra.c)(4),{openConfirm:t}=fe(),n=L(bt),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(oa,{onClick:async()=>{n({state:xt.CLOSING}),await o(),da()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Ba=_(),N=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Fa(){var be,xe;let e=(0,Ba.c)(51),t=pa(),{openModal:n,closeModal:o}=fe(),{toggleApplication:s}=st(),{selectedPanel:r}=lt(),[l]=Ze(Ie),i=de(aa),d=qa(),[m]=kt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:u,addSetupCellIfDoesntExist:f,collapseAllCells:y,expandAllCells:k}=ge(),b=$e(),x=ha(),j=Ta(t),v=L(Oe),P=L(ft),z=L(yt),{exportAsIPYNB:ee,exportAsMarkdown:te,readCode:I,saveCellConfig:ae,updateCellOutputs:M}=T(),W=ya(),oe=de(it),ne=de(pt),{selectedLayout:q}=We(),{setLayoutView:ie}=Se(),R=Ye(),B=((be=m.sharing)==null?void 0:be.html)??!0,F=((xe=m.sharing)==null?void 0:xe.wasm)??!0,ke=!he(),se=q==="slides",Ge=so,Je=io,V;e[0]!==t||e[1]!==W||e[2]!==M?(V=async c=>{let{preset:p,title:E}=c;if(!t){X();return}await Ne(E,async re=>{await Ee({takeScreenshots:()=>W({progress:re}),updateCellOutputs:M}),await La({filename:t,preset:p,downloadPDF:Ct})})},e[0]=t,e[1]=W,e[2]=M,e[3]=V):V=e[3];let S=V,Y;e[4]===S?Y=e[5]:(Y=async()=>{if(ke){await S({preset:"document",title:"Downloading Document PDF..."});return}let c=new Event("export-beforeprint"),p=new Event("export-afterprint");window.dispatchEvent(c),setTimeout(no,0),setTimeout(()=>window.dispatchEvent(p),0)},e[4]=S,e[5]=Y);let O=Y,K;e[6]!==ee||e[7]!==t||e[8]!==W||e[9]!==M?(K=async()=>{if(!t){X();return}await Ne("Downloading IPYNB...",async c=>{await Ee({takeScreenshots:()=>W({progress:c}),updateCellOutputs:M});let p=await ee({download:!1});ue(new Blob([p],{type:"application/x-ipynb+json"}),me.toIPYNB(document.title))})},e[6]=ee,e[7]=t,e[8]=W,e[9]=M,e[10]=K):K=e[10];let le=K,U;e[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),e[11]=U):U=e[11];let $;e[12]===Symbol.for("react.memo_cache_sentinel")?($=(0,a.jsx)(De,{size:14,strokeWidth:1.5}),e[12]=$):$=e[12];let D;e[13]===t?D=e[14]:(D=async()=>{if(!t){X();return}await _e({filename:t,includeCode:!0})},e[13]=t,e[14]=D);let G;return e[15]!==f||e[16]!==ne||e[17]!==u||e[18]!==o||e[19]!==y||e[20]!==j||e[21]!==S||e[22]!==k||e[23]!==te||e[24]!==t||e[25]!==O||e[26]!==le||e[27]!==oe||e[28]!==d||e[29]!==se||e[30]!==i||e[31]!==n||e[32]!==I||e[33]!==b||e[34]!==x||e[35]!==ae||e[36]!==q||e[37]!==r||e[38]!==v||e[39]!==z||e[40]!==ie||e[41]!==P||e[42]!==B||e[43]!==F||e[44]!==D||e[45]!==s||e[46]!==R||e[47]!==g||e[48]!==w||e[49]!==l.mode?(G=[{icon:U,label:"Download",handle:N,dropdown:[{icon:$,label:"Download as HTML",handle:D},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){X();return}await _e({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(ua,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await te({download:!1});ue(new Blob([c],{type:"text/plain"}),me.toMarkdown(document.title))}},{icon:(0,a.jsx)(va,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:le},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await I();ue(new Blob([c.contents],{type:"text/plain"}),me.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ma("global.hideCode",!1)]}),handle:oo},se?{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:N,dropdown:[{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:O},{icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:Je(!0),hidden:!ke,handle:async()=>{await S({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(J,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O}]},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Share",handle:N,hidden:!B&&!F,dropdown:[{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(Wa,{onClose:o}))}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await Q(ca({code:(await I()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:N,dropdown:dt.flatMap(c=>{let{type:p,Icon:E,hidden:re,additionalKeywords:Qe}=c;return re?[]:{label:ve(p),rightElement:Ge(r===p),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),handle:()=>s(p),additionalKeywords:Qe}})},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Present as",handle:N,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(Yt,{size:14,strokeWidth:1.5}):(0,a.jsx)(Re,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{R()}},...Le.map((c,p)=>{let E=Ke(c);return{divider:p===0,label:Ue(c),icon:(0,a.jsx)(E,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===c&&(0,a.jsx)(Ae,{size:14})}),handle:()=>{ie(c),l.mode==="edit"&&R()}}})]},{icon:(0,a.jsx)(wa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||he(),handle:j},{icon:(0,a.jsx)(He,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await Q((await I()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!oe||i,handle:async()=>{let c=tt(je());await ae({configs:ze.fromEntries(c.map(ao))});for(let p of c)w({cellId:p,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{f({})}},{icon:(0,a.jsx)(nt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ce,{onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ce,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ne||i,handle:()=>{g()}},{icon:(0,a.jsx)(Ma,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(xa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{x()}},{icon:(0,a.jsx)(ot,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{u()}},{icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(ba,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:y,redundant:!0},{icon:(0,a.jsx)(ka,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:k,redundant:!0},{divider:!0,icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(to)},{icon:(0,a.jsx)(ga,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(eo)},{icon:(0,a.jsx)(Vt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>P(Xa),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"Resources",handle:N,dropdown:[{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Za},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Qa},{icon:(0,a.jsx)(Et,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Ja},{icon:(0,a.jsx)(Ht,{size:14,strokeWidth:1.5}),label:"YouTube",handle:Ga},{icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:$a}]},{divider:!0,icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ua},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ka}].filter(Oa).map(Va),e[15]=f,e[16]=ne,e[17]=u,e[18]=o,e[19]=y,e[20]=j,e[21]=S,e[22]=k,e[23]=te,e[24]=t,e[25]=O,e[26]=le,e[27]=oe,e[28]=d,e[29]=se,e[30]=i,e[31]=n,e[32]=I,e[33]=b,e[34]=x,e[35]=ae,e[36]=q,e[37]=r,e[38]=v,e[39]=z,e[40]=ie,e[41]=P,e[42]=B,e[43]=F,e[44]=D,e[45]=s,e[46]=R,e[47]=g,e[48]=w,e[49]=l.mode,e[50]=G):G=e[50],G}function Va(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Ya)}:e}function Ya(e){return!e.hidden}function Oa(e){return!e.hidden}function Ka(){let e=Kt();window.open(e,"_blank")}function Ua(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function $a(){window.open(A.releasesPage,"_blank")}function Ga(){window.open(A.youtube,"_blank")}function Ja(){window.open(A.discordLink,"_blank")}function Qa(){window.open(A.githubPage,"_blank")}function Za(){window.open(A.docsPage,"_blank")}function Xa(e){return!e}function eo(e){return!e}function to(e){return!e}function ao(e){return[e,{disabled:!1}]}async function oo(){let e=document.getElementById("App");e&&await zt({element:e,filename:document.title,prepare:Mt})}function no(){return window.print()}function io(e){return e?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function so(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ae,{size:14})})}function X(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ye as a,qe as c,Oe as i,Te as l,$e as n,Fe as o,Pa as r,Re as s,Fa as t,He as u};
|
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-DvEaAswC.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-BW0IMuFq.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/clsx-BDxNtGmi.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/cn-BoaCR37F.js">
|
|
@@ -186,14 +186,14 @@
|
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/state-3V5UxC3B.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-az74f3Mp.js">
|
|
188
188
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-BgmMM9Zg.js">
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-D2AayAxp.js">
|
|
190
190
|
<link rel="modulepreload" crossorigin href="./assets/focus-DYwTiH9-.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-m8w66E4s.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-CM1a_K7I.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/katex-rvFxOCU-.js">
|
|
194
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
194
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-Cq3Wh2i9.js">
|
|
195
195
|
<link rel="modulepreload" crossorigin href="./assets/command-rfxSsiHU.js">
|
|
196
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
196
|
+
<link rel="modulepreload" crossorigin href="./assets/download-CubygmCt.js">
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/useRunCells-5m6jCnyo.js">
|
|
198
198
|
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-DJ8khuob.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-DTN9kFDq.js">
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/useDateFormatter-CpE7XQLs.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/range-CJeRXUtp.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/table-BCnp9gKC.js">
|
|
210
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-0OSBP9mW.js">
|
|
211
211
|
<link rel="modulepreload" crossorigin href="./assets/useDeleteCell-DRUDRiy0.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/icons-CrUXojcA.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/process-output-CTVsT--B.js">
|
|
@@ -217,26 +217,26 @@
|
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/file-DzHkbIdO.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/image-DXfkah9d.js">
|
|
219
219
|
<link rel="modulepreload" crossorigin href="./assets/play-DKSqmedg.js">
|
|
220
|
-
<link rel="modulepreload" crossorigin href="./assets/add-cell-with-ai-
|
|
220
|
+
<link rel="modulepreload" crossorigin href="./assets/add-cell-with-ai-CngarziZ.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/isEmpty-CfmnKtgL.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/bot-message-square-CK6eoGWy.js">
|
|
223
|
-
<link rel="modulepreload" crossorigin href="./assets/chat-display-
|
|
223
|
+
<link rel="modulepreload" crossorigin href="./assets/chat-display-CQpJ2w8h.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-DV8gdCvH.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/square-function-B006EYFX.js">
|
|
226
226
|
<link rel="modulepreload" crossorigin href="./assets/spec-DbmSqx09.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-CAB7tdza.js">
|
|
228
228
|
<link rel="modulepreload" crossorigin href="./assets/components-Bpgzv_5_.js">
|
|
229
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
229
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-BRmbsSSX.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/toggle-RCwU-rnE.js">
|
|
231
231
|
<link rel="modulepreload" crossorigin href="./assets/globals-BsV5fVR-.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/share-BdH_5I58.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-D5BgdrnX.js">
|
|
234
234
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-DDRqG5ui.js">
|
|
235
|
-
<link rel="modulepreload" crossorigin href="./assets/context-aware-panel-
|
|
235
|
+
<link rel="modulepreload" crossorigin href="./assets/context-aware-panel-DpscNCjB.js">
|
|
236
236
|
<link rel="modulepreload" crossorigin href="./assets/floating-outline-BvQKiC0F.js">
|
|
237
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
237
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-Q17XaFd_.js">
|
|
238
238
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-vwi9L975.js">
|
|
239
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
239
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-D4-6Eh-f.js">
|
|
240
240
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-B5q2Ow55.js">
|
|
241
241
|
<link rel="modulepreload" crossorigin href="./assets/file-icons-CWLHDa1J.js">
|
|
242
242
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-DLpfIr8v.js">
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
<link rel="stylesheet" crossorigin href="./assets/cells-jmgGt1lS.css">
|
|
260
260
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
|
|
261
261
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-B7vuddcd.css">
|
|
262
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
262
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CkOKOnvu.css">
|
|
263
263
|
</head>
|
|
264
264
|
<body>
|
|
265
265
|
<div id="root"></div>
|
package/package.json
CHANGED
package/src/css/md.css
CHANGED
|
@@ -374,6 +374,13 @@ button .prose.prose {
|
|
|
374
374
|
@apply p-4 pt-0;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
/* Restore proper list indentation inside details blocks.
|
|
378
|
+
The p-4 above overrides prose's padding-inline-start for bullet space.
|
|
379
|
+
This ensures bullets render correctly with list-style-position: outside. */
|
|
380
|
+
.markdown details > :is(ul, ol) {
|
|
381
|
+
padding-inline-start: 2.5rem;
|
|
382
|
+
}
|
|
383
|
+
|
|
377
384
|
.markdown .codehilite {
|
|
378
385
|
background-color: var(--slate-2);
|
|
379
386
|
border-radius: 4px;
|
|
@@ -437,8 +437,8 @@ describe("downloadHTMLAsImage", () => {
|
|
|
437
437
|
await downloadHTMLAsImage({ element: mockElement, filename: "test" });
|
|
438
438
|
|
|
439
439
|
expect(toast).toHaveBeenCalledWith({
|
|
440
|
-
title: "
|
|
441
|
-
description: "Failed
|
|
440
|
+
title: "Failed to download as PNG",
|
|
441
|
+
description: "Failed",
|
|
442
442
|
variant: "danger",
|
|
443
443
|
});
|
|
444
444
|
});
|
package/src/utils/download.ts
CHANGED
|
@@ -156,10 +156,11 @@ export async function downloadHTMLAsImage(opts: {
|
|
|
156
156
|
// Get screenshot
|
|
157
157
|
const dataUrl = await toPng(element);
|
|
158
158
|
downloadByURL(dataUrl, Filenames.toPNG(filename));
|
|
159
|
-
} catch {
|
|
159
|
+
} catch (error) {
|
|
160
|
+
Logger.error("Error downloading as PNG", error);
|
|
160
161
|
toast({
|
|
161
|
-
title: "
|
|
162
|
-
description:
|
|
162
|
+
title: "Failed to download as PNG",
|
|
163
|
+
description: prettyError(error),
|
|
163
164
|
variant: "danger",
|
|
164
165
|
});
|
|
165
166
|
} finally {
|
|
@@ -140,6 +140,11 @@ export const necessaryStyleProperties = [
|
|
|
140
140
|
"cursor",
|
|
141
141
|
];
|
|
142
142
|
|
|
143
|
+
// 1x1 transparent PNG as a fallback for images that fail to embed (e.g., cross-origin).
|
|
144
|
+
// Without this, failed embeds leave external URLs in the cloned DOM, which taints the canvas.
|
|
145
|
+
const TRANSPARENT_PIXEL =
|
|
146
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQI12NgAAIABQABNjN9GQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAA0lEQVQI12P4z8BQDwAEgAF/QualIQAAAABJRU5ErkJggg==";
|
|
147
|
+
|
|
143
148
|
/**
|
|
144
149
|
* Default options for html-to-image conversions.
|
|
145
150
|
* These handle common edge cases like filtering out toolbars and logging errors.
|
|
@@ -162,6 +167,7 @@ export const defaultHtmlToImageOptions: HtmlToImageOptions = {
|
|
|
162
167
|
return true;
|
|
163
168
|
}
|
|
164
169
|
},
|
|
170
|
+
imagePlaceholder: TRANSPARENT_PIXEL,
|
|
165
171
|
onImageErrorHandler: (event) => {
|
|
166
172
|
Logger.error("Error loading image:", event);
|
|
167
173
|
},
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as B}from"./useEvent-O0nX5vok.js";import{Sn as G,b as Q,si as v}from"./cells-fq1RMGX_.js";import{m as $}from"./useEventListener-Dy81QR4n.js";import{t as R}from"./requests-Bgjtqo_1.js";function I({moduleName:e,variableName:t,onAddImport:r,appStore:n=B}){if(t in n.get(G))return!1;let{cellData:i,cellIds:o}=n.get(Q),a=RegExp(`import[ ]+${e}[ ]+as[ ]+${t}`,"g");for(let l of o.inOrderIds)if(a.test(i[l].code))return!1;return r(`import ${e} as ${t}`),!0}function X({autoInstantiate:e,createNewCell:t,fromCellId:r,before:n}){let i=R(),o=null;return I({moduleName:"marimo",variableName:"mo",onAddImport:a=>{o=v.create(),t({cellId:r??"__end__",before:n??!1,code:a,lastCodeRun:e?a:void 0,newCellId:o,skipIfCodeExists:!0,autoFocus:!1}),e&&i.sendRun({cellIds:[o],codes:[a]})}})?o:null}function J({autoInstantiate:e,createNewCell:t,fromCellId:r}){let n=R(),i=null;return I({moduleName:"altair",variableName:"alt",onAddImport:o=>{i=v.create(),t({cellId:r??"__end__",before:!1,code:o,lastCodeRun:e?o:void 0,newCellId:i,skipIfCodeExists:!0,autoFocus:!1}),e&&n.sendRun({cellIds:[i],codes:[o]})}})?i:null}function K(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),t&&(n.href=t),i.href=e,i.href}const Y=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function d(e){let t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}var g=null;function k(e={}){return g||(e.includeStyleProperties?(g=e.includeStyleProperties,g):(g=d(window.getComputedStyle(document.documentElement)),g))}function p(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Z(e){let t=p(e,"border-left-width"),r=p(e,"border-right-width");return e.clientWidth+t+r}function ee(e){let t=p(e,"border-top-width"),r=p(e,"border-bottom-width");return e.clientHeight+t+r}function P(e,t={}){return{width:t.width||Z(e),height:t.height||ee(e)}}function te(){let e,t;try{t=process}catch{}let r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var c=16384;function re(e){(e.width>c||e.height>c)&&(e.width>c&&e.height>c?e.width>e.height?(e.height*=c/e.width,e.width=c):(e.width*=c/e.height,e.height=c):e.width>c?(e.height*=c/e.width,e.width=c):(e.width*=c/e.height,e.height=c))}function w(e){return new Promise((t,r)=>{let n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function ne(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ie(e,t,r){let n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),ne(i)}const u=(e,t)=>{if(e instanceof t)return!0;let r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||u(r,t)};function oe(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ae(e,t){return k(t).map(r=>`${r}: ${e.getPropertyValue(r)}${e.getPropertyPriority(r)?" !important":""};`).join(" ")}function le(e,t,r,n){let i=`.${e}:${t}`,o=r.cssText?oe(r):ae(r,n);return document.createTextNode(`${i}{${o}}`)}function N(e,t,r,n){let i=window.getComputedStyle(e,r),o=i.getPropertyValue("content");if(o===""||o==="none")return;let a=Y();try{t.className=`${t.className} ${a}`}catch{return}let l=document.createElement("style");l.appendChild(le(a,r,i,n)),t.appendChild(l)}function se(e,t,r){N(e,t,":before",r),N(e,t,":after",r)}var T="application/font-woff",A="image/jpeg",ce={woff:T,woff2:T,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:A,jpeg:A,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ue(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function x(e){return ce[ue(e).toLowerCase()]||""}function de(e){return e.split(/,/)[1]}function S(e){return e.search(/^(data:)/)!==-1}function L(e,t){return`data:${t};base64,${e}`}async function H(e,t,r){let n=await fetch(e,t);if(n.status===404)throw Error(`Resource "${n.url}" not found`);let i=await n.blob();return new Promise((o,a)=>{let l=new FileReader;l.onerror=a,l.onloadend=()=>{try{o(r({res:n,result:l.result}))}catch(s){a(s)}},l.readAsDataURL(i)})}var E={};function fe(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function C(e,t,r){let n=fe(e,t,r.includeQueryParams);if(E[n]!=null)return E[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{i=L(await H(e,r.fetchRequestInit,({res:o,result:a})=>(t||(t=o.headers.get("Content-Type")||""),de(a))),t)}catch(o){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return E[n]=i,i}async function he(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):w(t)}async function me(e,t){if(e.currentSrc){let n=document.createElement("canvas"),i=n.getContext("2d");return n.width=e.clientWidth,n.height=e.clientHeight,i==null||i.drawImage(e,0,0,n.width,n.height),w(n.toDataURL())}let r=e.poster;return w(await C(r,x(r),t))}async function ge(e,t){var r;try{if((r=e==null?void 0:e.contentDocument)!=null&&r.body)return await y(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function pe(e,t){return u(e,HTMLCanvasElement)?he(e):u(e,HTMLVideoElement)?me(e,t):u(e,HTMLIFrameElement)?ge(e,t):e.cloneNode(F(e))}var we=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",F=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ye(e,t,r){if(F(t))return t;let n=[];return n=we(e)&&e.assignedNodes?d(e.assignedNodes()):d((e.shadowRoot??e).childNodes),n.length===0||u(e,HTMLVideoElement)||await n.reduce((i,o)=>i.then(()=>y(o,r)).then(a=>{a&&t.appendChild(a)}),Promise.resolve()),t}function be(e,t,r){let n=t.style;if(!n)return;let i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):k(r).forEach(o=>{let a=i.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),u(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),n.setProperty(o,a,i.getPropertyPriority(o))})}function xe(e,t){u(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),u(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Se(e,t){if(u(e,HTMLSelectElement)){let r=t,n=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function Ee(e,t,r){return u(t,Element)&&(be(e,t,r),se(e,t,r),xe(e,t),Se(e,t)),t}async function Ce(e,t){let r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;let n={};for(let o=0;o<r.length;o++){let a=r[o].getAttribute("xlink:href");if(a){let l=e.querySelector(a),s=document.querySelector(a);!l&&s&&!n[a]&&(n[a]=await y(s,t,!0))}}let i=Object.values(n);if(i.length){let o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";let l=document.createElementNS(o,"defs");a.appendChild(l);for(let s=0;s<i.length;s++)l.appendChild(i[s]);e.appendChild(a)}return e}async function y(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>pe(n,t)).then(n=>ye(e,n,t)).then(n=>Ee(e,n,t)).then(n=>Ce(n,t))}var M=/url\((['"]?)([^'"]+?)\1\)/g,ve=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,$e=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Re(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Ie(e){let t=[];return e.replace(M,(r,n,i)=>(t.push(i),r)),t.filter(r=>!S(r))}async function ke(e,t,r,n,i){try{let o=r?K(t,r):t,a=x(t),l;return l=i?L(await i(o),a):await C(o,a,n),e.replace(Re(t),`$1${l}$3`)}catch{}return e}function Pe(e,{preferredFontFormat:t}){return t?e.replace($e,r=>{for(;;){let[n,,i]=ve.exec(r)||[];if(!i)return"";if(i===t)return`src: ${n};`}}):e}function V(e){return e.search(M)!==-1}async function j(e,t,r){if(!V(e))return e;let n=Pe(e,r);return Ie(n).reduce((i,o)=>i.then(a=>ke(a,o,t,r)),Promise.resolve(n))}async function h(e,t,r){var i;let n=(i=t.style)==null?void 0:i.getPropertyValue(e);if(n){let o=await j(n,null,r);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Ne(e,t){await h("background",e,t)||await h("background-image",e,t),await h("mask",e,t)||await h("-webkit-mask",e,t)||await h("mask-image",e,t)||await h("-webkit-mask-image",e,t)}async function Te(e,t){let r=u(e,HTMLImageElement);if(!(r&&!S(e.src))&&!(u(e,SVGImageElement)&&!S(e.href.baseVal)))return;let n=r?e.src:e.href.baseVal,i=await C(n,x(n),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...s)=>{try{o(t.onImageErrorHandler(...s))}catch(f){a(f)}}:a;let l=e;l.decode&&(l.decode=o),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Ae(e,t){let r=d(e.childNodes).map(n=>D(n,t));await Promise.all(r).then(()=>e)}async function D(e,t){u(e,Element)&&(await Ne(e,t),await Te(e,t),await Ae(e,t))}function Le(e,t){let{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);let n=t.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),e}var O={};async function _(e){let t=O[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},O[e]=t,t)}async function z(e,t){let r=e.cssText,n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async o=>{let a=o.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),H(a,t.fetchRequestInit,({result:l})=>(r=r.replace(o,`url(${l})`),[o,l]))});return Promise.all(i).then(()=>r)}function U(e){if(e==null)return[];let t=[],r=e.replace(/(\/\*[\s\S]*?\*\/)/gi,""),n=RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let a=n.exec(r);if(a===null)break;t.push(a[0])}r=r.replace(n,"");let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=i.exec(r);if(a===null){if(a=o.exec(r),a===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(a[0])}return t}async function He(e,t){let r=[],n=[];return e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let l=a+1,s=o.href,f=_(s).then(m=>z(m,t)).then(m=>U(m).forEach(b=>{try{i.insertRule(b,b.startsWith("@import")?l+=1:i.cssRules.length)}catch(W){console.error("Error inserting rule from remote css",{rule:b,error:W})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(f)}})}catch(o){let a=e.find(l=>l.href==null)||document.styleSheets[0];i.href!=null&&n.push(_(i.href).then(l=>z(l,t)).then(l=>U(l).forEach(s=>{a.insertRule(s,a.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(e.forEach(i=>{if("cssRules"in i)try{d(i.cssRules||[]).forEach(o=>{r.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),r))}function Fe(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>V(t.style.getPropertyValue("src")))}async function Me(e,t){if(e.ownerDocument==null)throw Error("Provided element is not within a Document");return Fe(await He(d(e.ownerDocument.styleSheets),t))}function q(e){return e.trim().replace(/["']/g,"")}function Ve(e){let t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(i=>{t.add(q(i))}),Array.from(n.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function je(e,t){let r=await Me(e,t),n=Ve(e);return(await Promise.all(r.filter(i=>n.has(q(i.style.fontFamily))).map(i=>{let o=i.parentStyleSheet?i.parentStyleSheet.href:null;return j(i.cssText,o,t)}))).join(`
|
|
2
|
-
`)}async function De(e,t){let r=t.fontEmbedCSS==null?t.skipFonts?null:await je(e,t):t.fontEmbedCSS,n=t.extraStyleContent==null?r:t.extraStyleContent.concat(r||"");if(n){let i=document.createElement("style"),o=document.createTextNode(n);i.appendChild(o),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Oe(e,t={}){let{width:r,height:n}=P(e,t),i=await y(e,t,!0);return await De(i,t),await D(i,t),Le(i,t),await ie(i,r,n)}async function _e(e,t={}){let{width:r,height:n}=P(e,t),i=await w(await Oe(e,t)),o=document.createElement("canvas"),a=o.getContext("2d"),l=t.pixelRatio||te(),s=t.canvasWidth||r,f=t.canvasHeight||n;return o.width=s*l,o.height=f*l,t.skipAutoScale||re(o),o.style.width=`${s}`,o.style.height=`${f}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,o.width,o.height)),a.drawImage(i,0,0,o.width,o.height),o}async function ze(e,t={}){return(await _e(e,t)).toDataURL()}const Ue={filter:e=>{try{if("classList"in e){let t=e.classList;if(t.contains("mpl-toolbar")||t.contains("print:hidden"))return!1}return!0}catch(t){return $.error("Error filtering node:",t),!0}},onImageErrorHandler:e=>{$.error("Error loading image:",e)},includeStyleProperties:"width.height.min-width.min-height.max-width.max-height.box-sizing.aspect-ratio.display.position.top.left.bottom.right.z-index.float.clear.flex.flex-direction.flex-wrap.flex-grow.flex-shrink.flex-basis.align-items.align-self.justify-content.gap.order.grid-template-columns.grid-template-rows.grid-column.grid-row.row-gap.column-gap.margin.margin-top.margin-right.margin-bottom.margin-left.padding.padding-top.padding-right.padding-bottom.padding-left.font.font-family.font-size.font-weight.font-style.line-height.letter-spacing.word-spacing.text-align.text-decoration.text-transform.text-indent.text-shadow.white-space.text-wrap.word-break.text-overflow.vertical-align.color.background.background-color.background-image.background-size.background-position.background-repeat.background-clip.border.border-width.border-style.border-color.border-top.border-right.border-bottom.border-left.border-radius.outline.box-shadow.text-shadow.opacity.filter.backdrop-filter.mix-blend-mode.transform.clip-path.overflow.overflow-x.overflow-y.visibility.fill.stroke.stroke-width.object-fit.object-position.list-style.list-style-type.border-collapse.border-spacing.content.cursor".split(".")};async function qe(e,t){return ze(e,{...Ue,...t})}export{J as n,X as r,qe as t};
|