@marimo-team/frontend 0.23.16-dev5 → 0.23.16-dev6
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/{cell-editor-B5JVq7_q.js → cell-editor-Dc9n2AtH.js} +1 -1
- package/dist/assets/{command-palette-iOCqUIs1.js → command-palette-CfAVBwu9.js} +1 -1
- package/dist/assets/{edit-page-7X3HYey7.js → edit-page-C0GKZFRK.js} +4 -4
- package/dist/assets/{index-CMZzy-dF.js → index-BN0kAyO7.js} +2 -2
- package/dist/assets/index-xs-zSSrX.css +2 -0
- package/dist/assets/{layout-CUlZijwG.js → layout-8qIOoWr6.js} +2 -2
- package/dist/assets/{panels-Dj45fW-v.js → panels-DoYN5Sjm.js} +1 -1
- package/dist/assets/{reveal-component-BLMTmd8T.js → reveal-component-BxHiLG4_.js} +57 -57
- package/dist/assets/{run-page-B6pgDYEJ.js → run-page-Dwu5y6Vv.js} +1 -1
- package/dist/assets/{scratchpad-panel-B0mEqBNk.js → scratchpad-panel-7BZVzpvj.js} +1 -1
- package/dist/assets/{skeleton-D3QPxqWC.js → skeleton-BdSCqt9m.js} +1 -1
- package/dist/assets/{useNotebookActions-DTXAoukG.js → useNotebookActions-CAf3BzKW.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +198 -0
- package/src/components/slides/reveal-component.tsx +3 -2
- package/src/components/slides/slide-scroll-hint.tsx +161 -0
- package/dist/assets/index-A71LAt6h.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as I}from"./chunk-LvLJmgfZ.js";import{p as U,u as T}from"./useEvent-D91BmmQi.js";import{t as $}from"./react-Bj1aDYRI.js";import{Bi as D,E as W,b as q,h as F}from"./cells-Cf7bHHq3.js";import"./react-dom-CSu739Rf.js";import{t as R}from"./compiler-runtime-B3qBwwSJ.js";import{C as M}from"./utils-Z80SV4_d.js";import{n as z}from"./constants-CDyU_g2F.js";import{T as V,l as A,m as G,v as H}from"./config-BbOTTCYY.js";import"./readonly-python-code-CW_G5e4E.js";import{t as J}from"./cn-DYvqRARy.js";import{t as K}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-dUjPYOmm.js";import"./popover-DrHQ3KEt.js";import{Lt as Q,P as X}from"./JsonOutput-CkCD-FgM.js";import{r as Y}from"./download-BomYt3nl.js";import{n as Z,t as P}from"./button-eIihcbUw.js";import"./dist-12S8I4CH.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{r as ee}from"./requests-9-v2bhoi.js";import"./layout-
|
|
1
|
+
import{s as I}from"./chunk-LvLJmgfZ.js";import{p as U,u as T}from"./useEvent-D91BmmQi.js";import{t as $}from"./react-Bj1aDYRI.js";import{Bi as D,E as W,b as q,h as F}from"./cells-Cf7bHHq3.js";import"./react-dom-CSu739Rf.js";import{t as R}from"./compiler-runtime-B3qBwwSJ.js";import{C as M}from"./utils-Z80SV4_d.js";import{n as z}from"./constants-CDyU_g2F.js";import{T as V,l as A,m as G,v as H}from"./config-BbOTTCYY.js";import"./readonly-python-code-CW_G5e4E.js";import{t as J}from"./cn-DYvqRARy.js";import{t as K}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-dUjPYOmm.js";import"./popover-DrHQ3KEt.js";import{Lt as Q,P as X}from"./JsonOutput-CkCD-FgM.js";import{r as Y}from"./download-BomYt3nl.js";import{n as Z,t as P}from"./button-eIihcbUw.js";import"./dist-12S8I4CH.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{r as ee}from"./requests-9-v2bhoi.js";import"./layout-8qIOoWr6.js";import{l as te}from"./state-WBgc7MiA.js";import"./markdown-renderer-QvXG0CRk.js";import{t as re}from"./copy-3iHFdt22.js";import{d as se,i as oe,l as ae,n as ie,r as B,t as ne,u as me}from"./panels-DoYN5Sjm.js";import{t as le}from"./spinner-D-V4psAa.js";import"./dist-DcwTQG1A.js";import"./dist-DnjsPBRJ.js";import"./dist-BJZAIIze.js";import"./dist-aRc_dRed.js";import"./dist-CPjTeT8p.js";import{t as ce}from"./use-toast-BwJoaaDM.js";import{t as de}from"./session-CEFnN9Cq.js";import"./purify.es-CWmnYhGI.js";import"./dates-D-kIKDYA.js";import{n as pe}from"./copy-BtTOqPTS.js";import{a as he,c as fe,l as xe,n as be,r as je,t as ue}from"./dialog-D1DEsRZ2.js";import{t as ge}from"./share-CYpcX4N4.js";import"./tooltip-HLb6RxVp.js";import"./vega-loader.browser-Dun7Qe4B.js";import"./defaultLocale-DOVIEEPN.js";import"./defaultLocale-BUCH2FMc.js";import{a as ye}from"./cell-link-DqBkyAFe.js";import"./chunk-5FQGJX7Z-Cp0LZT-a.js";import"./html-to-image-CwmX28T9.js";import{n as ke,t as _e}from"./react-resizable-panels.browser.esm-Z-MD3n3J.js";import"./esm-BL7jQmzn.js";import"./name-cell-input-C6cukQ9k.js";import{n as Ne,t as ve}from"./marimo-icons-C_nFooxr.js";import"./ws-BmTnbVEi.js";import"./dist-D5ToCtv8.js";import"./dist-D35OyUMQ.js";import"./dist-ByK00N0T.js";import"./dist-C5kf6g-d.js";import"./dist-BaKJ0-Tb.js";import"./dist-DNGKAtWk.js";import"./dist-56ul6-mm.js";import"./dist-3N7-WLqi.js";import"./dist-CM-lWxt3.js";import"./esm-Cmv0Nuxi.js";var we=R(),Se=I($(),1),t=I(K(),1),Ce=U(o=>o(F)||!G(o(H).state));const ze=o=>{let e=(0,we.c)(22),{appConfig:s}=o,{setCells:r}=W(),{sendComponentValues:l}=ee(),a;e[0]===l?a=e[1]:(a=()=>(B.INSTANCE.start(l),Pe),e[0]=l,e[1]=a);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[2]=i):i=e[2],(0,Se.useEffect)(a,i);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=de(),e[3]=c):c=e[3];let g;e[4]===r?g=e[5]:(g={autoInstantiate:!0,setCells:r,sessionId:c},e[4]=r,e[5]=g);let{connection:j,reconnect:k}=ie(g),u=T(q),d;e:{if(typeof window>"u"){d=null;break e}let b,m;if(e[6]===Symbol.for("react.memo_cache_sentinel")){if(m=new URL(window.location.href),!m.searchParams.has("file")){d=null;break e}m.searchParams.delete("file"),b=m.searchParams.toString(),e[6]=b,e[7]=m,e[8]=d}else b=e[6],m=e[7],d=e[8];let y=b;d=y?`${m.pathname}?${y}`:m.pathname}let _=d,p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=_&&(0,t.jsx)("div",{className:"flex items-center px-6 pt-4 sm:-mt-8",children:(0,t.jsxs)("a",{href:_,"aria-label":"Back to gallery",className:J(Z({variant:"text",size:"sm"}),"gap-2 px-0 text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(te,{className:"size-4","aria-hidden":!0}),(0,t.jsx)("span",{children:"Back"})]})}),e[9]=p):p=e[9];let h;e[10]===j?h=e[11]:(h=(0,t.jsx)(se,{connection:j,className:"sm:pt-8",children:p}),e[10]=j,e[11]=h);let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(le,{className:"mx-auto"}),(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground mt-2",children:"Connecting..."})]}),e[12]=f):f=e[12];let n;e[13]===s?n=e[14]:(n=(0,t.jsx)(me,{requires:Ce,delay:2e3,fallback:f,children:(0,t.jsx)(oe,{appConfig:s,mode:"read"})}),e[13]=s,e[14]=n);let x;return e[15]!==s.width||e[16]!==j||e[17]!==u||e[18]!==k||e[19]!==h||e[20]!==n?(x=(0,t.jsxs)(ae,{connection:j,isRunning:u,width:s.width,onReconnect:k,children:[h,n]}),e[15]=s.width,e[16]=j,e[17]=u,e[18]=k,e[19]=h,e[20]=n,e[21]=x):x=e[21],x};function Pe(){B.INSTANCE.stop()}var O=R();const Re=()=>{let o=(0,O.c)(3),e=T(D);if(!A()||!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:z.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)(Ee,{code:e})})]}),o[1]=e,o[2]=r),r};var Ee=o=>{var E;let e=(0,O.c)(36),{code:s}=o,r=ye()||"notebook.py",l=r.lastIndexOf("/");l!==-1&&(r=r.slice(l+1));let[a]=M(),i=((E=a.sharing)==null?void 0:E.molab)!==!1,c=window.location.href,g;e[0]===s?g=e[1]:(g=ge({code:s,baseUrl:`${z.molab}/new`}),e[0]=s,e[1]=g);let j=g,k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(xe,{asChild:!0,children:(0,t.jsx)(P,{"data-testid":"static-notebook-dialog-trigger",variant:"outline",size:"xs",children:"Run or Edit"})}),e[2]=k):k=e[2];let u;e[3]===r?u=e[4]:(u=(0,t.jsx)(fe,{children:r}),e[3]=r,e[4]=u);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsxs)("p",{children:["This is a static"," ",(0,t.jsx)("a",{href:z.githubPage,target:"_blank",className:"text-(--sky-11) hover:underline font-medium",children:"marimo"})," ","notebook. To run interactively:"]}),e[5]=d):d=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)("br",{}),e[6]=_):_=e[6];let p;e[7]===r?p=e[8]:(p=(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",_,"marimo edit ",r]})}),e[7]=r,e[8]=p);let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=!c.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]=h):h=e[9];let f;e[10]!==i||e[11]!==j?(f=i&&(0,t.jsxs)("div",{className:"pt-3 border-t flex gap-2 items-center",children:[(0,t.jsx)(P,{asChild:!0,variant:"outline",size:"xs",className:"shrink-0",children:(0,t.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)(Ne,{size:12,strokeWidth:1.5,className:"mr-1.5 mt-px text-(--grass-11)"}),"Open in molab"]})}),(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[10]=i,e[11]=j,e[12]=f):f=e[12];let n;e[13]!==p||e[14]!==f?(n=(0,t.jsxs)(je,{className:"pt-3 text-left space-y-3",children:[d,p,h,f]}),e[13]=p,e[14]=f,e[15]=n):n=e[15];let x;e[16]!==u||e[17]!==n?(x=(0,t.jsxs)(he,{children:[u,n]}),e[16]=u,e[17]=n,e[18]=x):x=e[18];let b;e[19]===s?b=e[20]:(b=async()=>{await pe(s),ce({title:"Copied to clipboard"})},e[19]=s,e[20]=b);let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(re,{className:"w-3 h-3 mr-2"}),e[21]=m):m=e[21];let y;e[22]===b?y=e[23]:(y=(0,t.jsxs)(P,{"data-testid":"copy-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:b,children:[m,"Copy code"]}),e[22]=b,e[23]=y);let N;e[24]!==s||e[25]!==r?(N=()=>{Y(new Blob([s],{type:"text/plain"}),r)},e[24]=s,e[25]=r,e[26]=N):N=e[26];let S;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(Q,{className:"w-3 h-3 mr-2"}),e[27]=S):S=e[27];let v;e[28]===N?v=e[29]:(v=(0,t.jsxs)(P,{"data-testid":"download-static-notebook-dialog-button",variant:"outline",size:"sm",onClick:N,children:[S,"Download"]}),e[28]=N,e[29]=v);let w;e[30]!==y||e[31]!==v?(w=(0,t.jsxs)("div",{className:"flex gap-3 pt-2",children:[y,v]}),e[30]=y,e[31]=v,e[32]=w):w=e[32];let C;return e[33]!==x||e[34]!==w?(C=(0,t.jsxs)(ue,{children:[k,(0,t.jsxs)(be,{children:[x,w]})]}),e[33]=x,e[34]=w,e[35]=C):C=e[35],C},L=R(),Ie=V()||A(),Te=o=>{let e=(0,L.c)(9),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(Re,{}),e[0]=s):s=e[0];let r;e[1]===o.appConfig?r=e[2]:(r=(0,t.jsx)(ze,{appConfig:o.appConfig}),e[1]=o.appConfig,e[2]=r);let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=Ie&&(0,t.jsx)(Ae,{}),e[3]=l):l=e[3];let a;e[4]===r?a=e[5]:(a=(0,t.jsxs)(_e,{children:[s,r,l]}),e[4]=r,e[5]=a);let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(X,{}),e[6]=i):i=e[6];let c;return e[7]===a?c=e[8]:(c=(0,t.jsx)(ne,{children:(0,t.jsxs)(ke,{direction:"horizontal",autoSaveId:"marimo:chrome:v1:run1",children:[a,i]})}),e[7]=a,e[8]=c),c},Ae=()=>{let o=(0,L.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 print:hidden","data-testid":"watermark",children:(0,t.jsxs)("a",{href:z.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)(ve,{className:"h-4 w-auto"})]})}),o[0]=e):e=o[0],e},Be=Te;export{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as be,l as ye,n as V,p as oe,u as we}from"./useEvent-D91BmmQi.js";import{t as Ne}from"./react-Bj1aDYRI.js";import{E as ze,F as ke,Ki as Ce,ea as Se,ta as n,zn as Oe,__tla as Ae}from"./cells-Cf7bHHq3.js";import"./react-dom-CSu739Rf.js";import{t as se}from"./compiler-runtime-B3qBwwSJ.js";import{_ as ie}from"./useEventListener-B_w3A283.js";import{C as Ie}from"./utils-Z80SV4_d.js";import{t as Me}from"./constants-CDyU_g2F.js";import"./readonly-python-code-CW_G5e4E.js";import{t as le}from"./cn-DYvqRARy.js";import{t as Ee}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-dUjPYOmm.js";import"./popover-DrHQ3KEt.js";import{n as Le,__tla as Pe}from"./JsonOutput-CkCD-FgM.js";import"./download-BomYt3nl.js";import{t as k}from"./tooltip-CFX4fYHU.js";import{t as C}from"./button-eIihcbUw.js";import"./dist-12S8I4CH.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{r as Re}from"./requests-9-v2bhoi.js";import{t as me}from"./createLucideIcon-w-Qo9n0R.js";import{f as De,__tla as He}from"./layout-
|
|
1
|
+
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as be,l as ye,n as V,p as oe,u as we}from"./useEvent-D91BmmQi.js";import{t as Ne}from"./react-Bj1aDYRI.js";import{E as ze,F as ke,Ki as Ce,ea as Se,ta as n,zn as Oe,__tla as Ae}from"./cells-Cf7bHHq3.js";import"./react-dom-CSu739Rf.js";import{t as se}from"./compiler-runtime-B3qBwwSJ.js";import{_ as ie}from"./useEventListener-B_w3A283.js";import{C as Ie}from"./utils-Z80SV4_d.js";import{t as Me}from"./constants-CDyU_g2F.js";import"./readonly-python-code-CW_G5e4E.js";import{t as le}from"./cn-DYvqRARy.js";import{t as Ee}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-dUjPYOmm.js";import"./popover-DrHQ3KEt.js";import{n as Le,__tla as Pe}from"./JsonOutput-CkCD-FgM.js";import"./download-BomYt3nl.js";import{t as k}from"./tooltip-CFX4fYHU.js";import{t as C}from"./button-eIihcbUw.js";import"./dist-12S8I4CH.js";import"./cjs-D5tzp-Y6.js";import"./main-BNL5rxQw.js";import"./useNonce-CbdaHKzX.js";import{r as Re}from"./requests-9-v2bhoi.js";import{t as me}from"./createLucideIcon-w-Qo9n0R.js";import{f as De,__tla as He}from"./layout-8qIOoWr6.js";import{n as Ve,t as qe,__tla as Te}from"./LazyAnyLanguageCodeMirror-sVm_hz8A.js";import{__tla as Fe}from"./markdown-renderer-QvXG0CRk.js";import{u as Ge}from"./toDate-Ct2FT81-.js";import{t as Ke,__tla as Ue}from"./cell-editor-Dc9n2AtH.js";import{t as Be}from"./spinner-D-V4psAa.js";import{i as Je}from"./useDeleteCell-EPH4kcG7.js";import"./dist-DcwTQG1A.js";import"./dist-DnjsPBRJ.js";import"./dist-BJZAIIze.js";import"./dist-aRc_dRed.js";import"./dist-CPjTeT8p.js";import"./session-CEFnN9Cq.js";import{r as Qe}from"./useTheme-KXqAyDPC.js";import"./purify.es-CWmnYhGI.js";import"./dates-D-kIKDYA.js";import"./tooltip-HLb6RxVp.js";import"./vega-loader.browser-Dun7Qe4B.js";import"./defaultLocale-DOVIEEPN.js";import"./defaultLocale-BUCH2FMc.js";import{__tla as We}from"./chunk-5FQGJX7Z-Cp0LZT-a.js";import"./html-to-image-CwmX28T9.js";import{o as Xe}from"./focus-DiEyfiAG.js";import{n as Ye,r as Ze,t as ne}from"./react-resizable-panels.browser.esm-Z-MD3n3J.js";import{a as $e}from"./renderShortcut-BZLr8D7H.js";import"./esm-BL7jQmzn.js";import"./name-cell-input-C6cukQ9k.js";import{n as et,r as tt}from"./panel-context-CH75ubGG.js";import{__tla as rt}from"./loro_wasm_bg-RNUly1SE.js";import"./ws-BmTnbVEi.js";import"./Inputs-B8-VCb_j.js";import"./dist-D5ToCtv8.js";import"./dist-D35OyUMQ.js";import"./dist-ByK00N0T.js";import"./dist-C5kf6g-d.js";import"./dist-BaKJ0-Tb.js";import"./dist-DNGKAtWk.js";import"./dist-56ul6-mm.js";import"./dist-3N7-WLqi.js";import"./dist-CM-lWxt3.js";import"./esm-Cmv0Nuxi.js";import{t as at}from"./kiosk-mode-ABm3oYgq.js";let ce,ot=Promise.all([(()=>{try{return Ae}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return rt}catch{}})()]).then(async()=>{var de=me("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),pe=me("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),he=se(),q=ae(Ne(),1),ue=15;const T=Ce("marimo:scratchpadHistory:v1",[],Oe),fe=oe(!1),xe=oe(null,(e,s,i)=>{if(i=i.trim(),!i)return;let m=e(T);s(T,[i,...m.filter(c=>c!==i)].slice(0,ue))});var t=ae(Ee(),1),_e={hide_code:!1,disabled:!1};const ve=()=>{var re;let e=(0,he.c)(60),s=ke(),[i]=Ie(),{theme:m}=Qe(),c=(0,q.useRef)(null),F=Xe(),{createNewCell:G,updateCellCode:d}=ze(),{sendRunScratchpad:p}=Re(),S=et(),K=tt(),l=s.cellRuntime[n],U=l==null?void 0:l.output,O=l==null?void 0:l.status,B=l==null?void 0:l.consoleOutputs,r=((re=s.cellData.__scratch__)==null?void 0:re.code)??"",J=be(xe),[o,h]=ye(fe),u=we(T),A;e[0]!==J||e[1]!==r||e[2]!==p?(A=()=>{p({code:r}),J(r)},e[0]=J,e[1]=r,e[2]=p,e[3]=A):A=e[3];let f=V(A),I;e[4]!==r||e[5]!==G||e[6]!==F?(I=()=>{r.trim()&&G({code:r,before:!1,cellId:F??"__end__"})},e[4]=r,e[5]=G,e[6]=F,e[7]=I):I=e[7];let Q=V(I),M;e[8]!==p||e[9]!==d?(M=()=>{d({cellId:n,code:"",formattingChange:!1}),p({code:""});let a=c.current;a&&a.dispatch({changes:{from:0,to:a.state.doc.length,insert:""}})},e[8]=p,e[9]=d,e[10]=M):M=e[10];let W=V(M),E;e[11]!==h||e[12]!==d?(E=a=>{h(!1),d({cellId:n,code:a,formattingChange:!1});let z=c.current;z&&z.dispatch({changes:{from:0,to:z.state.doc.length,insert:a}})},e[11]=h,e[12]=d,e[13]=E):E=e[13];let X=V(E),[Y,ge]=(0,q.useState)(),L;e[14]!==X||e[15]!==u||e[16]!==o||e[17]!==m?(L=()=>o?(0,t.jsx)("div",{className:"absolute inset-0 z-100 bg-background p-3 border-none overflow-auto",children:(0,t.jsx)("div",{className:"overflow-auto flex flex-col gap-3",children:u.map((a,z)=>(0,t.jsx)("div",{className:"border rounded-md hover:shadow-sm cursor-pointer hover:border-input overflow-hidden",onClick:()=>X(a),children:(0,t.jsx)(q.Suspense,{children:(0,t.jsx)(qe,{language:"python",theme:m,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},value:a.trim(),editable:!1,readOnly:!0})})},z))})}):null,e[14]=X,e[15]=u,e[16]=o,e[17]=m,e[18]=L):L=e[18];let Z=L,P;e[19]!==W||e[20]!==Q||e[21]!==f||e[22]!==u.length||e[23]!==o||e[24]!==h||e[25]!==O?(P=()=>(0,t.jsxs)("div",{className:"flex items-center shrink-0 border-b",children:[(0,t.jsx)(k,{content:$e("cell.run"),children:(0,t.jsx)(C,{"data-testid":"scratchpad-run-button",onClick:f,disabled:o,variant:"text",size:"xs",children:(0,t.jsx)(Je,{color:"var(--grass-11)",size:16})})}),(0,t.jsx)(k,{content:"Clear code and outputs",children:(0,t.jsx)(C,{disabled:o,size:"xs",variant:"text",onClick:W,children:(0,t.jsx)(de,{size:16})})}),(0,t.jsx)(at,{children:(0,t.jsx)(k,{content:"Insert code",children:(0,t.jsx)(C,{disabled:o,size:"xs",variant:"text",onClick:Q,children:(0,t.jsx)(Ve,{size:16})})})}),(O==="running"||O==="queued")&&(0,t.jsx)(Be,{className:"inline",size:"small"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(k,{content:"Toggle history",children:(0,t.jsx)(C,{size:"xs",variant:"text",className:le(o&&"bg-(--sky-3) rounded-none"),onClick:()=>h(!o),disabled:u.length===0,children:(0,t.jsx)(pe,{size:16})})}),(0,t.jsx)(k,{content:(0,t.jsx)("span",{className:"block max-w-prose",children:"Use this scratchpad to experiment with code without restrictions on variable names. Variables defined here aren't saved to notebook memory, and the code is not saved in the notebook file."}),children:(0,t.jsx)(C,{size:"xs",variant:"text",children:(0,t.jsx)(Ge,{size:16})})})]}),e[19]=W,e[20]=Q,e[21]=f,e[22]=u.length,e[23]=o,e[24]=h,e[25]=O,e[26]=P):P=e[26];let $=P,je=S==="vertical",R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=Se.create(n),e[27]=R):R=e[27];let x;e[28]===$?x=e[29]:(x=$(),e[28]=$,e[29]=x);let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=a=>{c.current=a},e[30]=D):D=e[30];let _;e[31]!==r||e[32]!==f||e[33]!==Y||e[34]!==m||e[35]!==i?(_=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Ke,{theme:m,showPlaceholder:!1,id:n,code:r,config:_e,status:"idle",serializedEditorState:null,runCell:f,userConfig:i,editorViewRef:c,setEditorView:D,hidden:!1,showHiddenCode:ie.NOOP,languageAdapter:Y,setLanguageAdapter:ge})}),e[31]=r,e[32]=f,e[33]=Y,e[34]=m,e[35]=i,e[36]=_):_=e[36];let v;e[37]===Z?v=e[38]:(v=Z(),e[37]=Z,e[38]=v);let g;e[39]!==v||e[40]!==x||e[41]!==_?(g=(0,t.jsx)(ne,{defaultSize:40,minSize:20,maxSize:70,children:(0,t.jsxs)("div",{className:"h-full flex flex-col overflow-hidden relative",children:[x,_,v]})}),e[39]=v,e[40]=x,e[41]=_,e[42]=g):g=e[42];let ee=je?"h-1":"w-1",j;e[43]===ee?j=e[44]:(j=le("bg-border hover:bg-primary/50 transition-colors",ee),e[43]=ee,e[44]=j);let b;e[45]===j?b=e[46]:(b=(0,t.jsx)(Ze,{className:j}),e[45]=j,e[46]=b);let y;e[47]===U?y=e[48]:(y=(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(Le,{allowExpand:!1,output:U,className:Me.outputArea,cellId:n,stale:!1,loading:!1})}),e[47]=U,e[48]=y);let w;e[49]===B?w=e[50]:(w=(0,t.jsx)("div",{className:"overflow-auto shrink-0 max-h-[50%]",children:(0,t.jsx)(De,{consoleOutputs:B,className:"overflow-auto",stale:!1,interrupted:!1,cellName:"_",onSubmitDebugger:ie.NOOP,cellId:n,debuggerActive:!1})}),e[49]=B,e[50]=w);let N;e[51]!==y||e[52]!==w?(N=(0,t.jsx)(ne,{defaultSize:60,minSize:20,children:(0,t.jsxs)("div",{className:"h-full flex flex-col divide-y overflow-hidden",children:[y,w]})}),e[51]=y,e[52]=w,e[53]=N):N=e[53];let H;return e[54]!==S||e[55]!==K||e[56]!==g||e[57]!==b||e[58]!==N?(H=(0,t.jsx)("div",{className:"flex flex-col h-full overflow-hidden",id:R,children:(0,t.jsxs)(Ye,{direction:S,className:"h-full",children:[g,b,N]},K)}),e[54]=S,e[55]=K,e[56]=g,e[57]=b,e[58]=N,e[59]=H):H=e[59],H};let te;te=se(),ce=()=>{let e=(0,te.c)(1),s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(ve,{}),e[0]=s):s=e[0],s}});export{ot as __tla,ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var A=Object.defineProperty;var N=(t,e,a)=>e in t?A(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var b=(t,e,a)=>N(t,typeof e!="symbol"?e+"":e,a);import{s as V}from"./chunk-LvLJmgfZ.js";import{u as I}from"./useEvent-D91BmmQi.js";import{a as T}from"./cells-Cf7bHHq3.js";import{t as M}from"./compiler-runtime-B3qBwwSJ.js";import{g as k}from"./useEventListener-B_w3A283.js";import{t as E}from"./objects-BlG0ZrO0.js";import{o as P}from"./utils-Z80SV4_d.js";import{v as _,w as D}from"./config-BbOTTCYY.js";import{t as z}from"./cn-DYvqRARy.js";import{t as $}from"./jsx-runtime-Blw4afVn.js";import{s as B,u as H}from"./download-BomYt3nl.js";import{r as L}from"./requests-9-v2bhoi.js";import{F as R}from"./layout-
|
|
1
|
+
var A=Object.defineProperty;var N=(t,e,a)=>e in t?A(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var b=(t,e,a)=>N(t,typeof e!="symbol"?e+"":e,a);import{s as V}from"./chunk-LvLJmgfZ.js";import{u as I}from"./useEvent-D91BmmQi.js";import{a as T}from"./cells-Cf7bHHq3.js";import{t as M}from"./compiler-runtime-B3qBwwSJ.js";import{g as k}from"./useEventListener-B_w3A283.js";import{t as E}from"./objects-BlG0ZrO0.js";import{o as P}from"./utils-Z80SV4_d.js";import{v as _,w as D}from"./config-BbOTTCYY.js";import{t as z}from"./cn-DYvqRARy.js";import{t as $}from"./jsx-runtime-Blw4afVn.js";import{s as B,u as H}from"./download-BomYt3nl.js";import{r as L}from"./requests-9-v2bhoi.js";import{F as R}from"./layout-8qIOoWr6.js";import{t as Y}from"./Deferred-D2igisxY.js";import{t as q}from"./use-toast-BwJoaaDM.js";import{t as x}from"./useInterval-CC0vKpWm.js";var G=class{constructor(){b(this,"capturedInputs",new Map);b(this,"inFlight",new Map)}cancelEntry(t){t.controller.abort(),t.deferred.status==="pending"&&t.deferred.resolve(void 0)}needsCapture(t,e){if(this.capturedInputs.get(t)===e)return!1;let a=this.inFlight.get(t);return!(a&&a.inputValue===e)}waitForInFlight(t,e){let a=this.inFlight.get(t);return a&&a.inputValue===e?a.deferred.promise:null}startCapture(t,e){let a=this.inFlight.get(t);a&&this.cancelEntry(a);let r=new AbortController,i=new Y,s={controller:r,inputValue:e,deferred:i};return this.inFlight.set(t,s),{signal:r.signal,markCaptured:p=>{this.inFlight.get(t)===s&&(i.resolve(p),this.capturedInputs.set(t,e),this.inFlight.delete(t))},markFailed:()=>{this.inFlight.get(t)===s&&(i.resolve(void 0),this.inFlight.delete(t))}}}prune(t){for(let e of this.capturedInputs.keys())t.has(e)||this.capturedInputs.delete(e);for(let[e,a]of this.inFlight)t.has(e)||(this.cancelEntry(a),this.inFlight.delete(e))}get isCapturing(){return this.inFlight.size>0}abort(){for(let t of this.inFlight.values())this.cancelEntry(t);this.inFlight.clear()}reset(){this.abort(),this.capturedInputs.clear()}},J=M(),S=5e3;function K(){let t=(0,J.c)(14),e=I(P),{state:a}=I(_),r=e.auto_download.includes("markdown"),i=e.auto_download.includes("html"),s=e.auto_download.includes("ipynb"),p=a===D.OPEN,m=!r||!p,d=!i||!p,c=!s||!p,{autoExportAsHTML:l,autoExportAsIPYNB:o,autoExportAsMarkdown:n,updateCellOutputs:u}=L(),h=O(),f;t[0]===n?f=t[1]:(f=async()=>{await n({download:!1})},t[0]=n,t[1]=f);let g;t[2]===m?g=t[3]:(g={delayMs:S,whenVisible:!0,disabled:m},t[2]=m,t[3]=g),x(f,g);let w;t[4]===l?w=t[5]:(w=async()=>{await l({download:!1,includeCode:!0,files:R.INSTANCE.filenames()})},t[4]=l,t[5]=w);let v;t[6]===d?v=t[7]:(v={delayMs:S,whenVisible:!0,disabled:d},t[6]=d,t[7]=v),x(w,v);let F;t[8]!==o||t[9]!==h||t[10]!==u?(F=async()=>{await j({takeScreenshots:()=>h({progress:H.indeterminate()}),updateCellOutputs:u}),await o({download:!1})},t[8]=o,t[9]=h,t[10]=u,t[11]=F):F=t[11];let y;t[12]===c?y=t[13]:(y={delayMs:S,whenVisible:!0,disabled:c,skipIfRunning:!0},t[12]=c,t[13]=y),x(F,y)}var Q=new Set(["text/html","application/vnd.vegalite.v5+json","application/vnd.vega.v5+json","application/vnd.vegalite.v6+json","application/vnd.vega.v6+json"]);const C=new G;function O(){let t=I(T);return async e=>{var d,c;let{progress:a}=e,r=new Set(E.keys(t));C.prune(r);let i=[],s=[];for(let[l,o]of E.entries(t)){let n=(d=o.output)==null?void 0:d.data;if((c=o.output)!=null&&c.mimetype&&Q.has(o.output.mimetype)&&n)if(C.needsCapture(l,n))i.push([l,n]);else{let u=C.waitForInFlight(l,n);u&&s.push({cellId:l,promise:u})}}if(i.length===0&&s.length===0)return{};i.length>0&&a.addTotal(i.length);let p={};for(let[l,o]of i){let n=C.startCapture(l,o);try{let u=await B(l);if(n.signal.aborted)continue;if(!u){k.error(`Failed to capture screenshot for cell ${l}`),n.markFailed();continue}let h=["image/png",u];p[l]=h,n.markCaptured(h)}catch(u){k.error(`Error screenshotting cell ${l}:`,u),n.markFailed()}finally{a.increment(1)}}let m=await Promise.allSettled(s.map(({promise:l})=>l));for(let[l,{cellId:o}]of s.entries()){let n=m[l];n.status==="fulfilled"&&n.value&&(p[o]=n.value)}return p}}async function j(t){let{takeScreenshots:e,updateCellOutputs:a}=t;try{let r=await e();E.size(r)>0&&await a({cellIdsToOutput:r})}catch(r){k.error("Error updating cell outputs with screenshots:",r),q({title:"Failed to capture cell outputs",description:"Some outputs may not appear in the PDF. Continuing with export.",variant:"danger"})}}var U=M(),W=V($(),1),X=t=>{let e=(0,U.c)(8),a,r;e[0]===t?(a=e[1],r=e[2]):({className:a,...r}=t,e[0]=t,e[1]=a,e[2]=r);let i;e[3]===a?i=e[4]:(i=z("animate-pulse rounded-md bg-muted",a),e[3]=a,e[4]=i);let s;return e[5]!==r||e[6]!==i?(s=(0,W.jsx)("div",{className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s};export{O as i,j as n,K as r,X as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as _e}from"./chunk-LvLJmgfZ.js";import{d as R,i as St,l as At,p as _t,u as N}from"./useEvent-D91BmmQi.js";import{t as Dt}from"./react-Bj1aDYRI.js";import{An as Et,Cr as It,E as De,Fn as Pt,Hi as Lt,Jt as Tt,Kn as Ot,Li as Ht,Ln as Rt,Lt as Ee,Nn as $t,Nr as Bt,Or as Ft,Pn as qt,T as Ut,Tr as Yt,ct as Kt,ea as ke,g as Vt,m as Ie,si as Gt,st as Jt,t as Xt,ut as Pe,wr as Le,y as Qt}from"./cells-Cf7bHHq3.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{n as Zt,r as ea,x as ta}from"./ai-model-dropdown-DXgLphFa.js";import{g as $,n as aa}from"./useEventListener-B_w3A283.js";import{t as Te}from"./objects-BlG0ZrO0.js";import{C as na,r as oa}from"./utils-Z80SV4_d.js";import{n as C,t as Oe}from"./constants-CDyU_g2F.js";import{T as ee,v as He,w as Re}from"./config-BbOTTCYY.js";import{c as sa}from"./readonly-python-code-CW_G5e4E.js";import{t as ra}from"./cn-DYvqRARy.js";import{t as la}from"./jsx-runtime-Blw4afVn.js";import{o as ia}from"./alert-dialog-BXegNC0I.js";import{a as da,c as ca,i as ha,n as ma,r as ua,s as pa,t as fa}from"./select-B5TFNjmU.js";import{Lt as xa}from"./JsonOutput-CkCD-FgM.js";import{c as $e,d as we,n as ba,o as ya,r as ge,t as ka}from"./download-BomYt3nl.js";import{t as wa}from"./tooltip-CFX4fYHU.js";import{r as ga,t as P}from"./button-eIihcbUw.js";import{i as ja,t as je}from"./strings-Djnbwmfl.js";import{r as L}from"./requests-9-v2bhoi.js";import{t as k}from"./createLucideIcon-w-Qo9n0R.js";import{F as va,I as Ca,L as Na,R as Be,a as Fe,d as za,i as qe,u as Ue}from"./layout-
|
|
1
|
+
import{s as _e}from"./chunk-LvLJmgfZ.js";import{d as R,i as St,l as At,p as _t,u as N}from"./useEvent-D91BmmQi.js";import{t as Dt}from"./react-Bj1aDYRI.js";import{An as Et,Cr as It,E as De,Fn as Pt,Hi as Lt,Jt as Tt,Kn as Ot,Li as Ht,Ln as Rt,Lt as Ee,Nn as $t,Nr as Bt,Or as Ft,Pn as qt,T as Ut,Tr as Yt,ct as Kt,ea as ke,g as Vt,m as Ie,si as Gt,st as Jt,t as Xt,ut as Pe,wr as Le,y as Qt}from"./cells-Cf7bHHq3.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{n as Zt,r as ea,x as ta}from"./ai-model-dropdown-DXgLphFa.js";import{g as $,n as aa}from"./useEventListener-B_w3A283.js";import{t as Te}from"./objects-BlG0ZrO0.js";import{C as na,r as oa}from"./utils-Z80SV4_d.js";import{n as C,t as Oe}from"./constants-CDyU_g2F.js";import{T as ee,v as He,w as Re}from"./config-BbOTTCYY.js";import{c as sa}from"./readonly-python-code-CW_G5e4E.js";import{t as ra}from"./cn-DYvqRARy.js";import{t as la}from"./jsx-runtime-Blw4afVn.js";import{o as ia}from"./alert-dialog-BXegNC0I.js";import{a as da,c as ca,i as ha,n as ma,r as ua,s as pa,t as fa}from"./select-B5TFNjmU.js";import{Lt as xa}from"./JsonOutput-CkCD-FgM.js";import{c as $e,d as we,n as ba,o as ya,r as ge,t as ka}from"./download-BomYt3nl.js";import{t as wa}from"./tooltip-CFX4fYHU.js";import{r as ga,t as P}from"./button-eIihcbUw.js";import{i as ja,t as je}from"./strings-Djnbwmfl.js";import{r as L}from"./requests-9-v2bhoi.js";import{t as k}from"./createLucideIcon-w-Qo9n0R.js";import{F as va,I as Ca,L as Na,R as Be,a as Fe,d as za,i as qe,u as Ue}from"./layout-8qIOoWr6.js";import{t as Ye}from"./check-rzLRd0j9.js";import{r as Ma}from"./useCellActionButton-CRfIEVB5.js";import{t as Wa}from"./code-B2aKtXoe.js";import{t as Sa}from"./copy-3iHFdt22.js";import{t as Ke}from"./eye-off-BOZA7gbn.js";import{t as Ve}from"./external-link-BOlXZUla.js";import{t as te}from"./file-CJH9JNGH.js";import{u as Aa}from"./form-B6BkSCJb.js";import{n as _a,r as Da,t as Ea}from"./youtube-OwaksuQt.js";import{i as Ia,n as Ge}from"./add-connection-dialog-B-jCRNTN.js";import{t as Pa}from"./house-DS0r7dNZ.js";import{t as La}from"./image-5XI2VU-q.js";import{t as Ta}from"./link-CHdiBDr5.js";import{r as Oa}from"./input-CqrUjynb.js";import{t as Ha}from"./settings-D_PiwXwo.js";import{t as Ra}from"./sparkles-DUCpRFlS.js";import{y as $a}from"./textarea-CpFfEUet.js";import{t as Ba}from"./square-DFICx2Qv.js";import{t as Je}from"./triangle-alert-BL4YVsPy.js";import{t as W}from"./use-toast-BwJoaaDM.js";import{n as Xe,t as Fa}from"./paths-BKO-pHK6.js";import{o as qa}from"./session-CEFnN9Cq.js";import{n as ae}from"./copy-BtTOqPTS.js";import{t as Qe}from"./copy-icon-C2pG0ZNK.js";import{r as Ua}from"./useRunCells-CSSF_mJ0.js";import{a as Ze,c as et,i as Ya,n as tt,r as at}from"./dialog-D1DEsRZ2.js";import{n as ne}from"./ImperativeModal-BIavOiUv.js";import{r as Ka,t as nt}from"./share-CYpcX4N4.js";import{a as Va}from"./cell-link-DqBkyAFe.js";import{n as ot}from"./useAsyncData-Bg5iAViP.js";import{a as Ga}from"./renderShortcut-BZLr8D7H.js";import{t as Ja}from"./icons-CIPE8AIY.js";import{i as Xa,n as st}from"./error-entries-Birw-8VX.js";import{t as Qa}from"./pair-with-agent-modal-CKOYwOYw.js";import{t as Za}from"./github-_JH-0hIO.js";import{n as rt}from"./marimo-icons-C_nFooxr.js";import{t as en}from"./links-CToBjIIj.js";import{i as tn,n as lt,t as ve}from"./skeleton-BdSCqt9m.js";import{t as it}from"./types-Da7lA5YC.js";var an=k("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),nn=k("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),dt=k("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"}]]),ct=k("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"}]]),ht=k("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"}]]),on=k("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"}]]),sn=k("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"}]]),rn=k("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"}]]),mt=k("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ln=k("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"}]]),dn=k("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),ut=k("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"}]]),cn=k("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"}]]),hn=k("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"}]]),pt=k("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"}]]),mn=z(),T=_e(Dt(),1);function Ce(e,t){let n=(0,mn.c)(11),o;n[0]===t?o=n[1]:(o=new Ht(t),n[0]=t,n[1]=o);let s=o,l;n[2]!==e||n[3]!==s?(l=()=>s.get(e),n[2]=e,n[3]=s,n[4]=l):l=n[4];let[r,d]=(0,T.useState)(l),i;n[5]!==e||n[6]!==s?(i=x=>{d(x),s.set(e,x)},n[5]=e,n[6]=s,n[7]=i):i=n[7];let c=i,h;return n[8]!==c||n[9]!==r?(h=[r,c],n[8]=c,n[9]=r,n[10]=h):h=n[10],h}function un(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function pn(e,t,n,o){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":o}}function Ne(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),s=>s[0].length)),o="`".repeat(n+1);return`${o}${e}
|
|
2
2
|
${t}
|
|
3
3
|
${o}`}function fn(e,t){let n=e.includes("?")?"&":"?",o=[],s=e,l=0;for(let[r,d]of Object.entries(t)){if(d.length===0)continue;let i=`${r}=${encodeURIComponent(d)}`,c=`${s}${l===0?n:"&"}${i}`;if(c.length>6e3){o.push(r);continue}s=c,l+=1}return{url:s,omitted:o}}function ze(e,t){return["<details>",`<summary>${je.htmlEscape(e)??""}</summary>`,"",t,"","</details>"].join(`
|
|
4
4
|
`)}function xn(e){return ze("Environment",Ne("json",JSON.stringify(e,null,2)))}function ft(e){return ze("Errors",Ne("text",e.map(st).join(`
|
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-BN0kAyO7.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/objects-BlG0ZrO0.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
<link rel="stylesheet" crossorigin href="./assets/cells-BVzo2MHf.css">
|
|
250
250
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
|
|
251
251
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-BQtz7-np.css">
|
|
252
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
252
|
+
<link rel="stylesheet" crossorigin href="./assets/index-xs-zSSrX.css">
|
|
253
253
|
</head>
|
|
254
254
|
<body>
|
|
255
255
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { act, render, screen } from "@testing-library/react";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import {
|
|
6
|
+
shouldShowScrollHint,
|
|
7
|
+
SlideScrollContainer,
|
|
8
|
+
} from "../slide-scroll-hint";
|
|
9
|
+
|
|
10
|
+
describe("shouldShowScrollHint", () => {
|
|
11
|
+
it("shows when content overflows and scroll is at the top", () => {
|
|
12
|
+
expect(
|
|
13
|
+
shouldShowScrollHint({
|
|
14
|
+
scrollHeight: 800,
|
|
15
|
+
clientHeight: 400,
|
|
16
|
+
scrollTop: 0,
|
|
17
|
+
}),
|
|
18
|
+
).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("hides when content fits", () => {
|
|
22
|
+
expect(
|
|
23
|
+
shouldShowScrollHint({
|
|
24
|
+
scrollHeight: 300,
|
|
25
|
+
clientHeight: 400,
|
|
26
|
+
scrollTop: 0,
|
|
27
|
+
}),
|
|
28
|
+
).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("hides after the user scrolls down", () => {
|
|
32
|
+
expect(
|
|
33
|
+
shouldShowScrollHint({
|
|
34
|
+
scrollHeight: 800,
|
|
35
|
+
clientHeight: 400,
|
|
36
|
+
scrollTop: 40,
|
|
37
|
+
}),
|
|
38
|
+
).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("ignores sub-pixel overflow", () => {
|
|
42
|
+
expect(
|
|
43
|
+
shouldShowScrollHint({
|
|
44
|
+
scrollHeight: 401,
|
|
45
|
+
clientHeight: 400,
|
|
46
|
+
scrollTop: 0,
|
|
47
|
+
}),
|
|
48
|
+
).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("still shows within the top threshold", () => {
|
|
52
|
+
expect(
|
|
53
|
+
shouldShowScrollHint({
|
|
54
|
+
scrollHeight: 800,
|
|
55
|
+
clientHeight: 400,
|
|
56
|
+
scrollTop: 8,
|
|
57
|
+
}),
|
|
58
|
+
).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe("SlideScrollContainer", () => {
|
|
63
|
+
const resizeObservers: Array<{
|
|
64
|
+
callback: ResizeObserverCallback;
|
|
65
|
+
observe: ReturnType<typeof vi.fn>;
|
|
66
|
+
disconnect: ReturnType<typeof vi.fn>;
|
|
67
|
+
}> = [];
|
|
68
|
+
|
|
69
|
+
beforeEach(() => {
|
|
70
|
+
resizeObservers.length = 0;
|
|
71
|
+
vi.stubGlobal("requestAnimationFrame", (cb: FrameRequestCallback) => {
|
|
72
|
+
cb(0);
|
|
73
|
+
return 0;
|
|
74
|
+
});
|
|
75
|
+
vi.stubGlobal("cancelAnimationFrame", vi.fn());
|
|
76
|
+
vi.stubGlobal(
|
|
77
|
+
"ResizeObserver",
|
|
78
|
+
class MockResizeObserver {
|
|
79
|
+
callback: ResizeObserverCallback;
|
|
80
|
+
observe = vi.fn();
|
|
81
|
+
unobserve = vi.fn();
|
|
82
|
+
disconnect = vi.fn();
|
|
83
|
+
|
|
84
|
+
constructor(callback: ResizeObserverCallback) {
|
|
85
|
+
this.callback = callback;
|
|
86
|
+
resizeObservers.push(this);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
vi.stubGlobal(
|
|
91
|
+
"MutationObserver",
|
|
92
|
+
class MockMutationObserver {
|
|
93
|
+
observe = vi.fn();
|
|
94
|
+
disconnect = vi.fn();
|
|
95
|
+
takeRecords = vi.fn(() => []);
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
afterEach(() => {
|
|
101
|
+
vi.unstubAllGlobals();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
function stubOverflow(
|
|
105
|
+
el: HTMLElement,
|
|
106
|
+
metrics: {
|
|
107
|
+
scrollHeight: number;
|
|
108
|
+
clientHeight: number;
|
|
109
|
+
scrollTop?: number;
|
|
110
|
+
},
|
|
111
|
+
) {
|
|
112
|
+
Object.defineProperty(el, "scrollHeight", {
|
|
113
|
+
configurable: true,
|
|
114
|
+
get: () => metrics.scrollHeight,
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(el, "clientHeight", {
|
|
117
|
+
configurable: true,
|
|
118
|
+
get: () => metrics.clientHeight,
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(el, "scrollTop", {
|
|
121
|
+
configurable: true,
|
|
122
|
+
get: () => metrics.scrollTop ?? 0,
|
|
123
|
+
set: (value: number) => {
|
|
124
|
+
metrics.scrollTop = value;
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
it("renders a scroll hint when content overflows", () => {
|
|
130
|
+
render(
|
|
131
|
+
<SlideScrollContainer>
|
|
132
|
+
<div>tall content</div>
|
|
133
|
+
</SlideScrollContainer>,
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const container = screen.getByTestId("slide-scroll-container");
|
|
137
|
+
stubOverflow(container, { scrollHeight: 900, clientHeight: 400 });
|
|
138
|
+
|
|
139
|
+
act(() => {
|
|
140
|
+
for (const observer of resizeObservers) {
|
|
141
|
+
observer.callback([], observer as unknown as ResizeObserver);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
expect(screen.getByTestId("slide-scroll-hint")).toBeTruthy();
|
|
146
|
+
expect(screen.getByText("Scroll for more")).toBeTruthy();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("hides the hint after scrolling", () => {
|
|
150
|
+
const metrics = {
|
|
151
|
+
scrollHeight: 900,
|
|
152
|
+
clientHeight: 400,
|
|
153
|
+
scrollTop: 0,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
render(
|
|
157
|
+
<SlideScrollContainer>
|
|
158
|
+
<div>tall content</div>
|
|
159
|
+
</SlideScrollContainer>,
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const container = screen.getByTestId("slide-scroll-container");
|
|
163
|
+
stubOverflow(container, metrics);
|
|
164
|
+
|
|
165
|
+
act(() => {
|
|
166
|
+
for (const observer of resizeObservers) {
|
|
167
|
+
observer.callback([], observer as unknown as ResizeObserver);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
expect(screen.getByTestId("slide-scroll-hint")).toBeTruthy();
|
|
171
|
+
|
|
172
|
+
act(() => {
|
|
173
|
+
metrics.scrollTop = 50;
|
|
174
|
+
container.dispatchEvent(new Event("scroll"));
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
expect(screen.queryByTestId("slide-scroll-hint")).toBeNull();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("does not show a hint when content fits", () => {
|
|
181
|
+
render(
|
|
182
|
+
<SlideScrollContainer>
|
|
183
|
+
<div>short content</div>
|
|
184
|
+
</SlideScrollContainer>,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const container = screen.getByTestId("slide-scroll-container");
|
|
188
|
+
stubOverflow(container, { scrollHeight: 200, clientHeight: 400 });
|
|
189
|
+
|
|
190
|
+
act(() => {
|
|
191
|
+
for (const observer of resizeObservers) {
|
|
192
|
+
observer.callback([], observer as unknown as ResizeObserver);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
expect(screen.queryByTestId("slide-scroll-hint")).toBeNull();
|
|
197
|
+
});
|
|
198
|
+
});
|
|
@@ -14,6 +14,7 @@ import { CodeIcon, ExpandIcon, EyeOffIcon } from "lucide-react";
|
|
|
14
14
|
import { Deck, Fragment, Slide, Stack } from "@revealjs/react";
|
|
15
15
|
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
16
16
|
import { Slide as CellOutputSlide } from "@/components/slides/slide";
|
|
17
|
+
import { SlideScrollContainer } from "@/components/slides/slide-scroll-hint";
|
|
17
18
|
import { Button } from "@/components/ui/button";
|
|
18
19
|
import { useFullScreenElement } from "@/components/ui/fullscreen";
|
|
19
20
|
import { Tooltip } from "@/components/ui/tooltip";
|
|
@@ -327,7 +328,7 @@ const SubslideView = ({
|
|
|
327
328
|
|
|
328
329
|
return (
|
|
329
330
|
<Slide>
|
|
330
|
-
<
|
|
331
|
+
<SlideScrollContainer>
|
|
331
332
|
<div
|
|
332
333
|
className={
|
|
333
334
|
anyCodeShown
|
|
@@ -367,7 +368,7 @@ const SubslideView = ({
|
|
|
367
368
|
return <ReactFragment key={i}>{rendered}</ReactFragment>;
|
|
368
369
|
})}
|
|
369
370
|
</div>
|
|
370
|
-
</
|
|
371
|
+
</SlideScrollContainer>
|
|
371
372
|
{/* Outside any `.fragment`: shown only before any fragment is revealed. */}
|
|
372
373
|
{slideLevel && <NotesAside text={slideLevel} />}
|
|
373
374
|
</Slide>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import {
|
|
5
|
+
type ReactNode,
|
|
6
|
+
type RefObject,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
10
|
+
} from "react";
|
|
11
|
+
import { cn } from "@/utils/cn";
|
|
12
|
+
|
|
13
|
+
/** Pixels of scroll before the hint is considered dismissed. */
|
|
14
|
+
const TOP_THRESHOLD_PX = 8;
|
|
15
|
+
/** Ignore sub-pixel overflow from rounding / borders. */
|
|
16
|
+
const OVERFLOW_TOLERANCE_PX = 1;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Whether a scroll container should show a "more content below" affordance.
|
|
20
|
+
* Visible only when content overflows and the viewport is still near the top.
|
|
21
|
+
*/
|
|
22
|
+
export function shouldShowScrollHint(options: {
|
|
23
|
+
scrollHeight: number;
|
|
24
|
+
clientHeight: number;
|
|
25
|
+
scrollTop: number;
|
|
26
|
+
}): boolean {
|
|
27
|
+
const { scrollHeight, clientHeight, scrollTop } = options;
|
|
28
|
+
const overflowing = scrollHeight > clientHeight + OVERFLOW_TOLERANCE_PX;
|
|
29
|
+
const atTop = scrollTop <= TOP_THRESHOLD_PX;
|
|
30
|
+
return overflowing && atTop;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Measure only up to the first unrevealed fragment so
|
|
35
|
+
* the hint reflects currently revealed content, not future fragment steps.
|
|
36
|
+
*/
|
|
37
|
+
function measureRevealedHeight(el: HTMLElement): number {
|
|
38
|
+
const firstUnrevealed = el.querySelector<HTMLElement>(
|
|
39
|
+
".fragment:not(.visible)",
|
|
40
|
+
);
|
|
41
|
+
if (!firstUnrevealed) {
|
|
42
|
+
return el.scrollHeight;
|
|
43
|
+
}
|
|
44
|
+
const fragmentTop = firstUnrevealed.getBoundingClientRect().top;
|
|
45
|
+
return fragmentTop - el.getBoundingClientRect().top + el.scrollTop;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Tracks whether a scroll container is overflowing at the top, so we can
|
|
50
|
+
* surface a scroll affordance.
|
|
51
|
+
*/
|
|
52
|
+
function useScrollHint(
|
|
53
|
+
scrollRef: RefObject<HTMLElement | null>,
|
|
54
|
+
contentRef: RefObject<HTMLElement | null>,
|
|
55
|
+
): boolean {
|
|
56
|
+
const [showHint, setShowHint] = useState(false);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const el = scrollRef.current;
|
|
60
|
+
const content = contentRef.current;
|
|
61
|
+
if (!el || !content) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let frame = 0;
|
|
66
|
+
const update = () => {
|
|
67
|
+
cancelAnimationFrame(frame);
|
|
68
|
+
frame = requestAnimationFrame(() => {
|
|
69
|
+
setShowHint(
|
|
70
|
+
shouldShowScrollHint({
|
|
71
|
+
scrollHeight: measureRevealedHeight(el),
|
|
72
|
+
clientHeight: el.clientHeight,
|
|
73
|
+
scrollTop: el.scrollTop,
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
update();
|
|
80
|
+
|
|
81
|
+
const resizeObserver = new ResizeObserver(update);
|
|
82
|
+
resizeObserver.observe(el);
|
|
83
|
+
resizeObserver.observe(content);
|
|
84
|
+
|
|
85
|
+
// Fragments reveal via class changes (opacity/visibility, no layout shift),
|
|
86
|
+
// which the ResizeObserver can't see, so re-check on class mutations. Only
|
|
87
|
+
// attach on slides that have fragments to avoid reacting to unrelated class
|
|
88
|
+
// churn (e.g. animating widgets) on the common non-fragment slide.
|
|
89
|
+
const fragmentObserver = content.querySelector(".fragment")
|
|
90
|
+
? new MutationObserver(update)
|
|
91
|
+
: null;
|
|
92
|
+
fragmentObserver?.observe(content, {
|
|
93
|
+
subtree: true,
|
|
94
|
+
attributes: true,
|
|
95
|
+
attributeFilter: ["class"],
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
99
|
+
|
|
100
|
+
return () => {
|
|
101
|
+
cancelAnimationFrame(frame);
|
|
102
|
+
resizeObserver.disconnect();
|
|
103
|
+
fragmentObserver?.disconnect();
|
|
104
|
+
el.removeEventListener("scroll", update);
|
|
105
|
+
};
|
|
106
|
+
}, [scrollRef, contentRef]);
|
|
107
|
+
|
|
108
|
+
return showHint;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const ScrollHintOverlay = ({ className }: { className?: string }) => {
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
className={cn(
|
|
115
|
+
"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center",
|
|
116
|
+
"animate-in fade-in-0 duration-200",
|
|
117
|
+
className,
|
|
118
|
+
)}
|
|
119
|
+
data-testid="slide-scroll-hint"
|
|
120
|
+
aria-hidden={true}
|
|
121
|
+
>
|
|
122
|
+
<div className="h-16 w-full bg-linear-to-t from-background via-background/80 to-transparent" />
|
|
123
|
+
<div className="absolute bottom-3 flex items-center gap-1 rounded-full border border-border/60 bg-background/90 px-2.5 py-1 text-xs text-muted-foreground shadow-sm backdrop-blur-sm">
|
|
124
|
+
<ChevronDownIcon className="h-3.5 w-3.5" />
|
|
125
|
+
<span>Scroll for more</span>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Full-height scroll container for a slide. Shows a dismissible "Scroll for
|
|
133
|
+
* more" cue when content overflows the frame (easy to miss in fullscreen when
|
|
134
|
+
* OS overlay scrollbars are hidden).
|
|
135
|
+
*/
|
|
136
|
+
export const SlideScrollContainer = ({
|
|
137
|
+
children,
|
|
138
|
+
className,
|
|
139
|
+
}: {
|
|
140
|
+
children: ReactNode;
|
|
141
|
+
className?: string;
|
|
142
|
+
}) => {
|
|
143
|
+
const scrollRef = useRef<HTMLDivElement>(null);
|
|
144
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
145
|
+
const showHint = useScrollHint(scrollRef, contentRef);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<div className={cn("relative h-full w-full", className)}>
|
|
149
|
+
<div
|
|
150
|
+
ref={scrollRef}
|
|
151
|
+
className="h-full w-full overflow-auto"
|
|
152
|
+
data-testid="slide-scroll-container"
|
|
153
|
+
>
|
|
154
|
+
<div ref={contentRef} className="flex w-full min-h-full">
|
|
155
|
+
{children}
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
{showHint && <ScrollHintOverlay />}
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
};
|