ode-explorer 1.0.0-dev.202306301017 → 1.0.0-dev.202307041550
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/README.md +1 -1
- package/dist/AppAction.js +1 -1
- package/dist/Card.js +1 -1
- package/dist/DeleteModal.js +1 -1
- package/dist/EditFolderModal.js +1 -1
- package/dist/EditResourceModal.js +1 -1
- package/dist/EmptyScreenApp.js +1 -1
- package/dist/EmptyScreenNoContentInFolder.js +1 -1
- package/dist/EmptyScreenTrash.js +1 -1
- package/dist/FoldersList.js +1 -1
- package/dist/ImagePicker.js +1 -1
- package/dist/Library.js +1 -1
- package/dist/MoveModal.js +1 -1
- package/dist/OnboardingTrash.js +1 -1
- package/dist/PublishModal.js +2 -2
- package/dist/ResourcesList.js +1 -1
- package/dist/SelectList.js +1 -1
- package/dist/ShareResourceModal.js +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/TrashedResourceModal.js +1 -1
- package/dist/index.js +27 -27
- package/dist/style.css +1 -1
- package/dist/usePopper.js +1 -1
- package/dist/version.txt +1 -1
- package/package.json +32 -30
- package/LICENSE +0 -20
package/README.md
CHANGED
package/dist/AppAction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as
|
|
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};
|
package/dist/Card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as R,
|
|
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};
|
package/dist/DeleteModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/EditFolderModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/EmptyScreenApp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as
|
|
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 +1 @@
|
|
|
1
|
-
import{u as r,j as
|
|
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};
|
package/dist/EmptyScreenTrash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as r,j as
|
|
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};
|
package/dist/FoldersList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as x,
|
|
1
|
+
import{u as x,a9 as h,G as j,aa as f,c as y,ab as C,j as o,$ as a}from"./index.js";import{C as I}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";const O=()=>{var c,d;const{currentApp:p}=x(),{data:e,isFetching:u}=h(),n=j(),i=f(),{setSelectedFolders:l,setFolderIds:r,openFolder:m}=y();function g(s){i.includes(s.id)?(r(i.filter(t=>t!==s.id)),l(n.filter(t=>t.id!==s.id))):(r([...i,s.id]),l([...n,s]))}const F=C({from:{opacity:0},to:{opacity:1}});return(c=e==null?void 0:e.pages[0])!=null&&c.folders.length?o.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:S}=s;return o.jsx(a.li,{className:"g-col-4",style:{...F},children:o.jsx(I,{app:p,name:S,isFolder:!0,isLoading:u,isSelected:i.includes(s.id),onOpen:()=>m({folder:s,folderId:s.id}),onSelect:()=>g(s)})},t)})}):null};export{O as default};
|
package/dist/ImagePicker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,
|
|
1
|
+
import{r as s,f as R,j as a,F as d,t as p,a6 as L,a7 as E,y as N,q as S,a8 as z}from"./index.js";const u=s.forwardRef(({label:h,addButtonLabel:x="Add image",deleteButtonLabel:v="Delete image",src:j,className:f,app:D,onUploadImage:C,onDeleteImage:I},P)=>{const r=s.useRef(null),[n,o]=s.useState({name:"",image:j||""}),[,l]=s.useState(!1),c=e=>{o({...n,name:"",image:""});const t=e==null?void 0:e[0];if(!t)return;const i={...n,name:t.name,image:URL.createObjectURL(t)};o(i),C(i)},$=()=>{var e;(e=r.current)==null||e.click()},b=()=>{r.current&&(r.current.value="");const e={...n,name:"",image:""};o(e),I()},k=e=>{c(e.target.files)},g=e=>{e.preventDefault(),e.stopPropagation(),l(!0)},m=e=>{e.preventDefault(),e.stopPropagation(),l(!1)},w=e=>{var i;m(e);const t=(i=e.dataTransfer)==null?void 0:i.files;c(t),r.current&&t&&(r.current.files=t)},y=R("image-input",f);return a.jsxs(d,{id:"image-input",className:y,onDragEnter:g,onDragOver:g,onDragLeave:m,onDrop:w,ref:P,children:[a.jsxs("div",{className:"image-input-actions gap-8",children:[a.jsx(p,{"aria-label":x,color:"tertiary",icon:a.jsx(L,{}),onClick:$,type:"button",variant:"ghost"}),a.jsx(p,{"aria-label":v,color:"danger",disabled:!n.image,icon:a.jsx(E,{width:"20",height:"20"}),onClick:b,type:"button",variant:"ghost"})]}),a.jsxs(d.Label,{children:[a.jsx("span",{className:"visually-hidden",children:h}),a.jsx(N,{accept:"image/*",hidden:!0,onChange:k,ref:r,size:"sm",type:"file"}),n.image?a.jsx(S,{alt:n.name,src:n.image,size:"xl"}):a.jsx(z,{app:D,iconFit:"ratio",size:"160",variant:"rounded"})]})]})});u.displayName="ImagePicker";const F=u;export{F as I};
|
package/dist/Library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as r,I as c,B as x,
|
|
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};
|
package/dist/MoveModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,
|
|
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};
|