jamespot-react-core 1.2.42 → 1.2.44
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/build/{563.33f503e79a13ce686eb4.chunk.js → 628.73265f7fde405adcd2c9.chunk.js} +128 -93
- package/build/628.73265f7fde405adcd2c9.chunk.js.map +1 -0
- package/build/app.bundle.js +934 -882
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/calendar/CalendarHeader.d.ts +1 -0
- package/build/src/components/calendar/CalendarToolbar.d.ts +23 -0
- package/build/src/components/calendar/CalendarWrapper.d.ts +26 -0
- package/build/src/hooks/index.d.ts +5 -3
- package/build/src/hooks/useActivities.d.ts +5 -0
- package/build/src/hooks/useMessengerUnread.d.ts +1 -0
- package/build/src/redux/store.d.ts +3 -3
- package/build/src/registry/core-component-list.d.ts +2 -1
- package/build/src/registry/coreComponents.d.ts +2 -0
- package/build/src/registry/ext-component-list.d.ts +2 -0
- package/package.json +7 -7
- package/build/563.33f503e79a13ce686eb4.chunk.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[628],{628:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>T,AddReportModal:()=>Z,Audience:()=>L,Avatar:()=>x,CalendarToolbar:()=>ue,CalendarWrapper:()=>Ml,CommentsBloc:()=>yl,DisplayForm:()=>R,Editor:()=>Qe,EditorsPortal:()=>Lt,Empty:()=>Al,FullPageLayout:()=>Il,JRCInputTinyMCEWithExt:()=>Vl,JRCInputTinyMCEWithExtRaw:()=>Fl,MarkdownModal:()=>Oi,ModalAudience:()=>Hl,ModalSchedule:()=>Kl,TwoColLayout:()=>ts,WidgetList:()=>Vt,WidgetWrapperCore:()=>cl});var n=i(211),o=i(594),l=i(196),s=i.n(l),a=i(493),r=i(917),d=i(335),c=i(815),u=i(423);const g=u.j.getLazyComponent("Icon"),m=u.j.getLazyComponent("JRCAvatar"),p=s().span`
|
|
2
2
|
${r.SROnly}
|
|
3
3
|
`,x=e=>{const t=(0,l.useTheme)(),i=(0,a.useIntl)(),o=(0,c.GV)(d.Bx.selectors.selectNetworkPublic);return e.uri===o?.uri?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{name:"icon-fs-wall",size:8*(e.size??3),color:t.color.primary,variant:"circle"}),(0,n.jsx)(p,{children:i.formatMessage({id:"NETWORK_Public"})})]}):(0,n.jsx)(m,{...e})},h=u.j.getLazyComponent("FlexBox"),f=u.j.getLazyComponent("ModalContent"),j=u.j.getLazyComponent("ModalLayout"),y=u.j.getLazyComponent("StyledHref"),b=u.j.getLazyComponent("Tooltip"),C=u.j.getLazyComponent("Typography"),v=s().div`
|
|
4
4
|
display: flex;
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
border: 4px solid ${e=>e.theme.color.white};
|
|
20
20
|
margin-left: ${e=>e.overlap?"-18px":"0"};
|
|
21
21
|
cursor: pointer;
|
|
22
|
-
`,L=({audience:e,limit:t=2})=>{const i=(0,a.useIntl)(),s=(0,l.useTheme)(),[d,c]=(0,o.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(h,{children:[[...e].splice(0,t).map((e,t)=>(0,n.jsx)(w,{overlap:0!==t,href:e._url,target:"_blank",children:(0,n.jsx)(b,{description:void 0===e.title?" ":e.title,position:"left",children:(0,n.jsx)(x,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?r.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0})})},e.id)),e.length>t&&(0,n.jsxs)(w,{onClick:()=>c(!0),overlap:!0,children:["+",e.length-t]})]}),e.length>t&&(0,n.jsx)(j,{closeHandler:()=>c(!1),enableClickAwayCloseModal:!0,open:d,variant:"fixed-height",maxHeight:"800px",children:(0,n.jsx)(f,{title:i.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>c(!1),children:(0,n.jsx)(v,{children:e.map((e,t)=>(0,n.jsxs)(h,{y:"center",gap:s.space.l,children:[(0,n.jsx)(x,{size:5,uri:`${e.type}/${e.id}`}),(0,n.jsx)(y,{href:`${e.type}/${e.id}`,children:(0,n.jsx)(C,{children:e.title})})]},`audience-${t}`))})})})]})};var E=i(833),k=i.n(E);const _=u.j.getLazyComponent("Loader"),W=u.j.getLazyComponent("ModalContent"),
|
|
22
|
+
`,L=({audience:e,limit:t=2})=>{const i=(0,a.useIntl)(),s=(0,l.useTheme)(),[d,c]=(0,o.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(h,{children:[[...e].splice(0,t).map((e,t)=>(0,n.jsx)(w,{overlap:0!==t,href:e._url,target:"_blank",children:(0,n.jsx)(b,{description:void 0===e.title?" ":e.title,position:"left",children:(0,n.jsx)(x,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?r.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0})})},e.id)),e.length>t&&(0,n.jsxs)(w,{onClick:()=>c(!0),overlap:!0,children:["+",e.length-t]})]}),e.length>t&&(0,n.jsx)(j,{closeHandler:()=>c(!1),enableClickAwayCloseModal:!0,open:d,variant:"fixed-height",maxHeight:"800px",children:(0,n.jsx)(f,{title:i.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>c(!1),children:(0,n.jsx)(v,{children:e.map((e,t)=>(0,n.jsxs)(h,{y:"center",gap:s.space.l,children:[(0,n.jsx)(x,{size:5,uri:`${e.type}/${e.id}`}),(0,n.jsx)(y,{href:`${e.type}/${e.id}`,children:(0,n.jsx)(C,{children:e.title})})]},`audience-${t}`))})})})]})};var E=i(833),k=i.n(E);const _=u.j.getLazyComponent("Loader"),W=u.j.getLazyComponent("ModalContent"),S=u.j.getLazyComponent("ModalLayout"),q=u.j.getLazyComponent("Typography"),M=s().div`
|
|
23
23
|
padding: ${e=>e.theme.space.md}px;
|
|
24
|
-
`,
|
|
24
|
+
`,A={response:void 0,loading:!0,error:void 0},T=({query:e})=>{const t=(0,a.useIntl)(),[i,s]=(0,o.useState)(A),r=(0,l.useTheme)(),d=(0,o.useCallback)(e=>{s(A),k().jia.textEnhancement({text:e.text,capacity:e.capability}).then(e=>{if(e.error)return void s({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const i=e.result.text;s({error:void 0,loading:!1,response:i})}).catch(e=>{s({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})})},[t]);return(0,o.useEffect)(()=>{e&&e.text.trim().length>0&&d(e)},[e,d]),(0,n.jsx)(S,{zIndex:r.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{e?.reject()},children:(0,n.jsx)(W,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&d(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&e?.resolve(i.response)},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>e?.reject()}],isFull:!0,children:(0,n.jsxs)(M,{children:[i.loading&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_,{}),(0,n.jsx)(q,{align:"center",children:t.formatMessage({id:"JIA_WAITING_WARNIG"})})]}),!i.loading&&i.error&&(0,n.jsx)("p",{children:i.error}),!i.loading&&i.response&&(0,n.jsx)("p",{children:i.response})]})})})};var I=i(655),z=i(859);const G=l.css`
|
|
25
25
|
height: 100%;
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
`,D=s().div`
|
|
30
30
|
${({stretch:e})=>e&&G}
|
|
31
|
-
|
|
31
|
+
`,V=s().form`
|
|
32
32
|
${({stretch:e})=>e&&G}
|
|
33
|
-
|
|
33
|
+
`,$=(0,o.forwardRef)((e,t)=>e.onSubmit?(0,n.jsx)(V,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t,"data-cy":e.dataCy,children:e.children}):(0,n.jsx)(D,{stretch:e.stretch,ref:t,"data-cy":e.dataCy,children:e.children})),F=s().div`
|
|
34
34
|
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
35
|
-
`,R=(0,o.forwardRef)(({onInit:e,...t},i)=>{const l=(0,o.useRef)(null),[s,a]=(0,z.SC)(t.fields,t.type,t.forceMandatory),[r,d]=(0,o.useState)(!1),{handleSubmit:c,control:u,reset:g,...m}=(0,I.useForm)({defaultValues:{...a,...t.defaultValues},criteriaMode:"all"});(0,o.useEffect)(()=>{e&&!r&&(e(m),d(!0))},[e,m,r]);const p=(0,o.useCallback)(e=>{const t={};return Object.keys(e).forEach(i=>{const n=s.find(e=>e.name===i)?.widget;switch(n?.type){case"audience":t[i]=e[i].map(e=>e.uri).join(",");break;case"taxonomy":t[i]=e[i].map(e=>e.title).join(",");break;case"toggle":t[i]=e[i]?"1":"0";break;default:t[i]=e[i]}}),t},[s]);return(0,o.useImperativeHandle)(i,()=>({...m,handleSubmit:c,control:u,reset:()=>{l?.current?.scrollTo(0,0),g()},getFormattedValues:()=>p(m.getValues())}),[]),(0,n.jsxs)(
|
|
35
|
+
`,R=(0,o.forwardRef)(({onInit:e,...t},i)=>{const l=(0,o.useRef)(null),[s,a]=(0,z.SC)(t.fields,t.type,t.forceMandatory),[r,d]=(0,o.useState)(!1),{handleSubmit:c,control:u,reset:g,...m}=(0,I.useForm)({defaultValues:{...a,...t.defaultValues},criteriaMode:"all"});(0,o.useEffect)(()=>{e&&!r&&(e(m),d(!0))},[e,m,r]);const p=(0,o.useCallback)(e=>{const t={};return Object.keys(e).forEach(i=>{const n=s.find(e=>e.name===i)?.widget;switch(n?.type){case"audience":t[i]=e[i].map(e=>e.uri).join(",");break;case"taxonomy":t[i]=e[i].map(e=>e.title).join(",");break;case"toggle":t[i]=e[i]?"1":"0";break;default:t[i]=e[i]}}),t},[s]);return(0,o.useImperativeHandle)(i,()=>({...m,handleSubmit:c,control:u,reset:()=>{l?.current?.scrollTo(0,0),g()},getFormattedValues:()=>p(m.getValues())}),[]),(0,n.jsxs)($,{dataCy:t.dataCy,stretch:t.stretch,onSubmit:t.onSubmit?c(t.onSubmit):void 0,ref:l,children:[(0,n.jsxs)(F,{stretch:t.stretch,children:[s.map(({Input:e,...i})=>(0,n.jsx)(e,{control:u,...i,dataCy:`${t.dataCy}-${i.name}`,readOnly:t.readOnly},i.name)),t.extraInputs&&t.extraInputs(u)]}),t.buttons]})});var O=i(42);const B=u.j.getLazyComponent("ModalForm"),H=u.j.getLazyComponent("Loader"),U=u.j.getLazyComponent("Icon"),P=u.j.getLazyComponent("Typography"),N=u.j.getLazyComponent("Deprecated_Ellipsis"),Y=u.j.getLazyComponent("StyledHref"),Q=s().div`
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: ${({theme:e})=>e.space.md}px;
|
|
@@ -48,7 +48,16 @@
|
|
|
48
48
|
display: flex;
|
|
49
49
|
flex-direction: column;
|
|
50
50
|
gap: ${({theme:e})=>e.space.sm}px;
|
|
51
|
-
`,Z=({onClose:e,articleId:t,articleUri:i,commentUri:l})=>{const s=(0,a.useIntl)(),r=(0,o.useRef)(null),u=(0,c.jL)(),[g,m]=(0,o.useState)(!0),[p,x]=(0,o.useState)(),[h,f]=(0,o.useState)(),[j,y]=(0,o.useState)(!0),[b,C]=(0,o.useState)(!1),v=(0,O.Ie)();(0,o.useEffect)(()=>{Promise.all([(async()=>{const e=await k().article.get({idArticle:t,format:"raw-list"},{signal:v.signal});x(e.result)})(),(async()=>{if(l){const e=await k().article.getComments({idArticle:t},{format:"raw-list",signal:v.signal});f(e.result.find(e=>e.uri===l))}})()]).then(()=>{y(!1)})},[v,t,l]);const w=(0,o.useCallback)(()=>{m(!1),e()},[e]),L=(0,o.useCallback)(e=>{e?.trim()?(C(!0),k().contentReport.createReport({uri:l||i,description:e}).then(()=>{u(d.y8.actions.success({label:s.formatMessage({id:"CRPT_Report_Sent"})})),w()}).catch(e=>{d.y8.actions.error({label:e.errorMsg??"GLOBAL_Error"}),C(!1)})):u(d.y8.actions.error({label:s.formatMessage({id:"CRPT_Report_Description_Required"})}))},[i,w,l,u,s]),E=(0,o.useCallback)(({description:e})=>{L(e)},[L]);return(0,n.jsx)(B,{title:s.formatMessage({id:"CRPT_Add_Report"}),open:g,closeHandler:w,onSubmit:async()=>L(r.current?.getValues().description),enableClickAwayCloseModal:!0,maxHeight:"520px",buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:w},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Send"}),clickHandler:()=>L(r.current?.getValues().description),color:"valid",loading:b}],children:j?(0,n.jsx)(H,{size:"l"}):(0,n.jsxs)(Q,{children:[(0,n.jsxs)(K,{children:[(0,n.jsx)(U,{name:l?"icon-comment":"icon-file",size:50,variant:"square"}),(0,n.jsxs)(X,{children:[(0,n.jsx)(P,{variant:l?"h3":"h2",children:(0,n.jsx)(N,{label:p?.title,length:40})}),h&&(0,n.jsxs)(P,{children:[s.formatMessage({id:"CRPT_Comment_Of"})," ",(0,n.jsx)(Y,{href:h?._user._url,children:h?._user.title})]})]})]}),(0,n.jsx)(R,{ref:r,fields:["description"],type:"contentReport",onSubmit:E})]})})}
|
|
51
|
+
`,Z=({onClose:e,articleId:t,articleUri:i,commentUri:l})=>{const s=(0,a.useIntl)(),r=(0,o.useRef)(null),u=(0,c.jL)(),[g,m]=(0,o.useState)(!0),[p,x]=(0,o.useState)(),[h,f]=(0,o.useState)(),[j,y]=(0,o.useState)(!0),[b,C]=(0,o.useState)(!1),v=(0,O.Ie)();(0,o.useEffect)(()=>{Promise.all([(async()=>{const e=await k().article.get({idArticle:t,format:"raw-list"},{signal:v.signal});x(e.result)})(),(async()=>{if(l){const e=await k().article.getComments({idArticle:t},{format:"raw-list",signal:v.signal});f(e.result.find(e=>e.uri===l))}})()]).then(()=>{y(!1)})},[v,t,l]);const w=(0,o.useCallback)(()=>{m(!1),e()},[e]),L=(0,o.useCallback)(e=>{e?.trim()?(C(!0),k().contentReport.createReport({uri:l||i,description:e}).then(()=>{u(d.y8.actions.success({label:s.formatMessage({id:"CRPT_Report_Sent"})})),w()}).catch(e=>{d.y8.actions.error({label:e.errorMsg??"GLOBAL_Error"}),C(!1)})):u(d.y8.actions.error({label:s.formatMessage({id:"CRPT_Report_Description_Required"})}))},[i,w,l,u,s]),E=(0,o.useCallback)(({description:e})=>{L(e)},[L]);return(0,n.jsx)(B,{title:s.formatMessage({id:"CRPT_Add_Report"}),open:g,closeHandler:w,onSubmit:async()=>L(r.current?.getValues().description),enableClickAwayCloseModal:!0,maxHeight:"520px",buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:w},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Send"}),clickHandler:()=>L(r.current?.getValues().description),color:"valid",loading:b}],children:j?(0,n.jsx)(H,{size:"l"}):(0,n.jsxs)(Q,{children:[(0,n.jsxs)(K,{children:[(0,n.jsx)(U,{name:l?"icon-comment":"icon-file",size:50,variant:"square"}),(0,n.jsxs)(X,{children:[(0,n.jsx)(P,{variant:l?"h3":"h2",children:(0,n.jsx)(N,{label:p?.title,length:40})}),h&&(0,n.jsxs)(P,{children:[s.formatMessage({id:"CRPT_Comment_Of"})," ",(0,n.jsx)(Y,{href:h?._user._url,children:h?._user.title})]})]})]}),(0,n.jsx)(R,{ref:r,fields:["description"],type:"contentReport",onSubmit:E})]})})},ee=u.j.getLazyComponent("Typography"),te=u.j.getLazyComponent("FlexBox"),ie=u.j.getLazyComponent("ButtonDropdown"),ne=u.j.getLazyComponent("DropDown"),oe=u.j.getLazyComponent("IconButton"),le=u.j.getLazyComponent("InputSelectRaw"),se=u.j.getLazyComponent("InputCheckboxRaw"),ae=u.j.getLazyComponent("StyledHref"),re=s()(ee)`
|
|
52
|
+
text-transform: capitalize;
|
|
53
|
+
margin-right: ${({theme:e})=>e.space.md}px;
|
|
54
|
+
`,de=s().div`
|
|
55
|
+
max-width: 200px;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
`,ce=s().div`
|
|
59
|
+
padding: 0 ${({theme:e})=>e.space.md}px;
|
|
60
|
+
`,ue=({label:e,view:t,viewsOptions:i,calendarApi:l,isLoading:s,navigateWithQuery:r,setView:u,setCreationType:g,setExportModalOpen:m})=>{const p=(0,a.useIntl)(),x=(0,c.GV)(e=>d.lg.selectors.selectById(e,"AnimatedMeetingHook")),h=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"AnimatedMeetingHook")),f=(0,c.GV)(e=>d.lg.selectors.selectById(e,"MeetingHook")),j=(0,c.GV)(e=>d.lg.selectors.selectById(e,"BoardcardHook")),[y,b]=(0,o.useState)(new URLSearchParams(window.location.search).get("types")?.split(",").filter(e=>["socialEvent","meeting","animatedMeeting","boardCard"].includes(e))??[]),C=(0,o.useMemo)(()=>[{label:p.formatMessage({id:"CALENDAR_Create_SocialEvent"}),onClick:()=>{g("socialEvent")}},...f?[{label:p.formatMessage({id:"CALENDAR_Create_Meeting"}),onClick:()=>{g("meeting")}}]:[],...x&&h?.create?[{label:p.formatMessage({id:"CALENDAR_Create_AnimatedMeeting"}),href:"/?action=spotlight-edit&type=animatedMeeting"}]:[]],[x,h?.create,p,f,g]),v=(0,o.useMemo)(()=>[{label:(0,n.jsx)(a.FormattedMessage,{id:"CALENDAR_SocialEvents"}),value:"socialEvent"},...f?[{label:(0,n.jsx)(a.FormattedMessage,{id:"CALENDAR_Meetings"}),value:"meeting"}]:[],...x?[{label:(0,n.jsx)(a.FormattedMessage,{id:"CALENDAR_AnimatedMeetings"}),value:"animatedMeeting"}]:[],...j?[{label:(0,n.jsx)(a.FormattedMessage,{id:"CALENDAR_BoardCards"}),value:"boardCard"}]:[]],[x,j,f]);return(0,n.jsxs)(te,{y:"center",children:["list"!==t.value&&(0,n.jsxs)(o.Fragment,{children:[(0,n.jsx)(re,{size:"l",weight:"medium",children:e}),(0,n.jsxs)(te,{children:[(0,n.jsx)(oe,{icon:"icon-chevron-left",onClick:()=>l?.prev(),color:"grey5"}),(0,n.jsx)(oe,{icon:"icon-chevron-right",onClick:()=>l?.next(),color:"grey5"})]}),(0,n.jsx)(oe,{icon:"icon-calendar",onClick:()=>l?.today(),tooltip:{description:"CALENDAR_Today",position:"bottom"},color:"grey5"})]}),(0,n.jsx)(de,{children:(0,n.jsx)(le,{onChange:u,value:t,name:"selectView",options:i,getLabel:e=>e.label,getValue:e=>e.value,required:!0,minWidth:!1,loading:s,noMargin:!0})}),(0,n.jsx)(ie,{noMargin:!0,color:"primary",icon:"icon-plus",label:p.formatMessage({id:"GLOBAL_Add"}),options:C}),(0,n.jsx)(ne,{trigger:(0,n.jsx)(oe,{"aria-label":p.formatMessage({id:"GLOBAL_Filter"}),colorVariant:"light",icon:"icon-filter",badgeNumber:y.length}),dropdown:()=>(0,n.jsx)(ce,{children:(0,n.jsxs)(te,{direction:"column",children:[(0,n.jsx)(ee,{weight:"medium",color:"primary",children:p.formatMessage({id:"GLOBAL_Filter"})}),(0,n.jsx)(se,{labelPosition:"before",checkboxMode:"checkbox",direction:"column",onChange:e=>{b(e),r({types:e})},options:v,value:y,name:"0"}),(0,n.jsx)(ae,{onClick:()=>{b([]),r({types:[]})},as:"button",color:"cancel",disabled:0===y.length,children:p.formatMessage({id:"GLOBAL_Reset"})})]})}),withBorder:!0,align:"right"}),(0,n.jsx)(ie,{noMargin:!0,small:!0,smallOpenDirection:"left",color:"primary",variant:"outlined",icon:"icon-ellipsis-v",label:p.formatMessage({id:"GLOBAL_Options"}),options:[{label:p.formatMessage({id:"EVENT_Export_Calendar_ICalendar_Format"}),onClick:()=>m(!0)}]})]})};var ge=i(737),me=i(282),pe=i(789);var xe=i(206),he=i(831),fe=i(704);const je=(s().div`
|
|
52
61
|
margin-bottom: 24px;
|
|
53
62
|
`,s().div`
|
|
54
63
|
margin-bottom: 4px;
|
|
@@ -60,27 +69,27 @@
|
|
|
60
69
|
flex: 1;
|
|
61
70
|
display: flex;
|
|
62
71
|
overflow: hidden;
|
|
63
|
-
`),
|
|
72
|
+
`),ye=s().div`
|
|
64
73
|
flex-direction: row;
|
|
65
74
|
display: flex;
|
|
66
75
|
min-height: 60px;
|
|
67
76
|
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
68
|
-
`,
|
|
77
|
+
`,be=s().div`
|
|
69
78
|
width: 60px;
|
|
70
79
|
display: flex;
|
|
71
80
|
align-items: center;
|
|
72
81
|
justify-content: center;
|
|
73
|
-
`,
|
|
82
|
+
`,Ce=s().div`
|
|
74
83
|
flex: 1;
|
|
75
84
|
display: flex;
|
|
76
85
|
align-items: center;
|
|
77
86
|
justify-content: center;
|
|
78
|
-
`,
|
|
87
|
+
`,ve=s().div`
|
|
79
88
|
position: relative;
|
|
80
89
|
overflow: hidden;
|
|
81
90
|
top: 0px;
|
|
82
91
|
width: ${460}px;
|
|
83
|
-
`,
|
|
92
|
+
`,we=s().div`
|
|
84
93
|
position: absolute;
|
|
85
94
|
top: 0;
|
|
86
95
|
${e=>"left"===e.position?"left: 0px;":""}
|
|
@@ -96,7 +105,7 @@
|
|
|
96
105
|
&.animate {
|
|
97
106
|
right: 0px;
|
|
98
107
|
}
|
|
99
|
-
`,
|
|
108
|
+
`,Le=s().div`
|
|
100
109
|
flex: 1;
|
|
101
110
|
display: flex;
|
|
102
111
|
flex-direction: column;
|
|
@@ -104,29 +113,29 @@
|
|
|
104
113
|
overflow: auto;
|
|
105
114
|
margin-bottom: 12px;
|
|
106
115
|
position: relative;
|
|
107
|
-
`,
|
|
116
|
+
`,Ee=s().div`
|
|
108
117
|
flex: 1;
|
|
109
118
|
display: flex;
|
|
110
119
|
flex-direction: column;
|
|
111
|
-
`,
|
|
120
|
+
`,ke=s().div`
|
|
112
121
|
position: absolute;
|
|
113
122
|
inset: 0;
|
|
114
123
|
background-color: rgba(255, 255, 255, 0.8);
|
|
115
124
|
display: flex;
|
|
116
125
|
align-items: center;
|
|
117
126
|
justify-content: center;
|
|
118
|
-
`,
|
|
127
|
+
`,_e=s().div`
|
|
119
128
|
position: absolute;
|
|
120
129
|
inset: 0;
|
|
121
130
|
background-color: ${e=>e.theme.color.white};
|
|
122
131
|
padding: ${e=>e.theme.space.md}px;
|
|
123
|
-
`,
|
|
132
|
+
`,We=s().div`
|
|
124
133
|
width: ${50}px;
|
|
125
134
|
padding-top: 60px;
|
|
126
135
|
display: flex;
|
|
127
136
|
flex-direction: column;
|
|
128
137
|
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
129
|
-
`,
|
|
138
|
+
`,Se=s().button`
|
|
130
139
|
border-radius: 4px;
|
|
131
140
|
cursor: pointer;
|
|
132
141
|
height: 42px;
|
|
@@ -142,7 +151,7 @@
|
|
|
142
151
|
&:hover {
|
|
143
152
|
background-color: ${e=>e.theme.color.grey2};
|
|
144
153
|
}
|
|
145
|
-
`,
|
|
154
|
+
`,qe=(s().div`
|
|
146
155
|
display: flex;
|
|
147
156
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
148
157
|
border-radius: ${8}px;
|
|
@@ -177,41 +186,41 @@
|
|
|
177
186
|
flex: 1;
|
|
178
187
|
display: flex;
|
|
179
188
|
align-items: center;
|
|
180
|
-
`,u.j.getLazyComponent("Button")),
|
|
189
|
+
`,u.j.getLazyComponent("Button")),Me=u.j.getLazyComponent("Icon"),Ae=({uniqid:e})=>{const t=(0,c.jL)(),i=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e));return i&&i.popup&&i.view?(0,n.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90},children:[(0,n.jsxs)(ye,{children:[(0,n.jsx)(be,{}),(0,n.jsx)(Ce,{children:"Popup"}),(0,n.jsx)(be,{children:(0,n.jsx)(Se,{onClick:()=>{t(d.cr.slice.actions.flushEditorPopup({uniqid:e}))},children:(0,n.jsx)(Me,{name:"icon-times",color:"grey2",size:26.75})})})]}),(0,n.jsx)("div",{style:{flex:1,display:"flex"},children:i.view}),(0,n.jsx)(ye,{children:(0,n.jsx)(qe,{onClick:()=>{t(d.cr.slice.actions.flushEditorPopup({uniqid:e}))},children:"Save"})})]}):(0,n.jsx)(n.Fragment,{})};var Te=i(59);const Ie=u.j.getLazyComponent("WidgetArticleTitleEditor"),ze=u.j.getLazyComponent("WidgetArticleTextEditor"),Ge=u.j.getLazyComponent("WidgetArticleGalleryEditor"),De=u.j.getLazyComponent("WidgetArticleAttachmentEditor"),Ve=u.j.getLazyComponent("WidgetArticleSliderEditor"),$e=u.j.getLazyComponent("WidgetArticleImageEditor"),Fe=u.j.getLazyComponent("WidgetButtonEditor"),Re=u.j.getLazyComponent("WidgetCheckListEditor"),Oe=u.j.getLazyComponent("WidgetQuickSurveyEditor"),Be=u.j.getLazyComponent("WidgetDatasourceTableEditor"),He=u.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),Ue=u.j.getLazyComponent("WidgetPresenceEditor"),Pe=u.j.getLazyComponent("WidgetLuccaAbsenceEditor"),Ne=u.j.getLazyComponent("WidgetEmailsImapEditor"),Ye=u.j.getLazyComponent("WidgetContactCardDavEditor"),Je=u.j.getLazyComponent("WidgetCalendarCalDavEditor"),Qe=({uniqid:e})=>{const t=(0,c.jL)(),i=(0,c.GV)(d.x0.selectors.selectToken),o=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),fe.shallowEqual),l=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e)?.onSave,fe.shallowEqual),s=e=>d.qn.selectors.selectHook(Te.M.getState(),e)?.isActive,a=i=>{o&&t(d.x0.slice.actions.updateWidget({uniqid:e,content:i})),t(d.cr.slice.actions.flushEditor({uniqid:e})),l&&l(i)},u=(i,n)=>{t(void 0!==n?d.x0.slice.actions.setWidgetState({uniqid:n,...i}):d.x0.slice.actions.setWidgetState({uniqid:e,...i}))},g=i=>{t(d.cr.slice.actions.registerEditorPopup({uniqid:e,view:i}))},m=o?.widget;return m?(0,E.ensureWidgetArticleButtonType)(m)?(0,n.jsx)(Fe,{...m.content,onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:()=>a({})}):(0,E.ensureWidgetArticleGalleryType)(m)?(0,n.jsx)(Ge,{token:i,content:m.content,onChange:i=>t((0,d.vR)(e,i,!1)),onSave:a,onStateChange:u}):(0,E.ensureWidgetArticleAttachmentType)(m)?(0,n.jsx)(De,{token:i,content:m.content,onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,onStateChange:u,onOpen:g}):(0,E.ensureWidgetLuccaAbsenceType)(m)?(0,n.jsx)(Pe,{}):(0,E.ensureWidgetArticleImageType)(m)?(0,n.jsx)($e,{content:m.content,token:i,onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,onStateChange:u}):(0,E.ensureWidgetArticleSliderType)(m)?void 0!==i?(0,n.jsx)(Ve,{slides:m.content.slides??[],loop:m.content.loop??!1,useDots:m.content.useDots??!0,onChange:i=>{t((0,d.vR)(e,i,!1))},token:i,onSave:a}):(0,n.jsx)(n.Fragment,{children:"Token is mandatory"}):(0,E.ensureWidgetArticleTitleType)(m)?(0,n.jsx)(Ie,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,content:m.content,onOpen:g}):(0,E.ensureWidgetArticleTextType)(m)?(0,n.jsx)(ze,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,content:m.content}):(0,E.ensureWidgetPresenceType)(m)?(0,n.jsx)(Ue,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,onStateChange:u,...m.content}):(0,E.ensureWidgetCheckListType)(m)?(0,n.jsx)(Re,{token:i,uniqid:m.uniqid,content:{...m.content,arr:m.content.arr?.map(e=>({...e,title:r.Utils.html.htmlDecodeSpecialChars(e.title)}))},onChangeContent:(e,i)=>{t((0,d.vR)(e,i,!1))},onChangeWrapper:e=>{t(d.x0.slice.actions.updateWidgetWrapper({...e,title:r.Utils.html.htmlDecodeSpecialChars(e.title)}))},handleChange:i=>t((0,d.vR)(e,i,!1))}):(0,E.ensureWidgetQuickSurveyType)(m)?(0,n.jsx)(Oe,{token:i,uniqid:m.uniqid,content:m.content,onChangeContent:(e,i)=>{t((0,d.vR)(e,i,!1))},onChangeWrapper:e=>{t(d.x0.slice.actions.updateWidgetWrapper({...e}))},handleChange:i=>t((0,d.vR)(e,i,!1))}):(0,E.ensureWidgetExcelDatasourceTableType)(m)?(0,n.jsx)(He,{...m.content,uri:m.content.uri,limit:m.content.limit??20,hook:{isActive:s},handlers:{jamespot:{datasource:k().datasource,network:k().network,filebank:k().filebank,wedoc:k().wedoc},handleStart:()=>u({busy:!0}),handleCatch:e=>t(d.y8.actions.error({label:e.errorMsg})),handleFinally:()=>u({busy:!1})},onSave:a,onChange:(i,n)=>t((0,d.vR)(e,i,n??!1)),onStateChange:u,onError:e=>t(d.y8.actions.error({label:e}))}):(0,E.ensureWidgetEmailsImapType)(m)?(0,n.jsx)(Ne,{}):(0,E.ensureWidgetContactCardDavType)(m)?(0,n.jsx)(Ye,{}):(0,E.ensureWidgetCalendarCalDavType)(m)?(0,n.jsx)(Je,{}):(0,E.ensureWidgetDatasourceTableType)(m)?(0,n.jsx)(Be,{...m.content,uri:m.content.uri,limit:m.content.limit??20,hook:{isActive:s},handlers:{jamespot:{datasource:k().datasource,network:k().network,application:k().application,filebank:k().filebank},handleStart:()=>u({busy:!0}),handleCatch:e=>t(d.y8.actions.error({label:e.errorMsg})),handleFinally:()=>u({busy:!1})},onSave:a,onChange:(i,n)=>t((0,d.vR)(e,i,n??!1)),onStateChange:u,onError:e=>{t(d.y8.actions.error({label:e}))}}):(0,n.jsx)(n.Fragment,{children:"cannot display editor"}):null},Ke=u.j.getLazyComponent("Icon"),Xe=({uniqid:e,position:t})=>{const i=(0,c.jL)(),o=(0,l.useTheme)();return(0,n.jsx)(be,{children:(0,n.jsx)(Se,{onClick:()=>{i(d.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))},children:(0,n.jsx)(Ke,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:o.color.lavender,size:26.75})})})},Ze=u.j.getLazyComponent("InputColorRaw"),et=s().label`
|
|
181
190
|
margin-left: 2px;
|
|
182
191
|
margin-right: 2px;
|
|
183
192
|
margin-bottom: 8px;
|
|
184
193
|
font-size: 14px;
|
|
185
194
|
width: 100%;
|
|
186
195
|
min-height: 20px;
|
|
187
|
-
`,
|
|
196
|
+
`,tt=s().fieldset`
|
|
188
197
|
margin: 12px 0px !important;
|
|
189
198
|
width: 100% !important;
|
|
190
|
-
`,Be=({label:e,initialValue:t,handleChange:i})=>{const o=(0,l.useTheme)(),s=[{name:(0,a.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[o.color.primary,o.color.secondary,o.color.headerColor,o.color.lavender,o.color.orange,o.color.green,o.color.navy,o.color.overseas]}];return(0,n.jsxs)(Oe,{children:[(0,n.jsx)(Re,{children:(0,n.jsx)(a.FormattedMessage,{id:e})}),(0,n.jsx)(Ve,{palettes:s,label:e,initialValue:t??o.color.primary,name:"background-color",onChange:i})]})},He=u.j.getLazyComponent("InputNumber"),Ue=({label:e,initialValue:t,handleChange:i})=>{const l=(0,a.useIntl)(),{control:s,watch:r}=(0,I.useForm)({defaultValues:{value:t??"0"},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=r(e=>{i(e.value??"")});return()=>e.unsubscribe()},[r,i]),(0,n.jsx)(He,{label:e,name:"value",width:"100%",control:s,placeholder:l.formatMessage({id:e})})},Pe=u.j.getLazyComponent("InputSelectExtended"),Ne=({label:e,options:t=[],initialValue:i,required:l=!1,handleChange:s})=>{const a=(0,o.useMemo)(()=>i&&t.find(e=>e.value===i)?t.find(e=>e.value===i):t[0],[i,t]),{control:r,watch:d}=(0,I.useForm)({defaultValues:{select:a},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=d(e=>{s(e.select.value)});return()=>e.unsubscribe()},[d,s]),(0,n.jsx)(Pe,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:l},hideDeleteIcon:!0,required:l,control:r,name:"select"})},Ye=u.j.getLazyComponent("InputText"),Je=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e)),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetContext(t,e),oe.shallowEqual),u=(0,l.useTheme)(),g=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),oe.shallowEqual),{control:m,watch:p}=(0,I.useForm)({defaultValues:{text:s?.title.replace(/&/g,"&")??""},criteriaMode:"all"});(0,o.useEffect)(()=>{const t=p(t=>{i(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))});return()=>t.unsubscribe()},[p,e,i]);const x=(0,o.useMemo)(()=>({color:g&&g.color?String(g.color):u.color.black,backgroundColor:g&&g["background-color"]?String(g["background-color"]):"transparent",fontSize:g&&g["font-size"]?String(g["font-size"]):"24",fontWeight:g&&g["font-weight"]?String(g["font-weight"]):"medium",textAlign:g&&g["text-align"]?String(g["text-align"]):"left"}),[g,u]),h=(0,o.useCallback)((t,n)=>{i(d.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))},[i,e]);return s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ye,{name:"text",label:"WIDGET_Title",width:"100%",control:m,placeholder:t.formatMessage({id:"WIDGET_Title"})}),"comment"!==r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Be,{label:"STYLE_Text_Color",initialValue:x.color,handleChange:e=>h("color",e)}),(0,n.jsx)(Be,{label:"STYLE_Background_Color",initialValue:x.backgroundColor,handleChange:e=>h("background-color",e)}),(0,n.jsx)(Ue,{label:"STYLE_Text_Size",initialValue:x.fontSize,handleChange:e=>h("font-size",e)}),(0,n.jsx)(Ne,{label:"STYLE_Font_Weight",initialValue:x.fontWeight,options:[{label:t.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:t.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:t.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>h("font-weight",e)}),(0,n.jsx)(Ne,{label:"STYLE_Text_Align",initialValue:x.textAlign,options:[{label:t.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:t.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:t.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:t.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>h("text-align",e)})]})]}):(0,n.jsx)(n.Fragment,{})},Qe=u.j.getLazyComponent("Loader"),Ke=({uniqid:e})=>{const t=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),oe.shallowEqual)?.busy;return(0,n.jsx)(n.Fragment,{children:t&&(0,n.jsx)(me,{children:(0,n.jsx)(Qe,{size:"l"})})})},Xe=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),oe.shallowEqual)?.locked;return i?(0,n.jsx)(pe,{children:t.formatMessage({id:"INTRANET_Panel_Change_Off"})}):(0,n.jsx)(n.Fragment,{})},Ze=u.j.getLazyComponent("Button"),et=({uniqid:e,mode:t})=>{const i=(0,a.useIntl)(),o=(0,c.jL)(),l=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),oe.shallowEqual),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e),oe.shallowEqual);return(0,n.jsx)(Ze,{color:"valid",onClick:()=>{o(d.cr.slice.actions.flushEditor({uniqid:e}));const n=l&&l.widget&&l.widget.content;s&&l&&n&&("view"==t&&k().widget.updateWidget({uri:s,uniqid:e,title:l.title,content:n,v2:!0}).catch(e=>{o(d.y8.actions.error({label:e.errorMsg??i.formatMessage({id:"GLOBAL_Error"})}))}),"edit"===t&&o(d.x0.slice.actions.updateWidget({uniqid:e,content:n})))},children:i.formatMessage({id:"GLOBAL_Save"})})},tt=({uniqid:e})=>{const t=(0,l.useTheme)(),i=(0,c.jL)(),s=(0,a.useIntl)(),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),oe.shallowEqual),u=(0,o.useMemo)(()=>({color:r&&r.color?String(r.color):t.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):t.color.white,padding:r&&r.padding?String(r.padding):"0",borderRadius:r&&r["border-radius"]?String(r["border-radius"]):"0",borderColor:r["border-color"]?String(r["border-color"]):t.color.black,borderWidth:r["border-width"]?String(r["border-width"]):"0",borderStyle:r["border-style"]?String(r["border-style"]):"none"}),[r,t]),g=(0,o.useCallback)((t,n)=>{i(d.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:n}}))},[e,i]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Be,{label:"STYLE_Background_Color",initialValue:u.backgroundColor,handleChange:e=>g("background-color",e)}),(0,n.jsx)(Be,{label:"STYLE_Text_Color",initialValue:u.color,handleChange:e=>g("color",e)}),(0,n.jsx)("hr",{}),(0,n.jsx)(Ue,{label:"STYLE_Padding",initialValue:u.padding,handleChange:e=>g("padding",String(e))}),(0,n.jsx)(Ue,{label:"STYLE_Radius",initialValue:u.borderRadius,handleChange:e=>g("border-radius",String(e))}),(0,n.jsx)(Ne,{label:"STYLE_Border_Style",initialValue:u.borderStyle,options:[{label:s.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:s.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:s.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:s.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{g("border-style",e),"none"!==e&&g("border-color",t.color.black),"none"!==e&&g("border-width","1")}}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,n.jsx)(Be,{label:"STYLE_Border_Color",initialValue:u.borderColor,handleChange:e=>g("border-color",e)}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,n.jsx)(Ue,{label:"STYLE_Border_Width",initialValue:u.borderWidth,handleChange:e=>g("border-width",e)})]})},it=({uniqid:e})=>{const t=(0,c.jL)(),i=(0,a.useIntl)(),l=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e),oe.shallowEqual),s=d.x0.definition(l?.name),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetLevel(t,e),oe.shallowEqual),u=(0,o.useCallback)(i=>{t(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(i)}))},[e,t]);return(0,n.jsx)(Ne,{handleChange:u,required:!0,label:"WIDGET_Display_Level_Select",initialValue:r?String(r):"3",options:[{label:i.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:i.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:i.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:i.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter(e=>Array.isArray(s.displayLevel)?s.displayLevel.includes(Number(e.value)):[])})},nt=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],ot=u.j.getLazyComponent("Icon"),lt=u.j.getLazyComponent("Tooltip"),st=({uniqid:e,position:t})=>{const i=(0,a.useIntl)(),s=(0,c.jL)(),r=(0,l.useTheme)(),u=(0,o.useRef)(null),g=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e),oe.shallowEqual),m=d.x0.definition(g?.name),p=(0,o.useMemo)(()=>void 0!==m.displayLevel&&Array.isArray(m.displayLevel)&&0!==m.displayLevel.length,[m]),x=(0,o.useMemo)(()=>[{name:"widget-title",label:i.formatMessage({id:"PANEL_Title"}),enable:m.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:i.formatMessage({id:"PANEL_Widget_Selection"}),enable:m.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:i.formatMessage({id:"PANEL_Widget_Settings"}),enable:m.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:i.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}],[m,i,p]),h=(0,o.useMemo)(()=>m.panel.useEditor?x.find(e=>"widget-settings"===e.name):x.filter(e=>e.enable)[0],[m,x]),[f,j]=(0,o.useState)(h);return(0,o.useEffect)(()=>{setTimeout(()=>{u&&u.current&&(u.current.className=u.current.className+" animate")},0)},[]),g?(0,n.jsxs)(de,{children:[(0,n.jsxs)(ce,{ref:u,position:t,children:[(0,n.jsx)(xe,{children:x.filter(e=>e.enable).map(e=>(0,n.jsx)(he,{isActive:f&&f.name===e.name,onClick:()=>j(e),children:(0,n.jsx)(lt,{position:"left",description:e.label,children:(0,n.jsx)(ot,{name:e.icon,color:f&&f.name===e.name?r.color.white:r.color.lavender})})},e.name))}),(0,n.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"},children:[(0,n.jsxs)(se,{children:[(0,n.jsx)(Fe,{uniqid:e,position:g.position}),(0,n.jsx)(re,{children:(0,n.jsx)("h3",{children:f?f.label:i.formatMessage({id:m.label})})}),(0,n.jsx)(ae,{children:(0,n.jsx)(he,{onClick:()=>{s(d.cr.slice.actions.flushEditor({uniqid:e}))},children:(0,n.jsx)(ot,{name:"icon-times",color:r.color.lavender,size:26.75})})})]}),(0,n.jsxs)(ue,{children:[(0,n.jsxs)(ge,{children:[f&&"widget-settings"===f.name&&m.panel.useEditor&&(0,n.jsx)(De,{uniqid:g.uniqid}),f&&"widget-title"===f.name&&m.panel.useWrapper&&(0,n.jsx)(Je,{uniqid:g.uniqid}),f&&"widget-selection"===f.name&&(0,n.jsx)(tt,{uniqid:e}),f&&"widget-level"===f.name&&p&&(0,n.jsx)(it,{uniqid:e})]}),(0,n.jsx)(Ke,{uniqid:e}),(0,n.jsx)(Xe,{uniqid:e}),nt.includes(g.name)&&(0,n.jsx)(et,{uniqid:e,mode:g.mode})]})]})]}),g?.popup?(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):(0,n.jsx)(n.Fragment,{})]}):(0,n.jsx)(n.Fragment,{})},at=s().div`
|
|
199
|
+
`,it=({label:e,initialValue:t,handleChange:i})=>{const o=(0,l.useTheme)(),s=[{name:(0,a.useIntl)().formatMessage({id:"GLOBAL_Platform_Color"}),colors:[o.color.primary,o.color.secondary,o.color.headerColor,o.color.lavender,o.color.orange,o.color.green,o.color.navy,o.color.overseas]}];return(0,n.jsxs)(tt,{children:[(0,n.jsx)(et,{children:(0,n.jsx)(a.FormattedMessage,{id:e})}),(0,n.jsx)(Ze,{palettes:s,label:e,initialValue:t??o.color.primary,name:"background-color",onChange:i})]})},nt=u.j.getLazyComponent("InputNumber"),ot=({label:e,initialValue:t,handleChange:i})=>{const l=(0,a.useIntl)(),{control:s,watch:r}=(0,I.useForm)({defaultValues:{value:t??"0"},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=r(e=>{i(e.value??"")});return()=>e.unsubscribe()},[r,i]),(0,n.jsx)(nt,{label:e,name:"value",width:"100%",control:s,placeholder:l.formatMessage({id:e})})},lt=u.j.getLazyComponent("InputSelectExtended"),st=({label:e,options:t=[],initialValue:i,required:l=!1,handleChange:s})=>{const a=(0,o.useMemo)(()=>i&&t.find(e=>e.value===i)?t.find(e=>e.value===i):t[0],[i,t]),{control:r,watch:d}=(0,I.useForm)({defaultValues:{select:a},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=d(e=>{s(e.select.value)});return()=>e.unsubscribe()},[d,s]),(0,n.jsx)(lt,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:l},hideDeleteIcon:!0,required:l,control:r,name:"select"})},at=u.j.getLazyComponent("InputText"),rt=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e)),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetContext(t,e),fe.shallowEqual),u=(0,l.useTheme)(),g=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),fe.shallowEqual),{control:m,watch:p}=(0,I.useForm)({defaultValues:{text:s?.title.replace(/&/g,"&")??""},criteriaMode:"all"});(0,o.useEffect)(()=>{const t=p(t=>{i(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))});return()=>t.unsubscribe()},[p,e,i]);const x=(0,o.useMemo)(()=>({color:g&&g.color?String(g.color):u.color.black,backgroundColor:g&&g["background-color"]?String(g["background-color"]):"transparent",fontSize:g&&g["font-size"]?String(g["font-size"]):"24",fontWeight:g&&g["font-weight"]?String(g["font-weight"]):"medium",textAlign:g&&g["text-align"]?String(g["text-align"]):"left"}),[g,u]),h=(0,o.useCallback)((t,n)=>{i(d.x0.slice.actions.setWidgetTitleStyle({uniqid:e,styles:{[t]:n}}))},[i,e]);return s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(at,{name:"text",label:"WIDGET_Title",width:"100%",control:m,placeholder:t.formatMessage({id:"WIDGET_Title"})}),"comment"!==r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(it,{label:"STYLE_Text_Color",initialValue:x.color,handleChange:e=>h("color",e)}),(0,n.jsx)(it,{label:"STYLE_Background_Color",initialValue:x.backgroundColor,handleChange:e=>h("background-color",e)}),(0,n.jsx)(ot,{label:"STYLE_Text_Size",initialValue:x.fontSize,handleChange:e=>h("font-size",e)}),(0,n.jsx)(st,{label:"STYLE_Font_Weight",initialValue:x.fontWeight,options:[{label:t.formatMessage({id:"STYLE_Font_Weight_Normal"}),value:"normal"},{label:t.formatMessage({id:"STYLE_Font_Weight_Medium"}),value:"medium"},{label:t.formatMessage({id:"STYLE_Font_Weight_Bold"}),value:"bold"}],required:!1,handleChange:e=>h("font-weight",e)}),(0,n.jsx)(st,{label:"STYLE_Text_Align",initialValue:x.textAlign,options:[{label:t.formatMessage({id:"STYLE_Text_Align_Left"}),value:"left"},{label:t.formatMessage({id:"STYLE_Text_Align_Center"}),value:"center"},{label:t.formatMessage({id:"STYLE_Text_Align_Justify"}),value:"justify"},{label:t.formatMessage({id:"STYLE_Text_Align_Right"}),value:"right"}],required:!1,handleChange:e=>h("text-align",e)})]})]}):(0,n.jsx)(n.Fragment,{})},dt=u.j.getLazyComponent("Loader"),ct=({uniqid:e})=>{const t=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),fe.shallowEqual)?.busy;return(0,n.jsx)(n.Fragment,{children:t&&(0,n.jsx)(ke,{children:(0,n.jsx)(dt,{size:"l"})})})},ut=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),fe.shallowEqual)?.locked;return i?(0,n.jsx)(_e,{children:t.formatMessage({id:"INTRANET_Panel_Change_Off"})}):(0,n.jsx)(n.Fragment,{})},gt=u.j.getLazyComponent("Button"),mt=({uniqid:e,mode:t})=>{const i=(0,a.useIntl)(),o=(0,c.jL)(),l=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),fe.shallowEqual),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e),fe.shallowEqual);return(0,n.jsx)(gt,{color:"valid",onClick:()=>{o(d.cr.slice.actions.flushEditor({uniqid:e}));const n=l&&l.widget&&l.widget.content;s&&l&&n&&("view"==t&&k().widget.updateWidget({uri:s,uniqid:e,title:l.title,content:n,v2:!0}).catch(e=>{o(d.y8.actions.error({label:e.errorMsg??i.formatMessage({id:"GLOBAL_Error"})}))}),"edit"===t&&o(d.x0.slice.actions.updateWidget({uniqid:e,content:n})))},children:i.formatMessage({id:"GLOBAL_Save"})})},pt=({uniqid:e})=>{const t=(0,l.useTheme)(),i=(0,c.jL)(),s=(0,a.useIntl)(),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),fe.shallowEqual),u=(0,o.useMemo)(()=>({color:r&&r.color?String(r.color):t.color.black,backgroundColor:r&&r["background-color"]?String(r["background-color"]):t.color.white,padding:r&&r.padding?String(r.padding):"0",borderRadius:r&&r["border-radius"]?String(r["border-radius"]):"0",borderColor:r["border-color"]?String(r["border-color"]):t.color.black,borderWidth:r["border-width"]?String(r["border-width"]):"0",borderStyle:r["border-style"]?String(r["border-style"]):"none"}),[r,t]),g=(0,o.useCallback)((t,n)=>{i(d.x0.slice.actions.setWidgetWrapperStyle({uniqid:e,styles:{[t]:n}}))},[e,i]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(it,{label:"STYLE_Background_Color",initialValue:u.backgroundColor,handleChange:e=>g("background-color",e)}),(0,n.jsx)(it,{label:"STYLE_Text_Color",initialValue:u.color,handleChange:e=>g("color",e)}),(0,n.jsx)("hr",{}),(0,n.jsx)(ot,{label:"STYLE_Padding",initialValue:u.padding,handleChange:e=>g("padding",String(e))}),(0,n.jsx)(ot,{label:"STYLE_Radius",initialValue:u.borderRadius,handleChange:e=>g("border-radius",String(e))}),(0,n.jsx)(st,{label:"STYLE_Border_Style",initialValue:u.borderStyle,options:[{label:s.formatMessage({id:"STYLE_Border_Style_None"}),value:"none"},{label:s.formatMessage({id:"STYLE_Border_Style_Solid"}),value:"solid"},{label:s.formatMessage({id:"STYLE_Border_Style_Dashed"}),value:"dashed"},{label:s.formatMessage({id:"STYLE_Border_Style_Dotted"}),value:"dotted"}],required:!1,handleChange:e=>{g("border-style",e),"none"!==e&&g("border-color",t.color.black),"none"!==e&&g("border-width","1")}}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,n.jsx)(it,{label:"STYLE_Border_Color",initialValue:u.borderColor,handleChange:e=>g("border-color",e)}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,n.jsx)(ot,{label:"STYLE_Border_Width",initialValue:u.borderWidth,handleChange:e=>g("border-width",e)})]})},xt=({uniqid:e})=>{const t=(0,c.jL)(),i=(0,a.useIntl)(),l=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e),fe.shallowEqual),s=d.x0.definition(l?.name),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetLevel(t,e),fe.shallowEqual),u=(0,o.useCallback)(i=>{t(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(i)}))},[e,t]);return(0,n.jsx)(st,{handleChange:u,required:!0,label:"WIDGET_Display_Level_Select",initialValue:r?String(r):"3",options:[{label:i.formatMessage({id:"WIDGET_Display_Level_1"}),value:"1"},{label:i.formatMessage({id:"WIDGET_Display_Level_2"}),value:"2"},{label:i.formatMessage({id:"WIDGET_Display_Level_3"}),value:"3"},{label:i.formatMessage({id:"WIDGET_Display_Level_4"}),value:"4"}].filter(e=>Array.isArray(s.displayLevel)?s.displayLevel.includes(Number(e.value)):[])})},ht=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],ft=u.j.getLazyComponent("Icon"),jt=u.j.getLazyComponent("Tooltip"),yt=({uniqid:e,position:t})=>{const i=(0,a.useIntl)(),s=(0,c.jL)(),r=(0,l.useTheme)(),u=(0,o.useRef)(null),g=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e),fe.shallowEqual),m=d.x0.definition(g?.name),p=(0,o.useMemo)(()=>void 0!==m.displayLevel&&Array.isArray(m.displayLevel)&&0!==m.displayLevel.length,[m]),x=(0,o.useMemo)(()=>[{name:"widget-title",label:i.formatMessage({id:"PANEL_Title"}),enable:m.panel.useWrapper,icon:"icon-font"},{name:"widget-selection",label:i.formatMessage({id:"PANEL_Widget_Selection"}),enable:m.panel.useSelection,icon:"icon-sliders"},{name:"widget-settings",label:i.formatMessage({id:"PANEL_Widget_Settings"}),enable:m.panel.useEditor,icon:"icon-pen"},{name:"widget-level",label:i.formatMessage({id:"PANEL_Widget_Level"}),enable:p,icon:"icon-edit"}],[m,i,p]),h=(0,o.useMemo)(()=>m.panel.useEditor?x.find(e=>"widget-settings"===e.name):x.filter(e=>e.enable)[0],[m,x]),[f,j]=(0,o.useState)(h);return(0,o.useEffect)(()=>{setTimeout(()=>{u&&u.current&&(u.current.className=u.current.className+" animate")},0)},[]),g?(0,n.jsxs)(ve,{children:[(0,n.jsxs)(we,{ref:u,position:t,children:[(0,n.jsx)(We,{children:x.filter(e=>e.enable).map(e=>(0,n.jsx)(Se,{isActive:f&&f.name===e.name,onClick:()=>j(e),children:(0,n.jsx)(jt,{position:"left",description:e.label,children:(0,n.jsx)(ft,{name:e.icon,color:f&&f.name===e.name?r.color.white:r.color.lavender})})},e.name))}),(0,n.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"},children:[(0,n.jsxs)(ye,{children:[(0,n.jsx)(Xe,{uniqid:e,position:g.position}),(0,n.jsx)(Ce,{children:(0,n.jsx)("h3",{children:f?f.label:i.formatMessage({id:m.label})})}),(0,n.jsx)(be,{children:(0,n.jsx)(Se,{onClick:()=>{s(d.cr.slice.actions.flushEditor({uniqid:e}))},children:(0,n.jsx)(ft,{name:"icon-times",color:r.color.lavender,size:26.75})})})]}),(0,n.jsxs)(Le,{children:[(0,n.jsxs)(Ee,{children:[f&&"widget-settings"===f.name&&m.panel.useEditor&&(0,n.jsx)(Qe,{uniqid:g.uniqid}),f&&"widget-title"===f.name&&m.panel.useWrapper&&(0,n.jsx)(rt,{uniqid:g.uniqid}),f&&"widget-selection"===f.name&&(0,n.jsx)(pt,{uniqid:e}),f&&"widget-level"===f.name&&p&&(0,n.jsx)(xt,{uniqid:e})]}),(0,n.jsx)(ct,{uniqid:e}),(0,n.jsx)(ut,{uniqid:e}),ht.includes(g.name)&&(0,n.jsx)(mt,{uniqid:e,mode:g.mode})]})]})]}),g?.popup?(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):(0,n.jsx)(n.Fragment,{})]}):(0,n.jsx)(n.Fragment,{})},bt=s().div`
|
|
191
200
|
position: absolute;
|
|
192
201
|
inset: 0;
|
|
193
202
|
pointer-events: none;
|
|
194
203
|
z-index: 1;
|
|
195
|
-
`,
|
|
204
|
+
`,Ct=s().div`
|
|
196
205
|
flex: 1;
|
|
197
206
|
display: flex;
|
|
198
207
|
margin-top: ${90}px;
|
|
199
208
|
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
200
|
-
`,
|
|
209
|
+
`,vt=s().div`
|
|
201
210
|
flex: 1;
|
|
202
211
|
display: flex;
|
|
203
212
|
flex-direction: row;
|
|
204
213
|
pointer-events: none;
|
|
205
|
-
`,
|
|
214
|
+
`,wt=s().div`
|
|
206
215
|
width: ${440}px;
|
|
207
216
|
pointer-events: none;
|
|
208
|
-
`,
|
|
217
|
+
`,Lt=()=>{const e=(0,c.jL)();(0,o.useEffect)(()=>{const t=()=>{e(d.cr.slice.actions.flushAllEditor())};return window.addEventListener("NGWidgetEditorFlushAll",t),()=>{window.removeEventListener("NGWidgetEditorFlushAll",t)}},[e]);const t=(0,c.GV)(d.cr.selectors.selectEditors,fe.shallowEqual);return(0,n.jsx)(bt,{className:"editor-portal-wrapper",children:t.map(e=>(0,n.jsx)(je,{isActive:!1,children:(0,n.jsx)(vt,{children:"left"===e.position?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(yt,{uniqid:e.uniqid,position:e.position}),(0,n.jsx)(Ct,{isActive:void 0!==e.popup,children:(0,n.jsx)(Ae,{uniqid:e.uniqid})}),(0,n.jsx)(wt,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(wt,{}),(0,n.jsx)(Ct,{isActive:void 0!==e.popup,children:(0,n.jsx)(Ae,{uniqid:e.uniqid})}),(0,n.jsx)(yt,{uniqid:e.uniqid,position:e.position})]})})},e.uniqid))})},Et=()=>{const e=document.getElementById("react-portals"),t=(0,o.useMemo)(()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,he.A)(),e.appendChild(t)),t})(e),[e]);return t?(0,xe.createPortal)((0,n.jsx)(r.JRCThemeProvider,{children:(0,n.jsx)(Lt,{})}),t):null},kt=s().div`
|
|
209
218
|
display: flex;
|
|
210
219
|
flex-direction: row;
|
|
211
220
|
flex-wrap: wrap;
|
|
212
221
|
gap: 10px;
|
|
213
222
|
justify-content: center;
|
|
214
|
-
`,
|
|
223
|
+
`,_t=s().div`
|
|
215
224
|
border: 1px solid ${e=>e.theme.color.grey2};
|
|
216
225
|
border-radius: 8px;
|
|
217
226
|
cursor: pointer;
|
|
@@ -236,7 +245,7 @@
|
|
|
236
245
|
opacity: 1;
|
|
237
246
|
}
|
|
238
247
|
}
|
|
239
|
-
`,
|
|
248
|
+
`,Wt=s().div`
|
|
240
249
|
border: 2px solid ${e=>e.theme.color.primary};
|
|
241
250
|
height: ${e=>e.open?e.height:"54"}px;
|
|
242
251
|
border-radius: 8px;
|
|
@@ -246,14 +255,14 @@
|
|
|
246
255
|
transition: height 0.4s;
|
|
247
256
|
overflow: hidden;
|
|
248
257
|
flex-direction: column;
|
|
249
|
-
`,
|
|
258
|
+
`,St=s().div`
|
|
250
259
|
display: flex;
|
|
251
260
|
flex-direction: row;
|
|
252
261
|
flex-wrap: wrap;
|
|
253
262
|
justify-content: center;
|
|
254
263
|
gap: 10px;
|
|
255
264
|
${e=>e.column&&"flex-direction: column;"}
|
|
256
|
-
`,
|
|
265
|
+
`,qt=s().div`
|
|
257
266
|
min-height: 50px;
|
|
258
267
|
display: flex;
|
|
259
268
|
justify-content: center;
|
|
@@ -263,7 +272,7 @@
|
|
|
263
272
|
&:hover {
|
|
264
273
|
background-color: ${e=>e.theme.color.grey0};
|
|
265
274
|
}
|
|
266
|
-
`,
|
|
275
|
+
`,Mt=s().button`
|
|
267
276
|
display: flex;
|
|
268
277
|
align-items: center;
|
|
269
278
|
padding: ${e=>e.parentIsColumn?"36px 16px":"0 10px"};
|
|
@@ -284,48 +293,48 @@
|
|
|
284
293
|
}
|
|
285
294
|
|
|
286
295
|
${(0,r.DashedFocusBorder)()}
|
|
287
|
-
`,
|
|
296
|
+
`,At=s().div`
|
|
288
297
|
display: flex;
|
|
289
298
|
flex-direction: ${e=>"row"===e.direction?"row":"column"};
|
|
290
299
|
align-items: ${e=>"row"===e.direction?"center":"flex-start"};
|
|
291
300
|
justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
|
|
292
301
|
flex: 1;
|
|
293
302
|
${e=>e.gap&&`gap:${e.gap}px`}
|
|
294
|
-
`,
|
|
303
|
+
`,Tt=u.j.getLazyComponent("Button"),It=u.j.getLazyComponent("ModalLayout"),zt=u.j.getLazyComponent("ModalContent"),Gt=u.j.getLazyComponent("Tooltip"),Dt=u.j.getLazyComponent("IconButton"),Vt=({mode:e,view:t,children:i,namespace:l="default",onChange:s})=>{const[r,c]=(0,o.useState)(!1),u=function(e){switch(e){case"widget-article-image":return[d.x0.definition(E.WidgetsName.ArticleTitle),d.x0.definition(E.WidgetsName.ArticleButton)];case"comment":return[d.x0.definition(E.WidgetsName.CheckList),d.x0.definition(E.WidgetsName.Presence),d.x0.definition(E.WidgetsName.QuickSurvey)];default:return[d.x0.definition(E.WidgetsName.ArticleTitle),d.x0.definition(E.WidgetsName.ArticleText),d.x0.definition(E.WidgetsName.ArticleImage),d.x0.definition(E.WidgetsName.ArticleButton),d.x0.definition(E.WidgetsName.ArticleSlider),d.x0.definition(E.WidgetsName.ArticleAttachment),d.x0.definition(E.WidgetsName.Presence)]}}(l),g=(0,a.useIntl)(),m={open:r,portalId:"react-modal",variant:"full-height",closeHandler:()=>c(!1)},p=e=>{s(d.x0.factory(e)),c(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(It,{...m,children:(0,n.jsx)(zt,{onClickIconClose:m.closeHandler,buttons:"comment"===e?[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>c(!1)}]:void 0,title:g.formatMessage({id:"WIDGET_Builder"}),children:"comment"===e?(0,n.jsx)(St,{column:!0,children:u.map((e,t)=>(0,n.jsx)(Mt,{open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>p(e.name),children:(0,n.jsxs)(At,{direction:"row",gap:12,children:[(0,n.jsx)("img",{src:e.img}),(0,n.jsxs)(At,{direction:"column",children:[(0,n.jsx)("h3",{children:g.formatMessage({id:e.label})}),(0,n.jsx)("p",{children:g.formatMessage({id:e.description})})]})]})},e.name))}):(0,n.jsx)(kt,{children:u.map((e,t)=>(0,n.jsxs)(_t,{onClick:()=>p(e.name),available:e.available,children:[(0,n.jsx)("img",{src:e.img}),(0,n.jsx)("div",{className:"show-on-hover",children:g.formatMessage({id:e.label})})]},t))})})}),"custom"===e&&i?(0,n.jsx)("div",{onClick:()=>c(!0),children:i}):(0,n.jsx)(n.Fragment,{}),"button"===e&&"edit"===t?(0,n.jsx)(Tt,{onClick:()=>c(!0),variant:"outlined",minWidth:"100%",children:g.formatMessage({id:"WIDGET_Add_Widget"})}):(0,n.jsx)(n.Fragment,{}),"gallery"===e&&"edit"===t?(0,n.jsx)(kt,{children:u.map((e,t)=>(0,n.jsxs)(_t,{onClick:()=>p(e.name),available:e.available,children:[(0,n.jsx)("img",{src:e.img}),(0,n.jsx)("div",{className:"show-on-hover",children:g.formatMessage({id:e.label})})]},t))}):(0,n.jsx)(n.Fragment,{}),"article"===e&&"edit"===t?(0,n.jsx)($t,{widgets:u,onClick:p}):(0,n.jsx)(n.Fragment,{}),"comment"===e&&"edit"===t?(0,n.jsx)(Ft,{onClick:()=>{c(!0)}}):(0,n.jsx)(n.Fragment,{})]})},$t=({widgets:e,onClick:t})=>{const[i,l]=(0,o.useState)(!1),s=(0,a.useIntl)(),r=(0,o.useMemo)(()=>80*Math.ceil(e.length/2)+50+10,[e]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Wt,{open:i,height:r,children:[(0,n.jsx)(qt,{onClick:()=>l(!i),children:s.formatMessage({id:"WIDGET_Add_Widget"})}),(0,n.jsx)(St,{children:e.map((e,o)=>(0,n.jsxs)(Mt,{open:i,index:o,onClick:()=>t(e.name),children:[(0,n.jsx)("img",{src:e.img}),s.formatMessage({id:e.label})]},e.name))})]})})},Ft=({onClick:e})=>{const t=(0,a.useIntl)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Gt,{description:t.formatMessage({id:"COMMENT_Add_Widget"}),children:(0,n.jsx)(Dt,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})})})},Rt=()=>{const e=(0,a.useIntl)(),[t,i]=(0,o.useState)(!1),[n,l]=(0,o.useState)();return{open:t,onInsert:e=>{n?.execCommand("InsertHTML",!1,e)},close:()=>i(!1),ext:(0,o.useMemo)(()=>r.JTinyMCEExtensionsBuilders.markdown(e=>{l(e),i(!0)},e),[e]),isActive:!0}};var Ot=i(802),Bt=i(892);const Ht=u.j.getLazyComponent("InputFileAdvancedRaw"),Ut=s().div`
|
|
295
304
|
width: 0;
|
|
296
305
|
height: 0;
|
|
297
306
|
overflow: hidden;
|
|
298
|
-
`,
|
|
307
|
+
`,Pt=({children:e,initialFiles:t,initialClick:i,multiple:l,accept:s,onUploadStart:a,onUploadEnd:r,onUploadSuccess:u})=>{const g=(0,o.useRef)(null),m=(0,c.GV)(d.x0.selectors.selectToken),[p,x]=(0,o.useState)(0),[h,f]=(0,o.useState)(t);return(0,o.useEffect)(()=>{i&&g.current?.click()},[i]),(0,o.useEffect)(()=>{t.length!==h.length&&f(t)},[t]),(0,o.useEffect)(()=>{u(h)},[h]),(0,o.useEffect)(()=>{0===p&&r()},[p]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{onClick:()=>{i&&g.current?.click()},children:e}),(0,n.jsx)(Ut,{children:(0,n.jsx)(Ht,{ref:g,id:"widget-upload-file",name:"editorFiles",content:"",accept:s,multiple:l,token:m,onUploadStart:e=>{void 0!==e&&x(t=>t+e),"function"==typeof a&&0!==e&&a()},onUploadSuccess:e=>{void 0!==e&&(x(e=>void 0!==e?e-1:0),f(t=>l?[...t,e]:[e]))}})})]})},Nt=u.j.getLazyComponent("WidgetAttachment"),Yt=u.j.getLazyComponent("WidgetEmptyInplace"),Jt=u.j.getLazyComponent("FileViewer"),Qt=s().div`
|
|
299
308
|
flex: 1;
|
|
300
|
-
|
|
309
|
+
`,Kt=({widget:e,inplace:t,mode:i})=>{const l=(0,a.useIntl)(),{uniqid:s}=e,{files:r}=e.content,u=(0,c.jL)(),g=(0,c.GV)(e=>d.x0.selectors.isActive(e,s),fe.shallowEqual),m=e=>{u(d.y8.actions.error({label:e??l.formatMessage({id:"GLOBAL_Error"})}))};(0,o.useEffect)(()=>{u(d.x0.slice.actions.setWidgetState({uniqid:s,mounted:!0}))},[]),(0,o.useEffect)(()=>{u(d.x0.slice.actions.setWidgetState({uniqid:s,empty:!r||0===r.length}))},[r]);const p=(0,c.GV)(e=>d.lg.selectors.selectById(e,"WeDocHook")),x=[{label:l.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&k().object.getAccessHash(`fileArticle/${e.id}`).then(t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)}).catch(()=>{u(d.y8.actions.error({label:"WIDGET_Open_Failed"},6e3))})}}],h=p?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:x}]:[];return void 0!==r?(0,n.jsxs)(Qt,{children:["view"!==i?(0,n.jsx)(Nt,{files:r,onClick:()=>{},onError:m}):(0,n.jsx)(Jt,{files:r,openWithOptions:h,children:e=>(0,n.jsx)(Nt,{files:r.map(e=>({...e,uri:(0,E.resolveFilePath)(e)})),onClick:t=>e(t),onError:m})}),t&&"view"!==i&&(0,n.jsx)(Pt,{initialFiles:r,initialClick:g,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&u((0,d.vR)(s,{files:e.map(e=>({...e,uri:(0,E.resolveFilePath)(e)??""}))}))},onUploadStart:()=>{u(d.x0.slice.actions.setWidgetState({uniqid:s,loading:!0}))},onUploadEnd:()=>{u(d.x0.slice.actions.setWidgetState({uniqid:s,loading:!1}))},children:"edit"===i?(0,n.jsx)(Yt,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):(0,n.jsx)(n.Fragment,{})})]}):(0,n.jsx)(n.Fragment,{})},Xt=u.j.getLazyComponent("WidgetButton"),Zt=s().div`
|
|
301
310
|
display: flex;
|
|
302
311
|
flex: 1;
|
|
303
312
|
justify-content: center;
|
|
304
313
|
align-items: center;
|
|
305
|
-
`,
|
|
314
|
+
`,ei=s().div`
|
|
306
315
|
pointer-events: ${e=>e.clickable?"all":"none"};
|
|
307
316
|
cursor: pointer;
|
|
308
317
|
display: flex;
|
|
309
318
|
flex: 1;
|
|
310
319
|
justify-content: center;
|
|
311
320
|
align-items: center;
|
|
312
|
-
`,
|
|
321
|
+
`,ti=({widget:e,mode:t})=>{const i=(0,c.jL)(),{uniqid:l}=e,{text:s,url:a,target:r,color:u,backgroundColor:g,buttonSize:m,borderRadius:p,variant:x}=e.content;return(0,o.useEffect)(()=>{i(d.x0.slice.actions.setWidgetState({uniqid:l,empty:!s||0===s.length}))},[s]),(0,n.jsx)(Zt,{onClick:()=>{"edit"===t&&i(d.cr.slice.actions.registerEditor({uniqid:l,name:e.name}))},children:(0,n.jsx)(ei,{clickable:"edit"!==t,children:(0,n.jsx)(Xt,{text:s,url:a,target:r,color:u,backgroundColor:g,buttonSize:m,borderRadius:p,variant:x})})})},ii=u.j.getLazyComponent("WidgetArticleGallery"),ni=u.j.getLazyComponent("WidgetEmptyInplace"),oi=u.j.getLazyComponent("FileViewer"),li=s().button`
|
|
313
322
|
cursor: pointer;
|
|
314
|
-
`,
|
|
323
|
+
`,si=({widget:e,inplace:t,mode:i})=>{const{uniqid:l}=e,{files:s}=e.content,a=(0,c.jL)(),r=(0,c.GV)(e=>d.x0.selectors.isActive(e,l),fe.shallowEqual);return(0,o.useEffect)(()=>{a(d.x0.slice.actions.setWidgetState({uniqid:l,mounted:!0}))},[]),void 0!==s?(0,n.jsxs)(n.Fragment,{children:["edit"===i?(0,n.jsx)(ii,{files:s,maxWidth:800,gap:e.content.gap??"10",column:e.content.column??"3",onClick:()=>{}}):(0,n.jsx)(oi,{files:s,openWithOptions:[],children:t=>(0,n.jsx)(li,{children:(0,n.jsx)(ii,{files:s,maxWidth:600,gap:e.content.gap??"10",column:e.content.column??"3",onClick:e=>t(e)})})}),t&&"edit"===i?(0,n.jsx)(Pt,{initialFiles:s,initialClick:r,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&a((0,d.vR)(l,{files:e}))},onUploadStart:()=>{a(d.x0.slice.actions.setWidgetState({uniqid:l,loading:!0}))},onUploadEnd:()=>{a(d.x0.slice.actions.setWidgetState({uniqid:l,loading:!1}))},children:(0,n.jsx)(ni,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})}):(0,n.jsx)(n.Fragment,{})]}):(0,n.jsx)(n.Fragment,{})},ai=s().div`
|
|
315
324
|
padding: ${e=>e.theme.space.md}px;
|
|
316
325
|
padding-right: 0px;
|
|
317
|
-
`,
|
|
326
|
+
`,ri=s().div`
|
|
318
327
|
text-align: ${e=>e.textAlign};
|
|
319
328
|
font-size: ${e=>e.fontSize}px;
|
|
320
329
|
font-weight: ${e=>e.fontWeight};
|
|
321
330
|
color: ${e=>e.color};
|
|
322
|
-
`,
|
|
331
|
+
`,di=({uniqid:e,textAlign:t="left",fontSize:i="16",fontWeight:o="medium",color:l})=>{const s=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),fe.shallowEqual);return(0,n.jsx)(n.Fragment,{children:s&&"string"==typeof s.title&&0!==s.title.length&&(0,n.jsx)(ai,{children:(0,n.jsx)(ri,{textAlign:t,fontSize:i,fontWeight:o,color:l,children:s.title})})})},ci=s().div`
|
|
323
332
|
background-color: ${e=>e.backroundColor};
|
|
324
|
-
`,
|
|
333
|
+
`,ui=s().div`
|
|
325
334
|
display: flex;
|
|
326
335
|
flex-direction: row;
|
|
327
336
|
align-items: center;
|
|
328
|
-
`,
|
|
337
|
+
`,gi=(s().div`
|
|
329
338
|
padding: ${e=>e.theme.space.sm}px ${e=>e.theme.space.md}px;
|
|
330
339
|
color: ${e=>e.theme.color.grey4};
|
|
331
340
|
`,s().div`
|
|
@@ -334,28 +343,28 @@
|
|
|
334
343
|
flex-direction: row;
|
|
335
344
|
gap: ${e=>e.theme.space.xs}px;
|
|
336
345
|
align-items: center;
|
|
337
|
-
`),
|
|
346
|
+
`),mi=({uniqid:e,dropdown:t,subHeader:i})=>{const s=(0,l.useTheme)(),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),fe.shallowEqual),r=(0,o.useMemo)(()=>({color:a&&a.color?String(a.color):s.color.black,backgroundColor:a&&a["background-color"]?String(a["background-color"]):"transparent",fontSize:a&&a["font-size"]?String(a["font-size"]):"16",fontWeight:a&&a["font-weight"]?String(a["font-weight"]):"medium",textAlign:a&&a["text-align"]?String(a["text-align"]):"left"}),[a,s]);return(0,n.jsx)(ci,{backroundColor:r.backgroundColor,children:(0,n.jsxs)(ui,{children:[(0,n.jsxs)(gi,{children:[(0,n.jsx)(di,{uniqid:e,fontWeight:r.fontWeight,fontSize:r.fontSize,textAlign:r.textAlign,color:r.color}),i&&i(r.color)]}),t&&t()]})})},pi=s().div`
|
|
338
347
|
flex-direction: column;
|
|
339
348
|
display: flex;
|
|
340
349
|
flex: 1;
|
|
341
|
-
`,
|
|
350
|
+
`,xi=s().div`
|
|
342
351
|
position: relative;
|
|
343
352
|
display: flex;
|
|
344
353
|
flex: 1;
|
|
345
|
-
`,
|
|
354
|
+
`,hi=s().div`
|
|
346
355
|
overflow: auto;
|
|
347
356
|
position: absolute;
|
|
348
357
|
inset: 0;
|
|
349
|
-
`,
|
|
358
|
+
`,fi=({header:e,scrollable:t,footer:i})=>(0,n.jsxs)(pi,{children:[e&&e(),(0,n.jsx)(xi,{children:(0,n.jsx)(hi,{children:t&&t()})}),i&&i()]}),ji=s().div`
|
|
350
359
|
display: flex;
|
|
351
360
|
flex-direction: column;
|
|
352
|
-
`,
|
|
361
|
+
`,yi=({uniqid:e,children:t})=>{const i=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),fe.shallowEqual),l=(0,o.useMemo)(()=>({padding:i&&i.padding?`${i.padding}px`:"0px"}),[i]);return(0,n.jsx)(ji,{style:{padding:l.padding},children:t})},bi=s().div`
|
|
353
362
|
position: absolute;
|
|
354
363
|
inset: 0;
|
|
355
364
|
display: flex;
|
|
356
365
|
justify-content: center;
|
|
357
366
|
align-items: center;
|
|
358
|
-
`,
|
|
367
|
+
`,Ci=u.j.getLazyComponent("WidgetLuccaAbsence"),vi=u.j.getLazyComponent("Loader"),wi=({uniqid:e})=>{const[t,i]=(0,o.useState)([]),[l,s]=(0,o.useState)(!1),[r,d]=(0,o.useState)(!0),c=(0,O.Ie)(),u=(0,o.useMemo)(()=>(new Date).getFullYear()+"-"+((new Date).getMonth()+1).toString().padStart(2,"0")+"-"+(new Date).getDate().toString().padStart(2,"0")+" 00:00:00",[]);return(0,o.useEffect)(()=>{k().lucca.getAbsence({date:u},{signal:c.signal}).then(({result:e})=>i(e)).catch(()=>{c.signal.aborted||s(!0)}).finally(()=>d(!1))},[u,c.signal]),r?(0,n.jsx)(bi,{children:(0,n.jsx)(vi,{size:"m"})}):l?(0,n.jsx)(bi,{children:(0,n.jsx)(a.FormattedMessage,{id:"WIDGET_Lucca_Absence_Url_Error"})}):(0,n.jsx)(fi,{header:()=>(0,n.jsx)(mi,{uniqid:e}),scrollable:()=>(0,n.jsx)(yi,{uniqid:e,children:(0,n.jsx)(Ci,{list:t})})})},Li=u.j.getLazyComponent("WidgetImage"),Ei=u.j.getLazyComponent("FileViewer"),ki=u.j.getLazyComponent("WidgetEmptyInplace"),_i=s().div`
|
|
359
368
|
position: absolute;
|
|
360
369
|
inset: 0;
|
|
361
370
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -368,16 +377,16 @@
|
|
|
368
377
|
&:hover {
|
|
369
378
|
opacity: 1;
|
|
370
379
|
}
|
|
371
|
-
`,
|
|
380
|
+
`,Wi=s().button`
|
|
372
381
|
cursor: pointer;
|
|
373
|
-
`,
|
|
382
|
+
`,Si={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},qi=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Mi=({widget:e,width:t,inplace:i,mode:l})=>{const{uniqid:s}=e,{file:r,useFilter:u}=e.content,g=(0,c.jL)(),m=(0,c.GV)(e=>d.x0.selectors.isActive(e,s),fe.shallowEqual),[p,x]=(0,o.useState)(void 0),h=(0,a.useIntl)();return(0,o.useEffect)(()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,mounted:!0}))},[]),(0,o.useEffect)(()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,empty:!r}))},[r]),(0,o.useEffect)(()=>{r&&x((0,E.formatImgUrl)({timestamp:r.dateModified?qi(r.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:r.uri}))},[r]),(0,n.jsxs)(n.Fragment,{children:["edit"!==l&&(0,n.jsx)(Ei,{files:[{...Si,...r,path:p,mimetype:"image/png"}],openWithOptions:[],children:e=>(0,n.jsx)(Wi,{onClick:()=>e(r?.id??0),children:(0,n.jsx)(Li,{maxWidth:t??600,uri:p,useFilter:u??!1})})}),"edit"===l&&(0,n.jsxs)(n.Fragment,{children:[void 0!==p&&(0,n.jsx)(Li,{maxWidth:t??600,uri:p,useFilter:u??!1}),i&&(0,n.jsx)(Pt,{initialFiles:[],initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&g((0,d.vR)(s,{file:e[0]}))},onUploadStart:()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,loading:!0}))},onUploadEnd:()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,loading:!1}))},children:void 0!==r?(0,n.jsx)(_i,{children:h.formatMessage({id:"ARTICLE_Widget_Image_Change"})}):(0,n.jsx)(ki,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})})]})]})},Ai=u.j.getLazyComponent("FileViewer"),Ti=u.j.getLazyComponent("WidgetEmptyInplace"),Ii=u.j.getLazyComponent("WidgetSlider"),zi=s().div`
|
|
374
383
|
flex: 1;
|
|
375
384
|
display: flex;
|
|
376
385
|
flex-direction: row;
|
|
377
386
|
min-height: 60px;
|
|
378
387
|
align-items: center;
|
|
379
388
|
width: ${e=>e.maxWidth}px;
|
|
380
|
-
`,
|
|
389
|
+
`,Gi={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Di=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Vi=({widget:e,mode:t,width:i})=>{const{uniqid:l}=e,s=(0,c.jL)(),a=(0,c.GV)(e=>d.x0.selectors.isActive(e,l),fe.shallowEqual),r=i??600,[u,g]=(0,o.useState)(void 0),m=(0,o.useRef)(null),p=(0,o.useMemo)(()=>e.content.slides?[...e.content.slides.map((e,t)=>({...Gi,id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Gi.mimetype,path:e.file&&e.file.uri?(0,E.formatImgUrl)({size:"fitx1200",uri:e.file.uri,from:"imagecache",timestamp:e.file&&e.file.dateModified?Di(e.file.dateModified):Date.now()}):""}))]:[],[e.content.slides]),x=(0,o.useMemo)(()=>void 0!==e.content.slides?[...e.content.slides.map(e=>e.file?{...e,uri:(0,E.formatImgUrl)({timestamp:e.file.dateModified?Di(e.file.dateModified):Date.now(),size:`fitx${u&&u<r?u:r}`,from:"imagecache",uri:e.file.uri})}:{...e,uri:""})]:[],[e.content.slides,u,r]);(0,o.useEffect)(()=>{a&&"edit"===t&&s(d.cr.slice.actions.registerEditor({uniqid:l,name:e.name}))},[a]),(0,o.useEffect)(()=>{const e=()=>{m.current&&g(m.current?m.current.offsetWidth:r)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[m]),(0,o.useEffect)(()=>{g(m.current?m.current.offsetWidth:r)},[m]),(0,o.useEffect)(()=>{s(d.x0.slice.actions.setWidgetState({uniqid:l,empty:!e.content.slides||0===e.content.slides.length}))},[e.content.slides]);const h=(0,o.useMemo)(()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length,[e.content.slides,t]),f=(0,o.useCallback)(()=>{s(d.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))},[s,e.uniqid,e.name]);return void 0===u?(0,n.jsx)("div",{ref:m,style:{width:"100%"}}):(0,n.jsxs)(zi,{maxWidth:u&&u<r?u:r,children:[(0,n.jsx)(Ai,{files:p,openWithOptions:[],children:i=>(0,n.jsx)(Ii,{slides:x,maxWidth:u&&u<r?u:r,useDots:e.content.useDots??!0,loop:e.content.loop??!1,startAt:0,onClickSlide:n=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[n];t&&t.file&&i(t.file.id)}}else s(d.cr.slice.actions.registerEditor({uniqid:l,name:e.name}))}})}),h?(0,n.jsx)(Ti,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:f}):(0,n.jsx)(n.Fragment,{})]})};var $i=i(850);const Fi=u.j.getLazyComponent("InputTextareaRaw"),Ri=u.j.getLazyComponent("Modal"),Oi=({onInsert:e,open:t,close:i})=>{const l=(0,a.useIntl)(),[s,r]=(0,o.useState)(""),d=(0,o.useCallback)(()=>{r(""),i()},[i]);return(0,n.jsx)(Ri,{title:l.formatMessage({id:"TINY_MCE_Insert_Markdown"}),open:t,closeHandler:d,enableClickAwayCloseModal:!0,buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:d},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Insert"}),color:"valid",disabled:!s,clickHandler:()=>{e($i.xI.parse(s,{async:!1}).replace(/<br>/g,"<br><br>")),d()}}],children:(0,n.jsx)(Fi,{value:s,onChange:e=>r(e.target.value),height:"400px"})})},Bi=u.j.getLazyComponent("WidgetArticleText"),Hi=s().div`
|
|
381
390
|
width: 100%;
|
|
382
391
|
cursor: text;
|
|
383
392
|
|
|
@@ -388,20 +397,20 @@
|
|
|
388
397
|
a {
|
|
389
398
|
word-wrap: break-word;
|
|
390
399
|
}
|
|
391
|
-
`,
|
|
400
|
+
`,Ui=({widget:e,mode:t})=>{const{uniqid:i}=e,s=(0,l.useTheme)(),{text:r}=e.content,u=(0,c.jL)(),g=(0,c.GV)(e=>d.x0.selectors.isActive(e,i),fe.shallowEqual),m=(0,c.GV)(e=>d.x0.selectors.selectWidgetState(e,i)?.busy),p=(0,c.GV)(d.x0.selectors.selectToken),x=(0,c.GV)(d.sU.selectors.selectTinyMCECommonOptions),h=(0,c.GV)(d.Kx.selectors.selectAll),f=(0,a.useIntl)(),{open:j,onInsert:y,close:b,ext:C,isActive:v}=Rt(),w=(0,o.useCallback)(e=>{u(d.y8.actions.error({label:e??f.formatMessage({id:"GLOBAL_Error"})}))},[u,f]);(0,o.useEffect)(()=>{u(d.x0.slice.actions.setWidgetState({uniqid:i,empty:!r||0===r.length}))},[r]);const L=(0,o.useMemo)(()=>(0,Ot.X)(h,s,w),[h,w,s]);return m?(0,n.jsx)(n.Fragment,{}):(0,n.jsxs)(Hi,{children:[(0,n.jsx)(Bi,{autoFocus:g,text:r??"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&x?{commonOptions:x,mentionsQueries:L}:void 0,mode:t,onChange:e=>{u((0,d.vR)(i,{text:e}))},additionalExtensions:[C]}),v&&(0,n.jsx)(Oi,{onInsert:y,open:j,close:b})]})},Pi=u.j.getLazyComponent("WidgetArticleTitle"),Ni=s().div`
|
|
392
401
|
flex: 1;
|
|
393
402
|
display: flex;
|
|
394
403
|
flex-direction: row;
|
|
395
404
|
align-items: center;
|
|
396
405
|
cursor: text;
|
|
397
|
-
`,
|
|
406
|
+
`,Yi=s().div`
|
|
398
407
|
display: flex;
|
|
399
408
|
flex-direction: row;
|
|
400
409
|
border-radius: 8px;
|
|
401
410
|
overflow: hidden;
|
|
402
411
|
margin: 4px;
|
|
403
412
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
404
|
-
`,
|
|
413
|
+
`,Ji=s().button`
|
|
405
414
|
display: flex;
|
|
406
415
|
width: 40px;
|
|
407
416
|
height: 40px;
|
|
@@ -413,18 +422,18 @@
|
|
|
413
422
|
&:hover {
|
|
414
423
|
background-color: ${e=>e.theme.color.grey1};
|
|
415
424
|
}
|
|
416
|
-
`,
|
|
425
|
+
`,Qi=({widget:e,inplace:t,mode:i,dataCy:l})=>{const{uniqid:s}=e,{text:a,color:r,heading:u}=e.content,g=(0,c.jL)(),m=(0,c.GV)(e=>d.x0.selectors.isActive(e,s),fe.shallowEqual);return(0,o.useEffect)(()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,empty:!a||0===a.length}))},[a]),(0,n.jsxs)(Ni,{children:[(0,n.jsx)(Pi,{dataCy:l,text:a,color:r,heading:u,autoFocus:m,inplace:t,mode:i,onChange:e=>{g((0,d.vR)(s,{text:e}))}}),m&&"edit"===i?(0,n.jsx)(Ki,{heading:u,onClick:e=>{g((0,d.vR)(s,{heading:e}))}}):(0,n.jsx)(n.Fragment,{})]})},Ki=({heading:e="h1",onClick:t})=>(0,n.jsx)(Yi,{children:["h1","h2","h3","h4"].map((i,o)=>(0,n.jsx)(Ji,{isActive:e===i,onClick:()=>t(i),children:i},o))});var Xi=i(554);const Zi=u.j.getLazyComponent("Button"),en=u.j.getLazyComponent("ModalLayout"),tn=u.j.getLazyComponent("ModalContent"),nn=u.j.getLazyComponent("IconButton"),on=(s().button`
|
|
417
426
|
padding: ${e=>e.theme.space.md}px;
|
|
418
427
|
`,s().div`
|
|
419
428
|
padding: ${e=>e.theme.space.md}px;
|
|
420
429
|
display: flex;
|
|
421
430
|
flex-direction: row-reverse;
|
|
422
|
-
`),
|
|
431
|
+
`),ln=({id:e,type:t,uniqid:i})=>{const l=(0,c.jL)(),s=(0,a.useIntl)(),[r,u]=(0,o.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nn,{iconSize:14,onClick:()=>u(!0),icon:"icon-trash"}),r&&(0,n.jsxs)(en,{enableClickAwayCloseModal:!0,open:r,closeHandler:()=>u(!1),children:[(0,n.jsx)(tn,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,n.jsx)(on,{children:(0,n.jsx)(Zi,{label:s.formatMessage({id:"GLOBAL_Confirm"}),onClick:()=>{k().widget.removeWidget({id:e,type:t,uniqid:i}).then(()=>{l(d.x0.slice.actions.flushWidget({uniqid:i}))}).catch(()=>l(d.y8.actions.error({label:"WIDGET_Presence_Error"})))}})})]})]})},sn=s().div`
|
|
423
432
|
display: flex;
|
|
424
433
|
flex: 1;
|
|
425
434
|
flex-direction: row;
|
|
426
435
|
border-top: 1px solid ${e=>e.theme.color.grey1};
|
|
427
|
-
`,
|
|
436
|
+
`,an=s().button`
|
|
428
437
|
display: flex;
|
|
429
438
|
flex: 1;
|
|
430
439
|
justify-content: center;
|
|
@@ -433,21 +442,21 @@
|
|
|
433
442
|
&:hover {
|
|
434
443
|
background-color: ${e=>e.theme.color.grey0};
|
|
435
444
|
}
|
|
436
|
-
`,
|
|
445
|
+
`,rn=({name:e,uniqid:t,mode:i,collaborationRights:l,handleOpenEditor:s})=>{const r=(0,a.useIntl)(),u=(0,c.jL)(),g=(0,c.GV)(e=>d.x0.selectors.selectWidgetObject(e,t),fe.shallowEqual),m=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,t),fe.shallowEqual),p=(0,o.useMemo)(()=>g&&m&&m.update||l&&l.update,[g,m,l]),x=(0,o.useMemo)(()=>g&&m&&m.delete,[g,m]),h=(0,o.useCallback)(()=>{u(d.cr.slice.actions.registerEditor({uniqid:t,name:e,mode:i}))},[t,u,e,i]);return p&&(0,E.ensureWidgetObjectHasMinimumProperties)(g)?(0,n.jsxs)(sn,{children:[(0,n.jsx)(an,{onClick:s??h,children:r.formatMessage({id:"WIDGET_Set_Widget"})}),x&&(0,n.jsx)(ln,{id:g.id,type:g.type,uniqid:t})]}):(0,n.jsx)(n.Fragment,{})},dn=u.j.getLazyComponent("Button"),cn=u.j.getLazyComponent("InputText"),un=s().div`
|
|
437
446
|
padding: ${e=>e.theme.space.md}px;
|
|
438
447
|
display: flex;
|
|
439
448
|
flex-direction: row;
|
|
440
449
|
fieldset {
|
|
441
450
|
margin: 0.2rem !important;
|
|
442
451
|
}
|
|
443
|
-
`,
|
|
452
|
+
`,gn=({placeholder:e,handleClick:t})=>{const i=(0,a.useIntl)(),l=(0,c.jL)(),[s,r]=(0,o.useState)(""),{control:d,watch:u,reset:g}=(0,I.useForm)({defaultValues:{label:s},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=u(e=>{r(e.label??"")});return()=>e.unsubscribe()},[u,l]),(0,n.jsxs)(un,{children:[(0,n.jsx)(cn,{name:"label",control:d,placeholder:e,width:"100%"}),(0,n.jsx)(dn,{label:i.formatMessage({id:"GLOBAL_Confirm"}),disabled:!s.length,onClick:()=>{t(s),r(""),g()}})]})},mn=u.j.getLazyComponent("Loader"),pn=s().div`
|
|
444
453
|
position: absolute;
|
|
445
454
|
inset: 0;
|
|
446
455
|
display: flex;
|
|
447
456
|
justify-content: center;
|
|
448
457
|
align-items: center;
|
|
449
458
|
background-color: rgba(255, 255, 255, 0.4);
|
|
450
|
-
`,
|
|
459
|
+
`,xn=()=>(0,n.jsx)(pn,{children:(0,n.jsx)(mn,{size:"m"})}),hn=u.j.getLazyComponent("WidgetCheckList"),fn=u.j.getLazyComponent("WidgetCheckListEditor"),jn=u.j.getLazyComponent("FileViewer"),yn=(s().div`
|
|
451
460
|
display: flex;
|
|
452
461
|
flex-direction: row;
|
|
453
462
|
justify-content: space-between;
|
|
@@ -461,9 +470,9 @@
|
|
|
461
470
|
display: flex;
|
|
462
471
|
gap: 14px;
|
|
463
472
|
padding: 16px;
|
|
464
|
-
`),
|
|
473
|
+
`),bn=s().div`
|
|
465
474
|
position: relative;
|
|
466
|
-
`,
|
|
475
|
+
`,Cn=({widget:e,inplace:t,mode:i,onWidgetUpdate:l})=>{const s=(0,a.useIntl)(),{uniqid:u,content:g}=e,m=(0,c.jL)(),[p,x]=(0,o.useState)(),[h,f]=(0,o.useState)(!1),[j,y]=(0,o.useState)(),[b,C]=(0,o.useState)(!1),v=(0,c.GV)(d.x0.selectors.selectToken,fe.shallowEqual),w=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e.uniqid),fe.shallowEqual),L=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,u),fe.shallowEqual),_=(0,c.GV)(t=>d.x0.selectors.selectAllWidgetRTObject(t,e.uniqid),fe.shallowEqual),W=(0,o.useMemo)(()=>L&&L.update,[L]),S=(0,o.useMemo)(()=>L&&L.administrate,[L]),q=(0,o.useCallback)(e=>{m(d.y8.actions.error({label:e??s.formatMessage({id:"GLOBAL_Error"})}))},[m,s]),M=(0,o.useCallback)(()=>{p||h||(f(!0),k().network.token().then(e=>{x(e.result),f(!1),m(d.x0.slice.actions.setToken({token:e.result}))}).catch(e=>{q(e.errorMsg)}))},[q,p,h,m]);v?p||x(v):M();const A=(0,o.useCallback)((e,t)=>{m((0,d.vR)(e,t))},[m]),T=(0,o.useCallback)(()=>{w&&(C(!0),k().widget.getWidget({uri:w,uniqid:u}).then(e=>{(0,E.ensureWidgetCheckListType)(e.result)&&A(u,e.result.content)}).catch(e=>!e.aborted&&q).finally(()=>C(!1)))},[u,q,w,A]),I=t=>{m(d.cr.slice.actions.flushAllEditor()),m(d.x0.slice.actions.setToken({token:t})),m(d.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:E.WidgetsName.CheckList,mode:i}))};(0,o.useEffect)(()=>{p||"edit"!==i||k().network.token().then(e=>{m(d.x0.slice.actions.setToken({token:e.result}))})},[i,p,m]),(0,o.useEffect)(()=>{const t=e.content.arr?.map(e=>({text:e.title??"",file:e.file??void 0,checked:e.value??!1,...e.links&&{links:e.links},...e.user&&{user:e.user??void 0},...e.id&&{id:e.id,mimetype:"image/png"}}));y(t)},[e.content.arr,g]),(0,o.useEffect)(()=>{if(!Array.isArray(_))return;const t=_.at(-1);t&&w&&t.object.uri===w&&t.uniqid===e.uniqid&&("check-list-response"!==t.fn&&"widget-update"!==t.fn||T())},[_,e.uniqid,w,q,m,T]);const z=t=>{if(!e.content.arr||!w)return;const i={...e.content,arr:[...e.content.arr,{title:t,value:!1}]};k().widget.updateWidget({uri:w,uniqid:e.uniqid,content:i,v2:!0}).then(()=>A(e.uniqid,i)).catch(e=>q(e.errorMsg))},G=(0,o.useMemo)(()=>{if(!Array.isArray(g.arr))return[];const e=[];return g.arr.forEach(t=>{t.file&&e.push(t.file)}),e},[g]);return"edit"===i&&t?(0,n.jsx)(yn,{children:(0,n.jsx)(fn,{token:p,uniqid:u,content:{...g,arr:g.arr?.map(e=>({...e,title:r.Utils.html.htmlDecodeSpecialChars(e.title)}))},inplace:t,onChangeContent:A,onChangeWrapper:e=>{m(d.x0.slice.actions.updateWidgetWrapper({...e}))},handleChange:t=>m((0,d.vR)(e.uniqid,t))})}):(0,n.jsx)(Xi.M,{useRT:()=>{(0,Bt.AW)(e.uniqid)},children:j&&(0,n.jsx)(jn,{files:G,openWithOptions:[],children:t=>(0,n.jsxs)(bn,{children:[(0,n.jsx)(hn,{limit:10,initialEntries:j,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{w&&(b||(C(!0),k().widget.checkListRespond({uri:w,uniqid:e,index:t}).then(()=>{l&&l()}).catch(e=>{q(e.message),C(!1)})))})(e.uniqid,t)}),g.edit&&(0,n.jsx)(gn,{handleClick:z,placeholder:s.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),S&&p&&(0,n.jsx)(rn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!W)},mode:i,handleOpenEditor:()=>{p?I(p):(C(!0),k().network.token().then(e=>{m(d.x0.slice.actions.setToken({token:e.result})),I(e.result)}).finally(()=>C(!1)))}}),b&&(0,n.jsx)(xn,{})]},e.uniqid)})})},vn=(e,t)=>{const i=[];return e.filter(e=>e.isVisible).forEach(e=>{const n=t.find(t=>t.name===e.name);n&&i.push(n)}),i},wn=u.j.getLazyComponent("Button"),Ln=u.j.getLazyComponent("WidgetTable"),En=u.j.getLazyComponent("Loader"),kn=(s().div``,s().div`
|
|
467
476
|
position: absolute;
|
|
468
477
|
inset: 0;
|
|
469
478
|
display: flex;
|
|
@@ -471,7 +480,7 @@
|
|
|
471
480
|
justify-content: center;
|
|
472
481
|
align-items: center;
|
|
473
482
|
gap: ${e=>e.theme.space.md}px;
|
|
474
|
-
`),
|
|
483
|
+
`),_n=({uri:e,limit:t,tableHeadColor:i,tableHeadTextColor:l,tableHeadIconColor:s,tableRowColor:r,tableRowTextColor:u,tableColumnsData:g=[],tableBorderRadius:m,tableSizedColumns:p,tableSizedColumnsWidth:x,mode:h})=>{const f=(0,c.jL)(),[j,y]=(0,o.useState)(!1),[b,C]=(0,o.useState)([]),[v,w]=(0,o.useState)([]),[L,_]=(0,o.useState)({order:"ascending",name:"unknown"}),[W,S]=(0,o.useState)(void 0),[q,M]=(0,o.useState)(""),A=(0,o.useMemo)(()=>d.x0.definition(E.WidgetsName.DatasourceTable),[]),T=(0,o.useMemo)(()=>"studio"===W?[{type:[q]}]:[],[W,q]),I=(0,o.useMemo)(()=>"doc"===W?[q]:[],[W,q]),{rtLastObject:z}=(0,Bt.YL)(T,I),G=(0,o.useCallback)(()=>{e&&(y(!0),k().datasource.get(e,E.Format.VIEW).then(e=>{w(e.result.model),C(e.result.data),_(e.result.sort),S(e.result.datasource.datasourceType),M(e.result.datasource.datasourceIdentifier)}).finally(()=>y(!1)))},[e]);(0,o.useEffect)(()=>{void 0!==e&&0!==g.length&&0===v.length&&G()},[e,g,v,G]),(0,o.useEffect)(()=>{z&&G()},[z,G]),(0,o.useEffect)(()=>{e||w([])},[e]),(0,o.useEffect)(()=>{"view"!==h&&"preview"!==h||f(d.cr.slice.actions.flushAllEditor())},[h,f]);const D=(0,o.useMemo)(()=>vn(g,v),[g,v]);return 0!==g.length||j||"edit"!==h?j?(0,n.jsx)(kn,{children:(0,n.jsx)(En,{})}):(0,n.jsx)(n.Fragment,{children:j||0!==b.length||"edit"===h?(0,n.jsx)(Ln,{rows:b,columns:D,limit:t,tableHeadColor:i,tableHeadTextColor:l,tableHeadIconColor:s,tableRowColor:r,tableRowTextColor:u,tableBorderRadius:m,tableColumnsData:g,tableSizedColumns:p,tableSizedColumnsWidth:x,tableDefaultSortOrder:L.order,tableDefaultSortName:L.name}):(0,n.jsxs)(kn,{children:[(0,n.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.DatasourceTable}.png`,alt:""}),(0,n.jsx)(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(kn,{children:[(0,n.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.DatasourceTable}.png`,alt:""}),(0,n.jsx)(a.FormattedMessage,{id:A.label}),(0,n.jsx)(wn,{label:"GLOBAL_Settings"})]})})},Wn=u.j.getLazyComponent("Button"),Sn=u.j.getLazyComponent("WidgetTable"),qn=u.j.getLazyComponent("Loader"),Mn=(s().div``,s().div`
|
|
475
484
|
position: absolute;
|
|
476
485
|
inset: 0;
|
|
477
486
|
display: flex;
|
|
@@ -479,21 +488,21 @@
|
|
|
479
488
|
justify-content: center;
|
|
480
489
|
align-items: center;
|
|
481
490
|
gap: ${e=>e.theme.space.md}px;
|
|
482
|
-
`),
|
|
491
|
+
`),An=({uri:e,limit:t,tableHeadColor:i,tableHeadTextColor:l,tableHeadIconColor:s,tableRowColor:r,tableRowTextColor:u,tableColumnsData:g=[],tableBorderRadius:m,tableSizedColumns:p,tableSizedColumnsWidth:x,mode:h})=>{const f=(0,c.jL)(),[j,y]=(0,o.useState)(!1),[b,C]=(0,o.useState)([]),[v,w]=(0,o.useState)([]),L=(0,o.useMemo)(()=>d.x0.definition(E.WidgetsName.ExcelDatasourceTable),[]);(0,o.useEffect)(()=>{void 0!==e&&0!==g.length&&0===v.length&&(y(!0),k().datasource.get(e,E.Format.VIEW).then(e=>{w(e.result.model),C(e.result.data)}).finally(()=>y(!1)))},[e,g,v]),(0,o.useEffect)(()=>{e||w([])},[e]),(0,o.useEffect)(()=>{"view"!==h&&"preview"!==h||f(d.cr.slice.actions.flushAllEditor())},[h,f]);const _=(0,o.useMemo)(()=>vn(g,v),[g,v]);return 0!==g.length||j||"edit"!==h?j?(0,n.jsx)(Mn,{children:(0,n.jsx)(qn,{})}):(0,n.jsx)(n.Fragment,{children:j||0!==b.length||"edit"===h?(0,n.jsx)(Sn,{rows:b,columns:_,limit:t,tableHeadColor:i,tableHeadTextColor:l,tableHeadIconColor:s,tableRowColor:r,tableRowTextColor:u,tableBorderRadius:m,tableColumnsData:g,tableSizedColumns:p,tableSizedColumnsWidth:x}):(0,n.jsxs)(Mn,{children:[(0,n.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),(0,n.jsx)(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Mn,{children:[(0,n.jsx)("img",{src:`/img/fast-intranet/${E.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),(0,n.jsx)(a.FormattedMessage,{id:L.label}),(0,n.jsx)(Wn,{label:"GLOBAL_Settings"})]})})},Tn=s().div`
|
|
483
492
|
padding: ${e=>e.theme.space.md}px;
|
|
484
|
-
`,
|
|
493
|
+
`,In=s().a`
|
|
485
494
|
cursor: pointer;
|
|
486
495
|
color: ${e=>e.theme.color.secondary};
|
|
487
|
-
`,
|
|
496
|
+
`,zn=s().div`
|
|
488
497
|
display: flex;
|
|
489
498
|
justify-content: center;
|
|
490
499
|
align-items: center;
|
|
491
|
-
`,
|
|
500
|
+
`,Gn=({mode:e,uniqid:t,content:i})=>{const l=(0,a.useIntl)(),s=(0,c.jL)(),r=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectUri(e,t),fe.shallowEqual),u=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,t),fe.shallowEqual),g=(0,o.useMemo)(()=>!(!u||!u.update),[u]),m=(0,o.useCallback)(()=>{if("edit"===e||!g||!r)return;const n={...i,isClosed:!0};k().widget.updateWidget({uri:r,uniqid:t,content:n,v2:!0}).then(()=>s(d.x0.slice.actions.updateWidget({uniqid:t,content:n}))).catch(()=>s(d.y8.actions.error({label:"WIDGET_Presence_Error"})))},[e,t,g,r,i,s]);return(0,n.jsx)(n.Fragment,{children:g&&!i.isClosed&&(0,n.jsx)(Tn,{children:(0,n.jsx)(zn,{children:(0,n.jsx)(In,{onClick:m,children:l.formatMessage({id:"WIDGET_Presence_Closing"})})})})})},Dn=u.j.getLazyComponent("WidgetPresence"),Vn=u.j.getLazyComponent("ModalUserList"),$n=s().div`
|
|
492
501
|
display: flex;
|
|
493
502
|
flex: 1;
|
|
494
503
|
position: relative;
|
|
495
504
|
flex-direction: column;
|
|
496
|
-
`,
|
|
505
|
+
`,Fn=(s().div`
|
|
497
506
|
position: absolute;
|
|
498
507
|
inset: 0;
|
|
499
508
|
background-color: rgba(255, 255, 255, 0.7);
|
|
@@ -510,24 +519,24 @@
|
|
|
510
519
|
align-items: center;
|
|
511
520
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
512
521
|
margin: ${e=>e.theme.space.sm}px;
|
|
513
|
-
`),
|
|
522
|
+
`),Rn=({widget:e,mode:t})=>{const i=(0,a.useIntl)(),l=(0,c.jL)(),{limit:s,limitValue:r,closing:u,isClosed:g}=e.content,{uniqid:m}=e,[p,x]=(0,o.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[h,f]=(0,o.useState)(!1),[j]=(0,o.useState)(new AbortController),[y,b]=(0,o.useState)(!1),[C,v]=(0,o.useState)(),[w,L]=(0,o.useState)(),E=(0,o.useRef)(j),_=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectUri(e,m),fe.shallowEqual),W=(0,c.GV)(e=>d.x0.selectors.selectAllWidgetRTObject(e,m),fe.shallowEqual),S=(0,o.useCallback)(()=>l(d.y8.actions.error({label:"WIDGET_Presence_Error"})),[l]),q=(0,o.useMemo)(()=>!(s&&r&&p.userAvailableTotal>=r),[s,r,p.userAvailableTotal]),M=(0,o.useMemo)(()=>u&&g||"edit"===t,[u,g,t]),A=(0,o.useCallback)(()=>{_&&!M&&(q?(f(!0),k().widget.presenceCancel({uri:_,uniqid:m}).catch(S).finally(()=>f(!1))):l(d.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))},[l,m,S,_,q,M]),T=(0,o.useCallback)(e=>{_&&!M&&(f(!0),k().widget.presenceRespond({uri:_,uniqid:m,value:e},E.current.signal).catch(S).finally(()=>f(!1)))},[_,m,S,M]),I=(0,o.useCallback)(()=>{"edit"!==t&&_&&(f(!0),k().widget.presenceGetResponse({uri:_,uniqid:m},E.current.signal).then(e=>{x(e.result)}).catch(e=>!e.aborted&&S()).finally(()=>f(!1)))},[_,S,m,t]),z=(e,t)=>{_&&k().widget.presenceGetResponseUserList({uri:_,uniqid:m,index:e,page:t,limit:8},E.current.signal).then(e=>{L({...e.result,data:[...e.result.data],cnt:e.result.cnt})}).catch(e=>!e.aborted&&S)},G=(0,o.useCallback)(()=>{_&&(f(!0),k().widget.getWidget({uri:_,uniqid:m}).then(e=>{l((0,d.vR)(m,e.result))}).catch(e=>!e.aborted&&S).finally(()=>f(!1)))},[l,S,_,m]);return(0,o.useEffect)(()=>{const e=E.current;return()=>{e.abort()}},[]),(0,o.useEffect)(()=>{I()},[I]),(0,o.useEffect)(()=>{if(!Array.isArray(W))return;const e=W.at(-1);e&&_&&e.object.uri===_&&e.uniqid===m&&("widget-presence-response"===e.fn&&I(),"widget-update"===e.fn&&G())},[W,I,m,_,G]),(0,n.jsx)(Xi.M,{useRT:()=>{(0,Bt.AW)(e.uniqid)},children:(0,n.jsxs)($n,{children:[(0,n.jsx)(Dn,{limit:s,limitValue:r,userAvailableList:p.userAvailableList,userUnavailableList:p.userUnavailableList,userValue:p.userValue,userAvailableTotal:p?.userAvailableTotal,userUnavailableTotal:p?.userUnavailableTotal,isClosed:u&&g,handleClickAvailable:()=>1===p.userValue?A():T(1),handleClickUnavailable:()=>0===p.userValue?A():T(0),handleOpenUsersModal:e=>{L({limit:0,page:0,data:[],cnt:0}),v(e),z(e),b(!0)}}),u&&g&&(0,n.jsx)(Fn,{children:i.formatMessage({id:"WIDGET_Presence_Is_Closed"})}),u&&!g&&(0,n.jsx)(Gn,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&(0,n.jsx)(rn,{uniqid:e.uniqid,name:e.name,mode:t}),h&&(0,n.jsx)(xn,{}),(0,n.jsx)(Vn,{open:y,usersList:w,title:1===C?i.formatMessage({id:"WIDGET_Presence_On"}):i.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:b,onClose:()=>{L({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{z(C??0,e)}})]})})},On=u.j.getLazyComponent("WidgetQuickSurvey"),Bn=u.j.getLazyComponent("WidgetQuickSurveyEditor"),Hn=u.j.getLazyComponent("ModalUserList"),Un=u.j.getLazyComponent("FileViewer"),Pn=s().div`
|
|
514
523
|
width: 100%;
|
|
515
524
|
display: flex;
|
|
516
525
|
flex-direction: column;
|
|
517
526
|
gap: 14px;
|
|
518
527
|
${e=>e.withPadding&&"padding: 0 12px;"}
|
|
519
528
|
padding-top: 16px;
|
|
520
|
-
`,
|
|
529
|
+
`,Nn=({widget:e,inplace:t,mode:i})=>{const l=(0,a.useIntl)(),s=(0,c.jL)(),{uniqid:r,content:u}=e,[g,m]=(0,o.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[p,x]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),[j,y]=(0,o.useState)(),[b,C]=(0,o.useState)(),[v]=(0,o.useState)(new AbortController),w=(0,o.useRef)(v),L=(0,c.GV)(d.x0.selectors.selectToken,fe.shallowEqual),_=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e.uniqid),fe.shallowEqual),W=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,r),fe.shallowEqual),S=(0,c.GV)(t=>d.x0.selectors.selectAllWidgetRTObject(t,e.uniqid),fe.shallowEqual),q=(0,o.useCallback)((e,t)=>{s((0,d.vR)(e,t))},[s]),M=t=>{s(d.cr.slice.actions.flushAllEditor()),s(d.x0.slice.actions.setToken({token:t})),s(d.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:E.WidgetsName.QuickSurvey}))},A=(0,o.useCallback)(()=>s(d.y8.actions.error({label:"WIDGET_Presence_Error"})),[s]),T=(0,o.useCallback)(e=>{"edit"!==i&&_&&(f(!0),k().widget.quickSurveyGetResponse({uri:_,uniqid:e},w.current.signal).then(e=>{m(e.result)}).catch(e=>!e.aborted&&A).finally(()=>f(!1)))},[A,_,i]),I=(0,o.useCallback)(()=>{_&&(f(!0),k().widget.getWidget({uri:_,uniqid:r},w.current.signal).then(e=>{q(r,e.result.content)}).catch(e=>!e.aborted&&A).finally(()=>f(!1)))},[r,A,_,q]),z=()=>{if(_&&u.closing){const e={...u,isClosed:!0};k().widget.updateWidget({uri:_,uniqid:r,content:e}).catch(()=>{A()})}},G=t=>{(t=>{"edit"!==i&&_&&(f(!0),k().widget.quickSurveyRespond({uri:_,index:t,multi:u.multi?1:0,uniqid:r},w.current.signal).then(()=>{T(e.uniqid)}).catch(e=>!e.aborted&&A).finally(()=>f(!1)))})(t)},D=(e,t)=>{_&&k().widget.quickSurveyGetResponseUserList({uri:_,uniqid:r,index:e,page:t,limit:8},w.current.signal).then(e=>{C({...e.result,data:[...e.result.data],cnt:e.result.cnt})}).catch(e=>!e.aborted&&A)},V=(0,o.useMemo)(()=>W&&W.update,[W]);(0,o.useEffect)(()=>{T(e.uniqid)},[T,e.uniqid]),(0,o.useEffect)(()=>{if(!Array.isArray(S))return;const t=S.at(-1);t&&_&&t.object.uri===_&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&T(e.uniqid),"widget-update"===t.fn&&I())},[S,_,e.uniqid,I,T]);const $=(0,o.useMemo)(()=>{if(!Array.isArray(u.arr))return[];const e=[];return u.arr.forEach(t=>{t.file&&e.push(t.file)}),e},[u]);return(0,o.useEffect)(()=>{L||"edit"!==i||k().network.token().then(e=>{s(d.x0.slice.actions.setToken({token:e.result}))})},[i,L,s]),"edit"===i&&t?(0,n.jsx)(Pn,{withPadding:!0,children:(0,n.jsx)(Bn,{token:L,uniqid:r,content:e.content,onChangeContent:q,onChangeWrapper:e=>{s(d.x0.slice.actions.updateWidgetWrapper({...e}))},handleChange:e=>q(r,e),inplace:t})}):(0,n.jsx)(Xi.M,{useRT:()=>{(0,Bt.AW)(e.uniqid)},children:(0,n.jsxs)(Pn,{children:[(0,n.jsx)(Un,{files:$,openWithOptions:[],children:t=>(0,n.jsx)(On,{limit:g.totalResponse??0,values:u.arr??[],userResponses:g.userResponses,userHasAlreadyVoted:g.userLoggedResponses.length>0,canCloseSurvey:e.content.closing??!1,isClosed:e.content.isClosed??!1,open:e.content.open??!1,anonymize:e.content.anonymize??!1,seeResponseAfter:e.content.seeResponseAfter??!1,canUpdate:V,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:z,handleProgressBarClick:G,setOpenUsersModal:e=>{y(e),D(e),x(!0)}})}),u.open&&(0,n.jsx)(gn,{handleClick:e=>{if(!_)return;const t={...u,arr:[...u.arr??[],{title:e}]};k().widget.quickSurveyAddEnty({uri:_,uniqid:r,label:e}).then(()=>{s(d.x0.slice.actions.updateWidget({uniqid:r,content:t}))}).catch(A)},placeholder:l.formatMessage({id:"FIELDS_Add_Option"})}),V&&(0,n.jsx)(rn,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!V},mode:i,handleOpenEditor:()=>{L?M(L):(f(!0),k().network.token().then(e=>{s(d.x0.slice.actions.setToken({token:e.result})),M(e.result)}).finally(()=>f(!1)))}}),h&&(0,n.jsx)(xn,{}),(0,n.jsx)(Hn,{open:p,usersList:b,title:u.arr?.[j??0]?.title??"",setOpen:x,handleLoadUsersList:e=>{D(j??0,e)},onClose:()=>{C({limit:0,page:0,data:[],cnt:0})}})]})})},Yn=u.j.getLazyComponent("ModalLayout"),Jn=u.j.getLazyComponent("ModalContent"),Qn=u.j.getLazyComponent("Button"),Kn=u.j.getLazyComponent("InputText"),Xn=u.j.getLazyComponent("InputNumber"),Zn=u.j.getLazyComponent("InputSelectExtended"),eo=u.j.getLazyComponent("InputPassword"),to=u.j.getLazyComponent("Typography"),io=u.j.getLazyComponent("Loader"),no=s().div`
|
|
521
530
|
display: flex;
|
|
522
531
|
flex-direction: column;
|
|
523
532
|
opacity: ${e=>e.isLocked?".4":"1.0"};
|
|
524
|
-
`,
|
|
533
|
+
`,oo=s().div`
|
|
525
534
|
position: absolute;
|
|
526
535
|
inset: 0;
|
|
527
536
|
display: flex;
|
|
528
537
|
justify-content: center;
|
|
529
538
|
align-items: center;
|
|
530
|
-
`,
|
|
539
|
+
`,lo=s().div`
|
|
531
540
|
background-color: ${e=>e.theme.color.orange};
|
|
532
541
|
color: ${e=>e.theme.color.white};
|
|
533
542
|
padding: ${e=>e.theme.space.sm}px;
|
|
@@ -535,67 +544,67 @@
|
|
|
535
544
|
display: flex;
|
|
536
545
|
justify-content: center;
|
|
537
546
|
align-items: center;
|
|
538
|
-
`,
|
|
547
|
+
`,so=s().div`
|
|
539
548
|
margin-bottom: ${e=>e.theme.space.md}px;
|
|
540
|
-
`,
|
|
549
|
+
`,ao={username:"",password:"",hostname:"",imapPort:993,imapConnectionSecurity:E.ImapConnection.NONE,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},ro=()=>{const e=(0,a.useIntl)(),t=(0,c.jL)(),i=(0,r.useAbortController)(),[l,s]=(0,o.useState)(!1),[u,g]=(0,o.useState)(!1),{control:m,reset:p,setValue:x,getValues:h,watch:f,formState:{isValid:j}}=(0,I.useForm)({defaultValues:ao,criteriaMode:"all"}),[y,b]=(0,o.useState)([]),C=f(),v=[{label:"NONE",value:E.ImapConnection.NONE},{label:"SSL",value:E.ImapConnection.SSL},{label:"STARTTLS",value:E.ImapConnection.STARTTLS}],w=(0,o.useCallback)(e=>{k().office.getConfiguration().then(({result:t})=>{p({...t,provider:e.includes(t.provider??"")?t.provider:e[0]})})},[p]);(0,o.useEffect)(()=>{l&&(g(!0),k().office.getProviders({signal:i.signal}).then(({result:e})=>{i.signal.aborted||(b(e),w(e.map(e=>e.id)))}).catch(e=>{i.signal.aborted||t(d.y8.actions.error({label:e.errorMsg}))}).finally(()=>{g(!1)}))},[l,i.signal,t,w]),(0,o.useEffect)(()=>{1===y.length&&x("provider",y[0].id)},[y,x]);const L=()=>s(!1),_=(0,o.useMemo)(()=>y.length>1,[y]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(oo,{children:(0,n.jsx)(Qn,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>s(!0)})}),(0,n.jsx)(Yn,{open:l,radius:"small",closeHandler:L,children:(0,n.jsx)(Jn,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:L,children:u?(0,n.jsx)(io,{size:"s"}):(0,n.jsxs)(n.Fragment,{children:[0===y.length&&(0,n.jsx)(lo,{children:e.formatMessage({id:"Office_No_Providers"})}),(0,n.jsxs)(no,{isLocked:0===y.length,children:[_&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(so,{children:[(0,n.jsx)(to,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_Provider"})}),(0,n.jsx)(co,{label:"OfficeHook_Conf_Select_Provider",initialValue:{label:y[0].label,value:y[0].id},options:y.map(e=>({label:e.label,value:e.id})),handleChange:e=>{h("provider")!==e&&p(),x("provider",e)}})]})}),(0,n.jsxs)(so,{children:[(0,n.jsx)(to,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Settings"})}),(0,n.jsx)(Kn,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),(0,n.jsx)(Kn,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),(0,n.jsx)(eo,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}})]}),(0,n.jsxs)(so,{children:[(0,n.jsx)(to,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})}),(0,n.jsx)(Xn,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),(0,n.jsx)(co,{label:"OfficeHook_Conf_Select_Connection_Security",initialValue:v[0],options:v,handleChange:e=>x("imapConnectionSecurity",e)}),(0,n.jsx)(Kn,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}})]}),(0,n.jsxs)(so,{children:[(0,n.jsx)(to,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})}),(0,n.jsx)(Kn,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}})]}),(0,n.jsxs)(so,{children:[(0,n.jsx)(to,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})}),(0,n.jsx)(Kn,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}})]})]}),(0,n.jsx)(Qn,{label:e.formatMessage({id:"OfficeHook_Conf_Prompt_Submit"}),loader:u,disabled:u||0===y.length||!j,onClick:()=>{u||(g(!0),k().office.setConfiguration(C).then(()=>window.location.reload()).catch(e=>t(d.y8.actions.error({label:e.errorMsg}))).finally(()=>{s(!1),g(!1),p()}))}})]})})})]})},co=({label:e,initialValue:t,options:i,handleChange:l})=>{const{control:s,watch:a}=(0,I.useForm)({defaultValues:{provider:t},criteriaMode:"all"});return(0,o.useEffect)(()=>{const e=a(e=>{e.provider&&e.provider.value&&l(e.provider.value)});return()=>e.unsubscribe()},[a,l]),(0,n.jsx)(Zn,{label:e,name:"provider",options:i??[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:s,rules:{required:!0}})},uo=u.j.getLazyComponent("ButtonDropdown"),go=u.j.getLazyComponent("Tooltip"),mo=s().div`
|
|
541
550
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
542
551
|
button {
|
|
543
552
|
background: ${e=>e.theme.color.white};
|
|
544
553
|
}
|
|
545
|
-
`,
|
|
554
|
+
`,po=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const o=(0,a.useIntl)(),l=(0,fe.useDispatch)(),s=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ao).finally(i)}}];return(0,n.jsx)(mi,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(mo,{children:(0,n.jsx)(go,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(uo,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},xo=u.j.getLazyComponent("WidgetContactCardDav"),ho=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:l}=e,s=(0,c.jL)(),[a,r]=(0,o.useState)(void 0),[u,g]=(0,o.useState)(void 0),[m,p]=(0,o.useState)(!1),x=(0,c.GV)(e=>d.x0.selectors.selectWidgetLevel(e,l),fe.shallowEqual),[h,f]=(0,o.useState)([]),j=(0,o.useCallback)((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ao),t?window.location.reload():(r(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1})))},[s,l]),y=(0,o.useCallback)(e=>{r(e),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0}))},[s,l]),b=(0,o.useCallback)(e=>s(d.x0.slice.actions.setWidgetState({uniqid:l,loading:e})),[l,s]),C=(0,o.useCallback)(()=>{k().office.getProviderBaseUrls().then(({result:e})=>{g(e.dav_address_book_url)}).finally(()=>b(!1))},[b]),v=(0,o.useCallback)(()=>{k().office.davAddressBookGetContacts({limit:10}).then(({result:e})=>{f(e),p(!0)}).catch(()=>{s(d.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),r(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1}))}).finally(()=>b(!1))},[b,s,l]);return(0,o.useEffect)(()=>{if(!m)return;if(!a)return;if(x!==E.WIDGET_LEVEL_3)return;const e=setInterval(v,4e3);return()=>clearInterval(e)},[a,v,m,x]),(0,o.useEffect)(()=>{b(!0),k().office.isConfigurationValid().then(({result:e})=>y(e)).catch(j).finally(()=>b(!1))},[y,x,C,b,j]),(0,o.useEffect)(()=>{if(a)return x===E.WIDGET_LEVEL_1?(b(!0),void C()):void v()},[a,C,b,v,x]),a&&x&&x!==E.WIDGET_LEVEL_3&&i?(0,n.jsx)(n.Fragment,{children:i(x,u??"")}):(0,n.jsx)(fi,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(po,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(yi,{uniqid:l,children:[a&&(0,n.jsx)(xo,{contactCardList:h}),void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)(ro,{})]})})},fo=u.j.getLazyComponent("ButtonDropdown"),jo=u.j.getLazyComponent("Tooltip"),yo=s().div`
|
|
546
555
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
547
556
|
button {
|
|
548
557
|
background: ${e=>e.theme.color.white};
|
|
549
558
|
}
|
|
550
|
-
`,
|
|
559
|
+
`,bo=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const o=(0,a.useIntl)(),l=(0,fe.useDispatch)(),s=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ao).finally(i)}}];return(0,n.jsx)(mi,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(yo,{children:(0,n.jsx)(jo,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(fo,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},Co=u.j.getLazyComponent("WidgetCalendarCalDav"),vo=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:l}=e,s=(0,c.jL)(),[a,u]=(0,o.useState)(void 0),[g,m]=(0,o.useState)(!1),p=(0,c.GV)(e=>d.x0.selectors.selectWidgetLevel(e,l),fe.shallowEqual),[x,h]=(0,o.useState)(void 0),[f,j]=(0,o.useState)([]),y=(0,o.useCallback)((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ao),t?window.location.reload():(u(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1})))},[s,l]),b=(0,o.useCallback)(e=>{u(e),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0}))},[s,l]),C=(0,o.useCallback)(e=>s(d.x0.slice.actions.setWidgetState({uniqid:l,loading:e})),[l,s]),v=(0,o.useCallback)(()=>{k().office.getProviderBaseUrls().then(({result:e})=>{h(e.dav_calendar_url)}).finally(()=>C(!1))},[C]),w=(0,o.useCallback)(()=>{const e=new Date,t=r.Utils.date.addMonth(new Date(e));k().office.davCalendarGetEvents({limit:10,dateStart:r.Utils.date.formatDateTime(e),dateEnd:r.Utils.date.formatDateTime(t)}).then(({result:e})=>{j(e),m(!0)}).catch(()=>{s(d.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),u(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1}))}).finally(()=>C(!1))},[C,s,l]);return(0,o.useEffect)(()=>{if(!g)return;if(!a)return;if(p!==E.WIDGET_LEVEL_3)return;const e=setInterval(w,6e4);return()=>clearInterval(e)},[a,w,g,p]),(0,o.useEffect)(()=>{C(!0),k().office.isConfigurationValid().then(({result:e})=>b(e)).catch(y)},[y,C,b]),(0,o.useEffect)(()=>{if(a)return p===E.WIDGET_LEVEL_1?(C(!0),void v()):void w()},[a,v,C,w,p]),a&&p&&p!==E.WIDGET_LEVEL_3&&i?(0,n.jsx)(n.Fragment,{children:i(p,x??"")}):(0,n.jsx)(fi,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(bo,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>y(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(yi,{uniqid:l,children:[a&&(0,n.jsx)(Co,{calendarListEvent:f}),void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)(ro,{})]})})},wo=u.j.getLazyComponent("ButtonDropdown"),Lo=u.j.getLazyComponent("Tooltip"),Eo=s().div`
|
|
551
560
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
552
561
|
button {
|
|
553
562
|
background: ${e=>e.theme.color.white};
|
|
554
563
|
}
|
|
555
|
-
`,
|
|
564
|
+
`,ko=s().div`
|
|
556
565
|
font-size: ${e=>e.theme.size.sm+4}px;
|
|
557
566
|
color: ${e=>e.color};
|
|
558
|
-
`,
|
|
567
|
+
`,_o=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const o=(0,a.useIntl)(),l=(0,c.jL)(),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetChipCount(t,e),fe.shallowEqual),r=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(ao).finally(i)}}];return(0,n.jsx)(mi,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(Eo,{children:(0,n.jsx)(Lo,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(wo,{small:!0,smallOpenDirection:"left",options:r,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})}),subHeader:e=>t&&0!==s&&(0,n.jsxs)(ko,{color:e,children:["(",o.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:s}),")"]})})},Wo=u.j.getLazyComponent("WidgetEmailsImap"),So=({widget:e,mode:t,levelFallback:i})=>{const{uniqid:l}=e,s=(0,c.jL)(),[a,r]=(0,o.useState)(void 0),[u,g]=(0,o.useState)(!1),[m,p]=(0,o.useState)([]),[x,h]=(0,o.useState)(void 0),f=(0,c.GV)(t=>d.x0.selectors.selectWidgetLevel(t,e.uniqid),fe.shallowEqual),j=(0,o.useCallback)((e,t)=>{e&&400===e.error&&k().office.setConfiguration(ao),t?window.location.reload():(r(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1})))},[s,l]),y=(0,o.useCallback)(()=>{k().office.imapInboxGetUnreadEmailsCount().then(({result:e})=>{s(d.x0.slice.actions.setWidgetChipCount({uniqid:l,count:e})),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0}))}).catch(j)},[s,l,j]),b=(0,o.useCallback)(e=>s(d.x0.slice.actions.setWidgetState({uniqid:l,loading:e})),[l,s]),C=(0,o.useCallback)(()=>{k().office.getProviderBaseUrls().then(({result:e})=>{h(e.imap_inbox_url)}).finally(()=>b(!1))},[b]),v=(0,o.useCallback)(e=>{r(e),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0}))},[s,l]),w=(0,o.useCallback)(()=>{k().office.imapInboxGetEmails({limit:10}).then(({result:e})=>{p(e),g(!0)}).catch(()=>{s(d.y8.actions.error({label:"PLUGIN_Manager_Connection_Error"})),r(!1),s(d.x0.slice.actions.setWidgetState({uniqid:l,initialized:!0,loading:!1}))}).finally(()=>b(!1))},[b,s,l]);return(0,o.useEffect)(()=>{if(!u)return;if(!a)return;if(f===E.WIDGET_LEVEL_1)return;const e=setInterval(()=>{f===E.WIDGET_LEVEL_2&&y(),f===E.WIDGET_LEVEL_3&&(y(),w())},6e4);return()=>clearInterval(e)},[a,w,u,y,f]),(0,o.useEffect)(()=>{k().office.isConfigurationValid().then(({result:e})=>v(e)).catch(j)},[v,j]),(0,o.useEffect)(()=>{if(a){if(f===E.WIDGET_LEVEL_1)return b(!0),void C();if(f===E.WIDGET_LEVEL_2)return b(!0),y(),void C();b(!0),y(),w()}},[a,f,C,w,b,y,s]),a&&f&&f!==E.WIDGET_LEVEL_3&&i?(0,n.jsx)(n.Fragment,{children:i(f,x??"")}):(0,n.jsx)(fi,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(_o,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(yi,{uniqid:l,children:[void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)(ro,{}),a&&(0,n.jsx)(Wo,{emailList:m})]})})},qo=u.j.getLazyComponent("Html"),Mo=s().div`
|
|
559
568
|
padding: ${e=>e.theme.space.md}px;
|
|
560
569
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
561
|
-
`,
|
|
570
|
+
`,Ao=({uniqid:e})=>{const t=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),fe.shallowEqual),i=(0,l.useTheme)(),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),fe.shallowEqual),a=(0,o.useMemo)(()=>({color:s&&s.color?String(s.color):i.color.black,backgroundColor:s&&s["background-color"]?String(s["background-color"]):i.color.white,fontSize:s&&s["font-size"]?`${s["font-size"]}px`:"24px",fontWeight:s&&s["font-weight"]?String(s["font-weight"]):"medium",textAlign:s&&s["text-align"]?String(s["text-align"]):"left"}),[s,i]),r=(0,o.useMemo)(()=>t&&"string"==typeof t.title&&0!==t.title.length?t.title:void 0,[t]);return r?(0,n.jsx)(Mo,{style:{color:a.color,backgroundColor:a.backgroundColor,fontSize:a.fontSize,fontWeight:a.fontWeight,textAlign:a.textAlign},children:(0,n.jsx)(qo,{as:"span",__html:r})}):(0,n.jsx)(n.Fragment,{})},To=u.j.getLazyComponent("InputText"),Io=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),l=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e)?.title,fe.shallowEqual),{control:s,watch:r}=(0,I.useForm)({defaultValues:{widgetTitle:l},criteriaMode:"all"});return(0,o.useEffect)(()=>{const t=r(t=>{i(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))});return()=>t.unsubscribe()},[r,i,e]),(0,n.jsx)(To,{name:"widgetTitle",control:s,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},zo=u.j.getLazyComponent("Button"),Go=u.j.getLazyComponent("ModalLayout"),Do=u.j.getLazyComponent("ModalContent"),Vo=u.j.getLazyComponent("IconButton"),$o=s().div`
|
|
562
571
|
padding: ${e=>e.theme.space.md}px;
|
|
563
572
|
display: flex;
|
|
564
573
|
flex-direction: row-reverse;
|
|
565
|
-
`,
|
|
574
|
+
`,Fo=s().div`
|
|
566
575
|
flex: 1;
|
|
567
576
|
display: flex;
|
|
568
577
|
flex-direction: row;
|
|
569
578
|
gap: ${e=>e.theme.space.sm}px;
|
|
570
579
|
padding: ${e=>e.theme.space.sm}px;
|
|
571
580
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
572
|
-
`,
|
|
581
|
+
`,Ro=s().div`
|
|
573
582
|
flex: 1;
|
|
574
583
|
display: flex;
|
|
575
584
|
fieldset:first-of-type {
|
|
576
585
|
margin: 0px !important;
|
|
577
586
|
}
|
|
578
|
-
`,
|
|
587
|
+
`,Oo=s().div`
|
|
579
588
|
display: flex;
|
|
580
589
|
gap: ${e=>e.theme.space.sm}px;
|
|
581
|
-
`,
|
|
590
|
+
`,Bo=({uniqid:e,name:t,handleOpenEditor:i})=>{const l=(0,c.jL)(),s=(0,a.useIntl)(),[r,u]=(0,o.useState)(!1),g=(0,o.useCallback)(()=>{l(d.cr.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))},[e,l,t]),m=(0,o.useCallback)(()=>{l(d.x0.slice.actions.flushWidget({uniqid:e}))},[e,l]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Fo,{children:[(0,n.jsx)(Ro,{children:(0,n.jsx)(Io,{uniqid:e})}),(0,n.jsxs)(Oo,{children:[(0,n.jsx)(Vo,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:i??g,title:s.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),(0,n.jsx)(Vo,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>u(!0),title:s.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})})]})]}),r&&(0,n.jsxs)(Go,{enableClickAwayCloseModal:!0,open:r,closeHandler:()=>u(!1),children:[(0,n.jsx)(Do,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,n.jsx)($o,{children:(0,n.jsx)(zo,{label:s.formatMessage({id:"GLOBAL_Confirm"}),onClick:m})})]})]})},Ho=s().div`
|
|
582
591
|
position: absolute;
|
|
583
592
|
inset: 0;
|
|
584
593
|
display: flex;
|
|
585
594
|
align-items: center;
|
|
586
595
|
justify-content: center;
|
|
587
596
|
color: ${e=>e.theme.color.orange};
|
|
588
|
-
`,
|
|
597
|
+
`,Uo=({children:e,name:t})=>{const i=(0,c.GV)(e=>d.qn.selectors.selectHook(e,t)),o=(0,a.useIntl)();return i&&!i.hasLicense?(0,n.jsx)(Ho,{children:o.formatMessage({id:"WIDGET_Missing_License"},{label:"label"in i?i.label:""})}):(0,n.jsx)(n.Fragment,{children:e})},Po=s().div`
|
|
589
598
|
display: flex;
|
|
590
599
|
flex: 1;
|
|
591
600
|
flex-direction: column;
|
|
592
|
-
`,
|
|
601
|
+
`,No=({widget:e,width:t,inplace:i=!1,mode:o="view",onWidgetUpdate:l,cannotDisplayComponent:s,levelFallback:a,dataCy:r})=>{const{name:d}=e;return(0,E.ensureWidgetArticleButtonType)(e)?(0,n.jsx)(ti,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleGalleryType)(e)?(0,n.jsx)(si,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetLuccaAbsenceType)(e)?(0,n.jsx)(Po,{children:(0,n.jsx)(Uo,{name:"LuccaAbsenceHook",children:(0,n.jsx)(wi,{uniqid:e.uniqid})})}):(0,E.ensureWidgetArticleAttachmentType)(e)?(0,n.jsx)(Kt,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleImageType)(e)?(0,n.jsx)(Mi,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleSliderType)(e)?(0,n.jsx)(Vi,{widget:e,inplace:i,mode:o,width:t??800}):(0,E.ensureWidgetArticleTitleType)(e)?(0,n.jsx)(Qi,{widget:e,inplace:i,mode:o,dataCy:r}):(0,E.ensureWidgetArticleTextType)(e)?(0,n.jsx)(Ui,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetExcelDatasourceTableType)(e)?(0,n.jsxs)(Po,{children:[(0,n.jsx)(Ao,{uniqid:e.uniqid}),(0,n.jsx)(An,{...e.content,uniqid:e.uniqid,mode:o})]}):(0,E.ensureWidgetDatasourceTableType)(e)?(0,n.jsxs)(Po,{children:[(0,n.jsx)(Ao,{uniqid:e.uniqid}),(0,n.jsx)(_n,{...e.content,uniqid:e.uniqid,mode:o})]}):(0,E.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?(0,n.jsxs)(Po,{children:["edit"===o?(0,n.jsx)(Bo,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(Ao,{uniqid:e.uniqid}),(0,n.jsx)(Cn,{widget:e,inplace:i,mode:o,onWidgetUpdate:l})]}):(0,E.ensureWidgetPresenceType)(e)?(0,n.jsxs)(Po,{children:["edit"===o?(0,n.jsx)(Bo,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(Ao,{uniqid:e.uniqid}),(0,n.jsx)(Rn,{widget:e,inplace:i,mode:o})]}):(0,E.ensureWidgetQuickSurveyType)(e)?(0,n.jsxs)(Po,{children:["edit"===o?(0,n.jsx)(Bo,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(Ao,{uniqid:e.uniqid}),(0,n.jsx)(Nn,{widget:e,inplace:i,mode:o})]}):(0,E.ensureWidgetCalendarCalDavType)(e)?(0,n.jsx)(Po,{children:(0,n.jsx)(Uo,{name:"OfficeHook",children:(0,n.jsx)(vo,{widget:e,inplace:i,mode:o,levelFallback:a})})}):(0,E.ensureWidgetContactCardDavType)(e)?(0,n.jsx)(Po,{children:(0,n.jsx)(Uo,{name:"OfficeHook",children:(0,n.jsx)(ho,{widget:e,inplace:i,mode:o,levelFallback:a})})}):(0,E.ensureWidgetEmailsImapType)(e)?(0,n.jsx)(Po,{children:(0,n.jsx)(Uo,{name:"OfficeHook",children:(0,n.jsx)(So,{widget:e,inplace:i,mode:o,levelFallback:a})})}):s?(0,n.jsx)(n.Fragment,{children:s(d)}):(0,n.jsxs)(n.Fragment,{children:["cannot display widget (",d,")"]})},Yo=s().div`
|
|
593
602
|
position: absolute;
|
|
594
603
|
inset: 0;
|
|
595
604
|
opacity: ${e=>e.opacity};
|
|
596
605
|
background-color: ${e=>e.backgroundColor};
|
|
597
606
|
pointer-events: ${e=>e.pointerEvents};
|
|
598
|
-
`,
|
|
607
|
+
`,Jo=u.j.getLazyComponent("DoubleClick"),Qo=({uniqid:e,mode:t})=>{const i=(0,c.GV)(t=>t.widgets.ids[e].widget.layers,fe.shallowEqual);return(0,n.jsx)(n.Fragment,{children:i?.map((e,t)=>(0,n.jsx)(Ko,{uniqid:e,mode:"edit"},t))})},Ko=({uniqid:e,mode:t})=>{const i=(0,c.GV)(t=>t.widgets.layers[e]);return"view"===t?(0,n.jsx)(Yo,{opacity:1,backgroundColor:"transparent",pointerEvents:"none",children:i.widgets.map((e,t)=>(0,n.jsx)(Xo,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"},t))}):(0,n.jsx)(Yo,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all",children:i.widgets.map((e,t)=>(0,n.jsx)(Xo,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"},t))})},Xo=({uniqid:e,layerId:t,mode:i})=>{const o=(0,c.jL)(),l=(0,c.GV)(t=>t.widgets.ids[e],fe.shallowEqual),s=(0,c.GV)(e=>e.widgets.layers[t]);return l&&s&&s.position?"view"===i?(0,n.jsx)("div",{style:{position:"absolute",top:s.position.y,left:s.position.x},children:(0,n.jsx)(ul,{uniqid:e,widget:l,mode:i,inplace:!0,context:"article"})}):(0,n.jsx)(Zo,{position:{x:s.position.x,y:s.position.y},onMouseUp:e=>{(s.position&&s.position.x!==e.x||s.position&&s.position.y!==e.y)&&(e=>{o(d.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)},children:(0,n.jsx)(Jo,{onDoubleTap:()=>((e,t)=>{o(d.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(l.widget.uniqid,l.widget.name),children:(0,n.jsx)(ul,{uniqid:e,widget:l,mode:i,inplace:!0,context:"article"})})}):(0,n.jsx)(n.Fragment,{})},Zo=({position:e,children:t,onMouseUp:i})=>{const[l,s]=(0,o.useState)(!1),[a,r]=(0,o.useState)({x:0,y:0}),[d,c]=(0,o.useState)({x:0,y:0}),[u,g]=(0,o.useState)({x:e.x,y:e.y}),m=(0,o.useRef)(null),p=(0,o.useCallback)(e=>{s(!0),m.current&&(r({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),c({x:u.x,y:u.y}))},[u.x,u.y]),x=(0,o.useCallback)(e=>{if(l&&m.current){const t=d.x+(e.clientX-a.x),i=d.y+(e.clientY-a.y);g({x:t,y:i})}},[a.x,a.y,l,d.x,d.y]),h=(0,o.useCallback)(()=>{s(!1),i({x:u.x,y:u.y})},[u.x,u.y,i]);return(0,o.useEffect)(()=>(document.addEventListener("mousemove",x),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",h)}),[x,h]),(0,n.jsx)("div",{style:{position:"absolute",top:u.y,left:u.x},ref:m,onMouseDown:p,children:t})},el=u.j.getLazyComponent("Loader"),tl=({uniqid:e,inplace:t})=>{const i=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e));return i?.loading?(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},children:(0,n.jsx)(el,{})}):i?.hover?(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):(0,n.jsx)(n.Fragment,{})},il=u.j.getLazyComponent("Html"),nl=s().button`
|
|
599
608
|
position: absolute;
|
|
600
609
|
inset: 0;
|
|
601
610
|
display: flex;
|
|
@@ -613,10 +622,10 @@
|
|
|
613
622
|
}
|
|
614
623
|
|
|
615
624
|
${(0,r.DashedFocusBorder)()}
|
|
616
|
-
`,
|
|
625
|
+
`,ol=({uniqid:e,name:t})=>{const i=(0,c.jL)(),l=(0,a.useIntl)(),s=(0,o.useCallback)(()=>{i(d.cr.slice.actions.flushAllEditor()),i(d.cr.slice.actions.registerEditor({uniqid:e,name:t}))},[i,e,t]),r=d.x0.definition(t);return(0,n.jsx)(nl,{onClick:s,children:(0,n.jsx)(il,{__html:`${l.formatMessage({id:"WIDGET_Set_Widget"})} <b>${l.formatMessage({id:r.label})}</b>`})})},ll=s().div`
|
|
617
626
|
display: flex;
|
|
618
627
|
flex-direction: column;
|
|
619
|
-
`,
|
|
628
|
+
`,sl=({uniqid:e,onClick:t,children:i})=>{const s=(0,l.useTheme)(),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),fe.shallowEqual),r=(0,o.useMemo)(()=>({color:a&&a.color?String(a.color):s.color.black,backgroundColor:a&&a["background-color"]?String(a["background-color"]):s.color.white,borderRadius:a&&a["border-radius"]?`${a["border-radius"]}px`:"0px",borderColor:a["border-color"]?String(a["border-color"]):s.color.black,borderWidth:a["border-width"]?`${a["border-width"]}px`:"0px",borderStyle:a["border-style"]?String(a["border-style"]):"none"}),[a,s]);return(0,n.jsx)(ll,{onClick:t,style:{color:r.color,borderColor:r.borderColor,borderStyle:r.borderStyle,borderRadius:r.borderRadius,borderWidth:r.borderWidth,backgroundColor:r.backgroundColor,overflow:Number(r.borderRadius)>0?"hidden":"initial"},children:i})},al=u.j.getLazyComponent("WidgetIcon"),rl=s().a`
|
|
620
629
|
position: absolute;
|
|
621
630
|
top: 0;
|
|
622
631
|
right: 0;
|
|
@@ -632,19 +641,45 @@
|
|
|
632
641
|
background-color: rgba(0, 0, 0, 0.1);
|
|
633
642
|
color: ${e=>e.color?e.color:e.theme.color.black};
|
|
634
643
|
}
|
|
635
|
-
`,
|
|
644
|
+
`,dl=({uniqid:e,name:t,url:i,level:o})=>{const l=d.x0.definition(t),s=(0,c.GV)(t=>2===o?d.x0.selectors.selectWidgetChipCount(t,e):0,fe.shallowEqual),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),fe.shallowEqual);return(0,n.jsx)(rl,{href:i,target:"_blank",color:String(a.color)??void 0,rel:"noreferrer","aria-label":l.label,children:(0,n.jsx)(al,{count:s,img:l.img,label:l.label,maxValue:999})})},cl=({uniqid:e,widgetObject:t,widget:i,inplace:l=!0,mode:s,width:a,context:r,onWidgetUpdate:u,cannotDisplayComponent:g,dataCy:m})=>{const p=(0,c.jL)(),x=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e)),h=(0,c.GV)(t=>t.widgets.editableMap[e],fe.shallowEqual),f=(0,c.GV)(e=>e.widgets.currentEditableWidgetId,fe.shallowEqual),j=(0,c.GV)(t=>t.widgets.currentEditableWidgetId===e,fe.shallowEqual),{isComponentVisible:y,setIsComponentVisible:b}=(0,Bt.xv)(!1);(0,o.useEffect)(()=>{t&&p(d.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))},[]),(0,o.useEffect)(()=>{i&&p(d.x0.slice.actions.registerWidget({uniqid:e,widget:i,context:r}))},[]),(0,o.useEffect)(()=>{y||e===f&&p(d.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))},[y]),(0,o.useEffect)(()=>{y!==j&&b(j)},[j]);const C=(0,o.useCallback)(()=>{if(void 0===x||"view"===s)return;p(d.cr.slice.actions.flushAllEditor());const{widget:e}=x;p(d.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))},[p,s,x]);return void 0===x?(0,n.jsx)(n.Fragment,{children:"This widget cannot be displayed"}):l&&"view"!==s?(0,n.jsxs)(sl,{uniqid:e,onClick:()=>{b(!0),h&&(p(d.x0.slice.actions.setEditableIndex({index:h.index})),p(d.x0.slice.actions.setEditableWidgetId({uniqid:e})))},children:[(0,n.jsx)(No,{dataCy:m,width:a,widget:{...x.widget,...x.title&&{title:x.title}},inplace:l,mode:s,levelFallback:(e,t)=>e<=2&&(0,n.jsx)(dl,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,n.jsx)(Qo,{uniqid:e,mode:s}),(0,n.jsx)(tl,{name:x.widget.name,uniqid:x.widget.uniqid,inplace:l})]}):(0,n.jsxs)(sl,{uniqid:e,onClick:C,children:[(0,n.jsx)(No,{dataCy:m,widget:{...x.widget,...x.title&&{title:x.title}},inplace:l,mode:s,width:a,onWidgetUpdate:u,cannotDisplayComponent:g,levelFallback:(e,t)=>e<=2&&(0,n.jsx)(dl,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,n.jsx)(Qo,{uniqid:e,mode:s}),"edit"===s&&(0,n.jsx)(ol,{uniqid:e,name:i.widget.name}),(0,n.jsx)(tl,{name:x.widget.name,uniqid:x.widget.uniqid,inplace:l})]})},ul=cl,gl=s().div`
|
|
636
645
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
637
646
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
638
647
|
background-color: ${e=>e.theme.color.white};
|
|
639
648
|
overflow: hidden;
|
|
640
|
-
`,
|
|
649
|
+
`,ml=u.j.getLazyComponent("Message"),pl=({widgets:e})=>{const t=(0,a.useIntl)(),i=(0,c.GV)(d.x0.selectors.selectFlushedWidgets,fe.shallowEqual);return(0,n.jsx)(n.Fragment,{children:e.filter(e=>!i.includes(e.widget.uniqid)).map(e=>e&&e.widget&&(0,n.jsx)(gl,{children:(0,n.jsx)(ul,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>(0,n.jsx)(ml,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},xl=u.j.getLazyComponent("Message"),hl=e=>{const t=(0,a.useIntl)(),{widgets:i,comment:o,inplace:l,mode:s,handleWidgetUpdate:r}=e,u=(0,c.GV)(d.x0.selectors.selectFlushedWidgets,fe.shallowEqual);return(0,n.jsx)(n.Fragment,{children:i.filter(e=>!u.includes(e.widget.uniqid)).map(e=>e&&(0,n.jsx)(gl,{children:(0,n.jsx)(ul,{uniqid:e.widget.uniqid,widgetObject:o,widget:e,inplace:l,mode:s,onWidgetUpdate:r,cannotDisplayComponent:e=>(0,n.jsx)(xl,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},fl=u.j.getLazyComponent("JRCCommentsBloc"),jl=s().div`
|
|
641
650
|
display: flex;
|
|
642
651
|
flex-direction: column;
|
|
643
652
|
gap: 4px;
|
|
644
653
|
flex: 1;
|
|
645
654
|
width: 100%;
|
|
646
655
|
margin-top: 10px;
|
|
647
|
-
`,
|
|
656
|
+
`,yl=({articleId:e,variant:t="inline",canComment:i,commentType:s="comment",socialQuestion:r,articleUri:u})=>{const g=(0,a.useIntl)(),m=(0,l.useTheme)(),p=(0,c.jL)(),[x,h]=(0,o.useState)(),[f,j]=(0,o.useState)(!1),[y,b]=(0,o.useState)([]),[C,v]=(0,o.useState)(!1),w=(0,c.GV)(d.xJ.selectors.get),L=(0,c.GV)(d.x0.selectors.selectWidgets),E=(0,c.GV)(d.sU.selectors.selectTinyMCECommonOptions),_=(0,c.GV)(d.sU.selectors.selectTinyMCEExtendedOptions),W=(0,c.GV)(d.Kx.selectors.selectAll),S=(0,c.GV)(d.OD.selectors.selectPlatformConfig),q=(0,c.GV)(t=>d.Mw.selectors.commentList(t,e)),M=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"DriveHook")),A=(0,c.GV)(e=>d.lg.selectors.selectById(e,"FileBankHook")),T=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"WidgetHook")),[I,z]=(0,o.useState)(r),[G,D]=(0,o.useState)(null),{open:V,onInsert:$,close:F,ext:R,isActive:O}=Rt();(0,me.A)(e),((e,t)=>{const i=(0,c.jL)(),n=(0,o.useMemo)(()=>pe.A,[]),l=(0,o.useMemo)(()=>d.Mw.getCommentsLikeRTHandlers(i,e,t),[i,e,t]);(0,o.useEffect)(()=>(l.forEach(e=>{n.onMessage(e.namespace,e.function,e.handler)}),()=>{l.forEach(e=>{n.offMessage(e.namespace,e.function,e.handler)})}),[l,n])})(q.map(e=>e.id),e);const B=(0,o.useCallback)(e=>{p(d.y8.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})}))},[p,g]),H=()=>{p(d.Mw.actions.fetchComments({idArticle:e})),U()},U=(0,o.useCallback)(()=>{x||C||(v(!0),k().network.token().then(e=>{h(e.result),v(!1),p(d.x0.slice.actions.setToken({token:e.result}))}).catch(e=>{B(e.errorMsg)}))},[B,x,C,p]),P=(0,o.useCallback)(async t=>{if(x){j(!0);const i=Object.keys(L).map(e=>y?.some(t=>t.widget.uniqid===e)?L[e]:null).filter(e=>null!==e);try{await k().article.addComment({...t,widgets:i,token:x,idArticle:e,type:s}).then(()=>{b([])}),U()}catch(e){throw B(e.errorMsg),e}finally{j(!1)}}},[e,s,U,B,x,L,y]);return(0,o.useEffect)(()=>{U()},[U]),(0,o.useEffect)(()=>{p(d.Mw.actions.fetchComments({idArticle:e}))},[e,p]),(0,o.useEffect)(()=>{q&&q.forEach(e=>{e._widgets?.forEach(t=>{p(d.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),p(d.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))})})},[q,p]),(0,n.jsxs)(n.Fragment,{children:[E&&_&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(jl,{children:[(0,n.jsx)(fl,{canComment:i,loading:f,token:x,comments:q,onComment:P,onCommentUpdate:async t=>{const i=q.find(e=>e.id===t.idComment);if(i)return k().article.updateComment({idComment:t.idComment,description:t.description??i.description??void 0,token:t.token,widgets:t.widgets}).then(()=>{p(d.Mw.actions.fetchComments({idArticle:e})),U()}).catch(e=>{B(e.errorMsg)})},onCommentDelete:async t=>{p(d.Mw.actions.deleteComment({idComment:t,idArticle:e}))},isWidgetActive:!(!T?.isActive||!T?.autorize?.includes("comment")),canCreateWidget:!!(T?.isActive&&T?.create&&T?.autorize?.includes("comment")),widgetListComponent:(0,n.jsx)(Vt,{mode:"comment",namespace:"comment",onChange:e=>{b([e]),p(d.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e,context:"comment"})),h(void 0),U()},view:"edit"}),newWidgetsWrapperComponent:(0,n.jsx)(pl,{widgets:y}),existingWidgetsWrapperComponent:(e,t,i,o=!0)=>(0,n.jsx)(hl,{comment:e,widgets:t,mode:i,inplace:o,handleWidgetUpdate:H,handleWidgetRemove:U}),currentUser:w,tinyMCEConfig:{commonOptions:{...E,toolbar:_.commentsToolbar},mentionsQueries:(0,Ot.X)(W,m,B)},onError:B,highlightFields:S.userHighlightFields,userAccountStatus:S.userAccountStatus,userModel:W.find(e=>"user"===e.type),onGetHashError:e=>p(d.y8.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...A&&M?["fileBank"]:[],...d.qn.utils.buildDrivesArrayFromObject(M?.drives)],variant:t,handlers:{drive:k().drive,filebank:k().filebank,file:k().file,user:k().user,global:k().global,questionAnswer:k().questionAnswer},socialQuestion:I?{...I,onSelectResponse:e=>{z({...I,responseId:e,isResolved:!0})},onUnselectResponse:()=>{z({...I,responseId:void 0,isResolved:!1})}}:void 0,articleId:e,additionalExtensions:[R],onReport:t=>D({articleId:e,commentUri:t,articleUri:u})}),(0,n.jsx)(Et,{})]})}),O&&(0,n.jsx)(Oi,{onInsert:$,open:V,close:F}),G&&(0,n.jsx)(Z,{onClose:()=>D(null),...G})]})},bl=s().li`
|
|
657
|
+
list-style: none;
|
|
658
|
+
`,Cl=s().a`
|
|
659
|
+
display: flex;
|
|
660
|
+
align-items: center;
|
|
661
|
+
gap: ${({theme:e})=>e.space.sm}px;
|
|
662
|
+
text-decoration: none;
|
|
663
|
+
color: ${({theme:e})=>e.font.color};
|
|
664
|
+
padding: ${({theme:e})=>e.space.sm}px ${({theme:e})=>e.space.md}px ${({theme:e})=>e.space.sm}px
|
|
665
|
+
${({theme:e})=>e.space.xs}px;
|
|
666
|
+
border-radius: ${({theme:e})=>e.size.sm}px;
|
|
667
|
+
|
|
668
|
+
&:hover {
|
|
669
|
+
text-decoration: none;
|
|
670
|
+
background-color: ${({theme:e})=>e.color.grey1};
|
|
671
|
+
color: ${({theme:e})=>e.font.color};
|
|
672
|
+
}
|
|
673
|
+
`,vl=u.j.getLazyComponent("Icon"),wl=u.j.getLazyComponent("FlexBox"),Ll=u.j.getLazyComponent("Typography"),El=u.j.getLazyComponent("DropDown"),kl=()=>{const e=(0,l.useTheme)(),t=(0,a.useIntl)(),i=(0,c.GV)(e=>d.lg.selectors.selectById(e,"AnimatedMeetingHook")),o=(0,c.GV)(e=>d.lg.selectors.selectById(e,"calendar")),s=(0,c.GV)(e=>d.lg.selectors.selectById(e,"SurveyDateHook"));return o?(0,n.jsxs)(wl,{y:"center",children:[(0,n.jsx)(vl,{name:"icon-"+o.icon,variant:"circle",color:o.color,size:40}),(0,n.jsx)(Ll,{variant:"h1",size:"xl",weight:"medium",children:o.label}),(s||i)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ll,{size:"xl",color:"grey4",children:"/"}),(0,n.jsx)(El,{withBorder:!0,borderColor:"grey3",trigger:(0,n.jsxs)(wl,{y:"center",gap:e.space.xs,children:[(0,n.jsx)(Ll,{size:"xl",color:"grey4",children:t.formatMessage({id:"CALENDAR_Agenda"})}),(0,n.jsx)(vl,{name:"icon-chevron-down",color:"grey4",size:16})]}),dropdown:()=>(0,n.jsxs)(wl,{direction:"column",gap:e.space.sm,as:"ul",children:[s&&(0,n.jsx)(bl,{children:(0,n.jsxs)(Cl,{href:s.url,children:[(0,n.jsx)(vl,{name:"icon-"+s.icon,size:25,variant:"circle",color:s.color}),(0,n.jsx)(Ll,{size:"l",children:s.label})]})}),i&&(0,n.jsx)(bl,{children:(0,n.jsxs)(Cl,{href:i.url,children:[(0,n.jsx)(vl,{name:"icon-"+i.icon,size:25,variant:"circle",color:i.color}),(0,n.jsx)(Ll,{size:"l",children:i.label})]})})]})})]})]}):null},_l=u.j.getLazyComponent("Calendar"),Wl=s().div`
|
|
674
|
+
margin-bottom: ${({theme:e})=>e.space.md}px;
|
|
675
|
+
`,Sl=s().div`
|
|
676
|
+
height: 54px;
|
|
677
|
+
display: flex;
|
|
678
|
+
align-items: center;
|
|
679
|
+
justify-content: space-between;
|
|
680
|
+
${({view:e,theme:t})=>"list"===e&&`border-bottom: 1px solid ${t.color.grey2};`}
|
|
681
|
+
padding: 0 ${({theme:e})=>e.space.md}px;
|
|
682
|
+
`,ql=[{label:"CALENDAR_dayGridMonth",value:"dayGridMonth"},{label:"CALENDAR_timeGridWeek",value:"timeGridWeek"},{label:"CALENDAR_timeGridDay",value:"timeGridDay"},{label:"CALENDAR_listWeek",value:"list"}],Ml=({views:e=["dayGridMonth","list","timeGridDay","timeGridWeek"],mode:t="full",withPadding:i=!0,withHeader:l=!0,withToolbar:s=!0,fluid:u,children:g})=>{const m=(0,a.useIntl)(),p=(0,c.jL)(),x=(0,ge.useNavigate)(),[h,f]=(0,o.useState)(),j=(0,r.useAbortController)(),[y,b]=(0,o.useState)(!1),[C,v]=(0,o.useState)(),[w,L]=(0,o.useState)(),[E]=(0,o.useState)(new URLSearchParams(window.location.search).get("types")?.split(",").filter(e=>["socialEvent","meeting","animatedMeeting","boardCard"].includes(e))??[]),[_,W]=(0,o.useState)(null),[S,q]=(0,o.useState)(!1),[M,A]=(0,o.useState)(),T=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"calendarHook"))?.defaultView,I=(0,o.useMemo)(()=>{const e=new URLSearchParams(window.location.search).get("view");switch(e){case"dayGridMonth":case"timeGridDay":case"timeGridWeek":case"list":return e;default:return"calendar"===T?"dayGridMonth":"list"}},[T]),z=(0,o.useMemo)(()=>ql.filter(t=>e.includes(t.value)).map(e=>({label:m.formatMessage({id:e.label}),value:e.value})),[e,m]),[G,D]=(0,o.useState)(z.find(e=>e.value===I)??z[0]),V=(0,o.useCallback)(e=>{const t=new URLSearchParams(window.location.search);void 0!==e.types&&(e.types.length>0?t.set("types",e.types.join(",")):t.delete("types")),void 0!==e.view&&(e.view?t.set("view",e.view):t.delete("view")),x(`?${t.toString()}`,{replace:!0})},[x]),$=(0,o.useCallback)((e,t)=>{e&&Promise.all([k().calendar.listEvents({dateStart:r.Utils.date.formatDate(e.start),dateEnd:r.Utils.date.formatDate(e.end),statuses:["subscribed","unanswered"],types:E},{format:"raw-view",signal:j.signal}),t?k().article.get({uri:t,format:"raw-view"},{formatExtension:["socialEventRecord"]}):null]).then(([e,i])=>{A([...e.result,...i&&!e.result.some(e=>e.uri===t)?[i.result]:[]])}).catch(e=>{j.signal.aborted||p(d.y8.actions.error({label:e.errorMsg??m.formatMessage({id:"GLOBAL_Error"})}))}).finally(()=>{b(!1)})},[j,p,E,m]),F=(0,o.useCallback)(e=>{p(d.y8.actions.error({label:e??m.formatMessage({id:"GLOBAL_Error"})}))},[p,m]),R=(0,o.useCallback)(e=>{p(d.y8.actions.success({label:e}))},[p]),O=(0,o.useCallback)(e=>{D(e),V({view:e.value})},[V]),B=(0,o.useCallback)((e,t)=>{b(!0),v({start:e,end:t}),$({start:e,end:t})},[$]),[H,U]=(0,o.useState)(null);return(0,n.jsxs)(o.Fragment,{children:[g&&g({dates:C,eventToUpdate:_,creationType:H,isExportModalOpen:S,setEventToUpdate:W,fetchEvents:$,setCreationType:U,setExportModalOpen:q}),(l||s)&&(0,n.jsxs)(Sl,{view:G.value,children:[l&&(0,n.jsx)(kl,{}),s&&!y&&(0,n.jsx)(ue,{label:h,isLoading:y,view:G,calendarApi:w,viewsOptions:z,navigateWithQuery:V,setView:D,setCreationType:U,setExportModalOpen:q})]}),(0,n.jsx)(_l,{fluid:u,mode:t,fullScreen:!0,withPadding:i,events:M,loading:y,handler:{global:k().global,calendar:k().calendar,article:k().article},defaultView:G.value,eventModalExtraComponent:({id:e,uri:t,_right:i})=>(0,n.jsx)(Wl,{children:(0,n.jsx)(yl,{articleId:e,articleUri:t,canComment:i.comment})}),deportedToolbar:{onChangeLabel:f,onCalendarApiInit:L,view:G},onChangeDates:B,onError:F,onSuccess:R,onChangeView:O,onDeleteEvent:()=>{b(!0),$(C),p(d.y8.actions.success({label:m.formatMessage({id:"GLOBAL_Successfully_Deleted"})}))},onClickUpdateEvent:W})]})},Al=()=>(0,n.jsx)(n.Fragment,{}),Tl=u.j.getLazyComponent("Container"),Il=()=>(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(n.Fragment,{}),children:(0,n.jsx)(Tl,{backgroundColor:"white",mode:"fluid",flexDirection:"column",children:(0,n.jsx)(ge.Outlet,{})})});var zl=i(910);const Gl=()=>{const[e,t]=(0,o.useState)(),i=(0,a.useIntl)(),n=(0,o.useMemo)(()=>J.hooks?.MagicWandHook?.isActive&&J.hooks?.MagicWandHook?.menuItems&&J.hooks.MagicWandHook.menuItems.length,[]),l=(0,o.useCallback)(e=>{t({...e,reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}})},[]),s=(0,o.useCallback)((e,t)=>new Promise((i,n)=>{l({reject:n,resolve:i,text:e,capability:t})}),[l]),d=(0,o.useMemo)(()=>({develop:e=>s(e,"develop"),summarize:e=>s(e,"summarize"),tldr:e=>s(e,"tldr"),en:e=>s(e,"en"),es:e=>s(e,"es"),formal:e=>s(e,"formal"),funny:e=>s(e,"funny")}),[s]);return{query:e,ext:(0,o.useMemo)(()=>r.JTinyMCEExtensionsBuilders.jia(d,i),[i,d]),isActive:n}},Dl=u.j.getLazyComponent("InputTinyMCE"),Vl=e=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,l.useTheme)(),r=(0,c.GV)(d.Kx.selectors.selectAll),{query:u,ext:g,isActive:m}=Gl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=Rt(),y=(0,o.useMemo)(()=>[...j?[f]:[],...m?[g]:[]],[g,f,m,j]),b=(0,o.useCallback)(e=>{i(d.y8.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),C=(0,o.useMemo)(()=>(0,Ot.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>zl.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(Dl,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(T,{query:u}),j&&(0,n.jsx)(Oi,{onInsert:x,open:p,close:h})]})},$l=u.j.getLazyComponent("InputTinyMCERaw"),Fl=e=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,l.useTheme)(),r=(0,c.GV)(d.Kx.selectors.selectAll),{query:u,ext:g,isActive:m}=Gl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=Rt(),y=(0,o.useMemo)(()=>[...j?[f]:[],...m?[g]:[]],[g,f,m,j]),b=(0,o.useCallback)(e=>{i(d.y8.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),C=(0,o.useMemo)(()=>(0,Ot.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>zl.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)($l,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(T,{query:u}),j&&(0,n.jsx)(Oi,{onInsert:x,open:p,close:h})]})},Rl=u.j.getLazyComponent("InputAudience"),Ol=u.j.getLazyComponent("Message"),Bl=u.j.getLazyComponent("Modal"),Hl=({open:e,closeHandler:t,title:i,control:o,warningMessage:l,onSubmit:s,name:r="publishTo"})=>{const d=(0,a.useIntl)();return(0,n.jsxs)(Bl,{open:e,closeHandler:t,title:i??d.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),s()}}],children:[(0,n.jsx)(Ol,{variant:"warning",message:l??d.formatMessage({id:"FORM_Audience_Empty"})}),(0,n.jsx)(Rl,{asyncPromise:e=>k().audience.autocomplete(e),searchable:!0,control:o,multiple:!0,placeholder:d.formatMessage({id:"GLOBAL_Audience"}),name:r})]})},Ul=u.j.getLazyComponent("ModalForm"),Pl=u.j.getLazyComponent("InputDateTime"),Nl=u.j.getLazyComponent("InputTextRaw"),Yl=u.j.getLazyComponent("FlexBox"),Jl=u.j.getLazyComponent("IconButton"),Ql=s().div`
|
|
648
683
|
margin-bottom: ${({theme:e})=>e.space.xs}px;
|
|
649
|
-
`,
|
|
650
|
-
//# sourceMappingURL=
|
|
684
|
+
`,Kl=({open:e,closeHandler:t,onSubmit:i})=>{const l=(0,a.useIntl)(),s=(0,c.jL)(),u=(0,c.GV)(d.OD.selectors.selectUrlBase),g=(0,I.useForm)({defaultValues:async()=>{const e=new Date;return{scheduleDate:`${r.Utils.date.formatDate(e)} ${(0,E.padStartTwoDigits)(e.getHours())}:${(0,E.padStartTwoDigits)(e.getMinutes())}`,permalinkId:(0,he.A)()}}}),m=g.handleSubmit(e=>{i(e)});(0,o.useEffect)(()=>{e&&g.reset()},[g,e]);const p=(0,I.useWatch)({control:g.control,name:"permalinkId"}),x=(0,o.useMemo)(()=>`${u}permalink/${p}`,[p,u]);return(0,n.jsxs)(Ul,{open:e,closeHandler:t,onSubmit:m,maxHeight:"620px",title:l.formatMessage({id:"GLOBAL_Schedule"}),buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Schedule"}),color:"valid",clickHandler:()=>{t(),m()},disabled:!g.watch("scheduleDate")}],children:[(0,n.jsx)(Pl,{rules:{required:!0},label:"GLOBAL_Scheduled_Date",control:g.control,name:"scheduleDate"}),(0,n.jsxs)(Yl,{y:"flex-end",children:[(0,n.jsx)(Nl,{label:l.formatMessage({id:"GLOBAL_Permalink"}),value:x,onChange:()=>null,margin:"0",width:"100%"}),(0,n.jsx)(Ql,{children:(0,n.jsx)(Jl,{srOnly:"GLOBAL_Copy_Link",icon:"icon-copy",colorVariant:"primary",onClick:()=>{navigator.clipboard.writeText(x).then(()=>{s(d.y8.actions.success({label:l.formatMessage({id:"CLIPBOARD_Copy_Success"})}))})}})})]})]})},Xl=u.j.getLazyComponent("Container"),Zl=u.j.getLazyComponent("AppColumn"),es=u.j.getLazyComponent("MainColumn");function ts({extensionRoute:e,routes:t,description:i,mode:l="center",mainColumnProps:s}){const r=(0,a.useIntl)(),{pathname:d}=(0,ge.useLocation)(),c=(0,o.useMemo)(()=>Object.values(t),[t]),[u,g]=(0,o.useState)(c?.[0]?.key),m=c.map(t=>({...t,label:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0}));return(0,o.useEffect)(()=>{const t=c.find(t=>`/ng/rr/${e}/${t.path}`===d||t.paths?.reduce((t,i)=>{const n=`/ng/rr/${e}/${i}`,o=null!==(0,ge.matchPath)(n,d);return t||o},!1));t&&g(t.key)},[d,c,e]),(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(n.Fragment,{}),children:(0,n.jsxs)(Xl,{mode:l,children:[(0,n.jsx)(Zl,{mode:l,description:i,tabs:m,activeTab:u||""}),(0,n.jsx)(es,{mode:l,flex:!0,...s,children:(0,n.jsx)(ge.Outlet,{})})]})})}}}]);
|
|
685
|
+
//# sourceMappingURL=628.73265f7fde405adcd2c9.chunk.js.map
|