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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,o as F,e as W,c as C,f as fe,j as e,H as se,g as je,A as ye,u as ce,h as ve,i as de,k as Se,l as Ne,m as we,n as ae,p as Ie,a as Be,M as G,V as Z,q as oe,B as z,s as ie,t as Ae,v as Ce,F as ee,w as Me,x as Re,y as Ee,L as $e}from"./index.js";import{S as Te}from"./SelectList.js";import{T as Fe}from"./Tooltip.js";import"./usePopper.js";function Ue(l,d){const[n,u]=r.useState(l);return r.useEffect(()=>{const h=setTimeout(()=>{u(l)},d||500);return()=>{clearTimeout(h)}},[l,d]),n}function De(){const[l,d]=r.useState(!1);r.useEffect(()=>{n()},[]);const n=r.useCallback(async()=>{const u=await F.session().isAdml();d(u)},[]);return{isAdml:l}}const he=r.forwardRef(({label:l,disabled:d=!1,checked:n=!1,indeterminate:u=!1,...h},S)=>{const b=r.useRef(null);r.useImperativeHandle(S,()=>({...b.current})),r.useEffect(()=>{b.current.indeterminate=u},[b,u]);const j=r.useMemo(()=>h.id?h.id:(Math.floor(Math.random()*999999999999)+1e12).toString(),[h.id]),m={...h,type:"checkbox",checked:n,disabled:d,ref:b,className:W(h.className,"form-check-input c-pointer"),id:j};return C.jsxs("div",{className:"position-relative d-inline-block",children:[C.jsx("input",{...m}),l&&C.jsx("label",{className:"ms-8 form-check-label",htmlFor:m.id,children:l})]})});he.displayName="Checkbox";const ne=he,ue=r.forwardRef(({model:l,icon:d,label:n=!1,disabled:u=!1,...h},S)=>{const b=r.useMemo(()=>h.id?h.id:(Math.floor(Math.random()*999999999999)+1e12).toString(),[h.id]),j={...h,type:"radio",checked:l===h.value,disabled:u,ref:S,className:W(h.className,"form-check-input c-pointer",d&&"d-none"),id:b};return C.jsxs("div",{className:W("position-relative form-check",d&&"ps-0"),children:[C.jsx("input",{...j}),d&&C.jsx("label",{htmlFor:j.id,className:W("c-pointer",l!==h.value&&"text-muted"),children:d}),!d&&n&&C.jsx("label",{className:"form-check-label",htmlFor:j.id,children:n})]})});ue.displayName="Radio";const le=ue;function Pe({radioPublicationValue:l,onRadioPublicationChange:d}){const{i18n:n}=fe();return e.jsxs(e.Fragment,{children:[e.jsx("hr",{}),e.jsx(se,{headingStyle:"h4",level:"h3",className:"mb-16",children:n("explorer.publication.steps")}),e.jsx(le,{label:n("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:l,onChange:u=>d(u.target.value)}),e.jsx(le,{label:n("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",model:l,onChange:u=>d(u.target.value)})]})}function Le({radioPublicationValue:l,onRadioPublicationChange:d}){const{app:n}=je();return n===ye.BLOG?e.jsx(Pe,{radioPublicationValue:l,onRadioPublicationChange:d}):e.jsx(e.Fragment,{})}function Ve({onSuccess:l,payloadUpdatePublishType:d}){const{appCode:n,i18n:u}=ce(),{user:h,avatar:S}=ve(),[b,j]=r.useState(r.useId()),[m,k]=r.useState({rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]}),[y,N]=r.useState([]),[U,H]=r.useState(""),[w,q]=r.useState(!1),[M,_]=r.useState(""),I=Ue(M,500),[J,K]=r.useState([]),[R,D]=r.useState([]),[P,Q]=r.useState(!1),[E,O]=r.useState(!1),{isAdml:B}=De(),A=de(),X=Se();r.useEffect(()=>{Y()},[]),r.useEffect(()=>{be(I)},[I]);const Y=r.useCallback(async()=>{var a;const t=await F.share().getActionsForApp(n);N(t);const c=await F.share().getRightsForResource(n,(a=A[0])==null?void 0:a.assetId);k(c)},[]),p=(t,c)=>{k(({rights:a,...g})=>{var te,re;const s=[...a],i=s.findIndex(x=>x.id===t.id),$=y.filter(x=>x.id===c)[0];if(s[i].actions.findIndex(x=>x.id===c)>-1){let x=s[i].actions.filter(f=>f.id!==c);const v=y.filter(f=>{var T;return(T=f.requires)==null?void 0:T.includes(c)});x=x.filter(f=>!v.find(T=>T.id===f.id)),s[i]={...s[i],actions:x}}else{const x=y.filter(v=>{var f;return((f=$.requires)==null?void 0:f.includes(v.id))&&!s[i].actions.find(T=>T.id===v.id)});s[i]={...s[i],actions:[...s[i].actions,$,...x]}}return t.type==="sharebookmark"&&((te=s[i].users)==null||te.forEach(x=>{const v=s.findIndex(f=>f.id===x.id);s[v]={...s[v],actions:s[i].actions}}),(re=s[i].groups)==null||re.forEach(x=>{const v=s.findIndex(f=>f.id===x.id);s[v]={...s[v],actions:s[i].actions}})),{rights:s,...g}})},L=Ne(),{hotToast:o}=we(Ie),V=async()=>{var t;try{await L.mutate({entId:(t=A[0])==null?void 0:t.assetId,shares:m.rights}),await X.mutate(d),o.success(u("explorer.shared.status.saved")),l==null||l()}catch(c){console.error("Failed to save share",c),o.error(u("explorer.shared.status.error"))}},me=t=>{k(c=>({...c,rights:m.rights.filter(a=>{var g,s;return a.id!==t.id&&!((g=t.users)!=null&&g.find(i=>i.id===a.id))&&!((s=t.groups)!=null&&s.find(i=>i.id===a.id))})}))},pe=t=>{_(t.target.value)},xe=()=>!E&&!B&&I.length>0&&R.length===0||!E&&B&&I.length>3&&R.length===0,ke=()=>B&&M.length<3,ge=()=>E&&M.length>0,be=async t=>{var c;if(O(!0),!B&&t.length>=1||B&&t.length>=3){const a=await F.share().searchShareSubjects(n,(c=A[0])==null?void 0:c.assetId,t);K(a);const g=a.filter(s=>!m.rights.find(i=>i.id===s.id)).filter(s=>!(s.type==="user"&&s.id===A[0].creatorId)).map(s=>({value:s.id,label:s.displayName,icon:s.type==="sharebookmark"?ae:null}));D(g)}else D([]),Promise.resolve();O(!1)};return{currentIsAuthor:()=>{for(const t of A)if(t.creatorId!==(h==null?void 0:h.userId))return!1;return!0},idBookmark:b,myAvatar:S,shareRights:m,shareRightActions:y,showBookmarkInput:w,searchInputValue:M,searchResults:R,bookmarkName:U,showBookmarkMembers:P,debouncedSearchInputValue:I,searchPending:E,setBookmarkName:H,saveBookmark:async t=>{try{const c=await F.directory().saveBookmarks(t,{users:m.rights.filter(a=>a.type==="user").map(a=>a.id),groups:m.rights.filter(a=>a.type==="group").map(a=>a.id),bookmarks:m.rights.filter(a=>a.type==="sharebookmark").map(a=>a.id)});o.success(u("explorer.bookmarked.status.saved")),k(a=>({...a,visibleBookmarks:[...a.visibleBookmarks,{displayName:t,id:c.id}]})),j(b+new Date().getTime().toString()),q(!1)}catch(c){console.error("Failed to save bookmark",c),o.error(u("explorer.bookmarked.status.error"))}},canSave:()=>!0,toggleBookmarkInput:q,handleActionCheckbox:p,handleShare:V,handleDeleteRow:me,handleSearchInputChange:pe,handleSearchResultsChange:async t=>{const c=J.find(g=>g.id===t[0]),a=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}];if(c){let g=[];if(c.type==="sharebookmark"){const s=await F.directory().getBookMarkById(c.id);g.push({...s,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:a}),s==null||s.users.filter(i=>!m.rights.find($=>$.id===i.id)).forEach(i=>{g.push({...i,type:"user",avatarUrl:"",directoryUrl:"",actions:a,isBookmarkMember:!0})}),s.groups.filter(i=>!m.rights.find($=>$.id===i.id)).forEach(i=>{g.push({...i,type:"group",avatarUrl:"",directoryUrl:"",actions:a,isBookmarkMember:!0})})}else g=[{...c,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];k({...m,rights:[...m.rights,...g]}),D(R.filter(s=>s.value!==t[0]))}},showSearchNoResults:xe,showSearchAdmlHint:ke,showSearchLoading:ge,handleBookmarkMembersToggle:()=>{Q(!P)},hasRight:(t,c)=>t.actions.filter(a=>c.id===a.id).length>0,showShareRightLine:t=>t.isBookmarkMember&&P||!t.isBookmarkMember}}function ze(){const l=de(),{assetId:d,description:n,thumbnail:u,name:h,public:S,trashed:b,slug:j,"publish-type":m}=l[0],[k,y]=r.useState(m||"IMMEDIATE"),[N,U]=r.useState({description:n,entId:d,name:h,public:!!S,slug:j||"",thumbnail:u,trashed:b,"publish-type":m});return r.useEffect(()=>{k&&U(w=>({...w,"publish-type":k}))},[k]),{radioPublicationValue:k,payloadUpdatePublishType:N,handleRadioPublicationChange:async w=>{y(w)}}}function es({isOpen:l,onSuccess:d,onCancel:n}){const{payloadUpdatePublishType:u,radioPublicationValue:h,handleRadioPublicationChange:S}=ze(),{myAvatar:b,idBookmark:j,shareRights:m,shareRightActions:k,showBookmarkInput:y,searchResults:N,bookmarkName:U,showBookmarkMembers:H,searchPending:w,currentIsAuthor:q,setBookmarkName:M,saveBookmark:_,canSave:I,toggleBookmarkInput:J,handleActionCheckbox:K,handleShare:R,handleDeleteRow:D,handleSearchInputChange:P,handleSearchResultsChange:Q,showSearchNoResults:E,showSearchAdmlHint:O,showSearchLoading:B,handleBookmarkMembersToggle:A,hasRight:X,showShareRightLine:Y}=Ve({payloadUpdatePublishType:u,onSuccess:d,onCancel:n}),{i18n:p}=ce(),L=r.useRef(null);return Be.createPortal(e.jsxs(G,{id:"share_modal",size:"lg",isOpen:l,onModalClose:n,children:[e.jsx(G.Header,{onModalClose:n,children:p("share.title")}),e.jsxs(G.Body,{children:[e.jsx(se,{headingStyle:"h4",level:"h3",className:"mb-16",children:p("explorer.modal.share.usersWithAccess")}),e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"table border align-middle mb-0",children:[e.jsx("thead",{className:"bg-secondary text-white",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"w-32",children:e.jsx(Z,{children:p("explorer.modal.share.avatar.shared.alt")})}),e.jsx("th",{scope:"col",children:e.jsx(Z,{children:p("explorer.modal.share.search.placeholder")})}),k.map(o=>e.jsx("th",{scope:"col",className:"text-center",children:p(o.displayName)},o.displayName)),e.jsx("th",{scope:"col",children:e.jsx(Z,{children:p("close")})})]})}),e.jsxs("tbody",{children:[q()&&e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:e.jsx(oe,{alt:p("explorer.modal.share.avatar.me.alt"),size:"xs",src:b,variant:"circle"})}),e.jsx("td",{children:p("share.me")}),k.map(o=>e.jsx("td",{style:{width:"80px"},className:"text-center",children:e.jsx(ne,{checked:!0,disabled:!0})},o.displayName)),e.jsx("td",{})]}),m==null?void 0:m.rights.map(o=>Y(o)&&e.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[e.jsxs("td",{children:[o.type!=="sharebookmark"&&e.jsx(oe,{alt:p("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&e.jsx(ae,{})]}),e.jsx("td",{children:e.jsxs("div",{className:"d-flex",children:[o.type==="sharebookmark"&&e.jsx(z,{color:"tertiary",rightIcon:e.jsx(ie,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:H?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:A,children:o.displayName}),o.type!=="sharebookmark"&&o.displayName]})}),k.map(V=>e.jsx("td",{style:{width:"80px"},className:"text-center",children:e.jsx(ne,{checked:X(o,V),onChange:()=>K(o,V.id)})},V.displayName)),e.jsx("td",{children:!o.isBookmarkMember&&e.jsx(Ae,{"aria-label":"Delete",color:"tertiary",icon:e.jsx(Ce,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>D(o)})})]},o.id))]})]})}),e.jsxs("div",{className:"mt-16",children:[e.jsx(z,{color:"tertiary",leftIcon:e.jsx(ae,{}),rightIcon:e.jsx(ie,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:y?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>J(!y),children:p("share.save.sharebookmark")}),y&&e.jsx("div",{className:"mt-16",children:e.jsxs(ee,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[e.jsx("div",{className:"flex-fill",children:e.jsx(ee.Input,{ref:L,onChange:()=>{M(()=>{var o;return((o=L.current)==null?void 0:o.value)||""})},placeholder:p("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},j)}),e.jsx(z,{type:"button",color:"primary",variant:"ghost",disabled:U.length===0,leftIcon:e.jsx(Me,{}),onClick:()=>{_(L.current.value)},className:"text-nowrap",children:p("explorer.modal.share.sharebookmark.save")})]})})]}),e.jsx("hr",{}),e.jsxs(se,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[e.jsx("div",{className:"me-8",children:p("explorer.modal.share.search")}),e.jsx(Fe,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:e.jsx(Re,{className:"c-pointer",height:"18"})})]}),e.jsxs(ee,{className:"d-flex align-items-center",id:"search",children:[e.jsx(Ee,{className:"max-w-512",noValidationIcon:!0,placeholder:O()?p("explorer.search.adml.hint"):p("explorer.modal.share.search.placeholder"),size:"md",type:"search",onChange:P}),B()&&e.jsxs("div",{className:"d-flex align-items-center p-4",children:[e.jsx($e,{isLoading:w}),e.jsx("span",{className:"ps-4",children:p("explorer.search.pending")})]}),E()&&e.jsx("div",{className:"p-4",children:p("portal.no.result")})]}),(N==null?void 0:N.length)>0&&e.jsx("div",{className:"position-absolute w-100 max-w-512 z-1 bg-white shadow rounded-4 d-block show py-12 px-8",children:e.jsx(Te,{options:N,hideCheckbox:!0,isMonoSelection:!0,onChange:Q})}),e.jsx(Le,{radioPublicationValue:h,onRadioPublicationChange:S})]}),e.jsxs(G.Footer,{children:[e.jsx(z,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:p("explorer.cancel")}),e.jsx(z,{type:"button",color:"primary",variant:"filled",onClick:R,disabled:!I(),children:p("share")})]})]}),document.getElementById("portal"))}export{es as default};
|
|
1
|
+
import{r,o as E,d as G,j as e,u as ce,a as ae,e as fe,A as ye,f as je,g as de,h as ve,i as Se,k as Ne,l as ee,m as we,b as Ie,M as O,V as Y,n as oe,B as V,p as ie,q as Be,s as Ae,F as Z,t as Ce,v as Re,w as Me,L as Te}from"./index.js";import{S as $e}from"./SelectList.js";import{H as se}from"./Heading.js";import{T as Ee}from"./Tooltip.js";import"./usePopper.js";function Fe(n,h){const[u,m]=r.useState(n);return r.useEffect(()=>{const o=setTimeout(()=>{m(n)},h||500);return()=>{clearTimeout(o)}},[n,h]),u}function Ue(){const[n,h]=r.useState(!1);r.useEffect(()=>{u()},[]);const u=r.useCallback(async()=>{const m=await E.session().isAdml();h(m)},[]);return{isAdml:n}}const he=r.forwardRef(({label:n,disabled:h=!1,checked:u=!1,indeterminate:m=!1,...o},S)=>{const b=r.useRef(null);r.useImperativeHandle(S,()=>({...b.current})),r.useEffect(()=>{b.current.indeterminate=m},[b,m]);const y=r.useMemo(()=>o.id?o.id:(Math.floor(Math.random()*999999999999)+1e12).toString(),[o.id]),p={...o,type:"checkbox",checked:u,disabled:h,ref:b,className:G(o.className,"form-check-input c-pointer"),id:y};return e.jsxs("div",{className:"position-relative d-inline-block",children:[e.jsx("input",{...p}),n&&e.jsx("label",{className:"ms-8 form-check-label",htmlFor:p.id,children:n})]})});he.displayName="Checkbox";const ne=he,ue=r.forwardRef(({model:n,icon:h,label:u=!1,disabled:m=!1,...o},S)=>{const b=r.useMemo(()=>o.id?o.id:(Math.floor(Math.random()*999999999999)+1e12).toString(),[o.id]),y={...o,type:"radio",checked:n===o.value,disabled:m,ref:S,className:G(o.className,"form-check-input c-pointer",h&&"d-none"),id:b};return e.jsxs("div",{className:G("position-relative form-check",h&&"ps-0"),children:[e.jsx("input",{...y}),h&&e.jsx("label",{htmlFor:y.id,className:G("c-pointer",n!==o.value&&"text-muted"),children:h}),!h&&u&&e.jsx("label",{className:"form-check-label",htmlFor:y.id,children:u})]})});ue.displayName="Radio";const le=ue;function Pe({radioPublicationValue:n,onRadioPublicationChange:h}){const{appCode:u}=ce(),{t:m}=ae(u);return e.jsxs(e.Fragment,{children:[e.jsx("hr",{}),e.jsx(se,{headingStyle:"h4",level:"h3",className:"mb-16",children:m("explorer.publication.steps")}),e.jsx(le,{label:m("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:n,onChange:o=>h(o.target.value)}),e.jsx(le,{label:m("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",model:n,onChange:o=>h(o.target.value)})]})}function De({radioPublicationValue:n,onRadioPublicationChange:h}){const{app:u}=fe();return u===ye.BLOG?e.jsx(Pe,{radioPublicationValue:n,onRadioPublicationChange:h}):e.jsx(e.Fragment,{})}function Le({onSuccess:n,payloadUpdatePublishType:h}){const{appCode:u}=ce(),{t:m}=ae(),{user:o,avatar:S}=je(),[b,y]=r.useState(r.useId()),[p,k]=r.useState({rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]}),[j,N]=r.useState([]),[F,z]=r.useState(""),[w,H]=r.useState(!1),[C,W]=r.useState(""),I=Fe(C,500),[_,J]=r.useState([]),[R,U]=r.useState([]),[P,K]=r.useState(!1),[M,q]=r.useState(!1),{isAdml:B}=Ue(),A=de(),Q=ve(),X=Se(),{hotToast:l}=Ne(we);r.useEffect(()=>{D()},[]),r.useEffect(()=>{be(I)},[I]);const D=r.useCallback(async()=>{var a;const t=await E.share().getActionsForApp(u);N(t);const d=await E.share().getRightsForResource(u,(a=A[0])==null?void 0:a.assetId);k(d)},[]),c=(t,d)=>{k(({rights:a,...g})=>{var te,re;const s=[...a],i=s.findIndex(x=>x.id===t.id),T=j.filter(x=>x.id===d)[0];if(s[i].actions.findIndex(x=>x.id===d)>-1){let x=s[i].actions.filter(f=>f.id!==d);const v=j.filter(f=>{var $;return($=f.requires)==null?void 0:$.includes(d)});x=x.filter(f=>!v.find($=>$.id===f.id)),s[i]={...s[i],actions:x}}else{const x=j.filter(v=>{var f;return((f=T.requires)==null?void 0:f.includes(v.id))&&!s[i].actions.find($=>$.id===v.id)});s[i]={...s[i],actions:[...s[i].actions,T,...x]}}return t.type==="sharebookmark"&&((te=s[i].users)==null||te.forEach(x=>{const v=s.findIndex(f=>f.id===x.id);s[v]={...s[v],actions:s[i].actions}}),(re=s[i].groups)==null||re.forEach(x=>{const v=s.findIndex(f=>f.id===x.id);s[v]={...s[v],actions:s[i].actions}})),{rights:s,...g}})},L=async()=>{var t;try{await Q.mutateAsync(h),await X.mutateAsync({entId:(t=A[0])==null?void 0:t.assetId,shares:p.rights}),l.success(m("explorer.shared.status.saved")),n==null||n()}catch(d){console.error("Failed to save share",d),l.error(m("explorer.shared.status.error"))}},me=t=>{k(d=>({...d,rights:p.rights.filter(a=>{var g,s;return a.id!==t.id&&!((g=t.users)!=null&&g.find(i=>i.id===a.id))&&!((s=t.groups)!=null&&s.find(i=>i.id===a.id))})}))},pe=t=>{W(t.target.value)},xe=()=>!M&&!B&&I.length>0&&R.length===0||!M&&B&&I.length>3&&R.length===0,ke=()=>B&&C.length<3,ge=()=>M&&C.length>0,be=async t=>{var d;if(q(!0),!B&&t.length>=1||B&&t.length>=3){const a=await E.share().searchShareSubjects(u,(d=A[0])==null?void 0:d.assetId,t);J(a);const g=a.filter(s=>!p.rights.find(i=>i.id===s.id)).filter(s=>!(s.type==="user"&&s.id===A[0].creatorId)).map(s=>({value:s.id,label:s.displayName,icon:s.type==="sharebookmark"?ee:null}));U(g)}else U([]),Promise.resolve();q(!1)};return{currentIsAuthor:()=>{for(const t of A)if(t.creatorId!==(o==null?void 0:o.userId))return!1;return!0},idBookmark:b,myAvatar:S,shareRights:p,shareRightActions:j,showBookmarkInput:w,searchInputValue:C,searchResults:R,bookmarkName:F,showBookmarkMembers:P,debouncedSearchInputValue:I,searchPending:M,setBookmarkName:z,saveBookmark:async t=>{try{const d=await E.directory().saveBookmarks(t,{users:p.rights.filter(a=>a.type==="user").map(a=>a.id),groups:p.rights.filter(a=>a.type==="group").map(a=>a.id),bookmarks:p.rights.filter(a=>a.type==="sharebookmark").map(a=>a.id)});l.success(m("explorer.bookmarked.status.saved")),k(a=>({...a,visibleBookmarks:[...a.visibleBookmarks,{displayName:t,id:d.id}]})),y(b+new Date().getTime().toString()),H(!1)}catch(d){console.error("Failed to save bookmark",d),l.error(m("explorer.bookmarked.status.error"))}},canSave:()=>!0,toggleBookmarkInput:H,handleActionCheckbox:c,handleShare:L,handleDeleteRow:me,handleSearchInputChange:pe,handleSearchResultsChange:async t=>{const d=_.find(g=>g.id===t[0]),a=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}];if(d){let g=[];if(d.type==="sharebookmark"){const s=await E.directory().getBookMarkById(d.id);g.push({...s,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:a}),s==null||s.users.filter(i=>!p.rights.find(T=>T.id===i.id)).forEach(i=>{g.push({...i,type:"user",avatarUrl:"",directoryUrl:"",actions:a,isBookmarkMember:!0})}),s.groups.filter(i=>!p.rights.find(T=>T.id===i.id)).forEach(i=>{g.push({...i,type:"group",avatarUrl:"",directoryUrl:"",actions:a,isBookmarkMember:!0})})}else g=[{...d,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];k({...p,rights:[...p.rights,...g]}),U(R.filter(s=>s.value!==t[0]))}},showSearchNoResults:xe,showSearchAdmlHint:ke,showSearchLoading:ge,handleBookmarkMembersToggle:()=>{K(!P)},hasRight:(t,d)=>t.actions.filter(a=>d.id===a.id).length>0,showShareRightLine:t=>t.isBookmarkMember&&P||!t.isBookmarkMember}}function Ve(){const n=de(),{assetId:h,description:u,thumbnail:m,name:o,public:S,trashed:b,slug:y,"publish-type":p}=n.length>0?n[0]:{"publish-type":"",assetId:"",description:"",name:"",public:!1,slug:"",thumbnail:"",trashed:!1},[k,j]=r.useState(p||"RESTRAINT"),[N,F]=r.useState({description:u,entId:h,name:o,public:!!S,slug:y||"",thumbnail:m,trashed:b,"publish-type":p});return r.useEffect(()=>{k&&F(w=>({...w,"publish-type":k}))},[k]),{radioPublicationValue:k,payloadUpdatePublishType:N,handleRadioPublicationChange:async w=>{j(w)}}}function es({isOpen:n,onSuccess:h,onCancel:u}){const{payloadUpdatePublishType:m,radioPublicationValue:o,handleRadioPublicationChange:S}=Ve(),{myAvatar:b,idBookmark:y,shareRights:p,shareRightActions:k,showBookmarkInput:j,searchResults:N,bookmarkName:F,showBookmarkMembers:z,searchPending:w,currentIsAuthor:H,setBookmarkName:C,saveBookmark:W,canSave:I,toggleBookmarkInput:_,handleActionCheckbox:J,handleShare:R,handleDeleteRow:U,handleSearchInputChange:P,handleSearchResultsChange:K,showSearchNoResults:M,showSearchAdmlHint:q,showSearchLoading:B,handleBookmarkMembersToggle:A,hasRight:Q,showShareRightLine:X}=Le({payloadUpdatePublishType:m,onSuccess:h,onCancel:u}),{t:l}=ae(),D=r.useRef(null);return Ie.createPortal(e.jsxs(O,{id:"share_modal",size:"lg",isOpen:n,onModalClose:u,children:[e.jsx(O.Header,{onModalClose:u,children:l("share.title")}),e.jsxs(O.Body,{children:[e.jsx(se,{headingStyle:"h4",level:"h3",className:"mb-16",children:l("explorer.modal.share.usersWithAccess")}),e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"table border align-middle mb-0",children:[e.jsx("thead",{className:"bg-secondary text-white",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"w-32",children:e.jsx(Y,{children:l("explorer.modal.share.avatar.shared.alt")})}),e.jsx("th",{scope:"col",children:e.jsx(Y,{children:l("explorer.modal.share.search.placeholder")})}),k.map(c=>e.jsx("th",{scope:"col",className:"text-center",children:l(c.displayName)},c.displayName)),e.jsx("th",{scope:"col",children:e.jsx(Y,{children:l("close")})})]})}),e.jsxs("tbody",{children:[H()&&e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:e.jsx(oe,{alt:l("explorer.modal.share.avatar.me.alt"),size:"xs",src:b,variant:"circle"})}),e.jsx("td",{children:l("share.me")}),k.map(c=>e.jsx("td",{style:{width:"80px"},className:"text-center",children:e.jsx(ne,{checked:!0,disabled:!0})},c.displayName)),e.jsx("td",{})]}),p==null?void 0:p.rights.map(c=>X(c)&&e.jsxs("tr",{className:c.isBookmarkMember?"bg-light":"",children:[e.jsxs("td",{children:[c.type!=="sharebookmark"&&e.jsx(oe,{alt:l("explorer.modal.share.avatar.shared.alt"),size:"xs",src:c.avatarUrl,variant:"circle"}),c.type==="sharebookmark"&&e.jsx(ee,{})]}),e.jsx("td",{children:e.jsxs("div",{className:"d-flex",children:[c.type==="sharebookmark"&&e.jsx(V,{color:"tertiary",rightIcon:e.jsx(ie,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:z?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:A,children:c.displayName}),c.type!=="sharebookmark"&&c.displayName]})}),k.map(L=>e.jsx("td",{style:{width:"80px"},className:"text-center",children:e.jsx(ne,{checked:Q(c,L),onChange:()=>J(c,L.id)})},L.displayName)),e.jsx("td",{children:!c.isBookmarkMember&&e.jsx(Be,{"aria-label":"Delete",color:"tertiary",icon:e.jsx(Ae,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>U(c)})})]},c.id))]})]})}),e.jsxs("div",{className:"mt-16",children:[e.jsx(V,{color:"tertiary",leftIcon:e.jsx(ee,{}),rightIcon:e.jsx(ie,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:j?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>_(!j),children:l("share.save.sharebookmark")}),j&&e.jsx("div",{className:"mt-16",children:e.jsxs(Z,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[e.jsx("div",{className:"flex-fill",children:e.jsx(Z.Input,{ref:D,onChange:()=>{C(()=>{var c;return((c=D.current)==null?void 0:c.value)||""})},placeholder:l("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},y)}),e.jsx(V,{type:"button",color:"primary",variant:"ghost",disabled:F.length===0,leftIcon:e.jsx(Ce,{}),onClick:()=>{W(D.current.value)},className:"text-nowrap",children:l("explorer.modal.share.sharebookmark.save")})]})})]}),e.jsx("hr",{}),e.jsxs(se,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[e.jsx("div",{className:"me-8",children:l("explorer.modal.share.search")}),e.jsx(Ee,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:e.jsx(Re,{className:"c-pointer",height:"18"})})]}),e.jsxs(Z,{className:"d-flex align-items-center",id:"search",children:[e.jsx(Me,{className:"max-w-512",noValidationIcon:!0,placeholder:q()?l("explorer.search.adml.hint"):l("explorer.modal.share.search.placeholder"),size:"md",type:"search",onChange:P}),B()&&e.jsxs("div",{className:"d-flex align-items-center p-4",children:[e.jsx(Te,{isLoading:w}),e.jsx("span",{className:"ps-4",children:l("explorer.search.pending")})]}),M()&&e.jsx("div",{className:"p-4",children:l("portal.no.result")})]}),(N==null?void 0:N.length)>0&&e.jsx("div",{className:"position-absolute w-100 max-w-512 z-1 bg-white shadow rounded-4 d-block show py-12 px-8",children:e.jsx($e,{options:N,hideCheckbox:!0,isMonoSelection:!0,onChange:K})}),e.jsx(De,{radioPublicationValue:o,onRadioPublicationChange:S})]}),e.jsxs(O.Footer,{children:[e.jsx(V,{type:"button",color:"tertiary",variant:"ghost",onClick:u,children:l("explorer.cancel")}),e.jsx(V,{type:"button",color:"primary",variant:"filled",onClick:R,disabled:!I(),children:l("share")})]})]}),document.getElementById("portal"))}export{es as default};
|
package/dist/Tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,
|
|
1
|
+
import{r as t,j as e,d as v}from"./index.js";import{u as E}from"./usePopper.js";const j=({children:l,message:i,icon:s=null,placement:n="auto"})=>{const[a,p]=t.useState(null),[m,u]=t.useState(null),[c,d]=t.useState(null),{styles:o,attributes:x}=E(a,m,{placement:n,modifiers:[{name:"arrow",options:{element:c}}]}),[f,r]=t.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"d-inline-block position-relative z-2",ref:p,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:l}),f&&e.jsxs("div",{className:v("tooltip d-block show","bs-tooltip-auto"),ref:u,style:o.popper,...x.popper,children:[e.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[s&&s,e.jsx("div",{children:i})]}),e.jsx("div",{className:"tooltip-arrow",ref:d,style:o.arrow})]})]})},b=j;export{b as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b as l,j as e,M as o,B as d}from"./index.js";function i({isOpen:s,onCancel:r=()=>({})}){const{t}=a();return l.createPortal(e.jsxs(o,{isOpen:s,onModalClose:r,id:"trash_resource",children:[e.jsx(o.Header,{onModalClose:()=>r(),children:t("explorer.trash.modal.title")}),e.jsx(o.Body,{children:e.jsx("p",{className:"body",children:t("explorer.trash.modal.text")})}),e.jsx(o.Footer,{children:e.jsx(d,{color:"primary",onClick:r,type:"button",variant:"outline",children:t("close")})})]}),document.getElementById("portal"))}export{i as default};
|
package/dist/index.html
CHANGED
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
|
|
18
18
|
<!-- SET INITIALISATION CONFIG -->
|
|
19
19
|
<script>
|
|
20
|
-
var WORFLOW_ACCESS =
|
|
20
|
+
var WORFLOW_ACCESS =
|
|
21
|
+
"net.atos.entng.mindmap.controllers.MindmapController|view";
|
|
21
22
|
var WORKFLOW_CREATE =
|
|
22
|
-
"
|
|
23
|
-
var
|
|
24
|
-
"
|
|
25
|
-
var
|
|
26
|
-
"
|
|
27
|
-
var
|
|
23
|
+
"net.atos.entng.mindmap.controllers.FolderController|createFolder";
|
|
24
|
+
var WORKFLOW_PRINT =
|
|
25
|
+
"net.atos.entng.mindmap.controllers.MindmapController|printView";
|
|
26
|
+
var WORKFLOW_EXPORT_PNG =
|
|
27
|
+
"net.atos.entng.mindmap.controllers.MindmapController|exportPngMindmap";
|
|
28
|
+
var WORKFLOW_EXPORT_SVG =
|
|
29
|
+
"net.atos.entng.mindmap.controllers.MindmapController|exportSvgMindmap";
|
|
28
30
|
var odeConfig = {
|
|
29
|
-
app: "
|
|
30
|
-
types: ["
|
|
31
|
+
app: "mindmap",
|
|
32
|
+
types: ["mindmap"],
|
|
31
33
|
filters: [
|
|
32
34
|
{ id: "owner", defaultValue: true },
|
|
33
35
|
{ id: "public", defaultValue: false },
|
|
@@ -61,23 +63,12 @@
|
|
|
61
63
|
workflow: WORKFLOW_CREATE,
|
|
62
64
|
target: "tree",
|
|
63
65
|
},
|
|
64
|
-
{
|
|
65
|
-
id: "createPublic",
|
|
66
|
-
workflow: WORKFLOW_CREATE_PUBLIC,
|
|
67
|
-
target: "tree",
|
|
68
|
-
},
|
|
69
66
|
{
|
|
70
67
|
id: "move",
|
|
71
68
|
workflow: WORFLOW_ACCESS,
|
|
72
69
|
target: "actionbar",
|
|
73
70
|
right: "read",
|
|
74
71
|
},
|
|
75
|
-
{
|
|
76
|
-
id: "publish",
|
|
77
|
-
workflow: WORKFLOW_PUBLISH,
|
|
78
|
-
target: "actionbar",
|
|
79
|
-
right: "creator",
|
|
80
|
-
},
|
|
81
72
|
{
|
|
82
73
|
id: "print",
|
|
83
74
|
workflow: WORKFLOW_PRINT,
|