ode-explorer 1.2.2 → 1.3.0

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/AppAction.js CHANGED
@@ -1 +1 @@
1
- import{u as a,a as n,c as r,j as t,B as c,S as i}from"./index.js";function u(){const{appCode:e}=a(),{t:s}=n(e),{createResource:o}=r();return t.jsx(c,{type:"button",color:"primary",variant:"filled",leftIcon:t.jsx(i,{}),className:"ms-auto",onClick:o,children:s("explorer.create.title")})}export{u as default};
1
+ import{c as p,d as x,u as m,e as f,f as j,j as e,B as C,S,r as n,L as _,_ as g}from"./index.js";import"/assets/js/edifice-ts-client/index.js";const A=n.lazy(async()=>await g(()=>import("./EditResourceModal.js"),["EditResourceModal.js","index.js","index.esm.js","TextArea.js"]));function v(){const[a,s]=p(),{appCode:o}=x(),{t:r}=m(o),{clearSelectedItems:c,clearSelectedIds:l}=f(),{data:t}=j(),i=t==null?void 0:t.find(u=>u.id==="create"),d=()=>{c(),l(),s()};return i?e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"button",color:"primary",variant:"filled",leftIcon:e.jsx(S,{}),className:"ms-auto",onClick:d,children:r("explorer.create.title")}),e.jsx(n.Suspense,{fallback:e.jsx(_,{}),children:a&&e.jsx(A,{edit:!1,isOpen:a,onSuccess:s,onCancel:s})})]}):null}export{v as default};
package/dist/Card.js CHANGED
@@ -1 +1 @@
1
- import{r as R,f as a,j as s,t as B,ae as E,af as F,I as q,a8 as G,q as U,ag as D,ah as H,ai as J,aj as K}from"./index.js";import{T as n}from"./Tooltip.js";const d=R.forwardRef(({app:l,className:h,creatorName:r="tom.mate",isAnimated:x=!1,isFolder:t=!1,isLoading:e=!1,isSelected:m=!1,isShared:p=!1,isPublic:j=!1,name:g="Resource",resourceSrc:i="",updatedAt:v="2 days ago",userSrc:o="",onOpen:u,onSelect:c,messagePublic:N,messageShared:f,...$},b)=>{const{getIconCode:w}=K(),C=a("card",{"placeholder-glow":e,"is-selected":m,"is-animated":x},h),y=a("card-title body text-break text-truncate text-truncate--2 pe-32",{placeholder:e}),I=a("card-text small",{placeholder:e}),O=a("small text-truncate",{placeholder:e}),z=a("d-inline-flex align-items-center gap-8 text-truncate",{placeholder:e}),T=l?w(l):"placeholder",k=a(`color-app-${T}`,{placeholder:e});function A(P){P.stopPropagation(),c==null||c()}return s.jsxs("div",{ref:b,className:C,...$,children:[!e&&s.jsx(B,{"aria-label":"Open Action Bar",className:"z-3",color:"secondary",icon:s.jsx(E,{}),onClick:A,variant:"ghost"}),s.jsx("button",{onClick:u,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}),s.jsxs("div",{className:"card-body",children:[t?s.jsx(F,{width:"48",height:"48",className:k}):i?s.jsx("div",{className:"card-image",children:s.jsx(q,{alt:"",src:i,width:"80",height:"80",objectFit:"cover",className:"h-full"})}):s.jsx(G,{app:l,iconFit:"ratio",size:"80",variant:"rounded"}),s.jsxs("div",{children:[s.jsx("h3",{className:y,children:s.jsx("strong",{children:g})}),t?null:s.jsx("p",{className:"card-text small",children:s.jsx("em",{className:I,children:v})})]})]}),t?null:s.jsxs("div",{className:"card-footer gap-16",children:[s.jsxs("div",{className:z,children:[o?s.jsx(U,{alt:r,size:"xs",src:o,variant:"circle",width:"24",height:"24"}):s.jsx(D,{}),s.jsx("p",{className:O,children:r})]}),s.jsxs("div",{className:"d-inline-flex align-items-center gap-8",children:[j&&s.jsx(n,{message:N,placement:"top",children:s.jsx(H,{width:16,height:16})}),p&&s.jsx(n,{message:f,placement:"top",children:s.jsx(J,{width:16,height:16})})]})]})]})});d.displayName="Card";const S=d;export{S as C};
1
+ import{a5 as o,j as e,r as d,y as w,al as T,I as B,a8 as F,w as O,af as H,am as z}from"./index.js";const u=({children:t,space:a=null,flexDirection:s="row"})=>{const r=o("card-body",{"p-8":a==="8","gap-8":a==="8","align-items-start":s==="column","flex-column":s==="column"});return e.jsx("div",{className:r,children:t})};u.displayName="Card.Body";const U=u,i=d.createContext(null);i.displayName="CardContext";const m=()=>{const t=d.useContext(i);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},C=({children:t})=>e.jsx("div",{className:"card-footer gap-16",children:t});C.displayName="Card.Footer";const k=C,p=()=>{const{isSelectable:t,isClickable:a,onClick:s,onSelect:r}=m();return e.jsxs("div",{className:"card-header",children:[t?e.jsx(w,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:e.jsx(T,{}),onClick:r,variant:"ghost"}):null,a?e.jsx("button",{onClick:s,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]})};p.displayName="Card.Header";const A=p,j=({imageSrc:t,className:a,variant:s="medium"})=>{const{app:r}=m(),n=s==="landscape"?{width:"100%",height:"auto"}:null;return e.jsx("div",{className:o("card-image",s),children:t?e.jsx(B,{alt:"",src:t,objectFit:"cover",className:o("h-full",a)}):e.jsx(F,{app:r,iconFit:"ratio",size:"80",variant:"rounded",...n})})};j.displayName="Card.Image";const E=j,y=({children:t,className:a})=>{const s=o("card-text small text-break text-truncate text-truncate-1",a);return e.jsx("p",{className:s,children:t})};y.displayName="Card.Text";const R=y,N=({children:t,className:a})=>{const s=o("card-title body text-break text-truncate text-truncate-1",a);return e.jsx("h3",{className:s,children:e.jsx("strong",{children:t})})};N.displayName="Card.Title";const P=N,g=({userSrc:t,creatorName:a})=>t?e.jsx(O,{alt:a||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):e.jsx(H,{});g.displayName="Card.User";const M=g,h=d.forwardRef(({app:t,isSelectable:a=!0,isClickable:s=!0,isSelected:r=!1,onClick:n,onSelect:x,children:c,className:v},$)=>{const{getIconCode:f}=z(),l=t?f(t):"placeholder",I=d.useMemo(()=>({app:t,appCode:l,isSelectable:a,isClickable:s,onClick:n,onSelect:x}),[t,l,a,s,n,x]);return e.jsx(i.Provider,{value:I,children:e.jsxs("div",{ref:$,className:o("card",{"is-selected":r},v),children:[e.jsx(b.Header,{}),typeof c=="function"?c(l):c]})})});h.displayName="Card";const b=Object.assign(h,{Title:P,Text:R,Image:E,Body:U,User:M,Footer:k,Header:A}),G=b;export{G as C};
@@ -1 +1 @@
1
- import{a as d,z as x,C as p,D as u,m,p as j,b as y,j as e,M as n,B as i}from"./index.js";function f({onSuccess:o}){const{t:l}=d(),s=x(),t=p(),r=u(),{hotToast:a}=m(j);async function c(){try{r?(await s.mutate(),a.success(l("explorer.removed.from.trash"))):(await t.mutate(),a.success(l("explorer.trash.title"))),o==null||o()}catch(h){console.error(h)}}return{isTrashFolder:r,onDelete:c}}function M({isOpen:o,onSuccess:l=()=>({}),onCancel:s=()=>({})}){const{t}=d(),{isTrashFolder:r,onDelete:a}=f({onSuccess:l});return y.createPortal(e.jsxs(n,{isOpen:o,onModalClose:s,id:"deleteModal",children:[e.jsx(n.Header,{onModalClose:s,children:t(r?"explorer.delete.title":"explorer.trash.title")}),e.jsx(n.Body,{children:e.jsx("p",{className:"body",children:t(r?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),e.jsxs(n.Footer,{children:[e.jsx(i,{color:"tertiary",onClick:s,type:"button",variant:"ghost",children:t("explorer.cancel")}),e.jsx(i,{color:"primary",onClick:a,type:"button",variant:"filled",children:t(r?"explorer.delete":"explorer.trash")})]})]}),document.getElementById("portal"))}export{M as default};
1
+ import{u as d,J as u,K as x,N as p,t as m,A as j,a as f,j as e,M as n,B as i}from"./index.js";import"/assets/js/edifice-ts-client/index.js";function y({onSuccess:o}){const{t:l}=d(),s=u(),t=x(),r=p(),{hotToast:a}=m(j);async function c(){try{r?(await s.mutate(),a.success(l("explorer.removed.from.trash"))):(await t.mutate(),a.success(l("explorer.trash.title"))),o==null||o()}catch(h){console.error(h)}}return{isTrashFolder:r,onDelete:c}}function D({isOpen:o,onSuccess:l=()=>({}),onCancel:s=()=>({})}){const{t}=d(),{isTrashFolder:r,onDelete:a}=y({onSuccess:l});return f.createPortal(e.jsxs(n,{isOpen:o,onModalClose:s,id:"deleteModal",children:[e.jsx(n.Header,{onModalClose:s,children:t(r?"explorer.delete.title":"explorer.trash.title")}),e.jsx(n.Body,{children:e.jsx("p",{className:"body",children:t(r?"explorer.delete.subtitle":"explorer.trash.subtitle")})}),e.jsxs(n.Footer,{children:[e.jsx(i,{color:"tertiary",onClick:s,type:"button",variant:"ghost",children:t("explorer.cancel")}),e.jsx(i,{color:"danger",onClick:a,type:"button",variant:"filled",children:t(r?"explorer.delete":"explorer.trash")})]})]}),document.getElementById("portal"))}export{D as default};
@@ -1 +1 @@
1
- import{G as D,N as B,O as q,P as L,r as C,Q as R,a as U,b as w,j as r,M as s,F as P,U as T,y as V,B as y}from"./index.js";import{u as _}from"./index.esm.js";function k({edit:a,onSuccess:e,onClose:i}){var F;const l=D(),t=B(),m=q(),c=L(),u=a?(F=l[0])==null?void 0:F.name:void 0,{reset:o,register:f,handleSubmit:n,setFocus:p,formState:{errors:x,isSubmitting:h,isDirty:I,isValid:E}}=_({mode:"onChange",values:{name:u||""}}),g=C.useId(),M=async function({name:b}){var j;try{if(a){const d=(j=l[0])==null?void 0:j.parentId,$=l[0].id;await c.mutate({folderId:$,parentId:d,name:b}),o(),e==null||e()}else{const d=(t==null?void 0:t.id)||R.DEFAULT;await m.mutate({name:b,parentId:d}),o(),e==null||e()}}catch(d){console.error(d)}};function v(){o(),i()}return{formId:`createModal_${g}`,errors:x,isSubmitting:h,isDirty:I,isValid:E,register:f,setFocus:p,handleSubmit:n,onCancel:v,onSubmit:M}}function N({isOpen:a,edit:e,onSuccess:i,onCancel:l}){const{t}=U(),{isDirty:m,isValid:c,isSubmitting:u,formId:o,onSubmit:f,onCancel:n,handleSubmit:p,register:x,setFocus:h}=k({edit:e,onSuccess:i,onClose:l});return C.useEffect(()=>{a&&h("name")},[a]),w.createPortal(r.jsxs(s,{isOpen:a,onModalClose:n,id:"modal_"+o,children:[r.jsx(s.Header,{onModalClose:n,children:t(e?"explorer.rename.folder":"explorer.create.folder")}),r.jsx(s.Body,{children:r.jsx("form",{id:o,onSubmit:p(f),children:r.jsxs(P,{id:"nameFolder",isRequired:!0,children:[r.jsx(T,{children:t("explorer.create.folder.name")}),r.jsx(V,{type:"text",...x("name",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:t("explorer.create.folder.name"),size:"md","aria-required":!0})]})})}),r.jsxs(s.Footer,{children:[r.jsx(y,{color:"tertiary",onClick:n,type:"button",variant:"ghost",children:t("explorer.cancel")}),r.jsx(y,{form:o,type:"submit",color:"primary",variant:"filled",disabled:!m||!c||u,children:t(e?"explorer.rename":"explorer.create")})]})]}),document.getElementById("portal"))}export{N as default};
1
+ import{P as D,W as B,X as q,Y as L,r as C,u as R,a as k,j as r,M as i,F as w,Z as P,k as T,B as y}from"./index.js";import{FOLDER as U}from"/assets/js/edifice-ts-client/index.js";import{u as V}from"./index.esm.js";function _({edit:a,onSuccess:e,onClose:m}){var F;const l=D(),t=B(),c=q(),u=L(),f=a?(F=l[0])==null?void 0:F.name:void 0,{reset:o,register:p,handleSubmit:n,setFocus:x,formState:{errors:h,isSubmitting:s,isDirty:I,isValid:E}}=V({mode:"onChange",values:{name:f||""}}),g=C.useId(),M=async function({name:j}){var b;try{if(a){const d=(b=l[0])==null?void 0:b.parentId,$=l[0].id;await u.mutate({folderId:$,parentId:d,name:j}),o(),e==null||e()}else{const d=(t==null?void 0:t.id)||U.DEFAULT;await c.mutate({name:j,parentId:d}),o(),e==null||e()}}catch(d){console.error(d)}};function v(){o(),m()}return{formId:`createModal_${g}`,errors:h,isSubmitting:s,isDirty:I,isValid:E,register:p,setFocus:x,handleSubmit:n,onCancel:v,onSubmit:M}}function Y({isOpen:a,edit:e,onSuccess:m,onCancel:l}){const{t}=R(),{isDirty:c,isValid:u,isSubmitting:f,formId:o,onSubmit:p,onCancel:n,handleSubmit:x,register:h,setFocus:s}=_({edit:e,onSuccess:m,onClose:l});return C.useEffect(()=>{a&&s("name")},[a,s]),k.createPortal(r.jsxs(i,{isOpen:a,onModalClose:n,id:"modal_"+o,children:[r.jsx(i.Header,{onModalClose:n,children:t(e?"explorer.rename.folder":"explorer.create.folder")}),r.jsx(i.Body,{children:r.jsx("form",{id:o,onSubmit:x(p),children:r.jsxs(w,{id:"nameFolder",isRequired:!0,children:[r.jsx(P,{children:t("explorer.create.folder.name")}),r.jsx(T,{type:"text",...h("name",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:t("explorer.create.folder.name"),size:"md","aria-required":!0})]})})}),r.jsxs(i.Footer,{children:[r.jsx(y,{color:"tertiary",onClick:n,type:"button",variant:"ghost",children:t("explorer.cancel")}),r.jsx(y,{form:o,type:"submit",color:"primary",variant:"filled",disabled:!c||!u||f,children:t(e?"explorer.rename":"explorer.create")})]})]}),document.getElementById("portal"))}export{Y as default};
@@ -1 +1,3 @@
1
- import{a as B,j as e,H as A,p as E,F as m,y as P,W as G,B as T,X as J,k as K,i as z,r as p,m as Q,u as ee,Y as se,b as te,M as C,U as F,Z as le}from"./index.js";import{I as ae}from"./ImagePicker.js";import{u as re}from"./index.esm.js";const oe=({appCode:d,correctSlug:a,disableSlug:n,onPublicChange:r,onSlugChange:x,refPublic:c,refSlug:j,register:s,resource:h,slug:u,onCopyToClipBoard:g})=>{const{t:o}=B();return e.jsxs(e.Fragment,{children:[e.jsxs(A,{headingStyle:"h4",level:"h3",className:"mb-16",children:[o("explorer.resource.editModal.heading.access"),d]}),e.jsx(E,{type:"info",children:o("explorer.resource.editModal.access.alert")}),e.jsxs(m,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[e.jsx(m.Input,{type:"checkbox",role:"switch",...s("enablePublic",{value:h.public,onChange:i=>r(i.target.checked)}),className:"form-check-input mt-0",size:"md"},c),e.jsx(m.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e.jsx(m,{id:"slug",status:a?"invalid":void 0,children:e.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[e.jsxs("div",{children:[window.location.origin,window.location.pathname,"/pub/"]}),e.jsxs("div",{className:"flex-fill",children:[e.jsx(P,{type:"text",...s("safeSlug",{validate:{required:i=>!i&&!n?o("explorer.slug.name.mandatory"):!0},disabled:n,value:u,onChange:i=>x(i.target.value)}),size:"md",placeholder:o("explorer.resource.editModal.access.url.extension")},j),a&&e.jsx("div",{className:"position-absolute",children:e.jsx(G,{children:o("explorer.slug.name.error")})})]}),e.jsx(T,{color:"primary",disabled:n,onClick:()=>{g()},type:"button",leftIcon:e.jsx(J,{}),variant:"ghost",className:"text-nowrap",children:o("explorer.resource.editModal.access.url.button")})]})})]})};function ie({resource:d,onSuccess:a,onCancel:n}){const{t:r}=B(),x=K(),c=z(),{reset:j,register:s,handleSubmit:h,setFocus:u,formState:{errors:g,isSubmitting:o,isValid:i}}=re({mode:"onChange"}),I=p.useId(),[M,b]=p.useState(new Date().getTime()),[$,k]=p.useState(!d.public),[f,v]=p.useState(d.slug||""),[N,S]=p.useState(!1),{hotToast:y}=Q(E),[R,l]=p.useState({name:"",image:c[0].thumbnail}),_=t=>{l(t)},L=()=>{l({name:"",image:""})};function U(t){k(!t),t||(v(""),b(new Date().getTime()))}function V(t){if(!t)return"";const w="àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœøṕŕßśșțùúüûǘẃẍÿź·/_,:;",W="aaaaaaaaceeeeghiiiimnnnooooooprssstuuuuuwxyz------",X=new RegExp(w.split("").join("|"),"g"),Y=t.toString().toLowerCase().replace(/\s+/g,"-").replace(X,Z=>W.charAt(w.indexOf(Z))).replace(/&/g,"-and-").replace(/[^\w\\-]+/g,"").replace(/\\-\\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"");v(Y)}const q=async function(t){try{await x.mutateAsync({description:t.description,entId:c[0].assetId,name:t.title,public:t.enablePublic,slug:t.safeSlug,trashed:c[0].trashed,thumbnail:R.image}),S(!1),y.success(e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:r("explorer.resource.updated")}),e.jsxs("p",{children:["Titre: ",t.title]}),e.jsxs("p",{children:["Description: ",t.description]}),e.jsxs("p",{children:["Public:"," ",t.enablePublic?r("explorer.enable.public.yes"):r("explorer.enable.public.no")]})]})),a==null||a()}catch(w){S(!0),console.error(w)}};function D(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${f}`),y.success(r("explorer.copy.clipboard"))}function H(){j(),n()}const O=`resource_edit_modal_${I}`;return{slug:f,disableSlug:$,formId:O,errors:g,isSubmitting:o,isValid:i,versionSlug:M,correctSlug:N,onPublicChange:U,onSlugChange:V,register:s,setFocus:u,handleSubmit:h,onFormCancel:H,onSubmit:q,handleUploadImage:_,handleDeleteImage:L,onCopyToClipBoard:D}}function ue({isOpen:d,edit:a,onSuccess:n,onCancel:r}){const{appCode:x,currentApp:c}=ee(),s=z()[0],{slug:h,formId:u,isValid:g,isSubmitting:o,disableSlug:i,versionSlug:I,correctSlug:M,register:b,handleSubmit:$,onSubmit:k,handleUploadImage:f,handleDeleteImage:v,onCopyToClipBoard:N,onSlugChange:S,onPublicChange:y}=ie({resource:s,onSuccess:n,onCancel:r}),{data:R}=se(),{t:l}=B();return te.createPortal(e.jsxs(C,{id:"resource_edit_modal",size:"lg",isOpen:d,onModalClose:r,children:[e.jsx(C.Header,{onModalClose:r,children:l(a?"explorer.resource.editModal.header.edit":"explorer.resource.editModal.header.create")}),e.jsxs(C.Body,{children:[e.jsx(A,{headingStyle:"h4",level:"h3",className:"mb-16",children:l("explorer.resource.editModal.heading.general")}),e.jsxs("form",{id:u,onSubmit:$(k),children:[e.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 mb-24",children:[e.jsx(ae,{app:c,src:s==null?void 0:s.thumbnail,label:l("explorer.imagepicker.label"),addButtonLabel:l("explorer.imagepicker.button.add"),deleteButtonLabel:l("explorer.imagepicker.button.delete"),onUploadImage:f,onDeleteImage:v,className:"align-self-center"}),e.jsxs("div",{className:"col",children:[e.jsxs(m,{id:"title",className:"mb-16",isRequired:!0,children:[e.jsx(F,{children:l("title")}),e.jsx(P,{type:"text",defaultValue:a?s==null?void 0:s.name:"",...b("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:l("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),e.jsxs(m,{id:"description",isOptional:!0,children:[e.jsx(F,{children:l("description")}),e.jsx(P,{type:"text",defaultValue:a?s==null?void 0:s.description:"",...b("description"),placeholder:l("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),le({workflow:"createPublic",actions:R})&&e.jsx(oe,{appCode:x,correctSlug:M,disableSlug:i,onCopyToClipBoard:N,onPublicChange:y,onSlugChange:S,resource:s,slug:h,versionSlug:I,register:b})]})]}),e.jsxs(C.Footer,{children:[e.jsx(T,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:l("explorer.cancel")}),e.jsx(T,{form:u,type:"submit",color:"primary",variant:"filled",disabled:!g||o,children:l(a?"save":"explorer.create")})]})]}),document.getElementById("portal"))}export{ue as default};
1
+ import{u as E,j as a,H as Y,A as X,F as v,B as O,$ as me,d as ee,q as xe,a0 as be,p as te,n as we,r as S,W as Se,t as Be,Q as je,f as _e,a as ke,M as P,Z as q,k as Ce,a1 as $e}from"./index.js";import{APP as se}from"/assets/js/edifice-ts-client/index.js";import{u as Ie}from"./index.esm.js";import{I as Ae,T as ve}from"./TextArea.js";const ze=({appCode:s,isPublic:r,onCopyToClipBoard:i,onPublicChange:e,register:t,slug:n,resourceName:o})=>{const{t:c}=E();return a.jsxs(a.Fragment,{children:[a.jsxs(Y,{headingStyle:"h4",level:"h3",className:"mb-16",children:[c("explorer.resource.editModal.heading.access"),s]}),a.jsx(X,{type:"info",children:c("explorer.resource.editModal.access.alert")}),a.jsxs(v,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[a.jsx(v.Input,{type:"checkbox",role:"switch",...t("enablePublic",{disabled:!r&&!o,onChange:l=>{e(l.target.checked)}}),className:"form-check-input mt-0",size:"md"}),a.jsx(v.Label,{className:"form-check-label mb-0",children:c("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),r&&a.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[a.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",n]}),a.jsx(O,{color:"primary",disabled:!r,onClick:()=>i(),type:"button",leftIcon:a.jsx(me,{}),variant:"ghost",className:"text-nowrap",children:c("explorer.resource.editModal.access.url.button")})]})]})},W=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function Ne(s,r){r?r={...W,...r}:r=W;const i=re(r);return i.dispatch(s),i.toString()}const Pe=Object.freeze(["prototype","__proto__","constructor"]);function re(s){let r="",i=new Map;const e=t=>{r+=t};return{toString(){return r},getContext(){return i},dispatch(t){return s.replacer&&(t=s.replacer(t)),this[t===null?"null":typeof t](t)},object(t){if(t&&typeof t.toJSON=="function")return this.object(t.toJSON());const n=Object.prototype.toString.call(t);let o="";const c=n.length;c<10?o="unknown:["+n+"]":o=n.slice(8,c-1),o=o.toLowerCase();let l=null;if((l=i.get(t))===void 0)i.set(t,i.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(t))return e("buffer:"),e(t.toString("utf8"));if(o!=="object"&&o!=="function"&&o!=="asyncfunction")this[o]?this[o](t):s.ignoreUnknown||this.unkown(t,o);else{let d=Object.keys(t);s.unorderedObjects&&(d=d.sort());let p=[];s.respectType!==!1&&!G(t)&&(p=Pe),s.excludeKeys&&(d=d.filter(u=>!s.excludeKeys(u)),p=p.filter(u=>!s.excludeKeys(u))),e("object:"+(d.length+p.length)+":");const g=u=>{this.dispatch(u),e(":"),s.excludeValues||this.dispatch(t[u]),e(",")};for(const u of d)g(u);for(const u of p)g(u)}},array(t,n){if(n=n===void 0?s.unorderedArrays!==!1:n,e("array:"+t.length+":"),!n||t.length<=1){for(const l of t)this.dispatch(l);return}const o=new Map,c=t.map(l=>{const d=re(s);d.dispatch(l);for(const[p,g]of d.getContext())o.set(p,g);return d.toString()});return i=o,c.sort(),this.array(c,!1)},date(t){return e("date:"+t.toJSON())},symbol(t){return e("symbol:"+t.toString())},unkown(t,n){if(e(n),!!t&&(e(":"),t&&typeof t.entries=="function"))return this.array(Array.from(t.entries()),!0)},error(t){return e("error:"+t.toString())},boolean(t){return e("bool:"+t)},string(t){e("string:"+t.length+":"),e(t)},function(t){e("fn:"),G(t)?this.dispatch("[native]"):this.dispatch(t.toString()),s.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(t.name)),s.respectFunctionProperties&&this.object(t)},number(t){return e("number:"+t)},xml(t){return e("xml:"+t.toString())},null(){return e("Null")},undefined(){return e("Undefined")},regexp(t){return e("regex:"+t.toString())},uint8array(t){return e("uint8array:"),this.dispatch(Array.prototype.slice.call(t))},uint8clampedarray(t){return e("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(t))},int8array(t){return e("int8array:"),this.dispatch(Array.prototype.slice.call(t))},uint16array(t){return e("uint16array:"),this.dispatch(Array.prototype.slice.call(t))},int16array(t){return e("int16array:"),this.dispatch(Array.prototype.slice.call(t))},uint32array(t){return e("uint32array:"),this.dispatch(Array.prototype.slice.call(t))},int32array(t){return e("int32array:"),this.dispatch(Array.prototype.slice.call(t))},float32array(t){return e("float32array:"),this.dispatch(Array.prototype.slice.call(t))},float64array(t){return e("float64array:"),this.dispatch(Array.prototype.slice.call(t))},arraybuffer(t){return e("arraybuffer:"),this.dispatch(new Uint8Array(t))},url(t){return e("url:"+t.toString())},map(t){e("map:");const n=[...t];return this.array(n,s.unorderedSets!==!1)},set(t){e("set:");const n=[...t];return this.array(n,s.unorderedSets!==!1)},file(t){return e("file:"),this.dispatch([t.name,t.size,t.type,t.lastModfied])},blob(){if(s.ignoreUnknown)return e("[blob]");throw new Error(`Hashing Blob objects is currently not supported
2
+ Use "options.replacer" or "options.ignoreUnknown"
3
+ `)},domwindow(){return e("domwindow")},bigint(t){return e("bigint:"+t.toString())},process(){return e("process")},timer(){return e("timer")},pipe(){return e("pipe")},tcp(){return e("tcp")},udp(){return e("udp")},tty(){return e("tty")},statwatcher(){return e("statwatcher")},securecontext(){return e("securecontext")},connection(){return e("connection")},zlib(){return e("zlib")},context(){return e("context")},nodescript(){return e("nodescript")},httpparser(){return e("httpparser")},dataview(){return e("dataview")},signal(){return e("signal")},fsevent(){return e("fsevent")},tlswrap(){return e("tlswrap")}}}const ie="[native code] }",Me=ie.length;function G(s){return typeof s!="function"?!1:Function.prototype.toString.call(s).slice(-Me)===ie}class b{constructor(r,i){r=this.words=r||[],this.sigBytes=i===void 0?r.length*4:i}toString(r){return(r||Re).stringify(this)}concat(r){if(this.clamp(),this.sigBytes%4)for(let i=0;i<r.sigBytes;i++){const e=r.words[i>>>2]>>>24-i%4*8&255;this.words[this.sigBytes+i>>>2]|=e<<24-(this.sigBytes+i)%4*8}else for(let i=0;i<r.sigBytes;i+=4)this.words[this.sigBytes+i>>>2]=r.words[i>>>2];return this.sigBytes+=r.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new b([...this.words])}}const Re={stringify(s){const r=[];for(let i=0;i<s.sigBytes;i++){const e=s.words[i>>>2]>>>24-i%4*8&255;r.push((e>>>4).toString(16),(e&15).toString(16))}return r.join("")}},Oe={stringify(s){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=[];for(let e=0;e<s.sigBytes;e+=3){const t=s.words[e>>>2]>>>24-e%4*8&255,n=s.words[e+1>>>2]>>>24-(e+1)%4*8&255,o=s.words[e+2>>>2]>>>24-(e+2)%4*8&255,c=t<<16|n<<8|o;for(let l=0;l<4&&e*8+l*6<s.sigBytes*8;l++)i.push(r.charAt(c>>>6*(3-l)&63))}return i.join("")}},Ee={parse(s){const r=s.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(s.charCodeAt(e)&255)<<24-e%4*8;return new b(i,r)}},Le={parse(s){return Ee.parse(unescape(encodeURIComponent(s)))}};class Ue{constructor(){this._data=new b,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new b,this._nDataBytes=0}_append(r){typeof r=="string"&&(r=Le.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes}_doProcessBlock(r,i){}_process(r){let i,e=this._data.sigBytes/(this.blockSize*4);r?e=Math.ceil(e):e=Math.max((e|0)-this._minBufferSize,0);const t=e*this.blockSize,n=Math.min(t*4,this._data.sigBytes);if(t){for(let o=0;o<t;o+=this.blockSize)this._doProcessBlock(this._data.words,o);i=this._data.words.splice(0,t),this._data.sigBytes-=n}return new b(i,n)}}class Fe extends Ue{update(r){return this._append(r),this._process(),this}finalize(r){r&&this._append(r)}}const Z=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Te=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],B=[];class He extends Fe{constructor(){super(...arguments),this._hash=new b([...Z])}reset(){super.reset(),this._hash=new b([...Z])}_doProcessBlock(r,i){const e=this._hash.words;let t=e[0],n=e[1],o=e[2],c=e[3],l=e[4],d=e[5],p=e[6],g=e[7];for(let u=0;u<64;u++){if(u<16)B[u]=r[i+u]|0;else{const x=B[u-15],y=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,m=B[u-2],_=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;B[u]=y+B[u-7]+_+B[u-16]}const k=l&d^~l&p,C=t&n^t&o^n&o,w=(t<<30|t>>>2)^(t<<19|t>>>13)^(t<<10|t>>>22),$=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),j=g+$+k+Te[u]+B[u],I=w+C;g=p,p=d,d=l,l=c+j|0,c=o,o=n,n=t,t=j+I|0}e[0]=e[0]+t|0,e[1]=e[1]+n|0,e[2]=e[2]+o|0,e[3]=e[3]+c|0,e[4]=e[4]+l|0,e[5]=e[5]+d|0,e[6]=e[6]+p|0,e[7]=e[7]+g|0}finalize(r){super.finalize(r);const i=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(i/4294967296),this._data.words[(e+64>>>9<<4)+15]=i,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function Ke(s){return new He().finalize(s).toString(Oe)}function J(s,r={}){const i=typeof s=="string"?s:Ne(s,r);return Ke(i).slice(0,10)}var ne={};Object.defineProperty(ne,"__esModule",{value:!0});const Ve=s=>{const r="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",i="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",e=r.split("").join("|"),t=new RegExp(`(${e})`,"g");function n(o){return i[r.indexOf(o)]||""}return s.replace(t,n)},qe=s=>s.split("").map(r=>`\\${r}`).join(""),Q=(s,r,i=!1)=>{const e=Ve(s).trim().toLowerCase(),t=qe(r);return i?e.replace(/\s+/g,r):e.replace(new RegExp(`[^a-z0-9${t}]+`,"g"),r).replace(new RegExp(`${t}+`,"g"),r).replace(new RegExp(`^${t}`,"g"),"").replace(new RegExp(`${t}$`,"g"),"")},A=(s,r={delimiter:"-",prefix:""})=>{if(r.delimiter||(r.delimiter="-"),r.prefix||(r.prefix=""),!s||typeof s=="boolean")return"";const{delimiter:i,prefix:e}=r;if(typeof s=="boolean")return"";if(typeof s=="string"||typeof s=="number"){const t=Q(e,i,!0),n=Q(String(s),i);return t?`${t}${i}${n}`:n}return"children"in s?A(s.children):"type"in s?A(s.props.children,r):Symbol.iterator in s?A(Array.from(s).map(t=>A(t,{delimiter:i})).join(i),r):""};var D=ne.default=A;function We({resource:s,edit:r,onSuccess:i,onCancel:e}){var H;const{appCode:t}=ee(),{t:n}=E(),o=xe(),c=be(),l=te(),d=we(),{watch:p,reset:g,register:u,handleSubmit:k,setFocus:C,setValue:w,formState:{errors:$,isSubmitting:j,isValid:I}}=Ie({mode:"onChange",defaultValues:{description:s==null?void 0:s.description,enablePublic:s==null?void 0:s.public,title:s==null?void 0:s.name}}),x=S.useId(),y=Se(),{hotToast:m}=Be(X),[_,M]=S.useState((s==null?void 0:s.slug)||""),[f,ae]=S.useState(!!(s!=null&&s.public)),[L,U]=S.useState(((H=l[0])==null?void 0:H.thumbnail)||""),[oe,F]=S.useState(!1),z=p("title"),R=S.useId(),le=h=>{U(h)},ce=()=>{U("")};S.useEffect(()=>{if(f){let h="";s&&s.slug?h=s.slug:h=`${J({foo:`${z}${R}`})}-${D(z)}`,M(h)}},[f,s,z,R]);function ue(h){ae(h)}const de=je(),{filters:T,trashed:he}=d,pe=["context",{folderId:T.folder,filters:T,trashed:he}],fe=async function(h){var K,V;try{F(!0);const N=h.enablePublic?s&&s.slug?s.slug:`${J({foo:`${h.title}${R}`})}-${D(h.title)}`:"";r?await o.mutateAsync({description:h.description||"",entId:(K=l[0])==null?void 0:K.assetId,name:h.title,public:h.enablePublic,slug:N,trashed:(V=l[0])==null?void 0:V.trashed,thumbnail:L}):(de.invalidateQueries(pe),await c.mutateAsync({name:h.title,description:h.description||"",thumbnail:L,folder:(y==null?void 0:y.id)==="default"?void 0:parseInt((y==null?void 0:y.id)||""),public:h.enablePublic,slug:N,app:t})),m.success(a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:n(r?"explorer.resource.updated":"explorer.resource.created")}),a.jsxs("p",{children:["Titre: ",h.title]}),a.jsxs("p",{children:["Description: ",h.description]}),r&&t===se.BLOG&&a.jsxs("p",{children:["Public:",h.enablePublic?n("explorer.enable.public.yes"):n("explorer.enable.public.no")]})]})),i==null||i()}catch(N){console.error(N)}finally{F(!1)}};function ge(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${_}`),m.success(n("explorer.copy.clipboard"))}function ye(){g(),e()}return{slug:_,isPublic:f,formId:x,errors:$,isSubmitting:j,isValid:I,resourceName:z,isLoading:oe,onPublicChange:ue,register:u,setFocus:C,setValue:w,handleSubmit:k,onFormCancel:ye,onSubmit:fe,handleUploadImage:le,handleDeleteImage:ce,onCopyToClipBoard:ge}}function De({isOpen:s,edit:r,onSuccess:i,onCancel:e}){const{appCode:t,currentApp:n}=ee(),c=te()[0],{slug:l,formId:d,isValid:p,isSubmitting:g,isPublic:u,resourceName:k,isLoading:C,register:w,handleSubmit:$,onSubmit:j,handleUploadImage:I,handleDeleteImage:x,onCopyToClipBoard:y,onPublicChange:m,setValue:_}=We({resource:c,edit:r,onSuccess:i,onCancel:e}),{data:M}=_e(),{t:f}=E();return ke.createPortal(a.jsxs(P,{id:"resource_edit_modal",size:"lg",isOpen:s,onModalClose:e,children:[a.jsx(P.Header,{onModalClose:e,children:f(r?"explorer.resource.editModal.header.edit":"explorer.resource.editModal.header.create")}),a.jsxs(P.Body,{children:[a.jsx(Y,{headingStyle:"h4",level:"h3",className:"mb-16",children:f("explorer.resource.editModal.heading.general")}),a.jsxs("form",{id:d,onSubmit:$(j),children:[a.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[a.jsx("div",{children:a.jsx(Ae,{app:n,src:c==null?void 0:c.thumbnail,label:f("explorer.imagepicker.label"),addButtonLabel:f("explorer.imagepicker.button.add"),deleteButtonLabel:f("explorer.imagepicker.button.delete"),onUploadImage:I,onDeleteImage:x,className:"align-self-center mt-8"})}),a.jsxs("div",{className:"col",children:[a.jsxs(v,{id:"title",className:"mb-16",isRequired:!0,children:[a.jsx(q,{children:f("title")}),a.jsx(Ce,{type:"text",defaultValue:r?c==null?void 0:c.name:"",...w("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:f("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),a.jsxs(v,{id:"description",isOptional:!0,children:[a.jsx(q,{children:f("description")}),a.jsx(ve,{defaultValue:r?c==null?void 0:c.description:"",...w("description"),placeholder:f("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),t===se.BLOG&&$e({workflow:"createPublic",actions:M})&&a.jsx(ze,{appCode:t,isPublic:u,onCopyToClipBoard:y,onPublicChange:m,resource:c,resourceName:k,slug:l,setValue:_,register:w})]})]}),a.jsxs(P.Footer,{children:[a.jsx(O,{color:"tertiary",onClick:e,type:"button",variant:"ghost",children:f("explorer.cancel")}),a.jsx(O,{form:d,type:"submit",color:"primary",isLoading:C,variant:"filled",disabled:!p||g,children:f(r?"save":"explorer.create")})]})]}),document.getElementById("portal"))}export{De as default};
@@ -1 +1 @@
1
- import{j as e,H as n}from"./index.js";const c=({imageSrc:s,imageAlt:t="",title:a,text:m})=>e.jsxs("div",{className:"emptyscreen",children:[s&&e.jsx("div",{className:"emptyscreen-image mb-12",children:e.jsx("img",{className:"mx-auto",src:s,alt:t,width:"250",height:"250"})}),a&&e.jsx(n,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:a}),m&&e.jsx("div",{className:"text",children:m})]});c.displayName="EmptyScreen";const r=c;export{r as E};
1
+ import{j as e,H as n}from"./index.js";const c=({imageSrc:s,imageAlt:t="",title:a,text:m})=>e.jsxs("div",{className:"emptyscreen",children:[s&&e.jsx("div",{className:"emptyscreen-image mb-12",children:e.jsx("img",{className:"mx-auto",src:s,alt:t,width:"250",height:"250"})}),a&&e.jsx(n,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:a}),m&&e.jsx("div",{className:"text",children:m})]});c.displayName="EmptyScreen";const i=c;export{i as E};
@@ -1 +1 @@
1
- import{u as i,a as n,Y as a,j as c}from"./index.js";import{E as u}from"./EmptyScreen.js";function b(){const{appCode:o,theme:e}=i(),{t:r}=n(),{data:l}=a(),t=l==null?void 0:l.find(s=>s.id==="create"),p=()=>t!=null&&t.available&&(e!=null&&e.is1d)?r("explorer.emptyScreen.blog.txt1d.create"):t!=null&&t.available&&!(e!=null&&e.is1d)?r("explorer.emptyScreen.blog.txt2d.create"):!(t!=null&&t.available)&&(e!=null&&e.is1d)?r("explorer.emptyScreen.blog.txt1d.consultation"):r("explorer.emptyScreen.blog.txt2d.consultation");return c.jsx(u,{imageSrc:`${e==null?void 0:e.bootstrapPath}/images/emptyscreen/illu-${o}.svg`,imageAlt:r("explorer.emptyScreen.app.alt"),title:`${t!=null&&t.available?r("explorer.emptyScreen.blog.title.create"):r("explorer.emptyScreen.blog.title.consultation")}`,text:p()})}export{b as default};
1
+ import{d as i,h as a,u as c,f as u,j as m,b as x}from"./index.js";import{E as d}from"./EmptyScreen.js";import"/assets/js/edifice-ts-client/index.js";function b(){const{appCode:s}=i(),{theme:t}=a(),[l]=x(),{t:r}=c(),{data:n}=u(),e=n==null?void 0:n.find(o=>o.id==="create"),p=()=>e!=null&&e.available&&(t!=null&&t.is1d)?r("explorer.emptyScreen.txt1d.create",{ns:s}):e!=null&&e.available&&!(t!=null&&t.is1d)?r("explorer.emptyScreen.txt2d.create",{ns:s}):!(e!=null&&e.available)&&(t!=null&&t.is1d)?r("explorer.emptyScreen.txt1d.consultation",{ns:s}):r("explorer.emptyScreen.txt2d.consultation",{ns:s});return m.jsx(d,{imageSrc:`${l}/emptyscreen/illu-${s}.svg`,imageAlt:r("explorer.emptyScreen.app.alt",{ns:s}),title:`${e!=null&&e.available?r("explorer.emptyScreen.title.create",{ns:s}):r("explorer.emptyScreen.title.consultation")}`,text:p()})}export{b as default};
@@ -0,0 +1 @@
1
+ import{u as t,j as o,b as s}from"./index.js";import{E as a}from"./EmptyScreen.js";import"/assets/js/edifice-ts-client/index.js";function i(){const[r]=s(),{t:e}=t();return o.jsx(a,{imageSrc:`${r}/emptyscreen/illu-error.svg`,imageAlt:e("explorer.emptyScreen.error.alt"),text:"explorer.emptyScreen.error.text"})}export{i as default};
@@ -1 +1 @@
1
- import{u as r,a as n,j as o}from"./index.js";import{E as s}from"./EmptyScreen.js";function m(){const{theme:e}=r(),{t}=n();return o.jsx(s,{imageSrc:`${e==null?void 0:e.bootstrapPath}/images/emptyscreen/illu-no-content-in-folder.svg`,imageAlt:t("explorer.emptyScreen.folder.empty.alt"),text:t("explorer.emptyScreen.label")})}export{m as default};
1
+ import{d as r,u as o,j as s,b as a}from"./index.js";import{E as m}from"./EmptyScreen.js";import"/assets/js/edifice-ts-client/index.js";function c(){const[n]=a(),{appCode:e}=r(),{t}=o();return s.jsx(m,{imageSrc:`${n}/emptyscreen/illu-no-content-in-folder.svg`,imageAlt:t("explorer.emptyScreen.folder.empty.alt",{ns:e}),text:t("explorer.emptyScreen.label",{ns:e})})}export{c as default};
@@ -0,0 +1 @@
1
+ import{d as s,u as a,j as n,b as o}from"./index.js";import{E as c}from"./EmptyScreen.js";import"/assets/js/edifice-ts-client/index.js";function l(){const{appCode:e}=s(),[r]=o(),{t}=a();return n.jsx(c,{imageSrc:`${r}/emptyscreen/illu-search.svg`,imageAlt:t("explorer.emptyScreen.search.alt",{ns:e}),text:t("explorer.emptyScreen.search.text",{ns:e})})}export{l as default};
@@ -1 +1 @@
1
- import{u as r,a,j as n}from"./index.js";import{E as o}from"./EmptyScreen.js";function i(){const{appCode:s}=r(),{theme:e}=r(),{t}=a();return n.jsx(o,{imageSrc:`${e==null?void 0:e.bootstrapPath}/images/emptyscreen/illu-trash.svg`,imageAlt:t("explorer.emptyScreen.trash.alt"),title:t("explorer.emptyScreen.trash.title"),text:t("explorer.emptyScreen.trash.empty",{ns:s})})}export{i as default};
1
+ import{d as s,u as a,j as n,b as p}from"./index.js";import{E as m}from"./EmptyScreen.js";import"/assets/js/edifice-ts-client/index.js";function c(){const{appCode:t}=s(),[r]=p(),{t:e}=a();return n.jsx(m,{imageSrc:`${r}/emptyscreen/illu-trash.svg`,imageAlt:e("explorer.emptyScreen.trash.alt"),title:e("explorer.emptyScreen.trash.title"),text:e("explorer.emptyScreen.trash.empty",{ns:t})})}export{c as default};
@@ -1 +1 @@
1
- import{u as h,a9 as j,G as f,aa as y,c as C,ab as I,ac as T,j as i,$ as a}from"./index.js";import{C as b}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";const $=()=>{var r,d;const{currentApp:p}=h(),{data:e,isFetching:u}=j(),l=f(),o=y(),{setSelectedFolders:c,setFolderIds:n,openFolder:m}=C();function g(s){o.includes(s.id)?(n(o.filter(t=>t!==s.id)),c(l.filter(t=>t.id!==s.id))):(n([...o,s.id]),c([...l,s]))}const F=I({from:{opacity:0},to:{opacity:1}}),S=T();return(r=e==null?void 0:e.pages[0])!=null&&r.folders.length?i.jsx(a.ul,{className:"grid ps-0 list-unstyled mb-24",children:(d=e==null?void 0:e.pages[0])==null?void 0:d.folders.map(s=>{const{id:t,name:x}=s;return i.jsx(a.li,{className:"g-col-4",style:{...F},children:i.jsx(b,{app:p,name:x,isFolder:!0,isLoading:u,isSelected:o.includes(s.id),onOpen:()=>{S(),m({folder:s,folderId:s.id})},onSelect:()=>g(s)})},t)})}):null};export{$ as default};
1
+ import{j as l,aa as S,d as C,P as y,ab as f,e as T,ac as I,ad as N,ae as m}from"./index.js";import{C as a}from"./Card.js";import"/assets/js/edifice-ts-client/index.js";const g=({app:e,name:n,isSelected:r=!1,isSelectable:o=!0,onClick:t,onSelect:c})=>l.jsx(a,{app:e,isSelectable:o,isSelected:r,onClick:t,onSelect:c,children:d=>l.jsxs(a.Body,{children:[l.jsx(S,{width:"48",height:"48",className:`color-app-${d}`}),l.jsx(a.Title,{children:n})]})});g.displayName="FolderCard";const $=g,k=({data:e})=>{var p,u;const{currentApp:n}=C(),r=y(),o=f(),{setSelectedFolders:t,setFolderIds:c,openFolder:d}=T();function F(s){o.includes(s.id)?(c(o.filter(i=>i!==s.id)),t(r.filter(i=>i.id!==s.id))):(c([...o,s.id]),t([...r,s]))}const x=I({from:{opacity:0},to:{opacity:1}}),h=N();return(p=e==null?void 0:e.pages[0])!=null&&p.folders.length?l.jsx(m.ul,{className:"grid ps-0 list-unstyled mb-24",children:(u=e==null?void 0:e.pages[0])==null?void 0:u.folders.map(s=>{const{id:i,name:j}=s;return l.jsx(m.li,{className:"g-col-4 z-1",style:{position:"relative",...x},children:l.jsx($,{name:j,app:n,isSelected:o.includes(s.id),onClick:()=>{h(),d({folder:s,folderId:s.id})},onSelect:()=>F(s)})},i)})}):null};export{k as default};
package/dist/Library.js CHANGED
@@ -1 +1 @@
1
- import{r as n,j as r,I as c,B as x,d as m,a as d,e as p}from"./index.js";const t=n.forwardRef(({text:e,textButton:a,src:s,alt:i,url:l},o)=>r.jsx(r.Fragment,{children:r.jsxs("div",{ref:o,className:"p-16",children:[r.jsx(c,{width:"270",height:"140",loading:"lazy",className:"rounded",src:s,alt:i}),r.jsx("p",{className:"m-8",children:e}),r.jsx("a",{href:l,target:"_blank",rel:"noreferrer",children:r.jsx(x,{rightIcon:r.jsx(m,{}),className:"py-0 px-8",variant:"ghost",color:"primary",children:a})})]})}));t.displayName="Library";const g=t,y=({url:e})=>{const{t:a}=d(),{theme:s}=p();return r.jsx(g,{src:`${s==null?void 0:s.bootstrapPath}/images/image-library.svg`,url:e,alt:a("explorer.libray.img.alt"),text:a("explorer.libray.title"),textButton:a("explorer.libray.btn")})};export{y as default};
1
+ import{r as n,j as r,I as c,B as x,g as m,u as h,h as p,b as d}from"./index.js";import"/assets/js/edifice-ts-client/index.js";const i=n.forwardRef(({text:e,textButton:a,src:s,alt:t,url:o},l)=>r.jsx(r.Fragment,{children:r.jsxs("div",{ref:l,className:"p-16",children:[r.jsx(c,{width:"270",height:"140",loading:"lazy",className:"rounded",src:s,alt:t}),r.jsx("p",{className:"m-8",children:e}),r.jsx("a",{href:o,target:"_blank",rel:"noreferrer",children:r.jsx(x,{rightIcon:r.jsx(m,{}),className:"py-0 px-8",variant:"ghost",color:"primary",children:a})})]})}));i.displayName="Library";const g=i,u=({url:e})=>{const{t:a}=h(),{theme:s}=p(),[t]=d();return r.jsx(g,{src:`${t}/${s==null?void 0:s.bootstrapVersion}/image-library.svg`,url:e,alt:a("explorer.libray.img.alt"),text:a("explorer.libray.title"),textButton:a("explorer.libray.btn")})};export{u as default};
package/dist/MoveModal.js CHANGED
@@ -1 +1 @@
1
- import{r as p,E as v,G as T,i as M,c as y,J as b,a as j,K as F,b as S,j as o,M as n,T as w,B as h}from"./index.js";function E({onSuccess:a}){const[s,r]=p.useState(),l=v(),d=T(),c=M(),{foldTreeItem:i,unfoldTreeItem:m}=y(),u=b();async function f(){try{if(!s)throw new Error("explorer.move.selection.empty");await l.mutate(s),await(a==null?void 0:a())}catch(e){console.error(e)}}const I=e=>{var x;for(const t of d)if(e===t.id||e===t.parentId)return!1;for(const t of c)if(e===((t==null?void 0:t.folderIds)&&t.folderIds[0])||((x=t==null?void 0:t.folderIds)==null?void 0:x.length)===0&&e==="default")return!1;return!0};return{disableSubmit:!s,handleTreeItemSelect:e=>{I(e)?r(e):r(void 0)},handleTreeItemFold:i,handleTreeItemUnfold:async e=>await m(e,u),onMove:()=>{f()}}}function g({isOpen:a,onSuccess:s,onCancel:r}){const{t:l}=j(),{handleTreeItemFold:d,handleTreeItemSelect:c,handleTreeItemUnfold:i,onMove:m,disableSubmit:u}=E({onSuccess:s}),f=F();return S.createPortal(o.jsxs(n,{isOpen:a,onModalClose:r,id:"moveModal",children:[o.jsx(n.Header,{onModalClose:r,children:l("explorer.move.title")}),o.jsx(n.Subtitle,{children:l("explorer.move.subtitle")}),o.jsx(n.Body,{children:o.jsx(w,{data:f,onTreeItemSelect:c,onTreeItemFold:d,onTreeItemUnfold:i})}),o.jsxs(n.Footer,{children:[o.jsx(h,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:l("explorer.cancel")}),o.jsx(h,{color:"primary",onClick:m,type:"button",variant:"filled",disabled:u,children:l("explorer.move")})]})]}),document.getElementById("portal"))}export{g as default};
1
+ import{r as I,O as v,P as T,p as M,e as y,Q as j,u as b,T as F,a as S,j as o,M as n,U as w,B as x}from"./index.js";import"/assets/js/edifice-ts-client/index.js";function E({onSuccess:a}){const[s,r]=I.useState(),l=v(),d=T(),i=M(),{foldTreeItem:c,unfoldTreeItem:m}=y(),u=j();async function f(){try{if(!s)throw new Error("explorer.move.selection.empty");await l.mutate(s),await(a==null?void 0:a())}catch(e){console.error(e)}}const h=e=>{var p;for(const t of d)if(e===t.id||e===t.parentId)return!1;for(const t of i)if(e===((t==null?void 0:t.folderIds)&&t.folderIds[0])||((p=t==null?void 0:t.folderIds)==null?void 0:p.length)===0&&e==="default")return!1;return!0};return{disableSubmit:!s,handleTreeItemSelect:e=>{h(e)?r(e):r(void 0)},handleTreeItemFold:c,handleTreeItemUnfold:async e=>await m(e,u),onMove:()=>{f()}}}function g({isOpen:a,onSuccess:s,onCancel:r}){const{t:l}=b(),{handleTreeItemFold:d,handleTreeItemSelect:i,handleTreeItemUnfold:c,onMove:m,disableSubmit:u}=E({onSuccess:s}),f=F();return S.createPortal(o.jsxs(n,{isOpen:a,onModalClose:r,id:"moveModal",children:[o.jsx(n.Header,{onModalClose:r,children:l("explorer.move.title")}),o.jsx(n.Subtitle,{children:l("explorer.move.subtitle")}),o.jsx(n.Body,{children:o.jsx(w,{data:f,onTreeItemSelect:i,onTreeItemFold:d,onTreeItemUnfold:c})}),o.jsxs(n.Footer,{children:[o.jsx(x,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:l("explorer.cancel")}),o.jsx(x,{color:"primary",onClick:m,type:"button",variant:"filled",disabled:u,children:l("explorer.move")})]})]}),document.getElementById("portal"))}export{g as default};