@marimo-team/frontend 0.22.5-dev19 → 0.22.5-dev21
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/{CellStatus-BMEZcX6D.js → CellStatus-CP1jrQ3A.js} +1 -1
- package/dist/assets/{JsonOutput-BftIujCE.js → JsonOutput-Bk2by9qo.js} +10 -10
- package/dist/assets/{MarimoErrorOutput-DwB04lez.js → MarimoErrorOutput-Cyd8ikG3.js} +2 -2
- package/dist/assets/{RenderHTML-B1H96oeH.js → RenderHTML-BOW_1WUn.js} +1 -1
- package/dist/assets/{add-cell-with-ai-UrREhHNG.js → add-cell-with-ai-DUq7Y523.js} +8 -8
- package/dist/assets/{add-connection-dialog-RNl1YtDd.js → add-connection-dialog-20N0EHLl.js} +1 -1
- package/dist/assets/{agent-panel-5eW2Jdd_.js → agent-panel-DEza5aFa.js} +3 -3
- package/dist/assets/{ai-model-dropdown-DV6uEsTK.js → ai-model-dropdown-B-sbS07W.js} +3 -3
- package/dist/assets/{app-config-button-CNUlg9JF.js → app-config-button-CJFpYJ_2.js} +1 -1
- package/dist/assets/{cell-editor-BIK0Td2y.js → cell-editor-DLL6kX__.js} +10 -10
- package/dist/assets/{cell-link-BITFYvIs.js → cell-link-Dtonmtv_.js} +1 -1
- package/dist/assets/{cells-CFrQXbte.js → cells-BVG4a-Qn.js} +42 -42
- package/dist/assets/{chat-display-CBjI6eJ2.js → chat-display-DsIGz-Wy.js} +1 -1
- package/dist/assets/{chat-panel-B3wa_j2C.js → chat-panel-aXOgktdv.js} +1 -1
- package/dist/assets/{chat-ui-C7jOY4Gu.js → chat-ui-C--RApyx.js} +1 -1
- package/dist/assets/{column-preview-B9QUzNmm.js → column-preview-CB_HZPdz.js} +1 -1
- package/dist/assets/{command-palette-Dk4tecmR.js → command-palette-DLKNdcX_.js} +1 -1
- package/dist/assets/{common-_4Eq0fX8.js → common-CLVI2BhO.js} +1 -1
- package/dist/assets/{components-LekUV9ZS.js → components-CGwwQ0Y4.js} +1 -1
- package/dist/assets/{components-aYZA45OU.js → components-DiALLQRt.js} +1 -1
- package/dist/assets/{datasource-CyBbXtZn.js → datasource-BzTPyEw3.js} +1 -1
- package/dist/assets/{dependency-graph-panel-DGbAC2wK.js → dependency-graph-panel-Pxmnzmd4.js} +1 -1
- package/dist/assets/{documentation-panel-DsGADifT.js → documentation-panel-bgaPBvan.js} +1 -1
- package/dist/assets/{download-DTkyjpOn.js → download-QIfZjflb.js} +3 -3
- package/dist/assets/{edit-page-BMToXasi.js → edit-page-DB_go-vo.js} +7 -7
- package/dist/assets/{error-panel-Dr3Gx8dn.js → error-panel-DfHzC7q-.js} +1 -1
- package/dist/assets/{file-explorer-panel-BlD1M8JT.js → file-explorer-panel-CEd-m832.js} +1 -1
- package/dist/assets/{file-icons-o7IkTNGe.js → file-icons-ma7AC7Pi.js} +1 -1
- package/dist/assets/{floating-outline-C909H_YX.js → floating-outline-BluCz3vD.js} +1 -1
- package/dist/assets/{focus-dWZzpWQY.js → focus-BHXzPxK_.js} +1 -1
- package/dist/assets/{form-DpsQrY6E.js → form-C0W8wa3f.js} +1 -1
- package/dist/assets/{home-page-DmhU29Tb.js → home-page-nNrKA7jH.js} +2 -2
- package/dist/assets/{hooks-DkX8jVh3.js → hooks-C7qnb_ft.js} +1 -1
- package/dist/assets/{html-to-image-D7HTzVpq.js → html-to-image-B3VySJ1_.js} +1 -1
- package/dist/assets/{index-CkHHkVRJ.js → index-CLnKZIHZ.js} +8 -8
- package/dist/assets/{kiosk-mode-DhOLDPtI.js → kiosk-mode-BSY8y4kL.js} +1 -1
- package/dist/assets/{layout-cuzIQLaL.js → layout-V4eTNc4M.js} +3 -3
- package/dist/assets/{logs-panel-BDI22Bg1.js → logs-panel-B1AysC8S.js} +1 -1
- package/dist/assets/{markdown-renderer-BZbDk9sR.js → markdown-renderer-BiKTlki_.js} +1 -1
- package/dist/assets/{name-cell-input-B7FUJFyu.js → name-cell-input-BA5B0KJl.js} +1 -1
- package/dist/assets/{outline-panel-3lmrl2Fg.js → outline-panel-BfGPA_Sj.js} +1 -1
- package/dist/assets/{packages-panel-DdltAsdg.js → packages-panel-BgoT3rrV.js} +1 -1
- package/dist/assets/{panels-DPzM5So3.js → panels-BeW4RaML.js} +1 -1
- package/dist/assets/{process-output-CcHC5NZ0.js → process-output-MnxG8jwi.js} +1 -1
- package/dist/assets/{readonly-python-code-DWMBT9zQ.js → readonly-python-code-DuH_nOq_.js} +1 -1
- package/dist/assets/{run-page-Dzl9kS_J.js → run-page-kI3bwb2R.js} +1 -1
- package/dist/assets/{scratchpad-panel-CjnaWoGp.js → scratchpad-panel-617FvSKA.js} +1 -1
- package/dist/assets/{session-panel-Dw-GWx5V.js → session-panel-D6Sf5vhq.js} +1 -1
- package/dist/assets/{snippets-panel-DRwUTDoY.js → snippets-panel-DfWq0wh2.js} +1 -1
- package/dist/assets/{state-CzWkjLHG.js → state-Blw6taKi.js} +1 -1
- package/dist/assets/{state-DApwajb4.js → state-urfwd716.js} +2 -2
- package/dist/assets/{textarea-DIGEgQ8s.js → textarea-B5p9_myy.js} +1 -1
- package/dist/assets/{tracing-CMSXCvhu.js → tracing-CazNvlp4.js} +1 -1
- package/dist/assets/{tracing-panel-DiP-2OTH.js → tracing-panel-Bj0Bx8ZJ.js} +2 -2
- package/dist/assets/{useAddCell-XF-o2X0j.js → useAddCell-g3zSMJKs.js} +1 -1
- package/dist/assets/{useCellActionButton-DYYmbrbT.js → useCellActionButton-DdsVswP2.js} +1 -1
- package/dist/assets/{useDeleteCell-CNghagGT.js → useDeleteCell-CIdiI4Pk.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BSKsctbO.js → useDependencyPanelTab-DhXqfAqL.js} +1 -1
- package/dist/assets/{useNotebookActions-D-hCErEn.js → useNotebookActions-ULfiGMMl.js} +1 -1
- package/dist/assets/{useRunCells-BDQ0C7Ll.js → useRunCells-q5CA-QoL.js} +1 -1
- package/dist/assets/{useSplitCell-Ltfa9I0L.js → useSplitCell-B0jDwUEM.js} +1 -1
- package/dist/index.html +22 -22
- package/package.json +1 -1
- package/src/core/saving/file-state.ts +16 -0
- package/src/mount.tsx +17 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as q}from"./chunk-LvLJmgfZ.js";import{d as Z,p as ee,u as F}from"./useEvent-D91BmmQi.js";import{t as te}from"./react-Bj1aDYRI.js";import{K as L,j as re,pr as le,yr as se}from"./cells-CFrQXbte.js";import"./react-dom-CSu739Rf.js";import{t as ae}from"./compiler-runtime-B3qBwwSJ.js";import{t as ie}from"./cn-DYvqRARy.js";import{t as ne}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-k58KVlT-.js";import{t as A}from"./tooltip-DmqhBBs6.js";import"./dist-VwkX7yeV.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{t as oe}from"./createLucideIcon-w-Qo9n0R.js";import{n as de,r as U}from"./CellStatus-BMEZcX6D.js";import{r as ce}from"./x-Bv2rCglF.js";import{t as me}from"./chevron-right-CgvDWFE3.js";import{t as pe}from"./circle-check-DlWaawuO.js";import{t as ue}from"./circle-play-Ddna5GuC.js";import"./dist-BvlMLwcr.js";import"./dist-4lB-oR9j.js";import"./dist-CxquLoAZ.js";import"./dist-Dnlw22ji.js";import"./dist-CgYlATe-.js";import"./session-DdnWW30b.js";import{r as he}from"./useTheme-DCDmxPD0.js";import"./purify.es-BFDc-_i_.js";import"./vega-loader.browser-DXARUlxo.js";import{r as fe,t as xe}from"./react-vega-BVBnH7ue.js";import"./defaultLocale-JieDVWC_.js";import"./defaultLocale-BLne0bXb.js";import{t as ve}from"./cell-link-BITFYvIs.js";import{n as ge,r as je,t as K}from"./react-resizable-panels.browser.esm-BUNcfKXO.js";import{t as ye}from"./bundle.esm-BIoPrMH_.js";import{t as Ie}from"./empty-state-BbLVXQU7.js";import"./multi-icon-CGRsWmew.js";import{r as Se}from"./panel-context-aIZ10ULn.js";import{t as be}from"./clear-button-DpuufuDm.js";import{n as Ne,t as we}from"./runs-Qc-nusQ0.js";var ke=oe("circle-ellipsis",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]),H=ae(),C=q(te(),1);const V="hoveredCellId",Y="cellHover";var Re="cellNum",G="cell",O="startTimestamp",J="endTimestamp",Q="status";function Te(t,e,r,a){let i="hoursminutessecondsmilliseconds";return{$schema:"https://vega.github.io/schema/vega-lite/v6.json",background:a==="dark"?"black":void 0,mark:{type:"bar",cornerRadius:2},params:[{name:V,bind:{element:`#${e}`}},{name:Y,select:{type:"point",on:"mouseover",fields:[G],clear:"mouseout"}}],height:{step:r==="sideBySide"?26:21},encoding:{y:{field:Re,scale:{paddingInner:.2},sort:{field:"sortPriority"},title:"cell",axis:r==="sideBySide"?null:void 0},x:{field:O,type:"temporal",axis:{orient:"top",title:null}},x2:{field:J,type:"temporal"},tooltip:[{field:O,type:"temporal",timeUnit:i,title:"Start"},{field:J,type:"temporal",timeUnit:i,title:"End"}],size:{value:{expr:`${V} == toString(datum.${G}) ? 19.5 : 18`}},color:{field:Q,scale:{domain:["success","error"],range:["#37BE5F","red"]},legend:null}},data:{values:t},transform:[{calculate:`datum.${Q} === 'queued' ? 9999999999999 : datum.${O}`,as:"sortPriority"}],config:{view:{stroke:"transparent"}}}}function W(t){try{let e=new Date(t*1e3);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}.${String(e.getMilliseconds()).padStart(3,"0")}`}catch{return""}}var l=q(ne(),1),X=ee(new Map);const Ee=()=>{let t=(0,H.c)(34),{runIds:e,runMap:r}=F(we),a=F(X),{clearRuns:i}=Ne(),{theme:n}=he(),[s,k]=(0,C.useState)("above"),N=Se(),c;t[0]===s?c=t[1]:(c=()=>{k(s==="above"?"sideBySide":"above")},t[0]=s,t[1]=c);let m=c;if(e.length===0){let p;return t[2]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(Ie,{title:"No traces",description:(0,l.jsx)("span",{children:"Cells that have ran will appear here."}),icon:(0,l.jsx)(se,{})}),t[2]=p):p=t[2],p}let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsx)("label",{htmlFor:"chartPosition",className:"text-xs",children:"Inline chart"}),t[3]=u):u=t[3];let y=s==="sideBySide",o;t[4]!==y||t[5]!==m?(o=(0,l.jsxs)("div",{className:"flex flex-row gap-1 items-center",children:[u,(0,l.jsx)("input",{type:"checkbox",name:"chartPosition","data-testid":"chartPosition",onClick:m,defaultChecked:y,className:"h-3 cursor-pointer"})]}),t[4]=y,t[5]=m,t[6]=o):o=t[6];let h;t[7]===i?h=t[8]:(h=(0,l.jsx)(be,{dataTestId:"clear-traces-button",onClick:i}),t[7]=i,t[8]=h);let v;t[9]!==o||t[10]!==h?(v=(0,l.jsxs)("div",{className:"flex flex-row justify-start gap-3",children:[o,h]}),t[9]=o,t[10]=h,t[11]=v):v=t[11];let g;if(t[12]!==s||t[13]!==a||t[14]!==e||t[15]!==r||t[16]!==n){let p;t[18]!==s||t[19]!==a||t[20]!==r||t[21]!==n?(p=(E,P)=>{let T=r.get(E);return T?(0,l.jsx)(_e,{run:T,isExpanded:a.get(T.runId),isMostRecentRun:P===0,chartPosition:s,theme:n},T.runId):null},t[18]=s,t[19]=a,t[20]=r,t[21]=n,t[22]=p):p=t[22],g=e.map(p),t[12]=s,t[13]=a,t[14]=e,t[15]=r,t[16]=n,t[17]=g}else g=t[17];let j;t[23]===g?j=t[24]:(j=(0,l.jsx)("div",{className:"flex flex-col gap-3",children:g}),t[23]=g,t[24]=j);let w;t[25]!==v||t[26]!==j?(w=(0,l.jsxs)("div",{className:"py-1 px-2 overflow-y-scroll h-full",children:[v,j]}),t[25]=v,t[26]=j,t[27]=w):w=t[27];let f=w;if(N==="sidebar")return f;let x;t[28]===f?x=t[29]:(x=(0,l.jsx)(K,{defaultSize:50,minSize:30,maxSize:80,children:f}),t[28]=f,t[29]=x);let d;t[30]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(je,{className:"w-1 bg-border hover:bg-primary/50 transition-colors"}),t[30]=d):d=t[30];let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(K,{defaultSize:50,children:(0,l.jsx)("div",{})}),t[31]=I):I=t[31];let S;return t[32]===x?S=t[33]:(S=(0,l.jsxs)(ge,{direction:"horizontal",className:"h-full",children:[x,d,I]}),t[32]=x,t[33]=S),S};var _e=({run:t,isMostRecentRun:e,chartPosition:r,isExpanded:a,theme:i})=>{let n=Z(X);a??(a=e);let s=()=>{n(c=>{let m=new Map(c);return m.set(t.runId,!a),m})},k=(0,l.jsx)(a?ce:me,{height:16,className:"inline"}),N=(0,l.jsxs)("span",{className:"text-sm cursor-pointer",onClick:s,children:["Run - ",L(t.runStartTime),k]});return a?(0,l.jsx)(Me,{run:t,chartPosition:r,theme:i,title:N},t.runId):(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsx)("pre",{className:"font-mono font-semibold",children:N})},t.runId)},Me=t=>{let e=(0,H.c)(40),{run:r,chartPosition:a,theme:i,title:n}=t,[s,k]=(0,C.useState)(),N=(0,C.useRef)(null),{ref:c,width:m}=ye(),u=m===void 0?300:m,y=re(),o,h;if(e[0]!==y||e[1]!==a||e[2]!==r.cellRuns||e[3]!==r.runId||e[4]!==i){let R=[...r.cellRuns.values()].map(b=>{let _=b.elapsedTime??0;return{cell:b.cellId,cellNum:y.inOrderIds.indexOf(b.cellId),startTimestamp:W(b.startTime),endTimestamp:W(b.startTime+_),elapsedTime:U(_*1e3),status:b.status}});o=`hiddenInputElement-${r.runId}`,h=fe(Te(R,o,a,i)),e[0]=y,e[1]=a,e[2]=r.cellRuns,e[3]=r.runId,e[4]=i,e[5]=o,e[6]=h}else o=e[5],h=e[6];let v=h.spec,g=i==="dark"?"dark":void 0,j=u-50,w=a==="above"?120:100,f;e[7]!==g||e[8]!==j||e[9]!==w?(f={theme:g,width:j,height:w,actions:!1,mode:"vega",renderer:"canvas"},e[7]=g,e[8]=j,e[9]=w,e[10]=f):f=e[10];let x;e[11]!==f||e[12]!==v?(x={ref:N,spec:v,options:f},e[11]=f,e[12]=v,e[13]=x):x=e[13];let d=xe(x),I;e[14]===(d==null?void 0:d.view)?I=e[15]:(I=()=>{let R=[{signalName:Y,handler:(b,_)=>{var z;k(((z=_.cell)==null?void 0:z[0])??void 0??null)}}];return R.forEach(b=>{let{signalName:_,handler:z}=b;d==null||d.view.addSignalListener(_,z)}),()=>{R.forEach(b=>{let{signalName:_,handler:z}=b;d==null||d.view.removeSignalListener(_,z)})}},e[14]=d==null?void 0:d.view,e[15]=I);let S;e[16]===d?S=e[17]:(S=[d],e[16]=d,e[17]=S),(0,C.useEffect)(I,S);let p;e[18]!==o||e[19]!==s||e[20]!==r?(p=(0,l.jsx)($e,{run:r,hoveredCellId:s,hiddenInputElementId:o}),e[18]=o,e[19]=s,e[20]=r,e[21]=p):p=e[21];let E=p,P=a==="sideBySide"?"-mt-0.5 flex-1":"",T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=(0,l.jsx)(C.Suspense,{children:(0,l.jsx)("div",{ref:N})}),e[22]=T):T=e[22];let B;e[23]!==c||e[24]!==P?(B=(0,l.jsx)("div",{className:P,ref:c,children:T}),e[23]=c,e[24]=P,e[25]=B):B=e[25];let M=B;if(a==="above"){let R;e[26]!==M||e[27]!==n||e[28]!==E?(R=(0,l.jsxs)("pre",{className:"font-mono font-semibold",children:[n,M,E]}),e[26]=M,e[27]=n,e[28]=E,e[29]=R):R=e[29];let b;return e[30]!==r.runId||e[31]!==R?(b=(0,l.jsx)("div",{className:"flex flex-col",children:R},r.runId),e[30]=r.runId,e[31]=R,e[32]=b):b=e[32],b}let $;e[33]!==n||e[34]!==E?($=(0,l.jsxs)("pre",{className:"font-mono font-semibold",children:[n,E]}),e[33]=n,e[34]=E,e[35]=$):$=e[35];let D;return e[36]!==M||e[37]!==r.runId||e[38]!==$?(D=(0,l.jsxs)("div",{className:"flex flex-row",children:[$,M]},r.runId),e[36]=M,e[37]=r.runId,e[38]=$,e[39]=D):D=e[39],D},$e=t=>{let e=(0,H.c)(12),{run:r,hoveredCellId:a,hiddenInputElementId:i}=t,n=(0,C.useRef)(null),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o=>{n.current&&(n.current.value=String(o),n.current.dispatchEvent(new Event("input",{bubbles:!0})))},e[0]=s):s=e[0];let k=s,N=a||"",c;e[1]!==i||e[2]!==N?(c=(0,l.jsx)("input",{type:"text",id:i,defaultValue:N,hidden:!0,ref:n}),e[1]=i,e[2]=N,e[3]=c):c=e[3];let m;e[4]===r.cellRuns?m=e[5]:(m=[...r.cellRuns.values()],e[4]=r.cellRuns,e[5]=m);let u;e[6]!==a||e[7]!==m?(u=m.map(o=>(0,l.jsx)(Ce,{cellRun:o,hovered:o.cellId===a,dispatchHoverEvent:k},o.cellId)),e[6]=a,e[7]=m,e[8]=u):u=e[8];let y;return e[9]!==c||e[10]!==u?(y=(0,l.jsxs)("div",{className:"text-xs mt-0.5 ml-3 flex flex-col gap-0.5",children:[c,u]}),e[9]=c,e[10]=u,e[11]=y):y=e[11],y},ze={success:(0,l.jsx)(pe,{color:"green",size:14}),running:(0,l.jsx)(ue,{color:"var(--blue-10)",size:14}),error:(0,l.jsx)(le,{color:"red",size:14}),queued:(0,l.jsx)(ke,{color:"grey",size:14})},Ce=t=>{let e=(0,H.c)(39),{cellRun:r,hovered:a,dispatchHoverEvent:i}=t,n;e[0]===r.elapsedTime?n=e[1]:(n=r.elapsedTime?U(r.elapsedTime*1e3):"-",e[0]=r.elapsedTime,e[1]=n);let s=n,k;e[2]!==r.elapsedTime||e[3]!==s?(k=r.elapsedTime?(0,l.jsxs)("span",{children:["This cell took ",(0,l.jsx)(de,{elapsedTime:s})," to run"]}):(0,l.jsx)("span",{children:"This cell has not been run"}),e[2]=r.elapsedTime,e[3]=s,e[4]=k):k=e[4];let N=k,c;e[5]!==r.cellId||e[6]!==i?(c=()=>{i(r.cellId)},e[5]=r.cellId,e[6]=i,e[7]=c):c=e[7];let m=c,u;e[8]===i?u=e[9]:(u=()=>{i(null)},e[8]=i,e[9]=u);let y=u,o=a&&"bg-(--gray-3) opacity-100",h;e[10]===o?h=e[11]:(h=ie("flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100",o),e[10]=o,e[11]=h);let v;e[12]===r.startTime?v=e[13]:(v=L(r.startTime),e[12]=r.startTime,e[13]=v);let g;e[14]===v?g=e[15]:(g=(0,l.jsxs)("span",{className:"text-(--gray-10) dark:text-(--gray-11)",children:["[",v,"]"]}),e[14]=v,e[15]=g);let j;e[16]===r.cellId?j=e[17]:(j=(0,l.jsxs)("span",{className:"text-(--gray-10) w-16 overflow-hidden",children:["(",(0,l.jsx)(ve,{cellId:r.cellId}),")"]}),e[16]=r.cellId,e[17]=j);let w;e[18]===r.code?w=e[19]:(w=(0,l.jsx)("span",{className:"w-40 truncate -ml-1",children:r.code}),e[18]=r.code,e[19]=w);let f;e[20]===s?f=e[21]:(f=(0,l.jsx)("span",{className:"text-(--gray-10) dark:text-(--gray-11)",children:s}),e[20]=s,e[21]=f);let x;e[22]!==N||e[23]!==f?(x=(0,l.jsx)(A,{content:N,children:f}),e[22]=N,e[23]=f,e[24]=x):x=e[24];let d=ze[r.status],I;e[25]!==r.status||e[26]!==d?(I=(0,l.jsx)(A,{content:r.status,children:d}),e[25]=r.status,e[26]=d,e[27]=I):I=e[27];let S;e[28]!==x||e[29]!==I?(S=(0,l.jsxs)("div",{className:"flex flex-row gap-1 w-16 justify-end -ml-2",children:[x,I]}),e[28]=x,e[29]=I,e[30]=S):S=e[30];let p;return e[31]!==m||e[32]!==y||e[33]!==w||e[34]!==S||e[35]!==h||e[36]!==g||e[37]!==j?(p=(0,l.jsxs)("div",{className:h,onMouseEnter:m,onMouseLeave:y,children:[g,j,w,S]}),e[31]=m,e[32]=y,e[33]=w,e[34]=S,e[35]=h,e[36]=g,e[37]=j,e[38]=p):p=e[38],p};export{Ee as Tracing};
|
|
1
|
+
import{s as q}from"./chunk-LvLJmgfZ.js";import{d as Z,p as ee,u as F}from"./useEvent-D91BmmQi.js";import{t as te}from"./react-Bj1aDYRI.js";import{K as L,j as re,pr as le,yr as se}from"./cells-BVG4a-Qn.js";import"./react-dom-CSu739Rf.js";import{t as ae}from"./compiler-runtime-B3qBwwSJ.js";import{t as ie}from"./cn-DYvqRARy.js";import{t as ne}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-k58KVlT-.js";import{t as A}from"./tooltip-DmqhBBs6.js";import"./dist-VwkX7yeV.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{t as oe}from"./createLucideIcon-w-Qo9n0R.js";import{n as de,r as U}from"./CellStatus-CP1jrQ3A.js";import{r as ce}from"./x-Bv2rCglF.js";import{t as me}from"./chevron-right-CgvDWFE3.js";import{t as pe}from"./circle-check-DlWaawuO.js";import{t as ue}from"./circle-play-Ddna5GuC.js";import"./dist-BvlMLwcr.js";import"./dist-4lB-oR9j.js";import"./dist-CxquLoAZ.js";import"./dist-Dnlw22ji.js";import"./dist-CgYlATe-.js";import"./session-DdnWW30b.js";import{r as he}from"./useTheme-DCDmxPD0.js";import"./purify.es-BFDc-_i_.js";import"./vega-loader.browser-DXARUlxo.js";import{r as fe,t as xe}from"./react-vega-BVBnH7ue.js";import"./defaultLocale-JieDVWC_.js";import"./defaultLocale-BLne0bXb.js";import{t as ve}from"./cell-link-Dtonmtv_.js";import{n as ge,r as je,t as K}from"./react-resizable-panels.browser.esm-BUNcfKXO.js";import{t as ye}from"./bundle.esm-BIoPrMH_.js";import{t as Ie}from"./empty-state-BbLVXQU7.js";import"./multi-icon-CGRsWmew.js";import{r as Se}from"./panel-context-aIZ10ULn.js";import{t as be}from"./clear-button-DpuufuDm.js";import{n as Ne,t as we}from"./runs-Qc-nusQ0.js";var ke=oe("circle-ellipsis",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]),H=ae(),C=q(te(),1);const V="hoveredCellId",Y="cellHover";var Re="cellNum",G="cell",O="startTimestamp",J="endTimestamp",Q="status";function Te(t,e,r,a){let i="hoursminutessecondsmilliseconds";return{$schema:"https://vega.github.io/schema/vega-lite/v6.json",background:a==="dark"?"black":void 0,mark:{type:"bar",cornerRadius:2},params:[{name:V,bind:{element:`#${e}`}},{name:Y,select:{type:"point",on:"mouseover",fields:[G],clear:"mouseout"}}],height:{step:r==="sideBySide"?26:21},encoding:{y:{field:Re,scale:{paddingInner:.2},sort:{field:"sortPriority"},title:"cell",axis:r==="sideBySide"?null:void 0},x:{field:O,type:"temporal",axis:{orient:"top",title:null}},x2:{field:J,type:"temporal"},tooltip:[{field:O,type:"temporal",timeUnit:i,title:"Start"},{field:J,type:"temporal",timeUnit:i,title:"End"}],size:{value:{expr:`${V} == toString(datum.${G}) ? 19.5 : 18`}},color:{field:Q,scale:{domain:["success","error"],range:["#37BE5F","red"]},legend:null}},data:{values:t},transform:[{calculate:`datum.${Q} === 'queued' ? 9999999999999 : datum.${O}`,as:"sortPriority"}],config:{view:{stroke:"transparent"}}}}function W(t){try{let e=new Date(t*1e3);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}.${String(e.getMilliseconds()).padStart(3,"0")}`}catch{return""}}var l=q(ne(),1),X=ee(new Map);const Ee=()=>{let t=(0,H.c)(34),{runIds:e,runMap:r}=F(we),a=F(X),{clearRuns:i}=Ne(),{theme:n}=he(),[s,k]=(0,C.useState)("above"),N=Se(),c;t[0]===s?c=t[1]:(c=()=>{k(s==="above"?"sideBySide":"above")},t[0]=s,t[1]=c);let m=c;if(e.length===0){let p;return t[2]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.jsx)(Ie,{title:"No traces",description:(0,l.jsx)("span",{children:"Cells that have ran will appear here."}),icon:(0,l.jsx)(se,{})}),t[2]=p):p=t[2],p}let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsx)("label",{htmlFor:"chartPosition",className:"text-xs",children:"Inline chart"}),t[3]=u):u=t[3];let y=s==="sideBySide",o;t[4]!==y||t[5]!==m?(o=(0,l.jsxs)("div",{className:"flex flex-row gap-1 items-center",children:[u,(0,l.jsx)("input",{type:"checkbox",name:"chartPosition","data-testid":"chartPosition",onClick:m,defaultChecked:y,className:"h-3 cursor-pointer"})]}),t[4]=y,t[5]=m,t[6]=o):o=t[6];let h;t[7]===i?h=t[8]:(h=(0,l.jsx)(be,{dataTestId:"clear-traces-button",onClick:i}),t[7]=i,t[8]=h);let v;t[9]!==o||t[10]!==h?(v=(0,l.jsxs)("div",{className:"flex flex-row justify-start gap-3",children:[o,h]}),t[9]=o,t[10]=h,t[11]=v):v=t[11];let g;if(t[12]!==s||t[13]!==a||t[14]!==e||t[15]!==r||t[16]!==n){let p;t[18]!==s||t[19]!==a||t[20]!==r||t[21]!==n?(p=(E,P)=>{let T=r.get(E);return T?(0,l.jsx)(_e,{run:T,isExpanded:a.get(T.runId),isMostRecentRun:P===0,chartPosition:s,theme:n},T.runId):null},t[18]=s,t[19]=a,t[20]=r,t[21]=n,t[22]=p):p=t[22],g=e.map(p),t[12]=s,t[13]=a,t[14]=e,t[15]=r,t[16]=n,t[17]=g}else g=t[17];let j;t[23]===g?j=t[24]:(j=(0,l.jsx)("div",{className:"flex flex-col gap-3",children:g}),t[23]=g,t[24]=j);let w;t[25]!==v||t[26]!==j?(w=(0,l.jsxs)("div",{className:"py-1 px-2 overflow-y-scroll h-full",children:[v,j]}),t[25]=v,t[26]=j,t[27]=w):w=t[27];let f=w;if(N==="sidebar")return f;let x;t[28]===f?x=t[29]:(x=(0,l.jsx)(K,{defaultSize:50,minSize:30,maxSize:80,children:f}),t[28]=f,t[29]=x);let d;t[30]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(je,{className:"w-1 bg-border hover:bg-primary/50 transition-colors"}),t[30]=d):d=t[30];let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(K,{defaultSize:50,children:(0,l.jsx)("div",{})}),t[31]=I):I=t[31];let S;return t[32]===x?S=t[33]:(S=(0,l.jsxs)(ge,{direction:"horizontal",className:"h-full",children:[x,d,I]}),t[32]=x,t[33]=S),S};var _e=({run:t,isMostRecentRun:e,chartPosition:r,isExpanded:a,theme:i})=>{let n=Z(X);a??(a=e);let s=()=>{n(c=>{let m=new Map(c);return m.set(t.runId,!a),m})},k=(0,l.jsx)(a?ce:me,{height:16,className:"inline"}),N=(0,l.jsxs)("span",{className:"text-sm cursor-pointer",onClick:s,children:["Run - ",L(t.runStartTime),k]});return a?(0,l.jsx)(Me,{run:t,chartPosition:r,theme:i,title:N},t.runId):(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsx)("pre",{className:"font-mono font-semibold",children:N})},t.runId)},Me=t=>{let e=(0,H.c)(40),{run:r,chartPosition:a,theme:i,title:n}=t,[s,k]=(0,C.useState)(),N=(0,C.useRef)(null),{ref:c,width:m}=ye(),u=m===void 0?300:m,y=re(),o,h;if(e[0]!==y||e[1]!==a||e[2]!==r.cellRuns||e[3]!==r.runId||e[4]!==i){let R=[...r.cellRuns.values()].map(b=>{let _=b.elapsedTime??0;return{cell:b.cellId,cellNum:y.inOrderIds.indexOf(b.cellId),startTimestamp:W(b.startTime),endTimestamp:W(b.startTime+_),elapsedTime:U(_*1e3),status:b.status}});o=`hiddenInputElement-${r.runId}`,h=fe(Te(R,o,a,i)),e[0]=y,e[1]=a,e[2]=r.cellRuns,e[3]=r.runId,e[4]=i,e[5]=o,e[6]=h}else o=e[5],h=e[6];let v=h.spec,g=i==="dark"?"dark":void 0,j=u-50,w=a==="above"?120:100,f;e[7]!==g||e[8]!==j||e[9]!==w?(f={theme:g,width:j,height:w,actions:!1,mode:"vega",renderer:"canvas"},e[7]=g,e[8]=j,e[9]=w,e[10]=f):f=e[10];let x;e[11]!==f||e[12]!==v?(x={ref:N,spec:v,options:f},e[11]=f,e[12]=v,e[13]=x):x=e[13];let d=xe(x),I;e[14]===(d==null?void 0:d.view)?I=e[15]:(I=()=>{let R=[{signalName:Y,handler:(b,_)=>{var z;k(((z=_.cell)==null?void 0:z[0])??void 0??null)}}];return R.forEach(b=>{let{signalName:_,handler:z}=b;d==null||d.view.addSignalListener(_,z)}),()=>{R.forEach(b=>{let{signalName:_,handler:z}=b;d==null||d.view.removeSignalListener(_,z)})}},e[14]=d==null?void 0:d.view,e[15]=I);let S;e[16]===d?S=e[17]:(S=[d],e[16]=d,e[17]=S),(0,C.useEffect)(I,S);let p;e[18]!==o||e[19]!==s||e[20]!==r?(p=(0,l.jsx)($e,{run:r,hoveredCellId:s,hiddenInputElementId:o}),e[18]=o,e[19]=s,e[20]=r,e[21]=p):p=e[21];let E=p,P=a==="sideBySide"?"-mt-0.5 flex-1":"",T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=(0,l.jsx)(C.Suspense,{children:(0,l.jsx)("div",{ref:N})}),e[22]=T):T=e[22];let B;e[23]!==c||e[24]!==P?(B=(0,l.jsx)("div",{className:P,ref:c,children:T}),e[23]=c,e[24]=P,e[25]=B):B=e[25];let M=B;if(a==="above"){let R;e[26]!==M||e[27]!==n||e[28]!==E?(R=(0,l.jsxs)("pre",{className:"font-mono font-semibold",children:[n,M,E]}),e[26]=M,e[27]=n,e[28]=E,e[29]=R):R=e[29];let b;return e[30]!==r.runId||e[31]!==R?(b=(0,l.jsx)("div",{className:"flex flex-col",children:R},r.runId),e[30]=r.runId,e[31]=R,e[32]=b):b=e[32],b}let $;e[33]!==n||e[34]!==E?($=(0,l.jsxs)("pre",{className:"font-mono font-semibold",children:[n,E]}),e[33]=n,e[34]=E,e[35]=$):$=e[35];let D;return e[36]!==M||e[37]!==r.runId||e[38]!==$?(D=(0,l.jsxs)("div",{className:"flex flex-row",children:[$,M]},r.runId),e[36]=M,e[37]=r.runId,e[38]=$,e[39]=D):D=e[39],D},$e=t=>{let e=(0,H.c)(12),{run:r,hoveredCellId:a,hiddenInputElementId:i}=t,n=(0,C.useRef)(null),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o=>{n.current&&(n.current.value=String(o),n.current.dispatchEvent(new Event("input",{bubbles:!0})))},e[0]=s):s=e[0];let k=s,N=a||"",c;e[1]!==i||e[2]!==N?(c=(0,l.jsx)("input",{type:"text",id:i,defaultValue:N,hidden:!0,ref:n}),e[1]=i,e[2]=N,e[3]=c):c=e[3];let m;e[4]===r.cellRuns?m=e[5]:(m=[...r.cellRuns.values()],e[4]=r.cellRuns,e[5]=m);let u;e[6]!==a||e[7]!==m?(u=m.map(o=>(0,l.jsx)(Ce,{cellRun:o,hovered:o.cellId===a,dispatchHoverEvent:k},o.cellId)),e[6]=a,e[7]=m,e[8]=u):u=e[8];let y;return e[9]!==c||e[10]!==u?(y=(0,l.jsxs)("div",{className:"text-xs mt-0.5 ml-3 flex flex-col gap-0.5",children:[c,u]}),e[9]=c,e[10]=u,e[11]=y):y=e[11],y},ze={success:(0,l.jsx)(pe,{color:"green",size:14}),running:(0,l.jsx)(ue,{color:"var(--blue-10)",size:14}),error:(0,l.jsx)(le,{color:"red",size:14}),queued:(0,l.jsx)(ke,{color:"grey",size:14})},Ce=t=>{let e=(0,H.c)(39),{cellRun:r,hovered:a,dispatchHoverEvent:i}=t,n;e[0]===r.elapsedTime?n=e[1]:(n=r.elapsedTime?U(r.elapsedTime*1e3):"-",e[0]=r.elapsedTime,e[1]=n);let s=n,k;e[2]!==r.elapsedTime||e[3]!==s?(k=r.elapsedTime?(0,l.jsxs)("span",{children:["This cell took ",(0,l.jsx)(de,{elapsedTime:s})," to run"]}):(0,l.jsx)("span",{children:"This cell has not been run"}),e[2]=r.elapsedTime,e[3]=s,e[4]=k):k=e[4];let N=k,c;e[5]!==r.cellId||e[6]!==i?(c=()=>{i(r.cellId)},e[5]=r.cellId,e[6]=i,e[7]=c):c=e[7];let m=c,u;e[8]===i?u=e[9]:(u=()=>{i(null)},e[8]=i,e[9]=u);let y=u,o=a&&"bg-(--gray-3) opacity-100",h;e[10]===o?h=e[11]:(h=ie("flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100",o),e[10]=o,e[11]=h);let v;e[12]===r.startTime?v=e[13]:(v=L(r.startTime),e[12]=r.startTime,e[13]=v);let g;e[14]===v?g=e[15]:(g=(0,l.jsxs)("span",{className:"text-(--gray-10) dark:text-(--gray-11)",children:["[",v,"]"]}),e[14]=v,e[15]=g);let j;e[16]===r.cellId?j=e[17]:(j=(0,l.jsxs)("span",{className:"text-(--gray-10) w-16 overflow-hidden",children:["(",(0,l.jsx)(ve,{cellId:r.cellId}),")"]}),e[16]=r.cellId,e[17]=j);let w;e[18]===r.code?w=e[19]:(w=(0,l.jsx)("span",{className:"w-40 truncate -ml-1",children:r.code}),e[18]=r.code,e[19]=w);let f;e[20]===s?f=e[21]:(f=(0,l.jsx)("span",{className:"text-(--gray-10) dark:text-(--gray-11)",children:s}),e[20]=s,e[21]=f);let x;e[22]!==N||e[23]!==f?(x=(0,l.jsx)(A,{content:N,children:f}),e[22]=N,e[23]=f,e[24]=x):x=e[24];let d=ze[r.status],I;e[25]!==r.status||e[26]!==d?(I=(0,l.jsx)(A,{content:r.status,children:d}),e[25]=r.status,e[26]=d,e[27]=I):I=e[27];let S;e[28]!==x||e[29]!==I?(S=(0,l.jsxs)("div",{className:"flex flex-row gap-1 w-16 justify-end -ml-2",children:[x,I]}),e[28]=x,e[29]=I,e[30]=S):S=e[30];let p;return e[31]!==m||e[32]!==y||e[33]!==w||e[34]!==S||e[35]!==h||e[36]!==g||e[37]!==j?(p=(0,l.jsxs)("div",{className:h,onMouseEnter:m,onMouseLeave:y,children:[g,j,w,S]}),e[31]=m,e[32]=y,e[33]=w,e[34]=S,e[35]=h,e[36]=g,e[37]=j,e[38]=p):p=e[38],p};export{Ee as Tracing};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
|
2
|
-
import{s as m}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as n}from"./compiler-runtime-B3qBwwSJ.js";import{t as f}from"./jsx-runtime-Blw4afVn.js";import{t as _}from"./spinner-C5wIpWgQ.js";import{t as p}from"./preload-helper-D2MJg03u.js";let c,u=(async()=>{let a,l,r,o,s;a=n(),l=m(i(),1),r=m(f(),1),o=l.lazy(()=>p(()=>import("./tracing-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-CazNvlp4.js","./clear-button-DpuufuDm.js","./cn-DYvqRARy.js","./clsx-XrBBnd7s.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-Blw4afVn.js","./cells-BVG4a-Qn.js","./preload-helper-D2MJg03u.js","./badge-CwbVR_sO.js","./button-BKVLeSTX.js","./useEventListener-DGjKht0c.js","./fullscreen-k58KVlT-.js","./react-dom-CSu739Rf.js","./menu-items-Dtw5N98_.js","./select--zcABebs.js","./dist-sZgjGm4S.js","./check-B-sKate2.js","./createLucideIcon-w-Qo9n0R.js","./x-Bv2rCglF.js","./tooltip-DmqhBBs6.js","./use-toast-BDYuj3zG.js","./utils-8btzWeZg.js","./useEvent-D91BmmQi.js","./invariant-CkiqGLcK.js","./merge-BOaDhCTH.js","./isArrayLikeObject-ODovYgPQ.js","./isObject-DvLSfCY5.js","./zod-H_cgTO0M.js","./DeferredRequestRegistry-BLWK1eKa.js","./Deferred-DxQeE5uh.js","./uuid-DXdzqzcr.js","./config-Cgj0Ahvb.js","./constants-tOPFFcLZ.js","./session-DdnWW30b.js","./requests-9-v2bhoi.js","./useLifecycle-N3bfh_O1.js","./useNonce-CbdaHKzX.js","./useTheme-DCDmxPD0.js","./arrays-DAC2orgH.js","./strings-pfr2N700.js","./capabilities-BmGdj50E.js","./once-hq2TLzOp.js","./createReducer-CYlwteGD.js","./paths-BzSgteR-.js","./dist-BNTOYRCs.js","./dist-VwkX7yeV.js","./dist-DZJfxwLb.js","./dist-BvlMLwcr.js","./dist-4lB-oR9j.js","./dist-CxquLoAZ.js","./dist-Dnlw22ji.js","./dist-CgYlATe-.js","./dist-BPkOpnKv.js","./stex-jWatZkll.js","./toDate-BGIVWsZ9.js","./purify.es-BFDc-_i_.js","./cjs-D5tzp-Y6.js","./debounce-BbSyBDA8.js","./toNumber-BvwE1TMv.js","./isSymbol-BT6B8Bon.js","./now-DNX1lT2d.js","./database-zap-BxfYZ6ML.js","./main-BNL5rxQw.js","./cells-jmgGt1lS.css","./CellStatus-CP1jrQ3A.js","./multi-icon-CGRsWmew.js","./multi-icon-pwGWVz3d.css","./useDateFormatter-BEz9SEXo.js","./context-DGqo1TbK.js","./SSRProvider-D3zWcDme.js","./en-US-JRtp5zfw.js","./ellipsis-DidENKDy.js","./refresh-cw-CiOe0azG.js","./workflow-BAgKBPlq.js","./CellStatus-2Psjnl5F.css","./empty-state-BbLVXQU7.js","./panel-context-aIZ10ULn.js","./cell-link-Dtonmtv_.js","./ImperativeModal-DoGv2BXV.js","./alert-dialog-CXspBRlP.js","./dialog-BYjetQgE.js","./input-Bg12i6qY.js","./useDebounce-LVL1r3-M.js","./numbers--nDjbAPa.js","./useNumberFormatter-wQU1z0W_.js","./usePress-BXMIcLWP.js","./runs-Qc-nusQ0.js","./react-vega-BVBnH7ue.js","./precisionRound-CU2C3Vxx.js","./defaultLocale-JieDVWC_.js","./linear-BICTUQLW.js","./timer-DBQ_H0G1.js","./init-AtRnKt23.js","./time-DLcLlk0u.js","./defaultLocale-BLne0bXb.js","./range-1DwpgXvM.js","./vega-loader.browser-DXARUlxo.js","./treemap-DqSsE4KM.js","./path-BMloFSsK.js","./colors-C3_wIR8c.js","./ordinal-DuTuuUgV.js","./arc-3DY1fURi.js","./math-BIeW4iGV.js","./array-BF0shS9G.js","./step-COhf-b0R.js","./line-BCZzhM6G.js","./chevron-right-CgvDWFE3.js","./circle-check-DlWaawuO.js","./circle-play-Ddna5GuC.js","./react-resizable-panels.browser.esm-BUNcfKXO.js","./bundle.esm-BIoPrMH_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as m}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as n}from"./compiler-runtime-B3qBwwSJ.js";import{t as f}from"./jsx-runtime-Blw4afVn.js";import{t as _}from"./spinner-C5wIpWgQ.js";import{t as p}from"./preload-helper-D2MJg03u.js";let c,u=(async()=>{let a,l,r,o,s;a=n(),l=m(i(),1),r=m(f(),1),o=l.lazy(()=>p(()=>import("./tracing-CazNvlp4.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112]),import.meta.url).then(t=>({default:t.Tracing}))),c=()=>{let t=(0,a.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(s,{}),children:(0,r.jsx)(o,{})}),t[0]=e):e=t[0],e},s=()=>{let t=(0,a.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-full",children:(0,r.jsx)(_,{})}),t[0]=e):e=t[0],e}})();export{u as __tla,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as l}from"./useEvent-D91BmmQi.js";import{E as s}from"./cells-
|
|
1
|
+
import{u as l}from"./useEvent-D91BmmQi.js";import{E as s}from"./cells-BVG4a-Qn.js";import{t as i}from"./compiler-runtime-B3qBwwSJ.js";import{o as n}from"./utils-8btzWeZg.js";import{n as f}from"./html-to-image-B3VySJ1_.js";import{o as c}from"./focus-BHXzPxK_.js";var p=i();function u(){let o=(0,p.c)(4),a=l(n),r=c(),{createNewCell:t}=s(),e;return o[0]!==a||o[1]!==t||o[2]!==r?(e=m=>{m.includes("alt")&&f({autoInstantiate:a,createNewCell:t,fromCellId:r}),t({code:m,before:!1,cellId:r??"__end__"})},o[0]=a,o[1]=t,o[2]=r,o[3]=e):e=o[3],e}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-D91BmmQi.js";import{
|
|
1
|
+
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-D91BmmQi.js";import{Di as de,E as ne,Et as F,Gn as se,Ln as re,Rn as ce,dr as he,lr as me,ot as pe,pr as ke,ur as fe,v as ue}from"./cells-BVG4a-Qn.js";import{t as ye}from"./compiler-runtime-B3qBwwSJ.js";import{a as be,o as xe,r as je}from"./utils-8btzWeZg.js";import{t as ve}from"./jsx-runtime-Blw4afVn.js";import{t as Ce}from"./label-C89F4v17.js";import{a as we,h as ge}from"./download-QIfZjflb.js";import{r as Ie}from"./requests-9-v2bhoi.js";import{t as f}from"./createLucideIcon-w-Qo9n0R.js";import{n as G,r as Q}from"./x-Bv2rCglF.js";import{t as ze}from"./chevron-right-CgvDWFE3.js";import{t as V}from"./circle-plus-ifSmVHqa.js";import{t as We}from"./code-xml-DxxzgVgU.js";import{t as Me}from"./eye-off-DgRJ-xBZ.js";import{t as _e}from"./image-BgkzrnsX.js";import{t as Se}from"./link-dU_vDDSR.js";import{t as Ae}from"./play-BdC4C3dp.js";import{t as De}from"./sparkles-B79Qf6ma.js";import{t as Ee}from"./trash-2-DunI72kV.js";import{t as Re}from"./use-toast-BDYuj3zG.js";import{n as Te}from"./copy-Bizk-4hH.js";import{i as Le}from"./useRunCells-q5CA-QoL.js";import{a as Ne,c as qe,n as Be}from"./dialog-BYjetQgE.js";import{n as He}from"./ImperativeModal-DoGv2BXV.js";import{n as Oe}from"./state-Blw6taKi.js";import{r as K}from"./html-to-image-B3VySJ1_.js";import{n as Pe,t as Ue}from"./icons-DlzgV4KY.js";import{t as Fe}from"./useDeleteCell-CIdiI4Pk.js";import{n as $}from"./name-cell-input-BA5B0KJl.js";import{t as J}from"./multi-icon-CGRsWmew.js";import{t as Ge}from"./useSplitCell-B0jDwUEM.js";var X=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),Y=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"}]]),Qe=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 Ve(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 te(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var $e=ye(),l=ae(ve(),1);function Je(a){let e=(0,$e.c)(47),{cell:c,closePopover:u}=a,{createNewCell:m,updateCellConfig:s,updateCellName:x,moveCell:p,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:S,markUntouched:A}=ne(),D=Ge(),E=Le(c==null?void 0:c.cellId),R=!b(ue),T=Fe(),{openModal:j}=He(),L=ie(Oe),N=b(je),v=b(xe),oe=b(pe),y=b(be),{saveCellConfig:r}=Ie();if(!c||oe){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0],t}let{cellId:o,config:i,getEditorView:n,name:h,hasOutput:C,hasConsoleOutput:q,status:B}=c,w;e[1]!==o||e[2]!==i.disabled||e[3]!==r||e[4]!==s?(w=async()=>{let t={disabled:!i.disabled};await r({configs:{[o]:t}}),s({cellId:o,config:t})},e[1]=o,e[2]=i.disabled,e[3]=r,e[4]=s,e[5]=w):w=e[5];let H=w,g;e[6]!==o||e[7]!==i.hide_code||e[8]!==n||e[9]!==r||e[10]!==s?(g=async()=>{let t={hide_code:!i.hide_code};await r({configs:{[o]:t}}),s({cellId:o,config:t});let U=n();U&&(t.hide_code?U.contentDOM.blur():U.focus())},e[6]=o,e[7]=i.hide_code,e[8]=n,e[9]=r,e[10]=s,e[11]=g):g=e[11];let O=g,d=o===de,I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(Ae,{size:13,strokeWidth:1.5}),e[12]=I):I=e[12];let P=B==="running"||B==="queued"||B==="disabled-transitively"||i.disabled,k;e[13]===E?k=e[14]:(k=()=>E(),e[13]=E,e[14]=k);let z;return e[15]!==_||e[16]!==N||e[17]!==y||e[18]!==v||e[19]!==R||e[20]!==o||e[21]!==S||e[22]!==u||e[23]!==i.disabled||e[24]!==i.hide_code||e[25]!==m||e[26]!==T||e[27]!==n||e[28]!==q||e[29]!==C||e[30]!==d||e[31]!==A||e[32]!==p||e[33]!==h||e[34]!==j||e[35]!==r||e[36]!==M||e[37]!==W||e[38]!==L||e[39]!==D||e[40]!==P||e[41]!==k||e[42]!==H||e[43]!==O||e[44]!==s||e[45]!==x?(z=[[{icon:I,label:"Run cell",hotkey:"cell.run",hidden:P,redundant:!0,handle:k},{icon:(0,l.jsx)(De,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!N,handle:()=>{L(t=>(t==null?void 0:t.cellId)===o?null:{cellId:o})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Z,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>D({cellId:o})},{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let t=n();t&&se({[o]:t})}},{icon:i.hide_code?(0,l.jsx)(me,{size:13,strokeWidth:1.5}):(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:i.hide_code?"Show code":"Hide code",handle:O,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:H,hidden:d}],[{icon:(0,l.jsx)(Ue,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:async()=>{let t=n();t&&(K({autoInstantiate:v,createNewCell:m}),F(t,{language:"markdown",keepCodeAsIs:!1}),i.hide_code||(await r({configs:{[o]:{hide_code:!0}}}),s({cellId:o,config:{hide_code:!0}}),A({cellId:o})))},hidden:d},re(n())==="sql"?{icon:(0,l.jsx)(Pe,{}),label:"View as Python",hotkey:"cell.viewAsSQL",handle:()=>{let t=n();t&&ce(t,"python",{force:!0})},hidden:d}:{icon:(0,l.jsx)(fe,{size:13,strokeWidth:1.5}),label:"Convert to SQL",hotkey:"cell.viewAsSQL",handle:()=>{let t=n();t&&(K({autoInstantiate:v,createNewCell:m}),F(t,{language:"sql",keepCodeAsIs:!1}))},hidden:d}],[{icon:(0,l.jsxs)(J,{children:[(0,l.jsx)(V,{size:13,strokeWidth:1.5}),(0,l.jsx)(G,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>m({cellId:o,before:!0}),hidden:d,redundant:!0},{icon:(0,l.jsxs)(J,{children:[(0,l.jsx)(V,{size:13,strokeWidth:1.5}),(0,l.jsx)(Q,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>m({cellId:o,before:!1}),redundant:!0},{icon:(0,l.jsx)(G,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>p({cellId:o,before:!0}),hidden:d},{icon:(0,l.jsx)(Q,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>p({cellId:o,before:!1}),hidden:d},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>p({cellId:o,direction:"left"}),hidden:y!=="columns"||d},{icon:(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>p({cellId:o,direction:"right"}),hidden:y!=="columns"||d},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:o,scroll:!1}),hidden:d},{icon:(0,l.jsx)(X,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:o,scroll:!1}),hidden:d},{icon:(0,l.jsx)(he,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:o}),hidden:y!=="columns"||d}],[{icon:(0,l.jsx)(_e,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!C,handle:()=>we(o,"result")},{icon:(0,l.jsx)(ke,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(C||q),handle:()=>{S({cellId:o})}}],[{icon:(0,l.jsx)(Qe,{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)(qe,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(Ce,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)($,{placeholder:"cell name",value:h,onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),t.stopPropagation(),j(null))},onChange:t=>x({cellId:o,name:t})})]})]}))},rightElement:(0,l.jsx)($,{placeholder:"cell name",value:h,onChange:t=>x({cellId:o,name:t}),onEnterKey:()=>u==null?void 0:u()}),hidden:d},{icon:(0,l.jsx)(Se,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!te(h),tooltip:te(h)?void 0:"Only named cells can be linked to",handle:async()=>{await Te(Ve(h)),Re({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!R,variant:"danger",icon:(0,l.jsx)(Ee,{size:13,strokeWidth:1.5}),handle:()=>{T({cellId:o})}}]].map(Ye).filter(Xe),e[15]=_,e[16]=N,e[17]=y,e[18]=v,e[19]=R,e[20]=o,e[21]=S,e[22]=u,e[23]=i.disabled,e[24]=i.hide_code,e[25]=m,e[26]=T,e[27]=n,e[28]=q,e[29]=C,e[30]=d,e[31]=A,e[32]=p,e[33]=h,e[34]=j,e[35]=r,e[36]=M,e[37]=W,e[38]=L,e[39]=D,e[40]=P,e[41]=k,e[42]=H,e[43]=O,e[44]=s,e[45]=x,e[46]=z):z=e[46],z}function Xe(a){return a.length>0}function Ye(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,Y as o,le as r,X as s,Je as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as v}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-D91BmmQi.js";import{E as p,b as D,v as h}from"./cells-
|
|
1
|
+
import{s as v}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-D91BmmQi.js";import{E as p,b as D,v as h}from"./cells-BVG4a-Qn.js";import{t as C}from"./compiler-runtime-B3qBwwSJ.js";import{t as I}from"./useEventListener-DGjKht0c.js";import{t as x}from"./jsx-runtime-Blw4afVn.js";import{t as _}from"./button-BKVLeSTX.js";import{r as b}from"./requests-9-v2bhoi.js";import{t as g}from"./use-toast-BDYuj3zG.js";import{n as j}from"./renderShortcut-DrDh2657.js";var w=C(),d=v(x(),1);const f=e=>{let t=(0,w.c)(7),l;t[0]===e?l=t[1]:(l=a=>{var s;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(s=e.onClick)==null||s.call(e,a))},t[0]=e,t[1]=l);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r={capture:!0},t[2]=r):r=t[2],I(window,"keydown",l,r);let o=e.children??"Undo",i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,d.jsx)(j,{className:"ml-2",shortcut:"cmd-z"}),t[3]=i):i=t[3];let n;return t[4]!==o||t[5]!==e?(n=(0,d.jsxs)(_,{"data-testid":"undo-button",size:"sm",variant:"outline",...e,children:[o," ",i]}),t[4]=o,t[5]=e,t[6]=n):n=t[6],n};var y=C();function z(){let e=(0,y.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=b(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=i=>{var s;if(m.get(h))return;let{cellId:n}=i,a=(((s=m.get(D).cellData[n])==null?void 0:s.code)??"").trim()==="";if(t({cellId:n}),r({cellId:n}).catch(()=>{l()}),!a){let{dismiss:c}=g({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{l(),k()}})}),k=c}},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}function K(){let e=(0,y.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=b(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=async i=>{if(m.get(h))return;let{cellIds:n}=i;for(let c of n)await r({cellId:c}).then(()=>{t({cellId:c})});let{dismiss:a}=g({title:"Cells deleted",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{for(let c of n)l();s()}})}),s=a},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}export{K as n,f as r,z 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-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,jt as re}from"./cells-
|
|
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-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{G as te,jt as re}from"./cells-BVG4a-Qn.js";import{t as V}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./cn-DYvqRARy.js";import{t as ae}from"./jsx-runtime-Blw4afVn.js";import{d as ne}from"./alert-dialog-CXspBRlP.js";import{i as B,r as se,t as J}from"./popover-AtoFZ7i4.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-DmqhBBs6.js";import{t as de}from"./createLucideIcon-w-Qo9n0R.js";import{t as he}from"./useCellActionButton-DdsVswP2.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-DvF_4mQa.js";import{n as ve}from"./focus-BHXzPxK_.js";import{a as Ne,i as ge}from"./renderShortcut-DrDh2657.js";var we=de("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(ae(),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=he({cell:m,closePopover:W}).map(Ce).filter(_e),P=ne(),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=se,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:le(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 ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as ct,p as ht,u as me}from"./useEvent-D91BmmQi.js";import{t as mt}from"./react-Bj1aDYRI.js";import{E as Me,En as pt,Jt as ut,Rr as ft,Tn as xt,_ as yt,cr as kt,ct as We,h as _e,kn as bt,ot as wt,pr as jt,st as gt,t as vt,ur as Ct,vr as zt,wi as pe,wn as Mt}from"./cells-CFrQXbte.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Wt,x as _t}from"./ai-model-dropdown-DV6uEsTK.js";import{_ as H,d as Ne}from"./useEventListener-DGjKht0c.js";import{y as Nt}from"./utils-8btzWeZg.js";import{n as L,t as Se}from"./constants-tOPFFcLZ.js";import{S as ue,h as St,n as Dt,o as Pt,x as At}from"./config-Cgj0Ahvb.js";import{t as It}from"./jsx-runtime-Blw4afVn.js";import{o as Et}from"./alert-dialog-CXspBRlP.js";import{a as Lt,c as fe,o as xe,s as Tt}from"./popover-AtoFZ7i4.js";import{a as Rt,c as $t,i as Ht,n as qt,r as Bt,s as Ft,t as Ot}from"./select--zcABebs.js";import{gt as Ut}from"./JsonOutput-BftIujCE.js";import{c as De,d as ye,n as Vt,o as Yt,r as ke,t as Kt}from"./download-DTkyjpOn.js";import{m as Gt}from"./form-DpsQrY6E.js";import{t as Pe}from"./tooltip-DmqhBBs6.js";import{r as Ae,t as q}from"./button-BKVLeSTX.js";import{i as Jt,r as Qt,t as Ie}from"./strings-pfr2N700.js";import{r as B}from"./requests-9-v2bhoi.js";import{t as b}from"./createLucideIcon-w-Qo9n0R.js";import{a as Ee,f as Xt,i as Le,m as Zt,p as Te,u as Re}from"./layout-cuzIQLaL.js";import{t as be}from"./check-B-sKate2.js";import{n as ea}from"./maps-B4xARV9R.js";import{r as ta}from"./useCellActionButton-DYYmbrbT.js";import{t as $e}from"./copy-DFMsQ6MJ.js";import{t as aa}from"./eye-off-DgRJ-xBZ.js";import{t as ae}from"./file-l37OnSN4.js";import{t as oa}from"./github-C3N4cuN4.js";import{n as na,r as sa,t as la}from"./youtube-D6LtMx2w.js";import{i as ia,n as He}from"./add-connection-dialog-RNl1YtDd.js";import{n as ra,t as da}from"./square-COtNnHUC.js";import{t as ca}from"./image-BgkzrnsX.js";import{t as ha}from"./link-dU_vDDSR.js";import{r as ma}from"./input-Bg12i6qY.js";import{t as pa}from"./settings-C1bg8A2T.js";import{t as ua}from"./sparkles-B79Qf6ma.js";import{y as fa}from"./textarea-DIGEgQ8s.js";import{t as S}from"./use-toast-BDYuj3zG.js";import{n as qe,t as xa}from"./paths-BzSgteR-.js";import{o as ya}from"./session-DdnWW30b.js";import{n as F}from"./copy-Bizk-4hH.js";import{r as ka}from"./useRunCells-BDQ0C7Ll.js";import{a as Be,c as Fe,i as Oe,n as Ue,r as Ve}from"./dialog-BYjetQgE.js";import{n as we}from"./ImperativeModal-DoGv2BXV.js";import{r as ba,t as wa}from"./share-0LPgOyiW.js";import{a as ja}from"./cell-link-BITFYvIs.js";import{a as ga}from"./renderShortcut-DrDh2657.js";import{t as va}from"./icons-DlzgV4KY.js";import{n as Ca}from"./marimo-icons-Dp8wmdDL.js";import{t as za}from"./links-C19POYUQ.js";import{r as Ma,t as Ye}from"./hooks-DkX8jVh3.js";import{t as Ke}from"./types-DOdUT9LT.js";var Wa=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),_a=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ge=b("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"}]]),Je=b("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=b("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"}]]),Na=b("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"}]]),Sa=b("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"}]]),Da=b("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"}]]),Xe=b("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"}]]),Pa=b("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"}]]),Aa=b("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"}]]),Ia=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ze=b("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"}]]),Ea=b("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"}]]),La=b("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"}]]),et=b("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"}]]),je=N(),D=ze(mt(),1),a=ze(It(),1);function Ta(){return"uvx marimo@latest"}function Ra(t,e,n){let o=n?" --with-token":"",s=`${Ta()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:Qt(t)}}function $a(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var Ha="npx skills add marimo-team/marimo-pair";function qa(){let t=(0,je.c)(2),[e,n]=(0,D.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Dt("/auth/token").href,{credentials:"include"}).then(Ba).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,D.useEffect)(o,s),e}function Ba(t){return t.ok?t.json():null}const Fa=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,D.useState)("claude"),r=Pt(),i=qa(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=Ra(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Fe,{children:"Pair with an agent"}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Be,{children:[m,(0,a.jsxs)(Ve,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(O,{command:Ha})]}),e[6]=h):h=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Tt,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[u,(0,a.jsxs)(Lt,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(O,{command:i,display:$a(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Oe,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Ue,{className:"sm:max-w-lg",children:[p,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var O=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,D.useState)(!1),i;e[0]===n?i=e[1]:(i=Ae.stopPropagation(async x=>{x.preventDefault(),await F(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let m;e[4]===s?m=e[5]:(m=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=m);let p;e[6]!==l||e[7]!==m?(p=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:m}),e[6]=l,e[7]=m,e[8]=p):p=e[8];let h;e[9]!==s||e[10]!==p?(h=(0,a.jsx)(Pe,{content:"Copied!",open:s,children:p}),e[9]=s,e[10]=p,e[11]=h):h=e[11];let u;return e[12]!==c||e[13]!==h?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=u):u=e[14],u},tt=N(),oe="https://static.marimo.app";const Oa=t=>{let e=(0,tt.c)(25),{onClose:n}=t,[o,s]=(0,D.useState)(""),{exportAsHTML:r}=B(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:Xt.INSTANCE.filenames()}),v=S({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),S({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:L.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),S({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."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Fe,{children:"Share static notebook"}),e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsxs)(Be,{children:[c,(0,a.jsxs)(Ve,{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:oe,target:"_blank",children:oe}),"."]})]}),e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=p):p=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(ma,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:p,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let u;e[9]===l?u=e[10]:(u=(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)(Ua,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=u);let x;e[11]!==h||e[12]!==u?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,u]}),e[11]=h,e[12]=u,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await F(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Oe,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Ue,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[m,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Ua=t=>{let e=(0,tt.c)(8),[n,o]=D.useState(!1),s;e[0]===t.text?s=e[1]:(s=Ae.stopPropagation(async c=>{c.preventDefault(),await F(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Pe,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Va=N();function Ya(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ka(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function at(){let t=(0,Va.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ya();e(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ka(o)})})},t[0]=e,t[1]=n),n}const ot=ht(!1);var Ga=N();const Ja=()=>{let t=(0,Ga.c)(7),{selectedLayout:e}=Ee(),{setLayoutView:n}=Le();if(ue()&&!bt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(qt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(Rt,{children:"View as"}),Ke.map(Xa)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Ot,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Qa(t){return(0,a.jsx)(nt(t),{className:"h-4 w-4"})}function nt(t){switch(t){case"vertical":return Pa;case"grid":return sa;case"slides":return Ze;default:return Jt(t),da}}function st(t){return Ie.startCase(t)}function Xa(t){return(0,a.jsx)(Ht,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Qa(t),(0,a.jsx)("span",{children:st(t)})]})},t)}async function Za(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var eo=N();function to(t){let e=(0,eo.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=B(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=xa.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),S({title:"Notebook copied",description:"A copy of the notebook has been created."}),za(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const ao=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=B();return(0,D.useCallback)(async()=>{let n=new ut,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var oo=N();function lt(){let t=(0,oo.c)(4),{openConfirm:e}=we(),n=$(St),{sendRestart:o}=B(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({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)(Et,{onClick:async()=>{n({state:At.CLOSING}),await o(),ba()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var no=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function so(){var ve,Ce;let t=(0,no.c)(51),e=ja(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=Mt(),{selectedPanel:r}=xt(),[i]=ct(We),l=me(wt),d=ao(),[c]=Nt(),{updateCellConfig:m,undoDeleteCell:p,clearAllCellOutputs:h,addSetupCellIfDoesntExist:u,collapseAllCells:x,expandAllCells:w}=Me(),y=lt(),k=ka(),j=to(e),g=$(ot),z=$(Wt),v=$(_t),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=B(),A=Ma(),le=me(yt),ie=me(vt),{selectedLayout:U}=Ee(),{setLayoutView:re}=Le(),V=at(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=U==="slides",it=Co,rt=vo,G;t[0]!==e||t[1]!==A||t[2]!==P?(G=async f=>{let{preset:C,title:R}=f;if(!e){ne();return}await De(R,async he=>{await Ye({takeScreenshots:()=>A({progress:he}),updateCellOutputs:P}),await Za({filename:e,preset:C,downloadPDF:Vt})})},t[0]=e,t[1]=A,t[2]=P,t[3]=G):G=t[3];let I=G,J;t[4]===I?J=t[5]:(J=async()=>{if(ge){await I({preset:"document",title:"Downloading Document PDF..."});return}let f=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(f),setTimeout(go,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=I,t[5]=J);let Q=J,X;t[6]!==M||t[7]!==e||t[8]!==A||t[9]!==P?(X=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async f=>{await Ye({takeScreenshots:()=>A({progress:f}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=A,t[9]=P,t[10]=X):X=t[10];let ce=X,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Ut,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let E;t[13]===e?E=t[14]:(E=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=E);let te;return t[15]!==u||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==I||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Q||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==U||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==E||t[45]!==s||t[46]!==V||t[47]!==p||t[48]!==m||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:E},{icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(va,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let f=await W({download:!1});ke(new Blob([f],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let f=await _();ke(new Blob([f.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ga("global.hideCode",!1)]}),handle:jo},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Q},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:rt(!0),hidden:!ge,handle:async()=>{await I({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Q}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Fa,{onClose:o}))}},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Oa,{onClose:o}))}},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await F(wa({code:(await _()).contents})),S({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:pt.flatMap(f=>{let{type:C,Icon:R,hidden:he,additionalKeywords:dt}=f;return he?[]:{label:Ie.startCase(C),rightElement:it(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:dt}})},{icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{V()}},...Ke.map((f,C)=>{let R=nt(f);return{divider:C===0,label:st(f),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:U===f&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(f),i.mode==="edit"&&V()}}})]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await F((await _()).contents),S({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let f=ft(_e());await se({configs:Ne.fromEntries(f.map(wo))});for(let C of f)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{p()}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Je,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(bo)},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(ko)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(yo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:xo},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:fo},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:uo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"YouTube",handle:po},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:mo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:ho},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:co}].filter(ro).map(lo),t[15]=u,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=I,t[22]=w,t[23]=W,t[24]=e,t[25]=Q,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=U,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=E,t[45]=s,t[46]=V,t[47]=p,t[48]=m,t[49]=i.mode,t[50]=te):te=t[50],te}function lo(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(io)}:t}function io(t){return!t.hidden}function ro(t){return!t.hidden}function co(){let t=ya();window.open(t,"_blank")}function ho(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function mo(){window.open(L.releasesPage,"_blank")}function po(){window.open(L.youtube,"_blank")}function uo(){window.open(L.discordLink,"_blank")}function fo(){window.open(L.githubPage,"_blank")}function xo(){window.open(L.docsPage,"_blank")}function yo(t){return!t}function ko(t){return!t}function bo(t){return!t}function wo(t){return[t,{disabled:!1}]}async function jo(){let t=document.getElementById("App");t&&await Yt({element:t,filename:document.title,prepare:Kt})}function go(){return window.print()}function vo(t){return t?(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 Co(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){S({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{at as a,Qe as c,ot as i,Je as l,lt as n,et as o,Ja as r,Xe as s,so as t,Ge as u};
|
|
1
|
+
import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as ct,p as ht,u as me}from"./useEvent-D91BmmQi.js";import{t as mt}from"./react-Bj1aDYRI.js";import{E as Me,En as pt,Jt as ut,Rr as ft,Ti as pe,Tn as xt,_ as yt,cr as kt,ct as We,h as _e,kn as bt,ot as wt,pr as jt,st as gt,t as vt,ur as Ct,vr as zt,wn as Mt}from"./cells-BVG4a-Qn.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Wt,x as _t}from"./ai-model-dropdown-B-sbS07W.js";import{_ as H,d as Ne}from"./useEventListener-DGjKht0c.js";import{y as Nt}from"./utils-8btzWeZg.js";import{n as L,t as Se}from"./constants-tOPFFcLZ.js";import{S as ue,h as St,n as Dt,o as Pt,x as At}from"./config-Cgj0Ahvb.js";import{t as It}from"./jsx-runtime-Blw4afVn.js";import{o as Et}from"./alert-dialog-CXspBRlP.js";import{a as Lt,c as fe,o as xe,s as Tt}from"./popover-AtoFZ7i4.js";import{a as Rt,c as $t,i as Ht,n as qt,r as Bt,s as Ft,t as Ot}from"./select--zcABebs.js";import{gt as Ut}from"./JsonOutput-Bk2by9qo.js";import{c as De,d as ye,n as Vt,o as Yt,r as ke,t as Kt}from"./download-QIfZjflb.js";import{m as Gt}from"./form-C0W8wa3f.js";import{t as Pe}from"./tooltip-DmqhBBs6.js";import{r as Ae,t as q}from"./button-BKVLeSTX.js";import{i as Jt,r as Qt,t as Ie}from"./strings-pfr2N700.js";import{r as B}from"./requests-9-v2bhoi.js";import{t as b}from"./createLucideIcon-w-Qo9n0R.js";import{a as Ee,f as Xt,i as Le,m as Zt,p as Te,u as Re}from"./layout-V4eTNc4M.js";import{t as be}from"./check-B-sKate2.js";import{n as ea}from"./maps-B4xARV9R.js";import{r as ta}from"./useCellActionButton-DdsVswP2.js";import{t as $e}from"./copy-DFMsQ6MJ.js";import{t as aa}from"./eye-off-DgRJ-xBZ.js";import{t as ae}from"./file-l37OnSN4.js";import{t as oa}from"./github-C3N4cuN4.js";import{n as na,r as sa,t as la}from"./youtube-D6LtMx2w.js";import{i as ia,n as He}from"./add-connection-dialog-20N0EHLl.js";import{n as ra,t as da}from"./square-COtNnHUC.js";import{t as ca}from"./image-BgkzrnsX.js";import{t as ha}from"./link-dU_vDDSR.js";import{r as ma}from"./input-Bg12i6qY.js";import{t as pa}from"./settings-C1bg8A2T.js";import{t as ua}from"./sparkles-B79Qf6ma.js";import{y as fa}from"./textarea-B5p9_myy.js";import{t as S}from"./use-toast-BDYuj3zG.js";import{n as qe,t as xa}from"./paths-BzSgteR-.js";import{o as ya}from"./session-DdnWW30b.js";import{n as F}from"./copy-Bizk-4hH.js";import{r as ka}from"./useRunCells-q5CA-QoL.js";import{a as Be,c as Fe,i as Oe,n as Ue,r as Ve}from"./dialog-BYjetQgE.js";import{n as we}from"./ImperativeModal-DoGv2BXV.js";import{r as ba,t as wa}from"./share-0LPgOyiW.js";import{a as ja}from"./cell-link-Dtonmtv_.js";import{a as ga}from"./renderShortcut-DrDh2657.js";import{t as va}from"./icons-DlzgV4KY.js";import{n as Ca}from"./marimo-icons-Dp8wmdDL.js";import{t as za}from"./links-C19POYUQ.js";import{r as Ma,t as Ye}from"./hooks-C7qnb_ft.js";import{t as Ke}from"./types-DOdUT9LT.js";var Wa=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),_a=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ge=b("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"}]]),Je=b("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=b("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"}]]),Na=b("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"}]]),Sa=b("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"}]]),Da=b("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"}]]),Xe=b("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"}]]),Pa=b("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"}]]),Aa=b("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"}]]),Ia=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ze=b("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"}]]),Ea=b("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"}]]),La=b("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"}]]),et=b("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"}]]),je=N(),D=ze(mt(),1),a=ze(It(),1);function Ta(){return"uvx marimo@latest"}function Ra(t,e,n){let o=n?" --with-token":"",s=`${Ta()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:Qt(t)}}function $a(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var Ha="npx skills add marimo-team/marimo-pair";function qa(){let t=(0,je.c)(2),[e,n]=(0,D.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Dt("/auth/token").href,{credentials:"include"}).then(Ba).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,D.useEffect)(o,s),e}function Ba(t){return t.ok?t.json():null}const Fa=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,D.useState)("claude"),r=Pt(),i=qa(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=Ra(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Fe,{children:"Pair with an agent"}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Be,{children:[m,(0,a.jsxs)(Ve,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(O,{command:Ha})]}),e[6]=h):h=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Tt,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[u,(0,a.jsxs)(Lt,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(O,{command:i,display:$a(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Oe,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Ue,{className:"sm:max-w-lg",children:[p,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var O=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,D.useState)(!1),i;e[0]===n?i=e[1]:(i=Ae.stopPropagation(async x=>{x.preventDefault(),await F(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let m;e[4]===s?m=e[5]:(m=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=m);let p;e[6]!==l||e[7]!==m?(p=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:m}),e[6]=l,e[7]=m,e[8]=p):p=e[8];let h;e[9]!==s||e[10]!==p?(h=(0,a.jsx)(Pe,{content:"Copied!",open:s,children:p}),e[9]=s,e[10]=p,e[11]=h):h=e[11];let u;return e[12]!==c||e[13]!==h?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=u):u=e[14],u},tt=N(),oe="https://static.marimo.app";const Oa=t=>{let e=(0,tt.c)(25),{onClose:n}=t,[o,s]=(0,D.useState)(""),{exportAsHTML:r}=B(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:Xt.INSTANCE.filenames()}),v=S({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),S({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:L.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),S({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."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Fe,{children:"Share static notebook"}),e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsxs)(Be,{children:[c,(0,a.jsxs)(Ve,{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:oe,target:"_blank",children:oe}),"."]})]}),e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=p):p=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(ma,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:p,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let u;e[9]===l?u=e[10]:(u=(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)(Ua,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=u);let x;e[11]!==h||e[12]!==u?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,u]}),e[11]=h,e[12]=u,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await F(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Oe,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Ue,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[m,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Ua=t=>{let e=(0,tt.c)(8),[n,o]=D.useState(!1),s;e[0]===t.text?s=e[1]:(s=Ae.stopPropagation(async c=>{c.preventDefault(),await F(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Pe,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Va=N();function Ya(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ka(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function at(){let t=(0,Va.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ya();e(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ka(o)})})},t[0]=e,t[1]=n),n}const ot=ht(!1);var Ga=N();const Ja=()=>{let t=(0,Ga.c)(7),{selectedLayout:e}=Ee(),{setLayoutView:n}=Le();if(ue()&&!bt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(qt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(Rt,{children:"View as"}),Ke.map(Xa)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Ot,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Qa(t){return(0,a.jsx)(nt(t),{className:"h-4 w-4"})}function nt(t){switch(t){case"vertical":return Pa;case"grid":return sa;case"slides":return Ze;default:return Jt(t),da}}function st(t){return Ie.startCase(t)}function Xa(t){return(0,a.jsx)(Ht,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Qa(t),(0,a.jsx)("span",{children:st(t)})]})},t)}async function Za(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var eo=N();function to(t){let e=(0,eo.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=B(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=xa.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),S({title:"Notebook copied",description:"A copy of the notebook has been created."}),za(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const ao=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=B();return(0,D.useCallback)(async()=>{let n=new ut,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var oo=N();function lt(){let t=(0,oo.c)(4),{openConfirm:e}=we(),n=$(St),{sendRestart:o}=B(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({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)(Et,{onClick:async()=>{n({state:At.CLOSING}),await o(),ba()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var no=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function so(){var ve,Ce;let t=(0,no.c)(51),e=ja(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=Mt(),{selectedPanel:r}=xt(),[i]=ct(We),l=me(wt),d=ao(),[c]=Nt(),{updateCellConfig:m,undoDeleteCell:p,clearAllCellOutputs:h,addSetupCellIfDoesntExist:u,collapseAllCells:x,expandAllCells:w}=Me(),y=lt(),k=ka(),j=to(e),g=$(ot),z=$(Wt),v=$(_t),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=B(),A=Ma(),le=me(yt),ie=me(vt),{selectedLayout:U}=Ee(),{setLayoutView:re}=Le(),V=at(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=U==="slides",it=Co,rt=vo,G;t[0]!==e||t[1]!==A||t[2]!==P?(G=async f=>{let{preset:C,title:R}=f;if(!e){ne();return}await De(R,async he=>{await Ye({takeScreenshots:()=>A({progress:he}),updateCellOutputs:P}),await Za({filename:e,preset:C,downloadPDF:Vt})})},t[0]=e,t[1]=A,t[2]=P,t[3]=G):G=t[3];let I=G,J;t[4]===I?J=t[5]:(J=async()=>{if(ge){await I({preset:"document",title:"Downloading Document PDF..."});return}let f=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(f),setTimeout(go,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=I,t[5]=J);let Q=J,X;t[6]!==M||t[7]!==e||t[8]!==A||t[9]!==P?(X=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async f=>{await Ye({takeScreenshots:()=>A({progress:f}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=A,t[9]=P,t[10]=X):X=t[10];let ce=X,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Ut,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let E;t[13]===e?E=t[14]:(E=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=E);let te;return t[15]!==u||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==I||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Q||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==U||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==E||t[45]!==s||t[46]!==V||t[47]!==p||t[48]!==m||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:E},{icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(va,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let f=await W({download:!1});ke(new Blob([f],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let f=await _();ke(new Blob([f.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ga("global.hideCode",!1)]}),handle:jo},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Q},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:rt(!0),hidden:!ge,handle:async()=>{await I({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Q}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Fa,{onClose:o}))}},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Oa,{onClose:o}))}},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await F(wa({code:(await _()).contents})),S({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:pt.flatMap(f=>{let{type:C,Icon:R,hidden:he,additionalKeywords:dt}=f;return he?[]:{label:Ie.startCase(C),rightElement:it(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:dt}})},{icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{V()}},...Ke.map((f,C)=>{let R=nt(f);return{divider:C===0,label:st(f),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:U===f&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(f),i.mode==="edit"&&V()}}})]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await F((await _()).contents),S({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let f=ft(_e());await se({configs:Ne.fromEntries(f.map(wo))});for(let C of f)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{p()}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Je,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(bo)},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(ko)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(yo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:xo},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:fo},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:uo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"YouTube",handle:po},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:mo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:ho},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:co}].filter(ro).map(lo),t[15]=u,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=I,t[22]=w,t[23]=W,t[24]=e,t[25]=Q,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=U,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=E,t[45]=s,t[46]=V,t[47]=p,t[48]=m,t[49]=i.mode,t[50]=te):te=t[50],te}function lo(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(io)}:t}function io(t){return!t.hidden}function ro(t){return!t.hidden}function co(){let t=ya();window.open(t,"_blank")}function ho(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function mo(){window.open(L.releasesPage,"_blank")}function po(){window.open(L.youtube,"_blank")}function uo(){window.open(L.discordLink,"_blank")}function fo(){window.open(L.githubPage,"_blank")}function xo(){window.open(L.docsPage,"_blank")}function yo(t){return!t}function ko(t){return!t}function bo(t){return!t}function wo(t){return[t,{disabled:!1}]}async function jo(){let t=document.getElementById("App");t&&await Yt({element:t,filename:document.title,prepare:Kt})}function go(){return window.print()}function vo(t){return t?(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 Co(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){S({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{at as a,Qe as c,ot as i,Je as l,lt as n,et as o,Ja as r,Xe as s,so as t,Ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,n as i,p as k}from"./useEvent-D91BmmQi.js";import{E as v,Ln as w,Ur as F,h as d,yt as b,zr as _}from"./cells-
|
|
1
|
+
import{d as g,n as i,p as k}from"./useEvent-D91BmmQi.js";import{E as v,Ln as w,Ur as F,h as d,yt as b,zr as _}from"./cells-BVG4a-Qn.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{_ as z}from"./useEventListener-DGjKht0c.js";import{o as D}from"./dist-BNTOYRCs.js";import{r as E}from"./requests-9-v2bhoi.js";var u=x();const y=k(!1);function H(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function L(r){let n=(0,u.c)(3),t=f(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function U(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(_(d())),r[0]=n,r[1]=t),i(t)}function f(){let r=(0,u.c)(4),{prepareForRun:n}=v(),{sendRun:t}=E(),e=g(y),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,p;l?(w(l)!=="markdown"&&D(l),p=b(l)):p=((R=s[a])==null?void 0:R.code)||"",c.push(p),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{z.error(a)})}export{f as a,L as i,I as n,H as o,U as r,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,f,yt as u}from"./cells-
|
|
1
|
+
import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,f,yt as u}from"./cells-BVG4a-Qn.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-Blw4afVn.js";import{t as h}from"./use-toast-BDYuj3zG.js";import{r as v}from"./useDeleteCell-CIdiI4Pk.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
|
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-CLnKZIHZ.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-D2MJg03u.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/debounce-BbSyBDA8.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/database-zap-BxfYZ6ML.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/main-BNL5rxQw.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-BVG4a-Qn.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-dxChUL02.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/kbd-BUtlbGdu.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-CeM6oPsT.js">
|
|
@@ -148,33 +148,33 @@
|
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/usePress-BXMIcLWP.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/input-Bg12i6qY.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/ImperativeModal-DoGv2BXV.js">
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-Dtonmtv_.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/multi-map-MSuUqmbC.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/alert-DF3HbVtk.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-CgvDWFE3.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-DrHAuMTb.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/links-DOybeRem.js">
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-q5CA-QoL.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-Bizk-4hH.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-DFMsQ6MJ.js">
|
|
160
160
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-BGs1Pbai.js">
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
163
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-BOW_1WUn.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-BzTPyEw3.js">
|
|
163
|
+
<link rel="modulepreload" crossorigin href="./assets/state-Blw6taKi.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/sparkles-B79Qf6ma.js">
|
|
165
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
165
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-Cyd8ikG3.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/spinner-C5wIpWgQ.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-B3VySJ1_.js">
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-BHXzPxK_.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-aCoWDe-l.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-CoYqQxHb.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-DzSMahmM.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-Cyc7d5AB.js">
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-BiKTlki_.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/command-DvF_4mQa.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/popover-AtoFZ7i4.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/errors-CZb6hI2x.js">
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/download-QIfZjflb.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/table-B03CpBmt.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-C8jvQ1Lj.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/error-banner-bXc_9BBZ.js">
|
|
@@ -193,26 +193,26 @@
|
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-DidENKDy.js">
|
|
194
194
|
<link rel="modulepreload" crossorigin href="./assets/message-circle-DiHwtSG8.js">
|
|
195
195
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-BUNcfKXO.js">
|
|
196
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
196
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-Bk2by9qo.js">
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-CsXoiEZx.js">
|
|
198
198
|
<link rel="modulepreload" crossorigin href="./assets/square-function-BecUoMho.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/spec-DqqZbNbU.js">
|
|
200
200
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-vertical-DEH0lwkn.js">
|
|
201
201
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-CiOe0azG.js">
|
|
202
|
-
<link rel="modulepreload" crossorigin href="./assets/components-
|
|
203
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
202
|
+
<link rel="modulepreload" crossorigin href="./assets/components-DiALLQRt.js">
|
|
203
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-CB_HZPdz.js">
|
|
204
204
|
<link rel="modulepreload" crossorigin href="./assets/icons-DlzgV4KY.js">
|
|
205
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
206
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
205
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-BluCz3vD.js">
|
|
206
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-g3zSMJKs.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-smPWkHxB.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/esm-BqofWdD5.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-DgRJ-xBZ.js">
|
|
210
210
|
<link rel="modulepreload" crossorigin href="./assets/plus-BYq_Btg-.js">
|
|
211
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
211
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-DuH_nOq_.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-5_PGMxRL.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/file-l37OnSN4.js">
|
|
214
214
|
<link rel="modulepreload" crossorigin href="./assets/image-BgkzrnsX.js">
|
|
215
|
-
<link rel="modulepreload" crossorigin href="./assets/file-icons-
|
|
215
|
+
<link rel="modulepreload" crossorigin href="./assets/file-icons-ma7AC7Pi.js">
|
|
216
216
|
<link rel="modulepreload" crossorigin href="./assets/switch-C2idsSNO.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/events-Qeh-bHlj.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/globals-Bh85lAn7.js">
|
|
@@ -221,12 +221,12 @@
|
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/memoize-BwAF2XN5.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/get-D7jeR2wg.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-49dbm-yb.js">
|
|
224
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
224
|
+
<link rel="modulepreload" crossorigin href="./assets/state-urfwd716.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/label-C89F4v17.js">
|
|
226
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
226
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-B5p9_myy.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-CfYqAbmq.js">
|
|
228
228
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-DunI72kV.js">
|
|
229
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
229
|
+
<link rel="modulepreload" crossorigin href="./assets/form-C0W8wa3f.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/renderShortcut-DrDh2657.js">
|
|
231
231
|
<link rel="modulepreload" crossorigin href="./assets/field-DTzXkFLZ.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/RSPContexts-LWFBF00h.js">
|
package/package.json
CHANGED
|
@@ -16,6 +16,22 @@ export const filenameAtom = atom<string | null>(getFilenameFromDOM());
|
|
|
16
16
|
*/
|
|
17
17
|
export const cwdAtom = atom<string | null>(null);
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* LSP workspace information from the backend.
|
|
21
|
+
* Contains the project root and the document's file URI.
|
|
22
|
+
*/
|
|
23
|
+
export interface LspWorkspace {
|
|
24
|
+
rootUri: string;
|
|
25
|
+
documentUri: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Atom for storing the LSP workspace information.
|
|
30
|
+
* This is populated during active notebook sessions
|
|
31
|
+
* and null for other pages.
|
|
32
|
+
*/
|
|
33
|
+
export const lspWorkspaceAtom = atom<LspWorkspace | null>(null);
|
|
34
|
+
|
|
19
35
|
/**
|
|
20
36
|
* Set for static notebooks.
|
|
21
37
|
*/
|
package/src/mount.tsx
CHANGED
|
@@ -36,7 +36,12 @@ import {
|
|
|
36
36
|
DEFAULT_RUNTIME_CONFIG,
|
|
37
37
|
runtimeConfigAtom,
|
|
38
38
|
} from "./core/runtime/config";
|
|
39
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
codeAtom,
|
|
41
|
+
cwdAtom,
|
|
42
|
+
filenameAtom,
|
|
43
|
+
lspWorkspaceAtom,
|
|
44
|
+
} from "./core/saving/file-state";
|
|
40
45
|
import { store } from "./core/state/jotai";
|
|
41
46
|
import { patchFetch, patchVegaLoader } from "./core/static/files";
|
|
42
47
|
import {
|
|
@@ -150,6 +155,16 @@ const mountOptionsSchema = z.object({
|
|
|
150
155
|
* absolute working directory of the notebook
|
|
151
156
|
*/
|
|
152
157
|
cwd: z.string().nullish().default(null),
|
|
158
|
+
/**
|
|
159
|
+
* LSP workspace information
|
|
160
|
+
*/
|
|
161
|
+
lspWorkspace: z
|
|
162
|
+
.object({
|
|
163
|
+
rootUri: z.string(),
|
|
164
|
+
documentUri: z.string(),
|
|
165
|
+
})
|
|
166
|
+
.nullish()
|
|
167
|
+
.default(null),
|
|
153
168
|
/**
|
|
154
169
|
* notebook code
|
|
155
170
|
*/
|
|
@@ -287,6 +302,7 @@ function initStore(options: unknown) {
|
|
|
287
302
|
// Files
|
|
288
303
|
store.set(filenameAtom, parsedOptions.data.filename);
|
|
289
304
|
store.set(cwdAtom, parsedOptions.data.cwd ?? null);
|
|
305
|
+
store.set(lspWorkspaceAtom, parsedOptions.data.lspWorkspace);
|
|
290
306
|
store.set(codeAtom, parsedOptions.data.code);
|
|
291
307
|
store.set(initialModeAtom, mode);
|
|
292
308
|
|