ode-explorer 1.3.2-dev.202401241302 → 1.3.2-dev.202401261435

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.
@@ -1 +1 @@
1
- import{j as s,C as l,t as z,J as B,K as M,N as O,P as N,R as y,U as E,a as L,H as U,V as G,x as I,B as H}from"./edifice-react.js";import{u as $,r as J,b}from"./react.js";import{x as K,y as V}from"./edifice-icons.js";import{n as q,f as D,g as Q,u as W,d as X}from"./index.js";import"/assets/js/edifice-ts-client/index.js";const T=({app:i,resource:t,time:p,isSelected:g=!1,isSelectable:j=!0,onClick:c,onSelect:e})=>{const d=`/userbook/avatar/${t==null?void 0:t.creatorId}`;function o(n){const{rights:u,creatorId:v}=n||{};return u.filter(R=>!R.includes(v)).length>=1}const x=o(t),f=t==null?void 0:t.public,{t:h}=$();return s.jsx(l,{app:i,isSelected:g,isSelectable:j,onClick:c,onSelect:e,children:n=>s.jsxs(s.Fragment,{children:[s.jsxs(l.Body,{children:[s.jsx("div",{className:"card-image medium",children:t!=null&&t.thumbnail?s.jsx(z,{alt:"",src:t==null?void 0:t.thumbnail,objectFit:"cover",className:"h-full"}):s.jsx(B,{app:i,iconFit:"ratio",size:"80",variant:"rounded"})}),s.jsxs("div",{className:"text-truncate",children:[s.jsx(l.Title,{children:t==null?void 0:t.name}),s.jsx(l.Text,{children:s.jsx("em",{children:p})})]})]}),s.jsxs(l.Footer,{children:[s.jsxs("div",{className:"d-inline-flex align-items-center gap-8 text-truncate",children:[d?s.jsx(M,{alt:(t==null?void 0:t.creatorName)||"",size:"xs",src:d,variant:"circle",width:"24",height:"24"}):s.jsx(O,{}),s.jsx(l.Text,{children:t==null?void 0:t.creatorName})]}),s.jsxs("div",{className:"d-inline-flex align-items-center gap-8",children:[x&&s.jsx(N,{message:h("tooltip.shared",{ns:n}),placement:"top",children:s.jsx(K,{width:16,height:16})}),f&&s.jsx(N,{message:h("tooltip.public",{ns:n}),placement:"top",children:s.jsx(V,{width:16,height:16})})]})]})]})})};T.displayName="ResourceCard";y.extend(E);const as=({data:i,fetchNextPage:t})=>{const{currentApp:p,currentLanguage:g}=L(),{t:j}=$(),c=q(),e=D(),d=Q(),{setSelectedResources:o,setResourceIds:x,openResource:f,setResourceIsTrash:h}=W(),n=X(),u=U({from:{opacity:0},to:{opacity:1}}),S=c.pagination.startIdx+c.pagination.pageSize<(c.pagination.maxIdx||0),R=J.useCallback(()=>{t()},[]),C=a=>{n?(h(!0),x([a.id]),o([a])):f(a)};async function F(a){if(e.includes(a.id)){x(e.filter(m=>m!==a.id)),o(d.filter(m=>m.id!==a.id));return}x([...e,a.id]),o([...d,a])}const P=G("grid ps-0 list-unstyled");return s.jsxs(b.Fragment,{children:[s.jsx(I.ul,{className:P,children:i==null?void 0:i.pages.map((a,m)=>s.jsx(b.Fragment,{children:a.resources.map(r=>{const{id:k,updatedAt:A}=r,w=y(A).locale(g).fromNow();return s.jsx(I.li,{className:"g-col-4 z-1",style:{position:"relative",...u},children:s.jsx(T,{app:p,resource:r,time:w,isSelectable:!0,isSelected:e.includes(r.id),onClick:()=>C(r),onSelect:()=>F(r)})},k)})},m))}),S&&s.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:s.jsx(H,{type:"button",color:"secondary",variant:"filled",onClick:R,children:j("explorer.see.more")})})]})};export{as as default};
1
+ import{j as s,C as l,t as z,J as B,K as M,N as O,P as N,R as y,U as E,a as L,H as U,V as G,x as I,B as H}from"./edifice-react.js";import{u as $,r as J,b}from"./react.js";import{x as K,y as V}from"./edifice-icons.js";import{n as q,f as D,g as Q,u as W,d as X}from"./index.js";import"/assets/js/edifice-ts-client/index.js";const T=({app:i,resource:t,time:p,isSelected:g=!1,isSelectable:j=!0,onClick:c,onSelect:e})=>{const d=`/userbook/avatar/${t==null?void 0:t.creatorId}`;function o(n){const{rights:u,creatorId:v}=n||{};return u.filter(R=>!R.includes(v)).length>=1}const x=o(t),f=t==null?void 0:t.public,{t:h}=$();return s.jsx(l,{app:i,isSelected:g,isSelectable:j,onClick:c,onSelect:e,children:n=>s.jsxs(s.Fragment,{children:[s.jsxs(l.Body,{children:[s.jsx("div",{className:"card-image medium",children:t!=null&&t.thumbnail?s.jsx(z,{alt:"",src:t==null?void 0:t.thumbnail,objectFit:"cover",className:"h-full w-100"}):s.jsx(B,{app:i,iconFit:"ratio",size:"80",variant:"rounded"})}),s.jsxs("div",{className:"text-truncate",children:[s.jsx(l.Title,{children:t==null?void 0:t.name}),s.jsx(l.Text,{children:s.jsx("em",{children:p})})]})]}),s.jsxs(l.Footer,{children:[s.jsxs("div",{className:"d-inline-flex align-items-center gap-8 text-truncate",children:[d?s.jsx(M,{alt:(t==null?void 0:t.creatorName)||"",size:"xs",src:d,variant:"circle",width:"24",height:"24"}):s.jsx(O,{}),s.jsx(l.Text,{children:t==null?void 0:t.creatorName})]}),s.jsxs("div",{className:"d-inline-flex align-items-center gap-8",children:[x&&s.jsx(N,{message:h("tooltip.shared",{ns:n}),placement:"top",children:s.jsx(K,{width:16,height:16})}),f&&s.jsx(N,{message:h("tooltip.public",{ns:n}),placement:"top",children:s.jsx(V,{width:16,height:16})})]})]})]})})};T.displayName="ResourceCard";y.extend(E);const as=({data:i,fetchNextPage:t})=>{const{currentApp:p,currentLanguage:g}=L(),{t:j}=$(),c=q(),e=D(),d=Q(),{setSelectedResources:o,setResourceIds:x,openResource:f,setResourceIsTrash:h}=W(),n=X(),u=U({from:{opacity:0},to:{opacity:1}}),S=c.pagination.startIdx+c.pagination.pageSize<(c.pagination.maxIdx||0),R=J.useCallback(()=>{t()},[]),C=a=>{n?(h(!0),x([a.id]),o([a])):f(a)};async function F(a){if(e.includes(a.id)){x(e.filter(m=>m!==a.id)),o(d.filter(m=>m.id!==a.id));return}x([...e,a.id]),o([...d,a])}const P=G("grid ps-0 list-unstyled");return s.jsxs(b.Fragment,{children:[s.jsx(I.ul,{className:P,children:i==null?void 0:i.pages.map((a,m)=>s.jsx(b.Fragment,{children:a.resources.map(r=>{const{id:k,updatedAt:w}=r,A=y(w).locale(g).fromNow();return s.jsx(I.li,{className:"g-col-4 z-1",style:{position:"relative",...u},children:s.jsx(T,{app:p,resource:r,time:A,isSelectable:!0,isSelected:e.includes(r.id),onClick:()=>C(r),onSelect:()=>F(r)})},k)})},m))}),S&&s.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:s.jsx(H,{type:"button",color:"secondary",variant:"filled",onClick:R,children:j("explorer.see.more")})})]})};export{as as default};