ode-explorer 1.0.0-dev.202307050756 → 1.0.0-dev.202307070707

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/Card.js CHANGED
@@ -1 +1 @@
1
- import{r as R,f as a,j as s,t as B,ad as E,ae as F,I as q,a8 as G,q as U,af as D,ag as H,ah as J,ai 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{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 +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:/^\S/,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{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 +1 @@
1
- import{a as B,j as e,H as A,p as E,F as x,y as P,W as G,B as T,X as J,k as K,i as z,r as m,m as Q,u as ee,Y as te,b as se,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:u,refPublic:c,refSlug:f,register:t,resource:h,slug:p,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(x,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[e.jsx(x.Input,{type:"checkbox",role:"switch",...t("enablePublic",{value:h.public,onChange:i=>r(i.target.checked)}),className:"form-check-input mt-0",size:"md"},c),e.jsx(x.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e.jsx(x,{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",...t("safeSlug",{validate:{required:i=>!i&&!n?o("explorer.slug.name.mandatory"):!0},disabled:n,value:p,onChange:i=>u(i.target.value)}),size:"md",placeholder:o("explorer.resource.editModal.access.url.extension")},f),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(),u=K(),c=z(),{reset:f,register:t,handleSubmit:h,setFocus:p,formState:{errors:g,isSubmitting:o,isValid:i}}=re({mode:"onChange"}),I=m.useId(),[M,b]=m.useState(new Date().getTime()),[$,k]=m.useState(!d.public),[j,S]=m.useState(d.slug||""),[N,v]=m.useState(!1),{hotToast:y}=Q(E),[R,s]=m.useState({name:"",image:c[0].thumbnail}),_=l=>{s(l)},L=()=>{s({name:"",image:""})};function U(l){k(!l),l||(S(""),b(new Date().getTime()))}function V(l){if(!l)return"";const w="àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœøṕŕßśșțùúüûǘẃẍÿź·/_,:;",W="aaaaaaaaceeeeghiiiimnnnooooooprssstuuuuuwxyz------",X=new RegExp(w.split("").join("|"),"g"),Y=l.toString().toLowerCase().replace(/\s+/g,"-").replace(X,Z=>W.charAt(w.indexOf(Z))).replace(/&/g,"-and-").replace(/[^\w\\-]+/g,"").replace(/\\-\\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"");S(Y)}const q=async function(l){try{await u.mutateAsync({description:l.description,entId:c[0].assetId,name:l.title,public:l.enablePublic,slug:l.safeSlug,trashed:c[0].trashed,thumbnail:R.image}),v(!1),y.success(e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:r("explorer.resource.updated")}),e.jsxs("p",{children:["Titre: ",l.title]}),e.jsxs("p",{children:["Public:",l.enablePublic?r("explorer.enable.public.yes"):r("explorer.enable.public.no")]})]})),a==null||a()}catch(w){v(!0),console.error(w)}};function D(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${j}`),y.success(r("explorer.copy.clipboard"))}function H(){f(),n()}const O=`resource_edit_modal_${I}`;return{slug:j,disableSlug:$,formId:O,errors:g,isSubmitting:o,isValid:i,versionSlug:M,correctSlug:N,onPublicChange:U,onSlugChange:V,register:t,setFocus:p,handleSubmit:h,onFormCancel:H,onSubmit:q,handleUploadImage:_,handleDeleteImage:L,onCopyToClipBoard:D}}function ue({isOpen:d,edit:a,onSuccess:n,onCancel:r}){const{appCode:u,currentApp:c}=ee(),t=z()[0],{slug:h,formId:p,isValid:g,isSubmitting:o,disableSlug:i,versionSlug:I,correctSlug:M,register:b,handleSubmit:$,onSubmit:k,handleUploadImage:j,handleDeleteImage:S,onCopyToClipBoard:N,onSlugChange:v,onPublicChange:y}=ie({resource:t,onSuccess:n,onCancel:r}),{data:R}=te(),{t:s}=B();return se.createPortal(e.jsxs(C,{id:"resource_edit_modal",size:"lg",isOpen:d,onModalClose:r,children:[e.jsx(C.Header,{onModalClose:r,children:s(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:s("explorer.resource.editModal.heading.general")}),e.jsxs("form",{id:p,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:t==null?void 0:t.thumbnail,label:s("explorer.imagepicker.label"),addButtonLabel:s("explorer.imagepicker.button.add"),deleteButtonLabel:s("explorer.imagepicker.button.delete"),onUploadImage:j,onDeleteImage:S,className:"align-self-center"}),e.jsxs("div",{className:"col",children:[e.jsxs(x,{id:"title",className:"mb-16",isRequired:!0,children:[e.jsx(F,{children:s("title")}),e.jsx(P,{type:"text",defaultValue:a?t==null?void 0:t.name:"",...b("title",{required:!0,pattern:{value:/^\S/,message:"invalid title"}}),placeholder:s("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),u!=="blog"?e.jsxs(x,{id:"description",isOptional:!0,children:[e.jsx(F,{children:s("description")}),e.jsx(P,{type:"text",defaultValue:a?t==null?void 0:t.description:"",...b("description"),placeholder:s("explorer.resource.editModal.description.placeholder"),size:"md"})]}):null]})]}),le({workflow:"createPublic",actions:R})&&e.jsx(oe,{appCode:u,correctSlug:M,disableSlug:i,onCopyToClipBoard:N,onPublicChange:y,onSlugChange:v,resource:t,slug:h,versionSlug:I,register:b})]})]}),e.jsxs(C.Footer,{children:[e.jsx(T,{color:"tertiary",onClick:r,type:"button",variant:"ghost",children:s("explorer.cancel")}),e.jsx(T,{form:p,type:"submit",color:"primary",variant:"filled",disabled:!g||o,children:s(a?"save":"explorer.create")})]})]}),document.getElementById("portal"))}export{ue as default};
1
+ import{a as B,j as e,H as A,p as E,F as x,y as P,W as G,B as T,X as J,k as K,i as z,r as m,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:u,refPublic:c,refSlug:j,register:s,resource:h,slug:p,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(x,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[e.jsx(x.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(x.Label,{className:"form-check-label mb-0",children:o("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),e.jsx(x,{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:p,onChange:i=>u(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(),u=K(),c=z(),{reset:j,register:s,handleSubmit:h,setFocus:p,formState:{errors:g,isSubmitting:o,isValid:i}}=re({mode:"onChange"}),I=m.useId(),[M,b]=m.useState(new Date().getTime()),[$,k]=m.useState(!d.public),[f,v]=m.useState(d.slug||""),[N,S]=m.useState(!1),{hotToast:y}=Q(E),[R,l]=m.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 u.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:p,handleSubmit:h,onFormCancel:H,onSubmit:q,handleUploadImage:_,handleDeleteImage:L,onCopyToClipBoard:D}}function ue({isOpen:d,edit:a,onSuccess:n,onCancel:r}){const{appCode:u,currentApp:c}=ee(),s=z()[0],{slug:h,formId:p,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:p,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(x,{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})]}),u!=="blog"?e.jsxs(x,{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"})]}):null]})]}),le({workflow:"createPublic",actions:R})&&e.jsx(oe,{appCode:u,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:p,type:"submit",color:"primary",variant:"filled",disabled:!g||o,children:l(a?"save":"explorer.create")})]})]}),document.getElementById("portal"))}export{ue 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{u as r,a as o,j as n}from"./index.js";import{E as s}from"./EmptyScreen.js";function m(){const{theme:e}=r(),{t}=o();return n.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.folder.title")})}export{m as default};
@@ -1 +1 @@
1
- import{u as x,a9 as f,G as h,aa as j,c as y,ab as I,j as c,$ as a}from"./index.js";import{C}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";const b=()=>{const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}},R=()=>{var d,p;const{currentApp:t}=x(),{data:e,isFetching:u}=f(),n=h(),l=j(),{setSelectedFolders:r,setFolderIds:i,openFolder:m}=y();function g(s){l.includes(s.id)?(i(l.filter(o=>o!==s.id)),r(n.filter(o=>o.id!==s.id))):(i([...l,s.id]),r([...n,s]))}const S=I({from:{opacity:0},to:{opacity:1}}),F=b();return(d=e==null?void 0:e.pages[0])!=null&&d.folders.length?c.jsx(a.ul,{className:"grid ps-0 list-unstyled mb-24",children:(p=e==null?void 0:e.pages[0])==null?void 0:p.folders.map(s=>{const{id:o,name:T}=s;return c.jsx(a.li,{className:"g-col-4",style:{...S},children:c.jsx(C,{app:t,name:T,isFolder:!0,isLoading:u,isSelected:l.includes(s.id),onOpen:()=>{F(),m({folder:s,folderId:s.id})},onSelect:()=>g(s)})},o)})}):null};export{R as default};
1
+ import{u as f,a9 as h,G as j,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}=f(),{data:e,isFetching:u}=h(),l=j(),o=y(),{setSelectedFolders:n,setFolderIds:c,openFolder:m}=C();function g(s){o.includes(s.id)?(c(o.filter(t=>t!==s.id)),n(l.filter(t=>t.id!==s.id))):(c([...o,s.id]),n([...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 +1 @@
1
- import{u as O,a as B,a9 as E,g as w,a3 as z,i as D,c as q,D as G,ab as H,r as J,f as K,j as e,R as g,$ as h,ac as Q,B as U}from"./index.js";import{C as V}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";function W(r){const{rights:l,creatorId:i}=r;return l.filter(a=>!a.includes(i)).length>=1}const es=()=>{const{currentApp:r,currentLanguage:l,appCode:i}=O(),{t:n}=B(),{data:a,isFetching:x,fetchNextPage:f}=E(),d=w(),o=z(),m=D(),{setSelectedResources:u,setResourceIds:p,openResource:R,setResourceIsTrash:S}=q(),I=G(),j=H({from:{opacity:0},to:{opacity:1}}),b=d.pagination.startIdx+d.pagination.pageSize<(d.pagination.maxIdx||0),y=J.useCallback(()=>{f()},[]),N=s=>{I?(S(!0),p([s.id]),u([s])):R(s)};function C(s){o.includes(s.id)?(p(o.filter(c=>c!==s.id)),u(m.filter(c=>c.id!==s.id))):(p([...o,s.id]),u([...m,s]))}const P=K("grid ps-0 list-unstyled");return e.jsxs(g.Fragment,{children:[e.jsx(h.ul,{className:P,children:a==null?void 0:a.pages.map((s,c)=>e.jsx(g.Fragment,{children:s.resources.map(t=>{const{id:k,creatorName:A,creatorId:F,name:T,thumbnail:$,updatedAt:v}=t,L=W(t),M=Q(v).locale(l).fromNow();return e.jsx(h.li,{className:"g-col-4",style:{...j},children:e.jsx(V,{app:r,className:"c-pointer",creatorName:A,isPublic:t.public,isSelected:o.includes(t.id),isLoading:x,isShared:L,messagePublic:n("tooltip.public",{ns:i}),messageShared:n("tooltip.shared",{ns:i}),name:T,onOpen:()=>N(t),onSelect:()=>C(t),resourceSrc:$,updatedAt:M,userSrc:`/userbook/avatar/${F}`})},k)})},c))}),b&&e.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:e.jsx(U,{type:"button",color:"secondary",variant:"filled",onClick:y,children:n("explorer.see.more")})})]})};export{es as default};
1
+ import{u as O,a as B,a9 as E,g as w,a3 as z,i as D,c as q,D as G,ab as H,r as J,f as K,j as e,R as g,$ as h,ad as Q,B as U}from"./index.js";import{C as V}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";function W(r){const{rights:l,creatorId:i}=r;return l.filter(a=>!a.includes(i)).length>=1}const es=()=>{const{currentApp:r,currentLanguage:l,appCode:i}=O(),{t:n}=B(),{data:a,isFetching:x,fetchNextPage:f}=E(),d=w(),o=z(),m=D(),{setSelectedResources:u,setResourceIds:p,openResource:R,setResourceIsTrash:S}=q(),I=G(),j=H({from:{opacity:0},to:{opacity:1}}),b=d.pagination.startIdx+d.pagination.pageSize<(d.pagination.maxIdx||0),y=J.useCallback(()=>{f()},[]),N=s=>{I?(S(!0),p([s.id]),u([s])):R(s)};function C(s){o.includes(s.id)?(p(o.filter(c=>c!==s.id)),u(m.filter(c=>c.id!==s.id))):(p([...o,s.id]),u([...m,s]))}const P=K("grid ps-0 list-unstyled");return e.jsxs(g.Fragment,{children:[e.jsx(h.ul,{className:P,children:a==null?void 0:a.pages.map((s,c)=>e.jsx(g.Fragment,{children:s.resources.map(t=>{const{id:k,creatorName:A,creatorId:F,name:T,thumbnail:$,updatedAt:v}=t,L=W(t),M=Q(v).locale(l).fromNow();return e.jsx(h.li,{className:"g-col-4",style:{...j},children:e.jsx(V,{app:r,className:"c-pointer",creatorName:A,isPublic:t.public,isSelected:o.includes(t.id),isLoading:x,isShared:L,messagePublic:n("tooltip.public",{ns:i}),messageShared:n("tooltip.shared",{ns:i}),name:T,onOpen:()=>N(t),onSelect:()=>C(t),resourceSrc:$,updatedAt:M,userSrc:`/userbook/avatar/${F}`})},k)})},c))}),b&&e.jsx("div",{className:"d-grid gap-2 col-4 mx-auto my-24",children:e.jsx(U,{type:"button",color:"secondary",variant:"filled",onClick:y,children:n("explorer.see.more")})})]})};export{es as default};