@marimo-team/frontend 0.23.2-dev51 → 0.23.2-dev53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{s as R}from"./chunk-LvLJmgfZ.js";import{u as T}from"./useEvent-D91BmmQi.js";import{t as L}from"./react-Bj1aDYRI.js";import{E as $,fi as D,x as V}from"./cells-8P3lr_U-.js";import"./react-dom-CSu739Rf.js";import{t as I}from"./compiler-runtime-B3qBwwSJ.js";import{n as P}from"./constants-DMpttj8Q.js";import{S as W,d as F}from"./config-Calf6e81.js";import{t as M}from"./cn-DCUzRj2J.js";import{t as q}from"./jsx-runtime-BqBOg78p.js";import"./fullscreen-BDxedMYP.js";import"./popover-UExmgBsf.js";import{P as G,_t as H,st as B,v as J}from"./JsonOutput-C9sdMiTb.js";import{r as K}from"./download-C9hPuN_P.js";import{n as Q,t as E}from"./button-D9nb17Rw.js";import"./dist-BrR4M-k3.js";import"./cjs-BRGiG41H.js";import"./main-B0OX4z33.js";import"./useNonce-DfoVjkkH.js";import{r as X}from"./requests-DIwGYs0l.js";import"./layout-j6GRgN2K.js";import{c as Y}from"./state-Dlj7aAV2.js";import"./markdown-renderer-1cPM8PkF.js";import{t as Z}from"./copy-BwrPA9zQ.js";import{i as ee,l as te,n as re,r as O,t as se,u as oe}from"./panels--d4wmuBV.js";import{t as ae}from"./spinner-jEqwgi_c.js";import"./dist-BwejP-9J.js";import"./dist-G3xLh7ZX.js";import"./dist-idZNafp8.js";import"./dist-DfWgLTCQ.js";import"./dist-Dg3CCt0r.js";import{t as ie}from"./use-toast-PYIpV284.js";import{t as le}from"./session-DdhIEena.js";import"./purify.es-Cg0r2qW-.js";import"./dates-CtmdgiVR.js";import{n as me}from"./copy-BnK_ki61.js";import{a as ne,c as ce,l as de,n as pe,r as he,t as fe}from"./dialog-CqE8CV1Y.js";import{t as xe}from"./share-CJEPnWjm.js";import"./utils-DVodi8oQ.js";import"./vega-loader.browser-CRZ52CKf.js";import"./defaultLocale-D_rSvXvJ.js";import"./defaultLocale-C92Rrpmf.js";import{a as be}from"./cell-link-Df1ljd4V.js";import"./chunk-5FQGJX7Z-nCjg4iIq.js";import"./html-to-image-1NtYwXkp.js";import{n as je,t as ue}from"./react-resizable-panels.browser.esm-xQHRvEag.js";import"./esm-CcSYdGmP.js";import"./name-cell-input-BQJD6TKP.js";import{n as ge,t as ye}from"./marimo-icons-Ce24dQVN.js";import"./ws-BV-4clkP.js";import"./dist-De_C4bys.js";import"./dist-C65QDoZM.js";import"./dist-BicRLhLc.js";import"./dist-Ccf5fPww.js";import"./dist-Ba9R9Dz8.js";import"./dist-Bhj_nUh_.js";import"./dist-QPltPF77.js";import"./dist-yDzOYJbU.js";import"./dist-CJ2fCJoy.js";import"./esm-DYK5NwJW.js";var ke=I(),_e=R(L(),1),t=R(q(),1);const Ne=o=>{let e=(0,ke.c)(25),{appConfig:s}=o,{setCells:r}=$(),{sendComponentValues:h}=X(),m;e[0]===h?m=e[1]:(m=()=>(O.INSTANCE.start(h),ve),e[0]=h,e[1]=m);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[2]=l):l=e[2],(0,_e.useEffect)(m,l);let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=le(),e[3]=n):n=e[3];let j;e[4]===r?j=e[5]:(j={autoInstantiate:!0,setCells:r,sessionId:n},e[4]=r,e[5]=j);let{connection:a}=re(j),k=T(V),u;e[6]===a.state?u=e[7]:(u=F(a.state),e[6]=a.state,e[7]=u);let b=u,g;e[8]!==s||e[9]!==b?(g=()=>b?(0,t.jsxs)(G,{milliseconds:2e3,fallback:null,children:[(0,t.jsx)(ae,{className:"mx-auto"}),(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground mt-2",children:"Connecting..."})]}):(0,t.jsx)(ee,{appConfig:s,mode:"read"}),e[8]=s,e[9]=b,e[10]=g):g=e[10];let _=g,c;e:{if(typeof window>"u"){c=null;break e}let x,i;if(e[11]===Symbol.for("react.memo_cache_sentinel")){if(i=new URL(window.location.href),!i.searchParams.has("file")){c=null;break e}i.searchParams.delete("file"),x=i.searchParams.toString(),e[11]=x,e[12]=i,e[13]=c}else x=e[11],i=e[12],c=e[13];let w=x;c=w?`${i.pathname}?${w}`:i.pathname}let v=c,N=s.width,f;e[14]===Symbol.for("react.memo_cache_sentinel")?(f=v&&(0,t.jsx)("div",{className:"flex items-center px-6 pt-4 sm:-mt-8",children:(0,t.jsxs)("a",{href:v,"aria-label":"Back to gallery",className:M(Q({variant:"text",size:"sm"}),"gap-2 px-0 text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(Y,{className:"size-4","aria-hidden":!0}),(0,t.jsx)("span",{children:"Back"})]})}),e[14]=f):f=e[14];let d;e[15]===a?d=e[16]:(d=(0,t.jsx)(oe,{connection:a,className:"sm:pt-8",children:f}),e[15]=a,e[16]=d);let p;e[17]===_?p=e[18]:(p=_(),e[17]=_,e[18]=p);let y;return e[19]!==s.width||e[20]!==a||e[21]!==k||e[22]!==d||e[23]!==p?(y=(0,t.jsxs)(te,{connection:a,isRunning:k,width:N,children:[d,p]}),e[19]=s.width,e[20]=a,e[21]=k,e[22]=d,e[23]=p,e[24]=y):y=e[24],y};function ve(){O.INSTANCE.stop()}var U=I();const we=()=>{let o=(0,U.c)(3),e=T(D);if(!B()||!e)return null;let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("span",{children:["Static"," ",(0,t.jsx)("a",{href:P.githubPage,target:"_blank",className:"text-(--sky-11) font-medium underline",children:"marimo"})," ","notebook - Run or edit for full interactivity"]}),o[0]=s):s=o[0];let r;return o[1]===e?r=o[2]:(r=(0,t.jsxs)("div",{className:"px-4 py-2 bg-(--sky-2) border-b border-(--sky-7) text-(--sky-11) flex justify-between items-center gap-4 print:hidden text-sm","data-testid":"static-notebook-banner",children:[s,(0,t.jsx)("span",{className:"shrink-0",children:(0,t.jsx)(Se,{code:e})})]}),o[1]=e,o[2]=r),r};var Se=o=>{let e=(0,U.c)(39),{code:s}=o,r=be()||"notebook.py",h=r.lastIndexOf("/");h!==-1&&(r=r.slice(h+1));let m=window.location.href,l;e[0]===s?l=e[1]:(l=xe({code:s,baseUrl:`${P.molab}/new`}),e[0]=s,e[1]=l);let n=l,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)(de,{asChild:!0,children:(0,t.jsx)(E,{"data-testid":"static-notebook-dialog-trigger",variant:"outline",size:"xs",children:"Run or Edit"})}),e[2]=j):j=e[2];let a;e[3]===r?a=e[4]:(a=(0,t.jsx)(ce,{children:r}),e[3]=r,e[4]=a);let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsxs)("p",{children:["This is a static"," ",(0,t.jsx)("a",{href:P.githubPage,target:"_blank",className:"text-(--sky-11) hover:underline font-medium",children:"marimo"})," ","notebook. To run interactively:"]}),e[5]=k):k=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("br",{}),e[6]=u):u=e[6];let b;e[7]===r?b=e[8]:(b=(0,t.jsx)("div",{className:"rounded-lg p-3 border bg-(--sky-2) border-(--sky-7)",children:(0,t.jsxs)("div",{className:"font-mono text-(--sky-11) leading-relaxed",children:["pip install marimo",u,"marimo edit ",r]})}),e[7]=r,e[8]=b);let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=!m.endsWith(".html")&&(0,t.jsxs)("div",{className:"rounded-lg p-3 border bg-(--sky-2) border-(--sky-7)",children:[(0,t.jsx)("div",{className:"text-sm text-(--sky-12) mb-1",children:"Or run directly from URL:"}),(0,t.jsxs)("div",{className:"font-mono text-(--sky-11) break-all",children:["marimo edit ",window.location.href]})]}),e[9]=g):g=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(ge,{size:12,strokeWidth:1.5,className:"mr-1.5 mt-px text-(--grass-11)"}),e[10]=_):_=e[10];let c;e[11]===n?c=e[12]:(c=(0,t.jsx)(E,{asChild:!0,variant:"outline",size:"xs",className:"shrink-0",children:(0,t.jsxs)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:[_,"Open in molab"]})}),e[11]=n,e[12]=c);let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsxs)("p",{className:"text-sm text-(--sky-12)",children:["Run this notebook in"," ",(0,t.jsx)("span",{className:"font-semibold",children:"molab"}),", marimo's cloud-hosted notebook platform."]}),e[13]=v):v=e[13];let N;e[14]===c?N=e[15]:(N=(0,t.jsxs)("div",{className:"pt-3 border-t flex gap-2 items-center",children:[c,v]}),e[14]=c,e[15]=N);let f;e[16]!==N||e[17]!==b?(f=(0,t.jsxs)(he,{className:"pt-3 text-left space-y-3",children:[k,b,g,N]}),e[16]=N,e[17]=b,e[18]=f):f=e[18];let d;e[19]!==f||e[20]!==a?(d=(0,t.jsxs)(ne,{children:[a,f]}),e[19]=f,e[20]=a,e[21]=d):d=e[21];let p;e[22]===s?p=e[23]:(p=async()=>{await me(s),ie({title:"Copied to clipboard"})},e[22]=s,e[23]=p);let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsx)(Z,{className:"w-3 h-3 mr-2"}),e[24]=y):y=e[24];let x;e[25]===p?x=e[26]:(x=(0,t.jsxs)(E,{"data-testid":"copy-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:p,children:[y,"Copy code"]}),e[25]=p,e[26]=x);let i;e[27]!==s||e[28]!==r?(i=()=>{K(new Blob([s],{type:"text/plain"}),r)},e[27]=s,e[28]=r,e[29]=i):i=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)(H,{className:"w-3 h-3 mr-2"}),e[30]=w):w=e[30];let S;e[31]===i?S=e[32]:(S=(0,t.jsxs)(E,{"data-testid":"download-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:i,children:[w,"Download"]}),e[31]=i,e[32]=S);let C;e[33]!==x||e[34]!==S?(C=(0,t.jsxs)("div",{className:"flex gap-3 pt-2",children:[x,S]}),e[33]=x,e[34]=S,e[35]=C):C=e[35];let z;return e[36]!==d||e[37]!==C?(z=(0,t.jsxs)(fe,{children:[j,(0,t.jsxs)(pe,{children:[d,C]})]}),e[36]=d,e[37]=C,e[38]=z):z=e[38],z},A=I(),Ce=W()||B(),ze=o=>{let e=(0,A.c)(9),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(we,{}),e[0]=s):s=e[0];let r;e[1]===o.appConfig?r=e[2]:(r=(0,t.jsx)(Ne,{appConfig:o.appConfig}),e[1]=o.appConfig,e[2]=r);let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=Ce&&(0,t.jsx)(Pe,{}),e[3]=h):h=e[3];let m;e[4]===r?m=e[5]:(m=(0,t.jsxs)(ue,{children:[s,r,h]}),e[4]=r,e[5]=m);let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(J,{}),e[6]=l):l=e[6];let n;return e[7]===m?n=e[8]:(n=(0,t.jsx)(se,{children:(0,t.jsxs)(je,{direction:"horizontal",autoSaveId:"marimo:chrome:v1:run1",children:[m,l]})}),e[7]=m,e[8]=n),n},Pe=()=>{let o=(0,A.c)(1),e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"fixed bottom-0 right-0 z-50","data-testid":"watermark",children:(0,t.jsxs)("a",{href:P.githubPage,target:"_blank",className:"text-sm text-(--grass-11) font-bold tracking-wide transition-colors bg-(--grass-4) hover:bg-(--grass-5) border-t border-l border-(--grass-8) px-3 py-1 rounded-tl-md flex items-center gap-2",children:[(0,t.jsx)("span",{children:"made with marimo"}),(0,t.jsx)(ye,{className:"h-4 w-auto"})]})}),o[0]=e):e=o[0],e},Ee=ze;export{Ee as default};
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-D87tudCA.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-9Au3XWKl.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-BFv3hW2s.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
@@ -243,7 +243,7 @@
243
243
  <link rel="stylesheet" crossorigin href="./assets/cells-jmgGt1lS.css">
244
244
  <link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
245
245
  <link rel="stylesheet" crossorigin href="./assets/JsonOutput-B7vuddcd.css">
246
- <link rel="stylesheet" crossorigin href="./assets/index-BFiDkTwh.css">
246
+ <link rel="stylesheet" crossorigin href="./assets/index-CeoQ1Qbe.css">
247
247
  </head>
248
248
  <body>
249
249
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.23.2-dev51",
3
+ "version": "0.23.2-dev53",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -22,6 +22,7 @@ import {
22
22
  DialogTrigger,
23
23
  } from "../ui/dialog";
24
24
  import { toast } from "../ui/use-toast";
25
+ import { MarimoPlusIcon } from "../icons/marimo-icons";
25
26
 
26
27
  export const StaticBanner: React.FC = () => {
27
28
  const code = useAtomValue(codeAtom);
@@ -66,7 +67,10 @@ const StaticBannerDialog = ({ code }: { code: string }) => {
66
67
  }
67
68
 
68
69
  const href = window.location.href;
69
- const wasmLink = createShareableLink({ code });
70
+ const molabLink = createShareableLink({
71
+ code,
72
+ baseUrl: `${Constants.molab}/new`,
73
+ });
70
74
 
71
75
  return (
72
76
  <Dialog>
@@ -114,21 +118,26 @@ const StaticBannerDialog = ({ code }: { code: string }) => {
114
118
  </div>
115
119
  )}
116
120
 
117
- <div className="pt-3 border-t border-(--sky-7)">
118
- <p className="text-sm text-(--sky-12) mb-2">
119
- <strong>Try in browser with WebAssembly:</strong>{" "}
120
- <a
121
- href={wasmLink}
122
- target="_blank"
123
- className="text-(--sky-11) hover:underline break-all"
124
- rel="noreferrer"
125
- >
126
- {wasmLink.slice(0, 50)}...
121
+ <div className="pt-3 border-t flex gap-2 items-center">
122
+ <Button
123
+ asChild={true}
124
+ variant="outline"
125
+ size="xs"
126
+ className="shrink-0"
127
+ >
128
+ <a href={molabLink} target="_blank" rel="noopener noreferrer">
129
+ <MarimoPlusIcon
130
+ size={12}
131
+ strokeWidth={1.5}
132
+ className="mr-1.5 mt-px text-(--grass-11)"
133
+ />
134
+ Open in molab
127
135
  </a>
128
- </p>
136
+ </Button>
129
137
  <p className="text-sm text-(--sky-12)">
130
- Note: WebAssembly may not work for all notebooks. Additionally,
131
- some dependencies may not be available in the browser.
138
+ Run this notebook in{" "}
139
+ <span className="font-semibold">molab</span>, marimo's
140
+ cloud-hosted notebook platform.
132
141
  </p>
133
142
  </div>
134
143
  </DialogDescription>