ode-explorer 1.0.0-develop-b2school.202306201556 → 1.0.0-develop-pedago.202307262104
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 +2 -2
- 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/EmptyScreen.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/Heading.js +1 -0
- 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.html +11 -20
- package/dist/index.js +65 -97
- package/dist/style.css +1 -1
- package/dist/usePopper.js +1 -1
- package/dist/version.txt +1 -1
- package/package.json +33 -31
- package/LICENSE +0 -20
- package/dist/AppAction.js +0 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Explorer App
|
|
|
9
9
|
Without Docker, you need to generate a `package.json`
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
node scripts/package.
|
|
12
|
+
node scripts/package.cjs
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Install all dependencies.
|
|
@@ -79,7 +79,7 @@ pnpm lighthouse
|
|
|
79
79
|
|
|
80
80
|
### Pre-commit
|
|
81
81
|
|
|
82
|
-
When committing your work, `pre-commit` will start `
|
|
82
|
+
When committing your work, `pre-commit` will start `pnpm lint-staged`:
|
|
83
83
|
|
|
84
84
|
> lint-staged starts lint + prettier
|
|
85
85
|
|
package/dist/Card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as R,d as a,j as s,q as B,ac as E,ad as F,I as q,a6 as G,n as U,ae as D,af as H,ag as J,ah 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,x as h,y as u,z as p,k as m,m as y,b as j,j as e,M as n,B as i}from"./index.js";function f({onSuccess:o}){const{t:l}=d(),s=h(),t=u(),r=p(),{hotToast:a}=m(y);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(x){console.error(x)}}return{isTrashFolder:r,onDelete:c}}function T({isOpen:o,onSuccess:l=()=>({}),onCancel:s=()=>({})}){const{t}=d(),{isTrashFolder:r,onDelete:a}=f({onSuccess:l});return j.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{T as default};
|
package/dist/EditFolderModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{D as $,J as B,K as q,N as w,r as C,O as L,a as R,b as P,j as r,M as s,F as T,P as U,w 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=$(),t=B(),m=q(),c=w(),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,D=l[0].id;await c.mutate({folderId:D,parentId:d,name:b}),o(),e==null||e()}else{const d=(t==null?void 0:t.id)||L.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 K({isOpen:a,edit:e,onSuccess:i,onCancel:l}){const{t}=R(),{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]),P.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(T,{id:"nameFolder",isRequired:!0,children:[r.jsx(U,{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{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as B,j as e,m as A,F as m,w as R,Q as J,B as T,U as K,h as Y,g as E,r as p,k as Z,u as ee,W as se,b as te,M as C,P as F,X as le}from"./index.js";import{H as z}from"./Heading.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:f,register:s,resource:h,slug:u,onCopyToClipBoard:g})=>{const{t:o}=B();return e.jsxs(e.Fragment,{children:[e.jsxs(z,{headingStyle:"h4",level:"h3",className:"mb-16",children:[o("explorer.resource.editModal.heading.access"),d]}),e.jsx(A,{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(R,{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")},f),a&&e.jsx("div",{className:"position-absolute",children:e.jsx(J,{children:o("explorer.slug.name.error")})})]}),e.jsx(T,{color:"primary",disabled:n,onClick:()=>{g()},type:"button",leftIcon:e.jsx(K,{}),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=Y(),c=E(),{reset:f,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),[j,v]=p.useState(d.slug||""),[N,S]=p.useState(!1),{hotToast:w}=Z(A),[P,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 y="àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœøṕŕßśșțùúüûǘẃẍÿź·/_,:;",Q="aaaaaaaaceeeeghiiiimnnnooooooprssstuuuuuwxyz------",W=new RegExp(y.split("").join("|"),"g"),X=t.toString().toLowerCase().replace(/\s+/g,"-").replace(W,G=>Q.charAt(y.indexOf(G))).replace(/&/g,"-and-").replace(/[^\w\\-]+/g,"").replace(/\\-\\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"");v(X)}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:P.image}),S(!1),w.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(y){S(!0),console.error(y)}};function D(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${j}`),w.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:s,setFocus:u,handleSubmit:h,onFormCancel:H,onSubmit:q,handleUploadImage:_,handleDeleteImage:L,onCopyToClipBoard:D}}function pe({isOpen:d,edit:a,onSuccess:n,onCancel:r}){const{appCode:x,currentApp:c}=ee(),s=E()[0],{slug:h,formId:u,isValid:g,isSubmitting:o,disableSlug:i,versionSlug:I,correctSlug:M,register:b,handleSubmit:$,onSubmit:k,handleUploadImage:j,handleDeleteImage:v,onCopyToClipBoard:N,onSlugChange:S,onPublicChange:w}=ie({resource:s,onSuccess:n,onCancel:r}),{data:P}=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(z,{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:j,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(R,{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(R,{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:P})&&e.jsx(oe,{appCode:x,correctSlug:M,disableSlug:i,onCopyToClipBoard:N,onPublicChange:w,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{pe as default};
|
package/dist/EmptyScreen.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{j as e}from"./index.js";import{H as r}from"./Heading.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(r,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:a}),m&&e.jsx("div",{className:"text",children:m})]});c.displayName="EmptyScreen";const l=c;export{l as E};
|
package/dist/EmptyScreenApp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as
|
|
1
|
+
import{u as i,a as n,W as a,j as c}from"./index.js";import{E as u}from"./EmptyScreen.js";import"./Heading.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 n}from"./index.js";import{E as
|
|
1
|
+
import{u as r,a as o,j as n}from"./index.js";import{E as s}from"./EmptyScreen.js";import"./Heading.js";function p(){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.label")})}export{p as default};
|
package/dist/EmptyScreenTrash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as r,j as
|
|
1
|
+
import{u as r,a,j as o}from"./index.js";import{E as p}from"./EmptyScreen.js";import"./Heading.js";function l(){const{appCode:s}=r(),{theme:e}=r(),{t}=a();return o.jsx(p,{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{l as default};
|
package/dist/FoldersList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as
|
|
1
|
+
import{u as h,a7 as j,D as f,a8 as y,E as C,a9 as I,aa as T,j as i,Z as a}from"./index.js";import{C as A}from"./Card.js";import"./Tooltip.js";import"./usePopper.js";const b=()=>{var c,d;const{currentApp:p}=h(),{data:e,isFetching:u}=j(),l=f(),o=y(),{setSelectedFolders:n,setFolderIds:r,openFolder:m}=C();function g(s){o.includes(s.id)?(r(o.filter(t=>t!==s.id)),n(l.filter(t=>t.id!==s.id))):(r([...o,s.id]),n([...l,s]))}const F=I({from:{opacity:0},to:{opacity:1}}),S=T();return(c=e==null?void 0:e.pages[0])!=null&&c.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(A,{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{b as default};
|
package/dist/Heading.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,d as i,j as l}from"./index.js";const s=d.forwardRef(({level:a="h1",headingStyle:e="h1",children:r,className:t,...o},n)=>{const c=i(e,t);return l.jsx(a,{ref:n,className:c,...o,children:r})});s.displayName="Heading";const m=s;export{m as H};
|
package/dist/ImagePicker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as o,d as y,j as e,F as v,q as j,a4 as L,a5 as R,w as z,n as E,a6 as N}from"./index.js";const S=(r,d)=>{const[,l]=o.useState(!1),m=o.useCallback(a=>{a.preventDefault(),a.stopPropagation(),l(!0)},[]),c=a=>{a.preventDefault(),a.stopPropagation(),l(!1)};return{handleDragging:m,handleDragLeave:c,handleDrop:a=>{var g;c(a);const s=(g=a.dataTransfer)==null?void 0:g.files;d(s),r!=null&&r.current&&s&&(r.current.files=s)}}},A=S,C=o.forwardRef(({label:r,addButtonLabel:d="Add image",deleteButtonLabel:l="Delete image",src:m,className:c,app:a,onUploadImage:s,onDeleteImage:g},$)=>{const i=o.useRef(null),[t,p]=o.useState({name:"",image:m||""}),h=n=>{p({...t,name:"",image:""});const u=n==null?void 0:n[0];if(!u)return;const D={...t,name:u.name,image:URL.createObjectURL(u)};p(D),s(D)},b=()=>{var n;(n=i.current)==null||n.click()},k=()=>{i.current&&(i.current.value="");const n={...t,name:"",image:""};p(n),g()},w=n=>{h(n.target.files)},I=y("image-input",c),{handleDragging:x,handleDragLeave:P,handleDrop:f}=A(i,h);return e.jsxs(v,{id:"image-input",className:I,onDragEnter:x,onDragOver:x,onDragLeave:P,onDrop:f,ref:$,children:[e.jsxs("div",{className:"image-input-actions gap-8",children:[e.jsx(j,{"aria-label":d,color:"tertiary",icon:e.jsx(L,{}),onClick:b,type:"button",variant:"ghost"}),e.jsx(j,{"aria-label":l,color:"danger",disabled:!t.image,icon:e.jsx(R,{width:"20",height:"20"}),onClick:k,type:"button",variant:"ghost"})]}),e.jsxs(v.Label,{children:[e.jsx("span",{className:"visually-hidden",children:r}),e.jsx(z,{accept:"image/*",hidden:!0,onChange:w,ref:i,size:"sm",type:"file"}),t.image?e.jsx(E,{alt:t.name,src:t.image,size:"xl"}):e.jsx(N,{app:a,iconFit:"ratio",size:"160",variant:"rounded"})]})]})});C.displayName="ImagePicker";const O=C;export{O as I};
|
package/dist/Library.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,
|
|
1
|
+
import{r as n,j as r,I as c,B as x,S as m,a as p,c as d}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}=p(),{theme:s}=d();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,C as v,D as T,g as M,E as y,G as b,a as j,H 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 B({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{B as default};
|