@marimo-team/frontend 0.19.8-dev21 → 0.19.8-dev23
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/gallery-page-DuDrhEq0.js +1 -0
- package/dist/assets/index-3CaNzO41.css +2 -0
- package/dist/assets/{index-U7La6ZBB.js → index-B1ViTbhO.js} +2 -2
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/pages/gallery-page.tsx +37 -6
- package/dist/assets/gallery-page-Yq7Go5FK.js +0 -1
- package/dist/assets/index-BTVKRPtt.css +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as b}from"./chunk-LvLJmgfZ.js";import"./useEvent-BhXAndur.js";import{t as y}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import"./compiler-runtime-B3qBwwSJ.js";import{t as P}from"./ErrorBoundary-B9Ifj8Jf.js";import{t as $}from"./jsx-runtime-ZmTK25f3.js";import{r as z}from"./requests-B4FYHTZl.js";import{t as N}from"./spinner-DA8-7wQv.js";import{lt as L,r as M}from"./input-DHHmNa19.js";import{n as c,t as R}from"./paths-Dfii2bN8.js";import{c as v,t as I}from"./session-fBtIbMpB.js";import"./Combination-izwufzWe.js";import{r as A}from"./errors-CPlNr33a.js";import{t as f}from"./error-banner-Dlrzo_Ay.js";import{n as D}from"./useAsyncData-BMGLSTg8.js";import{n as W,t as _}from"./card-DdlNjkEA.js";var p=b(y(),1),e=b($(),1),B=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),w=a=>{let o=R.guessDeliminator(a).deliminator;return a.replace(/\.[^./]+$/,"").split(o).filter(Boolean).map(d=>d.split(/[_-]/).map(B).join(" ")).join(" > ")},F=a=>`${I()}-${encodeURIComponent(a)}`,Y=a=>{try{return new URL(a).protocol==="https:"}catch{return!1}},q=10,E=()=>{let{getWorkspaceFiles:a}=z(),[o,d]=(0,p.useState)(""),n=D(()=>a({includeMarkdown:!1}),[]),t=n.data,m=(0,p.useMemo)(()=>{let r=(t==null?void 0:t.files)??[],i=(t==null?void 0:t.root)??"";return r.filter(s=>!s.isDirectory).map(s=>{var g,x,j;let l=i&&c.isAbsolute(s.path)&&s.path.startsWith(i)?c.rest(s.path,i):s.path,C=((g=s.opengraph)==null?void 0:g.title)??w(c.basename(l)),S=w(c.dirname(l)),U=((x=s.opengraph)==null?void 0:x.description)??"",h=(j=s.opengraph)==null?void 0:j.image,k=h&&Y(h)?h:v(`/og/thumbnail?file=${encodeURIComponent(l)}`).toString();return{...s,relativePath:l,title:C,subtitle:S,description:U,thumbnailUrl:k}}).sort((s,l)=>s.relativePath.localeCompare(l.relativePath))},[t==null?void 0:t.files,t==null?void 0:t.root]),u=(0,p.useMemo)(()=>{if(!o)return m;let r=o.toLowerCase();return m.filter(i=>i.title.toLowerCase().includes(r))},[m,o]);return n.isPending?(0,e.jsx)(N,{centered:!0,size:"xlarge",className:"mt-6"}):n.error?(0,e.jsx)(f,{kind:"danger",className:"rounded p-4",children:A(n.error)}):t?(0,e.jsx)(p.Suspense,{children:(0,e.jsxs)("div",{className:"flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10",children:[(0,e.jsx)("img",{src:"logo.png",alt:"marimo logo",className:"w-48 mb-2"}),(0,e.jsx)(P,{children:(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[t.hasMore&&(0,e.jsxs)(f,{kind:"warn",className:"rounded p-4",children:["Showing first ",t.fileCount," files. Your workspace has more files."]}),m.length>q&&(0,e.jsx)(M,{id:"search",value:o,icon:(0,e.jsx)(L,{className:"h-4 w-4"}),onChange:r=>d(r.target.value),placeholder:"Search",rootClassName:"mb-3",className:"mb-0 border-border"}),u.length===0?(0,e.jsx)(f,{kind:"warn",className:"rounded p-4",children:"No marimo apps found."}):(0,e.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:u.map(r=>(0,e.jsx)("a",{href:v(`?file=${encodeURIComponent(r.relativePath)}`).toString(),target:F(r.path),className:"no-underline",children:(0,e.jsxs)(_,{className:"h-full overflow-hidden hover:bg-accent/20 transition-colors",children:[(0,e.jsx)("img",{src:r.thumbnailUrl,alt:r.title,loading:"lazy",className:"w-full aspect-1200/630 object-cover border-b border-border/60"}),(0,e.jsx)(W,{className:"p-6 pt-4",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[r.subtitle&&(0,e.jsx)("div",{className:"text-sm font-semibold text-muted-foreground",children:r.subtitle}),(0,e.jsx)("div",{className:"text-lg font-medium",children:r.title}),r.description&&(0,e.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-3 mt-1",children:r.description})]})})]})},r.path))})]})})]})}):(0,e.jsx)(N,{centered:!0,size:"xlarge",className:"mt-6"})};export{E as default};
|